@vectoriox/iox-ui 5.196.0 → 5.198.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/composite-core/index.d.ts +19 -2
  2. package/data-core/index.d.ts +101 -2
  3. package/design-core/index.d.ts +183 -30
  4. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +49 -10
  5. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-data-core.mjs +192 -2
  7. package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui-design-core.mjs +299 -74
  9. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +2287 -528
  11. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  12. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +3 -1
  13. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  14. package/fesm2022/vectoriox-iox-ui.mjs +32 -2
  15. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  16. package/generation-core/index.d.ts +1454 -200
  17. package/harness-core/index.d.ts +1 -1
  18. package/package.json +1 -1
  19. package/src/composite-core/header.ts +34 -1
  20. package/src/composite-core/slider-runtime.ts +16 -8
  21. package/src/data-core/placeholder-rows.ts +220 -0
  22. package/src/data-core/public-api.ts +2 -1
  23. package/src/design-core/brand.ts +58 -5
  24. package/src/design-core/contrast-audit.ts +49 -22
  25. package/src/design-core/design-apply.ts +34 -3
  26. package/src/design-core/flavor-fixtures.generated.ts +123 -123
  27. package/src/design-core/flavor-spec.generated.ts +44 -4
  28. package/src/design-core/flavor-tokens.ts +1 -1
  29. package/src/design-core/header-behaviour.ts +82 -15
  30. package/src/design-core/motion-language.ts +5 -14
  31. package/src/design-core/node-links.ts +34 -0
  32. package/src/design-core/preloader.ts +4 -5
  33. package/src/generation-core/audit-site.ts +10 -1
  34. package/src/generation-core/audit-words.ts +5 -0
  35. package/src/generation-core/body-mix.ts +40 -102
  36. package/src/generation-core/check-free.ts +26 -5
  37. package/src/generation-core/check-layout.ts +10 -4
  38. package/src/generation-core/check-list.ts +3 -25
  39. package/src/generation-core/colour-mix.ts +296 -0
  40. package/src/generation-core/compose-free.ts +40 -18
  41. package/src/generation-core/compose-site.ts +124 -22
  42. package/src/generation-core/footer-mix.ts +102 -54
  43. package/src/generation-core/free-fallback.ts +6 -4
  44. package/src/generation-core/free-opening.ts +57 -0
  45. package/src/generation-core/free-parts.ts +87 -0
  46. package/src/generation-core/free-slot-words.ts +30 -0
  47. package/src/generation-core/generation-tier.ts +6 -17
  48. package/src/generation-core/header-mix.ts +125 -4
  49. package/src/generation-core/item-fill.ts +42 -0
  50. package/src/generation-core/layout-drawers.ts +3 -2
  51. package/src/generation-core/layout-wire.ts +10 -16
  52. package/src/generation-core/list-panel.ts +3 -3
  53. package/src/generation-core/list-table.ts +5 -14
  54. package/src/generation-core/list-words.ts +2 -1
  55. package/src/generation-core/nav-shape.ts +45 -16
  56. package/src/generation-core/node-baselines.generated.ts +1 -0
  57. package/src/generation-core/opening-mix.ts +16 -33
  58. package/src/generation-core/part-tier.ts +14 -0
  59. package/src/generation-core/plan-wire.ts +31 -43
  60. package/src/generation-core/public-api.ts +4 -0
  61. package/src/generation-core/site-build-run.ts +4 -0
  62. package/src/generation-core/site-spec.generated.ts +1127 -93
  63. package/src/generation-core/stock-search.ts +106 -18
  64. package/src/generation-core/type-led.ts +19 -4
  65. package/src/generation-core/validate-site-plan.ts +4 -5
  66. package/src/harness-core/run-compose-context.ts +3 -1
  67. package/styles/iox-design.css +139 -4
@@ -1,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
  }
@@ -9,6 +9,8 @@ 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';
13
+ import type { FreeSlotKind } from './free-slot-words';
12
14
 
13
15
  /**
14
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,
@@ -44,8 +46,10 @@ export type FreeIssue = PathIssue<FreeIssueCode>;
44
46
 
45
47
  /** What a placed slot is, and the options it may carry (a list's mix words). */
46
48
  export interface FreeSlotOffer {
47
- kind: 'list' | 'form';
48
- /** 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>`). */
49
53
  ref: string;
50
54
  opts?: ReadonlyArray<string>;
51
55
  }
@@ -69,6 +73,10 @@ export interface FreeJudgeContext {
69
73
  said?: ReadonlyArray<string>;
70
74
  /** Home: a business with videos plays one there. */
71
75
  home?: boolean;
76
+ /** iox-ui#180: the picture boxes the page was offered (`freeOpeningOffer`) — empty pictures the build fills. */
77
+ boxes?: ReadonlyArray<string>;
78
+ /** iox-ui#180: a picture can come for the Home's opening (the owner's photo, or a box): its first section holds it. */
79
+ opensOnPicture?: boolean;
72
80
  }
73
81
 
74
82
  /** A free page is this many sections. */
@@ -229,7 +237,8 @@ function judgeFree(page: FreePage, ctx: FreeJudgeContext, signature: boolean): F
229
237
  const seen = new Set<string>();
230
238
  const texts: WrittenText[] = [];
231
239
  let h1 = 0;
232
- for (const { node, path, up } of walked) {
240
+ let boxes = 0;
241
+ for (const { node, path, up, section } of walked) {
233
242
  if (!Object.values(FreeNodeType).includes(node.type)) { say(FreeIssueCode.Structure, path, `"${node.type}" is not a node type — ${Object.values(FreeNodeType).join(', ')}`); continue; }
234
243
  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
244
  seen.add(node.id);
@@ -253,9 +262,17 @@ function judgeFree(page: FreePage, ctx: FreeJudgeContext, signature: boolean): F
253
262
  }
254
263
  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
264
  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`);
265
+ const src = node.src ?? '';
266
+ const offeredBox = isFreeBox(src) && !!ctx.boxes?.includes(src);
267
+ const m = ctx.material[src] ?? (offeredBox ? { kind: 'image' as const } : undefined);
268
+ if (!m) say(FreeIssueCode.Content, `${path}.src`, `"${src}" is not in the material — use an id from the list`);
258
269
  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'}`);
270
+ else if (offeredBox) {
271
+ // iox-ui#180: a box is the opening's ONE picture place, filled after the page is written — never a ground.
272
+ if (section !== 0) say(FreeIssueCode.Content, `${path}.src`, 'a box is the opening\'s picture — only the first section may hold one');
273
+ else if (boxes++ > 0) say(FreeIssueCode.Content, `${path}.src`, 'one box: the opening has one picture place');
274
+ 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');
275
+ }
259
276
  }
260
277
  if (node.type === FreeNodeType.Slot) {
261
278
  const offer = ctx.slots?.[node.slot ?? ''];
@@ -311,6 +328,10 @@ function judgeFree(page: FreePage, ctx: FreeJudgeContext, signature: boolean): F
311
328
  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
329
  const hasVideos = Object.values(ctx.material).some(m => m.kind === 'video');
313
330
  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)');
331
+ // 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.
332
+ if (ctx.home && ctx.opensOnPicture && sections[0] && !ready(0) && !walkFree([sections[0]]).some(w => w.node.type === FreeNodeType.Image)) {
333
+ 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`);
334
+ }
314
335
  if (!(Object.values(FreePictures) as string[]).includes(page?.pictures)) say(FreeIssueCode.Structure, 'pictures', `one word: ${Object.values(FreePictures).join(', ')}`);
315
336
  issues.push(...followedIssues(page, ctx));
316
337
  issues.push(...freeContrastIssues(page, ctx));
@@ -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 } };
@@ -2,7 +2,7 @@ import {
2
2
  LayoutIssue, LayoutIssueCode, LayoutLayerKind, LayoutListArrange, LayoutListArrive, LayoutListHow, LayoutListHover, LayoutListItem, LayoutListMix,
3
3
  LayoutListMove, LayoutListPhone, LayoutListShape, LayoutListWho, LayoutMendKind, LayoutPage,
4
4
  } from './layout-language';
5
- import { LIST_RULES, bentoFill, listBelowPro, listBuiltWords, listMeaning, listWait, listWordRefusal, ListWordRefusal } from './list-table';
5
+ import { LIST_RULES, bentoFill, listBuiltWords, listMeaning, listWait, listWordRefusal, ListWordRefusal } from './list-table';
6
6
  import { bentoFillsParams, listSaidSentence, ListSaid, ListSayCode, ListSayParams, listWordRef, listWordRefs } from './list-words';
7
7
  import { SPEC_SITE_LAYOUT } from './site-spec.generated';
8
8
 
@@ -15,7 +15,6 @@ import { SPEC_SITE_LAYOUT } from './site-spec.generated';
15
15
 
16
16
  const R = SPEC_SITE_LAYOUT.list.rules;
17
17
  const IMAGE = 'image';
18
- const AWARD = 'award';
19
18
  /** What a name set on its picture may show beside the picture: the name and a short detail (AW11-D8). */
20
19
  const TITLE_ON_PHOTO_PARTS: ReadonlySet<string> = new Set(['title', 'meta', 'date']);
21
20
  const inList = (values: ReadonlyArray<string>, v: unknown): boolean => typeof v === 'string' && values.includes(v);
@@ -46,7 +45,7 @@ export interface LayoutListNever {
46
45
 
47
46
  /** AW11: what the judge knows of where the list sits and who it is built for. */
48
47
  export interface ListCheckOptions {
49
- /** AW-D23: the tier the site is built at; absent: the builder (the owner's choice — no word is held back). */
48
+ /** The tier the site is built at. Since AW-D42 it holds back no word; kept so its callers still read. */
50
49
  readonly tier?: string | null;
51
50
  /** The list is in the page's first screen (its first section): no arrival plays there (AW11-D15). */
52
51
  readonly firstScreen?: boolean;
@@ -105,27 +104,6 @@ export function checkList(mix: LayoutListMix, shape: LayoutListShape | null, lay
105
104
  const drawn = (next[k] as string[]).map(w => { const stand = waiting(k, w); return stand === undefined ? w : stand; }).filter((w): w is string => !!w);
106
105
  (next as unknown as Record<string, string[]>)[k] = [...new Set(drawn)];
107
106
  }
108
- // AW-D23: a round-two word on a site built below the award tier is drawn as its stand-in (the contract's belowPro).
109
- if (options.tier !== undefined && options.tier !== null && options.tier !== AWARD) {
110
- const below = (k: 'item' | 'arrange' | 'arrive', fallback: string) => {
111
- const stand = listBelowPro(k, next[k]);
112
- if (stand === undefined) return;
113
- repair(ListSayCode.AwardOnly, { k, word: listWordRef(k, next[k]), as: listWordRef(k, stand ?? fallback) });
114
- (next as unknown as Record<string, string>)[k] = stand ?? fallback;
115
- };
116
- below('item', LayoutListItem.Card);
117
- below('arrange', LayoutListArrange.Grid);
118
- below('arrive', LayoutListArrive.Together);
119
- for (const k of ['move', 'hover'] as const) {
120
- const kept = (next[k] as string[]).flatMap(w => {
121
- const stand = listBelowPro(k, w);
122
- if (stand === undefined) return [w];
123
- repair(ListSayCode.AwardOnly, { k, word: listWordRef(k, w), ...(stand ? { as: listWordRef(k, stand) } : {}) });
124
- return stand ? [stand] : [];
125
- });
126
- (next as unknown as Record<string, string[]>)[k] = [...new Set(kept)];
127
- }
128
- }
129
107
  const roles = shape.roles as ReadonlyArray<string>;
130
108
  const pictured = roles.includes(IMAGE);
131
109
 
@@ -313,7 +291,7 @@ export function checkList(mix: LayoutListMix, shape: LayoutListShape | null, lay
313
291
  next.hover = next.hover.filter(h => !has(R.onlyStrips.hover, h));
314
292
  }
315
293
  // AW11: hover words that need what the list may not have (one table), and the hover tilt — a still card's.
316
- const unread = next.hover.filter(h => listWordRefusal('hover', h, shape) !== null && listWordRefusal('hover', h, shape) !== ListWordRefusal.ProOnly);
294
+ const unread = next.hover.filter(h => listWordRefusal('hover', h, shape) !== null);
317
295
  if (unread.length) {
318
296
  // One sentence each (#123: they were one joined line — a screen says each in the owner's words).
319
297
  for (const h of unread) {