@caelo-cms/shared 0.10.22 → 0.10.23
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/dist/ai-tools.d.ts +290 -214
- package/dist/ai-tools.d.ts.map +1 -1
- package/dist/ai-tools.js +341 -264
- package/dist/ai-tools.js.map +1 -1
- package/dist/auth-forms.d.ts.map +1 -1
- package/dist/auth-forms.js +4 -1
- package/dist/auth-forms.js.map +1 -1
- package/dist/base-css.d.ts +24 -0
- package/dist/base-css.d.ts.map +1 -0
- package/dist/base-css.js +28 -0
- package/dist/base-css.js.map +1 -0
- package/dist/build-page.d.ts +330 -0
- package/dist/build-page.d.ts.map +1 -0
- package/dist/build-page.js +282 -0
- package/dist/build-page.js.map +1 -0
- package/dist/content.d.ts +322 -9
- package/dist/content.d.ts.map +1 -1
- package/dist/content.js +354 -11
- package/dist/content.js.map +1 -1
- package/dist/css-gradient-scan.d.ts +14 -0
- package/dist/css-gradient-scan.d.ts.map +1 -0
- package/dist/css-gradient-scan.js +81 -0
- package/dist/css-gradient-scan.js.map +1 -0
- package/dist/css-var-scan.d.ts +56 -0
- package/dist/css-var-scan.d.ts.map +1 -0
- package/dist/css-var-scan.js +97 -0
- package/dist/css-var-scan.js.map +1 -0
- package/dist/design-manifest.d.ts +36 -0
- package/dist/design-manifest.d.ts.map +1 -0
- package/dist/design-manifest.js +90 -0
- package/dist/design-manifest.js.map +1 -0
- package/dist/fonts.d.ts +89 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +241 -0
- package/dist/fonts.js.map +1 -0
- package/dist/genesis-inventory.d.ts +32 -0
- package/dist/genesis-inventory.d.ts.map +1 -0
- package/dist/genesis-inventory.js +186 -0
- package/dist/genesis-inventory.js.map +1 -0
- package/dist/genesis.d.ts +62 -0
- package/dist/genesis.d.ts.map +1 -0
- package/dist/genesis.js +78 -0
- package/dist/genesis.js.map +1 -0
- package/dist/i18n.d.ts +44 -1
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +72 -6
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -1
- package/dist/interactions.d.ts +23 -0
- package/dist/interactions.d.ts.map +1 -0
- package/dist/interactions.js +44 -0
- package/dist/interactions.js.map +1 -0
- package/dist/media.d.ts +101 -16
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +126 -15
- package/dist/media.js.map +1 -1
- package/dist/page-log.d.ts +94 -0
- package/dist/page-log.d.ts.map +1 -0
- package/dist/page-log.js +111 -0
- package/dist/page-log.js.map +1 -0
- package/dist/preview-compose.d.ts +79 -0
- package/dist/preview-compose.d.ts.map +1 -1
- package/dist/preview-compose.js +155 -25
- package/dist/preview-compose.js.map +1 -1
- package/dist/proposal-status.d.ts +40 -0
- package/dist/proposal-status.d.ts.map +1 -0
- package/dist/proposal-status.js +34 -0
- package/dist/proposal-status.js.map +1 -0
- package/dist/responsive-images.d.ts +64 -0
- package/dist/responsive-images.d.ts.map +1 -0
- package/dist/responsive-images.js +98 -0
- package/dist/responsive-images.js.map +1 -0
- package/dist/safe-keys.d.ts +9 -0
- package/dist/safe-keys.d.ts.map +1 -0
- package/dist/safe-keys.js +20 -0
- package/dist/safe-keys.js.map +1 -0
- package/dist/seo.d.ts +8 -0
- package/dist/seo.d.ts.map +1 -1
- package/dist/seo.js +3 -1
- package/dist/seo.js.map +1 -1
- package/dist/skills.d.ts +14 -68
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +19 -113
- package/dist/skills.js.map +1 -1
- package/dist/strip-cdata.d.ts +7 -0
- package/dist/strip-cdata.d.ts.map +1 -0
- package/dist/strip-cdata.js +48 -0
- package/dist/strip-cdata.js.map +1 -0
- package/dist/structured-sets.d.ts +6 -16
- package/dist/structured-sets.d.ts.map +1 -1
- package/dist/structured-sets.js +5 -16
- package/dist/structured-sets.js.map +1 -1
- package/dist/subagents.d.ts +105 -3
- package/dist/subagents.d.ts.map +1 -1
- package/dist/subagents.js +224 -41
- package/dist/subagents.js.map +1 -1
- package/dist/template-engine.d.ts +85 -0
- package/dist/template-engine.d.ts.map +1 -0
- package/dist/template-engine.js +403 -0
- package/dist/template-engine.js.map +1 -0
- package/dist/theme-importers/auto-detect.d.ts +26 -0
- package/dist/theme-importers/auto-detect.d.ts.map +1 -0
- package/dist/theme-importers/auto-detect.js +42 -0
- package/dist/theme-importers/auto-detect.js.map +1 -0
- package/dist/theme-importers/css-comments.d.ts +12 -0
- package/dist/theme-importers/css-comments.d.ts.map +1 -0
- package/dist/theme-importers/css-comments.js +15 -0
- package/dist/theme-importers/css-comments.js.map +1 -0
- package/dist/theme-importers/dtcg.d.ts +46 -0
- package/dist/theme-importers/dtcg.d.ts.map +1 -0
- package/dist/theme-importers/dtcg.js +111 -0
- package/dist/theme-importers/dtcg.js.map +1 -0
- package/dist/theme-importers/loose.d.ts +3 -0
- package/dist/theme-importers/loose.d.ts.map +1 -0
- package/dist/theme-importers/loose.js +76 -0
- package/dist/theme-importers/loose.js.map +1 -0
- package/dist/theme-importers/shadcn.d.ts +24 -0
- package/dist/theme-importers/shadcn.d.ts.map +1 -0
- package/dist/theme-importers/shadcn.js +135 -0
- package/dist/theme-importers/shadcn.js.map +1 -0
- package/dist/theme-importers/style-dictionary.d.ts +17 -0
- package/dist/theme-importers/style-dictionary.d.ts.map +1 -0
- package/dist/theme-importers/style-dictionary.js +125 -0
- package/dist/theme-importers/style-dictionary.js.map +1 -0
- package/dist/theme-importers/tailwind.d.ts +3 -0
- package/dist/theme-importers/tailwind.d.ts.map +1 -0
- package/dist/theme-importers/tailwind.js +218 -0
- package/dist/theme-importers/tailwind.js.map +1 -0
- package/dist/theme-literal-binding.d.ts +37 -0
- package/dist/theme-literal-binding.d.ts.map +1 -0
- package/dist/theme-literal-binding.js +138 -0
- package/dist/theme-literal-binding.js.map +1 -0
- package/dist/theme-normalize.d.ts +31 -0
- package/dist/theme-normalize.d.ts.map +1 -0
- package/dist/theme-normalize.js +587 -0
- package/dist/theme-normalize.js.map +1 -0
- package/dist/theme-ramp.d.ts +55 -0
- package/dist/theme-ramp.d.ts.map +1 -0
- package/dist/theme-ramp.js +149 -0
- package/dist/theme-ramp.js.map +1 -0
- package/dist/theme-render.d.ts +105 -0
- package/dist/theme-render.d.ts.map +1 -0
- package/dist/theme-render.js +441 -0
- package/dist/theme-render.js.map +1 -0
- package/dist/themes-errors.d.ts +109 -0
- package/dist/themes-errors.d.ts.map +1 -0
- package/dist/themes-errors.js +170 -0
- package/dist/themes-errors.js.map +1 -0
- package/dist/themes.d.ts +343 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +697 -0
- package/dist/themes.js.map +1 -0
- package/dist/version.d.ts +7 -4
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +6 -3
- package/dist/version.js.map +1 -1
- package/package.json +10 -2
- package/src/__tests__/redos-hardening.test.ts +160 -0
- package/src/ai-tools-add-module-modes.test.ts +106 -0
- package/src/ai-tools-position.test.ts +134 -0
- package/src/ai-tools.test.ts +81 -0
- package/src/ai-tools.ts +1179 -0
- package/src/auth-forms.ts +36 -0
- package/src/base-css.ts +30 -0
- package/src/build-page.test.ts +228 -0
- package/src/build-page.ts +319 -0
- package/src/cap-failures.ts +67 -0
- package/src/content.test.ts +170 -0
- package/src/content.ts +620 -0
- package/src/context.ts +43 -0
- package/src/css-gradient-scan.ts +88 -0
- package/src/css-var-scan.test.ts +96 -0
- package/src/css-var-scan.ts +144 -0
- package/src/derive-module-type.test.ts +80 -0
- package/src/design-manifest.ts +93 -0
- package/src/fonts.test.ts +157 -0
- package/src/fonts.ts +296 -0
- package/src/genesis-inventory.test.ts +86 -0
- package/src/genesis-inventory.ts +215 -0
- package/src/genesis-sanitize.test.ts +35 -0
- package/src/genesis.ts +87 -0
- package/src/i18n.test.ts +274 -0
- package/src/i18n.ts +269 -0
- package/src/index.test.ts +10 -0
- package/src/index.ts +59 -0
- package/src/interactions.ts +48 -0
- package/src/logger.ts +147 -0
- package/src/media.test.ts +160 -0
- package/src/media.ts +355 -0
- package/src/page-log.test.ts +163 -0
- package/src/page-log.ts +124 -0
- package/src/preview-compose.test.ts +602 -0
- package/src/preview-compose.ts +709 -0
- package/src/preview-scanner.test.ts +96 -0
- package/src/preview-scanner.ts +214 -0
- package/src/proposal-status.test.ts +69 -0
- package/src/proposal-status.ts +40 -0
- package/src/responsive-images.test.ts +104 -0
- package/src/responsive-images.ts +151 -0
- package/src/result.ts +29 -0
- package/src/safe-keys.ts +21 -0
- package/src/seo.test.ts +234 -0
- package/src/seo.ts +261 -0
- package/src/skills.ts +48 -0
- package/src/snapshots.test.ts +80 -0
- package/src/snapshots.ts +81 -0
- package/src/strip-cdata.test.ts +41 -0
- package/src/strip-cdata.ts +50 -0
- package/src/structured-sets.ts +180 -0
- package/src/subagents.test.ts +262 -0
- package/src/subagents.ts +432 -0
- package/src/template-engine.test.ts +379 -0
- package/src/template-engine.ts +520 -0
- package/src/theme-gradient.test.ts +92 -0
- package/src/theme-importers/__tests__/proto-pollution.test.ts +54 -0
- package/src/theme-importers/auto-detect.ts +84 -0
- package/src/theme-importers/css-comments.ts +15 -0
- package/src/theme-importers/dtcg.ts +106 -0
- package/src/theme-importers/loose.ts +76 -0
- package/src/theme-importers/shadcn.ts +133 -0
- package/src/theme-importers/style-dictionary.ts +125 -0
- package/src/theme-importers/tailwind.ts +217 -0
- package/src/theme-literal-binding.test.ts +71 -0
- package/src/theme-literal-binding.ts +159 -0
- package/src/theme-motion.test.ts +115 -0
- package/src/theme-normalize-envelope.test.ts +43 -0
- package/src/theme-normalize-gradient.test.ts +135 -0
- package/src/theme-normalize.ts +661 -0
- package/src/theme-ramp.ts +187 -0
- package/src/theme-render-sanitize.test.ts +45 -0
- package/src/theme-render.test.ts +119 -0
- package/src/theme-render.ts +487 -0
- package/src/theme-shadow.test.ts +56 -0
- package/src/themes-errors.ts +199 -0
- package/src/themes.ts +842 -0
- package/src/translation.test.ts +160 -0
- package/src/translation.ts +295 -0
- package/src/version.ts +66 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* issue #164 — design-compiler stage 1: the deterministic INVENTORY.
|
|
4
|
+
*
|
|
5
|
+
* Compiler contract (epic #149): the AI decides, code executes and
|
|
6
|
+
* verifies. This module is the "code" half of the first stage — it
|
|
7
|
+
* parses a Genesis draft (complete single-file HTML) into a fact base
|
|
8
|
+
* of design values (colors with usage contexts, font families, size /
|
|
9
|
+
* spacing / radius histograms, gradients, shadows) plus a section
|
|
10
|
+
* outline. The AI reads the inventory and makes the DECISIONS (which
|
|
11
|
+
* literal becomes which token, what things are called); it never has
|
|
12
|
+
* to re-derive facts by eyeballing raw CSS, and the facts can't be
|
|
13
|
+
* hallucinated.
|
|
14
|
+
*
|
|
15
|
+
* Pure string analysis, linear scans, unambiguous regex classes
|
|
16
|
+
* (ReDoS-aware per issue #113 — drafts are AI-authored but the parser
|
|
17
|
+
* budget must hold on adversarial input too).
|
|
18
|
+
*/
|
|
19
|
+
import { scanCssGradients } from "./css-gradient-scan.js";
|
|
20
|
+
/** Linear extraction of every <style> block's contents. */
|
|
21
|
+
export function extractDraftCss(html) {
|
|
22
|
+
const parts = [];
|
|
23
|
+
const lower = html.toLowerCase();
|
|
24
|
+
let from = 0;
|
|
25
|
+
while (true) {
|
|
26
|
+
const open = lower.indexOf("<style", from);
|
|
27
|
+
if (open === -1)
|
|
28
|
+
break;
|
|
29
|
+
const openEnd = lower.indexOf(">", open);
|
|
30
|
+
if (openEnd === -1)
|
|
31
|
+
break;
|
|
32
|
+
const close = lower.indexOf("</style", openEnd);
|
|
33
|
+
if (close === -1)
|
|
34
|
+
break;
|
|
35
|
+
parts.push(html.slice(openEnd + 1, close));
|
|
36
|
+
from = close + 8;
|
|
37
|
+
}
|
|
38
|
+
return parts.join("\n");
|
|
39
|
+
}
|
|
40
|
+
const DECLARATION_RE = /([a-zA-Z-]+)\s*:\s*([^;{}]+)/g;
|
|
41
|
+
const COLOR_LITERAL_RE = /#[0-9a-fA-F]{3,8}\b|(?:oklch|rgba?|hsla?|lab|lch|hwb)\([^()]*\)/g;
|
|
42
|
+
const LENGTH_RE = /-?\d+(?:\.\d+)?(?:rem|em|px|vh|vw|ch|%)\b/g;
|
|
43
|
+
const SPACING_PROPS = new Set([
|
|
44
|
+
"margin",
|
|
45
|
+
"margin-top",
|
|
46
|
+
"margin-bottom",
|
|
47
|
+
"margin-left",
|
|
48
|
+
"margin-right",
|
|
49
|
+
"margin-block",
|
|
50
|
+
"margin-inline",
|
|
51
|
+
"padding",
|
|
52
|
+
"padding-top",
|
|
53
|
+
"padding-bottom",
|
|
54
|
+
"padding-left",
|
|
55
|
+
"padding-right",
|
|
56
|
+
"padding-block",
|
|
57
|
+
"padding-inline",
|
|
58
|
+
"gap",
|
|
59
|
+
"row-gap",
|
|
60
|
+
"column-gap",
|
|
61
|
+
]);
|
|
62
|
+
const GENERIC_FONT_KEYWORDS = new Set([
|
|
63
|
+
"serif",
|
|
64
|
+
"sans-serif",
|
|
65
|
+
"monospace",
|
|
66
|
+
"cursive",
|
|
67
|
+
"fantasy",
|
|
68
|
+
"system-ui",
|
|
69
|
+
"ui-sans-serif",
|
|
70
|
+
"ui-serif",
|
|
71
|
+
"ui-monospace",
|
|
72
|
+
]);
|
|
73
|
+
function pushCount(map, key) {
|
|
74
|
+
map.set(key, (map.get(key) ?? 0) + 1);
|
|
75
|
+
}
|
|
76
|
+
function sortedByCount(map) {
|
|
77
|
+
return [...map.entries()].sort((a, z) => z[1] - a[1]).map(([k]) => k);
|
|
78
|
+
}
|
|
79
|
+
const OUTLINE_TAG_RE = /<(section|header|footer|main|nav|h1|h2|h3)\b[^>]*>/gi;
|
|
80
|
+
const TAG_STRIP_RE = /<[^>]*>/g;
|
|
81
|
+
/**
|
|
82
|
+
* Build the inventory. Caps guard pathological drafts: the boundary
|
|
83
|
+
* already limits draft size (GENESIS_DRAFT_MAX_HTML_BYTES), and each
|
|
84
|
+
* result list is truncated to what a decision-maker can actually use.
|
|
85
|
+
*/
|
|
86
|
+
export function inventoryGenesisDraft(html) {
|
|
87
|
+
const css = extractDraftCss(html);
|
|
88
|
+
const colorMeta = new Map();
|
|
89
|
+
const gradients = new Map();
|
|
90
|
+
const fontFamilies = new Map();
|
|
91
|
+
const fontSizes = new Map();
|
|
92
|
+
const spacing = new Map();
|
|
93
|
+
const radii = new Map();
|
|
94
|
+
const shadows = new Map();
|
|
95
|
+
for (const decl of css.matchAll(DECLARATION_RE)) {
|
|
96
|
+
const prop = (decl[1] ?? "").toLowerCase();
|
|
97
|
+
const value = (decl[2] ?? "").trim();
|
|
98
|
+
for (const g of scanCssGradients(value)) {
|
|
99
|
+
pushCount(gradients, g.literal);
|
|
100
|
+
}
|
|
101
|
+
// Colors inside gradients still count — a gradient stop color is a
|
|
102
|
+
// palette member the token map must name.
|
|
103
|
+
for (const c of value.matchAll(COLOR_LITERAL_RE)) {
|
|
104
|
+
const key = c[0].toLowerCase();
|
|
105
|
+
const meta = colorMeta.get(key) ?? { count: 0, properties: new Set() };
|
|
106
|
+
meta.count += 1;
|
|
107
|
+
meta.properties.add(prop);
|
|
108
|
+
colorMeta.set(key, meta);
|
|
109
|
+
}
|
|
110
|
+
if (prop === "font-family") {
|
|
111
|
+
for (const fam of value.split(",")) {
|
|
112
|
+
const clean = fam.trim().replace(/^["']|["']$/g, "");
|
|
113
|
+
// Generic keywords are fallback-chain noise, not palette
|
|
114
|
+
// members — the token map names real typefaces.
|
|
115
|
+
if (clean.length > 0 &&
|
|
116
|
+
clean.length < 80 &&
|
|
117
|
+
!GENERIC_FONT_KEYWORDS.has(clean.toLowerCase())) {
|
|
118
|
+
pushCount(fontFamilies, clean);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else if (prop === "font-size") {
|
|
123
|
+
pushCount(fontSizes, value);
|
|
124
|
+
}
|
|
125
|
+
else if (SPACING_PROPS.has(prop)) {
|
|
126
|
+
for (const len of value.matchAll(LENGTH_RE))
|
|
127
|
+
pushCount(spacing, len[0]);
|
|
128
|
+
}
|
|
129
|
+
else if (prop === "border-radius") {
|
|
130
|
+
pushCount(radii, value);
|
|
131
|
+
}
|
|
132
|
+
else if (prop === "box-shadow" || prop === "text-shadow") {
|
|
133
|
+
pushCount(shadows, value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const outline = [];
|
|
137
|
+
for (const m of html.matchAll(OUTLINE_TAG_RE)) {
|
|
138
|
+
if (outline.length >= 60)
|
|
139
|
+
break;
|
|
140
|
+
const tag = (m[1] ?? "").toLowerCase();
|
|
141
|
+
const start = (m.index ?? 0) + m[0].length;
|
|
142
|
+
const text = html
|
|
143
|
+
.slice(start, start + 400)
|
|
144
|
+
.replace(TAG_STRIP_RE, " ")
|
|
145
|
+
.replace(/\s+/g, " ")
|
|
146
|
+
.trim()
|
|
147
|
+
.slice(0, 80);
|
|
148
|
+
outline.push({ tag, text });
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
colors: [...colorMeta.entries()]
|
|
152
|
+
.sort((a, z) => z[1].count - a[1].count)
|
|
153
|
+
.slice(0, 40)
|
|
154
|
+
.map(([value, meta]) => ({
|
|
155
|
+
value,
|
|
156
|
+
count: meta.count,
|
|
157
|
+
properties: [...meta.properties].sort(),
|
|
158
|
+
})),
|
|
159
|
+
gradients: sortedByCount(gradients).slice(0, 12),
|
|
160
|
+
fontFamilies: sortedByCount(fontFamilies).slice(0, 12),
|
|
161
|
+
fontSizes: sortedByCount(fontSizes).slice(0, 24),
|
|
162
|
+
spacingValues: sortedByCount(spacing).slice(0, 24),
|
|
163
|
+
radiusValues: sortedByCount(radii).slice(0, 12),
|
|
164
|
+
shadows: sortedByCount(shadows).slice(0, 12),
|
|
165
|
+
outline,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/** Compact, prompt-friendly rendering of the inventory. */
|
|
169
|
+
export function formatGenesisInventory(inv) {
|
|
170
|
+
const lines = [];
|
|
171
|
+
lines.push(`Colors (${inv.colors.length}): ${inv.colors
|
|
172
|
+
.map((c) => `${c.value}×${c.count}[${c.properties.join("/")}]`)
|
|
173
|
+
.join(", ")}`);
|
|
174
|
+
if (inv.gradients.length > 0)
|
|
175
|
+
lines.push(`Gradients: ${inv.gradients.join(" | ")}`);
|
|
176
|
+
lines.push(`Font families: ${inv.fontFamilies.join(", ") || "(none declared)"}`);
|
|
177
|
+
lines.push(`Font sizes: ${inv.fontSizes.join(", ")}`);
|
|
178
|
+
lines.push(`Spacing values: ${inv.spacingValues.join(", ")}`);
|
|
179
|
+
if (inv.radiusValues.length > 0)
|
|
180
|
+
lines.push(`Radii: ${inv.radiusValues.join(", ")}`);
|
|
181
|
+
if (inv.shadows.length > 0)
|
|
182
|
+
lines.push(`Shadows: ${inv.shadows.join(" | ")}`);
|
|
183
|
+
lines.push(`Outline: ${inv.outline.map((o) => `<${o.tag}>${o.text ? ` ${o.text}` : ""}`).join(" → ")}`);
|
|
184
|
+
return lines.join("\n");
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=genesis-inventory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis-inventory.js","sourceRoot":"","sources":["../src/genesis-inventory.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAsB1D,2DAA2D;AAC3D,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CA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
+
*
|
|
4
|
+
* Design-time is divergent: the AI drafts complete freeform HTML pages
|
|
5
|
+
* (one per design direction) and the operator picks one; the CMS
|
|
6
|
+
* structure is derived FROM that choice (#164's compiler). These are
|
|
7
|
+
* the boundary schemas for the brief + the draft rows.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
/**
|
|
11
|
+
* The structured Design Brief the discovery dialog produces. Every
|
|
12
|
+
* field optional — the AI fills what the conversation answered; the
|
|
13
|
+
* draft prompts degrade gracefully on gaps. Stored on
|
|
14
|
+
* `site_defaults.design_brief`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const designBriefSchema: z.ZodObject<{
|
|
17
|
+
audience: z.ZodOptional<z.ZodString>;
|
|
18
|
+
moodWords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
tone: z.ZodOptional<z.ZodString>;
|
|
20
|
+
industry: z.ZodOptional<z.ZodString>;
|
|
21
|
+
differentiators: z.ZodOptional<z.ZodString>;
|
|
22
|
+
imageryDirection: z.ZodOptional<z.ZodString>;
|
|
23
|
+
avoid: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export type DesignBrief = z.infer<typeof designBriefSchema>;
|
|
26
|
+
/** Complete single-file drafts stay well under this (inline CSS only). */
|
|
27
|
+
export declare const GENESIS_DRAFT_MAX_HTML_BYTES = 300000;
|
|
28
|
+
export declare const genesisDraftStatus: z.ZodEnum<{
|
|
29
|
+
candidate: "candidate";
|
|
30
|
+
selected: "selected";
|
|
31
|
+
discarded: "discarded";
|
|
32
|
+
}>;
|
|
33
|
+
export type GenesisDraftStatus = z.infer<typeof genesisDraftStatus>;
|
|
34
|
+
/** issue #199 — where a draft came from. */
|
|
35
|
+
export declare const genesisDraftSourceKind: z.ZodEnum<{
|
|
36
|
+
genesis: "genesis";
|
|
37
|
+
byod_image: "byod_image";
|
|
38
|
+
byod_html: "byod_html";
|
|
39
|
+
}>;
|
|
40
|
+
export type GenesisDraftSourceKind = z.infer<typeof genesisDraftSourceKind>;
|
|
41
|
+
export declare const genesisAddDraftInput: z.ZodObject<{
|
|
42
|
+
direction: z.ZodString;
|
|
43
|
+
rationale: z.ZodDefault<z.ZodString>;
|
|
44
|
+
html: z.ZodString;
|
|
45
|
+
sourceKind: z.ZodDefault<z.ZodEnum<{
|
|
46
|
+
genesis: "genesis";
|
|
47
|
+
byod_image: "byod_image";
|
|
48
|
+
byod_html: "byod_html";
|
|
49
|
+
}>>;
|
|
50
|
+
referenceAssetId: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export type GenesisAddDraftInput = z.infer<typeof genesisAddDraftInput>;
|
|
53
|
+
/**
|
|
54
|
+
* issue #199 — strip <script> blocks from operator-provided draft
|
|
55
|
+
* HTML. Defense in depth: drafts render inside sandbox="" iframes
|
|
56
|
+
* (scripts never execute there), but stored HTML flows onward into
|
|
57
|
+
* materialisation, so the boundary removes them outright. Linear
|
|
58
|
+
* scan per the #113 discipline; case-insensitive; unterminated
|
|
59
|
+
* script blocks drop everything to EOF (never leak half a script).
|
|
60
|
+
*/
|
|
61
|
+
export declare function sanitizeDraftHtml(html: string): string;
|
|
62
|
+
//# sourceMappingURL=genesis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis.d.ts","sourceRoot":"","sources":["../src/genesis.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;kBAWnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,0EAA0E;AAC1E,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAEpD,eAAO,MAAM,kBAAkB;;;;EAAiD,CAAC;AACjF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,4CAA4C;AAC5C,eAAO,MAAM,sBAAsB;;;;EAAiD,CAAC;AACrF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,eAAO,MAAM,oBAAoB;;;;;;;;;;kBAetB,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBtD"}
|
package/dist/genesis.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* issue #163 — Site Genesis shared shapes.
|
|
4
|
+
*
|
|
5
|
+
* Design-time is divergent: the AI drafts complete freeform HTML pages
|
|
6
|
+
* (one per design direction) and the operator picks one; the CMS
|
|
7
|
+
* structure is derived FROM that choice (#164's compiler). These are
|
|
8
|
+
* the boundary schemas for the brief + the draft rows.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
/**
|
|
12
|
+
* The structured Design Brief the discovery dialog produces. Every
|
|
13
|
+
* field optional — the AI fills what the conversation answered; the
|
|
14
|
+
* draft prompts degrade gracefully on gaps. Stored on
|
|
15
|
+
* `site_defaults.design_brief`.
|
|
16
|
+
*/
|
|
17
|
+
export const designBriefSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
audience: z.string().min(1).max(500).optional(),
|
|
20
|
+
/** 3–5 adjectives the operator wants the design to feel like. */
|
|
21
|
+
moodWords: z.array(z.string().min(1).max(40)).max(12).optional(),
|
|
22
|
+
tone: z.string().min(1).max(300).optional(),
|
|
23
|
+
industry: z.string().min(1).max(200).optional(),
|
|
24
|
+
differentiators: z.string().min(1).max(1000).optional(),
|
|
25
|
+
imageryDirection: z.string().min(1).max(500).optional(),
|
|
26
|
+
avoid: z.string().min(1).max(500).optional(),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
/** Complete single-file drafts stay well under this (inline CSS only). */
|
|
30
|
+
export const GENESIS_DRAFT_MAX_HTML_BYTES = 300_000;
|
|
31
|
+
export const genesisDraftStatus = z.enum(["candidate", "selected", "discarded"]);
|
|
32
|
+
/** issue #199 — where a draft came from. */
|
|
33
|
+
export const genesisDraftSourceKind = z.enum(["genesis", "byod_image", "byod_html"]);
|
|
34
|
+
export const genesisAddDraftInput = z
|
|
35
|
+
.object({
|
|
36
|
+
/** Human-readable design direction ("bold editorial"). */
|
|
37
|
+
direction: z.string().min(3).max(120),
|
|
38
|
+
/** Why this direction fits the brief — shown beside the preview. */
|
|
39
|
+
rationale: z.string().max(1000).default(""),
|
|
40
|
+
/** Complete self-contained single-file HTML. */
|
|
41
|
+
html: z.string().min(200).max(GENESIS_DRAFT_MAX_HTML_BYTES),
|
|
42
|
+
/** issue #199 — 'byod_image' (AI reproduction of an operator
|
|
43
|
+
* mockup) / 'byod_html' (operator HTML, sanitised at the op). */
|
|
44
|
+
sourceKind: genesisDraftSourceKind.default("genesis"),
|
|
45
|
+
/** issue #199 — byod_image only: the uploaded mockup's media
|
|
46
|
+
* asset. The parity gate uses THIS image as the reference. */
|
|
47
|
+
referenceAssetId: z.string().uuid().optional(),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
/**
|
|
51
|
+
* issue #199 — strip <script> blocks from operator-provided draft
|
|
52
|
+
* HTML. Defense in depth: drafts render inside sandbox="" iframes
|
|
53
|
+
* (scripts never execute there), but stored HTML flows onward into
|
|
54
|
+
* materialisation, so the boundary removes them outright. Linear
|
|
55
|
+
* scan per the #113 discipline; case-insensitive; unterminated
|
|
56
|
+
* script blocks drop everything to EOF (never leak half a script).
|
|
57
|
+
*/
|
|
58
|
+
export function sanitizeDraftHtml(html) {
|
|
59
|
+
const lower = html.toLowerCase();
|
|
60
|
+
let out = "";
|
|
61
|
+
let from = 0;
|
|
62
|
+
while (true) {
|
|
63
|
+
const open = lower.indexOf("<script", from);
|
|
64
|
+
if (open === -1) {
|
|
65
|
+
out += html.slice(from);
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
out += html.slice(from, open);
|
|
69
|
+
const close = lower.indexOf("</script", open);
|
|
70
|
+
if (close === -1)
|
|
71
|
+
return out;
|
|
72
|
+
const closeEnd = lower.indexOf(">", close);
|
|
73
|
+
if (closeEnd === -1)
|
|
74
|
+
return out;
|
|
75
|
+
from = closeEnd + 1;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=genesis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis.js","sourceRoot":"","sources":["../src/genesis.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC/C,iEAAiE;IACjE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAA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,CAAC,SAAS,CAAC;IACrD;mEAC+D;IAC/D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC/C,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC;YAChB,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO,GAAG,CAAC;QACb,CAAC;QACD,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC9C,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAC7B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3C,IAAI,QAAQ,KAAK,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAChC,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/dist/i18n.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip leading and trailing `/` characters with a single linear scan.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the regex `/^\/+|\/+$/g`, whose trailing-slash branch
|
|
5
|
+
* backtracks O(n²) on a long run of slashes that is not at end-of-string
|
|
6
|
+
* (CodeQL js/polynomial-redos). This char-index walk is unconditionally
|
|
7
|
+
* linear and produces byte-identical output for every input.
|
|
8
|
+
*/
|
|
9
|
+
export declare function trimSlashes(s: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Strip only trailing `/` characters with a single linear scan — the
|
|
12
|
+
* non-backtracking replacement for `/\/+$/` (same ReDoS class as above).
|
|
13
|
+
* Used for base URLs, which carry a scheme and must keep their leading
|
|
14
|
+
* characters.
|
|
15
|
+
*/
|
|
16
|
+
export declare function trimTrailingSlashes(s: string): string;
|
|
1
17
|
export interface LocaleConfig {
|
|
2
18
|
code: string;
|
|
3
19
|
displayName: string;
|
|
@@ -5,6 +21,25 @@ export interface LocaleConfig {
|
|
|
5
21
|
urlHost: string | null;
|
|
6
22
|
isDefault: boolean;
|
|
7
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The "magic slug" sentinel test: a page whose slug is empty, `home`,
|
|
26
|
+
* or `index` is the locale root by convention even without an explicit
|
|
27
|
+
* `locales.home_page_id` designation. Leading/trailing slashes are
|
|
28
|
+
* ignored so `/home/` reads the same as `home`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isHomeSlug(slug: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The single home-decision predicate every URL/output-path site must
|
|
33
|
+
* use so canonical, hreflang, redirects, and the emitted file agree
|
|
34
|
+
* (0184 explicit-homepage feature). A page is the locale root when it
|
|
35
|
+
* IS the locale's designated `home_page_id` OR carries a magic slug.
|
|
36
|
+
*
|
|
37
|
+
* @param pageId The page being resolved.
|
|
38
|
+
* @param slug That page's slug.
|
|
39
|
+
* @param localeHomePageId `locales.home_page_id` for the page's locale
|
|
40
|
+
* (null/undefined when no page is designated).
|
|
41
|
+
*/
|
|
42
|
+
export declare function pageIsLocaleHome(pageId: string, slug: string, localeHomePageId: string | null | undefined): boolean;
|
|
8
43
|
/**
|
|
9
44
|
* Build a public-facing URL for a (locale, slug) tuple. Pure function —
|
|
10
45
|
* no DB access — so the static generator can call it for every page
|
|
@@ -14,9 +49,17 @@ export interface LocaleConfig {
|
|
|
14
49
|
* @param slug Path component (e.g. "about", "blog/post-1"). No leading slash.
|
|
15
50
|
* @param siteBaseUrl Default base URL when the strategy is `none` or
|
|
16
51
|
* `subdirectory` (e.g. "https://example.com").
|
|
52
|
+
* @param pageUrlStyle Page emission style (see below).
|
|
53
|
+
* @param isHomePage Explicit homepage designation (0184 —
|
|
54
|
+
* `locales.home_page_id`). When true this page IS the
|
|
55
|
+
* locale root and resolves to `<base>/` regardless of
|
|
56
|
+
* its own slug. The explicit flag WINS over the slug
|
|
57
|
+
* sentinel below; the sentinel stays as a back-compat
|
|
58
|
+
* fallback for callers that can't cheaply surface the
|
|
59
|
+
* designation.
|
|
17
60
|
* @returns Absolute URL, including scheme + host.
|
|
18
61
|
*/
|
|
19
|
-
export declare function resolveLocaleUrl(locale: LocaleConfig, slug: string, siteBaseUrl: string, pageUrlStyle?: "directory" | "no-extension"): string;
|
|
62
|
+
export declare function resolveLocaleUrl(locale: LocaleConfig, slug: string, siteBaseUrl: string, pageUrlStyle?: "directory" | "no-extension", isHomePage?: boolean): string;
|
|
20
63
|
/**
|
|
21
64
|
* Emit `<link rel="alternate" hreflang="…">` tags for every locale
|
|
22
65
|
* that has a published variant of this page. The default locale also
|
package/dist/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AA6BA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAM7C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC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
|
|
8
8
|
* recompute path.
|
|
9
9
|
*
|
|
10
|
-
* resolveLocaleUrl(locale, slug,
|
|
10
|
+
* resolveLocaleUrl(locale, slug, siteBaseUrl, pageUrlStyle?, isHomePage?) —
|
|
11
11
|
* builds the public URL for a (locale, slug) tuple given the
|
|
12
|
-
* locale's url_strategy + url_host.
|
|
12
|
+
* locale's url_strategy + url_host. `isHomePage` forces the locale
|
|
13
|
+
* root (0184 explicit designation). Used by:
|
|
13
14
|
* - hreflang emitter
|
|
14
15
|
* - sitemap.xml emitter (when extended for i18n)
|
|
15
16
|
* - language-selector module
|
|
@@ -23,6 +24,59 @@
|
|
|
23
24
|
* siblings, advanced strategy chosen while toggle is off).
|
|
24
25
|
*/
|
|
25
26
|
const TEXT_ENCODER = new TextEncoder();
|
|
27
|
+
/**
|
|
28
|
+
* Strip leading and trailing `/` characters with a single linear scan.
|
|
29
|
+
*
|
|
30
|
+
* Replaces the regex `/^\/+|\/+$/g`, whose trailing-slash branch
|
|
31
|
+
* backtracks O(n²) on a long run of slashes that is not at end-of-string
|
|
32
|
+
* (CodeQL js/polynomial-redos). This char-index walk is unconditionally
|
|
33
|
+
* linear and produces byte-identical output for every input.
|
|
34
|
+
*/
|
|
35
|
+
export function trimSlashes(s) {
|
|
36
|
+
let start = 0;
|
|
37
|
+
let end = s.length;
|
|
38
|
+
while (start < end && s.charCodeAt(start) === 47 /* '/' */)
|
|
39
|
+
start += 1;
|
|
40
|
+
while (end > start && s.charCodeAt(end - 1) === 47 /* '/' */)
|
|
41
|
+
end -= 1;
|
|
42
|
+
return s.slice(start, end);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Strip only trailing `/` characters with a single linear scan — the
|
|
46
|
+
* non-backtracking replacement for `/\/+$/` (same ReDoS class as above).
|
|
47
|
+
* Used for base URLs, which carry a scheme and must keep their leading
|
|
48
|
+
* characters.
|
|
49
|
+
*/
|
|
50
|
+
export function trimTrailingSlashes(s) {
|
|
51
|
+
let end = s.length;
|
|
52
|
+
while (end > 0 && s.charCodeAt(end - 1) === 47 /* '/' */)
|
|
53
|
+
end -= 1;
|
|
54
|
+
return s.slice(0, end);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The "magic slug" sentinel test: a page whose slug is empty, `home`,
|
|
58
|
+
* or `index` is the locale root by convention even without an explicit
|
|
59
|
+
* `locales.home_page_id` designation. Leading/trailing slashes are
|
|
60
|
+
* ignored so `/home/` reads the same as `home`.
|
|
61
|
+
*/
|
|
62
|
+
export function isHomeSlug(slug) {
|
|
63
|
+
const s = trimSlashes(slug);
|
|
64
|
+
return s === "" || s === "home" || s === "index";
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The single home-decision predicate every URL/output-path site must
|
|
68
|
+
* use so canonical, hreflang, redirects, and the emitted file agree
|
|
69
|
+
* (0184 explicit-homepage feature). A page is the locale root when it
|
|
70
|
+
* IS the locale's designated `home_page_id` OR carries a magic slug.
|
|
71
|
+
*
|
|
72
|
+
* @param pageId The page being resolved.
|
|
73
|
+
* @param slug That page's slug.
|
|
74
|
+
* @param localeHomePageId `locales.home_page_id` for the page's locale
|
|
75
|
+
* (null/undefined when no page is designated).
|
|
76
|
+
*/
|
|
77
|
+
export function pageIsLocaleHome(pageId, slug, localeHomePageId) {
|
|
78
|
+
return (localeHomePageId != null && pageId === localeHomePageId) || isHomeSlug(slug);
|
|
79
|
+
}
|
|
26
80
|
/**
|
|
27
81
|
* Build a public-facing URL for a (locale, slug) tuple. Pure function —
|
|
28
82
|
* no DB access — so the static generator can call it for every page
|
|
@@ -32,6 +86,14 @@ const TEXT_ENCODER = new TextEncoder();
|
|
|
32
86
|
* @param slug Path component (e.g. "about", "blog/post-1"). No leading slash.
|
|
33
87
|
* @param siteBaseUrl Default base URL when the strategy is `none` or
|
|
34
88
|
* `subdirectory` (e.g. "https://example.com").
|
|
89
|
+
* @param pageUrlStyle Page emission style (see below).
|
|
90
|
+
* @param isHomePage Explicit homepage designation (0184 —
|
|
91
|
+
* `locales.home_page_id`). When true this page IS the
|
|
92
|
+
* locale root and resolves to `<base>/` regardless of
|
|
93
|
+
* its own slug. The explicit flag WINS over the slug
|
|
94
|
+
* sentinel below; the sentinel stays as a back-compat
|
|
95
|
+
* fallback for callers that can't cheaply surface the
|
|
96
|
+
* designation.
|
|
35
97
|
* @returns Absolute URL, including scheme + host.
|
|
36
98
|
*/
|
|
37
99
|
export function resolveLocaleUrl(locale, slug, siteBaseUrl,
|
|
@@ -40,16 +102,20 @@ export function resolveLocaleUrl(locale, slug, siteBaseUrl,
|
|
|
40
102
|
// in `/<slug>` (no trailing slash) to match what the bucket
|
|
41
103
|
// actually serves when pages are emitted as bare slugs. Home
|
|
42
104
|
// page is always `<base>/` regardless of style.
|
|
43
|
-
pageUrlStyle = "directory") {
|
|
44
|
-
const stripped = slug
|
|
45
|
-
|
|
105
|
+
pageUrlStyle = "directory", isHomePage) {
|
|
106
|
+
const stripped = trimSlashes(slug);
|
|
107
|
+
// 0184 — the explicit designation wins; the slug sentinel
|
|
108
|
+
// (""/`home`/`index`) survives as a back-compat fallback so a page the
|
|
109
|
+
// AI never ran set_home_page on still resolves to the root. Shared
|
|
110
|
+
// `isHomeSlug` keeps this test identical across every home-decision site.
|
|
111
|
+
const isHome = isHomePage === true || isHomeSlug(stripped);
|
|
46
112
|
// tail: the path component appended after `<base>/` or `<base>/<locale>/`.
|
|
47
113
|
// 'directory' style: trailing slash for non-home so the URL points at
|
|
48
114
|
// the directory the bucket serves index.html from.
|
|
49
115
|
// 'no-extension' style: no trailing slash, no extension — the URL
|
|
50
116
|
// points at the bare-slug object the bucket serves directly.
|
|
51
117
|
const tail = isHome ? "" : pageUrlStyle === "no-extension" ? stripped : `${stripped}/`;
|
|
52
|
-
const base = siteBaseUrl
|
|
118
|
+
const base = trimTrailingSlashes(siteBaseUrl);
|
|
53
119
|
switch (locale.urlStrategy) {
|
|
54
120
|
case "none":
|
|
55
121
|
return tail ? `${base}/${tail}` : `${base}/`;
|
package/dist/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,MAAM,YAAY,GAAG,IAAI,WAAW,EAAE,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,CAAS;IACnC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,OAAO,KAAK,GAAG,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,SAAS;QAAE,KAAK,IAAI,CAAC,CAAC;IACvE,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS;QAAE,GAAG,IAAI,CAAC,CAAC;IACvE,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAS;IAC3C,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS;QAAE,GAAG,IAAI,CAAC,CAAC;IACnE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzB,CAAC;AAUD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5B,O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ACpE,sEAAsE;IACtE,+BAA+B;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,WAAW,KAAK,cAAc,CAAC,CAAC;IAC/F,IAAI,GAAG,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnE,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,2BAA2B;YACjC,OAAO,EAAE,mBAAmB,GAAG,CAAC,IAAI,uBAAuB,cAAc;iBACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;iBAClB,IAAI,CACH,IAAI,CACL,oFAAoF;SACxF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,47 @@
|
|
|
1
1
|
export declare const PROJECT_NAME = "caelo-cms";
|
|
2
2
|
export * from "./ai-tools.js";
|
|
3
3
|
export * from "./auth-forms.js";
|
|
4
|
+
export * from "./base-css.js";
|
|
5
|
+
export * from "./build-page.js";
|
|
4
6
|
export * from "./cap-failures.js";
|
|
5
7
|
export * from "./content.js";
|
|
6
8
|
export * from "./context.js";
|
|
9
|
+
export * from "./css-gradient-scan.js";
|
|
10
|
+
export * from "./css-var-scan.js";
|
|
11
|
+
export * from "./design-manifest.js";
|
|
12
|
+
export * from "./fonts.js";
|
|
13
|
+
export * from "./genesis.js";
|
|
14
|
+
export * from "./genesis-inventory.js";
|
|
7
15
|
export * from "./i18n.js";
|
|
16
|
+
export * from "./interactions.js";
|
|
8
17
|
export { type LogContext, type Logger, type LoggerOptions, type LogLevel, makeLogger, mintRequestId, redact, type ServiceName, type StructuredLogEntry, } from "./logger.js";
|
|
9
18
|
export * from "./media.js";
|
|
19
|
+
export * from "./page-log.js";
|
|
10
20
|
export * from "./preview-compose.js";
|
|
11
21
|
export * from "./preview-scanner.js";
|
|
22
|
+
export * from "./proposal-status.js";
|
|
23
|
+
export * from "./responsive-images.js";
|
|
12
24
|
export * from "./result.js";
|
|
25
|
+
export * from "./safe-keys.js";
|
|
13
26
|
export * from "./seo.js";
|
|
14
27
|
export * from "./skills.js";
|
|
15
28
|
export * from "./snapshots.js";
|
|
29
|
+
export * from "./strip-cdata.js";
|
|
16
30
|
export * from "./structured-sets.js";
|
|
17
31
|
export * from "./subagents.js";
|
|
32
|
+
export * from "./template-engine.js";
|
|
33
|
+
export * from "./theme-importers/auto-detect.js";
|
|
34
|
+
export * from "./theme-importers/dtcg.js";
|
|
35
|
+
export * from "./theme-importers/loose.js";
|
|
36
|
+
export * from "./theme-importers/shadcn.js";
|
|
37
|
+
export * from "./theme-importers/style-dictionary.js";
|
|
38
|
+
export * from "./theme-importers/tailwind.js";
|
|
39
|
+
export * from "./theme-literal-binding.js";
|
|
40
|
+
export * from "./theme-normalize.js";
|
|
41
|
+
export * from "./theme-ramp.js";
|
|
42
|
+
export * from "./theme-render.js";
|
|
43
|
+
export * from "./themes.js";
|
|
44
|
+
export * from "./themes-errors.js";
|
|
18
45
|
export * from "./translation.js";
|
|
19
46
|
export { CAELO_VERSION, CALEO_VERSION, type CaeloVersion, parseVersion } from "./version.js";
|
|
20
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc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