@cosmicdrift/kumiko-headless 0.145.1 → 0.146.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/apex/index.ts +19 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-headless",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.146.0",
|
|
4
4
|
"description": "Headless UI logic for Kumiko — Dispatcher contract, Form-Controller, View-Model, Nav-Resolver. Plattform- und React-frei; jeder Renderer (renderer, renderer-web, renderer-native, …) komponiert darauf.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
39
|
+
"@cosmicdrift/kumiko-framework": "0.146.0",
|
|
40
40
|
"zod": "^4.4.3"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
package/src/apex/index.ts
CHANGED
|
@@ -451,12 +451,11 @@ function renderFooter(f: ApexFooter): string {
|
|
|
451
451
|
</footer>`;
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
const sections = page.sections.map(renderSection).join("\n\n ");
|
|
454
|
+
// All <title>/meta/link/script tags for an ApexHead — the single source both
|
|
455
|
+
// renderApexPage and any other head (e.g. page-render's wrapInLayout) splice
|
|
456
|
+
// into their own <head>. Extracted verbatim from renderApexPage so existing
|
|
457
|
+
// output stays byte-identical (see render.test.ts regression coverage).
|
|
458
|
+
export function renderApexHeadTags(head: ApexHead): string {
|
|
460
459
|
const ogUrl =
|
|
461
460
|
head.canonicalUrl !== undefined
|
|
462
461
|
? `\n <meta property="og:url" content="${escapeHtml(head.canonicalUrl)}" />`
|
|
@@ -506,16 +505,25 @@ export function renderApexPage(page: ApexPage): string {
|
|
|
506
505
|
head.schemaJson !== undefined
|
|
507
506
|
? `\n <script type="application/ld+json">${scriptSafeJsonHtml(head.schemaJson)}</script>`
|
|
508
507
|
: "";
|
|
508
|
+
return `<title>${escapeHtml(head.title)}</title>
|
|
509
|
+
<meta name="description" content="${escapeHtml(head.description)}" />
|
|
510
|
+
<meta property="og:title" content="${escapeHtml(head.title)}" />
|
|
511
|
+
<meta property="og:description" content="${escapeHtml(head.description)}" />
|
|
512
|
+
<meta property="og:type" content="website" />${ogUrl}${ogImage}${siteName}${locale}${twitterCard}${twitterSite}${favicon}${canonical}${alternates}${robots}${preconnects}${schema}`;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export function renderApexPage(page: ApexPage): string {
|
|
516
|
+
const { head, brand } = page;
|
|
517
|
+
const theme = page.theme ?? "light";
|
|
518
|
+
// Brand-CSS ist app-authored (Trust-Boundary siehe Datei-Header), kein Tenant-Input.
|
|
519
|
+
const cssHtml = (brand.fontFaceCss ?? "") + brand.tokensCss + APEX_STRUCTURAL_CSS;
|
|
520
|
+
const sections = page.sections.map(renderSection).join("\n\n ");
|
|
509
521
|
return `<!doctype html>
|
|
510
522
|
<html lang="${escapeHtml(head.lang)}">
|
|
511
523
|
<head>
|
|
512
524
|
<meta charset="utf-8" />
|
|
513
525
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
514
|
-
|
|
515
|
-
<meta name="description" content="${escapeHtml(head.description)}" />
|
|
516
|
-
<meta property="og:title" content="${escapeHtml(head.title)}" />
|
|
517
|
-
<meta property="og:description" content="${escapeHtml(head.description)}" />
|
|
518
|
-
<meta property="og:type" content="website" />${ogUrl}${ogImage}${siteName}${locale}${twitterCard}${twitterSite}${favicon}${canonical}${alternates}${robots}${preconnects}${schema}
|
|
526
|
+
${renderApexHeadTags(head)}
|
|
519
527
|
<style>${cssHtml}</style>
|
|
520
528
|
</head>
|
|
521
529
|
<body${theme === "dark" ? ` class="apex-dark"` : ""}>
|