diff --git a/backend/composer.json b/backend/composer.json index 3e43d86..2dc558a 100644 --- a/backend/composer.json +++ b/backend/composer.json @@ -23,7 +23,7 @@ "require": { "craftcms/ckeditor": "4.4.0", "craftcms/cloud": "*", - "craftcms/cms": "5.5.2", + "craftcms/cms": "^5.5.0", "vlucas/phpdotenv": "^5.4.0" }, "require-dev": { diff --git a/backend/composer.lock b/backend/composer.lock index 0188301..e3fdc18 100644 --- a/backend/composer.lock +++ b/backend/composer.lock @@ -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": "d93b729493fd3aa1c65864de58b506ab", + "content-hash": "2f387dbeb80768309650b7fd25d04ed7", "packages": [ { "name": "99designs/http-signatures", @@ -48,11 +48,11 @@ }, { "name": "aws/aws-crt-php", - "version": "v1.2.6", + "version": "v1.2.7", "dist": { "type": "zip", - "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/a63485b65b6b3367039306496d49737cf1995408", - "reference": "a63485b65b6b3367039306496d49737cf1995408", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/d71d9906c7bb63a28295447ba12e74723bd3730e", + "reference": "d71d9906c7bb63a28295447ba12e74723bd3730e", "shasum": "" }, "require": { @@ -84,15 +84,20 @@ "crt", "sdk" ], - "time": "2024-06-13T17:21:28+00:00" + "time": "2024-10-18T22:15:13+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.319.4", + "version": "3.331.0", + "source": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-php.git", + "reference": "0f8b3f63ba7b296afedcb3e6a43ce140831b9400" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b39a56786bef9e922c8bdd0e47c73ba828cc512e", - "reference": "b39a56786bef9e922c8bdd0e47c73ba828cc512e", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0f8b3f63ba7b296afedcb3e6a43ce140831b9400", + "reference": "0f8b3f63ba7b296afedcb3e6a43ce140831b9400", "shasum": "" }, "require": { @@ -107,6 +112,25 @@ "php": ">=7.2.5", "psr/http-message": "^1.0 || ^2.0" }, + "require-dev": { + "andrewsville/php-token-reflection": "^1.4", + "aws/aws-php-sns-message-validator": "~1.0", + "behat/behat": "~3.0", + "composer/composer": "^1.10.22", + "dms/phpunit-arraysubset-asserts": "^0.4.0", + "doctrine/cache": "~1.4", + "ext-dom": "*", + "ext-openssl": "*", + "ext-pcntl": "*", + "ext-sockets": "*", + "nette/neon": "^2.3", + "paragonie/random_compat": ">= 2", + "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", + "sebastian/comparator": "^1.2.3 || ^4.0", + "yoast/phpunit-polyfills": "^1.0" + }, "suggest": { "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications", "doctrine/cache": "To use the DoctrineCacheAdapter", @@ -131,6 +155,7 @@ "src/data/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -152,7 +177,12 @@ "s3", "sdk" ], - "time": "2024-08-13T18:04:50+00:00" + "support": { + "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", + "issues": "https://github.com/aws/aws-sdk-php/issues", + "source": "https://github.com/aws/aws-sdk-php/tree/3.331.0" + }, + "time": "2024-11-27T19:12:58+00:00" }, { "name": "bacon/bacon-qr-code", @@ -504,11 +534,11 @@ }, { "name": "craftcms/cloud", - "version": "2.6.1", + "version": "2.6.7", "dist": { "type": "zip", - "url": "https://api.github.com/repos/craftcms/cloud-extension-yii2/zipball/5b37d2e3a600e3179dc95d6fad11632155716cf2", - "reference": "5b37d2e3a600e3179dc95d6fad11632155716cf2", + "url": "https://api.github.com/repos/craftcms/cloud-extension-yii2/zipball/b41311a383633f034baa96fb2c06fa6ea38eaf45", + "reference": "b41311a383633f034baa96fb2c06fa6ea38eaf45", "shasum": "" }, "require": { @@ -538,15 +568,15 @@ "craft\\cloud\\": "src/" } }, - "time": "2024-07-29T16:47:46+00:00" + "time": "2024-11-08T18:32:00+00:00" }, { "name": "craftcms/cms", - "version": "5.5.2", + "version": "5.5.3", "dist": { "type": "zip", - "url": "https://api.github.com/repos/craftcms/cms/zipball/43dc9cfba1d5ccb1cd0b5da4ff1ab6459db26811", - "reference": "43dc9cfba1d5ccb1cd0b5da4ff1ab6459db26811", + "url": "https://api.github.com/repos/craftcms/cms/zipball/20199c5340825146f2354d0a29fb694b7d86e400", + "reference": "20199c5340825146f2354d0a29fb694b7d86e400", "shasum": "" }, "require": { @@ -644,7 +674,7 @@ "docs": "https://craftcms.com/docs/5.x/", "rss": "https://github.com/craftcms/cms/releases.atom" }, - "time": "2024-11-19T17:17:31+00:00" + "time": "2024-11-22T23:29:45+00:00" }, { "name": "craftcms/flysystem", @@ -1242,11 +1272,6 @@ { "name": "graham-campbell/result-type", "version": "v1.1.3", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" - }, "dist": { "type": "zip", "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", @@ -1257,16 +1282,12 @@ "php": "^7.2.5 || ^8.0", "phpoption/phpoption": "^1.9.3" }, - "require-dev": { - "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" - }, "type": "library", "autoload": { "psr-4": { "GrahamCampbell\\ResultType\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1285,20 +1306,6 @@ "Result-Type", "result" ], - "support": { - "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", - "type": "tidelift" - } - ], "time": "2024-07-20T21:45:45+00:00" }, { @@ -1576,11 +1583,11 @@ }, { "name": "illuminate/collections", - "version": "v10.48.23", + "version": "v10.48.25", "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/37c863cffb345869dd134eff8e646bc82a19cc96", - "reference": "37c863cffb345869dd134eff8e646bc82a19cc96", + "url": "https://api.github.com/repos/illuminate/collections/zipball/48de3d6bc6aa779112ddcb608a3a96fc975d89d8", + "reference": "48de3d6bc6aa779112ddcb608a3a96fc975d89d8", "shasum": "" }, "require": { @@ -1617,15 +1624,15 @@ ], "description": "The Illuminate Collections package.", "homepage": "https://laravel.com", - "time": "2024-06-19T14:25:05+00:00" + "time": "2024-11-21T14:02:44+00:00" }, { "name": "illuminate/conditionable", - "version": "v10.48.23", + "version": "v10.48.25", "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/conditionable/zipball/d0958e4741fc9d6f516a552060fd1b829a85e009", - "reference": "d0958e4741fc9d6f516a552060fd1b829a85e009", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/3ee34ac306fafc2a6f19cd7cd68c9af389e432a5", + "reference": "3ee34ac306fafc2a6f19cd7cd68c9af389e432a5", "shasum": "" }, "require": { @@ -1653,15 +1660,15 @@ ], "description": "The Illuminate Conditionable package.", "homepage": "https://laravel.com", - "time": "2023-02-03T08:06:17+00:00" + "time": "2024-11-21T14:02:44+00:00" }, { "name": "illuminate/contracts", - "version": "v10.48.23", + "version": "v10.48.25", "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac", - "reference": "8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/f90663a69f926105a70b78060a31f3c64e2d1c74", + "reference": "f90663a69f926105a70b78060a31f3c64e2d1c74", "shasum": "" }, "require": { @@ -1691,11 +1698,11 @@ ], "description": "The Illuminate Contracts package.", "homepage": "https://laravel.com", - "time": "2024-01-15T18:52:32+00:00" + "time": "2024-11-21T14:02:44+00:00" }, { "name": "illuminate/macroable", - "version": "v10.48.23", + "version": "v10.48.25", "dist": { "type": "zip", "url": "https://api.github.com/repos/illuminate/macroable/zipball/dff667a46ac37b634dcf68909d9d41e94dc97c27", @@ -1765,11 +1772,11 @@ }, { "name": "league/flysystem", - "version": "3.28.0", + "version": "3.29.1", "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c", - "reference": "e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/edc1bb7c86fab0776c3287dbd19b5fa278347319", + "reference": "edc1bb7c86fab0776c3287dbd19b5fa278347319", "shasum": "" }, "require": { @@ -1815,15 +1822,15 @@ "sftp", "storage" ], - "time": "2024-05-22T10:09:12+00:00" + "time": "2024-10-08T08:58:34+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "3.28.0", + "version": "3.29.0", "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/22071ef1604bc776f5ff2468ac27a752514665c8", - "reference": "22071ef1604bc776f5ff2468ac27a752514665c8", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/c6ff6d4606e48249b63f269eba7fabdb584e76a9", + "reference": "c6ff6d4606e48249b63f269eba7fabdb584e76a9", "shasum": "" }, "require": { @@ -1861,15 +1868,15 @@ "s3", "storage" ], - "time": "2024-05-06T20:05:52+00:00" + "time": "2024-08-17T13:10:48+00:00" }, { "name": "league/flysystem-local", - "version": "3.28.0", + "version": "3.29.0", "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/13f22ea8be526ea58c2ddff9e158ef7c296e4f40", - "reference": "13f22ea8be526ea58c2ddff9e158ef7c296e4f40", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e0e8d52ce4b2ed154148453d321e97c8e931bd27", + "reference": "e0e8d52ce4b2ed154148453d321e97c8e931bd27", "shasum": "" }, "require": { @@ -1901,15 +1908,15 @@ "filesystem", "local" ], - "time": "2024-05-06T20:05:52+00:00" + "time": "2024-08-09T21:24:39+00:00" }, { "name": "league/mime-type-detection", - "version": "1.15.0", + "version": "1.16.0", "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", - "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", "shasum": "" }, "require": { @@ -1932,7 +1939,7 @@ } ], "description": "Mime-type detection for Flysystem", - "time": "2024-01-28T23:22:08+00:00" + "time": "2024-09-21T08:32:55+00:00" }, { "name": "league/uri", @@ -2171,18 +2178,18 @@ }, { "name": "moneyphp/money", - "version": "v4.5.1", + "version": "v4.6.0", "dist": { "type": "zip", - "url": "https://api.github.com/repos/moneyphp/money/zipball/142107bec4870ac2586057dc2fe917d25c92a91e", - "reference": "142107bec4870ac2586057dc2fe917d25c92a91e", + "url": "https://api.github.com/repos/moneyphp/money/zipball/ddf6a86b574808f8844777ed4e8c4f92a10dac9b", + "reference": "ddf6a86b574808f8844777ed4e8c4f92a10dac9b", "shasum": "" }, "require": { "ext-bcmath": "*", "ext-filter": "*", "ext-json": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "suggest": { "ext-gmp": "Calculate without integer limits", @@ -2227,7 +2234,7 @@ "money", "vo" ], - "time": "2024-09-27T12:04:27+00:00" + "time": "2024-11-22T10:59:03+00:00" }, { "name": "monolog/monolog", @@ -2293,11 +2300,11 @@ }, { "name": "mtdowling/jmespath.php", - "version": "2.7.0", + "version": "2.8.0", "dist": { "type": "zip", - "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/bbb69a935c2cbb0c03d7f481a238027430f6440b", - "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/a2a865e05d5f420b50cc2f85bb78d565db12a6bc", + "reference": "a2a865e05d5f420b50cc2f85bb78d565db12a6bc", "shasum": "" }, "require": { @@ -2310,7 +2317,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { @@ -2341,15 +2348,15 @@ "json", "jsonpath" ], - "time": "2023-08-25T10:54:48+00:00" + "time": "2024-09-04T18:46:31+00:00" }, { "name": "nyholm/psr7", - "version": "1.8.1", + "version": "1.8.2", "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/aa5fc277a4f5508013d571341ade0c3886d4d00e", - "reference": "aa5fc277a4f5508013d571341ade0c3886d4d00e", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", "shasum": "" }, "require": { @@ -2392,7 +2399,7 @@ "psr-17", "psr-7" ], - "time": "2023-11-13T09:31:12+00:00" + "time": "2024-09-09T07:06:30+00:00" }, { "name": "nystudio107/craft-code-editor", @@ -2694,11 +2701,6 @@ { "name": "phpoption/phpoption", "version": "1.9.3", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" - }, "dist": { "type": "zip", "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", @@ -2708,10 +2710,6 @@ "require": { "php": "^7.2.5 || ^8.0" }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" - }, "type": "library", "extra": { "bamarni-bin": { @@ -2727,7 +2725,6 @@ "PhpOption\\": "src/PhpOption/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -2750,20 +2747,6 @@ "php", "type" ], - "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], "time": "2024-07-20T21:41:07+00:00" }, { @@ -3636,11 +3619,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -3661,6 +3649,7 @@ "function.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3676,7 +3665,24 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", - "time": "2024-04-18T09:32:20+00:00" + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/event-dispatcher", @@ -3727,11 +3733,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.5.0", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { @@ -3753,6 +3764,7 @@ "Symfony\\Contracts\\EventDispatcher\\": "" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3776,7 +3788,24 @@ "interoperability", "standards" ], - "time": "2024-04-18T09:32:20+00:00" + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", @@ -3820,18 +3849,23 @@ }, { "name": "symfony/http-client", - "version": "v6.4.15", + "version": "v6.4.16", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "60a113666fa67e598abace38e5f46a0954d8833d" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/cb4073c905cd12b8496d24ac428a9228c1750670", - "reference": "cb4073c905cd12b8496d24ac428a9228c1750670", + "url": "https://api.github.com/repos/symfony/http-client/zipball/60a113666fa67e598abace38e5f46a0954d8833d", + "reference": "60a113666fa67e598abace38e5f46a0954d8833d", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/http-client-contracts": "~3.4.3|^3.5.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -3844,6 +3878,21 @@ "psr/http-client-implementation": "1.0", "symfony/http-client-implementation": "3.0" }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4|^2.0", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0" + }, "type": "library", "autoload": { "psr-4": { @@ -3853,6 +3902,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3871,15 +3921,37 @@ "keywords": [ "http" ], - "time": "2024-11-13T13:40:18+00:00" + "support": { + "source": "https://github.com/symfony/http-client/tree/v6.4.16" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-27T11:52:33+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.0", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", - "reference": "20414d96f391677bf80078aa55baece78b82647d", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", "shasum": "" }, "require": { @@ -3903,6 +3975,7 @@ "/Test/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -3926,7 +3999,24 @@ "interoperability", "standards" ], - "time": "2024-04-18T09:32:20+00:00" + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-25T12:02:18+00:00" }, { "name": "symfony/mailer", @@ -4671,11 +4761,16 @@ }, { "name": "symfony/property-info", - "version": "v7.1.8", + "version": "v7.1.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-info.git", + "reference": "e9a7b2a4984457c3849afd2b1a1ec7f2994cb1b5" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/3748f85f64351d282fd028e44309856f1d79142e", - "reference": "3748f85f64351d282fd028e44309856f1d79142e", + "url": "https://api.github.com/repos/symfony/property-info/zipball/e9a7b2a4984457c3849afd2b1a1ec7f2994cb1b5", + "reference": "e9a7b2a4984457c3849afd2b1a1ec7f2994cb1b5", "shasum": "" }, "require": { @@ -4686,8 +4781,14 @@ "conflict": { "phpdocumentor/reflection-docblock": "<5.2", "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<6.4", - "symfony/serializer": "<6.4" + "symfony/dependency-injection": "<6.4" + }, + "require-dev": { + "phpdocumentor/reflection-docblock": "^5.2", + "phpstan/phpdoc-parser": "^1.0|^2.0", + "symfony/cache": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4698,6 +4799,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4721,7 +4823,24 @@ "type", "validator" ], - "time": "2024-11-09T07:07:11+00:00" + "support": { + "source": "https://github.com/symfony/property-info/tree/v7.1.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-27T09:50:41+00:00" }, { "name": "symfony/serializer", @@ -4776,11 +4895,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -4809,6 +4933,7 @@ "/Test/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -4832,7 +4957,24 @@ "interoperability", "standards" ], - "time": "2024-04-18T09:32:20+00:00" + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/string", @@ -4994,11 +5136,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.47", + "version": "v5.4.48", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", - "reference": "e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/42f18f170aa86d612c3559cfb3bd11a375df32c8", + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8", "shasum": "" }, "require": { @@ -5009,6 +5156,14 @@ "conflict": { "symfony/console": "<4.4" }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/uid": "^5.1|^6.0", + "twig/twig": "^2.13|^3.0.4" + }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", "ext-intl": "To show region name in time zone dump", @@ -5029,6 +5184,7 @@ "/Tests/" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -5048,6 +5204,23 @@ "debug", "dump" ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v5.4.48" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2024-11-08T15:21:10+00:00" }, { @@ -5190,11 +5363,6 @@ { "name": "vlucas/phpdotenv", "version": "v5.6.1", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" - }, "dist": { "type": "zip", "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", @@ -5210,11 +5378,6 @@ "symfony/polyfill-mbstring": "^1.24", "symfony/polyfill-php80": "^1.24" }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "ext-filter": "*", - "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" - }, "suggest": { "ext-filter": "Required to use the boolean validator." }, @@ -5233,7 +5396,6 @@ "Dotenv\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -5255,20 +5417,6 @@ "env", "environment" ], - "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], "time": "2024-07-20T21:52:34+00:00" }, { @@ -5412,11 +5560,11 @@ }, { "name": "voku/portable-ascii", - "version": "2.0.1", + "version": "2.0.3", "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", - "reference": "b56450eed252f6801410d810c8e1727224ae0743", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", "shasum": "" }, "require": { @@ -5437,7 +5585,7 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", @@ -5447,7 +5595,7 @@ "clean", "php" ], - "time": "2022-03-08T17:03:00+00:00" + "time": "2024-11-21T01:49:47+00:00" }, { "name": "voku/portable-utf8", @@ -6235,11 +6383,6 @@ { "name": "craftcms/generator", "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/craftcms/generator.git", - "reference": "4ccc62474698905c252c3ddb3352c0a63fae9765" - }, "dist": { "type": "zip", "url": "https://api.github.com/repos/craftcms/generator/zipball/4ccc62474698905c252c3ddb3352c0a63fae9765", @@ -6252,11 +6395,6 @@ "nikic/php-parser": "^4.15", "php": "^8.2" }, - "require-dev": { - "craftcms/ecs": "dev-main", - "craftcms/phpstan": "dev-main", - "pestphp/pest": "^1.22" - }, "type": "yii2-extension", "extra": { "bootstrap": "craft\\generator\\Extension" @@ -6266,7 +6404,6 @@ "craft\\generator\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "mit" ], @@ -6286,35 +6423,23 @@ "support": { "email": "support@craftcms.com", "issues": "https://github.com/craftcms/generator/issues?state=open", - "rss": "https://github.com/craftcms/generator/releases.atom", - "source": "https://github.com/craftcms/generator" + "source": "https://github.com/craftcms/generator", + "rss": "https://github.com/craftcms/generator/releases.atom" }, "time": "2024-06-19T14:43:28+00:00" }, { "name": "nette/php-generator", - "version": "v4.1.5", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "690b00d81d42d5633e4457c43ef9754573b6f9d6" - }, + "version": "v4.1.6", "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/690b00d81d42d5633e4457c43ef9754573b6f9d6", - "reference": "690b00d81d42d5633e4457c43ef9754573b6f9d6", + "url": "https://api.github.com/repos/nette/php-generator/zipball/c90961e782ae86e517fe5ed732eb2b512945565b", + "reference": "c90961e782ae86e517fe5ed732eb2b512945565b", "shasum": "" }, "require": { "nette/utils": "^3.2.9 || ^4.0", - "php": "8.0 - 8.3" - }, - "require-dev": { - "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", - "nikic/php-parser": "^4.18 || ^5.0", - "phpstan/phpstan": "^1.0", - "tracy/tracy": "^2.8" + "php": "8.0 - 8.4" }, "suggest": { "nikic/php-parser": "to use ClassType::from(withBodies: true) & ClassType::fromCode()" @@ -6330,7 +6455,6 @@ "src/" ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0-only", @@ -6354,20 +6478,11 @@ "php", "scaffolding" ], - "support": { - "issues": "https://github.com/nette/php-generator/issues", - "source": "https://github.com/nette/php-generator/tree/v4.1.5" - }, - "time": "2024-05-12T17:31:02+00:00" + "time": "2024-09-10T09:31:55+00:00" }, { "name": "nette/utils", "version": "v4.0.5", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96" - }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", @@ -6381,12 +6496,6 @@ "nette/finder": "<3", "nette/schema": "<1.2.2" }, - "require-dev": { - "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.5", - "phpstan/phpstan": "^1.0", - "tracy/tracy": "^2.9" - }, "suggest": { "ext-gd": "to use Image", "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", @@ -6406,7 +6515,6 @@ "src/" ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0-only", @@ -6440,34 +6548,21 @@ "utility", "validation" ], - "support": { - "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.5" - }, "time": "2024-08-07T15:39:19+00:00" }, { "name": "nikic/php-parser", - "version": "v4.19.1", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" - }, + "version": "v4.19.4", "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=7.1" }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, "bin": [ "bin/php-parse" ], @@ -6482,7 +6577,6 @@ "PhpParser\\": "lib/PhpParser" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -6496,20 +6590,11 @@ "parser", "php" ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" - }, - "time": "2024-03-17T08:10:35+00:00" + "time": "2024-09-29T15:01:53+00:00" }, { "name": "psy/psysh", "version": "v0.11.22", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "128fa1b608be651999ed9789c95e6e2a31b5802b" - }, "dist": { "type": "zip", "url": "https://api.github.com/repos/bobthecow/psysh/zipball/128fa1b608be651999ed9789c95e6e2a31b5802b", @@ -6527,9 +6612,6 @@ "conflict": { "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.2" - }, "suggest": { "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", "ext-pdo-sqlite": "The doc command requires SQLite to work.", @@ -6557,7 +6639,6 @@ "Psy\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6576,24 +6657,15 @@ "interactive", "shell" ], - "support": { - "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.22" - }, "time": "2023-10-14T21:56:36+00:00" }, { "name": "symfony/console", - "version": "v6.4.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc" - }, + "version": "v6.4.15", "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/504974cbe43d05f83b201d6498c206f16fc0cdbc", - "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc", + "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", "shasum": "" }, "require": { @@ -6613,19 +6685,6 @@ "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" - }, "type": "library", "autoload": { "psr-4": { @@ -6635,7 +6694,6 @@ "/Tests/" ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -6657,33 +6715,11 @@ "console", "terminal" ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.4.10" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-07-26T12:30:32+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { "name": "yiisoft/yii2-shell", "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/yiisoft/yii2-shell.git", - "reference": "358d4651ce1f54db0f1add026c202ac2e47db06b" - }, "dist": { "type": "zip", "url": "https://api.github.com/repos/yiisoft/yii2-shell/zipball/358d4651ce1f54db0f1add026c202ac2e47db06b", @@ -6707,7 +6743,6 @@ "yii\\shell\\": "" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], @@ -6726,29 +6761,16 @@ "shell", "yii2" ], - "support": { - "forum": "http://www.yiiframework.com/forum/", - "irc": "irc://irc.freenode.net/yii", - "issues": "https://github.com/yiisoft/yii2-shell/issues", - "source": "https://github.com/yiisoft/yii2-shell", - "wiki": "http://www.yiiframework.com/wiki/" - }, - "funding": [ - { - "url": "https://opencollective.com/yiisoft", - "type": "open_collective" - } - ], "time": "2022-09-04T10:37:52+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "platform-overrides": { "php": "8.2" }, diff --git a/backend/templates/_utilities/image.twig b/backend/templates/_utilities/image.twig new file mode 100644 index 0000000..9187b4f --- /dev/null +++ b/backend/templates/_utilities/image.twig @@ -0,0 +1,30 @@ +{% macro pictures(photos, decorative = false) %} + + {% for photo in photos %} + {% if photo.extension == 'svg' %} + {% set alt = decorative ? null : (photo.alt ?? null) %} + {% set role = decorative ? null : 'img' %} + {{ svg(photo)|attr({ role: role, 'aria-label': alt }) }} + {% else %} + {% set outputWidths = [640, 1024, 1920] %} + {% set srcset = [] %} + {% for outputWidth in outputWidths %} + {% if outputWidth <= photo.width %} + {% set srcset = srcset | merge([photo.url({ width: outputWidth }) ~ ' ' ~ outputWidth ~ 'w']) %} + {% endif %} + {% endfor %} + + + + + {% endif %} + {% endfor %} +{% endmacro %} \ No newline at end of file diff --git a/frontend/composables/usePaginatedData.js b/frontend/composables/usePaginatedData.js index 7d7491e..b687770 100644 --- a/frontend/composables/usePaginatedData.js +++ b/frontend/composables/usePaginatedData.js @@ -7,29 +7,25 @@ export function usePaginatedData(fetchData, initialItemsPerPage = 4) { const currentPage = ref(parseInt(route.query.page) || 1) const itemsPerPage = ref(initialItemsPerPage) - const loading = ref(false) - const error = ref(null) - const data = ref(null) + + const { + data, + error, + pending: loading, + refresh + } = useAsyncData( + `paginated-data-${currentPage.value}`, + () => fetchData(currentPage.value, itemsPerPage.value), + { + watch: [currentPage] + } + ) const totalPosts = computed(() => data.value?.total || 0) const totalPages = computed(() => Math.ceil(totalPosts.value / itemsPerPage.value) ) - const fetchPageData = async (page = currentPage.value) => { - loading.value = true - error.value = null - try { - const result = await fetchData(page, itemsPerPage.value) - data.value = result - currentPage.value = page - } catch (err) { - error.value = err - } finally { - loading.value = false - } - } - const updateCurrentPage = async (newPage) => { if (newPage > 0 && newPage <= totalPages.value && newPage !== currentPage.value) { await router.push({ @@ -38,30 +34,14 @@ export function usePaginatedData(fetchData, initialItemsPerPage = 4) { } } - const refresh = async () => { - loading.value = true - try { - const newData = await fetchData(currentPage.value, itemsPerPage.value) - data.value = newData - } catch (err) { - error.value = err - console.error('Error refreshing data:', err) - } finally { - loading.value = false - } - } - + // Watch for route changes watch(() => route.query.page, async (newPage) => { const page = parseInt(newPage) || 1 if (page !== currentPage.value) { - await fetchPageData(page) + currentPage.value = page } }) - onMounted(() => { - fetchPageData(currentPage.value) - }) - return { currentPage, itemsPerPage, @@ -70,7 +50,7 @@ export function usePaginatedData(fetchData, initialItemsPerPage = 4) { loading, error, updateCurrentPage, - fetchPageData, + fetchPageData: refresh, refresh } } \ No newline at end of file diff --git a/frontend/pages/blog/[slug].vue b/frontend/pages/blog/[slug].vue index 6b0603d..f5c0487 100644 --- a/frontend/pages/blog/[slug].vue +++ b/frontend/pages/blog/[slug].vue @@ -16,35 +16,37 @@ if (isPreview.value) { definePageMeta({ ssr: false }) } -const fetchPost = async () => { - try { - const result = await graphql.query(BLOG_POSTS_QUERY, { - slug: route.params.slug - }, { - previewToken: previewToken.value - }) - - if (!result?.blogPostsEntries?.length) { - throw new Error('Post not found') - } - - return result - } catch (err) { - console.error('Error fetching post:', err) - throw err - } -} - -const asyncData = useLazyAsyncData( +const { data, error, refresh } = await useAsyncData( `post-${route.params.slug}`, - () => fetchPost(), + async () => { + try { + const result = await graphql.query(BLOG_POSTS_QUERY, { + slug: route.params.slug + }, { + previewToken: previewToken.value + }) + + if (!result?.blogPostsEntries?.length) { + throw createError({ + statusCode: 404, + message: 'Post not found' + }) + } + + return result + } catch (err) { + console.error('Error fetching post:', err) + throw createError({ + statusCode: 404, + message: 'Post not found' + }) + } + }, { - default: () => ({ blogPostsEntries: [] }) + watch: [previewToken] // Watch preview token for changes } ) -const { data, error, refresh } = asyncData - // Watch for preview changes watch([isPreview, previewToken], () => { if (isPreview.value && previewToken.value) { @@ -65,7 +67,7 @@ useHead(() => ({