@vectoriox/iox-ui 5.196.0 → 5.198.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 (67) hide show
  1. package/composite-core/index.d.ts +19 -2
  2. package/data-core/index.d.ts +101 -2
  3. package/design-core/index.d.ts +183 -30
  4. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +49 -10
  5. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-data-core.mjs +192 -2
  7. package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui-design-core.mjs +299 -74
  9. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2287 -528
  11. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  12. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +3 -1
  13. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  14. package/fesm2022/vectoriox-iox-ui.mjs +32 -2
  15. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  16. package/generation-core/index.d.ts +1454 -200
  17. package/harness-core/index.d.ts +1 -1
  18. package/package.json +1 -1
  19. package/src/composite-core/header.ts +34 -1
  20. package/src/composite-core/slider-runtime.ts +16 -8
  21. package/src/data-core/placeholder-rows.ts +220 -0
  22. package/src/data-core/public-api.ts +2 -1
  23. package/src/design-core/brand.ts +58 -5
  24. package/src/design-core/contrast-audit.ts +49 -22
  25. package/src/design-core/design-apply.ts +34 -3
  26. package/src/design-core/flavor-fixtures.generated.ts +123 -123
  27. package/src/design-core/flavor-spec.generated.ts +44 -4
  28. package/src/design-core/flavor-tokens.ts +1 -1
  29. package/src/design-core/header-behaviour.ts +82 -15
  30. package/src/design-core/motion-language.ts +5 -14
  31. package/src/design-core/node-links.ts +34 -0
  32. package/src/design-core/preloader.ts +4 -5
  33. package/src/generation-core/audit-site.ts +10 -1
  34. package/src/generation-core/audit-words.ts +5 -0
  35. package/src/generation-core/body-mix.ts +40 -102
  36. package/src/generation-core/check-free.ts +26 -5
  37. package/src/generation-core/check-layout.ts +10 -4
  38. package/src/generation-core/check-list.ts +3 -25
  39. package/src/generation-core/colour-mix.ts +296 -0
  40. package/src/generation-core/compose-free.ts +40 -18
  41. package/src/generation-core/compose-site.ts +124 -22
  42. package/src/generation-core/footer-mix.ts +102 -54
  43. package/src/generation-core/free-fallback.ts +6 -4
  44. package/src/generation-core/free-opening.ts +57 -0
  45. package/src/generation-core/free-parts.ts +87 -0
  46. package/src/generation-core/free-slot-words.ts +30 -0
  47. package/src/generation-core/generation-tier.ts +6 -17
  48. package/src/generation-core/header-mix.ts +125 -4
  49. package/src/generation-core/item-fill.ts +42 -0
  50. package/src/generation-core/layout-drawers.ts +3 -2
  51. package/src/generation-core/layout-wire.ts +10 -16
  52. package/src/generation-core/list-panel.ts +3 -3
  53. package/src/generation-core/list-table.ts +5 -14
  54. package/src/generation-core/list-words.ts +2 -1
  55. package/src/generation-core/nav-shape.ts +45 -16
  56. package/src/generation-core/node-baselines.generated.ts +1 -0
  57. package/src/generation-core/opening-mix.ts +16 -33
  58. package/src/generation-core/part-tier.ts +14 -0
  59. package/src/generation-core/plan-wire.ts +31 -43
  60. package/src/generation-core/public-api.ts +4 -0
  61. package/src/generation-core/site-build-run.ts +4 -0
  62. package/src/generation-core/site-spec.generated.ts +1127 -93
  63. package/src/generation-core/stock-search.ts +106 -18
  64. package/src/generation-core/type-led.ts +19 -4
  65. package/src/generation-core/validate-site-plan.ts +4 -5
  66. package/src/harness-core/run-compose-context.ts +3 -1
  67. package/styles/iox-design.css +139 -4
@@ -1,6 +1,6 @@
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,
3
+ AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerBrandOf, headerGroundOf, headerInkOf, headerShapeOf,
4
4
  columnWordOf,
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';
@@ -11,8 +11,8 @@ 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
17
  import { ConsentCategory } from '@vectoriox/iox-ui/consent-core';
18
18
 
@@ -25,7 +25,7 @@ import {
25
25
  legalFormLine, LegalKind, legalKindsFor, legalLabel, legalRoute, legalTitle,
26
26
  } from './legal';
27
27
  import {
28
- checkOpening, drawnOpeningMix, OpeningContext, openingIsTypeLed, openingMix, OpeningMix, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix,
28
+ checkOpening, drawnOpeningMix, namedOpeningMix, OpeningContext, openingIsTypeLed, openingMix, OpeningMix, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix,
29
29
  stampOpeningMotion, TYPE_LED_OPTIONAL_PARTS, typeLedOpeningSection,
30
30
  } from './opening-mix';
31
31
  import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, HeaderFacts, HeaderIngredient, HeaderNever, HeaderOpening, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
@@ -52,6 +52,7 @@ import { composeLayout, LayoutColourMode, layoutBandScheme, LayoutListBinding }
52
52
  import { LayoutGalleryList, LayoutListShape, LayoutPage, LayoutPhotoShape, LayoutPhotoSource, LayoutSite, parseLayoutPhotoId } from './layout-language';
53
53
  import { layoutMotionOf, layoutPresetOf } from './layout-look';
54
54
  import { ComposeFreeOptions, composeFreePage, composeFreeSection } from './compose-free';
55
+ import { isFreeBox } from './free-opening';
55
56
  import { FreePage } from './free-wire';
56
57
 
57
58
  /**
@@ -1198,12 +1199,17 @@ function composeSegmented(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1198
1199
 
1199
1200
  /** The content type a section binding lists, through its data source. */
1200
1201
  function boundContentType(binding: string, ctx: Ctx): ContentTypePlan | undefined {
1201
- const source = ctx.plan.dataSources.find(d => d.alias === binding);
1202
- return source && 'contentType' in source ? ctx.plan.contentTypes.find(t => t.name === source.contentType) : undefined;
1202
+ return listedContentType(binding, ctx.plan);
1203
+ }
1204
+
1205
+ /** The content type a list (a data source's alias) lists, in a plan. */
1206
+ export function listedContentType(alias: string, plan: Pick<SitePlan, 'dataSources' | 'contentTypes'>): ContentTypePlan | undefined {
1207
+ const source = plan.dataSources.find(d => d.alias === alias);
1208
+ return source && 'contentType' in source ? plan.contentTypes.find(t => t.name === source.contentType) : undefined;
1203
1209
  }
1204
1210
 
1205
1211
  /** A type's fields as composite-core's pickers read them. */
1206
- const fieldsOf = (type: ContentTypePlan | undefined) => (type?.fields ?? []).map(f => ({ name: f.name, type: f.type, controller: f.controller }));
1212
+ export const fieldsOf = (type: ContentTypePlan | undefined): ContentFieldLike[] => (type?.fields ?? []).map(f => ({ name: f.name, type: f.type, controller: f.controller }));
1207
1213
 
1208
1214
  /**
1209
1215
  * An Accordion (CC2) — the composite-core recipe stamped with this composer's factory. Manual (no section
@@ -1231,7 +1237,13 @@ function composeAccordion(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1231
1237
  }
1232
1238
  return root;
1233
1239
  }
1234
- const { picks, gap } = recipeListBinds<AccordionAutoBinds>(pn.recipe, fieldsOf(boundContentType(binding, ctx)));
1240
+ return bindAccordion(root, id, binding, fieldsOf(boundContentType(binding, ctx)));
1241
+ }
1242
+
1243
+ /** From content: the Accordion's root repeats `binding`, its one template item's question and answer bound to the type's
1244
+ * first short-text and long-text fields (`recipeListBinds`), limit 20. */
1245
+ function bindAccordion(root: SerializedNode, id: string, binding: string, fields: ReadonlyArray<ContentFieldLike>): SerializedNode {
1246
+ const { picks, gap } = recipeListBinds<AccordionAutoBinds>(PatternRecipe.Accordion, fields);
1235
1247
  if (gap) throw new ComposeError(`${id}: "${binding}" has no ${gap}`);
1236
1248
  addBinding(root, { prop: 'source', source: binding, path: '' });
1237
1249
  setProp(root, 'limit', ACCORDION_CONTENT_LIMIT);
@@ -1242,6 +1254,18 @@ function composeAccordion(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1242
1254
  return root;
1243
1255
  }
1244
1256
 
1257
+ /**
1258
+ * The Accordion over a list, From content — THE same recipe and binding a pattern's `faq.accordion` stamps (CC2, R3's AI
1259
+ * path), for any caller that places it by name (a free page's `accordion:<alias>` slot). Its rows are the list's own
1260
+ * items: no question or answer is written here. Pure.
1261
+ */
1262
+ export function composeListAccordion(id: string, alias: string, fields: ReadonlyArray<ContentFieldLike>, locale?: string): SerializedNode {
1263
+ const factory = (spec: CompositeNodeSpec): CompositeNode =>
1264
+ create(spec.key === AccordionRole.Accordion ? id : `${id}-${spec.key}`, spec.key === AccordionRole.Accordion ? REPEATER : spec.type, { ...(spec.props ?? {}) }, spec.elementStyle ?? null) as CompositeNode;
1265
+ const root = buildAccordionRecipe(factory, { items: accordionWords(locale).slice(0, 1) }) as SerializedNode;
1266
+ return bindAccordion(root, id, alias, fields);
1267
+ }
1268
+
1245
1269
 
1246
1270
  const TABS_ROOT_KEY = 'tabs';
1247
1271
  const TABS_HOLDER_KEYS: ReadonlySet<string> = new Set(['list', 'panels']);
@@ -1278,7 +1302,14 @@ function composeTabs(pn: PatternNode, id: string, ctx: Ctx): SerializedNode {
1278
1302
  }
1279
1303
  return root;
1280
1304
  }
1281
- const { picks, gap } = recipeListBinds<TabsAutoBinds>(pn.recipe, fieldsOf(boundContentType(binding, ctx)));
1305
+ return bindTabs(root, id, binding, fieldsOf(boundContentType(binding, ctx)));
1306
+ }
1307
+
1308
+ /** From content: the tab list and the panels holder BOTH repeat `binding`, each holding its one template, the tab's
1309
+ * words, the panel's words and picture bound to the type's fields (`recipeListBinds`), limit 6. */
1310
+ function bindTabs(root: SerializedNode, id: string, binding: string, fields: ReadonlyArray<ContentFieldLike>): SerializedNode {
1311
+ const tree = root as CompositeNode;
1312
+ const { picks, gap } = recipeListBinds<TabsAutoBinds>(PatternRecipe.Tabs, fields);
1282
1313
  if (gap) throw new ComposeError(`${id}: "${binding}" has no ${gap}`);
1283
1314
  for (const holder of [tabsListOf(tree), tabsPanelsOf(tree)] as SerializedNode[]) {
1284
1315
  addBinding(holder, { prop: 'source', source: binding, path: '' });
@@ -1298,6 +1329,17 @@ function composeTabs(pn: PatternNode, id: string, ctx: Ctx): SerializedNode {
1298
1329
  return root;
1299
1330
  }
1300
1331
 
1332
+ /**
1333
+ * Tabs over a list, From content — THE same recipe and binding a pattern's tabs stamp (CC4a, R3's AI path), for any
1334
+ * caller that places it by name (a free page's `tabs:<alias>` slot). Its tabs are the list's own items. Pure.
1335
+ */
1336
+ export function composeListTabs(id: string, alias: string, fields: ReadonlyArray<ContentFieldLike>, locale?: string, label?: string): SerializedNode {
1337
+ const factory = (spec: CompositeNodeSpec): CompositeNode =>
1338
+ 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;
1339
+ const root = buildTabsRecipe(factory, { tabs: tabsWords(locale).slice(0, 1), ...(label ? { label } : {}), lang: locale }) as SerializedNode;
1340
+ return bindTabs(root, id, alias, fields);
1341
+ }
1342
+
1301
1343
  /** A recipe's node factory for this composer: ids derive from the recipe's keys (`<id>-<key>`, the root `<id>`). */
1302
1344
  /** Commerce G1: a pattern's shop recipes, each E1c's `SHOP_RECIPES` entry and the key its root is built with. */
1303
1345
  const SHOP_PATTERN_RECIPES: ReadonlyMap<PatternRecipe, { recipe: ShopRecipe; rootKey: string }> = new Map([
@@ -1494,6 +1536,36 @@ function composeCarousel(pn: PatternNode, id: string, ctx: Ctx): SerializedNode
1494
1536
  return slider;
1495
1537
  }
1496
1538
 
1539
+ /**
1540
+ * The testimonial carousel over a list of REAL quotes (`quoteListOf`) — THE recipe `composeCarousel` stamps, for any
1541
+ * caller that places it by name (a free page's `quotes:<alias>` slot). Pure.
1542
+ */
1543
+ export function composeQuoteCarousel(id: string, from: CarouselFrom, locale?: string): SerializedNode {
1544
+ return buildCarouselRecipe(recipeFactory(id, 'carousel'), { lang: locale, from }) as SerializedNode;
1545
+ }
1546
+
1547
+ /**
1548
+ * CC3: a Lightbox over a list's pictures, opened at the clicked item — the recipe `composeLightbox` stamps (a Dialog
1549
+ * holding a Slider bound to the list), and every picture of `frame` bound to that list's `imageField` opens it at its own
1550
+ * row (`canOpenAtClickedItem` — the same rule the Interactions panel offers it by). Returns the Lightbox, or null when no
1551
+ * picture in the frame sits in a row of that list. Mutates the frame's pictures' interactions; pure otherwise.
1552
+ */
1553
+ export function composeListLightbox(id: string, frame: SerializedNode, alias: string, imageField: string, locale?: string, altField?: string): SerializedNode | null {
1554
+ const lightbox = buildLightboxRecipe(recipeFactory(id, 'lightbox'), { source: alias, imageField, ...(altField ? { altField } : {}), lang: locale }) as SerializedNode;
1555
+ let wired = 0;
1556
+ const visit = (n: SerializedNode, path: SerializedNode[]) => {
1557
+ const here = [...path, n];
1558
+ if (n.type === IMAGE && n.bindings.some(b => b.prop === 'src' && b.path === imageField)
1559
+ && canOpenAtClickedItem(here as unknown as CompositeNode[], lightbox as unknown as CompositeNode)) {
1560
+ 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' }] }];
1561
+ wired++;
1562
+ }
1563
+ for (const c of n.children ?? []) visit(c, here);
1564
+ };
1565
+ visit(frame, []);
1566
+ return wired ? lightbox : null;
1567
+ }
1568
+
1497
1569
  /** The first item of a list, as a binding path (`resolvePath` reads `0.<field>` on the list the source resolves to). */
1498
1570
  const FIRST_ITEM_PATH = '0';
1499
1571
 
@@ -1808,8 +1880,11 @@ function freeOptionsOf(
1808
1880
  const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
1809
1881
  return {
1810
1882
  owner: page.key, locale, rtl: isRtlLocale(locale), motion: layoutMotionOf(layoutPresetOf(plan.design).id),
1811
- photoSrc: id => context.photoSrc?.(id) ?? '', photoAlt: id => context.photoAlt?.(id) ?? '',
1883
+ // iox-ui#180: a picture box is an empty picture (the build fills it), never an address.
1884
+ photoSrc: id => (isFreeBox(id) ? '' : context.photoSrc?.(id) ?? ''), photoAlt: id => (isFreeBox(id) ? '' : context.photoAlt?.(id) ?? ''),
1812
1885
  listOf: alias => pageListOf(alias, plan, pictureless),
1886
+ listFields: alias => fieldsOf(listedContentType(alias, plan)),
1887
+ quotes: quoteListOf(plan),
1813
1888
  ...(readyMade ? {
1814
1889
  readyMade: (at: number, id: string) => {
1815
1890
  const section = page.sections[at];
@@ -1901,23 +1976,26 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
1901
1976
  const email = nonEmpty(plan.business.facts?.email) ? plan.business.facts!.email!.trim() : null;
1902
1977
  const base = { plan, placeholders, issues, routes, year: context.year, email, navPage: null, pictureless };
1903
1978
 
1904
- // AW-D23 / MB-D6: a lower plan wears its own words of the look's motion language (a Pro Feel arrives on today's
1905
- // curve, a Pro move fades) — in the tokens the build applies AND the entrances it stamps.
1906
- const design = motionLanguageForPlan(resolveDesignChoices(clone(plan.design)), context?.tier === GenerationTier.Award);
1979
+ // AW-D42: every plan wears the look's whole motion language (a lower plan's Pro words were drawn as its own, AW-D23).
1980
+ const design = motionLanguageForPlan(resolveDesignChoices(clone(plan.design)));
1907
1981
  const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
1908
1982
  const rtl = isRtlLocale(locale);
1909
- // AW6: the plan's body (seams, inset cards) as the build's tier may carry it — every mend said (`body-mended`).
1983
+ // AW6: the plan's body (seams, inset cards) as the site may carry it — every mend said (`body-mended`).
1910
1984
  const bodyMixAsked = bodyMixOfPlan(plan);
1911
- const bodyChecked = bodyMixAsked ? checkBody(drawnBodyMix(bodyMixAsked).drawn, { tier: context?.tier ?? GenerationTier.Basic, calm: !!context?.calm }) : null;
1985
+ const bodyChecked = bodyMixAsked ? checkBody(drawnBodyMix(bodyMixAsked).drawn, { calm: !!context?.calm }) : null;
1912
1986
  for (const r of bodyChecked?.repairs ?? []) issues.push({ code: ComposeIssueCode.BodyMended, nodeId: 'body', owner: 'body', detail: r.said });
1913
1987
  const body = bodyChecked?.mix ?? null;
1914
1988
  const pages: ComposedPage[] = plan.pages.map(page => {
1915
1989
  const nextAlias = page.routeSource ? nextSourceOf(relatives, page.routeSource) : null;
1916
1990
  if (page.free) {
1917
- // FS3: the model's own page. Its opening is its own (the plan's opening is never worn over it).
1918
- const nodes = composeFreePlanPage(page, page.free, plan, context, placeholders, pictureless, (section, id, at) =>
1991
+ // FS3: the model's own page. Its opening is its own (the plan's opening is never worn over it) — but a ready-made
1992
+ // opening (the fall back's, or the type-led round's when nothing fills its picture, iox-ui#180) is the plan's
1993
+ // section, worn as every Home's is.
1994
+ const stamped = composeFreePlanPage(page, page.free, plan, context, placeholders, pictureless, (section, id, at) =>
1919
1995
  composePattern(patternById(section.pattern) as SitePattern, id, { ...base, owner: page.key, page, section, nextAlias },
1920
1996
  { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null, opening: at === 0 }));
1997
+ const readyOpening = page.free.sections[0]?.readyMade;
1998
+ const nodes = readyOpening ? wearPlanOpening(page, stamped, plan, context, design, placeholders, issues, false, page.sections[readyOpening.at]) : stamped;
1921
1999
  const opening = schemeOfFirst(nodes);
1922
2000
  return {
1923
2001
  key: page.key, name: page.name, route: { path: page.route }, isHome: page.isHome === true, status: STATUS_DRAFT, locale,
@@ -1975,6 +2053,8 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
1975
2053
  // AW12-D10/D15: the kind of business (the caller's reading) chooses the call word and what the footer never wears.
1976
2054
  const footerContext = {
1977
2055
  name: plan.business.name, design, tagline: plan.business.tagline, locale: plan.locale, pages: plan.pages.filter(p => p.inNav).length,
2056
+ // FV1 `closing.email`: the owner's address, the fact the email line shows (none given, no such closing — said).
2057
+ ...(plan.business.facts?.email?.trim() ? { email: plan.business.facts.email.trim() } : {}),
1978
2058
  ...(context?.businessType ? { type: context.businessType } : {}), ...(context?.footerNever ? { never: context.footerNever } : {}),
1979
2059
  // AW12-D13 (iox-ui#153): the build's tier — absent, Basic, as the body's — never wears an award word.
1980
2060
  tier: context?.tier ?? GenerationTier.Basic,
@@ -2017,6 +2097,9 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
2017
2097
  if (headerRoot) setHeaderInk(headerRoot as unknown as CompositeNode, headerInkOf(header.recipe.mix[HeaderIngredient.Ink]));
2018
2098
  // HI3 (HI3-D1): what the header stands on — over the opening, glass, or its own ground — the same edit the Header section makes.
2019
2099
  if (headerRoot) setHeaderGround(headerRoot as unknown as CompositeNode, headerGroundOf(header.recipe.mix[HeaderIngredient.Ground]));
2100
+ // HI3 slice 2: its outline (pill · islands) and its name (hangs · later) — the same edits the Header studio makes.
2101
+ if (headerRoot) setHeaderShape(headerRoot as unknown as CompositeNode, headerShapeOf(header.recipe.mix[HeaderIngredient.Shape]));
2102
+ if (headerRoot) setHeaderBrand(headerRoot as unknown as CompositeNode, headerBrandOf(header.recipe.mix[HeaderIngredient.Brand]));
2020
2103
  // AW12: the footer root says the mix it was composed as (the classes iox-design.css draws from); an inset one is a card.
2021
2104
  const footerRoot = globals.find(g => g.id === GlobalSlot.Footer);
2022
2105
  if (footerRoot) stampFooterMix(footerRoot as unknown as { props: Record<string, unknown>; styleProps?: Record<string, unknown> }, footer.mix);
@@ -2434,6 +2517,8 @@ export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOption
2434
2517
  stampHeaderMix(header, recipe.mix);
2435
2518
  setHeaderInk(header as unknown as CompositeNode, headerInkOf(recipe.mix[HeaderIngredient.Ink]));
2436
2519
  setHeaderGround(header as unknown as CompositeNode, headerGroundOf(recipe.mix[HeaderIngredient.Ground]));
2520
+ setHeaderShape(header as unknown as CompositeNode, headerShapeOf(recipe.mix[HeaderIngredient.Shape]));
2521
+ setHeaderBrand(header as unknown as CompositeNode, headerBrandOf(recipe.mix[HeaderIngredient.Brand]));
2437
2522
  if (input.storeSlots) withStoreSlots(header, input.locale ?? DEFAULT_SITE_LOCALE);
2438
2523
  return { header, issues, mix: checked.mix, companions };
2439
2524
  }
@@ -2522,6 +2607,14 @@ const SCENE_ROLE = 'scene';
2522
2607
 
2523
2608
  /** May the opening take the place of this first section? It must hold a heading (the opening's title is its words) and
2524
2609
  * nothing the opening has no part for — a form, bound content, a Scene stay and the opening comes before them. */
2610
+ /** The named opening a first section's pattern stands for (`namedOpeningMix`), when the ONE judge would mend it for this
2611
+ * build — else null: the pattern stays as it is composed. */
2612
+ function openingTheJudgeMends(root: SerializedNode, source: PageSectionPlan | undefined, ctx: OpeningContext): OpeningMix | null {
2613
+ if (!source || root.composed?.pattern !== source.pattern) return null;
2614
+ const named = namedOpeningMix(source.pattern);
2615
+ return named && checkOpening(named, ctx).repairs.length ? named : null;
2616
+ }
2617
+
2525
2618
  function openingMayReplace(root: SerializedNode): boolean {
2526
2619
  let heading = false;
2527
2620
  let keeps = false;
@@ -2555,13 +2648,18 @@ function wearPlanOpening(
2555
2648
  page: PagePlan, layout: SerializedNode[], plan: SitePlan, context: ComposeContext, design: DesignChoices,
2556
2649
  placeholders: ComposedPlaceholder[], issues: ComposeIssue[], keep: boolean, source?: PageSectionPlan,
2557
2650
  ): SerializedNode[] {
2558
- const mix = openingMixOfPlan(plan);
2559
- if (!mix || !(page.isHome === true || page.route === HOME_PATH)) return layout;
2651
+ if (!(page.isHome === true || page.route === HOME_PATH)) return layout;
2560
2652
  const first = layout[0];
2561
2653
  const replace = !!first && !keep && openingMayReplace(first);
2562
- const id = replace ? first.id : `${page.key}-opening`;
2563
2654
  const tier = context.tier ?? GenerationTier.Basic;
2564
- const site = { pages: plan.pages.map(p => ({ name: p.name, route: p.route, isHome: p.isHome === true })), locale: plan.locale, design, badge: null, cutOut: false, tier };
2655
+ // J10 lever (b): a build never holds the owner's clip for the opening (their film plays in a Scene, SC6b) — a film
2656
+ // opening is drawn as a picture the owner's photo, a made picture or stock can fill (`checkOpening`, said).
2657
+ const site = { pages: plan.pages.map(p => ({ name: p.name, route: p.route, isHome: p.isHome === true })), locale: plan.locale, design, badge: null, cutOut: false, film: false, tier };
2658
+ // iox-ui#180: with no opening chosen, a first section that IS a named opening (`hero.full-bleed-media` = a film) is
2659
+ // judged as that opening — when the judge mends it (no clip: a picture) it is worn mended; else it stays as it is.
2660
+ const mix = openingMixOfPlan(plan) ?? (replace ? openingTheJudgeMends(first, source, openingContextOf({ ...site, business: plan.business })) : null);
2661
+ if (!mix) return layout;
2662
+ const id = replace ? first.id : `${page.key}-opening`;
2565
2663
  // #129: a type-led first screen takes the type-led hero's words slot by slot (nothing it said is lost); the name is
2566
2664
  // the business's, as every display-size opening's is.
2567
2665
  const checked = replace && source ? checkOpening(drawnOpeningMix(mix).drawn, openingContextOf({ ...site, business: plan.business })).mix : null;
@@ -2641,6 +2739,9 @@ export interface OpeningInput extends SectionInput {
2641
2739
  readonly badge?: string | null;
2642
2740
  /** The owner gives a cut-out picture (the name behind the subject). */
2643
2741
  readonly cutOut?: boolean;
2742
+ /** J10 lever (b): the owner's clip plays in the first screen; `false` = none (a build — a picture stands in, said);
2743
+ * absent = the film's placeholder (the builder). */
2744
+ readonly film?: boolean;
2644
2745
  /** AW-D23: the tier the site is built at; absent = every word (the builder shows the Pro marks itself). */
2645
2746
  readonly tier?: OpeningContext['tier'];
2646
2747
  /** Draw the mix as asked, never mended — the Opening studio (it ADVISES the check's mends, OB-2). */
@@ -2657,12 +2758,13 @@ export interface ComposedOpening extends ComposedSection {
2657
2758
  }
2658
2759
 
2659
2760
  /** The context an opening is judged and measured in — the same for the check, the recipe and the studio's advice. */
2660
- export function openingContextOf(input: Pick<OpeningInput, 'business' | 'design' | 'badge' | 'cutOut' | 'tier'>): OpeningContext {
2761
+ export function openingContextOf(input: Pick<OpeningInput, 'business' | 'design' | 'badge' | 'cutOut' | 'film' | 'tier'>): OpeningContext {
2661
2762
  return {
2662
2763
  name: input.business?.name ?? '',
2663
2764
  design: resolveDesignChoices(JSON.parse(JSON.stringify(input.design ?? {}))),
2664
2765
  ...(input.tier ? { tier: input.tier } : {}),
2665
2766
  ...(input.cutOut !== undefined ? { cutOut: input.cutOut } : {}),
2767
+ ...(input.film !== undefined ? { film: input.film } : {}),
2666
2768
  ...(input.badge !== undefined ? { badge: input.badge } : {}),
2667
2769
  };
2668
2770
  }