diff --git a/composer.json b/composer.json index 4a02727..c153c37 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "milpa/tool-runtime": ">=0.13 <1.0", "nyholm/psr7": "^1.8", "nyholm/psr7-server": "^1.1", - "milpa/live-web": ">=0.26.1 <1.0" + "milpa/live-web": ">=0.27 <1.0" }, "conflict": { "milpa/agent": "<0.5", diff --git a/src/Plugins/HelloPlugin/Controllers/HomeController.php b/src/Plugins/HelloPlugin/Controllers/HomeController.php index becff47..57264a0 100644 --- a/src/Plugins/HelloPlugin/Controllers/HomeController.php +++ b/src/Plugins/HelloPlugin/Controllers/HomeController.php @@ -20,8 +20,10 @@ use Milpa\Live\Components\CodeBlockComponent; use Milpa\Live\Contracts\Component\ComponentDefinitionInterface; use Milpa\Live\Contracts\Rendering\ComponentRendererInterface; +use App\Plugins\HelloPlugin\HelloPlugin; use Milpa\Live\Rendering\BrandMarkHtmlRenderer; use Milpa\Live\Rendering\CodeBlockHtmlRenderer; +use Milpa\Live\Support\DesignTokens; use Milpa\Live\ValueObjects\ComponentContext; use Milpa\Live\ValueObjects\RenderRequest; use Milpa\Live\ValueObjects\RenderTarget; @@ -223,12 +225,30 @@ private function elsewhere(): string return $html; } + /** + * The design system's tags, from the authority rather than from typing. + * + * The three filenames used to be spelled here, a fourth time in this family, and the prefix a + * fourth WAY — which is how `/design/` came to exist next to `/webauthn/`, `/admin/assets/` and + * `/live/` without anyone choosing four. {@see HelloPlugin::designPrefix()} owns the prefix and + * {@see DesignTokens::urls()} owns the filenames; this method owns neither + * (greenhouse decisions/0308). + */ + private static function designLinks(): string + { + $design = DesignTokens::urls(HelloPlugin::designPrefix()); + + return '' + . '' + . DesignTokens::iconLink($design[DesignTokens::APP_ICON]); + } + private function html(): string { $assets = self::assets(); return \str_replace( - ['__GREETING__', '__MARK__', '__DOOR__', '__WAYS_OUT__', '__ELSEWHERE__', '__STYLES__', '__SCRIPTS__'], + ['__GREETING__', '__MARK__', '__DOOR__', '__WAYS_OUT__', '__ELSEWHERE__', '__DESIGN__', '__STYLES__', '__SCRIPTS__'], [ htmlspecialchars($this->greeting, \ENT_QUOTES, 'UTF-8'), // READY, not `sown`: the mark reports what the surface is doing, and this page has @@ -238,6 +258,7 @@ private function html(): string self::door(), self::waysOut(), $this->elsewhere(), + self::designLinks(), $assets->styleTag(), $assets->scriptTag(), ], @@ -248,9 +269,7 @@ private function html(): string Milpa is running - - - + __DESIGN__ __STYLES__