@vectoriox/iox-ui 4.33.1 → 4.35.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.
@@ -0,0 +1,400 @@
1
+ /**
2
+ * The canonical shape of a page's SEO metadata, plus the flat tag list both renderers emit.
3
+ *
4
+ * ⚠️ This file is the ONLY declaration of that shape. Before it existed, `iox-cms` stored
5
+ * `seo.og.title` while the SSR engine read a flat `seo.ogTitle`, so no Open Graph tag had ever been
6
+ * emitted, and `iox-cms-client` carried a third, hand-copied variant of the same schema. See
7
+ * iox-ai-guidance `architecture/cms/seo-plan.md`.
8
+ */
9
+ /**
10
+ * The text fields that can carry a binding, as dotted paths into the document.
11
+ *
12
+ * One list, used by the resolver and (phase 2) by the panel that draws the bind affordance — so a
13
+ * field can never be bindable in the UI and ignored at render time. `robots`, `sitemap.*` and
14
+ * `structuredData` are deliberately absent: they are pick-lists and blobs, not prose.
15
+ */
16
+ const SEO_BINDABLE_FIELDS = [
17
+ 'title',
18
+ 'description',
19
+ 'canonicalUrl',
20
+ 'og.title',
21
+ 'og.description',
22
+ 'og.image',
23
+ 'twitter.title',
24
+ 'twitter.description',
25
+ 'twitter.image',
26
+ ];
27
+ /**
28
+ * The bottom rung of the ladder, as a table rather than a chain of ifs.
29
+ *
30
+ * Deliberately short. `og:title` and `twitter:*` are NOT here — `seoToTags` already falls back to
31
+ * the page title for them, and materialising a copy of a value we did not author would only make
32
+ * later drift harder to see.
33
+ */
34
+ const SEO_AUTO_SOURCES = [
35
+ { field: 'title', source: 'contentTitle' },
36
+ { field: 'description', source: 'contentDescription' },
37
+ { field: 'og.image', source: 'contentImage' },
38
+ { field: 'canonicalUrl', source: 'pageUrl' },
39
+ ];
40
+ /** Recommended maximum before search results truncate the title. */
41
+ const SEO_TITLE_MAX = 60;
42
+ /** Recommended maximum before search results truncate the description. */
43
+ const SEO_DESCRIPTION_MAX = 160;
44
+ const SEO_ROBOTS_OPTIONS = [
45
+ { label: 'Index, Follow', value: 'index, follow' },
46
+ { label: 'Index, No Follow', value: 'index, nofollow' },
47
+ { label: 'No Index, Follow', value: 'noindex, follow' },
48
+ { label: 'No Index, No Follow', value: 'noindex, nofollow' },
49
+ ];
50
+ const SEO_TWITTER_CARD_OPTIONS = [
51
+ { label: 'Summary', value: 'summary' },
52
+ { label: 'Summary Large Image', value: 'summary_large_image' },
53
+ { label: 'App', value: 'app' },
54
+ { label: 'Player', value: 'player' },
55
+ ];
56
+ const SEO_CHANGE_FREQ_OPTIONS = [
57
+ { label: 'Always', value: 'always' },
58
+ { label: 'Hourly', value: 'hourly' },
59
+ { label: 'Daily', value: 'daily' },
60
+ { label: 'Weekly', value: 'weekly' },
61
+ { label: 'Monthly', value: 'monthly' },
62
+ { label: 'Yearly', value: 'yearly' },
63
+ { label: 'Never', value: 'never' },
64
+ ];
65
+
66
+ /**
67
+ * Coerce whatever a page document happens to hold into a `SeoDoc`.
68
+ *
69
+ * Every consumer calls this before reading `seo`, because four shapes are in the wild:
70
+ * • the current nested shape (`og.title`);
71
+ * • the flat shape the SSR engine used to read (`ogTitle`) — never actually written, but a
72
+ * document hand-edited against the old engine code could carry it;
73
+ * • `""` for "not set", which must not become an empty `<meta>`;
74
+ * • `{ override: '…' }`, the per-field value object that plan phase 2 introduces — tolerated here
75
+ * so the ladder can land without a second normalizer.
76
+ *
77
+ * Empty branches are dropped rather than left as `{}`, so `if (seo.og)` is a meaningful test.
78
+ */
79
+ function normalizeSeoDoc(raw) {
80
+ const src = asRecord(raw);
81
+ if (!src)
82
+ return {};
83
+ const og = compact({
84
+ title: seoString(pick(src, 'og', 'title') ?? src['ogTitle']),
85
+ description: seoString(pick(src, 'og', 'description') ?? src['ogDescription']),
86
+ image: seoString(pick(src, 'og', 'image') ?? src['ogImage']),
87
+ });
88
+ const twitter = compact({
89
+ card: seoString(pick(src, 'twitter', 'card')),
90
+ title: seoString(pick(src, 'twitter', 'title')),
91
+ description: seoString(pick(src, 'twitter', 'description')),
92
+ image: seoString(pick(src, 'twitter', 'image')),
93
+ });
94
+ const sitemap = compact({
95
+ include: bool(pick(src, 'sitemap', 'include')),
96
+ priority: num(pick(src, 'sitemap', 'priority')),
97
+ changeFreq: seoString(pick(src, 'sitemap', 'changeFreq')),
98
+ });
99
+ const structuredData = structured(src['structuredData']);
100
+ const doc = compact({
101
+ title: seoString(src['title']),
102
+ description: seoString(src['description']),
103
+ keywords: seoString(src['keywords']),
104
+ canonicalUrl: seoString(src['canonicalUrl']),
105
+ robots: seoString(src['robots']),
106
+ og,
107
+ twitter,
108
+ sitemap,
109
+ structuredData,
110
+ });
111
+ return doc ?? {};
112
+ }
113
+ /** Read `src[branch][leaf]` without assuming the branch exists or is an object. */
114
+ function pick(src, branch, leaf) {
115
+ const nested = asRecord(src[branch]);
116
+ return nested ? nested[leaf] : undefined;
117
+ }
118
+ /**
119
+ * A field's value as a trimmed string, or `undefined`. Exported because the resolver needs the exact
120
+ * same coercion for a value it has just pulled out of a data source.
121
+ *
122
+ * Unwraps the value object: a bound or auto field has no `override`, so it correctly resolves to
123
+ * `undefined` here and `resolveSeo` fills it in from the lower rungs.
124
+ */
125
+ function seoString(value) {
126
+ const wrapper = asRecord(value);
127
+ const raw = wrapper ? wrapper['override'] : value;
128
+ if (typeof raw === 'number')
129
+ return String(raw);
130
+ if (typeof raw !== 'string')
131
+ return undefined;
132
+ const trimmed = raw.trim();
133
+ return trimmed.length ? trimmed : undefined;
134
+ }
135
+ /**
136
+ * `UIFormToDTO` can hand back `"true"` / `"false"` for a switch (see
137
+ * `architecture/cms/shop.md` — the boolean/number coercion pitfall), so accept both.
138
+ */
139
+ function bool(value) {
140
+ if (typeof value === 'boolean')
141
+ return value;
142
+ if (value === 'true')
143
+ return true;
144
+ if (value === 'false')
145
+ return false;
146
+ return undefined;
147
+ }
148
+ function num(value) {
149
+ if (typeof value === 'number')
150
+ return Number.isFinite(value) ? value : undefined;
151
+ if (typeof value !== 'string' || !value.trim().length)
152
+ return undefined;
153
+ const parsed = Number(value);
154
+ return Number.isFinite(parsed) ? parsed : undefined;
155
+ }
156
+ /** JSON-LD is stored as an object or as a JSON string from the `json` controller. */
157
+ function structured(value) {
158
+ if (typeof value === 'string') {
159
+ const trimmed = value.trim();
160
+ if (!trimmed.length)
161
+ return undefined;
162
+ try {
163
+ return JSON.parse(trimmed);
164
+ }
165
+ catch {
166
+ return undefined;
167
+ }
168
+ }
169
+ if (Array.isArray(value))
170
+ return value.length ? value : undefined;
171
+ const record = asRecord(value);
172
+ return record && Object.keys(record).length ? record : undefined;
173
+ }
174
+ function asRecord(value) {
175
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
176
+ ? value
177
+ : undefined;
178
+ }
179
+ /** Drop `undefined` values and empty nested objects, so absence is always `undefined`. */
180
+ function compact(value) {
181
+ const out = {};
182
+ for (const [key, entry] of Object.entries(value)) {
183
+ if (entry === undefined)
184
+ continue;
185
+ out[key] = entry;
186
+ }
187
+ return (Object.keys(out).length ? out : undefined);
188
+ }
189
+
190
+ /**
191
+ * Turn a page's SEO document into the flat list of head tags to emit.
192
+ *
193
+ * Both renderers call this, so a page cannot describe itself differently to a crawler than the
194
+ * builder previews. The order is fixed and part of the contract: title, description, keywords,
195
+ * canonical, Open Graph, Twitter, robots.
196
+ *
197
+ * Fallbacks are deliberately shallow — `og:title` reuses the page title, `twitter:*` reuses the
198
+ * Open Graph values — because a social scraper that finds no `og:title` falls back to `<title>`
199
+ * itself, and duplicating a value we did not author only makes the drift harder to see. The
200
+ * "derive from the page content" half of the ladder (first h1, first paragraph, first image) is
201
+ * `resolveSeo`, which runs BEFORE this and hands its output in as a filled-in `SeoDoc`.
202
+ */
203
+ function seoToTags(seo, ctx = {}) {
204
+ const doc = normalizeSeoDoc(seo);
205
+ const tags = [];
206
+ const title = doc.title ?? trimmed(ctx.fallbackTitle);
207
+ if (title)
208
+ tags.push({ kind: 'title', content: title });
209
+ if (doc.description)
210
+ tags.push({ kind: 'meta', attr: 'name', key: 'description', content: doc.description });
211
+ if (doc.keywords)
212
+ tags.push({ kind: 'meta', attr: 'name', key: 'keywords', content: doc.keywords });
213
+ if (doc.canonicalUrl)
214
+ tags.push({ kind: 'link', rel: 'canonical', href: doc.canonicalUrl });
215
+ // Open Graph. `og:url` reuses the canonical URL, which is what it means.
216
+ const ogTitle = doc.og?.title ?? title;
217
+ const ogDescription = doc.og?.description ?? doc.description;
218
+ if (ogTitle)
219
+ tags.push({ kind: 'meta', attr: 'property', key: 'og:title', content: ogTitle });
220
+ if (ogDescription)
221
+ tags.push({ kind: 'meta', attr: 'property', key: 'og:description', content: ogDescription });
222
+ if (doc.og?.image)
223
+ tags.push({ kind: 'meta', attr: 'property', key: 'og:image', content: doc.og.image });
224
+ if (doc.canonicalUrl)
225
+ tags.push({ kind: 'meta', attr: 'property', key: 'og:url', content: doc.canonicalUrl });
226
+ // Twitter. Emitted ONLY when a card type is chosen: without `twitter:card` the other tags are
227
+ // ignored anyway, so writing them would be noise that looks like configuration.
228
+ if (doc.twitter?.card) {
229
+ tags.push({ kind: 'meta', attr: 'name', key: 'twitter:card', content: doc.twitter.card });
230
+ const twitterTitle = doc.twitter.title ?? ogTitle;
231
+ const twitterDescription = doc.twitter.description ?? ogDescription;
232
+ const twitterImage = doc.twitter.image ?? doc.og?.image;
233
+ if (twitterTitle)
234
+ tags.push({ kind: 'meta', attr: 'name', key: 'twitter:title', content: twitterTitle });
235
+ if (twitterDescription) {
236
+ tags.push({ kind: 'meta', attr: 'name', key: 'twitter:description', content: twitterDescription });
237
+ }
238
+ if (twitterImage)
239
+ tags.push({ kind: 'meta', attr: 'name', key: 'twitter:image', content: twitterImage });
240
+ }
241
+ if (doc.robots)
242
+ tags.push({ kind: 'meta', attr: 'name', key: 'robots', content: doc.robots });
243
+ return tags;
244
+ }
245
+ function trimmed(value) {
246
+ const out = value?.trim();
247
+ return out?.length ? out : undefined;
248
+ }
249
+
250
+ /**
251
+ * The authoring schema for the `seo` object, in the platform's standard property dialect: `label`
252
+ * at property level, rendering metadata under `controller`.
253
+ *
254
+ * ONE builder, two callers: `iox-cms` spreads it into `PagesSchema` (the stored schema) and
255
+ * `iox-cms-client` feeds it to `<dynamic-form>`. Those used to be two hand-written copies that had
256
+ * already drifted — different controller types for the same field, and the client's copy missing
257
+ * `structuredData` entirely.
258
+ *
259
+ * `keywords` is deliberately absent: the tag is emitted when a document carries one, but there is
260
+ * no reason to invite new ones.
261
+ */
262
+ function buildSeoSchemaProperties() {
263
+ return {
264
+ title: {
265
+ type: 'string',
266
+ label: 'Meta Title',
267
+ controller: {
268
+ type: 'text',
269
+ placeholder: 'Page title for search engines',
270
+ maxLength: SEO_TITLE_MAX,
271
+ },
272
+ },
273
+ description: {
274
+ type: 'string',
275
+ label: 'Meta Description',
276
+ controller: {
277
+ type: 'textarea',
278
+ placeholder: 'Brief description for search results',
279
+ maxLength: SEO_DESCRIPTION_MAX,
280
+ },
281
+ },
282
+ canonicalUrl: {
283
+ type: 'string',
284
+ label: 'Canonical URL',
285
+ controller: {
286
+ type: 'text',
287
+ placeholder: 'https://example.com/page',
288
+ },
289
+ },
290
+ robots: {
291
+ type: 'string',
292
+ label: 'Robots',
293
+ controller: {
294
+ type: 'select',
295
+ options: SEO_ROBOTS_OPTIONS.map(option => ({ ...option })),
296
+ },
297
+ },
298
+ og: {
299
+ type: 'object',
300
+ label: 'Open Graph',
301
+ controller: { type: 'object' },
302
+ properties: {
303
+ title: {
304
+ type: 'string',
305
+ label: 'OG Title',
306
+ controller: { type: 'text', placeholder: 'Title for social sharing' },
307
+ },
308
+ description: {
309
+ type: 'string',
310
+ label: 'OG Description',
311
+ controller: { type: 'textarea', placeholder: 'Description for social sharing' },
312
+ },
313
+ image: {
314
+ type: 'string',
315
+ label: 'OG Image',
316
+ controller: { type: 'image' },
317
+ },
318
+ },
319
+ },
320
+ twitter: {
321
+ type: 'object',
322
+ label: 'Twitter Card',
323
+ controller: { type: 'object' },
324
+ properties: {
325
+ card: {
326
+ type: 'string',
327
+ label: 'Card Type',
328
+ controller: {
329
+ type: 'select',
330
+ options: SEO_TWITTER_CARD_OPTIONS.map(option => ({ ...option })),
331
+ },
332
+ },
333
+ title: {
334
+ type: 'string',
335
+ label: 'Twitter Title',
336
+ controller: { type: 'text' },
337
+ },
338
+ description: {
339
+ type: 'string',
340
+ label: 'Twitter Description',
341
+ controller: { type: 'textarea' },
342
+ },
343
+ image: {
344
+ type: 'string',
345
+ label: 'Twitter Image',
346
+ controller: { type: 'image' },
347
+ },
348
+ },
349
+ },
350
+ structuredData: {
351
+ type: 'object',
352
+ label: 'Structured Data (JSON-LD)',
353
+ controller: { type: 'json' },
354
+ },
355
+ sitemap: {
356
+ type: 'object',
357
+ label: 'Sitemap Settings',
358
+ controller: { type: 'object' },
359
+ properties: {
360
+ include: {
361
+ type: 'boolean',
362
+ label: 'Include in Sitemap',
363
+ controller: { type: 'switch' },
364
+ },
365
+ priority: {
366
+ type: 'number',
367
+ label: 'Priority',
368
+ controller: { type: 'range', options: { min: 0, max: 1, step: 0.1 } },
369
+ },
370
+ changeFreq: {
371
+ type: 'string',
372
+ label: 'Change Frequency',
373
+ controller: {
374
+ type: 'select',
375
+ options: SEO_CHANGE_FREQ_OPTIONS.map(option => ({ ...option })),
376
+ },
377
+ },
378
+ },
379
+ },
380
+ };
381
+ }
382
+
383
+ /*
384
+ * @vectoriox/iox-ui/seo-core — the shared, FRAMEWORK-FREE core of page SEO.
385
+ *
386
+ * ⚠️ Nothing in this entry point may import Angular, RxJS, the DOM, or Node. It is consumed by
387
+ * THREE runtimes: the builder panel (Angular), the SSR engine (Angular), and `iox-cms` (NestJS,
388
+ * plain Node) — the same reason `forms-core` exists.
389
+ *
390
+ * A page describes itself to a crawler exactly once: `seoToTags` is the only place that decides
391
+ * which head tags a page emits, and `buildSeoSchemaProperties` the only place that declares what an
392
+ * author can fill in. See iox-ai-guidance `architecture/cms/seo-plan.md`.
393
+ */
394
+
395
+ /**
396
+ * Generated bundle index. Do not edit.
397
+ */
398
+
399
+ export { SEO_AUTO_SOURCES, SEO_BINDABLE_FIELDS, SEO_CHANGE_FREQ_OPTIONS, SEO_DESCRIPTION_MAX, SEO_ROBOTS_OPTIONS, SEO_TITLE_MAX, SEO_TWITTER_CARD_OPTIONS, buildSeoSchemaProperties, normalizeSeoDoc, seoString, seoToTags };
400
+ //# sourceMappingURL=vectoriox-iox-ui-seo-core.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vectoriox-iox-ui-seo-core.mjs","sources":["../../../projects/iox-ui/src/seo-core/seo.model.ts","../../../projects/iox-ui/src/seo-core/normalize.ts","../../../projects/iox-ui/src/seo-core/tags.ts","../../../projects/iox-ui/src/seo-core/schema.ts","../../../projects/iox-ui/src/seo-core/public-api.ts","../../../projects/iox-ui/src/seo-core/vectoriox-iox-ui-seo-core.ts"],"sourcesContent":["/**\n * The canonical shape of a page's SEO metadata, plus the flat tag list both renderers emit.\n *\n * ⚠️ This file is the ONLY declaration of that shape. Before it existed, `iox-cms` stored\n * `seo.og.title` while the SSR engine read a flat `seo.ogTitle`, so no Open Graph tag had ever been\n * emitted, and `iox-cms-client` carried a third, hand-copied variant of the same schema. See\n * iox-ai-guidance `architecture/cms/seo-plan.md`.\n */\n\n/** Open Graph subset we author and emit. */\nexport interface SeoOg {\n title?: string;\n description?: string;\n image?: string;\n}\n\n/** Twitter-card subset. Emitted only when `card` is set — see `seoToTags`. */\nexport interface SeoTwitter {\n card?: string;\n title?: string;\n description?: string;\n image?: string;\n}\n\n/** Sitemap participation for this page. Consumed by the sitemap route (plan phase 3). */\nexport interface SeoSitemap {\n include?: boolean;\n priority?: number;\n changeFreq?: string;\n}\n\n/**\n * A page's stored SEO metadata, normalized.\n *\n * `keywords` has no authoring field — search engines have ignored the tag for over a decade — but\n * it is read and emitted when a document already carries one, because the engine used to read it.\n */\nexport interface SeoDoc {\n title?: string;\n description?: string;\n keywords?: string;\n canonicalUrl?: string;\n robots?: string;\n og?: SeoOg;\n twitter?: SeoTwitter;\n structuredData?: unknown;\n sitemap?: SeoSitemap;\n}\n\n/**\n * A binding on an SEO field. Structurally the resolvable part of an `IoxBinding` — `source` picks an\n * entry in the page's resolved data (`$current` on a template page), `path` walks into it, `pipes`\n * are the render-time transforms. Typed loosely because the pipe catalog lives in the main\n * `@vectoriox/iox-ui` entry point, which this framework-free one must not import.\n */\nexport interface SeoBinding {\n source: string;\n path?: string;\n pipes?: readonly unknown[];\n}\n\n/**\n * One SEO field as stored once it carries more than a typed string.\n *\n * The ladder is `override` → `binding` → auto; `auto: false` opts that field out of the automatic\n * value, leaving it genuinely empty. A bare `string` in a stored document means `{ override }`, so\n * nothing has to be migrated.\n */\nexport interface SeoFieldValue {\n override?: string;\n binding?: SeoBinding;\n auto?: false;\n}\n\n/** A stored SEO document, before resolution: any text field may be a plain string or a value object. */\nexport type SeoRawDoc = Record<string, unknown>;\n\n/**\n * The text fields that can carry a binding, as dotted paths into the document.\n *\n * One list, used by the resolver and (phase 2) by the panel that draws the bind affordance — so a\n * field can never be bindable in the UI and ignored at render time. `robots`, `sitemap.*` and\n * `structuredData` are deliberately absent: they are pick-lists and blobs, not prose.\n */\nexport const SEO_BINDABLE_FIELDS: readonly string[] = [\n 'title',\n 'description',\n 'canonicalUrl',\n 'og.title',\n 'og.description',\n 'og.image',\n 'twitter.title',\n 'twitter.description',\n 'twitter.image',\n];\n\n/** Where an automatic value comes from when a field has neither an override nor a binding. */\nexport type SeoAutoSource = 'contentTitle' | 'contentDescription' | 'contentImage' | 'pageUrl';\n\n/**\n * The bottom rung of the ladder, as a table rather than a chain of ifs.\n *\n * Deliberately short. `og:title` and `twitter:*` are NOT here — `seoToTags` already falls back to\n * the page title for them, and materialising a copy of a value we did not author would only make\n * later drift harder to see.\n */\nexport const SEO_AUTO_SOURCES: ReadonlyArray<{ field: string; source: SeoAutoSource }> = [\n { field: 'title', source: 'contentTitle' },\n { field: 'description', source: 'contentDescription' },\n { field: 'og.image', source: 'contentImage' },\n { field: 'canonicalUrl', source: 'pageUrl' },\n];\n\n/** `<title>`. */\nexport interface SeoTitleTag {\n kind: 'title';\n content: string;\n}\n\n/**\n * A `<meta>` tag. `attr` says which attribute identifies it — Open Graph is addressed by\n * `property`, everything else by `name`. Both renderers need that distinction to update rather\n * than duplicate a tag.\n */\nexport interface SeoMetaTag {\n kind: 'meta';\n attr: 'name' | 'property';\n key: string;\n content: string;\n}\n\n/** A `<link>`, currently only `rel=\"canonical\"`. */\nexport interface SeoLinkTag {\n kind: 'link';\n rel: string;\n href: string;\n}\n\nexport type SeoTag = SeoTitleTag | SeoMetaTag | SeoLinkTag;\n\n/** Context that lets `seoToTags` fill gaps without reaching for the DOM or a data source. */\nexport interface SeoTagContext {\n /** Used as `<title>` when the document has none — usually the page name. */\n fallbackTitle?: string;\n}\n\n/** Recommended maximum before search results truncate the title. */\nexport const SEO_TITLE_MAX = 60;\n\n/** Recommended maximum before search results truncate the description. */\nexport const SEO_DESCRIPTION_MAX = 160;\n\nexport const SEO_ROBOTS_OPTIONS: ReadonlyArray<{ label: string; value: string }> = [\n { label: 'Index, Follow', value: 'index, follow' },\n { label: 'Index, No Follow', value: 'index, nofollow' },\n { label: 'No Index, Follow', value: 'noindex, follow' },\n { label: 'No Index, No Follow', value: 'noindex, nofollow' },\n];\n\nexport const SEO_TWITTER_CARD_OPTIONS: ReadonlyArray<{ label: string; value: string }> = [\n { label: 'Summary', value: 'summary' },\n { label: 'Summary Large Image', value: 'summary_large_image' },\n { label: 'App', value: 'app' },\n { label: 'Player', value: 'player' },\n];\n\nexport const SEO_CHANGE_FREQ_OPTIONS: ReadonlyArray<{ label: string; value: string }> = [\n { label: 'Always', value: 'always' },\n { label: 'Hourly', value: 'hourly' },\n { label: 'Daily', value: 'daily' },\n { label: 'Weekly', value: 'weekly' },\n { label: 'Monthly', value: 'monthly' },\n { label: 'Yearly', value: 'yearly' },\n { label: 'Never', value: 'never' },\n];\n","import { SeoDoc, SeoOg, SeoSitemap, SeoTwitter } from './seo.model';\n\n/**\n * Coerce whatever a page document happens to hold into a `SeoDoc`.\n *\n * Every consumer calls this before reading `seo`, because four shapes are in the wild:\n * • the current nested shape (`og.title`);\n * • the flat shape the SSR engine used to read (`ogTitle`) — never actually written, but a\n * document hand-edited against the old engine code could carry it;\n * • `\"\"` for \"not set\", which must not become an empty `<meta>`;\n * • `{ override: '…' }`, the per-field value object that plan phase 2 introduces — tolerated here\n * so the ladder can land without a second normalizer.\n *\n * Empty branches are dropped rather than left as `{}`, so `if (seo.og)` is a meaningful test.\n */\nexport function normalizeSeoDoc(raw: unknown): SeoDoc {\n const src = asRecord(raw);\n if (!src) return {};\n\n const og = compact<SeoOg>({\n title: seoString(pick(src, 'og', 'title') ?? src['ogTitle']),\n description: seoString(pick(src, 'og', 'description') ?? src['ogDescription']),\n image: seoString(pick(src, 'og', 'image') ?? src['ogImage']),\n });\n\n const twitter = compact<SeoTwitter>({\n card: seoString(pick(src, 'twitter', 'card')),\n title: seoString(pick(src, 'twitter', 'title')),\n description: seoString(pick(src, 'twitter', 'description')),\n image: seoString(pick(src, 'twitter', 'image')),\n });\n\n const sitemap = compact<SeoSitemap>({\n include: bool(pick(src, 'sitemap', 'include')),\n priority: num(pick(src, 'sitemap', 'priority')),\n changeFreq: seoString(pick(src, 'sitemap', 'changeFreq')),\n });\n\n const structuredData = structured(src['structuredData']);\n\n const doc = compact<SeoDoc>({\n title: seoString(src['title']),\n description: seoString(src['description']),\n keywords: seoString(src['keywords']),\n canonicalUrl: seoString(src['canonicalUrl']),\n robots: seoString(src['robots']),\n og,\n twitter,\n sitemap,\n structuredData,\n });\n\n return doc ?? {};\n}\n\n/** Read `src[branch][leaf]` without assuming the branch exists or is an object. */\nfunction pick(src: Record<string, unknown>, branch: string, leaf: string): unknown {\n const nested = asRecord(src[branch]);\n return nested ? nested[leaf] : undefined;\n}\n\n/**\n * A field's value as a trimmed string, or `undefined`. Exported because the resolver needs the exact\n * same coercion for a value it has just pulled out of a data source.\n *\n * Unwraps the value object: a bound or auto field has no `override`, so it correctly resolves to\n * `undefined` here and `resolveSeo` fills it in from the lower rungs.\n */\nexport function seoString(value: unknown): string | undefined {\n const wrapper = asRecord(value);\n const raw = wrapper ? wrapper['override'] : value;\n if (typeof raw === 'number') return String(raw);\n if (typeof raw !== 'string') return undefined;\n const trimmed = raw.trim();\n return trimmed.length ? trimmed : undefined;\n}\n\n/**\n * `UIFormToDTO` can hand back `\"true\"` / `\"false\"` for a switch (see\n * `architecture/cms/shop.md` — the boolean/number coercion pitfall), so accept both.\n */\nfunction bool(value: unknown): boolean | undefined {\n if (typeof value === 'boolean') return value;\n if (value === 'true') return true;\n if (value === 'false') return false;\n return undefined;\n}\n\nfunction num(value: unknown): number | undefined {\n if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;\n if (typeof value !== 'string' || !value.trim().length) return undefined;\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : undefined;\n}\n\n/** JSON-LD is stored as an object or as a JSON string from the `json` controller. */\nfunction structured(value: unknown): unknown {\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed.length) return undefined;\n try {\n return JSON.parse(trimmed);\n } catch {\n return undefined;\n }\n }\n if (Array.isArray(value)) return value.length ? value : undefined;\n const record = asRecord(value);\n return record && Object.keys(record).length ? record : undefined;\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** Drop `undefined` values and empty nested objects, so absence is always `undefined`. */\nfunction compact<T extends object>(value: Record<string, unknown>): T | undefined {\n const out: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (entry === undefined) continue;\n out[key] = entry;\n }\n return (Object.keys(out).length ? out : undefined) as T | undefined;\n}\n","import { SeoDoc, SeoTag, SeoTagContext } from './seo.model';\nimport { normalizeSeoDoc } from './normalize';\n\n/**\n * Turn a page's SEO document into the flat list of head tags to emit.\n *\n * Both renderers call this, so a page cannot describe itself differently to a crawler than the\n * builder previews. The order is fixed and part of the contract: title, description, keywords,\n * canonical, Open Graph, Twitter, robots.\n *\n * Fallbacks are deliberately shallow — `og:title` reuses the page title, `twitter:*` reuses the\n * Open Graph values — because a social scraper that finds no `og:title` falls back to `<title>`\n * itself, and duplicating a value we did not author only makes the drift harder to see. The\n * \"derive from the page content\" half of the ladder (first h1, first paragraph, first image) is\n * `resolveSeo`, which runs BEFORE this and hands its output in as a filled-in `SeoDoc`.\n */\nexport function seoToTags(seo: SeoDoc | unknown, ctx: SeoTagContext = {}): SeoTag[] {\n const doc = normalizeSeoDoc(seo);\n const tags: SeoTag[] = [];\n\n const title = doc.title ?? trimmed(ctx.fallbackTitle);\n if (title) tags.push({ kind: 'title', content: title });\n if (doc.description) tags.push({ kind: 'meta', attr: 'name', key: 'description', content: doc.description });\n if (doc.keywords) tags.push({ kind: 'meta', attr: 'name', key: 'keywords', content: doc.keywords });\n if (doc.canonicalUrl) tags.push({ kind: 'link', rel: 'canonical', href: doc.canonicalUrl });\n\n // Open Graph. `og:url` reuses the canonical URL, which is what it means.\n const ogTitle = doc.og?.title ?? title;\n const ogDescription = doc.og?.description ?? doc.description;\n if (ogTitle) tags.push({ kind: 'meta', attr: 'property', key: 'og:title', content: ogTitle });\n if (ogDescription) tags.push({ kind: 'meta', attr: 'property', key: 'og:description', content: ogDescription });\n if (doc.og?.image) tags.push({ kind: 'meta', attr: 'property', key: 'og:image', content: doc.og.image });\n if (doc.canonicalUrl) tags.push({ kind: 'meta', attr: 'property', key: 'og:url', content: doc.canonicalUrl });\n\n // Twitter. Emitted ONLY when a card type is chosen: without `twitter:card` the other tags are\n // ignored anyway, so writing them would be noise that looks like configuration.\n if (doc.twitter?.card) {\n tags.push({ kind: 'meta', attr: 'name', key: 'twitter:card', content: doc.twitter.card });\n const twitterTitle = doc.twitter.title ?? ogTitle;\n const twitterDescription = doc.twitter.description ?? ogDescription;\n const twitterImage = doc.twitter.image ?? doc.og?.image;\n if (twitterTitle) tags.push({ kind: 'meta', attr: 'name', key: 'twitter:title', content: twitterTitle });\n if (twitterDescription) {\n tags.push({ kind: 'meta', attr: 'name', key: 'twitter:description', content: twitterDescription });\n }\n if (twitterImage) tags.push({ kind: 'meta', attr: 'name', key: 'twitter:image', content: twitterImage });\n }\n\n if (doc.robots) tags.push({ kind: 'meta', attr: 'name', key: 'robots', content: doc.robots });\n\n return tags;\n}\n\nfunction trimmed(value: string | undefined): string | undefined {\n const out = value?.trim();\n return out?.length ? out : undefined;\n}\n","import {\n SEO_CHANGE_FREQ_OPTIONS,\n SEO_DESCRIPTION_MAX,\n SEO_ROBOTS_OPTIONS,\n SEO_TITLE_MAX,\n SEO_TWITTER_CARD_OPTIONS,\n} from './seo.model';\n\n/**\n * The authoring schema for the `seo` object, in the platform's standard property dialect: `label`\n * at property level, rendering metadata under `controller`.\n *\n * ONE builder, two callers: `iox-cms` spreads it into `PagesSchema` (the stored schema) and\n * `iox-cms-client` feeds it to `<dynamic-form>`. Those used to be two hand-written copies that had\n * already drifted — different controller types for the same field, and the client's copy missing\n * `structuredData` entirely.\n *\n * `keywords` is deliberately absent: the tag is emitted when a document carries one, but there is\n * no reason to invite new ones.\n */\nexport function buildSeoSchemaProperties(): Record<string, unknown> {\n return {\n title: {\n type: 'string',\n label: 'Meta Title',\n controller: {\n type: 'text',\n placeholder: 'Page title for search engines',\n maxLength: SEO_TITLE_MAX,\n },\n },\n description: {\n type: 'string',\n label: 'Meta Description',\n controller: {\n type: 'textarea',\n placeholder: 'Brief description for search results',\n maxLength: SEO_DESCRIPTION_MAX,\n },\n },\n canonicalUrl: {\n type: 'string',\n label: 'Canonical URL',\n controller: {\n type: 'text',\n placeholder: 'https://example.com/page',\n },\n },\n robots: {\n type: 'string',\n label: 'Robots',\n controller: {\n type: 'select',\n options: SEO_ROBOTS_OPTIONS.map(option => ({ ...option })),\n },\n },\n og: {\n type: 'object',\n label: 'Open Graph',\n controller: { type: 'object' },\n properties: {\n title: {\n type: 'string',\n label: 'OG Title',\n controller: { type: 'text', placeholder: 'Title for social sharing' },\n },\n description: {\n type: 'string',\n label: 'OG Description',\n controller: { type: 'textarea', placeholder: 'Description for social sharing' },\n },\n image: {\n type: 'string',\n label: 'OG Image',\n controller: { type: 'image' },\n },\n },\n },\n twitter: {\n type: 'object',\n label: 'Twitter Card',\n controller: { type: 'object' },\n properties: {\n card: {\n type: 'string',\n label: 'Card Type',\n controller: {\n type: 'select',\n options: SEO_TWITTER_CARD_OPTIONS.map(option => ({ ...option })),\n },\n },\n title: {\n type: 'string',\n label: 'Twitter Title',\n controller: { type: 'text' },\n },\n description: {\n type: 'string',\n label: 'Twitter Description',\n controller: { type: 'textarea' },\n },\n image: {\n type: 'string',\n label: 'Twitter Image',\n controller: { type: 'image' },\n },\n },\n },\n structuredData: {\n type: 'object',\n label: 'Structured Data (JSON-LD)',\n controller: { type: 'json' },\n },\n sitemap: {\n type: 'object',\n label: 'Sitemap Settings',\n controller: { type: 'object' },\n properties: {\n include: {\n type: 'boolean',\n label: 'Include in Sitemap',\n controller: { type: 'switch' },\n },\n priority: {\n type: 'number',\n label: 'Priority',\n controller: { type: 'range', options: { min: 0, max: 1, step: 0.1 } },\n },\n changeFreq: {\n type: 'string',\n label: 'Change Frequency',\n controller: {\n type: 'select',\n options: SEO_CHANGE_FREQ_OPTIONS.map(option => ({ ...option })),\n },\n },\n },\n },\n };\n}\n","/*\n * @vectoriox/iox-ui/seo-core — the shared, FRAMEWORK-FREE core of page SEO.\n *\n * ⚠️ Nothing in this entry point may import Angular, RxJS, the DOM, or Node. It is consumed by\n * THREE runtimes: the builder panel (Angular), the SSR engine (Angular), and `iox-cms` (NestJS,\n * plain Node) — the same reason `forms-core` exists.\n *\n * A page describes itself to a crawler exactly once: `seoToTags` is the only place that decides\n * which head tags a page emits, and `buildSeoSchemaProperties` the only place that declares what an\n * author can fill in. See iox-ai-guidance `architecture/cms/seo-plan.md`.\n */\n\nexport * from './seo.model';\nexport * from './normalize';\nexport * from './tags';\nexport * from './schema';\n","/**\n * Generated bundle index. Do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