@vectoriox/iox-ui 5.197.0 → 5.199.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.
Files changed (73) hide show
  1. package/actions-core/index.d.ts +7 -1
  2. package/composite-core/index.d.ts +16 -2
  3. package/data-core/index.d.ts +11 -3
  4. package/design-core/index.d.ts +185 -28
  5. package/fesm2022/vectoriox-iox-ui-actions-core.mjs +6 -1
  6. package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +34 -2
  8. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-data-core.mjs +30 -4
  10. package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-design-core.mjs +323 -72
  12. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +17351 -15175
  14. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  15. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +243 -38
  16. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  17. package/fesm2022/vectoriox-iox-ui.mjs +2 -2
  18. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  19. package/generation-core/index.d.ts +1703 -264
  20. package/harness-core/index.d.ts +93 -6
  21. package/package.json +1 -1
  22. package/src/actions-core/element-actions.ts +6 -0
  23. package/src/composite-core/header.ts +34 -1
  24. package/src/data-core/placeholder-rows.ts +29 -4
  25. package/src/design-core/brand.ts +58 -5
  26. package/src/design-core/contrast-audit.ts +49 -22
  27. package/src/design-core/design-apply.ts +34 -3
  28. package/src/design-core/flavor-fixtures.generated.ts +123 -123
  29. package/src/design-core/flavor-spec.generated.ts +44 -4
  30. package/src/design-core/flavor-tokens.ts +1 -1
  31. package/src/design-core/header-behaviour.ts +72 -13
  32. package/src/design-core/menu-look.ts +23 -0
  33. package/src/design-core/motion-language.ts +5 -14
  34. package/src/design-core/node-classes.ts +39 -0
  35. package/src/design-core/preloader.ts +4 -5
  36. package/src/generation-core/body-mix.ts +40 -102
  37. package/src/generation-core/check-free.ts +22 -11
  38. package/src/generation-core/check-layout.ts +10 -4
  39. package/src/generation-core/check-list.ts +3 -25
  40. package/src/generation-core/colour-mix.ts +296 -0
  41. package/src/generation-core/compose-free.ts +47 -20
  42. package/src/generation-core/compose-site.ts +259 -59
  43. package/src/generation-core/footer-mix.ts +258 -64
  44. package/src/generation-core/free-fallback.ts +6 -4
  45. package/src/generation-core/free-opening.ts +13 -2
  46. package/src/generation-core/free-parts.ts +87 -0
  47. package/src/generation-core/free-slot-words.ts +30 -0
  48. package/src/generation-core/free-wire.ts +8 -0
  49. package/src/generation-core/generation-tier.ts +6 -17
  50. package/src/generation-core/header-mix.ts +73 -3
  51. package/src/generation-core/layout-drawers.ts +3 -2
  52. package/src/generation-core/layout-wire.ts +10 -16
  53. package/src/generation-core/legal.ts +24 -0
  54. package/src/generation-core/list-panel.ts +3 -3
  55. package/src/generation-core/list-table.ts +5 -14
  56. package/src/generation-core/list-words.ts +2 -1
  57. package/src/generation-core/menu-shelves.ts +138 -0
  58. package/src/generation-core/nav-shape.ts +138 -15
  59. package/src/generation-core/node-baselines.generated.ts +1 -0
  60. package/src/generation-core/opening-mix.ts +7 -34
  61. package/src/generation-core/part-tier.ts +14 -0
  62. package/src/generation-core/patterns.ts +7 -0
  63. package/src/generation-core/plan-wire.ts +32 -43
  64. package/src/generation-core/public-api.ts +3 -0
  65. package/src/generation-core/site-build-run.ts +8 -0
  66. package/src/generation-core/site-plan.model.ts +3 -0
  67. package/src/generation-core/site-spec.generated.ts +1383 -189
  68. package/src/generation-core/validate-site-plan.ts +6 -5
  69. package/src/harness-core/business-types.ts +4 -0
  70. package/src/harness-core/harness-spec.generated.ts +189 -30
  71. package/src/harness-core/popup-stance.ts +56 -3
  72. package/src/harness-core/run-compose-context.ts +25 -5
  73. package/styles/iox-design.css +162 -3
@@ -1,7 +1,7 @@
1
1
  import { carryInto, swapParts, type PageCarry } from './carry';
2
2
  import {
3
- AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerGroundOf, headerInkOf,
4
- columnWordOf,
3
+ AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerBrandOf, headerGroundOf, headerInkOf, headerShapeOf,
4
+ columnWordOf, elementStyleById,
5
5
  } from '@vectoriox/iox-ui/design-core';
6
6
  import { fitSeoText, SEO_DESCRIPTION_MAX, SEO_TITLE_MAX, SeoRawDoc } from '@vectoriox/iox-ui/seo-core';
7
7
  import { busyWord, channelOpensNewTab, FORM_ACTIONS_ROLE, FORM_CHANNEL_ROLE, FormPresetChannel, FormPresetDef, FormPresetField, formPresetById, FormPresetId, presetFormActions } from '@vectoriox/iox-ui/forms-core';
@@ -11,10 +11,9 @@ import {
11
11
  AccordionAutoBinds, CompositeNodeSpec, findByRole, LIGHTBOX_LABEL, SLIDE_TO_ROW, SLIDE_TYPE, buildTabsRecipe, tabLabelNodeOf,
12
12
  tabPanelImageOf, tabPanelTextOf, tabsListOf, tabsPanels, tabsPanelsOf, tabsTriggers, TABS_CONTENT_LIMIT, TABS_IMAGE_BIND_PROP, TABS_LABEL_BIND_PROP,
13
13
  TABS_TEXT_BIND_PROP, tabsWords, TabsAutoBinds, BadgeTone, BADGE_TONES, buildSegmentedRecipe, CardWords, ITEM_OPEN_STATE, segmentedOptions,
14
- setHeaderBehaviour, setHeaderGround, setHeaderInk, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe, AccountRole,
15
- buildConsentRecipe, ConsentActionType, CarouselFrom, carouselQuoteLabel, CAROUSEL_QUOTE_LABELS, pickCarouselAutoBinds,
14
+ setHeaderBehaviour, setHeaderBrand, setHeaderGround, setHeaderInk, setHeaderShape, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe, AccountRole,
15
+ buildConsentRecipe, canOpenAtClickedItem, ConsentActionType, ContentFieldLike, CarouselFrom, carouselQuoteLabel, CAROUSEL_QUOTE_LABELS, pickCarouselAutoBinds,
16
16
  } from '@vectoriox/iox-ui/composite-core';
17
- import { ConsentCategory } from '@vectoriox/iox-ui/consent-core';
18
17
 
19
18
  import { EntranceMark, EntrancePart, planEntrances } from './entrances';
20
19
  import { scrubEntranceStamps } from './text-scroll';
@@ -22,10 +21,10 @@ import { filmOfPlan } from './film';
22
21
  import { checkFooter, FooterArrange, footerMixOfPlan, FooterNever, footerPattern, FooterRole, stampFooterMix } from './footer-mix';
23
22
  import {
24
23
  countryLegalFacts, FOOTER_LEGAL_ROLE, FORM_LEGAL_ROLE, formAsksPersonalData, formLegalFacts, LEGAL_PAGE_SETTING, LegalContext, LegalFact, LegalFacts,
25
- legalFormLine, LegalKind, legalKindsFor, legalLabel, legalRoute, legalTitle,
24
+ legalFormLine, LegalKind, legalKindsFor, legalLabel, legalRoute, legalTitle, measuredCategories, siteMeasures,
26
25
  } from './legal';
27
26
  import {
28
- checkOpening, drawnOpeningMix, namedOpeningMix, OpeningContext, openingIsTypeLed, openingMix, OpeningMix, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix,
27
+ checkOpening, drawnOpeningMix, namedOpeningMix, OpeningContext, openingIsTypeLed, OpeningMedia, openingMix, OpeningMix, openingMixFromWords, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix,
29
28
  stampOpeningMotion, TYPE_LED_OPTIONAL_PARTS, typeLedOpeningSection,
30
29
  } from './opening-mix';
31
30
  import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, HeaderFacts, HeaderIngredient, HeaderNever, HeaderOpening, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
@@ -33,7 +32,7 @@ import { bodyMixOfPlan, checkBody, drawnBodyMix, joinPageHeader, wearBodyMix } f
33
32
  import { checkPopup, composePopup, POPUP_GLOBAL_ID } from './popup-plan';
34
33
  import { NODE_BASELINES } from './node-baselines.generated';
35
34
  import {
36
- BindScope, CardBindTarget, parsePatternPath, PatternDirective, PatternGlobalPosition, PatternNode, PatternOpens, PatternPlaceholder, PatternRecipe, PatternTrack,
35
+ BindScope, CardBindTarget, parsePatternPath, PatternDirective, PatternGlobalPosition, PatternNode, PatternOpens, PatternPlaceholder, PatternRecipe, PatternScrolls, PatternTrack,
37
36
  PriceBindTarget, SitePattern, patternById,
38
37
  } from './patterns';
39
38
  import { planSells, shopCategoriesOf, shopContentType, shopListsShownOn, variantNamesOf } from './shop-plan';
@@ -47,13 +46,13 @@ import { SitePlanSourceKind, ContentFieldControl, ContentFieldPlan,
47
46
  } from './site-plan.model';
48
47
  import { assertValidSitePlan, nextSourceOf, routeParams } from './validate-site-plan';
49
48
  import { PictureSupply, TypeLed, TypeLedChange, TypeLedChangeKind, typeLedRound } from './type-led';
50
- import { MenuSide, NavRole, NavShape, planNavShape } from './nav-shape';
49
+ import { MenuSide, NavPage, NavRole, NavShape, planNavShape } from './nav-shape';
51
50
  import { composeLayout, LayoutColourMode, layoutBandScheme, LayoutListBinding } from './compose-layout';
52
51
  import { LayoutGalleryList, LayoutListShape, LayoutPage, LayoutPhotoShape, LayoutPhotoSource, LayoutSite, parseLayoutPhotoId } from './layout-language';
53
52
  import { layoutMotionOf, layoutPresetOf } from './layout-look';
54
53
  import { ComposeFreeOptions, composeFreePage, composeFreeSection } from './compose-free';
55
54
  import { isFreeBox } from './free-opening';
56
- import { FreePage } from './free-wire';
55
+ import { FreeNode, FreeNodeType, FreePage } from './free-wire';
57
56
 
58
57
  /**
59
58
  * THE composer — a Site Plan in, ordinary IOX data out (design-system plan §6b, W1). Deterministic and
@@ -194,6 +193,10 @@ export interface ComposeContext {
194
193
  /** #129: which picture slots a picture fills (the owner's, a made one, a stock one). Given, a section whose picture
195
194
  * nothing fills is composed type-led (`type-led.ts`); absent, the plan composes exactly as it says. */
196
195
  pictures?: PictureSupply;
196
+ /** Pictures first (harness `BusinessType.opening`, given by harness-core `businessComposeContext` only when a picture can
197
+ * come — the owner's photo, or stock where the type allows it, never against the owner's "no pictures"): the opening
198
+ * words a Home whose plan names no opening takes (`withTypeOpening`). Absent: the Home opens as its plan writes. */
199
+ opening?: ReadonlyArray<string>;
197
200
  }
198
201
 
199
202
  /** Where a composed layout's photos are, as the server keeps them and the screens read them (M8 gate 2): id → address. */
@@ -743,8 +746,11 @@ enum DanglingFate {
743
746
  Unlink = 'unlink',
744
747
  }
745
748
 
749
+ /** FV1b: an address outside the site (a footer's social link, `footerSocialLinks` — https only) is an external link. */
750
+ const isExternalHref = (href: string): boolean => href.startsWith('https://');
751
+
746
752
  function danglingFate(pn: PatternNode, ctx: Ctx): DanglingFate | null {
747
- if (!pn.href || pn.href === PatternDirective.PageRoute || ctx.routes.has(pn.href)) return null;
753
+ if (!pn.href || pn.href === PatternDirective.PageRoute || ctx.routes.has(pn.href) || isExternalHref(pn.href)) return null;
748
754
  if (ctx.email) return DanglingFate.Email;
749
755
  return UNLINKED_TYPE[pn.t] || (ctx.keepButtons && pn.t === BUTTON_BLOCK) ? DanglingFate.Unlink : DanglingFate.Remove;
750
756
  }
@@ -965,6 +971,11 @@ function composeNode(given: PatternNode, id: string, repeater: RepeaterScope | n
965
971
  if (pn.opens !== PatternOpens.Lightbox) throw new ComposeError(`${id}: "opens" names the pattern's lightbox`);
966
972
  (ctx.openers ??= []).push(id);
967
973
  }
974
+ if (pn.scrolls) {
975
+ if (pn.scrolls !== PatternScrolls.Top) throw new ComposeError(`${id}: "scrolls" names the page's top`);
976
+ // A scrollTo with no target is the page's top in both renderers (actions-core `scrollsToPageTop`).
977
+ node.interactions = [{ id: `${id}-scrolls`, trigger: 'click', actions: [{ type: 'scrollTo', duration: 0, delay: 0, easing: 'ease' }] }];
978
+ }
968
979
 
969
980
  // Images: an empty slot, or a bound one — both fall back to the DS3 empty image, never a stock URL.
970
981
  if (pn.ph === PatternPlaceholder.Image) {
@@ -977,7 +988,8 @@ function composeNode(given: PatternNode, id: string, repeater: RepeaterScope | n
977
988
  if (pn.href === PatternDirective.PageRoute) {
978
989
  writePageLink(node, stampedPageValue(`${BindScope.Page}.route`, ctx, id));
979
990
  } else if (pn.href && !fate) {
980
- writePageLink(node, pn.href);
991
+ if (isExternalHref(pn.href)) writeExternalLink(node, pn.href);
992
+ else writePageLink(node, pn.href);
981
993
  } else if (fate) {
982
994
  if (fate === DanglingFate.Email) writeExternalLink(node, `${MAILTO}${ctx.email}`);
983
995
  reportDangling(fate, pn, id, words.value, ctx);
@@ -1199,12 +1211,17 @@ function composeSegmented(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1199
1211
 
1200
1212
  /** The content type a section binding lists, through its data source. */
1201
1213
  function boundContentType(binding: string, ctx: Ctx): ContentTypePlan | undefined {
1202
- const source = ctx.plan.dataSources.find(d => d.alias === binding);
1203
- return source && 'contentType' in source ? ctx.plan.contentTypes.find(t => t.name === source.contentType) : undefined;
1214
+ return listedContentType(binding, ctx.plan);
1215
+ }
1216
+
1217
+ /** The content type a list (a data source's alias) lists, in a plan. */
1218
+ export function listedContentType(alias: string, plan: Pick<SitePlan, 'dataSources' | 'contentTypes'>): ContentTypePlan | undefined {
1219
+ const source = plan.dataSources.find(d => d.alias === alias);
1220
+ return source && 'contentType' in source ? plan.contentTypes.find(t => t.name === source.contentType) : undefined;
1204
1221
  }
1205
1222
 
1206
1223
  /** A type's fields as composite-core's pickers read them. */
1207
- const fieldsOf = (type: ContentTypePlan | undefined) => (type?.fields ?? []).map(f => ({ name: f.name, type: f.type, controller: f.controller }));
1224
+ export const fieldsOf = (type: ContentTypePlan | undefined): ContentFieldLike[] => (type?.fields ?? []).map(f => ({ name: f.name, type: f.type, controller: f.controller }));
1208
1225
 
1209
1226
  /**
1210
1227
  * An Accordion (CC2) — the composite-core recipe stamped with this composer's factory. Manual (no section
@@ -1232,7 +1249,13 @@ function composeAccordion(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1232
1249
  }
1233
1250
  return root;
1234
1251
  }
1235
- const { picks, gap } = recipeListBinds<AccordionAutoBinds>(pn.recipe, fieldsOf(boundContentType(binding, ctx)));
1252
+ return bindAccordion(root, id, binding, fieldsOf(boundContentType(binding, ctx)));
1253
+ }
1254
+
1255
+ /** From content: the Accordion's root repeats `binding`, its one template item's question and answer bound to the type's
1256
+ * first short-text and long-text fields (`recipeListBinds`), limit 20. */
1257
+ function bindAccordion(root: SerializedNode, id: string, binding: string, fields: ReadonlyArray<ContentFieldLike>): SerializedNode {
1258
+ const { picks, gap } = recipeListBinds<AccordionAutoBinds>(PatternRecipe.Accordion, fields);
1236
1259
  if (gap) throw new ComposeError(`${id}: "${binding}" has no ${gap}`);
1237
1260
  addBinding(root, { prop: 'source', source: binding, path: '' });
1238
1261
  setProp(root, 'limit', ACCORDION_CONTENT_LIMIT);
@@ -1243,6 +1266,18 @@ function composeAccordion(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1243
1266
  return root;
1244
1267
  }
1245
1268
 
1269
+ /**
1270
+ * The Accordion over a list, From content — THE same recipe and binding a pattern's `faq.accordion` stamps (CC2, R3's AI
1271
+ * path), for any caller that places it by name (a free page's `accordion:<alias>` slot). Its rows are the list's own
1272
+ * items: no question or answer is written here. Pure.
1273
+ */
1274
+ export function composeListAccordion(id: string, alias: string, fields: ReadonlyArray<ContentFieldLike>, locale?: string): SerializedNode {
1275
+ const factory = (spec: CompositeNodeSpec): CompositeNode =>
1276
+ create(spec.key === AccordionRole.Accordion ? id : `${id}-${spec.key}`, spec.key === AccordionRole.Accordion ? REPEATER : spec.type, { ...(spec.props ?? {}) }, spec.elementStyle ?? null) as CompositeNode;
1277
+ const root = buildAccordionRecipe(factory, { items: accordionWords(locale).slice(0, 1) }) as SerializedNode;
1278
+ return bindAccordion(root, id, alias, fields);
1279
+ }
1280
+
1246
1281
 
1247
1282
  const TABS_ROOT_KEY = 'tabs';
1248
1283
  const TABS_HOLDER_KEYS: ReadonlySet<string> = new Set(['list', 'panels']);
@@ -1279,7 +1314,14 @@ function composeTabs(pn: PatternNode, id: string, ctx: Ctx): SerializedNode {
1279
1314
  }
1280
1315
  return root;
1281
1316
  }
1282
- const { picks, gap } = recipeListBinds<TabsAutoBinds>(pn.recipe, fieldsOf(boundContentType(binding, ctx)));
1317
+ return bindTabs(root, id, binding, fieldsOf(boundContentType(binding, ctx)));
1318
+ }
1319
+
1320
+ /** From content: the tab list and the panels holder BOTH repeat `binding`, each holding its one template, the tab's
1321
+ * words, the panel's words and picture bound to the type's fields (`recipeListBinds`), limit 6. */
1322
+ function bindTabs(root: SerializedNode, id: string, binding: string, fields: ReadonlyArray<ContentFieldLike>): SerializedNode {
1323
+ const tree = root as CompositeNode;
1324
+ const { picks, gap } = recipeListBinds<TabsAutoBinds>(PatternRecipe.Tabs, fields);
1283
1325
  if (gap) throw new ComposeError(`${id}: "${binding}" has no ${gap}`);
1284
1326
  for (const holder of [tabsListOf(tree), tabsPanelsOf(tree)] as SerializedNode[]) {
1285
1327
  addBinding(holder, { prop: 'source', source: binding, path: '' });
@@ -1299,6 +1341,17 @@ function composeTabs(pn: PatternNode, id: string, ctx: Ctx): SerializedNode {
1299
1341
  return root;
1300
1342
  }
1301
1343
 
1344
+ /**
1345
+ * Tabs over a list, From content — THE same recipe and binding a pattern's tabs stamp (CC4a, R3's AI path), for any
1346
+ * caller that places it by name (a free page's `tabs:<alias>` slot). Its tabs are the list's own items. Pure.
1347
+ */
1348
+ export function composeListTabs(id: string, alias: string, fields: ReadonlyArray<ContentFieldLike>, locale?: string, label?: string): SerializedNode {
1349
+ const factory = (spec: CompositeNodeSpec): CompositeNode =>
1350
+ create(spec.key === TABS_ROOT_KEY ? id : `${id}-${spec.key}`, TABS_HOLDER_KEYS.has(spec.key) ? REPEATER : spec.type, { ...(spec.props ?? {}) }, spec.elementStyle ?? null) as CompositeNode;
1351
+ const root = buildTabsRecipe(factory, { tabs: tabsWords(locale).slice(0, 1), ...(label ? { label } : {}), lang: locale }) as SerializedNode;
1352
+ return bindTabs(root, id, alias, fields);
1353
+ }
1354
+
1302
1355
  /** A recipe's node factory for this composer: ids derive from the recipe's keys (`<id>-<key>`, the root `<id>`). */
1303
1356
  /** Commerce G1: a pattern's shop recipes, each E1c's `SHOP_RECIPES` entry and the key its root is built with. */
1304
1357
  const SHOP_PATTERN_RECIPES: ReadonlyMap<PatternRecipe, { recipe: ShopRecipe; rootKey: string }> = new Map([
@@ -1495,6 +1548,36 @@ function composeCarousel(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1495
1548
  return slider;
1496
1549
  }
1497
1550
 
1551
+ /**
1552
+ * The testimonial carousel over a list of REAL quotes (`quoteListOf`) — THE recipe `composeCarousel` stamps, for any
1553
+ * caller that places it by name (a free page's `quotes:<alias>` slot). Pure.
1554
+ */
1555
+ export function composeQuoteCarousel(id: string, from: CarouselFrom, locale?: string): SerializedNode {
1556
+ return buildCarouselRecipe(recipeFactory(id, 'carousel'), { lang: locale, from }) as SerializedNode;
1557
+ }
1558
+
1559
+ /**
1560
+ * CC3: a Lightbox over a list's pictures, opened at the clicked item — the recipe `composeLightbox` stamps (a Dialog
1561
+ * holding a Slider bound to the list), and every picture of `frame` bound to that list's `imageField` opens it at its own
1562
+ * row (`canOpenAtClickedItem` — the same rule the Interactions panel offers it by). Returns the Lightbox, or null when no
1563
+ * picture in the frame sits in a row of that list. Mutates the frame's pictures' interactions; pure otherwise.
1564
+ */
1565
+ export function composeListLightbox(id: string, frame: SerializedNode, alias: string, imageField: string, locale?: string, altField?: string): SerializedNode | null {
1566
+ const lightbox = buildLightboxRecipe(recipeFactory(id, 'lightbox'), { source: alias, imageField, ...(altField ? { altField } : {}), lang: locale }) as SerializedNode;
1567
+ let wired = 0;
1568
+ const visit = (n: SerializedNode, path: SerializedNode[]) => {
1569
+ const here = [...path, n];
1570
+ if (n.type === IMAGE && n.bindings.some(b => b.prop === 'src' && b.path === imageField)
1571
+ && canOpenAtClickedItem(here as unknown as CompositeNode[], lightbox as unknown as CompositeNode)) {
1572
+ n.interactions = [...n.interactions, { id: `${n.id}-opens`, trigger: 'click', actions: [{ type: 'openDialog', target: lightbox.id, params: { slideTo: SLIDE_TO_ROW }, duration: 0, delay: 0, easing: 'ease' }] }];
1573
+ wired++;
1574
+ }
1575
+ for (const c of n.children ?? []) visit(c, here);
1576
+ };
1577
+ visit(frame, []);
1578
+ return wired ? lightbox : null;
1579
+ }
1580
+
1498
1581
  /** The first item of a list, as a binding path (`resolvePath` reads `0.<field>` on the list the source resolves to). */
1499
1582
  const FIRST_ITEM_PATH = '0';
1500
1583
 
@@ -1812,6 +1895,8 @@ function freeOptionsOf(
1812
1895
  // iox-ui#180: a picture box is an empty picture (the build fills it), never an address.
1813
1896
  photoSrc: id => (isFreeBox(id) ? '' : context.photoSrc?.(id) ?? ''), photoAlt: id => (isFreeBox(id) ? '' : context.photoAlt?.(id) ?? ''),
1814
1897
  listOf: alias => pageListOf(alias, plan, pictureless),
1898
+ listFields: alias => fieldsOf(listedContentType(alias, plan)),
1899
+ quotes: quoteListOf(plan),
1815
1900
  ...(readyMade ? {
1816
1901
  readyMade: (at: number, id: string) => {
1817
1902
  const section = page.sections[at];
@@ -1863,7 +1948,9 @@ function stampLayoutSections(page: PagePlan, layout: LayoutPage, nodes: Serializ
1863
1948
  * Compose a Site Plan. Throws `SitePlanError` (every issue) when the plan does not validate — the
1864
1949
  * composer never repairs a plan. `context` carries what the composer may not read for itself (the year).
1865
1950
  */
1866
- export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSite {
1951
+ export function composeSite(given: SitePlan, context: ComposeContext): ComposedSite {
1952
+ // Pictures first: a Home whose plan names no opening takes its kind of business's (when a picture can come).
1953
+ const plan = withTypeOpening(given, context);
1867
1954
  if (!context?.pictures) return composeSiteOnce(plan, context, NO_TYPES);
1868
1955
  // #129: compose, find the pictures nothing fills, compose again type-led — until a round changes nothing (an opening
1869
1956
  // left out shows its first section's own picture, judged in the next round). Monotone: a type-led section has no
@@ -1890,6 +1977,57 @@ export function composeSite(plan: SitePlan, context: ComposeContext): ComposedSi
1890
1977
  }
1891
1978
 
1892
1979
  const NO_TYPES: ReadonlySet<string> = new Set();
1980
+
1981
+ /** The pattern family whose section a Home's opening takes the place of (a hero gives it its words, slot by slot). */
1982
+ const HERO_FAMILY = 'hero';
1983
+ const PICTURE_FREE_TYPES: ReadonlySet<string> = new Set([FreeNodeType.Image, FreeNodeType.Video]);
1984
+
1985
+ /** True when a free node (or anything in it) shows a picture — the owner's photo, a box stock may fill, a film. */
1986
+ function freeShowsPicture(node: FreeNode): boolean {
1987
+ return PICTURE_FREE_TYPES.has(node.type) || (node.children ?? []).some(freeShowsPicture);
1988
+ }
1989
+
1990
+ /**
1991
+ * PICTURES FIRST (the 2026-11-28 reference baseline, gap #1: the references open on 70–100 % picture, six of eleven J10
1992
+ * sites opened on none). A Home whose plan names no opening (`mixes.opening`) takes its kind of business's
1993
+ * (`ComposeContext.opening` — harness OPENING_PICTURE, given only when a picture can come), so its first screen is a
1994
+ * picture the build fills: the owner's photo, a made picture or stock (`pictureTargets` finds the opening's empty image).
1995
+ * A free Home (FS3) whose own opening shows no picture gives its first place back to the plan's hero (the ready-made place
1996
+ * a fall back would give — iox-ui#180's move), which the opening is then worn over, carrying the hero's words slot by
1997
+ * slot; a free opening that already shows a picture, or a free Home with no hero to give, is left as the model laid it.
1998
+ * A plan that chose its own opening keeps it — only its free Home's picture-less opening gives way, so the choice is worn.
1999
+ * An opening chosen with no picture (`media:none`) is the plan's word and is never overridden.
2000
+ * When nothing fills the picture the type-led round opens the Home on its words, as every Home's (`typeLedRound`). The
2001
+ * same plan composes the same site, so a rebuild from a kept plan picks the picture up with no model call. Pure.
2002
+ */
2003
+ export function withTypeOpening(plan: SitePlan, context: Pick<ComposeContext, 'opening'> | null | undefined): SitePlan {
2004
+ // A picture can come only when the run says so (`context.opening`, given by `businessComposeContext`); the plan's own
2005
+ // opening is then worn as chosen (the J10 free hotel and salon chose one their free Home never wore), else the type's.
2006
+ if (!context?.opening?.length) return plan;
2007
+ const own = plan.mixes?.opening?.length ? plan.mixes.opening : null;
2008
+ const words = own ?? context.opening;
2009
+ try {
2010
+ if (openingMixFromWords(words).media === OpeningMedia.None) return plan;
2011
+ } catch { return plan; }
2012
+ const at = plan.pages.findIndex(p => p.isHome === true || p.route === HOME_PATH);
2013
+ const home = plan.pages[at];
2014
+ if (!home) return plan;
2015
+ // Only a Home that opens on a hero: the opening takes the hero's place and words, never another section's.
2016
+ const hero = home.sections[0];
2017
+ if (!hero || patternById(hero.pattern)?.family !== HERO_FAMILY) return plan;
2018
+ let page: PagePlan = home;
2019
+ const first = home.free?.sections[0];
2020
+ if (own && !(home.free && first && !first.readyMade)) return plan;
2021
+ if (home.free && first && !first.readyMade) {
2022
+ if (freeShowsPicture(first)) return plan;
2023
+ const given: FreeNode = { id: first.id, type: FreeNodeType.Section, styleProps: {}, readyMade: { at: 0, pattern: hero.pattern } };
2024
+ page = { ...home, free: { ...home.free, sections: [given, ...home.free.sections.slice(1)] } };
2025
+ }
2026
+ const pages = [...plan.pages];
2027
+ pages[at] = page;
2028
+ return { ...plan, pages, mixes: { ...plan.mixes, opening: [...words] } };
2029
+ }
2030
+
1893
2031
  /** The most rounds a composition takes to wear no empty picture: the opening, then its first section, then a margin. */
1894
2032
  const TYPE_LED_ROUNDS = 4;
1895
2033
 
@@ -1903,14 +2041,13 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
1903
2041
  const email = nonEmpty(plan.business.facts?.email) ? plan.business.facts!.email!.trim() : null;
1904
2042
  const base = { plan, placeholders, issues, routes, year: context.year, email, navPage: null, pictureless };
1905
2043
 
1906
- // AW-D23 / MB-D6: a lower plan wears its own words of the look's motion language (a Pro Feel arrives on today's
1907
- // curve, a Pro move fades) — in the tokens the build applies AND the entrances it stamps.
1908
- const design = motionLanguageForPlan(resolveDesignChoices(clone(plan.design)), context?.tier === GenerationTier.Award);
2044
+ // AW-D42: every plan wears the look's whole motion language (a lower plan's Pro words were drawn as its own, AW-D23).
2045
+ const design = motionLanguageForPlan(resolveDesignChoices(clone(plan.design)));
1909
2046
  const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
1910
2047
  const rtl = isRtlLocale(locale);
1911
- // AW6: the plan's body (seams, inset cards) as the build's tier may carry it — every mend said (`body-mended`).
2048
+ // AW6: the plan's body (seams, inset cards) as the site may carry it — every mend said (`body-mended`).
1912
2049
  const bodyMixAsked = bodyMixOfPlan(plan);
1913
- const bodyChecked = bodyMixAsked ? checkBody(drawnBodyMix(bodyMixAsked).drawn, { tier: context?.tier ?? GenerationTier.Basic, calm: !!context?.calm }) : null;
2050
+ const bodyChecked = bodyMixAsked ? checkBody(drawnBodyMix(bodyMixAsked).drawn, { calm: !!context?.calm }) : null;
1914
2051
  for (const r of bodyChecked?.repairs ?? []) issues.push({ code: ComposeIssueCode.BodyMended, nodeId: 'body', owner: 'body', detail: r.said });
1915
2052
  const body = bodyChecked?.mix ?? null;
1916
2053
  const pages: ComposedPage[] = plan.pages.map(page => {
@@ -1981,6 +2118,10 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
1981
2118
  // AW12-D10/D15: the kind of business (the caller's reading) chooses the call word and what the footer never wears.
1982
2119
  const footerContext = {
1983
2120
  name: plan.business.name, design, tagline: plan.business.tagline, locale: plan.locale, pages: plan.pages.filter(p => p.inNav).length,
2121
+ // FV1 `closing.email`: the owner's address, the fact the email line shows (none given, no such closing — said).
2122
+ ...(plan.business.facts?.email?.trim() ? { email: plan.business.facts.email.trim() } : {}),
2123
+ // FV1b `holds.social`: the owner's stated links (none: the block is left out, said).
2124
+ ...(plan.business.social?.length ? { social: plan.business.social } : {}),
1984
2125
  ...(context?.businessType ? { type: context.businessType } : {}), ...(context?.footerNever ? { never: context.footerNever } : {}),
1985
2126
  // AW12-D13 (iox-ui#153): the build's tier — absent, Basic, as the body's — never wears an award word.
1986
2127
  tier: context?.tier ?? GenerationTier.Basic,
@@ -2009,7 +2150,7 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
2009
2150
  // pages are behind its menu shows the menu at every width, on the side the mix names.
2010
2151
  for (const [slot, pattern] of slotPatterns) {
2011
2152
  if (!pattern.phoneMenu) continue;
2012
- globals = planNavShape(globals, pattern.phoneMenu as NavShape, headerShapeOptions(slot === GlobalSlot.Header ? header.recipe : null, plan.locale), slot).globals;
2153
+ globals = planNavShape(globals, pattern.phoneMenu as NavShape, headerShapeOptions(slot === GlobalSlot.Header ? header.recipe : null, plan.locale, header.context.collections), slot).globals;
2013
2154
  }
2014
2155
  // Premium M4 (T2): a header pattern's behaviour as the page scrolls — the same edit the Header section makes.
2015
2156
  for (const [slot, pattern] of slotPatterns) {
@@ -2023,6 +2164,9 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
2023
2164
  if (headerRoot) setHeaderInk(headerRoot as unknown as CompositeNode, headerInkOf(header.recipe.mix[HeaderIngredient.Ink]));
2024
2165
  // HI3 (HI3-D1): what the header stands on — over the opening, glass, or its own ground — the same edit the Header section makes.
2025
2166
  if (headerRoot) setHeaderGround(headerRoot as unknown as CompositeNode, headerGroundOf(header.recipe.mix[HeaderIngredient.Ground]));
2167
+ // HI3 slice 2: its outline (pill · islands) and its name (hangs · later) — the same edits the Header studio makes.
2168
+ if (headerRoot) setHeaderShape(headerRoot as unknown as CompositeNode, headerShapeOf(header.recipe.mix[HeaderIngredient.Shape]));
2169
+ if (headerRoot) setHeaderBrand(headerRoot as unknown as CompositeNode, headerBrandOf(header.recipe.mix[HeaderIngredient.Brand]));
2026
2170
  // AW12: the footer root says the mix it was composed as (the classes iox-design.css draws from); an inset one is a card.
2027
2171
  const footerRoot = globals.find(g => g.id === GlobalSlot.Footer);
2028
2172
  if (footerRoot) stampFooterMix(footerRoot as unknown as { props: Record<string, unknown>; styleProps?: Record<string, unknown> }, footer.mix);
@@ -2091,7 +2235,8 @@ export function legalFactsOf(plan: SitePlan, context: LegalContext, nodes: Reado
2091
2235
  const sells = planSells(plan);
2092
2236
  return {
2093
2237
  ...formLegalFacts(nodes),
2094
- [LegalFact.Tracker]: (context.trackers?.length ?? 0) > 0,
2238
+ // A site that will measure its visitors is judged as one with a tracker, before one is connected.
2239
+ [LegalFact.Tracker]: siteMeasures(context),
2095
2240
  [LegalFact.Sells]: sells,
2096
2241
  // The shop ships what it sells (commerce shipping, C-D9) — no product is digital yet.
2097
2242
  [LegalFact.PhysicalGoods]: sells,
@@ -2145,6 +2290,15 @@ function legalRow(routes: ReadonlyMap<LegalKind, string>, settings: SerializedNo
2145
2290
  }
2146
2291
 
2147
2292
  /** The legal line beside a form (AW-D15): the owner's words to edit, its links to the site's terms and privacy pages. */
2293
+ /** iox-ui#185: a link inside the form's legal sentence is a WORD of it — the sentence's size and leading (its words wear
2294
+ * `small`; the `link` element style names no size, so the link kept the Link's 16px in a 14px line and wrapped alone on
2295
+ * a phone). Token refs read from the contract's `small`, never a literal; only the colour and weight say "link". */
2296
+ const LEGAL_SENTENCE_STYLE = 'small';
2297
+ const LEGAL_SENTENCE_TYPE: Readonly<Record<string, string>> = (() => {
2298
+ const base = (elementStyleById(LEGAL_SENTENCE_STYLE)?.base ?? {}) as Record<string, string>;
2299
+ return Object.fromEntries((['fontSize', 'lineHeight'] as const).filter(k => typeof base[k] === 'string').map(k => [k, base[k]]));
2300
+ })();
2301
+
2148
2302
  function formLegalLine(form: SerializedNode, routes: ReadonlyMap<LegalKind, string>, locale: string): SerializedNode | null {
2149
2303
  if (!routes.has(LegalKind.Privacy)) return null;
2150
2304
  const id = `${form.id}-legal`;
@@ -2153,7 +2307,7 @@ function formLegalLine(form: SerializedNode, routes: ReadonlyMap<LegalKind, stri
2153
2307
  line.label = 'Legal line';
2154
2308
  setStyleProps(line, { display: 'block', width: '100%', minHeight: 'auto' });
2155
2309
  line.children = legalFormLine(locale, routes.has(LegalKind.Terms)).map((part, i) => ('kind' in part
2156
- ? legalLink(`${id}-${i}`, part.kind, routes.get(part.kind)!, locale, INLINE)
2310
+ ? legalLink(`${id}-${i}`, part.kind, routes.get(part.kind)!, locale, { ...INLINE, ...LEGAL_SENTENCE_TYPE })
2157
2311
  : (() => {
2158
2312
  const words = create(`${id}-${i}`, TEXT, { content: part.text, tag: 'span' }, 'small');
2159
2313
  setStyleProps(words, INLINE);
@@ -2169,21 +2323,78 @@ function withFormLine(form: SerializedNode, line: SerializedNode): void {
2169
2323
  kids.splice(at >= 0 ? at : kids.length, 0, line);
2170
2324
  }
2171
2325
 
2172
- /** The categories the trackers need a yes for, each once (Necessary never). */
2173
- function trackerCategories(context: LegalContext): ConsentCategory[] {
2174
- const out: ConsentCategory[] = [];
2175
- for (const t of context.trackers ?? []) {
2176
- const c = t.category as ConsentCategory;
2177
- if (c !== ConsentCategory.Necessary && !out.includes(c)) out.push(c);
2326
+ /** What `withConsentBanner` needs: the site's language, what it measures, its privacy page, a banner the studio keeps. */
2327
+ export interface ConsentStampInput {
2328
+ readonly locale: string;
2329
+ readonly trackers?: LegalContext['trackers'];
2330
+ readonly measures?: boolean | null;
2331
+ readonly privacyRoute?: string | null;
2332
+ /** The studio keeps its own banner: its preferences dialog's id — no second banner; Cookie settings opens it. */
2333
+ readonly keptPreferences?: string | null;
2334
+ /** Also put Cookie settings in the footer's legal row when it has none (a site built before it measured). */
2335
+ readonly intoFooter?: boolean;
2336
+ }
2337
+
2338
+ /** True when a global (or anything inside it) is a consent banner. */
2339
+ function holdsConsentBanner(globals: ReadonlyArray<SerializedNode>): boolean {
2340
+ let found = false;
2341
+ walkSerialized(globals, n => { if (!found && n.type === DIALOG && n.props['consentRole'] === true) found = true; });
2342
+ return found;
2343
+ }
2344
+
2345
+ /** True when a node (or anything inside it) opens the consent preferences. */
2346
+ function opensPreferences(node: SerializedNode): boolean {
2347
+ let found = false;
2348
+ walkSerialized([node], n => {
2349
+ for (const ix of n.interactions ?? []) for (const a of (ix as { actions?: Array<{ type?: string }> }).actions ?? []) if (a.type === ConsentActionType.OpenPreferences) found = true;
2350
+ });
2351
+ return found;
2352
+ }
2353
+
2354
+ /**
2355
+ * THE privacy banner stamp (consent C5, 2026-11-28: "a privacy banner on every site that measures visitors"): a site that
2356
+ * MEASURES (`siteMeasures`) and holds no consent banner gets the palette's banner + preferences (`buildConsentRecipe`) as
2357
+ * globals after the page — at build time from `composeLegal`, and LATER by the same call when a tracker is connected
2358
+ * after the build (the audit's `tracker-without-banner` is the detector; iox-cms calls this on that finding). With
2359
+ * `intoFooter`, the footer's legal row gains Cookie settings when it has none. Never a second banner; a banner the studio
2360
+ * keeps is linked, never replaced. Pure: a new globals array; the footer row gains its link in place.
2361
+ */
2362
+ export function withConsentBanner(globals: ReadonlyArray<SerializedNode>, input: ConsentStampInput): { globals: SerializedNode[]; settings: SerializedNode | null; added: boolean } {
2363
+ const out = [...globals];
2364
+ if (!siteMeasures(input) || (!input.keptPreferences && holdsConsentBanner(globals))) return { globals: out, settings: null, added: false };
2365
+ const privacy = input.privacyRoute ?? null;
2366
+ const consent = buildConsentRecipe(spec => create(spec.key, spec.type, { ...(spec.props ?? {}) }, spec.elementStyle ?? null) as CompositeNode, {
2367
+ lang: input.locale, categories: measuredCategories(input), privacyRoute: privacy, privacyLabel: privacy ? legalTitle(LegalKind.Privacy, input.locale) : undefined,
2368
+ });
2369
+ const settings = consent.settings as SerializedNode;
2370
+ let added = false;
2371
+ if (input.keptPreferences) {
2372
+ // The studio keeps its own banner: the footer's Cookie settings opens ITS preferences, and no second banner.
2373
+ for (const ix of settings.interactions ?? []) for (const a of (ix as { actions?: Array<{ type?: string; target?: string }> }).actions ?? []) {
2374
+ if (a.type === ConsentActionType.OpenPreferences) a.target = input.keptPreferences;
2375
+ }
2376
+ } else {
2377
+ for (const root of [consent.banner, consent.preferences] as SerializedNode[]) {
2378
+ root.isGlobal = true;
2379
+ root.globalPosition = PatternGlobalPosition.After;
2380
+ out.push(root);
2381
+ }
2382
+ added = true;
2178
2383
  }
2179
- return out;
2384
+ if (input.intoFooter) {
2385
+ let row: SerializedNode | null = null;
2386
+ const footer = out.find(g => g.id === GlobalSlot.Footer);
2387
+ if (footer) walkSerialized([footer], n => { if (!row && n.role === FOOTER_LEGAL_ROLE) row = n; });
2388
+ if (row && !opensPreferences(row)) ((row as SerializedNode).children ?? ((row as SerializedNode).children = [])).push(settings);
2389
+ }
2390
+ return { globals: out, settings, added };
2180
2391
  }
2181
2392
 
2182
2393
  /**
2183
2394
  * AW1 (C5): the law a site's facts call for — stamped, never asked. Each legal kind the facts need (`legalKindsFor`) is
2184
2395
  * the studio's own page when it has one (linked, never stamped again), else an empty flagged page on a free route; the
2185
- * cookie banner and its preferences are stamped as globals when a tracker is connected (unless the studio keeps its
2186
- * own); every footer gets the legal row (+ Cookie settings), every form that asks for personal details the legal line.
2396
+ * cookie banner and its preferences are stamped as globals when the site measures (`siteMeasures`: a tracker connected,
2397
+ * or the intent to count visitors — unless the studio keeps its own, `withConsentBanner`); every footer gets the legal row (+ Cookie settings), every form that asks for personal details the legal line.
2187
2398
  * Pure: new globals, the stamped pages; forms and the footer gain their nodes in place.
2188
2399
  */
2189
2400
  function composeLegal(plan: SitePlan, context: LegalContext, pages: ReadonlyArray<ComposedPage>, globals: SerializedNode[], footerArrange: string,
@@ -2207,28 +2418,11 @@ function composeLegal(plan: SitePlan, context: LegalContext, pages: ReadonlyArra
2207
2418
  stamped.push(composeLegalPage(kind, key, route, plan, placeholders));
2208
2419
  }
2209
2420
 
2210
- const out = [...globals];
2211
- let settings: SerializedNode | null = null;
2212
- const categories = trackerCategories(context);
2213
- if (context.trackers?.length) {
2214
- const privacy = routes.get(LegalKind.Privacy);
2215
- const consent = buildConsentRecipe(spec => create(spec.key, spec.type, { ...(spec.props ?? {}) }, spec.elementStyle ?? null) as CompositeNode, {
2216
- lang: locale, categories, privacyRoute: privacy ?? null, privacyLabel: privacy ? legalTitle(LegalKind.Privacy, locale) : undefined,
2217
- });
2218
- settings = consent.settings as SerializedNode;
2219
- if (context.keptPreferences) {
2220
- // The studio keeps its own banner: the footer's Cookie settings opens ITS preferences, and no second banner.
2221
- for (const ix of settings.interactions ?? []) for (const a of (ix as { actions?: Array<{ type?: string; target?: string }> }).actions ?? []) {
2222
- if (a.type === ConsentActionType.OpenPreferences) a.target = context.keptPreferences;
2223
- }
2224
- } else {
2225
- for (const root of [consent.banner, consent.preferences] as SerializedNode[]) {
2226
- root.isGlobal = true;
2227
- root.globalPosition = PatternGlobalPosition.After;
2228
- out.push(root);
2229
- }
2230
- }
2231
- }
2421
+ const privacy = routes.get(LegalKind.Privacy);
2422
+ const consent = withConsentBanner(globals, { locale, trackers: context.trackers, measures: context.measures, privacyRoute: privacy ?? null,
2423
+ keptPreferences: context.keptPreferences, intoFooter: false });
2424
+ const out = consent.globals;
2425
+ const settings = consent.settings;
2232
2426
  const footer = out.find(g => g.id === GlobalSlot.Footer);
2233
2427
  const row = footer ? legalRow(routes, settings, footerArrange, locale) : null;
2234
2428
  // AW12-D3: a name-and-action footer keeps its legal row in its end block, above the thank-you line — the name stays last,
@@ -2260,7 +2454,9 @@ export function planHeader(plan: SitePlan, facts: HeaderFacts = {}): { recipe: H
2260
2454
 
2261
2455
  /** The phone-menu options a header recipe asks for: its menu at every width and on its side (none for the defaults, so a
2262
2456
  * stored header's edit is the one it always was). */
2263
- function headerShapeOptions(recipe: HeaderRecipe | null, locale?: string): { everyWidth?: boolean; menuSide?: MenuSide; look?: Partial<MenuLook>; locale?: string } {
2457
+ function headerShapeOptions(recipe: HeaderRecipe | null, locale?: string, collections?: ReadonlyArray<{ name: string; route: string }>): {
2458
+ everyWidth?: boolean; menuSide?: MenuSide; look?: Partial<MenuLook>; locale?: string; collections?: NavPage[];
2459
+ } {
2264
2460
  // vectoriox/iox-ui#100: the menu's words (and the names its parts are heard by) are the site's language — English
2265
2461
  // words are the table's English, so an English header composes as it always did (R-H4).
2266
2462
  const words = locale ? { locale } : {};
@@ -2270,6 +2466,8 @@ function headerShapeOptions(recipe: HeaderRecipe | null, locale?: string): { eve
2270
2466
  return {
2271
2467
  ...(recipe.everyWidth ? { everyWidth: true } : {}), ...(recipe.menuSide === MenuSide.Start ? { menuSide: MenuSide.Start } : {}),
2272
2468
  ...(Object.keys(look).length ? { look } : {}), ...words,
2469
+ // HI2: a shelf's cards are the site's main collections (only a menu that shows pictures or a card needs them).
2470
+ ...(look.shows && collections?.length ? { collections: collections.map(c => ({ label: c.name, route: c.route })) } : {}),
2273
2471
  };
2274
2472
  }
2275
2473
 
@@ -2435,11 +2633,13 @@ export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOption
2435
2633
  root.isGlobal = true;
2436
2634
  root.globalPosition = pattern.global;
2437
2635
  const shape = pattern.phoneMenu as NavShape | undefined;
2438
- const [header, ...companions] = shape ? planNavShape([root], shape, { newId: options.newId, ...headerShapeOptions(recipe, input.locale) }, root.id).globals : [root];
2636
+ const [header, ...companions] = shape ? planNavShape([root], shape, { newId: options.newId, ...headerShapeOptions(recipe, input.locale, context.collections) }, root.id).globals : [root];
2439
2637
  if (pattern.header) setHeaderBehaviour(header as unknown as CompositeNode, pattern.header.behaviour, pattern.header.edge ?? null);
2440
2638
  stampHeaderMix(header, recipe.mix);
2441
2639
  setHeaderInk(header as unknown as CompositeNode, headerInkOf(recipe.mix[HeaderIngredient.Ink]));
2442
2640
  setHeaderGround(header as unknown as CompositeNode, headerGroundOf(recipe.mix[HeaderIngredient.Ground]));
2641
+ setHeaderShape(header as unknown as CompositeNode, headerShapeOf(recipe.mix[HeaderIngredient.Shape]));
2642
+ setHeaderBrand(header as unknown as CompositeNode, headerBrandOf(recipe.mix[HeaderIngredient.Brand]));
2443
2643
  if (input.storeSlots) withStoreSlots(header, input.locale ?? DEFAULT_SITE_LOCALE);
2444
2644
  return { header, issues, mix: checked.mix, companions };
2445
2645
  }