@vectoriox/iox-ui 5.201.0 → 5.202.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 (41) hide show
  1. package/design-core/index.d.ts +162 -5
  2. package/fesm2022/vectoriox-iox-ui-design-core.mjs +216 -12
  3. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  4. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2665 -1299
  5. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +28 -12
  7. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui.mjs +85 -1
  9. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  10. package/generation-core/index.d.ts +968 -263
  11. package/harness-core/index.d.ts +21 -13
  12. package/index.d.ts +50 -2
  13. package/package.json +1 -1
  14. package/src/design-core/brand-neutrals.ts +50 -7
  15. package/src/design-core/colour-words.ts +22 -5
  16. package/src/design-core/design-settings.ts +5 -0
  17. package/src/design-core/design-token.model.ts +3 -0
  18. package/src/design-core/flavor-fixtures.generated.ts +38 -2
  19. package/src/design-core/flavor-spec.generated.ts +143 -1
  20. package/src/design-core/flavor-tokens.ts +6 -2
  21. package/src/generation-core/check-free.ts +36 -16
  22. package/src/generation-core/colour-mix.ts +70 -14
  23. package/src/generation-core/compose-site.ts +139 -27
  24. package/src/generation-core/fallback-memory.ts +8 -5
  25. package/src/generation-core/footer-free.ts +439 -0
  26. package/src/generation-core/footer-mix.ts +130 -36
  27. package/src/generation-core/free-parts.ts +3 -0
  28. package/src/generation-core/free-slot-words.ts +3 -0
  29. package/src/generation-core/free-wire.ts +10 -2
  30. package/src/generation-core/layout-fingerprint.ts +6 -4
  31. package/src/generation-core/opening-mix.ts +61 -0
  32. package/src/generation-core/plan-wire.ts +1 -0
  33. package/src/generation-core/public-api.ts +1 -0
  34. package/src/generation-core/redesign-run.ts +45 -2
  35. package/src/generation-core/site-plan.model.ts +6 -0
  36. package/src/generation-core/site-spec.generated.ts +599 -22
  37. package/src/generation-core/validate-site-plan.ts +39 -1
  38. package/src/harness-core/business-types.ts +3 -1
  39. package/src/harness-core/harness-spec.generated.ts +24 -12
  40. package/src/harness-core/run-compose-context.ts +8 -1
  41. package/styles/iox-design.css +7 -4
@@ -15,7 +15,7 @@ import { SPEC_SITE_LAYOUT } from './site-spec.generated';
15
15
  * Doron's references. This module reads it and judges a composed page's grounds against its rhythm (`colourRhythmIssues`,
16
16
  * run by `checkLayout` — AW6's judge, moved here with the words, CV-D6). Pure.
17
17
  *
18
- * CV1 draws no new word: every word past today's look waits for CV2–CV5 and is drawn as today's (`drawnColourMix`).
18
+ * A word that waits is drawn as its stand-in (`drawnColourMix`); CV5 drew the last rhythm, `flow`.
19
19
  */
20
20
 
21
21
  interface ColourTable {
@@ -33,6 +33,7 @@ interface ColourTable {
33
33
  chapters: { changesAt: ReadonlyArray<string> };
34
34
  tail: { last: number };
35
35
  flood: { neighbours: 'differ'; apart: number };
36
+ flow: { crossfade: 'opacity'; darks: number };
36
37
  };
37
38
  rules: {
38
39
  groundsMax: Readonly<Record<string, number>>;
@@ -43,6 +44,7 @@ interface ColourTable {
43
44
  };
44
45
  tiers: Readonly<Record<string, 'all' | 'pro'>>;
45
46
  presets: Readonly<Record<string, Readonly<Record<string, string>>>>;
47
+ references: ReadonlyArray<{ id: string; after: string; added: string; mix: Readonly<Record<string, string>> }>;
46
48
  }
47
49
 
48
50
  const C = SPEC_SITE_LAYOUT.colour as unknown as ColourTable;
@@ -131,6 +133,11 @@ export function colourMix(partial: Partial<Record<string, string>> = {}): Colour
131
133
  return mix as ColourMix;
132
134
  }
133
135
 
136
+ /** Doron's colour references (§3, §8), each as a whole mix — what a plan that follows one wears (`colourMixWords`). */
137
+ export function colourReferences(): ReadonlyArray<{ id: string; after: string; added: string; mix: ColourMix }> {
138
+ return (C.references ?? []).map(r => ({ id: r.id, after: r.after, added: r.added, mix: colourMix(r.mix) }));
139
+ }
140
+
134
141
  /** CV-D13: a style preset's default colour mix (its §6 row, the rest the defaults); an unknown preset wears the defaults. */
135
142
  export function presetColourMix(presetId: string | null | undefined): ColourMix {
136
143
  return colourMix(C.presets[presetId ?? ''] ?? {});
@@ -149,17 +156,60 @@ export function colourMixOfPlan(plan: Pick<SitePlan, 'mixes' | 'design'>): Colou
149
156
  }
150
157
  }
151
158
 
152
- /** CV2 + CV3: the colour words a look carries as TOKENS (ground · dark · button · wash), as drawn — the rest are judged,
153
- * never painted. */
159
+ /** CV2 + CV3 + CV5: the colour words a look carries as TOKENS (ground · dark · button · wash · flow), as drawn — the rest are
160
+ * judged, never painted. The one rhythm that moves (`flow`) paints the page flat, so a flowing look carries no wash
161
+ * (`rules.flowWearsFlat`). */
154
162
  export function colourDesignWords(mix: ColourMix): Pick<DesignChoices, ColourWordKey> {
155
163
  const { drawn } = drawnColourMix(mix);
156
- return resolveColourWords({ ground: drawn.ground, dark: drawn.dark, action: drawn.action, wash: drawn.wash });
164
+ const flow = drawn.rhythm === ColourRhythm.Flow;
165
+ return resolveColourWords({ ground: drawn.ground, dark: drawn.dark, action: drawn.action, wash: flow ? undefined : drawn.wash, flow });
157
166
  }
158
167
 
159
168
  /** CV2: the ONE design a plan is built and composed with — its design and its colour words (the build's Look step writes
160
- * these; every compose of the plan judges against them). Pure. */
161
- export function planDesignChoices(plan: Pick<SitePlan, 'mixes' | 'design'>): DesignChoices {
162
- return resolveDesignChoices({ ...JSON.parse(JSON.stringify(plan.design ?? {})), ...colourDesignWords(colourMixOfPlan(plan)) });
169
+ * these; every compose of the plan judges against them). CV5: with the kind of business's `colourNever`, the words it
170
+ * never wears are mended first (`checkColour`). Pure. */
171
+ export function planDesignChoices(plan: Pick<SitePlan, 'mixes' | 'design'>, colourNever?: ReadonlyArray<string> | null): DesignChoices {
172
+ return resolveDesignChoices({ ...JSON.parse(JSON.stringify(plan.design ?? {})), ...colourDesignWords(checkColour(colourMixOfPlan(plan), colourNever).mix) });
173
+ }
174
+
175
+ // ── The check: a mix against what the kind of business never wears, each mend said (CV5, H1) ──────────────────────────
176
+
177
+ export enum ColourRepairCode {
178
+ /** A word the kind of business never wears (harness `COLOUR_NEVER`) — mended, and said. */
179
+ Never = 'colour-never',
180
+ }
181
+
182
+ export interface ColourRepair {
183
+ code: ColourRepairCode;
184
+ ingredient: `${ColourIngredient}`;
185
+ from: string;
186
+ to: string;
187
+ said: string;
188
+ }
189
+
190
+ /** What a word the business never wears becomes: a refused rhythm stands still on one ground (the flow's own rule without
191
+ * its motion; calm, unlike alternating or flooding); any other ingredient falls to today's look. */
192
+ const NEVER_MENDS: Readonly<Partial<Record<ColourIngredient, string>>> = { [ColourIngredient.Rhythm]: ColourRhythm.OneGround };
193
+
194
+ /**
195
+ * The ONE judge of a colour mix against the kind of business (`colourNever`, `<ingredient>.<word>` — harness-core
196
+ * `BusinessType.colour.never`, given by the caller as `ComposeContext.colourNever`): each refused word is mended to
197
+ * NEVER_MENDS' word (else the default) and said. A calm type's plan asking for the flow stands still. Never throws. Pure.
198
+ */
199
+ export function checkColour(mix: ColourMix, colourNever?: ReadonlyArray<string> | null): { mix: ColourMix; repairs: ColourRepair[] } {
200
+ const never = new Set(colourNever ?? []);
201
+ if (!never.size) return { mix, repairs: [] };
202
+ const out: Record<string, string> = { ...mix };
203
+ const repairs: ColourRepair[] = [];
204
+ for (const k of ORDER) {
205
+ if (!never.has(`${k}.${out[k]}`)) continue;
206
+ const wished = NEVER_MENDS[k];
207
+ const to = wished && !never.has(`${k}.${wished}`) ? wished : C.defaults[k];
208
+ repairs.push({ code: ColourRepairCode.Never, ingredient: k, from: out[k], to,
209
+ said: `this kind of business never wears "${colourMeaning(k, out[k])}": ${colourMeaning(k, to)} instead` });
210
+ out[k] = to;
211
+ }
212
+ return { mix: out as ColourMix, repairs };
163
213
  }
164
214
 
165
215
  /** A mix on the wire: one `<ingredient>:<word>` per ingredient, in the table's order. */
@@ -206,8 +256,8 @@ export function drawnColourMix(mix: ColourMix): { drawn: ColourMix; gaps: Colour
206
256
 
207
257
  /** CV2: the colour words `checkLayout` judges, as DRAWN — spread into its context (`{ ...checkContext, ...colourCheckOf(plan) }`)
208
258
  * so the accent word's budget, the grounds cap and the rhythm read the plan's own words (else its preset's row, CV-D13). */
209
- export function colourCheckOf(plan: Pick<SitePlan, 'mixes' | 'design'>): { accent: string; rhythm: string } {
210
- const { drawn } = drawnColourMix(colourMixOfPlan(plan));
259
+ export function colourCheckOf(plan: Pick<SitePlan, 'mixes' | 'design'>, colourNever?: ReadonlyArray<string> | null): { accent: string; rhythm: string } {
260
+ const { drawn } = drawnColourMix(checkColour(colourMixOfPlan(plan), colourNever).mix);
211
261
  return { accent: drawn.accent, rhythm: drawn.rhythm };
212
262
  }
213
263
 
@@ -259,8 +309,9 @@ const groundWordOf = (s: LayoutSection): string => s.ground ?? 'ground';
259
309
 
260
310
  /**
261
311
  * A composed page's grounds judged against the colour rhythm (`COLOUR.rhythms`): each issue a `Structure` issue on the
262
- * page, so the layout request is asked again with it. `free`, `flow` (CV5: the ScrollDriver's, not a section's) and an
263
- * unknown word ask nothing. A photo ground is free in every rhythm. Pure.
312
+ * page, so the layout request is asked again with it. `free` and an unknown word ask nothing; `flow` (CV5) asks
313
+ * one-ground's rule with its own count — the sections stand on the flowing ground so it is seen, at most `darks` dark ones,
314
+ * the last before the footer (the crossfade itself is the ScrollDriver's). A photo ground is free in every rhythm. Pure.
264
315
  */
265
316
  export function colourRhythmIssues(sections: ReadonlyArray<LayoutSection>, rhythm: string | null | undefined, ctx: ColourRhythmContext): LayoutIssue[] {
266
317
  const issues: LayoutIssue[] = [];
@@ -276,11 +327,16 @@ export function colourRhythmIssues(sections: ReadonlyArray<LayoutSection>, rhyth
276
327
  }
277
328
  }
278
329
  break;
279
- case ColourRhythm.OneGround: {
330
+ case ColourRhythm.OneGround:
331
+ case ColourRhythm.Flow: {
332
+ const flow = rhythm === ColourRhythm.Flow;
333
+ const most = (flow ? R.flow?.darks : undefined) ?? R['one-ground'].darks;
280
334
  const lastShown = tones.reduce((at, t, i) => (t === GroundTone.Photo ? at : i), -1);
281
335
  darks.forEach((i, n) => {
282
- if (n >= R['one-ground'].darks || i !== lastShown) {
283
- add(`sections[${i}].ground`, `one ground for most of the page, at most ${R['one-ground'].darks} dark section before the footer — "${sections[i].id}" is dark`);
336
+ if (n >= most || i !== lastShown) {
337
+ add(`sections[${i}].ground`, flow
338
+ ? `the page's ground flows under its sections, at most ${most} dark section before the footer — "${sections[i].id}" is dark and hides the flow`
339
+ : `one ground for most of the page, at most ${most} dark section before the footer — "${sections[i].id}" is dark`);
284
340
  }
285
341
  });
286
342
  break;
@@ -1,7 +1,7 @@
1
1
  import { carryInto, swapParts, type PageCarry } from './carry';
2
2
  import {
3
3
  AnimateId, COLOR_SCHEME_TRAIT, COLOR_SCHEMES, ColorScheme, colorSchemeClass, DEFAULT_MENU_LOOK, DesignChoices, LinkType, SignatureInput, withSignatureMove, MenuLook, motionLanguageForPlan, resolveDesignChoices, setColorScheme, headerBrandOf, headerGroundOf, headerInkOf, headerShapeOf,
4
- columnWordOf, elementStyleById,
4
+ columnWordOf, designTokenRows, 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';
@@ -18,17 +18,18 @@ import {
18
18
  import { EntranceMark, EntrancePart, planEntrances } from './entrances';
19
19
  import { scrubEntranceStamps } from './text-scroll';
20
20
  import { filmOfPlan } from './film';
21
- import { checkFooter, FooterArrange, footerMixOfPlan, FooterNever, footerPattern, FooterRole, stampFooterMix } from './footer-mix';
21
+ import { checkFooter, FooterArrange, FooterContext, footerMixOfPlan, FooterNever, footerPattern, footerReferences, FooterRole, stampFooterMix } from './footer-mix';
22
+ import { FreeFooterContext, freeFooterOrMix, referenceFooterLayout } from './footer-free';
22
23
  import { planWrites, withTypeSignUp } from './footer-sign-up';
23
24
  import {
24
25
  countryLegalFacts, FOOTER_LEGAL_ROLE, FORM_LEGAL_ROLE, formAsksPersonalData, formLegalFacts, LEGAL_PAGE_SETTING, LegalContext, LegalFact, LegalFacts,
25
26
  legalFormLine, LegalKind, legalKindsFor, legalLabel, legalRoute, legalTitle, measuredCategories, siteMeasures,
26
27
  } from './legal';
27
28
  import {
28
- checkOpening, drawnOpeningMix, namedOpeningMix, OpeningContext, openingIsTypeLed, OpeningMedia, openingMix, OpeningMix, openingMixFromWords, openingMixOfPlan, openingRecipe, OpeningRole, stampOpeningMix,
29
+ checkOpening, chooseOpeningWay, drawnOpeningMix, opensFullUnderFloat, namedOpeningMix, OpeningContext, openingIsTypeLed, OpeningMedia, openingMix, OpeningMix, openingMixFromWords, openingMixOfPlan, openingMixWords, openingRecipe, OpeningRole, stampOpeningMix,
29
30
  stampOpeningMotion, TYPE_LED_OPTIONAL_PARTS, typeLedOpeningSection,
30
31
  } from './opening-mix';
31
- import { bodyWithColourBands, colourMixOfPlan, planDesignChoices } from './colour-mix';
32
+ import { bodyWithColourBands, checkColour, colourMixOfPlan, planDesignChoices } from './colour-mix';
32
33
  import { checkHeader, drawnHeaderMix, HeaderContext, headerContextOfPlan, HeaderFacts, HeaderIngredient, HeaderNever, HeaderOpening, headerMix, HeaderMix, headerRecipe, HeaderRecipe, stampHeaderMix, wornHeaderOfPlan } from './header-mix';
33
34
  import { bodyMixOfPlan, checkBody, drawnBodyMix, joinPageHeader, joinSameGround, wearBodyMix } from './body-mix';
34
35
  import { checkPopup, composePopup, POPUP_GLOBAL_ID } from './popup-plan';
@@ -137,6 +138,8 @@ export enum ComposeIssueCode {
137
138
  /** AW6: the body's mix asked for what the build cannot carry (`checkBody`: an award edge on a basic build): the
138
139
  * detail says how. */
139
140
  BodyMended = 'body-mended',
141
+ /** Colour v2 CV5 (H1): a colour word the kind of business never wears was mended (`checkColour`) — said. */
142
+ ColourMended = 'colour-mended',
140
143
  /** Popups PU3: the plan's popup words asked for what a generated popup may not be (`checkPopup`: centred, by a button
141
144
  * only, a kind the owner did not tick, a link to no page): the detail says how it was mended. */
142
145
  PopupMended = 'popup-mended',
@@ -179,6 +182,9 @@ export interface ComposeContext {
179
182
  * body never wears a torn or dripping edge (`checkBody` mends it to a wave, said). The business type is the
180
183
  * generation's (the reading), never the plan's — the caller knows it. Absent = not calm. */
181
184
  calm?: boolean;
185
+ /** Colour v2 CV5 (H1): the colour words that kind of business never wears (harness-core `BusinessType.colour.never`,
186
+ * `<ingredient>.<word>`) — mended at build (`checkColour`, `colour-mended`): a calm type's flow stands still. */
187
+ colourNever?: ReadonlyArray<string>;
182
188
  /** AW12: the kind of business (the reading's, as `calm`) — it chooses the footer's call word (`footerCallWord`). */
183
189
  businessType?: string;
184
190
  /** AW12-D10: what that kind of business's footer never wears (harness-core `BusinessType.footer`) — `checkFooter`
@@ -210,6 +216,9 @@ export interface ComposeContext {
210
216
  * come — the owner's photo, or stock where the type allows it, never against the owner's "no pictures"): the opening
211
217
  * words a Home whose plan names no opening takes (`withTypeOpening`). Absent: the Home opens as its plan writes. */
212
218
  opening?: ReadonlyArray<string>;
219
+ /** iox-ui#192: what seeds the choices a site makes for itself (the organization's id, given by `runComposeContext`) —
220
+ * the way its picture Home opens (`chooseOpeningWay`). Absent: the business name. */
221
+ seed?: string;
213
222
  }
214
223
 
215
224
  /** Where a composed layout's photos are, as the server keeps them and the screens read them (M8 gate 2): id → address. */
@@ -2078,13 +2087,15 @@ function freeShowsPicture(node: FreeNode): boolean {
2078
2087
  * When nothing fills the picture the type-led round opens the Home on its words, as every Home's (`typeLedRound`). The
2079
2088
  * same plan composes the same site, so a rebuild from a kept plan picks the picture up with no model call. Pure.
2080
2089
  */
2081
- export function withTypeOpening(plan: SitePlan, context: Pick<ComposeContext, 'opening'> | null | undefined): SitePlan {
2090
+ export function withTypeOpening(plan: SitePlan, context: Pick<ComposeContext, 'opening' | 'seed' | 'tier'> | null | undefined): SitePlan {
2082
2091
  // A picture can come only when the run says so (`context.opening`, given by `businessComposeContext`); the plan's own
2083
- // opening is then worn as chosen (the J10 free hotel and salon chose one their free Home never wore), else the type's.
2092
+ // opening is then worn as chosen (the J10 free hotel and salon chose one their free Home never wore), else the type's —
2093
+ // in the way this site opens (iox-ui#192, `chooseOpeningWay`, seeded by the organization).
2084
2094
  if (!context?.opening?.length) return plan;
2085
2095
  const own = plan.mixes?.opening?.length ? plan.mixes.opening : null;
2086
- const words = own ?? context.opening;
2096
+ let words: ReadonlyArray<string>;
2087
2097
  try {
2098
+ words = own ?? typeOpeningWords(plan, context.opening, context);
2088
2099
  if (openingMixFromWords(words).media === OpeningMedia.None) return plan;
2089
2100
  } catch { return plan; }
2090
2101
  const at = plan.pages.findIndex(p => p.isHome === true || p.route === HOME_PATH);
@@ -2106,6 +2117,15 @@ export function withTypeOpening(plan: SitePlan, context: Pick<ComposeContext, 'o
2106
2117
  return { ...plan, pages, mixes: { ...plan.mixes, opening: [...words] } };
2107
2118
  }
2108
2119
 
2120
+ /** iox-ui#192: the kind of business's opening words in the way this site opens — its frame class's ways from where the
2121
+ * seed (the organization, else the business name) starts, the first the site carries unmended. */
2122
+ function typeOpeningWords(plan: SitePlan, typeWords: ReadonlyArray<string>, context: Pick<ComposeContext, 'seed' | 'tier'>): ReadonlyArray<string> {
2123
+ // HI3-D27: on Pro, where the kind of business opens edge to edge, only the full frames carry it unmended.
2124
+ const fullFrame = opensFullUnderFloat(context.tier, typeWords);
2125
+ const site = openingContextOf({ business: plan.business, design: plan.design, tier: context.tier ?? GenerationTier.Basic, badge: null, cutOut: false, fullFrame });
2126
+ return openingMixWords(chooseOpeningWay(openingMixFromWords(typeWords), site, context.seed || plan.business.name));
2127
+ }
2128
+
2109
2129
  /** The most rounds a composition takes to wear no empty picture: the opening, then its first section, then a margin. */
2110
2130
  const TYPE_LED_ROUNDS = 4;
2111
2131
 
@@ -2122,12 +2142,15 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
2122
2142
  // AW-D42: every plan wears the look's whole motion language (a lower plan's Pro words were drawn as its own, AW-D23).
2123
2143
  // CV2: the plan's design with its colour words (`planDesignChoices`) — what the build's Look step writes; MR-D1: signed
2124
2144
  // by its kind of business (a preloader or By the scroll; a Still start lifted) — the build applies it.
2125
- const design = withSignatureMove(motionLanguageForPlan(planDesignChoices(plan)), context?.signature).design;
2145
+ const design = withSignatureMove(motionLanguageForPlan(planDesignChoices(plan, context?.colourNever)), context?.signature).design;
2146
+ // CV5 (H1): the colour words this kind of business never wears are mended at build, each said (`colour-mended`).
2147
+ const colourChecked = checkColour(colourMixOfPlan(plan), context?.colourNever);
2148
+ for (const r of colourChecked.repairs) issues.push({ code: ComposeIssueCode.ColourMended, nodeId: 'colour', owner: 'colour', detail: r.said });
2126
2149
  const locale = plan.locale ?? DEFAULT_SITE_LOCALE;
2127
2150
  const rtl = isRtlLocale(locale);
2128
2151
  // AW6: the plan's body (seams, inset cards) as the site may carry it — every mend said (`body-mended`).
2129
2152
  // CV-D9: the colour's `bands.inset` is AW6's inset card, folded into the body before it is judged.
2130
- const bodyMixAsked = bodyWithColourBands(bodyMixOfPlan(plan), colourMixOfPlan(plan));
2153
+ const bodyMixAsked = bodyWithColourBands(bodyMixOfPlan(plan), colourChecked.mix);
2131
2154
  const bodyChecked = bodyMixAsked ? checkBody(drawnBodyMix(bodyMixAsked).drawn, { calm: !!context?.calm }) : null;
2132
2155
  for (const r of bodyChecked?.repairs ?? []) issues.push({ code: ComposeIssueCode.BodyMended, nodeId: 'body', owner: 'body', detail: r.said });
2133
2156
  const body = bodyChecked?.mix ?? null;
@@ -2208,20 +2231,15 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
2208
2231
  // contract's footer parts; each mend is said.
2209
2232
  // AW12: the footer judges what it holds against the site — the tagline (a statement), the navigation's length (list-big).
2210
2233
  // AW12-D10/D15: the kind of business (the caller's reading) chooses the call word and what the footer never wears.
2211
- const footerContext = {
2212
- name: plan.business.name, design, tagline: plan.business.tagline, locale: plan.locale, pages: plan.pages.filter(p => p.inNav).length,
2213
- // FV1 `closing.email`: the owner's address, the fact the email line shows (none given, no such closing — said).
2214
- ...(plan.business.facts?.email?.trim() ? { email: plan.business.facts.email.trim() } : {}),
2215
- // FV1b `holds.social`: the owner's stated links (none: the block is left out, said).
2216
- ...(plan.business.social?.length ? { social: plan.business.social } : {}),
2217
- ...(context?.businessType ? { type: context.businessType } : {}), ...(context?.footerNever ? { never: context.footerNever } : {}),
2218
- // AW12-D13 (iox-ui#153): the build's tier — absent, Basic, as the body's — never wears an award word.
2219
- tier: context?.tier ?? GenerationTier.Basic,
2220
- // AW12-D6: a sign-up only where the site has a reason to write (a journal, events, a shop, the type, the owner's tick).
2221
- writes: planWrites(plan, context?.footerSignUp),
2222
- };
2223
- // AW12 newsletter: the kind of business's sign-up when the plan's footer asks for none — the same plan, the same footer.
2224
- const footer = checkFooter(withTypeSignUp(footerMixOfPlan(plan), { signUp: context?.footerSignUp, writes: footerContext.writes }), footerContext);
2234
+ const footerContext = planFooterContext(plan, design, context);
2235
+ // FV2 (footer-v2 §4): a footer the model laid freely stands when it keeps the hard rules, else the nearest mix footer
2236
+ // (`freeFooterOrMix`, FV-D12) — said either way; the plan's mix footer otherwise. AW12 newsletter: a mix footer takes
2237
+ // the kind of business's sign-up when the plan's footer asks for none — the same plan, the same footer; a free footer
2238
+ // places a sign-up only where the model laid one.
2239
+ const planned = plan.freeFooter ? freeFooterOrMix(plan.freeFooter, freeFooterContextOf(plan, footerContext), { rtl }) : null;
2240
+ const footer = planned
2241
+ ? { mix: planned.mix, repairs: planned.said }
2242
+ : checkFooter(withTypeSignUp(footerMixOfPlan(plan), { signUp: context?.footerSignUp, writes: footerContext.writes }), footerContext);
2225
2243
  for (const r of footer.repairs) issues.push({ code: ComposeIssueCode.FooterMended, nodeId: GlobalSlot.Footer, owner: GlobalSlot.Footer, detail: r.said });
2226
2244
  // HI1: the header is the plan's header MIX (a stored pattern id is read as one), drawn as the product draws it, checked
2227
2245
  // against the site and arranged from the contract's header parts; each mend is said.
@@ -2233,7 +2251,7 @@ function composeSiteOnce(plan: SitePlan, context: ComposeContext, pictureless: R
2233
2251
  });
2234
2252
  for (const said of header.said) issues.push({ code: ComposeIssueCode.HeaderMended, nodeId: GlobalSlot.Header, owner: GlobalSlot.Header, detail: said });
2235
2253
  const patternOf = (slot: GlobalSlot): SitePattern => slot === GlobalSlot.Footer
2236
- ? footerPattern(footer.mix, footerContext)
2254
+ ? planned?.pattern ?? footerPattern(footer.mix, footerContext)
2237
2255
  : header.recipe.pattern;
2238
2256
  const slotPatterns = Object.values(GlobalSlot).map(slot => [slot, patternOf(slot)] as const);
2239
2257
  let globals = slotPatterns.map(([slot, pattern]) => {
@@ -2526,7 +2544,20 @@ function composeLegal(plan: SitePlan, context: LegalContext, pages: ReadonlyArra
2526
2544
  // standing on the window's bottom.
2527
2545
  let endBlock: SerializedNode | null = null;
2528
2546
  if (footer) walkSerialized([footer], n => { if (!endBlock && n.role === FooterRole.EndBlock) endBlock = n; });
2529
- if (footer && row) {
2547
+ // FV2 (rule 1): a free footer said where its legal row goes — the row stands there (none to show: the place goes).
2548
+ let place: SerializedNode | null = null;
2549
+ if (footer) walkSerialized([footer], n => { if (!place && n.role === FooterRole.LegalPlace) place = n; });
2550
+ if (footer && place) {
2551
+ if (row) {
2552
+ // A centred legal slot (`align:center`) centres its row, as a centred mix footer's.
2553
+ if ((place as SerializedNode).styleProps?.['alignItems'] === 'center') row.styleProps['justifyContent'] = 'center';
2554
+ (place as SerializedNode).children = [row];
2555
+ }
2556
+ else {
2557
+ const gone = (place as SerializedNode).id;
2558
+ walkSerialized([footer], n => { if (n.children?.some(k => k.id === gone)) n.children = n.children.filter(k => k.id !== gone); });
2559
+ }
2560
+ } else if (footer && row) {
2530
2561
  if (endBlock) {
2531
2562
  row.styleProps['justifyContent'] = 'flex-end';
2532
2563
  ((endBlock as SerializedNode).children ?? ((endBlock as SerializedNode).children = [])).unshift(row);
@@ -2801,6 +2832,81 @@ export function composeSection(patternId: string, input: SectionInput, options:
2801
2832
  return { section, placeholders, issues };
2802
2833
  }
2803
2834
 
2835
+ /** What a ready-made footer is composed for (FV2): the studio's business, pages, language and look, its kind of business and
2836
+ * the year its © line says. */
2837
+ export interface FooterInput extends SectionInput {
2838
+ readonly design: DesignChoices;
2839
+ /** The kind of business (harness): its call words, and what its footer never wears. */
2840
+ readonly businessType?: string;
2841
+ readonly footerNever?: FooterNever | null;
2842
+ readonly year?: number;
2843
+ }
2844
+
2845
+ /**
2846
+ * THE site a plan's footer is judged and stamped against (`FooterContext`): its name, look, line, language, how many pages
2847
+ * its navigation lists, the owner's email and links (FV1/FV1b), the kind of business and what its footer never wears
2848
+ * (AW12-D10/D15), the build's tier — absent, Basic (AW12-D13) — and whether the site has a reason to write (AW12-D6). ONE
2849
+ * reading, shared by `composeSite` and the free request that asks for the footer (iox-cms: the brief's offers and the
2850
+ * judge), so a footer that passed at the request is judged the same at the build. Pure.
2851
+ */
2852
+ export function planFooterContext(plan: SitePlan, design: DesignChoices,
2853
+ context?: Pick<ComposeContext, 'businessType' | 'footerNever' | 'tier' | 'footerSignUp'> | null): FooterContext & { tier: `${GenerationTier}`; writes: boolean } {
2854
+ return {
2855
+ name: plan.business.name, design, tagline: plan.business.tagline, locale: plan.locale, pages: plan.pages.filter(p => p.inNav).length,
2856
+ // FV1 `closing.email`: the owner's address, the fact the email line shows (none given, no such closing — said).
2857
+ ...(plan.business.facts?.email?.trim() ? { email: plan.business.facts.email.trim() } : {}),
2858
+ // FV1b `holds.social`: the owner's stated links (none: the block is left out, said).
2859
+ ...(plan.business.social?.length ? { social: plan.business.social } : {}),
2860
+ ...(context?.businessType ? { type: context.businessType } : {}), ...(context?.footerNever ? { never: context.footerNever } : {}),
2861
+ // AW12-D13 (iox-ui#153): the build's tier — absent, Basic, as the body's — never wears an award word.
2862
+ tier: context?.tier ?? GenerationTier.Basic,
2863
+ // AW12-D6: a sign-up only where the site has a reason to write (a journal, events, a shop, the type, the owner's tick).
2864
+ writes: planWrites(plan, context?.footerSignUp),
2865
+ };
2866
+ }
2867
+
2868
+ /** FV2: what a FREE footer is judged by beyond the mix footer's site — the owner's facts (rule 3: a facts block shows only
2869
+ * the lines given) and the look's token rows a style may name. Pure. */
2870
+ export function freeFooterContextOf(plan: SitePlan, footer: FooterContext): FreeFooterContext {
2871
+ return { ...footer, facts: plan.business.facts ?? {}, tokens: designTokenRows(footer.design) };
2872
+ }
2873
+
2874
+ /**
2875
+ * FV2 (FV-D6, R-H-FV5): one of the references' footers (`FOOTER.references[].layout`) composed for a studio — the builder's
2876
+ * ready-made footers. THE SAME decision and stamp as `composeSite`'s free footer (`freeFooterOrMix` → `composePattern` →
2877
+ * `stampFooterMix`), so the palette and a build stamp the same tree for the same layout; only the legal row is composeSite's
2878
+ * (it knows the site's legal pages): here the legal place stays empty for the host to fill. Pure.
2879
+ */
2880
+ export function composeReferenceFooter(referenceId: string, input: FooterInput, options: Partial<SectionOptions> = {}): ComposedSection & { said: string[] } {
2881
+ const reference = footerReferences().find(r => r.id === referenceId);
2882
+ const layout = referenceFooterLayout(reference?.layout);
2883
+ if (!layout) throw new ComposeError(`no footer reference "${referenceId}" with a layout`);
2884
+ const id = options.id ?? GlobalSlot.Footer;
2885
+ const business: SiteBusiness = input.business ?? { name: '' } as SiteBusiness;
2886
+ const pages = navPagePlans(input.pages ?? []);
2887
+ const plan = { business, pages, dataSources: [], contentTypes: [], ...(input.locale ? { locale: input.locale } : {}) } as unknown as SitePlan;
2888
+ const email = nonEmpty(business.facts?.email) ? business.facts!.email!.trim() : null;
2889
+ const placeholders: ComposedPlaceholder[] = [];
2890
+ const issues: ComposeIssue[] = [];
2891
+ const design = resolveDesignChoices(JSON.parse(JSON.stringify(input.design)));
2892
+ const planned = freeFooterOrMix(layout, {
2893
+ name: business.name, design, tagline: business.tagline, locale: input.locale, pages: pages.filter(p => p.inNav).length,
2894
+ ...(email ? { email } : {}), ...(business.social?.length ? { social: business.social } : {}),
2895
+ ...(input.businessType ? { type: input.businessType } : {}), ...(input.footerNever ? { never: input.footerNever } : {}),
2896
+ tier: GenerationTier.Basic, facts: business.facts ?? {}, tokens: designTokenRows(design),
2897
+ }, { rtl: isRtlLocale(input.locale) });
2898
+ const ctx: Ctx = {
2899
+ owner: id, page: null, section: null, plan, year: input.year ?? 0, email, navPage: null, nextAlias: null,
2900
+ placeholders, issues, routes: new Set(pages.map(p => p.route)),
2901
+ };
2902
+ const section = composePattern(planned.pattern, id, ctx);
2903
+ section.isGlobal = true;
2904
+ section.globalPosition = planned.pattern.global;
2905
+ stampFooterMix(section as unknown as { props: Record<string, unknown>; styleProps?: Record<string, unknown> }, planned.mix);
2906
+ if (isRtlLocale(input.locale)) section.styleProps = { ...(section.styleProps ?? {}), textDirection: 'rtl' };
2907
+ return { section, placeholders, issues, said: planned.said.map(r => r.said) };
2908
+ }
2909
+
2804
2910
  /** iox-ui#112: a type's own placeholder words (its builder baseline — "Enter text here", "Heading", an Image's "Image", a
2805
2911
  * submit button's "Sending…") on a Hebrew page, where a fresh section's empty slot shows them until the author writes it. */
2806
2912
  export const BASELINE_WORDS_HE: Readonly<Record<string, Readonly<Record<string, string>>>> = {
@@ -2879,7 +2985,10 @@ function wearPlanOpening(
2879
2985
  const tier = context.tier ?? GenerationTier.Basic;
2880
2986
  // J10 lever (b): a build never holds the owner's clip for the opening (their film plays in a Scene, SC6b) — a film
2881
2987
  // opening is drawn as a picture the owner's photo, a made picture or stock can fill (`checkOpening`, said).
2882
- 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 };
2988
+ // HI3-D27: a Pro site whose kind of business opens edge to edge opens full under its floating header — the plan's own
2989
+ // inset or settling frame too (`checkOpening`, said).
2990
+ const fullFrame = opensFullUnderFloat(tier, context.opening);
2991
+ 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, fullFrame };
2883
2992
  // iox-ui#180: with no opening chosen, a first section that IS a named opening (`hero.full-bleed-media` = a film) is
2884
2993
  // judged as that opening — when the judge mends it (no clip: a picture) it is worn mended; else it stays as it is.
2885
2994
  const mix = openingMixOfPlan(plan) ?? (replace ? openingTheJudgeMends(first, source, openingContextOf({ ...site, business: plan.business })) : null);
@@ -2969,6 +3078,8 @@ export interface OpeningInput extends SectionInput {
2969
3078
  readonly film?: boolean;
2970
3079
  /** AW-D23: the tier the site is built at; absent = every word (the builder shows the Pro marks itself). */
2971
3080
  readonly tier?: OpeningContext['tier'];
3081
+ /** HI3-D27: the picture frame stands full under a Pro floating header (`opensFullUnderFloat`); absent = any frame. */
3082
+ readonly fullFrame?: boolean;
2972
3083
  /** Draw the mix as asked, never mended — the Opening studio (it ADVISES the check's mends, OB-2). */
2973
3084
  readonly asAsked?: boolean;
2974
3085
  /** #129: a type-led first screen's words, slot by slot, from the hero it takes the place of (`typeLedOpeningSection`).
@@ -2983,7 +3094,7 @@ export interface ComposedOpening extends ComposedSection {
2983
3094
  }
2984
3095
 
2985
3096
  /** The context an opening is judged and measured in — the same for the check, the recipe and the studio's advice. */
2986
- export function openingContextOf(input: Pick<OpeningInput, 'business' | 'design' | 'badge' | 'cutOut' | 'film' | 'tier'>): OpeningContext {
3097
+ export function openingContextOf(input: Pick<OpeningInput, 'business' | 'design' | 'badge' | 'cutOut' | 'film' | 'tier' | 'fullFrame'>): OpeningContext {
2987
3098
  return {
2988
3099
  name: input.business?.name ?? '',
2989
3100
  design: resolveDesignChoices(JSON.parse(JSON.stringify(input.design ?? {}))),
@@ -2991,6 +3102,7 @@ export function openingContextOf(input: Pick<OpeningInput, 'business' | 'design'
2991
3102
  ...(input.cutOut !== undefined ? { cutOut: input.cutOut } : {}),
2992
3103
  ...(input.film !== undefined ? { film: input.film } : {}),
2993
3104
  ...(input.badge !== undefined ? { badge: input.badge } : {}),
3105
+ ...(input.fullFrame ? { fullFrame: true } : {}),
2994
3106
  };
2995
3107
  }
2996
3108
 
@@ -1,7 +1,7 @@
1
1
  import { LayoutPage, LayoutSection, LayoutSectionKind } from './layout-language';
2
2
  import { FingerprintedPage, fingerprintOf, LAYOUT_READY_MADE_TOKEN, LayoutFingerprint, wornOpenings } from './layout-fingerprint';
3
3
  import { footerMixOfPlan } from './footer-mix';
4
- import { wornHeaderOfPlan } from './header-mix';
4
+ import { HeaderFacts, wornHeaderOfPlan } from './header-mix';
5
5
  import { PatternNode, patternById, patternNeedsBinding, patternNodes, SITE_LIBRARY, SitePattern } from './patterns';
6
6
  import { PagePlan, PageSectionPlan } from './site-plan.model';
7
7
 
@@ -35,14 +35,17 @@ function readyMadePage(sections: ReadonlyArray<Pick<PageSectionPlan, 'pattern'>>
35
35
  * (`ready-made:hero.split`), its sequence is its patterns in order, its signature holds the screen (a ready-made page has
36
36
  * no signature section). The rest — ground, preset, header, footer — as `fingerprintOf`.
37
37
  */
38
- export function fallbackFingerprintOf(sections: ReadonlyArray<Pick<PageSectionPlan, 'pattern'>>, preset: string, mode: 'light' | 'dark', plan?: Parameters<typeof wornHeaderOfPlan>[0] & Parameters<typeof footerMixOfPlan>[0]): LayoutFingerprint {
39
- const base = fingerprintOf(readyMadePage(sections), preset, mode, plan ? wornHeaderOfPlan(plan).mix : undefined, plan ? footerMixOfPlan(plan) : undefined);
38
+ export function fallbackFingerprintOf(sections: ReadonlyArray<Pick<PageSectionPlan, 'pattern'>>, preset: string, mode: 'light' | 'dark', plan?: Parameters<typeof wornHeaderOfPlan>[0] & Parameters<typeof footerMixOfPlan>[0],
39
+ facts: Pick<HeaderFacts, 'tier'> = {}): LayoutFingerprint {
40
+ // HI-D Pro: at the generation's tier (`facts.tier`) — a Pro site is remembered wearing its floating header.
41
+ const base = fingerprintOf(readyMadePage(sections), preset, mode, plan ? wornHeaderOfPlan(plan, facts).mix : undefined, plan ? footerMixOfPlan(plan) : undefined);
40
42
  return { ...base, sequence: sections.map(s => readyMadeToken(s.pattern)) };
41
43
  }
42
44
 
43
45
  /** A plan page built from its sections (it fell back whole, or was never asked) — the ONE call a reader of a plan makes. */
44
- export function fallbackFingerprintOfPlanPage(page: Pick<PagePlan, 'sections'>, preset: string, mode: 'light' | 'dark', plan: Parameters<typeof wornHeaderOfPlan>[0] & Parameters<typeof footerMixOfPlan>[0]): LayoutFingerprint {
45
- return fallbackFingerprintOf(page.sections, preset, mode, plan);
46
+ export function fallbackFingerprintOfPlanPage(page: Pick<PagePlan, 'sections'>, preset: string, mode: 'light' | 'dark', plan: Parameters<typeof wornHeaderOfPlan>[0] & Parameters<typeof footerMixOfPlan>[0],
47
+ facts: Pick<HeaderFacts, 'tier'> = {}): LayoutFingerprint {
48
+ return fallbackFingerprintOf(page.sections, preset, mode, plan, facts);
46
49
  }
47
50
 
48
51
  /** What a slot is, by the element style its node wears (`display`, `lead`, `button-primary`…), else its type. */