@caelo-cms/shared 0.2.2
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 +571 -0
- package/dist/ai-tools.d.ts.map +1 -0
- package/dist/ai-tools.js +696 -0
- package/dist/ai-tools.js.map +1 -0
- package/dist/auth-forms.d.ts +24 -0
- package/dist/auth-forms.d.ts.map +1 -0
- package/dist/auth-forms.js +27 -0
- package/dist/auth-forms.js.map +1 -0
- package/dist/cap-failures.d.ts +17 -0
- package/dist/cap-failures.d.ts.map +1 -0
- package/dist/cap-failures.js +58 -0
- package/dist/cap-failures.js.map +1 -0
- package/dist/content.d.ts +111 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +137 -0
- package/dist/content.js.map +1 -0
- package/dist/context.d.ts +40 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +3 -0
- package/dist/context.js.map +1 -0
- package/dist/i18n.d.ts +49 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +154 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +56 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +84 -0
- package/dist/logger.js.map +1 -0
- package/dist/media.d.ts +143 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +168 -0
- package/dist/media.js.map +1 -0
- package/dist/preview-compose.d.ts +84 -0
- package/dist/preview-compose.d.ts.map +1 -0
- package/dist/preview-compose.js +385 -0
- package/dist/preview-compose.js.map +1 -0
- package/dist/preview-scanner.d.ts +44 -0
- package/dist/preview-scanner.d.ts.map +1 -0
- package/dist/preview-scanner.js +177 -0
- package/dist/preview-scanner.js.map +1 -0
- package/dist/result.d.ts +21 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +14 -0
- package/dist/result.js.map +1 -0
- package/dist/seo.d.ts +128 -0
- package/dist/seo.d.ts.map +1 -0
- package/dist/seo.js +176 -0
- package/dist/seo.js.map +1 -0
- package/dist/skills.d.ts +88 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +127 -0
- package/dist/skills.js.map +1 -0
- package/dist/snapshots.d.ts +54 -0
- package/dist/snapshots.d.ts.map +1 -0
- package/dist/snapshots.js +59 -0
- package/dist/snapshots.js.map +1 -0
- package/dist/structured-sets.d.ts +116 -0
- package/dist/structured-sets.d.ts.map +1 -0
- package/dist/structured-sets.js +154 -0
- package/dist/structured-sets.js.map +1 -0
- package/dist/subagents.d.ts +123 -0
- package/dist/subagents.d.ts.map +1 -0
- package/dist/subagents.js +202 -0
- package/dist/subagents.js.map +1 -0
- package/dist/translation.d.ts +127 -0
- package/dist/translation.d.ts.map +1 -0
- package/dist/translation.js +208 -0
- package/dist/translation.js.map +1 -0
- package/dist/version.d.ts +46 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +46 -0
- package/dist/version.js.map +1 -0
- package/package.json +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-compose.js","sourceRoot":"","sources":["../src/preview-compose.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAiC,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAoD7F,MAAM,aAAa,GAAG,cAAc,CAAC;AACrC,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,SAAS,YAAY,CAAC,MAAc,EAAE,MAAc,EAAE,QAAgB;IACpE,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,MAAM,GAAG,QAAQ,CAAC,CAAC,8CAA8C;IAChF,MAAM,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AAC;IAED,mEAAmE;IACnE,sEAAsE;IACtE,6DAA6D;IAC7D,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS;QAClC,GAAG,gBAAgB,CAAC,aAAa;QACjC,GAAG,QAAQ,CAAC,aAAa;KAC1B,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAS,CAAC,GAAG,gBAAgB,CAAC,YAAY,EAAE,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IACjG,KAAK,MAAM,IAAI,IAAI,WAAW;QAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxD,OAAO;QACL,IAAI;QACJ,aAAa,EAAE,CAAC,GAAG,WAAW,CAAC;QAC/B,YAAY,EAAE,CAAC,GAAG,UAAU,CAAC;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P6.7.6 review pass — return the list of `<caelo-slot name="…">` slot
|
|
3
|
+
* names declared in `html`, in source order. Used by the layout-aware
|
|
4
|
+
* composer to validate that a layout declares the required `content`
|
|
5
|
+
* slot before rendering, so misconfigurations error loudly per the
|
|
6
|
+
* no-fallbacks invariant. Walks the same htmlparser2 Parser as
|
|
7
|
+
* `applySlotReplacements` so attribute quoting / ordering / whitespace
|
|
8
|
+
* are handled uniformly.
|
|
9
|
+
*/
|
|
10
|
+
export declare function listSlotNames(html: string): readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* P6.7.6 review pass — when a rendered template body is exactly one
|
|
13
|
+
* top-level `<caelo-slot name="content">…</caelo-slot>` element
|
|
14
|
+
* (typical of legacy templates whose body wraps the slot directly),
|
|
15
|
+
* peel the wrapper and return just its inner HTML. Returns `null` when
|
|
16
|
+
* the body has multiple top-level elements, no top-level content slot,
|
|
17
|
+
* or any other shape — so the caller can fall back to using the body
|
|
18
|
+
* as-is.
|
|
19
|
+
*
|
|
20
|
+
* Replaces the previous regex-based peel which silently failed on
|
|
21
|
+
* single-quote attributes, attribute reordering, or whitespace
|
|
22
|
+
* variations.
|
|
23
|
+
*/
|
|
24
|
+
export declare function extractInnerOfTopLevelContentSlot(html: string): string | null;
|
|
25
|
+
export interface SlotReplacement {
|
|
26
|
+
/** Inner HTML for each `<caelo-slot name="…">`. */
|
|
27
|
+
readonly contentByName: ReadonlyMap<string, string>;
|
|
28
|
+
}
|
|
29
|
+
export interface ScanResult {
|
|
30
|
+
readonly html: string;
|
|
31
|
+
readonly replacedSlots: readonly string[];
|
|
32
|
+
readonly missingSlots: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns a copy of `templateHtml` where each `<caelo-slot name="X">…</caelo-slot>`
|
|
36
|
+
* has its inner HTML replaced by `replacement.contentByName.get(X)`. Slots
|
|
37
|
+
* with no entry render with their original inner HTML preserved (so a
|
|
38
|
+
* template-author placeholder stays visible in the editor preview).
|
|
39
|
+
*
|
|
40
|
+
* Throws on nested or unbalanced slot markers — those are template-author
|
|
41
|
+
* bugs and silently smoothing them over would just defer the discovery.
|
|
42
|
+
*/
|
|
43
|
+
export declare function applySlotReplacements(templateHtml: string, replacement: SlotReplacement): ScanResult;
|
|
44
|
+
//# sourceMappingURL=preview-scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-scanner.d.ts","sourceRoot":"","sources":["../src/preview-scanner.ts"],"names":[],"mappings":"AAyBA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAc7D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA2C7E;AAED,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAUD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,eAAe,GAC3B,UAAU,CA0EZ"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* `<caelo-slot name="…">…</caelo-slot>` scanner backed by `htmlparser2`'s
|
|
4
|
+
* Parser. Replaces the inner HTML of each named slot with caller-supplied
|
|
5
|
+
* content, leaving every byte outside the slots unchanged.
|
|
6
|
+
*
|
|
7
|
+
* Why a real parser: the previous regex-based version mishandled comments
|
|
8
|
+
* (`<!-- <caelo-slot> -->`), CDATA, and attributes containing `<`, and
|
|
9
|
+
* required hand-rolled "no nested slots" detection. htmlparser2 is MIT,
|
|
10
|
+
* tiny, and dependency-free — same parser the larger Cheerio/Jsdom-style
|
|
11
|
+
* tools use under the hood.
|
|
12
|
+
*
|
|
13
|
+
* Invariants preserved from the regex version:
|
|
14
|
+
* - Bytes outside `<caelo-slot>` ranges are byte-stable in the output.
|
|
15
|
+
* - The `<caelo-slot ...>` opening + closing tags themselves are
|
|
16
|
+
* preserved (only inner HTML is replaced) so CSS selectors keep matching.
|
|
17
|
+
* - Nested `<caelo-slot>` inside another `<caelo-slot>` is rejected.
|
|
18
|
+
* - Unterminated openers are rejected.
|
|
19
|
+
*/
|
|
20
|
+
import { Parser } from "htmlparser2";
|
|
21
|
+
const SLOT_TAG = "caelo-slot";
|
|
22
|
+
/**
|
|
23
|
+
* P6.7.6 review pass — return the list of `<caelo-slot name="…">` slot
|
|
24
|
+
* names declared in `html`, in source order. Used by the layout-aware
|
|
25
|
+
* composer to validate that a layout declares the required `content`
|
|
26
|
+
* slot before rendering, so misconfigurations error loudly per the
|
|
27
|
+
* no-fallbacks invariant. Walks the same htmlparser2 Parser as
|
|
28
|
+
* `applySlotReplacements` so attribute quoting / ordering / whitespace
|
|
29
|
+
* are handled uniformly.
|
|
30
|
+
*/
|
|
31
|
+
export function listSlotNames(html) {
|
|
32
|
+
const names = [];
|
|
33
|
+
const parser = new Parser({
|
|
34
|
+
onopentag(name, attrs) {
|
|
35
|
+
if (name !== SLOT_TAG)
|
|
36
|
+
return;
|
|
37
|
+
names.push(attrs.name ?? "");
|
|
38
|
+
},
|
|
39
|
+
}, { lowerCaseTags: true, recognizeSelfClosing: false });
|
|
40
|
+
parser.write(html);
|
|
41
|
+
parser.end();
|
|
42
|
+
return names;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* P6.7.6 review pass — when a rendered template body is exactly one
|
|
46
|
+
* top-level `<caelo-slot name="content">…</caelo-slot>` element
|
|
47
|
+
* (typical of legacy templates whose body wraps the slot directly),
|
|
48
|
+
* peel the wrapper and return just its inner HTML. Returns `null` when
|
|
49
|
+
* the body has multiple top-level elements, no top-level content slot,
|
|
50
|
+
* or any other shape — so the caller can fall back to using the body
|
|
51
|
+
* as-is.
|
|
52
|
+
*
|
|
53
|
+
* Replaces the previous regex-based peel which silently failed on
|
|
54
|
+
* single-quote attributes, attribute reordering, or whitespace
|
|
55
|
+
* variations.
|
|
56
|
+
*/
|
|
57
|
+
export function extractInnerOfTopLevelContentSlot(html) {
|
|
58
|
+
let depth = 0;
|
|
59
|
+
let topLevelOpens = 0;
|
|
60
|
+
let topLevelTextBetween = false;
|
|
61
|
+
let contentSlotInnerStart = -1;
|
|
62
|
+
let contentSlotInnerEnd = -1;
|
|
63
|
+
let foundContentSlot = false;
|
|
64
|
+
const parser = new Parser({
|
|
65
|
+
onopentag(name, attrs) {
|
|
66
|
+
if (depth === 0) {
|
|
67
|
+
topLevelOpens += 1;
|
|
68
|
+
if (name === SLOT_TAG && attrs.name === "content" && topLevelOpens === 1) {
|
|
69
|
+
foundContentSlot = true;
|
|
70
|
+
contentSlotInnerStart = parser.endIndex + 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
depth += 1;
|
|
74
|
+
},
|
|
75
|
+
onclosetag(name) {
|
|
76
|
+
depth -= 1;
|
|
77
|
+
if (depth === 0 && name === SLOT_TAG && foundContentSlot && contentSlotInnerEnd === -1) {
|
|
78
|
+
contentSlotInnerEnd = parser.startIndex;
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
ontext(text) {
|
|
82
|
+
if (depth === 0 && text.trim().length > 0)
|
|
83
|
+
topLevelTextBetween = true;
|
|
84
|
+
},
|
|
85
|
+
}, { lowerCaseTags: true, recognizeSelfClosing: false });
|
|
86
|
+
parser.write(html);
|
|
87
|
+
parser.end();
|
|
88
|
+
if (!foundContentSlot ||
|
|
89
|
+
topLevelOpens !== 1 ||
|
|
90
|
+
topLevelTextBetween ||
|
|
91
|
+
contentSlotInnerStart === -1 ||
|
|
92
|
+
contentSlotInnerEnd === -1) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
return html.slice(contentSlotInnerStart, contentSlotInnerEnd);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Returns a copy of `templateHtml` where each `<caelo-slot name="X">…</caelo-slot>`
|
|
99
|
+
* has its inner HTML replaced by `replacement.contentByName.get(X)`. Slots
|
|
100
|
+
* with no entry render with their original inner HTML preserved (so a
|
|
101
|
+
* template-author placeholder stays visible in the editor preview).
|
|
102
|
+
*
|
|
103
|
+
* Throws on nested or unbalanced slot markers — those are template-author
|
|
104
|
+
* bugs and silently smoothing them over would just defer the discovery.
|
|
105
|
+
*/
|
|
106
|
+
export function applySlotReplacements(templateHtml, replacement) {
|
|
107
|
+
const ranges = [];
|
|
108
|
+
let openName = null;
|
|
109
|
+
let openInnerStart = 0;
|
|
110
|
+
let openOpenStart = 0;
|
|
111
|
+
const parser = new Parser({
|
|
112
|
+
onopentag(name, attrs) {
|
|
113
|
+
if (name !== SLOT_TAG)
|
|
114
|
+
return;
|
|
115
|
+
if (openName !== null) {
|
|
116
|
+
throw new Error(`nested <caelo-slot> not allowed (at offset ${parser.startIndex})`);
|
|
117
|
+
}
|
|
118
|
+
openName = attrs.name ?? "";
|
|
119
|
+
// `endIndex` of the opening tag points at the closing `>`; the inner
|
|
120
|
+
// HTML therefore starts one byte later.
|
|
121
|
+
openOpenStart = parser.startIndex;
|
|
122
|
+
openInnerStart = parser.endIndex + 1;
|
|
123
|
+
},
|
|
124
|
+
onclosetag(name) {
|
|
125
|
+
if (name !== SLOT_TAG)
|
|
126
|
+
return;
|
|
127
|
+
if (openName === null) {
|
|
128
|
+
throw new Error(`closing </caelo-slot> with no opener (at offset ${parser.startIndex})`);
|
|
129
|
+
}
|
|
130
|
+
// htmlparser2 auto-closes unterminated tags at EOF — detect that case
|
|
131
|
+
// by verifying the source actually contains `</caelo-slot>` at the
|
|
132
|
+
// reported offset. Auto-closed tags fire onclosetag at EOF without a
|
|
133
|
+
// matching `</` in the input.
|
|
134
|
+
const hasExplicitClose = templateHtml
|
|
135
|
+
.slice(parser.startIndex, parser.startIndex + SLOT_TAG.length + 3)
|
|
136
|
+
.toLowerCase()
|
|
137
|
+
.startsWith(`</${SLOT_TAG}`);
|
|
138
|
+
if (!hasExplicitClose) {
|
|
139
|
+
throw new Error(`unterminated <caelo-slot name="${openName}"> at offset ${openOpenStart}`);
|
|
140
|
+
}
|
|
141
|
+
ranges.push({
|
|
142
|
+
name: openName,
|
|
143
|
+
innerStart: openInnerStart,
|
|
144
|
+
innerEnd: parser.startIndex,
|
|
145
|
+
});
|
|
146
|
+
openName = null;
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
// recognizeSelfClosing handles `<caelo-slot name="x" />` style; we still
|
|
150
|
+
// require an explicit close tag so that case skips replacement (matches
|
|
151
|
+
// the documented "self-close passes through" limitation).
|
|
152
|
+
{ lowerCaseTags: true, recognizeSelfClosing: false });
|
|
153
|
+
parser.write(templateHtml);
|
|
154
|
+
parser.end();
|
|
155
|
+
if (openName !== null) {
|
|
156
|
+
throw new Error(`unterminated <caelo-slot name="${openName}"> at offset ${openOpenStart}`);
|
|
157
|
+
}
|
|
158
|
+
const parts = [];
|
|
159
|
+
const replaced = [];
|
|
160
|
+
const missing = [];
|
|
161
|
+
let cursor = 0;
|
|
162
|
+
for (const range of ranges) {
|
|
163
|
+
parts.push(templateHtml.slice(cursor, range.innerStart));
|
|
164
|
+
if (replacement.contentByName.has(range.name)) {
|
|
165
|
+
parts.push(replacement.contentByName.get(range.name) ?? "");
|
|
166
|
+
replaced.push(range.name);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
missing.push(range.name);
|
|
170
|
+
parts.push(templateHtml.slice(range.innerStart, range.innerEnd));
|
|
171
|
+
}
|
|
172
|
+
cursor = range.innerEnd;
|
|
173
|
+
}
|
|
174
|
+
parts.push(templateHtml.slice(cursor));
|
|
175
|
+
return { html: parts.join(""), replacedSlots: replaced, missingSlots: missing };
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=preview-scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-scanner.js","sourceRoot":"","sources":["../src/preview-scanner.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAE9B;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,SAAS,CAAC,IAAI,EAAE,KAAK;YACnB,IAAI,IAAI,KAAK,QAAQ;gBAAE,OAAO;YAC9B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QAC/B,CAAC;K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;QAC3B,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACzD,IAAI,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAC5D,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACvC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAClF,CAAC"}
|
package/dist/result.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discriminated-union Result type. Used at the Query API boundary where errors are
|
|
3
|
+
* expected (validation, RLS denials, unknown operations) and throwing is reserved
|
|
4
|
+
* for genuinely exceptional conditions (lost DB connection, logic bug).
|
|
5
|
+
*
|
|
6
|
+
* Per CLAUDE.md §4: "errors are values where it matters".
|
|
7
|
+
*/
|
|
8
|
+
export type Ok<T> = {
|
|
9
|
+
readonly ok: true;
|
|
10
|
+
readonly value: T;
|
|
11
|
+
};
|
|
12
|
+
export type Err<E> = {
|
|
13
|
+
readonly ok: false;
|
|
14
|
+
readonly error: E;
|
|
15
|
+
};
|
|
16
|
+
export type Result<T, E> = Ok<T> | Err<E>;
|
|
17
|
+
export declare function ok<T>(value: T): Ok<T>;
|
|
18
|
+
export declare function err<E>(error: E): Err<E>;
|
|
19
|
+
export declare function isOk<T, E>(result: Result<T, E>): result is Ok<T>;
|
|
20
|
+
export declare function isErr<T, E>(result: Result<T, E>): result is Err<E>;
|
|
21
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,EAAE,CAAC,CAAC,IAAI;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAC/D,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAE1C,wBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAErC;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAEvC;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAEhE;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAElE"}
|
package/dist/result.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
export function ok(value) {
|
|
3
|
+
return { ok: true, value };
|
|
4
|
+
}
|
|
5
|
+
export function err(error) {
|
|
6
|
+
return { ok: false, error };
|
|
7
|
+
}
|
|
8
|
+
export function isOk(result) {
|
|
9
|
+
return result.ok;
|
|
10
|
+
}
|
|
11
|
+
export function isErr(result) {
|
|
12
|
+
return !result.ok;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAcnC,MAAM,UAAU,EAAE,CAAI,KAAQ;IAC5B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,GAAG,CAAI,KAAQ;IAC7B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,IAAI,CAAO,MAAoB;IAC7C,OAAO,MAAM,CAAC,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,KAAK,CAAO,MAAoB;IAC9C,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AACpB,CAAC"}
|
package/dist/seo.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 8 — SEO primitives. Per-page SEO is structured fields only;
|
|
3
|
+
* the renderer projects them into <head> meta + canonical + JSON-LD.
|
|
4
|
+
* Per CLAUDE.md §2 "no raw HTML into <head>" — every Zod schema below
|
|
5
|
+
* is on `.strict()` so the AI cannot smuggle additional keys.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
export declare const CHANGEFREQ_VALUES: readonly ["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"];
|
|
9
|
+
export type Changefreq = (typeof CHANGEFREQ_VALUES)[number];
|
|
10
|
+
/** Recommended length caps — server enforces, client trims with feedback. */
|
|
11
|
+
export declare const SEO_TITLE_RECOMMENDED_MAX = 60;
|
|
12
|
+
export declare const SEO_DESCRIPTION_RECOMMENDED_MAX = 160;
|
|
13
|
+
export declare const SEO_DESCRIPTION_HARD_MAX = 320;
|
|
14
|
+
export declare const SEO_CANONICAL_MAX = 2048;
|
|
15
|
+
export declare const seoSetInputSchema: z.ZodObject<{
|
|
16
|
+
pageId: z.ZodString;
|
|
17
|
+
metaDescription: z.ZodOptional<z.ZodString>;
|
|
18
|
+
ogImageAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
canonicalUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
noindex: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
changefreq: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
never: "never";
|
|
23
|
+
always: "always";
|
|
24
|
+
hourly: "hourly";
|
|
25
|
+
daily: "daily";
|
|
26
|
+
weekly: "weekly";
|
|
27
|
+
monthly: "monthly";
|
|
28
|
+
yearly: "yearly";
|
|
29
|
+
}>>;
|
|
30
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export type SeoSetInput = z.infer<typeof seoSetInputSchema>;
|
|
33
|
+
export declare const seoAutofillInputSchema: z.ZodObject<{
|
|
34
|
+
pageId: z.ZodString;
|
|
35
|
+
metaDescription: z.ZodString;
|
|
36
|
+
ogImageAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type SeoAutofillInput = z.infer<typeof seoAutofillInputSchema>;
|
|
39
|
+
export declare const seoOptimizeInputSchema: z.ZodObject<{
|
|
40
|
+
pageId: z.ZodString;
|
|
41
|
+
metaDescription: z.ZodString;
|
|
42
|
+
ogImageAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
context: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export type SeoOptimizeInput = z.infer<typeof seoOptimizeInputSchema>;
|
|
46
|
+
export declare const siteDefaultsSetSeoInputSchema: z.ZodObject<{
|
|
47
|
+
siteBaseUrl: z.ZodString;
|
|
48
|
+
sitemapEnabled: z.ZodBoolean;
|
|
49
|
+
organizationJson: z.ZodDefault<z.ZodObject<{
|
|
50
|
+
name: z.ZodOptional<z.ZodString>;
|
|
51
|
+
url: z.ZodOptional<z.ZodString>;
|
|
52
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
53
|
+
sameAs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
export type SiteDefaultsSetSeoInput = z.infer<typeof siteDefaultsSetSeoInputSchema>;
|
|
57
|
+
export interface PageSeoRow {
|
|
58
|
+
pageId: string;
|
|
59
|
+
metaDescription: string;
|
|
60
|
+
ogImageAssetId: string | null;
|
|
61
|
+
canonicalUrl: string | null;
|
|
62
|
+
noindex: boolean;
|
|
63
|
+
changefreq: Changefreq;
|
|
64
|
+
priority: number;
|
|
65
|
+
autofilledAt: string | null;
|
|
66
|
+
optimizedAt: string | null;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
}
|
|
69
|
+
export interface SiteSeoSettings {
|
|
70
|
+
siteBaseUrl: string;
|
|
71
|
+
sitemapEnabled: boolean;
|
|
72
|
+
organization: {
|
|
73
|
+
name?: string;
|
|
74
|
+
url?: string;
|
|
75
|
+
logo?: string;
|
|
76
|
+
sameAs?: string[];
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Resolve the canonical URL for a page. If `pages_seo.canonical_url`
|
|
81
|
+
* is set it wins; otherwise build `<siteBaseUrl>/<page-path>` from
|
|
82
|
+
* the page's slug + locale. Locale strategy is single-locale (no
|
|
83
|
+
* prefix) until P9 i18n.
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveCanonicalUrl(args: {
|
|
86
|
+
siteBaseUrl: string;
|
|
87
|
+
pageSlug: string;
|
|
88
|
+
pageLocale: string;
|
|
89
|
+
override: string | null;
|
|
90
|
+
/** P9 — when present, the locale's url_strategy decides the URL shape. */
|
|
91
|
+
localeConfig?: {
|
|
92
|
+
code: string;
|
|
93
|
+
urlStrategy: "none" | "subdirectory" | "subdomain" | "domain";
|
|
94
|
+
urlHost: string | null;
|
|
95
|
+
isDefault: boolean;
|
|
96
|
+
};
|
|
97
|
+
}): string;
|
|
98
|
+
export interface SeoMetaInput {
|
|
99
|
+
title: string;
|
|
100
|
+
metaDescription: string;
|
|
101
|
+
canonical: string;
|
|
102
|
+
noindex: boolean;
|
|
103
|
+
ogImageUrl: string | null;
|
|
104
|
+
hreflang: {
|
|
105
|
+
locale: string;
|
|
106
|
+
url: string;
|
|
107
|
+
}[];
|
|
108
|
+
organization: SiteSeoSettings["organization"];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Render the <head> meta block for a page. Returns the HTML string
|
|
112
|
+
* the renderer injects just before </head>. Order is canonical
|
|
113
|
+
* (W3C-recommended): charset / viewport stay in the layout; meta
|
|
114
|
+
* description + canonical + robots + Open Graph + Twitter card +
|
|
115
|
+
* hreflang + JSON-LD.
|
|
116
|
+
*
|
|
117
|
+
* No raw HTML escape hatch — every variable is HTML-attribute-encoded.
|
|
118
|
+
*/
|
|
119
|
+
export declare function renderSeoHead(input: SeoMetaInput): string;
|
|
120
|
+
/**
|
|
121
|
+
* Inject `renderSeoHead`'s output just before `</head>`. Replaces any
|
|
122
|
+
* existing `<title>` so the page-level title wins over a layout-
|
|
123
|
+
* supplied default. Pre-existing meta tags from the layout are left
|
|
124
|
+
* alone — authors can still drop e.g. `<meta name="theme-color">` in
|
|
125
|
+
* the layout HTML.
|
|
126
|
+
*/
|
|
127
|
+
export declare function injectSeoIntoHead(html: string, headBlock: string): string;
|
|
128
|
+
//# sourceMappingURL=seo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seo.d.ts","sourceRoot":"","sources":["../src/seo.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB,gFAQpB,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;kBAUnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,sBAAsB;;;;kBAMxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB;;;;;kBAQxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,6BAA6B;;;;;;;;;kBAkB/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,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AAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,YAAY,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA2DzD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CASzE"}
|
package/dist/seo.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Phase 8 — SEO primitives. Per-page SEO is structured fields only;
|
|
4
|
+
* the renderer projects them into <head> meta + canonical + JSON-LD.
|
|
5
|
+
* Per CLAUDE.md §2 "no raw HTML into <head>" — every Zod schema below
|
|
6
|
+
* is on `.strict()` so the AI cannot smuggle additional keys.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
export const CHANGEFREQ_VALUES = [
|
|
10
|
+
"always",
|
|
11
|
+
"hourly",
|
|
12
|
+
"daily",
|
|
13
|
+
"weekly",
|
|
14
|
+
"monthly",
|
|
15
|
+
"yearly",
|
|
16
|
+
"never",
|
|
17
|
+
];
|
|
18
|
+
/** Recommended length caps — server enforces, client trims with feedback. */
|
|
19
|
+
export const SEO_TITLE_RECOMMENDED_MAX = 60;
|
|
20
|
+
export const SEO_DESCRIPTION_RECOMMENDED_MAX = 160;
|
|
21
|
+
export const SEO_DESCRIPTION_HARD_MAX = 320;
|
|
22
|
+
export const SEO_CANONICAL_MAX = 2048;
|
|
23
|
+
export const seoSetInputSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
pageId: z.string().uuid(),
|
|
26
|
+
metaDescription: z.string().max(SEO_DESCRIPTION_HARD_MAX).optional(),
|
|
27
|
+
ogImageAssetId: z.string().uuid().nullable().optional(),
|
|
28
|
+
canonicalUrl: z.string().max(SEO_CANONICAL_MAX).nullable().optional(),
|
|
29
|
+
noindex: z.boolean().optional(),
|
|
30
|
+
changefreq: z.enum(CHANGEFREQ_VALUES).optional(),
|
|
31
|
+
priority: z.number().min(0).max(1).optional(),
|
|
32
|
+
})
|
|
33
|
+
.strict();
|
|
34
|
+
export const seoAutofillInputSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
pageId: z.string().uuid(),
|
|
37
|
+
metaDescription: z.string().min(1).max(SEO_DESCRIPTION_HARD_MAX),
|
|
38
|
+
ogImageAssetId: z.string().uuid().nullable().optional(),
|
|
39
|
+
})
|
|
40
|
+
.strict();
|
|
41
|
+
export const seoOptimizeInputSchema = z
|
|
42
|
+
.object({
|
|
43
|
+
pageId: z.string().uuid(),
|
|
44
|
+
metaDescription: z.string().min(1).max(SEO_DESCRIPTION_HARD_MAX),
|
|
45
|
+
ogImageAssetId: z.string().uuid().nullable().optional(),
|
|
46
|
+
/** Optional user-supplied context (keyword research, intent shifts) recorded in audit. */
|
|
47
|
+
context: z.string().max(4000).optional(),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
export const siteDefaultsSetSeoInputSchema = z
|
|
51
|
+
.object({
|
|
52
|
+
siteBaseUrl: z
|
|
53
|
+
.string()
|
|
54
|
+
.min(1)
|
|
55
|
+
.max(2048)
|
|
56
|
+
.url("siteBaseUrl must be an absolute URL (https://example.com)"),
|
|
57
|
+
sitemapEnabled: z.boolean(),
|
|
58
|
+
organizationJson: z
|
|
59
|
+
.object({
|
|
60
|
+
name: z.string().max(256).optional(),
|
|
61
|
+
url: z.string().max(2048).optional(),
|
|
62
|
+
logo: z.string().max(2048).optional(),
|
|
63
|
+
sameAs: z.array(z.string().max(2048)).max(20).optional(),
|
|
64
|
+
})
|
|
65
|
+
.strict()
|
|
66
|
+
.default({}),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the canonical URL for a page. If `pages_seo.canonical_url`
|
|
71
|
+
* is set it wins; otherwise build `<siteBaseUrl>/<page-path>` from
|
|
72
|
+
* the page's slug + locale. Locale strategy is single-locale (no
|
|
73
|
+
* prefix) until P9 i18n.
|
|
74
|
+
*/
|
|
75
|
+
export function resolveCanonicalUrl(args) {
|
|
76
|
+
if (args.override && args.override.length > 0)
|
|
77
|
+
return args.override;
|
|
78
|
+
const base = args.siteBaseUrl.replace(/\/$/, "");
|
|
79
|
+
// Slug `home` renders to root path per the existing pageOutputPath
|
|
80
|
+
// contract in apps/static-generator.
|
|
81
|
+
const cleanSlug = args.pageSlug === "home" || args.pageSlug === "" ? "" : args.pageSlug;
|
|
82
|
+
const cfg = args.localeConfig;
|
|
83
|
+
if (cfg && cfg.urlStrategy !== "none") {
|
|
84
|
+
if (cfg.urlStrategy === "subdirectory") {
|
|
85
|
+
return cleanSlug ? `${base}/${cfg.code}/${cleanSlug}/` : `${base}/${cfg.code}/`;
|
|
86
|
+
}
|
|
87
|
+
if ((cfg.urlStrategy === "subdomain" || cfg.urlStrategy === "domain") && cfg.urlHost) {
|
|
88
|
+
const protocol = base.startsWith("http://") ? "http://" : "https://";
|
|
89
|
+
return cleanSlug ? `${protocol}${cfg.urlHost}/${cleanSlug}/` : `${protocol}${cfg.urlHost}/`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return cleanSlug ? `${base}/${cleanSlug}/` : `${base}/`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Render the <head> meta block for a page. Returns the HTML string
|
|
96
|
+
* the renderer injects just before </head>. Order is canonical
|
|
97
|
+
* (W3C-recommended): charset / viewport stay in the layout; meta
|
|
98
|
+
* description + canonical + robots + Open Graph + Twitter card +
|
|
99
|
+
* hreflang + JSON-LD.
|
|
100
|
+
*
|
|
101
|
+
* No raw HTML escape hatch — every variable is HTML-attribute-encoded.
|
|
102
|
+
*/
|
|
103
|
+
export function renderSeoHead(input) {
|
|
104
|
+
const enc = (s) => s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
105
|
+
const lines = [];
|
|
106
|
+
lines.push(`<title>${enc(input.title)}</title>`);
|
|
107
|
+
if (input.metaDescription) {
|
|
108
|
+
lines.push(`<meta name="description" content="${enc(input.metaDescription)}" />`);
|
|
109
|
+
}
|
|
110
|
+
lines.push(`<link rel="canonical" href="${enc(input.canonical)}" />`);
|
|
111
|
+
if (input.noindex) {
|
|
112
|
+
lines.push(`<meta name="robots" content="noindex" />`);
|
|
113
|
+
}
|
|
114
|
+
// Open Graph
|
|
115
|
+
lines.push(`<meta property="og:title" content="${enc(input.title)}" />`);
|
|
116
|
+
if (input.metaDescription) {
|
|
117
|
+
lines.push(`<meta property="og:description" content="${enc(input.metaDescription)}" />`);
|
|
118
|
+
}
|
|
119
|
+
lines.push(`<meta property="og:type" content="website" />`);
|
|
120
|
+
lines.push(`<meta property="og:url" content="${enc(input.canonical)}" />`);
|
|
121
|
+
if (input.ogImageUrl) {
|
|
122
|
+
lines.push(`<meta property="og:image" content="${enc(input.ogImageUrl)}" />`);
|
|
123
|
+
}
|
|
124
|
+
// Twitter card
|
|
125
|
+
lines.push(`<meta name="twitter:card" content="${input.ogImageUrl ? "summary_large_image" : "summary"}" />`);
|
|
126
|
+
// Hreflang per locale + x-default. P8 ships zero rows; P9 i18n
|
|
127
|
+
// populates pages_hreflang and the existing renderer iterates.
|
|
128
|
+
for (const h of input.hreflang) {
|
|
129
|
+
lines.push(`<link rel="alternate" hreflang="${enc(h.locale)}" href="${enc(h.url)}" />`);
|
|
130
|
+
}
|
|
131
|
+
if (input.hreflang.length > 0) {
|
|
132
|
+
lines.push(`<link rel="alternate" hreflang="x-default" href="${enc(input.canonical)}" />`);
|
|
133
|
+
}
|
|
134
|
+
// JSON-LD WebPage block referencing the Organization (when set).
|
|
135
|
+
const ld = {
|
|
136
|
+
"@context": "https://schema.org",
|
|
137
|
+
"@type": "WebPage",
|
|
138
|
+
name: input.title,
|
|
139
|
+
url: input.canonical,
|
|
140
|
+
};
|
|
141
|
+
if (input.metaDescription)
|
|
142
|
+
ld.description = input.metaDescription;
|
|
143
|
+
if (input.ogImageUrl)
|
|
144
|
+
ld.image = input.ogImageUrl;
|
|
145
|
+
if (input.organization.name) {
|
|
146
|
+
ld.publisher = {
|
|
147
|
+
"@type": "Organization",
|
|
148
|
+
name: input.organization.name,
|
|
149
|
+
...(input.organization.url ? { url: input.organization.url } : {}),
|
|
150
|
+
...(input.organization.logo
|
|
151
|
+
? { logo: { "@type": "ImageObject", url: input.organization.logo } }
|
|
152
|
+
: {}),
|
|
153
|
+
...(input.organization.sameAs?.length ? { sameAs: input.organization.sameAs } : {}),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
lines.push(`<script type="application/ld+json">${JSON.stringify(ld).replace(/</g, "\\u003c")}</script>`);
|
|
157
|
+
return lines.join("\n");
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Inject `renderSeoHead`'s output just before `</head>`. Replaces any
|
|
161
|
+
* existing `<title>` so the page-level title wins over a layout-
|
|
162
|
+
* supplied default. Pre-existing meta tags from the layout are left
|
|
163
|
+
* alone — authors can still drop e.g. `<meta name="theme-color">` in
|
|
164
|
+
* the layout HTML.
|
|
165
|
+
*/
|
|
166
|
+
export function injectSeoIntoHead(html, headBlock) {
|
|
167
|
+
// Strip a layout-supplied <title> if present; we'll re-emit it in
|
|
168
|
+
// the headBlock at the right position.
|
|
169
|
+
const titleStripped = html.replace(/<title\b[^>]*>[\s\S]*?<\/title>/i, "");
|
|
170
|
+
if (titleStripped.includes("</head>")) {
|
|
171
|
+
return titleStripped.replace("</head>", `${headBlock}\n</head>`);
|
|
172
|
+
}
|
|
173
|
+
// No closing head tag — prepend the block to the document.
|
|
174
|
+
return `${headBlock}\n${titleStripped}`;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=seo.js.map
|
package/dist/seo.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seo.js","sourceRoot":"","s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