@vectoriox/iox-ui 5.195.0 → 5.197.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 (52) hide show
  1. package/composite-core/index.d.ts +15 -2
  2. package/data-core/index.d.ts +101 -2
  3. package/design-core/index.d.ts +374 -8
  4. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +41 -12
  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 +749 -264
  9. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1084 -630
  11. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  12. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +224 -3
  13. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  14. package/fesm2022/vectoriox-iox-ui-identity-core.mjs +11 -5
  15. package/fesm2022/vectoriox-iox-ui-identity-core.mjs.map +1 -1
  16. package/fesm2022/vectoriox-iox-ui.mjs +100 -17
  17. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  18. package/generation-core/index.d.ts +351 -109
  19. package/harness-core/index.d.ts +166 -4
  20. package/identity-core/index.d.ts +8 -1
  21. package/index.d.ts +23 -2
  22. package/package.json +1 -1
  23. package/src/composite-core/account-runtime.ts +2 -2
  24. package/src/composite-core/header.ts +23 -1
  25. package/src/composite-core/slider-runtime.ts +16 -8
  26. package/src/data-core/placeholder-rows.ts +220 -0
  27. package/src/data-core/public-api.ts +2 -1
  28. package/src/design-core/contrast-audit.ts +38 -0
  29. package/src/design-core/flavor-spec.generated.ts +275 -1
  30. package/src/design-core/header-behaviour.ts +180 -3
  31. package/src/design-core/node-classes.ts +9 -2
  32. package/src/design-core/node-links.ts +34 -0
  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/check-free.ts +21 -3
  36. package/src/generation-core/compose-site.ts +57 -17
  37. package/src/generation-core/free-opening.ts +57 -0
  38. package/src/generation-core/header-mix.ts +245 -12
  39. package/src/generation-core/item-fill.ts +42 -0
  40. package/src/generation-core/nav-shape.ts +45 -16
  41. package/src/generation-core/node-baselines.generated.ts +1 -0
  42. package/src/generation-core/opening-mix.ts +10 -0
  43. package/src/generation-core/public-api.ts +2 -0
  44. package/src/generation-core/site-build-run.ts +4 -0
  45. package/src/generation-core/site-spec.generated.ts +41 -9
  46. package/src/generation-core/stock-search.ts +106 -18
  47. package/src/generation-core/type-led.ts +19 -4
  48. package/src/harness-core/business-types.ts +11 -0
  49. package/src/harness-core/harness-spec.generated.ts +213 -0
  50. package/src/harness-core/run-compose-context.ts +12 -4
  51. package/src/identity-core/site-auth-transport.ts +11 -4
  52. package/styles/iox-design.css +149 -6
@@ -36,6 +36,9 @@ export enum HeaderTrait {
36
36
  /** AW6 (AW6-D10): `follows` — its colours follow the section under it as the page scrolls. Absent / `opening`: it
37
37
  * wears the page's opening (#71), as before. Written by the Header studio ▸ Ground and the composer (`ink:follows`). */
38
38
  Ink = 'headerInk',
39
+ /** HI3 slice 1 (HI3-D1): what the header stands on — `glass` | `over` | `over-glass`. Absent / `solid`: its own ground,
40
+ * as before. Written by the Header studio ▸ Around the bar and the composer (`ground:<word>`). */
41
+ Ground = 'headerGround',
39
42
  }
40
43
 
41
44
  /** Whose colours the header wears (contract HEADER `ink`): the page's opening, or every section as it passes under it. */
@@ -54,6 +57,10 @@ export enum HeaderAttribute {
54
57
  /** `follows` on a header whose colours follow the section under it (the header ink runtime writes the page's
55
58
  * `data-iox-opening` as each section passes; the shared CSS cross-fades). Absent: it wears the opening. */
56
59
  Ink = 'data-iox-header-ink',
60
+ /** `glass` | `over` | `over-glass` on a header that does not stand on its own solid ground (HI3 slice 1): the shared
61
+ * CSS draws the ground on ONE `::before` faded by opacity, gives the bar's height back over a pictured opening and
62
+ * lays the veil under its words at rest. Absent: the bar's own ground, as before. */
63
+ Ground = 'data-iox-header-ground',
57
64
  }
58
65
 
59
66
  /** What a composed header gets (the `nav.*` patterns' `header`, the palette's Navigation bar). */
@@ -85,17 +92,187 @@ export function headerInkOf(value: unknown): HeaderInk {
85
92
  return value === HeaderInk.Follows ? HeaderInk.Follows : HeaderInk.Opening;
86
93
  }
87
94
 
88
- /** The attributes a header renders, from its trait values — `{}` for a header that keeps today's behaviour. */
89
- export function headerAttributes(behaviour: unknown, edge: unknown, ink?: unknown): Record<string, string> {
95
+ /** The attributes a header renders, from its trait values — `{}` for a header that keeps today's behaviour. A header on
96
+ * glass draws no scroll edge (HI3-D9: its set carries its own hairline and shadow), whatever edge it stores. */
97
+ export function headerAttributes(behaviour: unknown, edge: unknown, ink?: unknown, ground?: unknown): Record<string, string> {
90
98
  const out: Record<string, string> = {};
91
99
  if (headerInkOf(ink) === HeaderInk.Follows) out[HeaderAttribute.Ink] = HeaderInk.Follows;
92
100
  const b = headerBehaviourOf(behaviour);
93
101
  if (b !== HeaderBehaviour.Scrolls) out[HeaderAttribute.Behaviour] = b;
102
+ const g = headerGroundOf(ground);
103
+ if (g !== HeaderGround.Solid) out[HeaderAttribute.Ground] = g;
94
104
  const e = headerEdgeOf(edge);
95
- if (e) out[HeaderAttribute.Edge] = e;
105
+ if (e && !headerGroundIsGlass(g)) out[HeaderAttribute.Edge] = e;
96
106
  return out;
97
107
  }
98
108
 
109
+ // ── What the header stands on (HI3 slice 1: over · over-glass · glass) ───────────────────────────────────────────────
110
+
111
+ /**
112
+ * What a header stands on (contract HEADER `ground`, HI3-D1). `blend` waits for slice 2+ and is never a trait value
113
+ * (a stored `blend` reads as solid). ONE answer every renderer applies: `headerAttributes` writes the word, the shared
114
+ * CSS (`iox-design.css`) draws it, and `headerFirm` / the selectors below say when the ground shows.
115
+ */
116
+ export enum HeaderGround {
117
+ /** Its own ground (the look's bar), as every header before HI3. */
118
+ Solid = 'solid',
119
+ /** The look's glass from the first frame. */
120
+ Glass = 'glass',
121
+ /** Over the opening, clear at first; the look's own bar once the page moves. */
122
+ Over = 'over',
123
+ /** Over the opening, clear at first; the look's glass once the page moves. */
124
+ OverGlass = 'over-glass',
125
+ }
126
+
127
+ const GROUNDS = new Set<string>(Object.values(HeaderGround));
128
+
129
+ /** A stored ground, or Solid for anything else. */
130
+ export function headerGroundOf(value: unknown): HeaderGround {
131
+ return typeof value === 'string' && GROUNDS.has(value) ? value as HeaderGround : HeaderGround.Solid;
132
+ }
133
+
134
+ /** The grounds that stand over the opening at rest (clear until the page moves). */
135
+ export const OVER_GROUNDS: ReadonlyArray<HeaderGround> = [HeaderGround.Over, HeaderGround.OverGlass];
136
+ /** The grounds that turn into the look's glass (`nav-glass-*`), and draw no scroll edge (HI3-D9). */
137
+ export const GLASS_GROUNDS: ReadonlyArray<HeaderGround> = [HeaderGround.Glass, HeaderGround.OverGlass];
138
+
139
+ /** True for a ground that stands over the opening at rest. */
140
+ export function headerGroundIsOver(ground: unknown): boolean {
141
+ return OVER_GROUNDS.includes(headerGroundOf(ground));
142
+ }
143
+
144
+ /** True for a ground that turns into the look's glass. */
145
+ export function headerGroundIsGlass(ground: unknown): boolean {
146
+ return GLASS_GROUNDS.includes(headerGroundOf(ground));
147
+ }
148
+
149
+ /**
150
+ * Whether the page OPENS on a picture the header can stand over (HI3-D10), written by each renderer beside
151
+ * `data-iox-opening` (the engine's body, in the raw SSR; the canvas's globals layer) from `openingMediaOf(layout)`.
152
+ */
153
+ export const OPENING_MEDIA_ATTRIBUTE = 'data-iox-opening-media';
154
+
155
+ export enum OpeningMediaKind {
156
+ /** The first section's picture (a photo, a film, slides, an object, a material) fills the top of the page. */
157
+ Picture = 'picture',
158
+ /** The page opens on a plain ground (words, an inset card, a form): an over header shows its ground from the top. */
159
+ Plain = 'plain',
160
+ }
161
+
162
+ /** A node as `openingMediaOf` reads it (both renderers' shapes: the builder's ComponentNode, a SerializedNode). */
163
+ export interface OpeningMediaNode {
164
+ type?: string;
165
+ role?: string | null;
166
+ props?: Readonly<Record<string, unknown>> | null;
167
+ styleProps?: Readonly<Record<string, unknown>> | null;
168
+ children?: ReadonlyArray<unknown> | null;
169
+ }
170
+
171
+ /** The props key a composed opening stores its mix under (generation-core `OPENING_MIX_PROP`; spelled here: design-core
172
+ * reads no generation-core). Its words are `<ingredient>:<word>`, space-separated. */
173
+ const OPENING_MIX_PROP = 'openingMix';
174
+ const OPENING_NO_MEDIA = 'none';
175
+ /** The frame that leaves the page's own ground at the top: the picture is a card inset from the edges. */
176
+ const OPENING_INSET_FRAME = 'inset';
177
+ /** Node types that ARE a picture: a section that is one, or a layer of one laid behind its words. */
178
+ const PICTURE_TYPES: ReadonlySet<string> = new Set(['Image', 'Video', 'SliderContainer', 'Gallery']);
179
+ const LAYER_POSITIONS: ReadonlySet<string> = new Set(['absolute', 'fixed']);
180
+ const PICTURE_PAINT = /url\(|image-set\(/i;
181
+
182
+ const wordOf = (mix: string, ingredient: string): string | null =>
183
+ mix.split(/\s+/).find(w => w.startsWith(`${ingredient}:`))?.slice(ingredient.length + 1) ?? null;
184
+ const paintsPicture = (styles: Readonly<Record<string, unknown>> | null | undefined): boolean =>
185
+ ['backgroundImage', 'background'].some(k => PICTURE_PAINT.test(String(styles?.[k] ?? '')));
186
+
187
+ /**
188
+ * What a page opens on, from its own nodes in order (never its globals): a composed opening by its mix (a picture unless
189
+ * its media is `none` or its frame is `inset`); any other first section when it paints a picture as its background, IS a
190
+ * picture, or lays one behind its words (a positioned Image / Video / slider child). A page with no nodes is plain. Pure.
191
+ */
192
+ export function openingMediaOf(layout: ReadonlyArray<OpeningMediaNode | null | undefined> | null | undefined): OpeningMediaKind {
193
+ const first = layout?.find(n => !!n);
194
+ if (!first) return OpeningMediaKind.Plain;
195
+ const mix = first.props?.[OPENING_MIX_PROP];
196
+ if (typeof mix === 'string' && mix.trim()) {
197
+ const media = wordOf(mix, 'media');
198
+ const frame = wordOf(mix, 'frame');
199
+ return media && media !== OPENING_NO_MEDIA && frame !== OPENING_INSET_FRAME ? OpeningMediaKind.Picture : OpeningMediaKind.Plain;
200
+ }
201
+ if (paintsPicture(first.styleProps) || (first.type && PICTURE_TYPES.has(first.type))) return OpeningMediaKind.Picture;
202
+ const layer = ((first.children ?? []) as ReadonlyArray<OpeningMediaNode | null>).some(c =>
203
+ !!c && !!c.type && PICTURE_TYPES.has(c.type) && LAYER_POSITIONS.has(String(c.styleProps?.['position'] ?? '')));
204
+ return layer ? OpeningMediaKind.Picture : OpeningMediaKind.Plain;
205
+ }
206
+
207
+ /** The attribute a page's renderer writes beside `data-iox-opening`. */
208
+ export function openingMediaAttributes(layout: ReadonlyArray<OpeningMediaNode | null | undefined> | null | undefined): Record<string, string> {
209
+ return { [OPENING_MEDIA_ATTRIBUTE]: openingMediaOf(layout) };
210
+ }
211
+
212
+ /** Where the header is in its page's moment: has the page moved (the shipped Page scrolled state, G4), is its menu open,
213
+ * what does the page open on. */
214
+ export interface HeaderMoment {
215
+ scrolled?: boolean;
216
+ menuOpen?: boolean;
217
+ openingMedia?: OpeningMediaKind | `${OpeningMediaKind}` | null;
218
+ }
219
+
220
+ /**
221
+ * Whether the header shows its ground — FIRM (HI3-D4, D10, D11): a solid or glass header always; an over header once the
222
+ * page has moved, while its menu is open, and from the top on a page that opens without a picture. The ONE answer: the
223
+ * shared CSS draws it through `HEADER_AT_REST_SELECTOR` (held equal to this by header-behaviour.spec), the canvas's
224
+ * "At the top · Scrolled" pair asks it. Pure.
225
+ */
226
+ export function headerFirm(ground: unknown, moment: HeaderMoment = {}): boolean {
227
+ if (!headerGroundIsOver(ground)) return true;
228
+ return !(moment.openingMedia === OpeningMediaKind.Picture && !moment.scrolled && !moment.menuOpen);
229
+ }
230
+
231
+ /** Whether the header gives its height back to the page (HI3-D7): it does not stand on its own solid ground, over a page
232
+ * that opens on a picture — the picture starts at the top of the page, under the bar. */
233
+ export function headerGivesBack(ground: unknown, openingMedia: unknown): boolean {
234
+ return headerGroundOf(ground) !== HeaderGround.Solid && openingMedia === OpeningMediaKind.Picture;
235
+ }
236
+
237
+ /** The Page scrolled state's attribute (main entry `SCROLLED_ATTRIBUTE`; spelled here — design-core reads no Angular
238
+ * entry; held equal by the scrolled spec). */
239
+ export const HEADER_SCROLLED_ATTRIBUTE = 'data-iox-scrolled';
240
+ /**
241
+ * Written on the builder canvas's open Dialog stage (`app-builder-dialog`'s `div.dialog-stage`) — the canvas twin of an
242
+ * open `<dialog>`, which the canvas does not use (vectoriox/iox-ui#181).
243
+ */
244
+ export const HEADER_MENU_OPEN_ATTRIBUTE = 'data-iox-menu-open';
245
+ /**
246
+ * An open menu inside the header (the drawer / full / panel Dialog is the header's own child — T2): a real open
247
+ * `<dialog>` on the live site, the stage carrying `HEADER_MENU_OPEN_ATTRIBUTE` on the canvas.
248
+ */
249
+ export const HEADER_OPEN_MENU_SELECTOR = `:is(dialog[open], [${HEADER_MENU_OPEN_ATTRIBUTE}])`;
250
+ /** The CSS custom property the header runtime writes its height in (`watchHeaderHeight`), on the scope around it. */
251
+ export const HEADER_HEIGHT_VAR = '--header-h';
252
+
253
+ const groundIs = (grounds: ReadonlyArray<HeaderGround>): string => `:is(${grounds.map(g => `[${HeaderAttribute.Ground}="${g}"]`).join(', ')})`;
254
+ const onPicture = `:is([${OPENING_MEDIA_ATTRIBUTE}="${OpeningMediaKind.Picture}"] *)`;
255
+
256
+ /**
257
+ * The header AT REST (not firm), as a compound selector on the header's own element — `headerFirm`'s twin in CSS: an over
258
+ * ground, inside a page that opens on a picture, not inside a scrolled page, holding no open menu.
259
+ */
260
+ export const HEADER_AT_REST_SELECTOR =
261
+ `${groundIs(OVER_GROUNDS)}${onPicture}:not([${HEADER_SCROLLED_ATTRIBUTE}] *):not(:has(${HEADER_OPEN_MENU_SELECTOR}))`;
262
+
263
+ /** The header that gives its height back (`headerGivesBack`'s twin): any ground word, inside a page that opens on a picture. */
264
+ export const HEADER_GIVES_BACK_SELECTOR = `[${HeaderAttribute.Ground}]${onPicture}`;
265
+
266
+ /**
267
+ * Whose colours a header wears at rest and once firm (HI3-D8), as the part of the opening follower's selector the header's
268
+ * element must match: a header with no ground word, or one that follows every section, wears the opening as before; a
269
+ * header standing on a ground wears the opening only AT REST — once firm, the page's own.
270
+ */
271
+ export const OPENING_FOLLOWER_GROUND_CLAUSES: ReadonlyArray<string> = [
272
+ `:where(:not([${HeaderAttribute.Ground}]:not([${HeaderAttribute.Ink}="${HeaderInk.Follows}"])))`,
273
+ `:where(${HEADER_AT_REST_SELECTOR})`,
274
+ ];
275
+
99
276
  // ── The header's name on a phone (vectoriox/iox-ui#98) ─────────────────────────────────────────────────────────────
100
277
 
101
278
  /** The brand's role (generation-core `NavRole.Brand`, spelled here: design-core reads no generation-core). */
@@ -3,6 +3,7 @@ import { SPEC_AXES, SPEC_SCHEME_INK, SPEC_SCHEMES } from './flavor-spec.generate
3
3
  import { isListMixClass, listMixClasses } from './list-classes';
4
4
  import { footerMixClasses, isFooterMixClass } from './footer-classes';
5
5
  import { isSectionDesignClass, sectionDesignClasses } from './section-edge';
6
+ import { OPENING_FOLLOWER_GROUND_CLAUSES } from './header-behaviour';
6
7
 
7
8
  /**
8
9
  * The design-system classes a node renders, in BOTH renderers (builder canvas, engine component
@@ -74,9 +75,15 @@ export function pageOpeningScheme(pageSettings: Readonly<Record<string, unknown>
74
75
  return colorSchemeClass(id) ? (id as ColorScheme) : null;
75
76
  }
76
77
 
77
- /** The header that follows an opening of scheme `id` and names none of its own, inside `scope` (the builder's token scope). */
78
+ /**
79
+ * The header that follows an opening of scheme `id` and names none of its own, inside `scope` (the builder's token scope).
80
+ * HI3-D8: a header standing on a ground (over · over-glass · glass) follows the opening only at rest — once it has turned
81
+ * it wears the page's own colours (unless its colours follow every section). Two selectors, each the same specificity as
82
+ * before (the ground clauses are `:where()`).
83
+ */
78
84
  export function openingFollowerSelector(id: string, scope?: string): string {
79
- return `${scope ? `${scope} ` : ''}[${OPENING_ATTRIBUTE}="${id}"] .${roleClass(OPENING_FOLLOWER_ROLE)}:not([class*="${SCHEME_PREFIX}"])`;
85
+ const base = `${scope ? `${scope} ` : ''}[${OPENING_ATTRIBUTE}="${id}"] .${roleClass(OPENING_FOLLOWER_ROLE)}:not([class*="${SCHEME_PREFIX}"])`;
86
+ return OPENING_FOLLOWER_GROUND_CLAUSES.map(clause => `${base}${clause}`).join(', ');
80
87
  }
81
88
 
82
89
  /**
@@ -59,3 +59,37 @@ export function headingHref(props: NodeLinkProps, pageHref: (route: string) => s
59
59
  if (props.linkType === LinkType.External) return String(props.url ?? '').trim() || null;
60
60
  return null;
61
61
  }
62
+
63
+ /** The prop a node's route params are stored under — `routeParam:<name>`, a static value or a binding (both land there). */
64
+ export const ROUTE_PARAM_PREFIX = 'routeParam:';
65
+
66
+ /** A node's route params by name, from its `routeParam:<name>` props (`{ 'routeParam:slug': 'soap' }` → `{ slug: 'soap' }`). */
67
+ export function routeParamValues(props: Readonly<Record<string, unknown>> | null | undefined): Record<string, unknown> {
68
+ const out: Record<string, unknown> = {};
69
+ for (const [key, value] of Object.entries(props ?? {})) {
70
+ if (key.startsWith(ROUTE_PARAM_PREFIX)) out[key.slice(ROUTE_PARAM_PREFIX.length)] = value;
71
+ }
72
+ return out;
73
+ }
74
+
75
+ const ROUTE_PARAM = /:([a-zA-Z_][a-zA-Z0-9_]*)/g;
76
+
77
+ /**
78
+ * A page route with its `:params` filled: each from `values` (URL-encoded), an unfilled one leaving no gap
79
+ * (`/shop/:slug/reviews` with no slug → `/shop/reviews`). The engine's `resolvePageHref` substitution, shared so the builder's
80
+ * Preview links where the live site does — a product card read `/shop/:slug` there (vectoriox/iox-ui#176). The route's
81
+ * leading slash is kept; the engine makes it base-relative itself.
82
+ */
83
+ export function fillRouteParams(route: string, values: Readonly<Record<string, unknown>>): string {
84
+ return String(route ?? '')
85
+ .replace(ROUTE_PARAM, (_m, name: string) => {
86
+ const value = values[name];
87
+ return value === undefined || value === null || value === '' ? '' : encodeURIComponent(String(value));
88
+ })
89
+ .replace(/\/{2,}/g, '/');
90
+ }
91
+
92
+ /** Does the route still name a `:param` (one nothing filled)? */
93
+ export function routeHasParams(route: string): boolean {
94
+ return new RegExp(ROUTE_PARAM.source).test(String(route ?? ''));
95
+ }
@@ -1,6 +1,7 @@
1
1
  import { ELEMENT_ACTION_DESCRIPTORS, POPUP_RULES, popupEnded, resolveActionAvailability } from '@vectoriox/iox-ui/actions-core';
2
2
  import { CheckoutGateCode, CheckoutGateRefusal, labelIn } from '@vectoriox/iox-ui/commerce-core';
3
3
  import { PopupArrive, PopupForm, popupFormOf, PopupRole, PopupTrait, ShopRole } from '@vectoriox/iox-ui/composite-core';
4
+ import { isNumberedPlaceholderTitle } from '@vectoriox/iox-ui/data-core';
4
5
  import { auditDesignContrast, DesignTokenLike } from '@vectoriox/iox-ui/design-core';
5
6
  import { ConsentActionType } from '@vectoriox/iox-ui/composite-core';
6
7
  import { collectFormSpec, FORM_CHANNEL_ROLE, FORM_NODE_TYPE, isChannelFilled } from '@vectoriox/iox-ui/forms-core';
@@ -62,6 +63,10 @@ export enum SiteFindingCode {
62
63
  ContactMissing = 'contact-missing',
63
64
  CopyPlaceholder = 'copy-placeholder',
64
65
  SampleItems = 'sample-items',
66
+ /** iox-ui#178: a sample item still titled like a numbered placeholder ("Product 2", "Room 2") — the builder draws it as
67
+ * a ghost card and the live site never lists it alone, but it is the owner's to name or remove. Asks ("Publish
68
+ * anyway", Doron 2026-11-28) — said instead of SampleItems (`isNumberedPlaceholderTitle`). */
69
+ PlaceholderTitle = 'placeholder-title',
65
70
  /** Commerce G1 (shop-aware §3i): a sample product the build added still has no price — a price is a fact a buyer is
66
71
  * held to, so the owner sets it (or removes the sample) before the store goes live. */
67
72
  SamplePrice = 'sample-price',
@@ -130,6 +135,7 @@ export const FINDING_SEVERITY: Readonly<Record<SiteFindingCode, CheckSeverity>>
130
135
  [SiteFindingCode.ContactMissing]: CheckSeverity.Warn,
131
136
  [SiteFindingCode.CopyPlaceholder]: CheckSeverity.Ask,
132
137
  [SiteFindingCode.SampleItems]: CheckSeverity.Ask,
138
+ [SiteFindingCode.PlaceholderTitle]: CheckSeverity.Ask,
133
139
  [SiteFindingCode.SamplePrice]: CheckSeverity.Block,
134
140
  [SiteFindingCode.SampleStock]: CheckSeverity.Block,
135
141
  [SiteFindingCode.StoreFact]: CheckSeverity.Block,
@@ -170,6 +176,7 @@ const CHECK_OF: Readonly<Record<SiteFindingCode, SiteCheckId>> = {
170
176
  [SiteFindingCode.ContactMissing]: SiteCheckId.Facts,
171
177
  [SiteFindingCode.CopyPlaceholder]: SiteCheckId.Facts,
172
178
  [SiteFindingCode.SampleItems]: SiteCheckId.Facts,
179
+ [SiteFindingCode.PlaceholderTitle]: SiteCheckId.Facts,
173
180
  [SiteFindingCode.SamplePrice]: SiteCheckId.Facts,
174
181
  [SiteFindingCode.SampleStock]: SiteCheckId.Facts,
175
182
  [SiteFindingCode.StoreFact]: SiteCheckId.Facts,
@@ -505,7 +512,9 @@ function checkFacts(ctx: Ctx, snapshot: SiteAuditSnapshot, pages: ReadonlyArray<
505
512
  else if (blocksPublish(p.kind)) add(ctx, SiteFindingCode.UnfilledFact, { text: String(p.text || p.kind) }, where);
506
513
  else if (p.kind === PlaceholderKind.Copy) add(ctx, SiteFindingCode.CopyPlaceholder, null, where);
507
514
  }
508
- for (const s of snapshot.samples ?? []) add(ctx, SiteFindingCode.SampleItems, { name: s.label ?? s.id }, { nodeId: s.id });
515
+ for (const s of snapshot.samples ?? []) {
516
+ add(ctx, isNumberedPlaceholderTitle(s.label) ? SiteFindingCode.PlaceholderTitle : SiteFindingCode.SampleItems, { name: s.label ?? s.id }, { nodeId: s.id });
517
+ }
509
518
  // iox-cms#98: what the shop lacks holds only the pages that show the shop — never the Home of a site that also sells.
510
519
  const shopShown = pages.some(pageShowsShop);
511
520
  for (const s of shopShown ? snapshot.unpricedSamples ?? [] : []) add(ctx, SiteFindingCode.SamplePrice, { name: s.label ?? s.id }, { nodeId: s.id });
@@ -97,6 +97,11 @@ export const SITE_FINDING_WORDS: Readonly<Record<`${SiteFindingCode}`, FindingWo
97
97
  many: S('{n} sample items — replace them with yours or remove them.', '{n} פריטים לדוגמה — החליפו אותם בשלכם או הסירו אותם.'),
98
98
  group: FindingGrouping.Site,
99
99
  },
100
+ 'placeholder-title': {
101
+ one: S('"{name}" is still a numbered placeholder — give it its own name, or remove it.', '"{name}" עדיין שם זמני ממוספר — תנו לו שם משלכם, או הסירו אותו.'),
102
+ many: S('{n} items are still numbered placeholders — give each its own name, or remove them.', '{n} פריטים עדיין בשמות זמניים ממוספרים — תנו לכל אחד שם משלכם, או הסירו אותם.'),
103
+ group: FindingGrouping.Site,
104
+ },
100
105
  // Each sample product is fixed on its own page (the screen links to it), so they are never one row.
101
106
  'sample-price': {
102
107
  one: S('"{name}" has no price yet — set yours, or remove the sample.', 'ל-"{name}" עדיין אין מחיר — קבעו מחיר או הסירו את הדוגמה.'),
@@ -9,6 +9,7 @@ import { factIssues, PlanWordContext, WrittenText } from './plan-words';
9
9
  import { PageSectionPlan } from './site-plan.model';
10
10
  import { PathIssue } from './shape-check';
11
11
  import { freeStyleWithoutSlot } from './free-slots';
12
+ import { isFreeBox } from './free-opening';
12
13
 
13
14
  /**
14
15
  * THE FREE PAGE'S JUDGE (award plan §11.4 gates 1 + 2, FS3): every reason a free page may not be stamped, path first,
@@ -69,6 +70,10 @@ export interface FreeJudgeContext {
69
70
  said?: ReadonlyArray<string>;
70
71
  /** Home: a business with videos plays one there. */
71
72
  home?: boolean;
73
+ /** iox-ui#180: the picture boxes the page was offered (`freeOpeningOffer`) — empty pictures the build fills. */
74
+ boxes?: ReadonlyArray<string>;
75
+ /** iox-ui#180: a picture can come for the Home's opening (the owner's photo, or a box): its first section holds it. */
76
+ opensOnPicture?: boolean;
72
77
  }
73
78
 
74
79
  /** A free page is this many sections. */
@@ -229,7 +234,8 @@ function judgeFree(page: FreePage, ctx: FreeJudgeContext, signature: boolean): F
229
234
  const seen = new Set<string>();
230
235
  const texts: WrittenText[] = [];
231
236
  let h1 = 0;
232
- for (const { node, path, up } of walked) {
237
+ let boxes = 0;
238
+ for (const { node, path, up, section } of walked) {
233
239
  if (!Object.values(FreeNodeType).includes(node.type)) { say(FreeIssueCode.Structure, path, `"${node.type}" is not a node type — ${Object.values(FreeNodeType).join(', ')}`); continue; }
234
240
  if (!node.id || seen.has(node.id)) say(FreeIssueCode.Structure, path, node.id ? `the id "${node.id}" is used twice` : 'every node needs its own id');
235
241
  seen.add(node.id);
@@ -253,9 +259,17 @@ function judgeFree(page: FreePage, ctx: FreeJudgeContext, signature: boolean): F
253
259
  }
254
260
  if (node.role && (node.role !== FREE_LEAD_ROLE || node.type !== FreeNodeType.Heading)) say(FreeIssueCode.Structure, `${path}.role`, 'role "lead" is for the heading a visitor reads first');
255
261
  if (node.type === FreeNodeType.Image || node.type === FreeNodeType.Video) {
256
- const m = ctx.material[node.src ?? ''];
257
- if (!m) say(FreeIssueCode.Content, `${path}.src`, `"${node.src ?? ''}" is not in the material — use an id from the list`);
262
+ const src = node.src ?? '';
263
+ const offeredBox = isFreeBox(src) && !!ctx.boxes?.includes(src);
264
+ const m = ctx.material[src] ?? (offeredBox ? { kind: 'image' as const } : undefined);
265
+ if (!m) say(FreeIssueCode.Content, `${path}.src`, `"${src}" is not in the material — use an id from the list`);
258
266
  else if ((node.type === FreeNodeType.Video) !== (m.kind === 'video')) say(FreeIssueCode.Content, `${path}.src`, `"${node.src}" is a${m.kind === 'image' ? 'n image' : ' video'} — ${node.type === FreeNodeType.Video ? 'a Video plays a video' : 'an Image shows a picture'}`);
267
+ else if (offeredBox) {
268
+ // iox-ui#180: a box is the opening's ONE picture place, filled after the page is written — never a ground.
269
+ if (section !== 0) say(FreeIssueCode.Content, `${path}.src`, 'a box is the opening\'s picture — only the first section may hold one');
270
+ else if (boxes++ > 0) say(FreeIssueCode.Content, `${path}.src`, 'one box: the opening has one picture place');
271
+ if (node.styleProps?.['position'] === 'absolute') say(FreeIssueCode.Content, `${path}.styleProps.position`, 'a box is never a ground: words never stand on a picture nobody has seen yet — set it beside, above or below the words');
272
+ }
259
273
  }
260
274
  if (node.type === FreeNodeType.Slot) {
261
275
  const offer = ctx.slots?.[node.slot ?? ''];
@@ -311,6 +325,10 @@ function judgeFree(page: FreePage, ctx: FreeJudgeContext, signature: boolean): F
311
325
  if (last >= 0 && !ready(last) && !walkFree([sections[last]]).some(w => w.node.type === FreeNodeType.Button)) say(FreeIssueCode.Structure, `sections[${last}]`, 'the page ends on something to do — a Button in the last section');
312
326
  const hasVideos = Object.values(ctx.material).some(m => m.kind === 'video');
313
327
  if (ctx.home && hasVideos && !sections.some(s => s.readyMade) && !walked.some(w => w.node.type === FreeNodeType.Video)) say(FreeIssueCode.Content, 'sections', 'this business has videos — the home page plays at least one (a Video node)');
328
+ // iox-ui#180: a picture can come for this Home's opening (the owner's photo, or a box stock fills) — it opens on it.
329
+ if (ctx.home && ctx.opensOnPicture && sections[0] && !ready(0) && !walkFree([sections[0]]).some(w => w.node.type === FreeNodeType.Image)) {
330
+ say(FreeIssueCode.Content, 'sections[0]', `a picture can open this home page — place ${ctx.boxes?.length ? `one of the owner's photos or a box (${ctx.boxes.join(', ')})` : 'one of the owner\'s photos'} as an Image in the first section, beside, above or below its words`);
331
+ }
314
332
  if (!(Object.values(FreePictures) as string[]).includes(page?.pictures)) say(FreeIssueCode.Structure, 'pictures', `one word: ${Object.values(FreePictures).join(', ')}`);
315
333
  issues.push(...followedIssues(page, ctx));
316
334
  issues.push(...freeContrastIssues(page, ctx));
@@ -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, headerInkOf,
3
+ AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerGroundOf, headerInkOf,
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,7 +11,7 @@ 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, setHeaderInk, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe, AccountRole,
14
+ setHeaderBehaviour, setHeaderGround, setHeaderInk, SHOP_RECIPES, ShopRecipe, ShopRole, bindShopPart, ShopBindTarget, ACCOUNT_RECIPES, AccountRecipe, AccountRole,
15
15
  buildConsentRecipe, ConsentActionType, CarouselFrom, carouselQuoteLabel, CAROUSEL_QUOTE_LABELS, pickCarouselAutoBinds,
16
16
  } from '@vectoriox/iox-ui/composite-core';
17
17
  import { ConsentCategory } from '@vectoriox/iox-ui/consent-core';
@@ -25,10 +25,10 @@ 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
- import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, HeaderIngredient, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
31
+ import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, HeaderFacts, HeaderIngredient, HeaderNever, HeaderOpening, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
32
32
  import { bodyMixOfPlan, checkBody, drawnBodyMix, joinPageHeader, wearBodyMix } from './body-mix';
33
33
  import { checkPopup, composePopup, POPUP_GLOBAL_ID } from './popup-plan';
34
34
  import { NODE_BASELINES } from './node-baselines.generated';
@@ -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
  /**
@@ -178,6 +179,12 @@ export interface ComposeContext {
178
179
  /** AW12-D10: what that kind of business's footer never wears (harness-core `BusinessType.footer`) — `checkFooter`
179
180
  * mends it, said. Absent = nothing refused. */
180
181
  footerNever?: FooterNever;
182
+ /** HI3-D12: what that kind of business never stands its header on (harness-core `BusinessType.header`) — `checkHeader`
183
+ * mends it to its own ground, said. Absent = nothing refused. */
184
+ headerNever?: HeaderNever;
185
+ /** HI3-D5: whether the header's words read at rest over the home opening's picture (`headerReadsAtRest`, judged where
186
+ * the picture's pixels are). Absent = not judged. */
187
+ headerReadable?: boolean;
181
188
  /** AW1: what the studio holds that decides its legal pages and banner (country, trackers, its own legal pages, its
182
189
  * routes, a banner it keeps). Absent = only what the plan and the composed pages say (no tracker, no country). */
183
190
  legal?: LegalContext;
@@ -1802,7 +1809,8 @@ function freeOptionsOf(
1802
1809
  const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
1803
1810
  return {
1804
1811
  owner: page.key, locale, rtl: isRtlLocale(locale), motion: layoutMotionOf(layoutPresetOf(plan.design).id),
1805
- photoSrc: id => context.photoSrc?.(id) ?? '', photoAlt: id => context.photoAlt?.(id) ?? '',
1812
+ // iox-ui#180: a picture box is an empty picture (the build fills it), never an address.
1813
+ photoSrc: id => (isFreeBox(id) ? '' : context.photoSrc?.(id) ?? ''), photoAlt: id => (isFreeBox(id) ? '' : context.photoAlt?.(id) ?? ''),
1806
1814
  listOf: alias => pageListOf(alias, plan, pictureless),
1807
1815
  ...(readyMade ? {
1808
1816
  readyMade: (at: number, id: string) => {
@@ -1908,10 +1916,14 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
1908
1916
  const pages: ComposedPage[] = plan.pages.map(page => {
1909
1917
  const nextAlias = page.routeSource ? nextSourceOf(relatives, page.routeSource) : null;
1910
1918
  if (page.free) {
1911
- // FS3: the model's own page. Its opening is its own (the plan's opening is never worn over it).
1912
- const nodes = composeFreePlanPage(page, page.free, plan, context, placeholders, pictureless, (section, id, at) =>
1919
+ // FS3: the model's own page. Its opening is its own (the plan's opening is never worn over it) — but a ready-made
1920
+ // opening (the fall back's, or the type-led round's when nothing fills its picture, iox-ui#180) is the plan's
1921
+ // section, worn as every Home's is.
1922
+ const stamped = composeFreePlanPage(page, page.free, plan, context, placeholders, pictureless, (section, id, at) =>
1913
1923
  composePattern(patternById(section.pattern) as SitePattern, id, { ...base, owner: page.key, page, section, nextAlias },
1914
1924
  { level: section.enter ?? design.animate ?? null, rtl, move: design.headings ?? null, scrub: design.scrub ?? null, opening: at === 0 }));
1925
+ const readyOpening = page.free.sections[0]?.readyMade;
1926
+ const nodes = readyOpening ? wearPlanOpening(page, stamped, plan, context, design, placeholders, issues, false, page.sections[readyOpening.at]) : stamped;
1915
1927
  const opening = schemeOfFirst(nodes);
1916
1928
  return {
1917
1929
  key: page.key, name: page.name, route: { path: page.route }, isHome: page.isHome === true, status: STATUS_DRAFT, locale,
@@ -1977,7 +1989,10 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
1977
1989
  for (const r of footer.repairs) issues.push({ code: ComposeIssueCode.FooterMended, nodeId: GlobalSlot.Footer, owner: GlobalSlot.Footer, detail: r.said });
1978
1990
  // HI1: the header is the plan's header MIX (a stored pattern id is read as one), drawn as the product draws it, checked
1979
1991
  // against the site and arranged from the contract's header parts; each mend is said.
1980
- const header = planHeader(plan);
1992
+ const header = planHeader(plan, {
1993
+ ...(context?.headerNever ? { never: context.headerNever } : {}),
1994
+ ...(context?.headerReadable !== undefined ? { readableAtRest: context.headerReadable } : {}),
1995
+ });
1981
1996
  for (const said of header.said) issues.push({ code: ComposeIssueCode.HeaderMended, nodeId: GlobalSlot.Header, owner: GlobalSlot.Header, detail: said });
1982
1997
  const patternOf = (slot: GlobalSlot): SitePattern => slot === GlobalSlot.Footer
1983
1998
  ? footerPattern(footer.mix, footerContext)
@@ -2006,6 +2021,8 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
2006
2021
  if (headerRoot) stampHeaderMix(headerRoot, header.recipe.mix);
2007
2022
  // AW6 (AW6-D10): a header whose ink follows the sections says so (the renderers' header ink runtime reads it).
2008
2023
  if (headerRoot) setHeaderInk(headerRoot as unknown as CompositeNode, headerInkOf(header.recipe.mix[HeaderIngredient.Ink]));
2024
+ // HI3 (HI3-D1): what the header stands on — over the opening, glass, or its own ground — the same edit the Header section makes.
2025
+ if (headerRoot) setHeaderGround(headerRoot as unknown as CompositeNode, headerGroundOf(header.recipe.mix[HeaderIngredient.Ground]));
2009
2026
  // AW12: the footer root says the mix it was composed as (the classes iox-design.css draws from); an inset one is a card.
2010
2027
  const footerRoot = globals.find(g => g.id === GlobalSlot.Footer);
2011
2028
  if (footerRoot) stampFooterMix(footerRoot as unknown as { props: Record<string, unknown>; styleProps?: Record<string, unknown> }, footer.mix);
@@ -2236,8 +2253,8 @@ function composeLegal(plan: SitePlan, context: LegalContext, pages: ReadonlyArra
2236
2253
 
2237
2254
  /** A plan's header (HI1): its mix as the product draws it, checked against the site, and the recipe to stamp — with what
2238
2255
  * was mended or drawn as something else, in words. */
2239
- export function planHeader(plan: SitePlan): { recipe: HeaderRecipe; context: HeaderContext; said: string[] } {
2240
- const { mix, context, said } = wornHeaderOfPlan(plan);
2256
+ export function planHeader(plan: SitePlan, facts: HeaderFacts = {}): { recipe: HeaderRecipe; context: HeaderContext; said: string[] } {
2257
+ const { mix, context, said } = wornHeaderOfPlan(plan, facts);
2241
2258
  return { recipe: headerRecipe(mix, context), context, said };
2242
2259
  }
2243
2260
 
@@ -2304,6 +2321,10 @@ export interface NavHeaderInput {
2304
2321
  readonly asAsked?: boolean;
2305
2322
  /** HI1b: the site sells — the header holds the account entry and the bag, as `composeSite` gives a selling site's. */
2306
2323
  readonly storeSlots?: boolean;
2324
+ /** HI3-D10: the Home's opening as the studio reads it (`openingMediaOf` of its first section: a full picture is
2325
+ * `{ frame: 'full', media: 'photo' }`; null = it opens plain). Absent: not judged — a header over the opening is kept
2326
+ * as chosen (the builder knows the page; a studio with no Site Plan has no plan opening to read). */
2327
+ readonly opening?: HeaderOpening | null;
2307
2328
  }
2308
2329
 
2309
2330
  export interface NavHeaderOptions {
@@ -2386,7 +2407,8 @@ function navHeaderPlan(input: Omit<NavHeaderInput, 'mix' | 'asAsked'>): SitePlan
2386
2407
 
2387
2408
  /** What a studio's header is judged against (`checkHeader`) — the same context `composeNavHeader` checks with. */
2388
2409
  export function navHeaderContext(input: Omit<NavHeaderInput, 'mix' | 'asAsked'>): HeaderContext {
2389
- return headerContextOfPlan(navHeaderPlan(input), input.shop ?? null);
2410
+ const { opening: _plan, ...context } = headerContextOfPlan(navHeaderPlan(input), input.shop ?? null);
2411
+ return input.opening === undefined ? context : { ...context, opening: input.opening };
2390
2412
  }
2391
2413
 
2392
2414
  export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOptions): ComposedNavHeader {
@@ -2396,7 +2418,7 @@ export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOption
2396
2418
  const email = nonEmpty(input.business.facts?.email) ? input.business.facts!.email!.trim() : null;
2397
2419
  const issues: ComposeIssue[] = [];
2398
2420
  // HI1: ONE recipe with composeSite — the mix drawn as the product draws it, checked against this studio, arranged.
2399
- const context = headerContextOfPlan(plan, input.shop ?? null);
2421
+ const context = navHeaderContext(input);
2400
2422
  const { drawn, gaps } = drawnHeaderMix(input.mix ?? headerMix());
2401
2423
  // R-H4: the Studio header (no mix asked) composes as it always did; a chosen mix is judged against the studio.
2402
2424
  const checked = input.mix && !input.asAsked ? checkHeader(drawn, context) : { mix: drawn, repairs: [] };
@@ -2417,6 +2439,7 @@ export function composeNavHeader(input: NavHeaderInput, options: NavHeaderOption
2417
2439
  if (pattern.header) setHeaderBehaviour(header as unknown as CompositeNode, pattern.header.behaviour, pattern.header.edge ?? null);
2418
2440
  stampHeaderMix(header, recipe.mix);
2419
2441
  setHeaderInk(header as unknown as CompositeNode, headerInkOf(recipe.mix[HeaderIngredient.Ink]));
2442
+ setHeaderGround(header as unknown as CompositeNode, headerGroundOf(recipe.mix[HeaderIngredient.Ground]));
2420
2443
  if (input.storeSlots) withStoreSlots(header, input.locale ?? DEFAULT_SITE_LOCALE);
2421
2444
  return { header, issues, mix: checked.mix, companions };
2422
2445
  }
@@ -2505,6 +2528,14 @@ const SCENE_ROLE = 'scene';
2505
2528
 
2506
2529
  /** May the opening take the place of this first section? It must hold a heading (the opening's title is its words) and
2507
2530
  * nothing the opening has no part for — a form, bound content, a Scene stay and the opening comes before them. */
2531
+ /** The named opening a first section's pattern stands for (`namedOpeningMix`), when the ONE judge would mend it for this
2532
+ * build — else null: the pattern stays as it is composed. */
2533
+ function openingTheJudgeMends(root: SerializedNode, source: PageSectionPlan | undefined, ctx: OpeningContext): OpeningMix | null {
2534
+ if (!source || root.composed?.pattern !== source.pattern) return null;
2535
+ const named = namedOpeningMix(source.pattern);
2536
+ return named && checkOpening(named, ctx).repairs.length ? named : null;
2537
+ }
2538
+
2508
2539
  function openingMayReplace(root: SerializedNode): boolean {
2509
2540
  let heading = false;
2510
2541
  let keeps = false;
@@ -2538,13 +2569,18 @@ function wearPlanOpening(
2538
2569
  page: PagePlan, layout: SerializedNode[], plan: SitePlan, context: ComposeContext, design: DesignChoices,
2539
2570
  placeholders: ComposedPlaceholder[], issues: ComposeIssue[], keep: boolean, source?: PageSectionPlan,
2540
2571
  ): SerializedNode[] {
2541
- const mix = openingMixOfPlan(plan);
2542
- if (!mix || !(page.isHome === true || page.route === HOME_PATH)) return layout;
2572
+ if (!(page.isHome === true || page.route === HOME_PATH)) return layout;
2543
2573
  const first = layout[0];
2544
2574
  const replace = !!first && !keep && openingMayReplace(first);
2545
- const id = replace ? first.id : `${page.key}-opening`;
2546
2575
  const tier = context.tier ?? GenerationTier.Basic;
2547
- 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 };
2576
+ // J10 lever (b): a build never holds the owner's clip for the opening (their film plays in a Scene, SC6b) — a film
2577
+ // opening is drawn as a picture the owner's photo, a made picture or stock can fill (`checkOpening`, said).
2578
+ 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 };
2579
+ // iox-ui#180: with no opening chosen, a first section that IS a named opening (`hero.full-bleed-media` = a film) is
2580
+ // judged as that opening — when the judge mends it (no clip: a picture) it is worn mended; else it stays as it is.
2581
+ const mix = openingMixOfPlan(plan) ?? (replace ? openingTheJudgeMends(first, source, openingContextOf({ ...site, business: plan.business })) : null);
2582
+ if (!mix) return layout;
2583
+ const id = replace ? first.id : `${page.key}-opening`;
2548
2584
  // #129: a type-led first screen takes the type-led hero's words slot by slot (nothing it said is lost); the name is
2549
2585
  // the business's, as every display-size opening's is.
2550
2586
  const checked = replace && source ? checkOpening(drawnOpeningMix(mix).drawn, openingContextOf({ ...site, business: plan.business })).mix : null;
@@ -2624,6 +2660,9 @@ export interface OpeningInput extends SectionInput {
2624
2660
  readonly badge?: string | null;
2625
2661
  /** The owner gives a cut-out picture (the name behind the subject). */
2626
2662
  readonly cutOut?: boolean;
2663
+ /** J10 lever (b): the owner's clip plays in the first screen; `false` = none (a build — a picture stands in, said);
2664
+ * absent = the film's placeholder (the builder). */
2665
+ readonly film?: boolean;
2627
2666
  /** AW-D23: the tier the site is built at; absent = every word (the builder shows the Pro marks itself). */
2628
2667
  readonly tier?: OpeningContext['tier'];
2629
2668
  /** Draw the mix as asked, never mended — the Opening studio (it ADVISES the check's mends, OB-2). */
@@ -2640,12 +2679,13 @@ export interface ComposedOpening extends ComposedSection {
2640
2679
  }
2641
2680
 
2642
2681
  /** The context an opening is judged and measured in — the same for the check, the recipe and the studio's advice. */
2643
- export function openingContextOf(input: Pick<OpeningInput, 'business' | 'design' | 'badge' | 'cutOut' | 'tier'>): OpeningContext {
2682
+ export function openingContextOf(input: Pick<OpeningInput, 'business' | 'design' | 'badge' | 'cutOut' | 'film' | 'tier'>): OpeningContext {
2644
2683
  return {
2645
2684
  name: input.business?.name ?? '',
2646
2685
  design: resolveDesignChoices(JSON.parse(JSON.stringify(input.design ?? {}))),
2647
2686
  ...(input.tier ? { tier: input.tier } : {}),
2648
2687
  ...(input.cutOut !== undefined ? { cutOut: input.cutOut } : {}),
2688
+ ...(input.film !== undefined ? { film: input.film } : {}),
2649
2689
  ...(input.badge !== undefined ? { badge: input.badge } : {}),
2650
2690
  };
2651
2691
  }