diff --git a/CLAUDE.md b/CLAUDE.md index c3438c2f..8c415488 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -82,7 +82,8 @@ server (`docs/architecture.md`, "The language bar"). every call through `useApi()` with `credentials: 'omit'`, so no cookie lands on a public page. - The theme follows the OS by default; `localStorage.theme` holds an explicit - choice. The portal is another origin and keeps its own. + choice. `/black-friday` alone is always dark. The portal is another origin and + keeps its own. ## Conventions diff --git a/composer.lock b/composer.lock index cfe5093f..9e9ff7d7 100644 --- a/composer.lock +++ b/composer.lock @@ -217,23 +217,23 @@ }, { "name": "doctrine/inflector", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" + "reference": "46351b6812b7b6d52b82c3efa5dfb786a198ec88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", - "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/46351b6812b7b6d52b82c3efa5dfb786a198ec88", + "reference": "46351b6812b7b6d52b82c3efa5dfb786a198ec88", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^12.0 || ^13.0", + "doctrine/coding-standard": "^12.0 || ^14.0", "phpstan/phpstan": "^1.12 || ^2.0", "phpstan/phpstan-phpunit": "^1.4 || ^2.0", "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", @@ -287,7 +287,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.1.0" + "source": "https://github.com/doctrine/inflector/tree/2.1.1" }, "funding": [ { @@ -303,7 +303,7 @@ "type": "tidelift" } ], - "time": "2025-08-10T19:31:58+00:00" + "time": "2026-10-26T08:14:14+00:00" }, { "name": "doctrine/lexer", @@ -382,16 +382,16 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.6.0", + "version": "v3.6.1", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013" + "reference": "4189372ffeff09bf14f731f67a9de90c7b413ebe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/d61a8a9604ec1f8c3d150d09db6ce98b32675013", - "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/4189372ffeff09bf14f731f67a9de90c7b413ebe", + "reference": "4189372ffeff09bf14f731f67a9de90c7b413ebe", "shasum": "" }, "require": { @@ -402,8 +402,8 @@ }, "require-dev": { "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^1.12.32|^2.1.31", - "phpunit/phpunit": "^8.5.48|^9.0" + "phpstan/phpstan": "^2.1.31", + "phpunit/phpunit": "^11.5.43 || ^12.4" }, "type": "library", "extra": { @@ -434,7 +434,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.6.0" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.6.1" }, "funding": [ { @@ -442,7 +442,7 @@ "type": "github" } ], - "time": "2025-10-31T18:51:33+00:00" + "time": "2026-10-19T17:53:57+00:00" }, { "name": "egulias/email-validator", @@ -646,25 +646,26 @@ }, { "name": "guzzlehttp/guzzle", - "version": "8.2.0", + "version": "8.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "93939470950a9b11e2e84204166ef5e048c55fe4" + "reference": "8e893188e1ac92b457eca35ddf2b574024b66280" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/93939470950a9b11e2e84204166ef5e048c55fe4", - "reference": "93939470950a9b11e2e84204166ef5e048c55fe4", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8e893188e1ac92b457eca35ddf2b574024b66280", + "reference": "8e893188e1ac92b457eca35ddf2b574024b66280", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^3.0.2", - "guzzlehttp/psr7": "^3.1", + "guzzlehttp/promises": "^3.1", + "guzzlehttp/psr7": "^3.4", "php": "^7.4 || ^8.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", "symfony/polyfill-php80": "^1.25", "symfony/polyfill-php82": "^1.27" }, @@ -675,7 +676,7 @@ "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", "guzzle/client-integration-tests": "4.0.1", - "guzzlehttp/test-server": "^1.0.1", + "guzzlehttp/test-server": "^1.1", "php-http/message-factory": "^1.1", "phpunit/phpunit": "^9.6.34", "psr/log": "^1.1 || ^2.0 || ^3.0" @@ -752,7 +753,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/8.2.0" + "source": "https://github.com/guzzle/guzzle/tree/8.5.2" }, "funding": [ { @@ -768,24 +769,25 @@ "type": "tidelift" } ], - "time": "2026-09-06T13:55:09+00:00" + "time": "2026-11-17T16:24:00+00:00" }, { "name": "guzzlehttp/promises", - "version": "3.0.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "42118e66a53c492effaf92bc357e931985d5c6f9" + "reference": "094d0ec418eb3b1411ea271a180ec95cae6ae933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/42118e66a53c492effaf92bc357e931985d5c6f9", - "reference": "42118e66a53c492effaf92bc357e931985d5c6f9", + "url": "https://api.github.com/repos/guzzle/promises/zipball/094d0ec418eb3b1411ea271a180ec95cae6ae933", + "reference": "094d0ec418eb3b1411ea271a180ec95cae6ae933", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "php": "^7.4 || ^8.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", @@ -835,7 +837,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/3.0.2" + "source": "https://github.com/guzzle/promises/tree/3.1.0" }, "funding": [ { @@ -851,26 +853,27 @@ "type": "tidelift" } ], - "time": "2026-08-24T10:00:26+00:00" + "time": "2026-10-18T12:48:16+00:00" }, { "name": "guzzlehttp/psr7", - "version": "3.1.0", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a3059ba1a84c9139c4ae03cf0f45bea276c97c74" + "reference": "180bd6fcebd1dc289cbec5c576135f4b6f576e02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a3059ba1a84c9139c4ae03cf0f45bea276c97c74", - "reference": "a3059ba1a84c9139c4ae03cf0f45bea276c97c74", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/180bd6fcebd1dc289cbec5c576135f4b6f576e02", + "reference": "180bd6fcebd1dc289cbec5c576135f4b6f576e02", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", "psr/http-factory": "^1.1", "psr/http-message": "^2.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", "symfony/polyfill-php80": "^1.25", "symfony/polyfill-php82": "^1.27" }, @@ -954,7 +957,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/3.1.0" + "source": "https://github.com/guzzle/psr7/tree/3.4.0" }, "funding": [ { @@ -970,7 +973,7 @@ "type": "tidelift" } ], - "time": "2026-08-24T11:02:13+00:00" + "time": "2026-11-13T03:03:24+00:00" }, { "name": "guzzlehttp/uri-template", @@ -1132,16 +1135,16 @@ }, { "name": "laravel/framework", - "version": "v13.34.0", + "version": "v13.43.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "c829b4982d29344cbcf1d7ad78eb5d2bb8ae66c4" + "reference": "72aa7e151062e218704d8660f407e6070040d8bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/c829b4982d29344cbcf1d7ad78eb5d2bb8ae66c4", - "reference": "c829b4982d29344cbcf1d7ad78eb5d2bb8ae66c4", + "url": "https://api.github.com/repos/laravel/framework/zipball/72aa7e151062e218704d8660f407e6070040d8bc", + "reference": "72aa7e151062e218704d8660f407e6070040d8bc", "shasum": "" }, "require": { @@ -1162,12 +1165,12 @@ "guzzlehttp/promises": "^2.0.3 || ^3.0", "guzzlehttp/psr7": "^2.9 || ^3.0", "guzzlehttp/uri-template": "^1.0 || ^2.0", - "laravel/prompts": "^0.3.11", + "laravel/prompts": "^0.3.25", "laravel/serializable-closure": "^2.0.10", "league/commonmark": "^2.8.1", "league/flysystem": "^3.25.1", "league/flysystem-local": "^3.25.1", - "league/uri": "^7.5.1", + "league/uri": "^7.6", "monolog/monolog": "^3.10", "nesbot/carbon": "^3.8.4", "nunomaduro/termwind": "^2.0", @@ -1196,6 +1199,7 @@ "voku/portable-ascii": "^2.0.2" }, "conflict": { + "laravel/horizon": "<5.47.0", "tightenco/collect": "<5.5.33" }, "provide": { @@ -1244,11 +1248,12 @@ "spatie/once": "*" }, "require-dev": { - "ably/ably-php": "^1.0", + "ably/pubsub-server": "^1.0|^2.0", "aws/aws-sdk-php": "^3.322.9", "ext-gmp": "*", "fakerphp/faker": "^1.24", - "intervention/image": "^4.0", + "intervention/image": "^4.2", + "jasonmccreary/double": "^1.1", "laravel/pint": "^1.18", "league/flysystem-aws-s3-v3": "^3.25.1", "league/flysystem-ftp": "^3.25.1", @@ -1257,10 +1262,10 @@ "league/flysystem-sftp-v3": "^3.25.1", "mockery/mockery": "^1.6.10", "opis/json-schema": "^2.4.1", - "orchestra/testbench-core": "^11.5.0", + "orchestra/testbench-core": "^11.6.0", "pda/pheanstalk": "^7.0.0 || ^8.0.0", "php-http/discovery": "^1.15", - "phpstan/phpstan": "2.2.15", + "phpstan/phpstan": "2.3.5", "phpunit/phpunit": "^11.5.50 || ^12.5.8 || ^13.0.3", "predis/predis": "^2.3 || ^3.0", "rector/rector": "2.6.3", @@ -1273,7 +1278,7 @@ "web-token/jwt-library": "^4.1" }, "suggest": { - "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", + "ably/pubsub-server": "Required to use the Ably broadcast driver (^1.0|^2.0).", "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).", "brianium/paratest": "Required to run tests in parallel (^7.0 || ^8.0).", "ext-apcu": "Required to use the APC cache driver.", @@ -1287,7 +1292,7 @@ "ext-redis": "Required to use the Redis cache and queue drivers (^4.0 || ^5.0 || ^6.0).", "fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).", "filp/whoops": "Required for friendly error pages in development (^2.14.3).", - "intervention/image": "Required to use the image processing features (^4.0).", + "intervention/image": "Required to use the image processing features (^4.2).", "laravel/tinker": "Required to use the tinker console command (^2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).", "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.25.1).", @@ -1359,20 +1364,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-09-29T12:46:21+00:00" + "time": "2026-11-17T14:58:33+00:00" }, { "name": "laravel/prompts", - "version": "v0.3.24", + "version": "v0.3.27", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b" + "reference": "abdfc75a1ae6c6f21522daed50da7124cbff09d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/5d3cdef29e93ca3b62b1871359db3078cd99908b", - "reference": "5d3cdef29e93ca3b62b1871359db3078cd99908b", + "url": "https://api.github.com/repos/laravel/prompts/zipball/abdfc75a1ae6c6f21522daed50da7124cbff09d2", + "reference": "abdfc75a1ae6c6f21522daed50da7124cbff09d2", "shasum": "" }, "require": { @@ -1415,23 +1420,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.24" + "source": "https://github.com/laravel/prompts/tree/v0.3.27" }, - "time": "2026-08-20T12:55:36+00:00" + "time": "2026-11-09T16:07:10+00:00" }, { "name": "laravel/serializable-closure", - "version": "v2.1.0", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "2d5869a838bbcf37e0d8b0568fc41914e81374b5" + "reference": "2bfb44e8af009b553ed2c060c94b0bc3c67b4769" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/2d5869a838bbcf37e0d8b0568fc41914e81374b5", - "reference": "2d5869a838bbcf37e0d8b0568fc41914e81374b5", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/2bfb44e8af009b553ed2c060c94b0bc3c67b4769", + "reference": "2bfb44e8af009b553ed2c060c94b0bc3c67b4769", "shasum": "" }, "require": { @@ -1479,7 +1483,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2026-09-22T14:32:34+00:00" + "time": "2026-10-14T21:20:29+00:00" }, { "name": "laravel/tinker", @@ -1929,20 +1933,21 @@ }, { "name": "league/uri", - "version": "7.8.1", + "version": "7.10.0", "source": { "type": "git", "url": "https://github.com/thephpleague/uri.git", - "reference": "08cf38e3924d4f56238125547b5720496fac8fd4" + "reference": "be89e2382e37acdef232259071ade5180821397b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri/zipball/08cf38e3924d4f56238125547b5720496fac8fd4", - "reference": "08cf38e3924d4f56238125547b5720496fac8fd4", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/be89e2382e37acdef232259071ade5180821397b", + "reference": "be89e2382e37acdef232259071ade5180821397b", "shasum": "" }, "require": { - "league/uri-interfaces": "^7.8.1", + "ext-mbstring": "*", + "league/uri-interfaces": "^7.10.0", "php": "^8.1", "psr/http-factory": "^1" }, @@ -2015,7 +2020,7 @@ "docs": "https://uri.thephpleague.com", "forum": "https://thephpleague.slack.com", "issues": "https://github.com/thephpleague/uri-src/issues", - "source": "https://github.com/thephpleague/uri/tree/7.8.1" + "source": "https://github.com/thephpleague/uri/tree/7.10.0" }, "funding": [ { @@ -2023,20 +2028,20 @@ "type": "github" } ], - "time": "2026-03-15T20:22:25+00:00" + "time": "2026-11-04T12:45:07+00:00" }, { "name": "league/uri-interfaces", - "version": "7.8.1", + "version": "7.10.0", "source": { "type": "git", "url": "https://github.com/thephpleague/uri-interfaces.git", - "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928" + "reference": "ea66240cff4ae9a56ce85d577a04d038b771e51c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/85d5c77c5d6d3af6c54db4a78246364908f3c928", - "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/ea66240cff4ae9a56ce85d577a04d038b771e51c", + "reference": "ea66240cff4ae9a56ce85d577a04d038b771e51c", "shasum": "" }, "require": { @@ -2099,7 +2104,7 @@ "docs": "https://uri.thephpleague.com", "forum": "https://thephpleague.slack.com", "issues": "https://github.com/thephpleague/uri-src/issues", - "source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.1" + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.10.0" }, "funding": [ { @@ -2107,20 +2112,20 @@ "type": "github" } ], - "time": "2026-03-08T20:05:35+00:00" + "time": "2026-11-04T12:45:07+00:00" }, { "name": "monolog/monolog", - "version": "3.12.1", + "version": "3.13.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15" + "reference": "1f5f55bb4a9a230ff6d8a4ceccea31d10b0142ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d7059e4c691d05ea1222b5124bed0f961be46e15", - "reference": "d7059e4c691d05ea1222b5124bed0f961be46e15", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1f5f55bb4a9a230ff6d8a4ceccea31d10b0142ac", + "reference": "1f5f55bb4a9a230ff6d8a4ceccea31d10b0142ac", "shasum": "" }, "require": { @@ -2200,7 +2205,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.12.1" + "source": "https://github.com/Seldaek/monolog/tree/3.13.0" }, "funding": [ { @@ -2212,20 +2217,20 @@ "type": "tidelift" } ], - "time": "2026-09-29T19:21:12+00:00" + "time": "2026-11-16T10:43:05+00:00" }, { "name": "nesbot/carbon", - "version": "3.14.2", + "version": "3.15.1", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224" + "reference": "ce0e5636fae7d1e99856eb70cae4c719a284aa08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/94cfc34887f07ab5c0efa07914c8f527544e3224", - "reference": "94cfc34887f07ab5c0efa07914c8f527544e3224", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/ce0e5636fae7d1e99856eb70cae4c719a284aa08", + "reference": "ce0e5636fae7d1e99856eb70cae4c719a284aa08", "shasum": "" }, "require": { @@ -2235,6 +2240,7 @@ "psr/clock": "^1.0", "symfony/clock": "^6.3.12 || ^7.0 || ^8.0", "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-time": "^1.0", "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0" }, "provide": { @@ -2317,7 +2323,7 @@ "type": "tidelift" } ], - "time": "2026-10-02T07:26:52+00:00" + "time": "2026-10-25T14:32:48+00:00" }, { "name": "nette/schema", @@ -2536,31 +2542,31 @@ }, { "name": "nunomaduro/termwind", - "version": "v2.4.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/nunomaduro/termwind.git", - "reference": "712a31b768f5daea284c2169a7d227031001b9a8" + "reference": "9b85ae4d802403bfc004ea633ce542bc262ee5c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8", - "reference": "712a31b768f5daea284c2169a7d227031001b9a8", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/9b85ae4d802403bfc004ea633ce542bc262ee5c3", + "reference": "9b85ae4d802403bfc004ea633ce542bc262ee5c3", "shasum": "" }, "require": { "ext-mbstring": "*", "php": "^8.2", - "symfony/console": "^7.4.4 || ^8.0.4" + "symfony/console": "^7.4.23 || ^8.1.11" }, "require-dev": { - "illuminate/console": "^11.47.0", - "laravel/pint": "^1.27.1", - "mockery/mockery": "^1.6.12", - "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2", - "phpstan/phpstan": "^1.12.32", + "illuminate/console": "^11.51 || ^12.70 || ^13.40", + "laravel/pint": "^1.30.4", + "mockery/mockery": "^1.6.15", + "pestphp/pest": "^2.36.1 || ^3.8.7 || ^4.7.8 || ^5.3.5", + "phpstan/phpstan": "^1.12.34", "phpstan/phpstan-strict-rules": "^1.6.2", - "symfony/var-dumper": "^7.3.5 || ^8.0.4", + "symfony/var-dumper": "^7.4.22 || ^8.1.10", "thecodingmachine/phpstan-strict-rules": "^1.0.0" }, "type": "library", @@ -2603,7 +2609,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0" + "source": "https://github.com/nunomaduro/termwind/tree/v2.4.1" }, "funding": [ { @@ -2619,7 +2625,7 @@ "type": "github" } ], - "time": "2026-02-16T23:10:27+00:00" + "time": "2026-11-07T03:57:16+00:00" }, { "name": "phiki/phiki", @@ -3339,16 +3345,16 @@ }, { "name": "ramsey/uuid", - "version": "4.9.4", + "version": "4.10.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2" + "reference": "f9aa3efc8015fcbc013d84d699583b268ccb593a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/75d73f48d02797c2c285a7e9f348fadc0102ffe2", - "reference": "75d73f48d02797c2c285a7e9f348fadc0102ffe2", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/f9aa3efc8015fcbc013d84d699583b268ccb593a", + "reference": "f9aa3efc8015fcbc013d84d699583b268ccb593a", "shasum": "" }, "require": { @@ -3360,23 +3366,22 @@ "rhumsaa/uuid": "self.version" }, "require-dev": { - "captainhook/captainhook": "^5.25", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "ergebnis/composer-normalize": "^2.47", - "mockery/mockery": "^1.6", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.6", - "php-mock/php-mock-mockery": "^1.5", + "captainhook/captainhook": "^5.29.3", + "captainhook/plugin-composer": "^5.3.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.2.1", + "mockery/mockery": "^1.6.15", + "paragonie/random-lib": "^2.0.3", + "php-mock/php-mock": "^2.7.0", + "php-mock/php-mock-mockery": "^1.5.0", "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpbench/phpbench": "^1.2.14", - "phpstan/extension-installer": "^1.4", - "phpstan/phpstan": "^2.1", - "phpstan/phpstan-mockery": "^2.0", - "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6", - "slevomat/coding-standard": "^8.18", - "squizlabs/php_codesniffer": "^3.13" + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.3.5", + "phpstan/phpstan-mockery": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.1.2", + "phpunit/phpunit": "^9.6.39", + "slevomat/coding-standard": "^8.31.3", + "squizlabs/php_codesniffer": "^4.0.4" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", @@ -3411,9 +3416,9 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.9.4" + "source": "https://github.com/ramsey/uuid/tree/4.10.0" }, - "time": "2026-09-16T11:39:30+00:00" + "time": "2026-11-14T23:23:20+00:00" }, { "name": "spatie/browsershot", @@ -5608,16 +5613,16 @@ }, { "name": "symfony/polyfill-php85", - "version": "v1.43.0", + "version": "v1.44.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php85.git", - "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6" + "reference": "94c794cb5ba51784bc259f11e9f128593297d8dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/86a42cbcc07adc331481a5ab310a4024bfc227f6", - "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/94c794cb5ba51784bc259f11e9f128593297d8dc", + "reference": "94c794cb5ba51784bc259f11e9f128593297d8dc", "shasum": "" }, "require": { @@ -5664,7 +5669,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php85/tree/v1.43.0" + "source": "https://github.com/symfony/polyfill-php85/tree/v1.44.0" }, "funding": [ { @@ -5684,7 +5689,7 @@ "type": "tidelift" } ], - "time": "2026-09-25T15:46:47+00:00" + "time": "2026-10-30T15:20:09+00:00" }, { "name": "symfony/polyfill-php86", @@ -5766,6 +5771,89 @@ ], "time": "2026-09-25T15:46:47+00:00" }, + { + "name": "symfony/polyfill-time", + "version": "v1.42.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-time.git", + "reference": "ac9f1ed802dd58f37e720388130c088434aa09fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-time/zipball/ac9f1ed802dd58f37e720388130c088434aa09fc", + "reference": "ac9f1ed802dd58f37e720388130c088434aa09fc", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Time\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Philippe Nyamagana Butera", + "email": "nyamsprod@gmail.com" + }, + { + "name": "Tim Düsterhus", + "email": "tim@tideways-gmbh.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Time API added to PHP 8.6", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "duration", + "polyfill", + "portable", + "shim", + "time" + ], + "support": { + "source": "https://github.com/symfony/polyfill-time/tree/v1.42.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-08-07T13:08:13+00:00" + }, { "name": "symfony/polyfill-uuid", "version": "v1.43.0", @@ -6644,16 +6732,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.7.0", + "version": "v5.8.0", "source": { "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "301c07936b16d88628b126b01d082ba153cf4c40" + "url": "https://github.com/phpdotenv/phpdotenv.git", + "reference": "96149103e62ac67e915f6d2ef59b72dee2e011e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/301c07936b16d88628b126b01d082ba153cf4c40", - "reference": "301c07936b16d88628b126b01d082ba153cf4c40", + "url": "https://api.github.com/repos/phpdotenv/phpdotenv/zipball/96149103e62ac67e915f6d2ef59b72dee2e011e0", + "reference": "96149103e62ac67e915f6d2ef59b72dee2e011e0", "shasum": "" }, "require": { @@ -6680,7 +6768,7 @@ "forward-command": false }, "branch-alias": { - "dev-master": "5.6-dev" + "dev-master": "5.8-dev" } }, "autoload": { @@ -6711,8 +6799,8 @@ "environment" ], "support": { - "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.7.0" + "issues": "https://github.com/phpdotenv/phpdotenv/issues", + "source": "https://github.com/phpdotenv/phpdotenv/tree/v5.8.0" }, "funding": [ { @@ -6724,7 +6812,7 @@ "type": "tidelift" } ], - "time": "2026-08-24T18:07:49+00:00" + "time": "2026-10-25T16:26:19+00:00" }, { "name": "voku/portable-ascii", @@ -6897,20 +6985,20 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.6", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca" + "reference": "d2e16653a734c8784c1851ad68b02f997b53ca82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", - "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/d2e16653a734c8784c1851ad68b02f997b53ca82", + "reference": "d2e16653a734c8784c1851ad68b02f997b53ca82", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.4 || ^8.0" }, "conflict": { "phpunit/phpunit": "<=7.5 || >=14" @@ -6939,9 +7027,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.6" + "source": "https://github.com/doctrine/deprecations/tree/1.2.0" }, - "time": "2026-02-07T07:09:04+00:00" + "time": "2026-11-11T10:04:49+00:00" }, { "name": "fidry/cpu-core-counter", @@ -10338,16 +10426,16 @@ }, { "name": "webmozart/assert", - "version": "2.4.1", + "version": "2.5.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "2ccb7c2e821038c03a3e6e1700c570c158c55f70" + "reference": "e578132c01bd0c64108386ab20d8217cd175ddec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/2ccb7c2e821038c03a3e6e1700c570c158c55f70", - "reference": "2ccb7c2e821038c03a3e6e1700c570c158c55f70", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/e578132c01bd0c64108386ab20d8217cd175ddec", + "reference": "e578132c01bd0c64108386ab20d8217cd175ddec", "shasum": "" }, "require": { @@ -10398,9 +10486,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/2.4.1" + "source": "https://github.com/webmozarts/assert/tree/2.5.1" }, - "time": "2026-06-15T15:31:57+00:00" + "time": "2026-11-15T13:41:13+00:00" } ], "aliases": [], diff --git a/docs/rebuild/design/design-system.md b/docs/rebuild/design/design-system.md index b44a520b..7dfab7c0 100644 --- a/docs/rebuild/design/design-system.md +++ b/docs/rebuild/design/design-system.md @@ -265,19 +265,22 @@ Every row of the §2.3 table becomes an assertion. Add a gamut assertion: no tok var t = localStorage.getItem('theme'); if (t === 'dark' || t === 'system' || t === 'light') { choice = t; } } catch (e) {} - var dark = choice === 'dark' || (choice === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); var root = document.documentElement; + var forced = root.dataset.themeForced === 'dark'; + var dark = forced || choice === 'dark' || (choice === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); if (dark) { root.classList.add('dark'); } root.dataset.themeChoice = choice; /* drives the control's icon without hydration */ root.style.colorScheme = dark ? 'dark' : 'light'; var m = document.querySelector('meta[name="theme-color"]'); - if (m) { m.setAttribute('content', dark ? '#121212' : '#ffffff'); } + if (m) { m.setAttribute('content', forced ? '#060606' : dark ? '#121212' : '#ffffff'); } })(); ``` `#ffffff` and `#121212` are the two `--background` values in §2.2. +**The one forced page.** `/black-friday` is dark in both themes, from the banner to the footer (owner decision, 2026-11-18). Blade stamps `html[data-theme-forced="dark"]` and `LandingLayout`'s `alwaysDark` holds it across visits inside the app. The reader's stored choice is untouched, the theme control is hidden there, and `--background`, `--surface` and `--raised` drop to `oklch(0.12 0 0)` (`#060606`), `oklch(0.15 0 0)` and `oklch(0.18 0 0)`. + **Rules:** - SSR markup never depends on the theme. diff --git a/docs/rebuild/design/positioning.md b/docs/rebuild/design/positioning.md index 88866b5d..8c5ec2f6 100644 --- a/docs/rebuild/design/positioning.md +++ b/docs/rebuild/design/positioning.md @@ -447,7 +447,7 @@ prices, with a code that works only inside the window (`App\Support\Pricing\Camp - **Where, while it is live:** the banner slot on every page but the sale's own, a black band above the homepage hero and Pricing's header, and the plan cards of the cycles it covers. Checkout from the site attaches the code. Before and after the window, only the sale's own page mentions it. -- **The sale's own page,** `/black-friday`, keeps one URL from year to year. Before the sale it states the window and +- **The sale's own page,** `/black-friday`, keeps one URL from year to year and is black throughout, in both themes. Before the sale it states the window and the prices, and offers a calendar file for the start instead of a button that cannot be pressed; during it the offers can be bought from it; after it, its title, heading and description say the sale has ended, and nothing on it is offered. Its copy stays near 150 words: the offers as two ruled rows, Pro one-time first and larger, then the Pro diff --git a/resources/css/app.css b/resources/css/app.css index 4393609c..6b10cf3c 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -249,6 +249,19 @@ html.campaign-live .campaign-band { color: var(--foreground); } +/* /black-friday is black from the banner to the footer in either theme, so its hero's ground is the page's. */ +@media screen { + html[data-theme-forced] { + --background: oklch(0.12 0 0); + --surface: oklch(0.15 0 0); + --raised: oklch(0.18 0 0); + } +} + +html[data-theme-forced] .theme-setting { + display: none; +} + .campaign-banner { border-bottom: 1px solid color-mix(in oklab, var(--accent) 45%, var(--rule)); } diff --git a/resources/js/components/shared/footer-bar.tsx b/resources/js/components/shared/footer-bar.tsx index 34cffcbc..2ba46888 100644 --- a/resources/js/components/shared/footer-bar.tsx +++ b/resources/js/components/shared/footer-bar.tsx @@ -130,16 +130,6 @@ interface FooterBarProps { className?: string; } -/** - * The last row of every page in both apps (design-system §5.3.17): the mark - * and the copyright on the left, the language menu and the theme on the - * right. Its rule runs rail to rail, so above a cell grid it lands on the - * grid's last line and draws it once. - * - * With `chat`, the controls stop short of the chat launcher: they keep - * `LAUNCHER_REACH` clear of the screen's right edge, which costs nothing once - * the page's own margin is that wide (from about 1416px). - */ export default function FooterBar({ copyright, language, themeLabels, chat = false, className }: FooterBarProps) { return (
{language} - +
); diff --git a/resources/js/components/site/mobile-nav.tsx b/resources/js/components/site/mobile-nav.tsx index 940061d4..16eaf2f1 100644 --- a/resources/js/components/site/mobile-nav.tsx +++ b/resources/js/components/site/mobile-nav.tsx @@ -37,23 +37,6 @@ interface MobileNavProps { desktop: string; } -/** - * The menu below the desktop header (sitemap §B.2; design-system §5.3.17): a - * modal `` sheet over the whole viewport. - * - * `showModal()` traps focus and makes the page behind it inert; Escape and the - * close button close it, and focus returns to the toggle that opened it. - * Crossing to the desktop layout while it is open closes it too, so a rotated - * tablet never keeps a scroll-locked page with no visible control. - * - * Order: Features (expanding in place to the same links as the desktop menu), - * Databases, Pricing, the platform pages, Docs, Blog, FAQ, GitHub with its star - * count, Account; then - * Download for Mac and the App Store badge, each with the system it needs, so - * both are on the first screen of a phone; last, the language, one row that - * opens the list, and the theme control. On an iPhone or iPad the badge comes - * before the Mac button. - */ export default function MobileNav({ id, open, onClose, desktop }: MobileNavProps) { const { locale, m, fmt } = useI18n(); const { url } = usePage(); @@ -278,7 +261,7 @@ export default function MobileNav({ id, open, onClose, desktop }: MobileNavProps
-
+
diff --git a/resources/js/layouts/landing-layout.tsx b/resources/js/layouts/landing-layout.tsx index aee26578..b731e815 100644 --- a/resources/js/layouts/landing-layout.tsx +++ b/resources/js/layouts/landing-layout.tsx @@ -1,4 +1,4 @@ -import { useEffect, type ReactNode } from 'react'; +import { useEffect, useLayoutEffect, type ReactNode } from 'react'; import { useLiveChat } from '@/components/site/chat-button'; import ConsentBar from '@/components/site/consent-bar'; import FrameRails from '@/components/shared/frame-rails'; @@ -6,62 +6,28 @@ import SiteFooter from '@/components/site/site-footer'; import SiteHeader from '@/components/site/site-header'; import TopBanner from '@/components/site/top-banner'; import { useI18n } from '@/i18n'; -import { syncTheme } from '@/lib/theme'; +import { forceDark, syncTheme } from '@/lib/theme'; interface Props { children: ReactNode; - /** - * False on a page that carries its own newsletter form (the blog index), - * so the footer does not repeat the same field a screen below it. - */ footerNewsletter?: boolean; + alwaysDark?: boolean; } -/** - * The public page frame: a stack in reading and tab order, drawn as a grid - * (design-system §4.6, §4.7, §7.2). - * - * 1. The skip link, first in the document. - * 2. The top banner, which scrolls away with the page: the license banner, - * or the bar offering this page in the reader's language. Then the sticky - * header. The header is a real `banner` landmark because it sits outside - * `
`. - * 3. `
`, so the skip link moves focus - * into it rather than only scrolling. - * 4. The footer, a `contentinfo` landmark for the same reason. - * 5. The consent bar, last, so it is the last tab stop on the page. - * - * The grid is drawn, not laid out: the rails are a decorative overlay on this - * `relative` root (`FrameRails`, from 1280px), and a full-bleed hairline joins - * every two blocks of `
` (frame.css). Neither moves content or takes a - * tab stop. - * - * Crisp's chat launcher joins every page once it has loaded and the browser is - * idle (`useLiveChat`, `lib/crisp.ts`); it is not part of the server render. - * - * There is no toast region: nothing on the public site calls `toast()`, and - * Sonner's region carried an English landmark name onto every /vi page. - * - * Nothing here clips overflow: `overflow-x: hidden` on an ancestor masked - * horizontal-scroll regressions instead of preventing them, and would break the - * sticky header. Anything wide scrolls inside its own region. - */ -export default function LandingLayout({ children, footerNewsletter = true }: Props) { +// Nothing here clips overflow: `overflow-x: hidden` on an ancestor would break the sticky header. +export default function LandingLayout({ children, footerNewsletter = true, alwaysDark = false }: Props) { const { locale, m } = useI18n(); - /* - * `` is right on the first byte, from Blade. A visit between - * locales is a full document load (`LocaleLink` renders a plain `` for - * it), so this only matters if history navigation ever restores a page in - * the other language without one. It is a safety net, not the mechanism. - */ + // History navigation can restore a page in another language without a document load. useEffect(() => { document.documentElement.lang = locale; }, [locale]); - /* Another tab changed the theme, or the system did while "System" is chosen. */ useEffect(() => syncTheme(), []); + // Before paint, so a visit from a light page never shows this one light. Blade covers the first load. + useLayoutEffect(() => (alwaysDark ? forceDark() : undefined), [alwaysDark]); + useLiveChat(); return ( diff --git a/resources/js/lib/theme.ts b/resources/js/lib/theme.ts index be2e27f0..b72bf8d2 100644 --- a/resources/js/lib/theme.ts +++ b/resources/js/lib/theme.ts @@ -23,8 +23,8 @@ export type ThemeChoice = 'light' | 'dark' | 'system'; export const THEME_CHOICES: readonly ThemeChoice[] = ['light', 'dark', 'system']; -/** `theme-color` per resolved theme: the two `--background` values in tokens.css. */ -export const THEME_COLORS = { light: '#ffffff', dark: '#121212' } as const; +// `sale` is the `--background` app.css gives a page under `html[data-theme-forced]`. +export const THEME_COLORS = { light: '#ffffff', dark: '#121212', sale: '#060606' } as const; const SYSTEM_DARK_QUERY = '(prefers-color-scheme: dark)'; @@ -56,28 +56,20 @@ export function resolveDark(choice: ThemeChoice, prefersDark: boolean): boolean return choice === 'dark' || (choice === 'system' && prefersDark); } -/** - * Paints `choice` on the document without storing it. - * - * Toggles `.dark` (every token and every themed image follows that class, never - * the media query), and updates `data-theme-choice` (which drives the theme - * control's icon and selected option from CSS), `color-scheme` and the single - * `theme-color` meta. - * - * Transitions are suppressed for one frame with `theme-switching`, so the - * colour transitions on links and buttons do not ripple across the page as - * every token changes at once. - */ export function renderTheme(choice: ThemeChoice): void { const root = document.documentElement; - const dark = resolveDark(choice, systemPrefersDark()); + const forced = root.dataset.themeForced === 'dark'; + const dark = forced || resolveDark(choice, systemPrefersDark()); + // `theme-switching` stops link and button transitions rippling across the page as every token changes. root.classList.add('theme-switching'); root.classList.toggle('dark', dark); root.dataset.themeChoice = choice; root.style.colorScheme = dark ? 'dark' : 'light'; - document.querySelector('meta[name="theme-color"]')?.setAttribute('content', dark ? THEME_COLORS.dark : THEME_COLORS.light); + document + .querySelector('meta[name="theme-color"]') + ?.setAttribute('content', forced ? THEME_COLORS.sale : dark ? THEME_COLORS.dark : THEME_COLORS.light); // Reading a computed value forces the new colours to apply while // transitions are still off; the class comes off on the next frame. @@ -92,6 +84,19 @@ export function renderTheme(choice: ThemeChoice): void { } } +// Holds the page dark whatever the reader chose, without touching that choice. Returns the release. +export function forceDark(): () => void { + const root = document.documentElement; + + root.dataset.themeForced = 'dark'; + renderTheme(readTheme()); + + return () => { + delete root.dataset.themeForced; + renderTheme(readTheme()); + }; +} + /** * The reader chose a theme: store it, paint it, and tell every control. * diff --git a/resources/js/pages/BlackFriday.tsx b/resources/js/pages/BlackFriday.tsx index 6a4e0ea0..195ff7dc 100644 --- a/resources/js/pages/BlackFriday.tsx +++ b/resources/js/pages/BlackFriday.tsx @@ -119,7 +119,7 @@ export default function BlackFriday({ content, paidFeatures, organizationProfile const big = { big: (text: string) => {text} }; return ( - + isLive() ? 'campaign-live' : null])) - + diff --git a/resources/views/partials/head-theme.blade.php b/resources/views/partials/head-theme.blade.php index 144f46eb..d25dee47 100644 --- a/resources/views/partials/head-theme.blade.php +++ b/resources/views/partials/head-theme.blade.php @@ -6,12 +6,13 @@ var t = localStorage.getItem('theme'); if (t === 'dark' || t === 'system' || t === 'light') { choice = t; } } catch (e) {} - var dark = choice === 'dark' || (choice === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); var root = document.documentElement; + var forced = root.dataset.themeForced === 'dark'; + var dark = forced || choice === 'dark' || (choice === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); if (dark) { root.classList.add('dark'); } root.dataset.themeChoice = choice; /* drives the control's icon without hydration */ root.style.colorScheme = dark ? 'dark' : 'light'; var m = document.querySelector('meta[name="theme-color"]'); - if (m) { m.setAttribute('content', dark ? '#121212' : '#ffffff'); } + if (m) { m.setAttribute('content', forced ? '#060606' : dark ? '#121212' : '#ffffff'); } })(); diff --git a/tests/Feature/Pages/CampaignTest.php b/tests/Feature/Pages/CampaignTest.php index afd2700d..e5169f06 100644 --- a/tests/Feature/Pages/CampaignTest.php +++ b/tests/Feature/Pages/CampaignTest.php @@ -23,6 +23,15 @@ function afterSale(): void travelTo(Campaign::current()?->endsAt ?? now()); } +it('holds only the sale page dark before first paint', function (string $path, bool $forced): void { + expect(str_contains(get($path)->assertOk()->getContent(), 'data-theme-forced="dark"'))->toBe($forced); +})->with([ + 'the sale page' => ['/black-friday', true], + 'a translated sale page' => ['/vi/black-friday', true], + 'the homepage' => ['/', false], + 'pricing' => ['/pricing', false], +]); + it('is upcoming before the start, live from it, and ended from the end', function (): void { $campaign = saleCampaign(); diff --git a/tests/js/theme.test.ts b/tests/js/theme.test.ts index a10ffe6e..1adcfd24 100644 --- a/tests/js/theme.test.ts +++ b/tests/js/theme.test.ts @@ -8,6 +8,7 @@ import { THEME_COLORS, THEME_STORAGE_KEY, applyTheme, + forceDark, parseTheme, readTheme, renderTheme, @@ -246,8 +247,33 @@ test('another tab changing the key repaints this one without writing it back', ( assert.equal(browser.events.length, 1, 'an unrelated key changes nothing'); }); -// The head partial cannot import this module, so it repeats the decision. -test('the head script and this module make the same decision', () => { +test('a forced page stays dark through every repaint and gives the reader their theme back', () => { + const browser = installBrowser({ stored: 'light', systemDark: false }); + + syncTheme(); + const release = forceDark(); + + assert.ok(browser.root.classes.has('dark')); + assert.equal(browser.root.style.colorScheme, 'dark'); + assert.equal(browser.themeColor.content, THEME_COLORS.sale); + assert.equal(browser.root.dataset.themeChoice, 'light'); + assert.equal(browser.storage.get(THEME_STORAGE_KEY), 'light'); + + for (const listener of browser.listeners.get('storage') ?? []) { + listener({ key: THEME_STORAGE_KEY }); + } + + assert.ok(browser.root.classes.has('dark'), 'another tab cannot lighten it'); + + release(); + + assert.ok(!browser.root.classes.has('dark')); + assert.equal(browser.root.dataset.themeForced, undefined); + assert.equal(browser.root.style.colorScheme, 'light'); + assert.equal(browser.themeColor.content, THEME_COLORS.light); +}); + +function headScript(): string { const partial = readFileSync( fileURLToPath(new URL('../../resources/views/partials/head-theme.blade.php', import.meta.url)), 'utf8', @@ -256,6 +282,30 @@ test('the head script and this module make the same decision', () => { assert.ok(script, 'the partial holds an inline script'); + return script; +} + +test('the head script paints a forced page dark over a stored light choice', () => { + const browser = installBrowser({ stored: 'light', systemDark: false }); + + browser.root.dataset.themeForced = 'dark'; + + new Function('window', 'localStorage', 'document', headScript())( + (globalThis as Record).window, + (globalThis as unknown as { window: { localStorage: unknown } }).window.localStorage, + (globalThis as Record).document, + ); + + assert.ok(browser.root.classes.has('dark')); + assert.equal(browser.root.dataset.themeChoice, 'light'); + assert.equal(browser.root.style.colorScheme, 'dark'); + assert.equal(browser.themeColor.content, THEME_COLORS.sale); +}); + +// The head partial cannot import this module, so it repeats the decision. +test('the head script and this module make the same decision', () => { + const script = headScript(); + const cases: { stored?: string; storageThrows?: boolean; systemDark: boolean }[] = [ { systemDark: false }, { systemDark: true },