@vectoriox/iox-ui 5.197.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 (47) hide show
  1. package/composite-core/index.d.ts +16 -2
  2. package/design-core/index.d.ts +160 -28
  3. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +34 -2
  4. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  5. package/fesm2022/vectoriox-iox-ui-design-core.mjs +259 -72
  6. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1845 -396
  8. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui.mjs +2 -2
  10. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  11. package/generation-core/index.d.ts +1286 -184
  12. package/package.json +1 -1
  13. package/src/composite-core/header.ts +34 -1
  14. package/src/design-core/brand.ts +58 -5
  15. package/src/design-core/contrast-audit.ts +49 -22
  16. package/src/design-core/design-apply.ts +34 -3
  17. package/src/design-core/flavor-fixtures.generated.ts +123 -123
  18. package/src/design-core/flavor-spec.generated.ts +44 -4
  19. package/src/design-core/flavor-tokens.ts +1 -1
  20. package/src/design-core/header-behaviour.ts +72 -13
  21. package/src/design-core/motion-language.ts +5 -14
  22. package/src/design-core/preloader.ts +4 -5
  23. package/src/generation-core/body-mix.ts +40 -102
  24. package/src/generation-core/check-free.ts +5 -2
  25. package/src/generation-core/check-layout.ts +10 -4
  26. package/src/generation-core/check-list.ts +3 -25
  27. package/src/generation-core/colour-mix.ts +296 -0
  28. package/src/generation-core/compose-free.ts +40 -18
  29. package/src/generation-core/compose-site.ts +92 -13
  30. package/src/generation-core/footer-mix.ts +102 -54
  31. package/src/generation-core/free-fallback.ts +6 -4
  32. package/src/generation-core/free-parts.ts +87 -0
  33. package/src/generation-core/free-slot-words.ts +30 -0
  34. package/src/generation-core/generation-tier.ts +6 -17
  35. package/src/generation-core/header-mix.ts +42 -1
  36. package/src/generation-core/layout-drawers.ts +3 -2
  37. package/src/generation-core/layout-wire.ts +10 -16
  38. package/src/generation-core/list-panel.ts +3 -3
  39. package/src/generation-core/list-table.ts +5 -14
  40. package/src/generation-core/list-words.ts +2 -1
  41. package/src/generation-core/opening-mix.ts +7 -34
  42. package/src/generation-core/part-tier.ts +14 -0
  43. package/src/generation-core/plan-wire.ts +31 -43
  44. package/src/generation-core/public-api.ts +2 -0
  45. package/src/generation-core/site-spec.generated.ts +1127 -93
  46. package/src/generation-core/validate-site-plan.ts +4 -5
  47. package/styles/iox-design.css +137 -3
@@ -4099,6 +4099,7 @@ export const SPEC_SCHEMES = {
4099
4099
  "section-bg": "{{accent}}",
4100
4100
  "bg": "{{accent}}",
4101
4101
  "nav-bg": "{{accent}}",
4102
+ "nav-glass-bg": "{{accent}}",
4102
4103
  "surface": "{{accent-hover}}",
4103
4104
  "surface-2": "{{accent-hover}}",
4104
4105
  "surface-glass": "{{accent-hover}}",
@@ -4126,6 +4127,7 @@ export const SPEC_SCHEMES = {
4126
4127
  "section-bg": "{{text-muted}}",
4127
4128
  "bg": "{{text-muted}}",
4128
4129
  "nav-bg": "{{text-muted}}",
4130
+ "nav-glass-bg": "{{text-muted}}",
4129
4131
  "surface": "{{text-muted}}",
4130
4132
  "surface-2": "{{text-muted}}",
4131
4133
  "surface-glass": "{{text-muted}}",
@@ -6219,11 +6221,33 @@ export const SPEC_CONTRAST_AUDIT = {
6219
6221
  "floatingGrounds": [
6220
6222
  {
6221
6223
  "ground": "nav-bg",
6222
- "ink": "text"
6224
+ "ink": "text",
6225
+ "scope": "header"
6226
+ },
6227
+ {
6228
+ "ground": "nav-bg",
6229
+ "ink": "link-color",
6230
+ "scope": "header"
6231
+ },
6232
+ {
6233
+ "ground": "nav-bg",
6234
+ "ink": "link-current-color",
6235
+ "scope": "header"
6223
6236
  },
6224
6237
  {
6225
6238
  "ground": "nav-glass-bg",
6226
- "ink": "text"
6239
+ "ink": "text",
6240
+ "scope": "header"
6241
+ },
6242
+ {
6243
+ "ground": "nav-glass-bg",
6244
+ "ink": "link-color",
6245
+ "scope": "header"
6246
+ },
6247
+ {
6248
+ "ground": "nav-glass-bg",
6249
+ "ink": "link-current-color",
6250
+ "scope": "header"
6227
6251
  },
6228
6252
  {
6229
6253
  "ground": "dialog-bg",
@@ -6236,8 +6260,24 @@ export const SPEC_CONTRAST_AUDIT = {
6236
6260
  {
6237
6261
  "ground": "surface-glass-strong",
6238
6262
  "ink": "text"
6263
+ },
6264
+ {
6265
+ "ground": "tabbar-bg",
6266
+ "ink": "tabbar-item-ink"
6239
6267
  }
6240
- ]
6268
+ ],
6269
+ "headerInkScope": {
6270
+ "selectors": [
6271
+ ".iox-es-nav > *",
6272
+ "[data-iox-header] > *"
6273
+ ],
6274
+ "set": {
6275
+ "link-color": "currentColor",
6276
+ "link-current-color": "currentColor",
6277
+ "link-hover-color": "var(--iox-accent-text)",
6278
+ "button-ghost-ink": "currentColor"
6279
+ }
6280
+ }
6241
6281
  } as const;
6242
6282
 
6243
6283
  export const SPEC_LEGACY_ALIASES = {
@@ -15582,7 +15622,7 @@ export const SPEC_FLAVOR_PACKS = [
15582
15622
  "tier": "component",
15583
15623
  "type": "color",
15584
15624
  "group": "components",
15585
- "value": "var(--iox-surface-glass-strong)",
15625
+ "value": "color-mix(in srgb, var(--iox-surface) 92%, transparent)",
15586
15626
  "overridden": true
15587
15627
  },
15588
15628
  {
@@ -148,7 +148,7 @@ export function legacyFlavorTokens(pack: FlavorPackV2, choices: DesignChoices):
148
148
  else delete row.values;
149
149
  }
150
150
  if (choices.seed && choices.seed.toLowerCase() !== pack.seed.toLowerCase()) {
151
- for (const accent of deriveAccentTokens(choices.seed, preTintAccentGrounds(pack.palette))) {
151
+ for (const accent of deriveAccentTokens(choices.seed, preTintAccentGrounds(pack.palette), {}, { keepSeed: false })) {
152
152
  const row = byName.get(accent.name);
153
153
  if (!row) continue;
154
154
  row.value = accent.value;
@@ -39,6 +39,10 @@ export enum HeaderTrait {
39
39
  /** HI3 slice 1 (HI3-D1): what the header stands on — `glass` | `over` | `over-glass`. Absent / `solid`: its own ground,
40
40
  * as before. Written by the Header studio ▸ Around the bar and the composer (`ground:<word>`). */
41
41
  Ground = 'headerGround',
42
+ /** HI3 slice 2 (HI3-D16/D18): its outline — `pill` | `islands`. Absent / `bar`: a full-width bar, as before. */
43
+ Shape = 'headerShape',
44
+ /** HI3 slice 2 (HI3-D21/D22): how its name sits — `hangs` | `later`. Absent / `fits`: the name fits the bar. */
45
+ Brand = 'headerBrand',
42
46
  }
43
47
 
44
48
  /** Whose colours the header wears (contract HEADER `ink`): the page's opening, or every section as it passes under it. */
@@ -61,6 +65,11 @@ export enum HeaderAttribute {
61
65
  * CSS draws the ground on ONE `::before` faded by opacity, gives the bar's height back over a pictured opening and
62
66
  * lays the veil under its words at rest. Absent: the bar's own ground, as before. */
63
67
  Ground = 'data-iox-header-ground',
68
+ /** `pill` | `islands` on a header that floats (HI3 slice 2): the shared CSS draws its ground as one inset bar, or one
69
+ * pill per part, from the top. Absent: a full-width bar. */
70
+ Shape = 'data-iox-header-shape',
71
+ /** `hangs` | `later` (HI3 slice 2): a logo taller than the bar, or a name that arrives once the page moves. */
72
+ Brand = 'data-iox-header-brand',
64
73
  }
65
74
 
66
75
  /** What a composed header gets (the `nav.*` patterns' `header`, the palette's Navigation bar). */
@@ -93,19 +102,67 @@ export function headerInkOf(value: unknown): HeaderInk {
93
102
  }
94
103
 
95
104
  /** 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> {
105
+ * glass draws no scroll edge (HI3-D9: its set carries its own hairline and shadow), whatever edge it stores; nor does a
106
+ * floating one (HI3-D20: a pill has no edge under it). A floating header on `over` floats on the look's glass from the
107
+ * top (HI3-D17: never a clear pill), so it writes `over-glass`. */
108
+ export function headerAttributes(behaviour: unknown, edge: unknown, ink?: unknown, ground?: unknown, shape?: unknown, brand?: unknown): Record<string, string> {
98
109
  const out: Record<string, string> = {};
99
110
  if (headerInkOf(ink) === HeaderInk.Follows) out[HeaderAttribute.Ink] = HeaderInk.Follows;
100
111
  const b = headerBehaviourOf(behaviour);
101
112
  if (b !== HeaderBehaviour.Scrolls) out[HeaderAttribute.Behaviour] = b;
102
- const g = headerGroundOf(ground);
103
- if (g !== HeaderGround.Solid) out[HeaderAttribute.Ground] = g;
113
+ const sh = headerShapeOf(shape);
114
+ const floats = sh !== HeaderShape.Bar;
115
+ const stood = headerGroundOf(ground);
116
+ const g = floats && stood === HeaderGround.Over ? HeaderGround.OverGlass : stood;
117
+ // A floating header always draws its ground on the ground layer — a solid one too (`solid`: the look's own bar).
118
+ if (g !== HeaderGround.Solid || floats) out[HeaderAttribute.Ground] = g;
119
+ if (floats) out[HeaderAttribute.Shape] = sh;
120
+ const br = headerBrandOf(brand);
121
+ if (br !== HeaderBrand.Fits) out[HeaderAttribute.Brand] = br;
104
122
  const e = headerEdgeOf(edge);
105
- if (e && !headerGroundIsGlass(g)) out[HeaderAttribute.Edge] = e;
123
+ if (e && !headerGroundIsGlass(g) && !floats) out[HeaderAttribute.Edge] = e;
106
124
  return out;
107
125
  }
108
126
 
127
+ // ── Its outline and its name (HI3 slice 2: pill · islands · hangs · later, board hi3-shapes) ──────────────────────────
128
+
129
+ /** The header's outline (contract HEADER `shape`). */
130
+ export enum HeaderShape {
131
+ /** A full-width bar (every header before HI3 slice 2). */
132
+ Bar = 'bar',
133
+ /** One floating bar inset from the window, as wide as the content column, its corner the look's button corner. */
134
+ Pill = 'pill',
135
+ /** Each part of the bar (the name, the pages, the action) a floating pill of its own. */
136
+ Islands = 'islands',
137
+ }
138
+
139
+ /** How the header's name sits (contract HEADER `brand`). */
140
+ export enum HeaderBrand {
141
+ Fits = 'fits',
142
+ /** A logo picture taller than the bar, breaking its lower edge (only with a logo picture). */
143
+ Hangs = 'hangs',
144
+ /** No name at the top of the opening (which names the business); it arrives once the page moves or a menu opens. */
145
+ Later = 'later',
146
+ }
147
+
148
+ const SHAPES = new Set<string>(Object.values(HeaderShape));
149
+ const BRANDS = new Set<string>(Object.values(HeaderBrand));
150
+
151
+ /** A stored shape, or Bar for anything else. */
152
+ export function headerShapeOf(value: unknown): HeaderShape {
153
+ return typeof value === 'string' && SHAPES.has(value) ? value as HeaderShape : HeaderShape.Bar;
154
+ }
155
+
156
+ /** A stored brand, or Fits for anything else. */
157
+ export function headerBrandOf(value: unknown): HeaderBrand {
158
+ return typeof value === 'string' && BRANDS.has(value) ? value as HeaderBrand : HeaderBrand.Fits;
159
+ }
160
+
161
+ /** True for a shape that floats (pill, islands): its ground shows from the top, and it has no scroll edge. */
162
+ export function headerShapeFloats(shape: unknown): boolean {
163
+ return headerShapeOf(shape) !== HeaderShape.Bar;
164
+ }
165
+
109
166
  // ── What the header stands on (HI3 slice 1: over · over-glass · glass) ───────────────────────────────────────────────
110
167
 
111
168
  /**
@@ -223,15 +280,16 @@ export interface HeaderMoment {
223
280
  * shared CSS draws it through `HEADER_AT_REST_SELECTOR` (held equal to this by header-behaviour.spec), the canvas's
224
281
  * "At the top · Scrolled" pair asks it. Pure.
225
282
  */
226
- export function headerFirm(ground: unknown, moment: HeaderMoment = {}): boolean {
227
- if (!headerGroundIsOver(ground)) return true;
283
+ export function headerFirm(ground: unknown, moment: HeaderMoment = {}, shape?: unknown): boolean {
284
+ // HI3-D17: a floating shape wears its ground from the top — never a clear pill over the picture.
285
+ if (!headerGroundIsOver(ground) || headerShapeFloats(shape)) return true;
228
286
  return !(moment.openingMedia === OpeningMediaKind.Picture && !moment.scrolled && !moment.menuOpen);
229
287
  }
230
288
 
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;
289
+ /** Whether the header gives its height back to the page (HI3-D7): it does not stand on its own solid ground (or it floats,
290
+ * HI3-D17), over a page that opens on a picture — the picture starts at the top of the page, under the bar. */
291
+ export function headerGivesBack(ground: unknown, openingMedia: unknown, shape?: unknown): boolean {
292
+ return (headerGroundOf(ground) !== HeaderGround.Solid || headerShapeFloats(shape)) && openingMedia === OpeningMediaKind.Picture;
235
293
  }
236
294
 
237
295
  /** The Page scrolled state's attribute (main entry `SCROLLED_ATTRIBUTE`; spelled here — design-core reads no Angular
@@ -255,10 +313,11 @@ const onPicture = `:is([${OPENING_MEDIA_ATTRIBUTE}="${OpeningMediaKind.Picture}"
255
313
 
256
314
  /**
257
315
  * 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.
316
+ * ground on a header that does not float (HI3-D17), inside a page that opens on a picture, not inside a scrolled page,
317
+ * holding no open menu.
259
318
  */
260
319
  export const HEADER_AT_REST_SELECTOR =
261
- `${groundIs(OVER_GROUNDS)}${onPicture}:not([${HEADER_SCROLLED_ATTRIBUTE}] *):not(:has(${HEADER_OPEN_MENU_SELECTOR}))`;
320
+ `${groundIs(OVER_GROUNDS)}:not([${HeaderAttribute.Shape}])${onPicture}:not([${HEADER_SCROLLED_ATTRIBUTE}] *):not(:has(${HEADER_OPEN_MENU_SELECTOR}))`;
262
321
 
263
322
  /** The header that gives its height back (`headerGivesBack`'s twin): any ground word, inside a page that opens on a picture. */
264
323
  export const HEADER_GIVES_BACK_SELECTOR = `[${HeaderAttribute.Ground}]${onPicture}`;
@@ -54,7 +54,6 @@ const LEAVE_FOR = L.leaveFor as Readonly<Record<ArriveId, LeaveId>>;
54
54
  * the first-visit preloader (AW5), By the scroll (AW10). */
55
55
  export type MotionWordKind = 'arrive' | 'leave' | 'move' | 'cover' | 'preloader' | 'scrub';
56
56
  const TIERS = L.tiers as Readonly<Record<MotionWordKind, Readonly<Record<string, `${MotionWordTier}`>>>>;
57
- const PLAN_FALLBACK = L.planFallback as Readonly<{ arrive: ArriveId; move: MoveId; cover: string; preloader: string; scrub: string }>;
58
57
 
59
58
  /** A style preset's own language (its Feel, Headings arrive and first-visit preloader with its exit) — undefined for an
60
59
  * unknown id. */
@@ -92,20 +91,12 @@ export function motionCurve(word: ArriveId | LeaveId, tokenValue: (name: string)
92
91
  }
93
92
 
94
93
  /**
95
- * What a lower plan wears of a language (AW-D23, MB-D6): a Pro word is drawn as the plan's own (the contract's
96
- * `planFallback`) — Feel today's arrival, a Pro move a fade, a Pro cover (AW4) a fade between pages, a preloader (AW5)
97
- * none, By the scroll (AW10) never. Applied where a look is CHOSEN (a Look pick, a build); a built site keeps its words.
94
+ * What a plan wears of a language: since AW-D42 (Doron, 2026-11-28 — the award parts are every tier's) EVERY plan wears
95
+ * the whole language — a Pro Feel, move, cover (AW4), preloader (AW5) and By the scroll (AW10) included. It once drew a
96
+ * lower plan's Pro words as the contract's `planFallback` (AW-D23, MB-D6); `pro` is kept so its callers still read.
98
97
  */
99
- export function motionLanguageForPlan<T extends Pick<DesignChoices, 'feel' | 'headings'> & { between?: DesignChoices['between']; preloader?: DesignChoices['preloader']; scrub?: DesignChoices['scrub'] }>(choices: T, pro: boolean): T {
100
- if (pro) return choices;
101
- const proWord = (kind: MotionWordKind, word: unknown) => typeof word === 'string' && motionWordTier(kind, word) === MotionWordTier.Pro;
102
- const feel = isArriveId(choices.feel) && proWord('arrive', choices.feel) ? PLAN_FALLBACK.arrive : choices.feel;
103
- const headings = isMoveId(choices.headings) && proWord('move', choices.headings) ? PLAN_FALLBACK.move : choices.headings;
104
- const out = { ...choices, feel, headings };
105
- if (proWord('cover', choices.between)) out.between = PLAN_FALLBACK.cover as DesignChoices['between'];
106
- if (proWord('preloader', choices.preloader)) out.preloader = PLAN_FALLBACK.preloader;
107
- if (proWord('scrub', choices.scrub)) out.scrub = PLAN_FALLBACK.scrub;
108
- return out;
98
+ export function motionLanguageForPlan<T extends Pick<DesignChoices, 'feel' | 'headings'> & { between?: DesignChoices['between']; preloader?: DesignChoices['preloader']; scrub?: DesignChoices['scrub'] }>(choices: T, _pro?: boolean): T {
99
+ return choices;
109
100
  }
110
101
 
111
102
  /** The reduced-motion floor (AW-D6): an entrance is a fade this long at most — gentler, never zero. */
@@ -1,5 +1,5 @@
1
1
  import { SPEC_MOTION_LANGUAGE } from './flavor-spec.generated';
2
- import { MotionWordTier, motionWordTier, presetMotionLanguage } from './motion-language';
2
+ import { presetMotionLanguage } from './motion-language';
3
3
  import { graphemes } from './graphemes';
4
4
 
5
5
  /**
@@ -74,9 +74,9 @@ export interface PreloaderInput {
74
74
  readonly animate: string | null | undefined;
75
75
  /** The style preset the look came from — its exit (`MOTION.presets`); absent or exit-less → Fade. */
76
76
  readonly presetId?: string | null;
77
- /** The studio's plan carries the Pro words (`GenerationTier.Award`). A built site keeps its word (AW-D23): pass true
78
- * for a stored design — the clamp happens where a look is CHOSEN (`motionLanguageForPlan`). */
79
- readonly pro: boolean;
77
+ /** The studio's plan carries the Pro words. Since AW-D42 every plan opens on its preloader; optional, kept so its
78
+ * callers still read. */
79
+ readonly pro?: boolean;
80
80
  /** The visitor asked for reduced motion. */
81
81
  readonly reducedMotion: boolean;
82
82
  /** This is the session's first page in this tab, not reached from another page of the site (`isFirstVisit`). */
@@ -89,7 +89,6 @@ export function planPreloader(input: PreloaderInput): PreloaderPlan | null {
89
89
  if (!isPreloaderKind(kind) || kind === PreloaderKind.None) return null;
90
90
  if (input.reducedMotion || !input.firstVisit) return null;
91
91
  if (!PRELOADER_LEVELS.includes(String(input.animate ?? ''))) return null;
92
- if (!input.pro && motionWordTier('preloader', kind) === MotionWordTier.Pro) return null;
93
92
  return { kind: kind as PreloaderPlan['kind'], exit: preloaderExitOf(input.presetId), capMs: PRELOADER_CAP_MS };
94
93
  }
95
94
 
@@ -1,4 +1,5 @@
1
1
  import { GenerationTier } from './site-plan.model';
2
+ import { tierOffers } from './part-tier';
2
3
  import { LayoutIssue, LayoutIssueCode, LayoutLayer, LayoutLayerKind, LayoutSection, LayoutSectionKind } from './layout-language';
3
4
  import { SPEC_SITE_LAYOUT } from './site-spec.generated';
4
5
  import { colorSchemeOf, planSectionShape, SECTION_EDGE_TYPES, sectionShapeOf, sectionEdgeClass, SectionShape, setSectionEdge, setSectionShape } from '@vectoriox/iox-ui/design-core';
@@ -6,12 +7,13 @@ import { patternById } from './patterns';
6
7
  import { SerializedNode, walkSerialized } from './serialized-node';
7
8
 
8
9
  /**
9
- * THE BODY (award-ingredients-plan §3.4, AW6; board award-body): how a site's sections meet (the seam), how their grounds
10
- * follow one another (the rhythm), the texture laid on a ground (AW7) and the extra kinds of section a site may hold. Every
11
- * word, its meaning in both languages, whether the product draws it, its tier, each seam's geometry and each rhythm's rule
12
- * live in ONE table, the contract's `site.layout.body` (layout.mjs `BODY`). This module reads it, mends a mix the site
13
- * cannot carry (`checkBody`) and judges a composed page's grounds against its rhythm (`rhythmIssues`, run by
14
- * `checkLayout`). Pure.
10
+ * THE BODY (award-ingredients-plan §3.4, AW6; board award-body): how a site's sections meet (the seam), the page's pace
11
+ * (a picture section, then a quiet one), the texture laid on a ground (AW7) and the extra kinds of section a site may hold.
12
+ * Every word, its meaning in both languages, whether the product draws it, its tier, each seam's geometry and each pace's
13
+ * rule live in ONE table, the contract's `site.layout.body` (layout.mjs `BODY`). This module reads it, mends a mix the site
14
+ * cannot carry (`checkBody`) and judges a composed page against its pace (`paceIssues`, run by `checkLayout`). Pure.
15
+ * Colour v2 CV-D6: how the grounds follow one another (the rhythm) moved to the COLOUR table (`colour-mix.ts`).
16
+ * A stored award plan may still carry `rhythm:free` in its body words: it is read as nothing (`LEGACY_BODY_INGREDIENTS`).
15
17
  *
16
18
  * A seam is PAINTED, never laid out (`rules.seamPaintsOnly`): the LOWER section's ground rises into the one above it as a
17
19
  * shape `depth` px tall, under the words; the upper section keeps its words clear of it (`rules.seamKeepsClear`). `rounded`
@@ -36,12 +38,9 @@ interface BodyTable {
36
38
  meanings: Readonly<Record<string, string>>;
37
39
  meaningsHe?: Readonly<Record<string, string>>;
38
40
  seams: Readonly<Record<string, BodySeamGeometry>>;
39
- rhythms: {
41
+ paces: {
40
42
  free: Record<string, never>;
41
- alternate: { neighbours: 'differ' };
42
43
  'loud-quiet': { pairs: number; quietCols: number };
43
- chapters: { changesAt: ReadonlyArray<string> };
44
- tail: { last: number };
45
44
  };
46
45
  waits: Readonly<Record<string, { phase: string; drawnAs: string | null }>>;
47
46
  defaults: Readonly<Record<string, string | ReadonlyArray<string>>>;
@@ -53,13 +52,13 @@ interface BodyTable {
53
52
  /** The ingredients, by the contract's keys (held equal to it by body-mix.spec). */
54
53
  export enum BodyIngredient {
55
54
  Seam = 'seam',
56
- Rhythm = 'rhythm',
55
+ Pace = 'pace',
57
56
  Texture = 'texture',
58
57
  Sections = 'sections',
59
58
  }
60
59
 
61
60
  export enum BodySeam { Straight = 'straight', Wave = 'wave', Drip = 'drip', Torn = 'torn', Rounded = 'rounded' }
62
- export enum BodyRhythm { Free = 'free', Alternate = 'alternate', LoudQuiet = 'loud-quiet', Chapters = 'chapters', Tail = 'tail' }
61
+ export enum BodyPace { Free = 'free', LoudQuiet = 'loud-quiet' }
63
62
  export enum BodyTexture { None = 'none', Pattern = 'pattern', Light = 'light', Material = 'material', Grain = 'grain', Lanes = 'lanes' }
64
63
  export enum BodySectionWord {
65
64
  InsetCard = 'inset-card',
@@ -71,10 +70,10 @@ export enum BodySectionWord {
71
70
  Hotspots = 'hotspots',
72
71
  }
73
72
 
74
- /** One word for each of seam, rhythm and texture; a list (in the table's order) of the extra kinds of section. */
73
+ /** One word for each of seam, pace and texture; a list (in the table's order) of the extra kinds of section. */
75
74
  export interface BodyMix {
76
75
  seam: string;
77
- rhythm: string;
76
+ pace: string;
78
77
  texture: string;
79
78
  sections: string[];
80
79
  }
@@ -112,21 +111,21 @@ export function bodyWordWaits(ingredient: `${BodyIngredient}`, word: string): st
112
111
  return WAITS[`${ingredient}.${word}`]?.phase ?? null;
113
112
  }
114
113
 
115
- /** AW-D23: a word every plan wears (`all`) or one the award tier alone is offered (`pro`). */
114
+ /** The tier a word was first drawn for (`all`, or `pro` — the award tier's, AW-D23); since AW-D42 every tier wears both. */
116
115
  export function bodyWordTier(ingredient: `${BodyIngredient}`, word: string): 'all' | 'pro' {
117
116
  return B.tiers[`${ingredient}.${word}`] === 'pro' ? 'pro' : 'all';
118
117
  }
119
118
 
120
- /** May a build at `tier` wear this word? */
119
+ /** May a build at `tier` wear this word? Every tier wears every drawn word (AW-D42, `tierOffers`). */
121
120
  export function bodyWordOffered(ingredient: `${BodyIngredient}`, word: string, tier: `${GenerationTier}`): boolean {
122
- return bodyWordTier(ingredient, word) === 'all' || tier === GenerationTier.Award;
121
+ return tierOffers(bodyWordTier(ingredient, word), tier);
123
122
  }
124
123
 
125
124
  /** A whole mix from part of one: what is not named is the default (straight, free, no texture). Refuses a word the table
126
125
  * lacks. */
127
126
  export function bodyMix(partial: Partial<Record<string, string | ReadonlyArray<string>>> = {}): BodyMix {
128
127
  const mix: BodyMix = {
129
- seam: B.defaults['seam'] as string, rhythm: B.defaults['rhythm'] as string, texture: B.defaults['texture'] as string,
128
+ seam: B.defaults['seam'] as string, pace: B.defaults['pace'] as string, texture: B.defaults['texture'] as string,
130
129
  sections: listOf(B.defaults['sections']),
131
130
  };
132
131
  for (const [k, v] of Object.entries(partial)) {
@@ -146,11 +145,16 @@ export function bodyMixWords(mix: BodyMix): string[] {
146
145
  return ORDER.flatMap(k => listOf((mix as unknown as Record<string, string | string[]>)[k]).map(w => `${k}:${w}`));
147
146
  }
148
147
 
148
+ /** CV-D6: ingredients the body table no longer has, whose words a stored plan may still carry (an award plan's
149
+ * `rhythm:free`, the only rhythm word the wire ever offered) — read as nothing; the grounds' rhythm is COLOUR's now. */
150
+ export const LEGACY_BODY_INGREDIENTS: ReadonlySet<string> = new Set(['rhythm']);
151
+
149
152
  /** The words back into a mix. Refuses an unknown word and two words for a one-word ingredient. */
150
153
  export function bodyMixFromWords(words: ReadonlyArray<string>): BodyMix {
151
154
  const partial: Record<string, string[]> = {};
152
155
  for (const pair of words) {
153
156
  const [k, w] = String(pair).split(':');
157
+ if (LEGACY_BODY_INGREDIENTS.has(k) && !INGREDIENTS[k]) continue;
154
158
  if (!INGREDIENTS[k] || !w) throw new BodyMixError(`"${pair}" is no body word (<ingredient>:<word>)`);
155
159
  const got = (partial[k] ??= []);
156
160
  if (!isMany(k) && got.length && got[0] !== w) throw new BodyMixError(`a body has one ${k} ("${got[0]}" and "${w}")`);
@@ -197,12 +201,12 @@ export function drawnBodyMix(mix: BodyMix): { drawn: BodyMix; gaps: BodyGap[] }
197
201
  /** The fingerprint's prefix for a body. */
198
202
  export const BODY_TOKEN = 'body';
199
203
 
200
- /** A body as the fingerprint sees it: `body:<seam>/<rhythm>/<texture>`. */
204
+ /** A body as the fingerprint sees it: `body:<seam>/<pace>/<texture>`. */
201
205
  export function bodyTokenOf(mix: BodyMix): string {
202
206
  return `${BODY_TOKEN}:${B.fingerprint.map(k => (mix as unknown as Record<string, string>)[k]).join('/')}`;
203
207
  }
204
208
 
205
- /** Every `<ingredient>:<word>` the generator's wire may carry at `tier`: drawn words only, the award tier's only there. */
209
+ /** Every `<ingredient>:<word>` the generator's wire may carry at `tier`: drawn words only (every tier's since AW-D42). */
206
210
  export function bodyWireWords(tier: `${GenerationTier}` = GenerationTier.Basic): string[] {
207
211
  return ORDER.flatMap(k => bodyWords(k).filter(w => bodyWordDrawn(k, w) && bodyWordOffered(k, w, tier)).map(w => `${k}:${w}`));
208
212
  }
@@ -350,8 +354,6 @@ export function joinPageHeader(layout: ReadonlyArray<SerializedNode>): Serialize
350
354
  // ── The check: a mix judged against the site, mended where the site cannot carry it, each mend said ──────────────────
351
355
 
352
356
  export enum BodyRepairCode {
353
- /** A word the award tier alone wears, on a site built below it. */
354
- ProOnly = 'pro-only',
355
357
  /** A trust or care business (harness `MOTION_CEILINGS.subtle`) never wears a torn or dripping edge: a soft hill. */
356
358
  CalmSeam = 'calm-seam',
357
359
  }
@@ -366,8 +368,6 @@ export interface BodyRepair {
366
368
  }
367
369
 
368
370
  export interface BodyContext {
369
- /** AW-D23: the tier the site is built at; absent: the award words are the owner's to choose (the builder). */
370
- readonly tier?: `${GenerationTier}`;
371
371
  /** A trust or care business — the harness's calm motion ceiling (`MOTION_CEILINGS.subtle`). */
372
372
  readonly calm?: boolean;
373
373
  }
@@ -376,21 +376,6 @@ export interface BodyContext {
376
376
  export function checkBody(mix: BodyMix, ctx: BodyContext = {}): { mix: BodyMix; repairs: BodyRepair[] } {
377
377
  const m: BodyMix = { ...mix, sections: [...mix.sections] };
378
378
  const repairs: BodyRepair[] = [];
379
- if (ctx.tier && ctx.tier !== GenerationTier.Award) {
380
- for (const k of ORDER) {
381
- if (isMany(k)) {
382
- const kept = m[k].filter(w => bodyWordTier(k, w) === 'all');
383
- for (const w of m[k].filter(x => !kept.includes(x))) repairs.push({ code: BodyRepairCode.ProOnly, said: `"${bodyMeaning(k, w)}" comes with the award plan: left out` });
384
- m[k] = kept;
385
- continue;
386
- }
387
- const word = (m as unknown as Record<string, string>)[k];
388
- if (bodyWordTier(k, word) === 'all') continue;
389
- const standIn = B.defaults[k] as string;
390
- (m as unknown as Record<string, string>)[k] = standIn;
391
- repairs.push({ code: BodyRepairCode.ProOnly, said: `"${bodyMeaning(k, word)}" comes with the award plan: ${bodyMeaning(k, standIn)} instead` });
392
- }
393
- }
394
379
  if (ctx.calm && LOUD_SEAMS.has(m.seam)) {
395
380
  repairs.push({ code: BodyRepairCode.CalmSeam, said: `a calm business never wears "${bodyMeaning(BodyIngredient.Seam, m.seam)}": ${bodyMeaning(BodyIngredient.Seam, CALM_SEAM)} instead` });
396
381
  m.seam = CALM_SEAM;
@@ -398,9 +383,10 @@ export function checkBody(mix: BodyMix, ctx: BodyContext = {}): { mix: BodyMix;
398
383
  return { mix: m, repairs };
399
384
  }
400
385
 
401
- // ── The rhythm: a composed page's grounds against the body's rhythm ──────────────────────────────────────────────────
386
+ // ── The pace, and how a ground reads ────────────────────────────────────────────────────────────────────────────────
402
387
 
403
- /** How a section's ground reads: dark or light (by its colour's luminance), or a photo (free in every rhythm). */
388
+ /** How a section's ground reads: dark or light (by its colour's luminance), or a photo (free in every rhythm). Shared with
389
+ * COLOUR's rhythms (`colour-mix.ts`). */
404
390
  export enum GroundTone {
405
391
  Dark = 'dark',
406
392
  Light = 'light',
@@ -415,72 +401,24 @@ export function groundToneOf(luminance: number): GroundTone.Dark | GroundTone.Li
415
401
  return luminance > TONE_SPLIT ? GroundTone.Light : GroundTone.Dark;
416
402
  }
417
403
 
418
- export interface RhythmContext {
419
- /** Each section's ground, as it reads. */
420
- toneOf: (section: LayoutSection) => GroundTone;
421
- /** The footer's ground, as it reads; absent: the tail is not judged (the footer's scheme is not known). */
422
- footerTone?: GroundTone | null;
423
- }
424
-
425
404
  const PICTURED: ReadonlySet<string> = new Set([LayoutLayerKind.Photo, LayoutLayerKind.Gallery, LayoutLayerKind.List, LayoutLayerKind.Marquee]);
426
405
  const span = (l: LayoutLayer) => (Array.isArray(l.col) ? l.col[1] - l.col[0] : 0);
427
- const pictured = (s: LayoutSection) => String(s.ground ?? '').startsWith('photo:') || (s.layers ?? []).some(l => PICTURED.has(l.kind));
406
+ /** A section that shows pictures: a photo ground, or a photo, gallery, list or marquee layer. */
407
+ export const sectionPictured = (s: LayoutSection): boolean => String(s.ground ?? '').startsWith('photo:') || (s.layers ?? []).some(l => PICTURED.has(l.kind));
428
408
  /** A quiet section: words only, centred, every layer within `cols` of the twelve. */
429
409
  const quiet = (s: LayoutSection, cols: number) =>
430
- !pictured(s) && !!(s.layers ?? []).length && (s.layers ?? []).every(l => l.kind === LayoutLayerKind.Shape || (span(l) <= cols && (l.align ?? 'start') === 'center'));
431
- const startsChapter = (s: LayoutSection, at: ReadonlyArray<string>) =>
432
- (at.includes('inhale') && s.kind === LayoutSectionKind.Inhale) || (at.includes('signature') && !!s.signature);
410
+ !sectionPictured(s) && !!(s.layers ?? []).length && (s.layers ?? []).every(l => l.kind === LayoutLayerKind.Shape || (span(l) <= cols && (l.align ?? 'start') === 'center'));
433
411
 
434
412
  /**
435
- * A composed page's grounds judged against the body's rhythm (`BODY.rhythms`): each issue a `Structure` issue on the page,
436
- * so the layout request is asked again with it. `free` (and an unknown word) asks nothing. A photo ground is free in
437
- * `alternate`, `chapters` and `tail`. Pure.
413
+ * A composed page judged against the body's pace (`BODY.paces`): each issue a `Structure` issue on the page, so the layout
414
+ * request is asked again with it. `free` (and an unknown word) asks nothing. Pure.
438
415
  */
439
- export function rhythmIssues(sections: ReadonlyArray<LayoutSection>, rhythm: string | null | undefined, ctx: RhythmContext): LayoutIssue[] {
440
- const issues: LayoutIssue[] = [];
441
- const add = (path: string, message: string) => issues.push({ code: LayoutIssueCode.Structure, path, message });
442
- const tones = sections.map(s => ctx.toneOf(s));
443
- const R = B.rhythms;
444
- switch (rhythm) {
445
- case BodyRhythm.Alternate:
446
- for (let i = 1; i < sections.length; i++) {
447
- if (tones[i] !== GroundTone.Photo && tones[i] === tones[i - 1]) {
448
- add(`sections[${i}].ground`, `grounds alternate dark and light — "${sections[i].id}" is ${tones[i]} like the section before it`);
449
- }
450
- }
451
- break;
452
- case BodyRhythm.LoudQuiet: {
453
- const { pairs, quietCols } = R['loud-quiet'];
454
- let found = 0;
455
- for (let i = 1; i < sections.length; i++) if (pictured(sections[i - 1]) && quiet(sections[i], quietCols)) found++;
456
- if (found < pairs) {
457
- add('sections', `${found} picture section(s) followed by a quiet one — the loud-quiet rhythm asks at least ${pairs}: a picture section, then words only, centred, within ${quietCols} of the 12 columns`);
458
- }
459
- break;
460
- }
461
- case BodyRhythm.Chapters: {
462
- const at = R.chapters.changesAt;
463
- let last: GroundTone | null = null;
464
- sections.forEach((s, i) => {
465
- const tone = tones[i];
466
- if (tone === GroundTone.Photo) return;
467
- if (last !== null && tone !== last && !startsChapter(s, at)) {
468
- add(`sections[${i}].ground`, `the ground changes only where a chapter starts (an inhale or the signature) — "${s.id}" changes it`);
469
- }
470
- last = tone;
471
- });
472
- break;
473
- }
474
- case BodyRhythm.Tail: {
475
- if (!ctx.footerTone || ctx.footerTone === GroundTone.Photo) break;
476
- const from = Math.max(0, sections.length - R.tail.last);
477
- for (let i = from; i < sections.length; i++) {
478
- if (tones[i] !== GroundTone.Photo && tones[i] !== ctx.footerTone) {
479
- add(`sections[${i}].ground`, `the last ${R.tail.last} sections wear the footer's ${ctx.footerTone} ground — "${sections[i].id}" is ${tones[i]}`);
480
- }
481
- }
482
- break;
483
- }
484
- }
485
- return issues;
416
+ export function paceIssues(sections: ReadonlyArray<LayoutSection>, pace: string | null | undefined): LayoutIssue[] {
417
+ if (pace !== BodyPace.LoudQuiet) return [];
418
+ const { pairs, quietCols } = B.paces['loud-quiet'];
419
+ let found = 0;
420
+ for (let i = 1; i < sections.length; i++) if (sectionPictured(sections[i - 1]) && quiet(sections[i], quietCols)) found++;
421
+ if (found >= pairs) return [];
422
+ return [{ code: LayoutIssueCode.Structure, path: 'sections',
423
+ message: `${found} picture section(s) followed by a quiet one — the loud-quiet pace asks at least ${pairs}: a picture section, then words only, centred, within ${quietCols} of the 12 columns` }];
486
424
  }
@@ -10,6 +10,7 @@ import { PageSectionPlan } from './site-plan.model';
10
10
  import { PathIssue } from './shape-check';
11
11
  import { freeStyleWithoutSlot } from './free-slots';
12
12
  import { isFreeBox } from './free-opening';
13
+ import type { FreeSlotKind } from './free-slot-words';
13
14
 
14
15
  /**
15
16
  * THE FREE PAGE'S JUDGE (award plan §11.4 gates 1 + 2, FS3): every reason a free page may not be stamped, path first,
@@ -45,8 +46,10 @@ export type FreeIssue = PathIssue<FreeIssueCode>;
45
46
 
46
47
  /** What a placed slot is, and the options it may carry (a list's mix words). */
47
48
  export interface FreeSlotOffer {
48
- kind: 'list' | 'form';
49
- /** The list alias (`list:<alias>`) or the forms-core preset (`form:<preset>`). */
49
+ /** What the slot places (`FreeSlotKind`, free-parts.ts): a list, a form, or a recipe over a list. */
50
+ kind: `${FreeSlotKind}`;
51
+ /** The list alias (`list:<alias>`, `accordion:<alias>`, `tabs:<alias>`, `quotes:<alias>`) or the forms-core preset
52
+ * (`form:<preset>`). */
50
53
  ref: string;
51
54
  opts?: ReadonlyArray<string>;
52
55
  }
@@ -20,7 +20,8 @@ import { SerializedNode, walkSerialized } from './serialized-node';
20
20
  import { SPEC_SITE_FACTS, SPEC_SITE_LAYOUT } from './site-spec.generated';
21
21
  import { checkList, LayoutListNever, pageListIssues } from './check-list';
22
22
  import { LIST_WORDS_BESIDE_RULE, LayoutListSide, layoutListBare, layoutListPair } from './list-space';
23
- import { GroundTone, groundToneOf, rhythmIssues } from './body-mix';
23
+ import { GroundTone, groundToneOf, paceIssues } from './body-mix';
24
+ import { colourRhythmIssues } from './colour-mix';
24
25
  import {
25
26
  LAYOUT_CHECK_VIEWPORT, LAYOUT_DRIFT, LAYOUT_KINETIC_KINDS, LAYOUT_LINE_HEIGHT, layoutBoxPx, layoutDriftPhoto, layoutHeldStill, layoutOpeningDisplayMend, layoutOpeningDisplays, layoutShapeHasPurpose,
26
27
  layoutStillLine, layoutTextFits, layoutVoidScreens, layoutVoids,
@@ -78,9 +79,13 @@ export interface CheckLayoutContext {
78
79
  first?: boolean;
79
80
  /** The design the page will wear: its fonts decide whether a `screen` word fits (iox-ui#46). Default: the preset's. */
80
81
  design?: DesignChoices;
81
- /** AW6: the body's rhythm as DRAWN (`drawnBodyMix(bodyMixOfPlan(plan)).rhythm`): the page's grounds are judged against
82
- * it (`rhythmIssues`). Absent or `free`: each section's ground is its own. */
82
+ /** The site's colour rhythm as DRAWN (`drawnColourMix(…).drawn.rhythm`, colour-v2 CV-D6 — AW6's body rhythm, moved to
83
+ * the COLOUR table): the page's grounds are judged against it (`colourRhythmIssues`). Absent or `free`: each
84
+ * section's ground is its own. */
83
85
  rhythm?: string | null;
86
+ /** AW6: the body's pace as DRAWN (`drawnBodyMix(bodyMixOfPlan(plan)).drawn.pace`): `loud-quiet` asks picture sections
87
+ * followed by quiet ones (`paceIssues`). Absent or `free`: nothing asked. */
88
+ pace?: string | null;
84
89
  /** AW6: how the footer's ground reads — the `tail` rhythm's last sections wear it. Absent: the tail is not judged. */
85
90
  footerTone?: GroundTone | null;
86
91
  /** Award §0c CW2 (AW-D34): the column words this business type never wears (harness-core `BusinessType.column.never`):
@@ -868,8 +873,9 @@ function examineLayout(page: LayoutPage, ctx: CheckLayoutContext, carried: Layou
868
873
  const toneOf = (s: LayoutSection) => (groundPhotoOf(s)
869
874
  ? GroundTone.Photo
870
875
  : groundToneOf(lumOf(paint.colours[(inList(V.colours, s.ground) ? s.ground : LayoutColour.Ground) as LayoutColour])));
871
- issues.push(...rhythmIssues(sections, ctx.rhythm, { toneOf, footerTone: ctx.footerTone }));
876
+ issues.push(...colourRhythmIssues(sections, ctx.rhythm, { toneOf, footerTone: ctx.footerTone }));
872
877
  }
878
+ issues.push(...paceIssues(sections, ctx.pace));
873
879
  const unshown = shownListIssue(page, ctx);
874
880
  if (unshown) issues.push(unshown);
875
881
  return { issues: uniqueIssues(issues), tally: { signatures: signatures.length, galleries, swappable, layered, bleeds, screenWords, wordsOnPhoto, holds } };