Compare commits

..

3 commits
0.25.1 ... main

Author SHA1 Message Date
Benjamin Nussbaum
c94dd89361 fix: enable trmnl-liquid renderer in OSS catalog
Some checks are pending
tests / ci (push) Waiting to run
2026-01-14 23:13:49 +01:00
Benjamin Nussbaum
de1a390574 feat: add liquid filter qr_code 2026-01-14 23:13:49 +01:00
Benjamin Nussbaum
6bc672c3c4 chore: update dependencies 2026-01-14 23:13:49 +01:00
6 changed files with 391 additions and 69 deletions

3
.gitignore vendored
View file

@ -34,3 +34,6 @@ yarn-error.log
/boost.json
/.gemini
/GEMINI.md
/.claude
/AGENTS.md
/opencode.json

View file

@ -7,6 +7,7 @@ use Illuminate\Support\Str;
use Keepsuit\Liquid\Filters\FiltersProvider;
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Exception\CommonMarkException;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
/**
* String, Markup, and HTML filters for Liquid templates
@ -58,4 +59,50 @@ class StringMarkup extends FiltersProvider
{
return strip_tags($html);
}
/**
* Generate a QR code as SVG from the input text
*
* @param string $text The text to encode in the QR code
* @param int|null $moduleSize Optional module size (defaults to 11, which equals 319px)
* @param string|null $errorCorrection Optional error correction level: 'l', 'm', 'q', 'h' (defaults to 'm')
* @return string The SVG QR code
*/
public function qr_code(string $text, ?int $moduleSize = null, ?string $errorCorrection = null): string
{
// Default module_size is 11
// Size calculation: (21 modules for QR code + 4 modules margin on each side * 2) * module_size
// = (21 + 8) * module_size = 29 * module_size
$moduleSize = $moduleSize ?? 11;
$size = 29 * $moduleSize;
$qrCode = QrCode::format('svg')
->size($size);
// Set error correction level if provided
if ($errorCorrection !== null) {
$qrCode->errorCorrection($errorCorrection);
}
$svg = (string) $qrCode->generate($text);
// Add class="qr-code" to the SVG element
// The SVG may start with <?xml...> and then <svg, so we need to find the <svg tag
// Match <svg followed by whitespace or attributes, and insert class before the first attribute or closing >
if (preg_match('/<svg\s+([^>]*)>/', $svg, $matches)) {
$attributes = $matches[1];
// Check if class already exists
if (mb_strpos($attributes, 'class=') === false) {
$svg = preg_replace('/<svg\s+([^>]*)>/', '<svg class="qr-code" $1>', $svg, 1);
} else {
// If class exists, add qr-code to it
$svg = preg_replace('/(<svg\s+[^>]*class=["\'])([^"\']*)(["\'][^>]*>)/', '$1$2 qr-code$3', $svg, 1);
}
} else {
// Fallback: simple replacement if no attributes
$svg = preg_replace('/<svg>/', '<svg class="qr-code">', $svg, 1);
}
return $svg;
}
}

View file

@ -22,9 +22,11 @@
"laravel/sanctum": "^4.0",
"laravel/socialite": "^5.23",
"laravel/tinker": "^2.10.1",
"livewire/livewire": "^3.7",
"livewire/flux": "^2.0",
"livewire/volt": "^1.7",
"om/icalparser": "^3.2",
"simplesoftwareio/simple-qrcode": "^4.2",
"spatie/browsershot": "^5.0",
"stevebauman/purify": "^6.3",
"symfony/yaml": "^7.3",

308
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "25c2a1a4a2f2594adefe25ddb6a072fb",
"content-hash": "ac6b1e352cb66f858a50b64e7e3c70d0",
"packages": [
{
"name": "aws/aws-crt-php",
@ -62,16 +62,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.369.10",
"version": "3.369.13",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "e179090bf2d658be7be37afc146111966ba6f41b"
"reference": "bedc36250c92b8287be855a2d25427fb0e065483"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/e179090bf2d658be7be37afc146111966ba6f41b",
"reference": "e179090bf2d658be7be37afc146111966ba6f41b",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/bedc36250c92b8287be855a2d25427fb0e065483",
"reference": "bedc36250c92b8287be855a2d25427fb0e065483",
"shasum": ""
},
"require": {
@ -153,9 +153,63 @@
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.369.10"
"source": "https://github.com/aws/aws-sdk-php/tree/3.369.13"
},
"time": "2026-01-09T19:08:12+00:00"
"time": "2026-01-14T19:13:46+00:00"
},
{
"name": "bacon/bacon-qr-code",
"version": "2.0.8",
"source": {
"type": "git",
"url": "https://github.com/Bacon/BaconQrCode.git",
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22",
"reference": "8674e51bb65af933a5ffaf1c308a660387c35c22",
"shasum": ""
},
"require": {
"dasprid/enum": "^1.0.3",
"ext-iconv": "*",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"phly/keep-a-changelog": "^2.1",
"phpunit/phpunit": "^7 | ^8 | ^9",
"spatie/phpunit-snapshot-assertions": "^4.2.9",
"squizlabs/php_codesniffer": "^3.4"
},
"suggest": {
"ext-imagick": "to generate QR code images"
},
"type": "library",
"autoload": {
"psr-4": {
"BaconQrCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "BaconQrCode is a QR code generator for PHP.",
"homepage": "https://github.com/Bacon/BaconQrCode",
"support": {
"issues": "https://github.com/Bacon/BaconQrCode/issues",
"source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8"
},
"time": "2022-12-07T17:46:57+00:00"
},
{
"name": "bnussbau/laravel-trmnl-blade",
@ -441,6 +495,56 @@
],
"time": "2024-02-09T16:56:22+00:00"
},
{
"name": "dasprid/enum",
"version": "1.0.7",
"source": {
"type": "git",
"url": "https://github.com/DASPRiD/Enum.git",
"reference": "b5874fa9ed0043116c72162ec7f4fb50e02e7cce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/DASPRiD/Enum/zipball/b5874fa9ed0043116c72162ec7f4fb50e02e7cce",
"reference": "b5874fa9ed0043116c72162ec7f4fb50e02e7cce",
"shasum": ""
},
"require": {
"php": ">=7.1 <9.0"
},
"require-dev": {
"phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11",
"squizlabs/php_codesniffer": "*"
},
"type": "library",
"autoload": {
"psr-4": {
"DASPRiD\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Ben Scholzen 'DASPRiD'",
"email": "mail@dasprids.de",
"homepage": "https://dasprids.de/",
"role": "Developer"
}
],
"description": "PHP 7.1 enum implementation",
"keywords": [
"enum",
"map"
],
"support": {
"issues": "https://github.com/DASPRiD/Enum/issues",
"source": "https://github.com/DASPRiD/Enum/tree/1.0.7"
},
"time": "2025-09-16T12:23:56+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
@ -1678,16 +1782,16 @@
},
{
"name": "laravel/framework",
"version": "v12.46.0",
"version": "v12.47.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "9dcff48d25a632c1fadb713024c952fec489c4ae"
"reference": "ab8114c2e78f32e64eb238fc4b495bea3f8b80ec"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/9dcff48d25a632c1fadb713024c952fec489c4ae",
"reference": "9dcff48d25a632c1fadb713024c952fec489c4ae",
"url": "https://api.github.com/repos/laravel/framework/zipball/ab8114c2e78f32e64eb238fc4b495bea3f8b80ec",
"reference": "ab8114c2e78f32e64eb238fc4b495bea3f8b80ec",
"shasum": ""
},
"require": {
@ -1896,20 +2000,20 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2026-01-07T23:26:53+00:00"
"time": "2026-01-13T15:29:06+00:00"
},
{
"name": "laravel/prompts",
"version": "v0.3.8",
"version": "v0.3.9",
"source": {
"type": "git",
"url": "https://github.com/laravel/prompts.git",
"reference": "096748cdfb81988f60090bbb839ce3205ace0d35"
"reference": "5c41bf0555b7cfefaad4e66d3046675829581ac4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/096748cdfb81988f60090bbb839ce3205ace0d35",
"reference": "096748cdfb81988f60090bbb839ce3205ace0d35",
"url": "https://api.github.com/repos/laravel/prompts/zipball/5c41bf0555b7cfefaad4e66d3046675829581ac4",
"reference": "5c41bf0555b7cfefaad4e66d3046675829581ac4",
"shasum": ""
},
"require": {
@ -1953,22 +2057,22 @@
"description": "Add beautiful and user-friendly forms to your command-line applications.",
"support": {
"issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.3.8"
"source": "https://github.com/laravel/prompts/tree/v0.3.9"
},
"time": "2025-11-21T20:52:52+00:00"
"time": "2026-01-07T21:00:29+00:00"
},
{
"name": "laravel/sanctum",
"version": "v4.2.2",
"version": "v4.2.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/sanctum.git",
"reference": "fd447754d2d3f56950d53b930128af2e3b617de9"
"reference": "47d26f1d310879ff757b971f5a6fc631d18663fd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sanctum/zipball/fd447754d2d3f56950d53b930128af2e3b617de9",
"reference": "fd447754d2d3f56950d53b930128af2e3b617de9",
"url": "https://api.github.com/repos/laravel/sanctum/zipball/47d26f1d310879ff757b971f5a6fc631d18663fd",
"reference": "47d26f1d310879ff757b971f5a6fc631d18663fd",
"shasum": ""
},
"require": {
@ -2018,20 +2122,20 @@
"issues": "https://github.com/laravel/sanctum/issues",
"source": "https://github.com/laravel/sanctum"
},
"time": "2026-01-06T23:11:51+00:00"
"time": "2026-01-11T18:20:25+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v2.0.7",
"version": "v2.0.8",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "cb291e4c998ac50637c7eeb58189c14f5de5b9dd"
"reference": "7581a4407012f5f53365e11bafc520fd7f36bc9b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/cb291e4c998ac50637c7eeb58189c14f5de5b9dd",
"reference": "cb291e4c998ac50637c7eeb58189c14f5de5b9dd",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/7581a4407012f5f53365e11bafc520fd7f36bc9b",
"reference": "7581a4407012f5f53365e11bafc520fd7f36bc9b",
"shasum": ""
},
"require": {
@ -2079,20 +2183,20 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
"time": "2025-11-21T20:52:36+00:00"
"time": "2026-01-08T16:22:46+00:00"
},
{
"name": "laravel/socialite",
"version": "v5.24.1",
"version": "v5.24.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/socialite.git",
"reference": "25e28c14d55404886777af1d77cf030e0f633142"
"reference": "5cea2eebf11ca4bc6c2f20495c82a70a9b3d1613"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/socialite/zipball/25e28c14d55404886777af1d77cf030e0f633142",
"reference": "25e28c14d55404886777af1d77cf030e0f633142",
"url": "https://api.github.com/repos/laravel/socialite/zipball/5cea2eebf11ca4bc6c2f20495c82a70a9b3d1613",
"reference": "5cea2eebf11ca4bc6c2f20495c82a70a9b3d1613",
"shasum": ""
},
"require": {
@ -2151,7 +2255,7 @@
"issues": "https://github.com/laravel/socialite/issues",
"source": "https://github.com/laravel/socialite"
},
"time": "2026-01-01T02:57:21+00:00"
"time": "2026-01-10T16:07:28+00:00"
},
{
"name": "laravel/tinker",
@ -2978,16 +3082,16 @@
},
{
"name": "livewire/livewire",
"version": "v3.7.3",
"version": "v3.7.4",
"source": {
"type": "git",
"url": "https://github.com/livewire/livewire.git",
"reference": "a5384df9fbd3eaf02e053bc49aabc8ace293fc1c"
"reference": "5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/livewire/livewire/zipball/a5384df9fbd3eaf02e053bc49aabc8ace293fc1c",
"reference": "a5384df9fbd3eaf02e053bc49aabc8ace293fc1c",
"url": "https://api.github.com/repos/livewire/livewire/zipball/5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0",
"reference": "5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0",
"shasum": ""
},
"require": {
@ -3042,7 +3146,7 @@
"description": "A front-end framework for Laravel.",
"support": {
"issues": "https://github.com/livewire/livewire/issues",
"source": "https://github.com/livewire/livewire/tree/v3.7.3"
"source": "https://github.com/livewire/livewire/tree/v3.7.4"
},
"funding": [
{
@ -3050,7 +3154,7 @@
"type": "github"
}
],
"time": "2025-12-19T02:00:29+00:00"
"time": "2026-01-13T09:37:21+00:00"
},
{
"name": "livewire/volt",
@ -4818,6 +4922,74 @@
},
"time": "2025-12-14T04:43:48+00:00"
},
{
"name": "simplesoftwareio/simple-qrcode",
"version": "4.2.0",
"source": {
"type": "git",
"url": "https://github.com/SimpleSoftwareIO/simple-qrcode.git",
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SimpleSoftwareIO/simple-qrcode/zipball/916db7948ca6772d54bb617259c768c9cdc8d537",
"reference": "916db7948ca6772d54bb617259c768c9cdc8d537",
"shasum": ""
},
"require": {
"bacon/bacon-qr-code": "^2.0",
"ext-gd": "*",
"php": ">=7.2|^8.0"
},
"require-dev": {
"mockery/mockery": "~1",
"phpunit/phpunit": "~9"
},
"suggest": {
"ext-imagick": "Allows the generation of PNG QrCodes.",
"illuminate/support": "Allows for use within Laravel."
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"QrCode": "SimpleSoftwareIO\\QrCode\\Facades\\QrCode"
},
"providers": [
"SimpleSoftwareIO\\QrCode\\QrCodeServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"SimpleSoftwareIO\\QrCode\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Simple Software LLC",
"email": "support@simplesoftware.io"
}
],
"description": "Simple QrCode is a QR code generator made for Laravel.",
"homepage": "https://www.simplesoftware.io/#/docs/simple-qrcode",
"keywords": [
"Simple",
"generator",
"laravel",
"qrcode",
"wrapper"
],
"support": {
"issues": "https://github.com/SimpleSoftwareIO/simple-qrcode/issues",
"source": "https://github.com/SimpleSoftwareIO/simple-qrcode/tree/4.2.0"
},
"time": "2021-02-08T20:43:55+00:00"
},
{
"name": "spatie/browsershot",
"version": "5.2.0",
@ -4949,16 +5121,16 @@
},
{
"name": "spatie/temporary-directory",
"version": "2.3.0",
"version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/temporary-directory.git",
"reference": "580eddfe9a0a41a902cac6eeb8f066b42e65a32b"
"reference": "662e481d6ec07ef29fd05010433428851a42cd07"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/temporary-directory/zipball/580eddfe9a0a41a902cac6eeb8f066b42e65a32b",
"reference": "580eddfe9a0a41a902cac6eeb8f066b42e65a32b",
"url": "https://api.github.com/repos/spatie/temporary-directory/zipball/662e481d6ec07ef29fd05010433428851a42cd07",
"reference": "662e481d6ec07ef29fd05010433428851a42cd07",
"shasum": ""
},
"require": {
@ -4994,7 +5166,7 @@
],
"support": {
"issues": "https://github.com/spatie/temporary-directory/issues",
"source": "https://github.com/spatie/temporary-directory/tree/2.3.0"
"source": "https://github.com/spatie/temporary-directory/tree/2.3.1"
},
"funding": [
{
@ -5006,7 +5178,7 @@
"type": "github"
}
],
"time": "2025-01-13T13:04:43+00:00"
"time": "2026-01-12T07:42:22+00:00"
},
{
"name": "stevebauman/purify",
@ -8674,16 +8846,16 @@
},
{
"name": "laravel/boost",
"version": "v1.8.9",
"version": "v1.8.10",
"source": {
"type": "git",
"url": "https://github.com/laravel/boost.git",
"reference": "1f2c2d41b5216618170fb6730ec13bf894c5bffd"
"reference": "aad8b2a423b0a886c2ce7ee92abbfde69992ff32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/boost/zipball/1f2c2d41b5216618170fb6730ec13bf894c5bffd",
"reference": "1f2c2d41b5216618170fb6730ec13bf894c5bffd",
"url": "https://api.github.com/repos/laravel/boost/zipball/aad8b2a423b0a886c2ce7ee92abbfde69992ff32",
"reference": "aad8b2a423b0a886c2ce7ee92abbfde69992ff32",
"shasum": ""
},
"require": {
@ -8736,7 +8908,7 @@
"issues": "https://github.com/laravel/boost/issues",
"source": "https://github.com/laravel/boost"
},
"time": "2026-01-07T18:43:11+00:00"
"time": "2026-01-14T14:51:16+00:00"
},
{
"name": "laravel/mcp",
@ -10149,16 +10321,16 @@
},
{
"name": "phpstan/phpdoc-parser",
"version": "2.3.0",
"version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495"
"reference": "16dbf9937da8d4528ceb2145c9c7c0bd29e26374"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495",
"reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/16dbf9937da8d4528ceb2145c9c7c0bd29e26374",
"reference": "16dbf9937da8d4528ceb2145c9c7c0bd29e26374",
"shasum": ""
},
"require": {
@ -10190,9 +10362,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0"
"source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.1"
},
"time": "2025-08-30T15:50:23+00:00"
"time": "2026-01-12T11:33:04+00:00"
},
{
"name": "phpstan/phpstan",
@ -10688,16 +10860,16 @@
},
{
"name": "rector/rector",
"version": "2.3.0",
"version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "f7166355dcf47482f27be59169b0825995f51c7d"
"reference": "9afc1bb43571b25629f353c61a9315b5ef31383a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/f7166355dcf47482f27be59169b0825995f51c7d",
"reference": "f7166355dcf47482f27be59169b0825995f51c7d",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/9afc1bb43571b25629f353c61a9315b5ef31383a",
"reference": "9afc1bb43571b25629f353c61a9315b5ef31383a",
"shasum": ""
},
"require": {
@ -10736,7 +10908,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.3.0"
"source": "https://github.com/rectorphp/rector/tree/2.3.1"
},
"funding": [
{
@ -10744,7 +10916,7 @@
"type": "github"
}
],
"time": "2025-12-25T22:00:18+00:00"
"time": "2026-01-13T15:13:58+00:00"
},
{
"name": "sebastian/cli-parser",
@ -11806,16 +11978,16 @@
},
{
"name": "webmozart/assert",
"version": "2.1.1",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/webmozarts/assert.git",
"reference": "bdbabc199a7ba9965484e4725d66170e5711323b"
"reference": "ce6a2f100c404b2d32a1dd1270f9b59ad4f57649"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/bdbabc199a7ba9965484e4725d66170e5711323b",
"reference": "bdbabc199a7ba9965484e4725d66170e5711323b",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/ce6a2f100c404b2d32a1dd1270f9b59ad4f57649",
"reference": "ce6a2f100c404b2d32a1dd1270f9b59ad4f57649",
"shasum": ""
},
"require": {
@ -11862,9 +12034,9 @@
],
"support": {
"issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/2.1.1"
"source": "https://github.com/webmozarts/assert/tree/2.1.2"
},
"time": "2026-01-08T11:28:40+00:00"
"time": "2026-01-13T14:02:24+00:00"
}
],
"aliases": [],

View file

@ -81,6 +81,7 @@ class extends Component
'logo_url' => Arr::get($plugin, 'logo_url'),
'screenshot_url' => Arr::get($plugin, 'screenshot_url'),
'learn_more_url' => Arr::get($plugin, 'author_bio.learn_more_url'),
'preferred_renderer' => Arr::get($plugin, 'byos.byos_laravel.renderer'),
];
})
->sortBy('name')
@ -112,7 +113,7 @@ class extends Component
$plugin['zip_url'],
auth()->user(),
$plugin['zip_entry_path'] ?? null,
null,
config('services.trmnl.liquid_enabled') ? $plugin['preferred_renderer'] : null,
$plugin['logo_url'] ?? null,
allowDuplicate: true
);

View file

@ -174,3 +174,100 @@ LIQUID
// Should not contain users < 30
$this->assertStringNotContainsString('Alice (25)', $result);
});
test('qr_code filter generates SVG QR code with qr-code class', function (): void {
$plugin = Plugin::factory()->create([
'markup_language' => 'liquid',
'render_markup' => '{{ "https://example.com" | qr_code }}',
]);
$result = $plugin->render('full');
// Should contain SVG elements
$this->assertStringContainsString('<svg', $result);
$this->assertStringContainsString('</svg>', $result);
// Should contain qr-code class
$this->assertStringContainsString('class="qr-code"', $result);
// Should contain QR code path elements
$this->assertStringContainsString('<path', $result);
});
test('qr_code filter works with custom text', function (): void {
$plugin = Plugin::factory()->create([
'markup_language' => 'liquid',
'render_markup' => '{{ "Hello World" | qr_code }}',
]);
$result = $plugin->render('full');
// Should generate valid SVG
$this->assertStringContainsString('<svg', $result);
$this->assertStringContainsString('</svg>', $result);
// Should contain qr-code class
$this->assertStringContainsString('class="qr-code"', $result);
});
test('qr_code filter calculates correct size for module_size 11', function (): void {
$plugin = Plugin::factory()->create([
'markup_language' => 'liquid',
'render_markup' => '{{ "test" | qr_code: 11 }}',
]);
$result = $plugin->render('full');
// Should have width="319" and height="319" (29 * 11 = 319)
$this->assertStringContainsString('width="319"', $result);
$this->assertStringContainsString('height="319"', $result);
});
test('qr_code filter calculates correct size for module_size 16', function (): void {
$plugin = Plugin::factory()->create([
'markup_language' => 'liquid',
'render_markup' => '{{ "test" | qr_code: 16 }}',
]);
$result = $plugin->render('full');
// Should have width="464" and height="464" (29 * 16 = 464)
$this->assertStringContainsString('width="464"', $result);
$this->assertStringContainsString('height="464"', $result);
});
test('qr_code filter calculates correct size for module_size 10', function (): void {
$plugin = Plugin::factory()->create([
'markup_language' => 'liquid',
'render_markup' => '{{ "test" | qr_code: 10 }}',
]);
$result = $plugin->render('full');
// Should have width="290" and height="290" (29 * 10 = 290)
$this->assertStringContainsString('width="290"', $result);
$this->assertStringContainsString('height="290"', $result);
});
test('qr_code filter calculates correct size for module_size 5', function (): void {
$plugin = Plugin::factory()->create([
'markup_language' => 'liquid',
'render_markup' => '{{ "test" | qr_code: 5 }}',
]);
$result = $plugin->render('full');
// Should have width="145" and height="145" (29 * 5 = 145)
$this->assertStringContainsString('width="145"', $result);
$this->assertStringContainsString('height="145"', $result);
});
test('qr_code filter supports error correction level parameter', function (): void {
$plugin = Plugin::factory()->create([
'markup_language' => 'liquid',
'render_markup' => '{{ "test" | qr_code: 11, "l" }}',
]);
$result = $plugin->render('full');
// Should generate valid SVG with qr-code class
$this->assertStringContainsString('<svg', $result);
$this->assertStringContainsString('class="qr-code"', $result);
});