@vectoriox/iox-ui 5.140.0 → 5.142.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 (45) hide show
  1. package/assist-core/index.d.ts +19 -2
  2. package/design-core/index.d.ts +171 -2
  3. package/fesm2022/vectoriox-iox-ui-assist-core.mjs +29 -3
  4. package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
  5. package/fesm2022/vectoriox-iox-ui-design-core.mjs +358 -172
  6. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1671 -861
  8. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +49 -18
  10. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-scene-core.mjs +32 -9
  12. package/fesm2022/vectoriox-iox-ui-scene-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui.mjs +85 -4
  14. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  15. package/generation-core/index.d.ts +525 -144
  16. package/harness-core/index.d.ts +18 -18
  17. package/index.d.ts +92 -2
  18. package/package.json +1 -1
  19. package/scene-core/index.d.ts +17 -1
  20. package/src/assist-core/assist-turn.ts +34 -2
  21. package/src/design-core/flavor-spec.generated.ts +141 -0
  22. package/src/design-core/ink-on-ground.ts +36 -0
  23. package/src/design-core/list-classes.ts +37 -0
  24. package/src/design-core/node-classes.ts +3 -2
  25. package/src/design-core/public-api.ts +2 -0
  26. package/src/generation-core/check-layout.ts +23 -1
  27. package/src/generation-core/check-list.ts +144 -5
  28. package/src/generation-core/compose-layout.ts +188 -23
  29. package/src/generation-core/compose-site.ts +14 -2
  30. package/src/generation-core/header-edit.ts +15 -11
  31. package/src/generation-core/layout-fingerprint.ts +5 -1
  32. package/src/generation-core/layout-language.ts +10 -0
  33. package/src/generation-core/layout-wire.ts +64 -24
  34. package/src/generation-core/list-panel.ts +122 -0
  35. package/src/generation-core/list-space.ts +205 -0
  36. package/src/generation-core/list-table.ts +101 -0
  37. package/src/generation-core/node-baselines.generated.ts +3 -1
  38. package/src/generation-core/public-api.ts +2 -0
  39. package/src/generation-core/serialized-node.ts +2 -0
  40. package/src/generation-core/site-plan.model.ts +6 -0
  41. package/src/generation-core/site-spec.generated.ts +188 -70
  42. package/src/generation-core/validate-site-plan.ts +8 -4
  43. package/src/harness-core/harness-spec.generated.ts +49 -18
  44. package/src/scene-core/split-text.ts +31 -7
  45. package/styles/iox-design.css +438 -4
@@ -0,0 +1,122 @@
1
+ import { checkList, LayoutListNever } from './check-list';
2
+ import {
3
+ LayoutIssue, LayoutIssueCode, LayoutListHow, LayoutListMix, LayoutListShape, LayoutListWho, LayoutMendKind,
4
+ } from './layout-language';
5
+ import {
6
+ LIST_INGREDIENTS, LIST_TABLE, ListIngredient, ListWordRefusal, listBuiltWords, listMeaning, listWordRefusal, listWordTier,
7
+ } from './list-table';
8
+
9
+ /**
10
+ * Bindings ▸ List (AW11-D18, board award-lists "Where an owner sets it"): the rows of the ONE list group, framework-free so
11
+ * the host (cms-client's Bindings panel) only draws them. P1 — the rows ARE the contract's ingredients and words (the
12
+ * same words the model writes, each with its meaning as the hint), so the panel can never offer a word the model can't
13
+ * write or the composer can't draw. P2 — a word the list's data can't carry is disabled with its reason (the same rule
14
+ * as the wire's per-list offer, `listWordRefusal`). P3 — what `checkList` mends after a pick is SAID under the group.
15
+ * Below Pro the round-two words show with the plan mark and cannot be picked (AW-D23).
16
+ */
17
+
18
+ /** One word of a row. */
19
+ export interface ListPanelWord {
20
+ readonly word: string;
21
+ /** The contract's meaning — the row's hint. */
22
+ readonly meaning: string;
23
+ /** A round-two word (the plan mark). */
24
+ readonly pro: boolean;
25
+ /** A hover word: phones never show it, so its hint says "(mouse)" (P4). */
26
+ readonly mouse: boolean;
27
+ /** Why it cannot be picked, or null. */
28
+ readonly refusal: ListWordRefusal | null;
29
+ }
30
+
31
+ /** One row of the group: an ingredient, its words, what the list wears now. */
32
+ export interface ListPanelRow {
33
+ readonly ingredient: ListIngredient;
34
+ /** Several words at once (move, hover) — a multi-select. */
35
+ readonly many: boolean;
36
+ readonly words: ReadonlyArray<ListPanelWord>;
37
+ /** The word(s) the list wears. */
38
+ readonly value: string | ReadonlyArray<string>;
39
+ }
40
+
41
+ /** What the panel is judged against. */
42
+ export interface ListPanelContext {
43
+ /** The list the section shows (`layoutListShapes`), or null when unknown — nothing is refused for its data then. */
44
+ readonly shape: LayoutListShape | null;
45
+ /** The studio's plan tier (`award` wears every word); absent: nothing is held back for the plan. */
46
+ readonly tier?: string | null;
47
+ /** The business type's never rule (`LIST_NEVER`). */
48
+ readonly never?: LayoutListNever | null;
49
+ }
50
+
51
+ const MANY: ReadonlySet<string> = new Set(LIST_TABLE.many as ReadonlyArray<string>);
52
+ const HOVER: ListIngredient = 'hover';
53
+
54
+ /** The word(s) a mix wears for an ingredient. */
55
+ export function listMixValue(mix: LayoutListMix, k: ListIngredient): string | ReadonlyArray<string> {
56
+ switch (k) {
57
+ case 'who': return mix.standout?.who ?? LayoutListWho.None;
58
+ case 'how': return mix.standout?.how ?? String((LIST_TABLE.defaults as unknown as Readonly<Record<string, unknown>>)['how']);
59
+ case 'move': return mix.move;
60
+ case 'hover': return mix.hover;
61
+ default: return (mix as unknown as Record<string, string>)[k];
62
+ }
63
+ }
64
+
65
+ /** The group's rows for a list — every ingredient the product draws, in the table's order. */
66
+ export function listPanelRows(mix: LayoutListMix, ctx: ListPanelContext): ListPanelRow[] {
67
+ return LIST_INGREDIENTS.map(k => ({
68
+ ingredient: k,
69
+ many: MANY.has(k),
70
+ value: listMixValue(mix, k),
71
+ words: listBuiltWords(k).map(word => ({
72
+ word,
73
+ meaning: listMeaning(k, word),
74
+ pro: listWordTier(k, word) === 'pro',
75
+ mouse: k === HOVER,
76
+ refusal: listWordRefusal(k, word, ctx.shape, ctx.tier, ctx.never),
77
+ })),
78
+ }));
79
+ }
80
+
81
+ /** A pick's outcome: the mix the list is recomposed with, what the harness mended (said under the group), and what it
82
+ * refused (the pick is not applied). */
83
+ export interface ListPick {
84
+ readonly mix: LayoutListMix;
85
+ readonly said: ReadonlyArray<string>;
86
+ readonly refused: ReadonlyArray<LayoutIssue>;
87
+ }
88
+
89
+ /** The mix with one ingredient set (a single word) or toggled (a word of a `many` ingredient). Pure. */
90
+ export function withListWord(mix: LayoutListMix, k: ListIngredient, word: string): LayoutListMix {
91
+ const next: LayoutListMix = structuredClone(mix);
92
+ if (k === 'move' || k === 'hover') {
93
+ const list = next[k] as string[];
94
+ (next as unknown as Record<string, string[]>)[k] = list.includes(word) ? list.filter(w => w !== word) : [...list, word];
95
+ } else if (k === 'who') {
96
+ if (word === LayoutListWho.None) delete next.standout;
97
+ else next.standout = { who: word as LayoutListWho, ...(next.standout?.how ? { how: next.standout.how } : {}) };
98
+ } else if (k === 'how') {
99
+ next.standout = { who: next.standout?.who ?? LayoutListWho.First, how: word as LayoutListHow };
100
+ } else {
101
+ (next as unknown as Record<string, string>)[k] = word;
102
+ }
103
+ return next;
104
+ }
105
+
106
+ /**
107
+ * The owner picks a word: refused outright when the word cannot be picked here (the row shows why), else the new mix
108
+ * judged by the ONE `checkList` — its mends applied and said, its refusals returned (the list stays as it was). Pure.
109
+ */
110
+ export function pickListWord(mix: LayoutListMix, k: ListIngredient, word: string, ctx: ListPanelContext): ListPick {
111
+ const refusal = listWordRefusal(k, word, ctx.shape, ctx.tier, ctx.never);
112
+ const adding = !(k === 'move' || k === 'hover') || !(mix[k] as string[]).includes(word);
113
+ if (refusal && adding) {
114
+ return { mix, said: [], refused: [{ code: LayoutIssueCode.Value, path: `list.${k}`, message: `${k} "${word}": ${refusal}` }] };
115
+ }
116
+ const next = withListWord(mix, k, word);
117
+ const issues = checkList(next, ctx.shape, 'list', ctx.never, { tier: ctx.tier });
118
+ const refused = issues.filter(i => !i.mend);
119
+ if (refused.length) return { mix, said: [], refused };
120
+ const mend = issues.map(i => i.mend).find(m => m?.kind === LayoutMendKind.List);
121
+ return { mix: mend?.kind === LayoutMendKind.List ? mend.mix : next, said: issues.map(i => i.message), refused: [] };
122
+ }
@@ -0,0 +1,205 @@
1
+ import {
2
+ LAYOUT_TEXT_KINDS, LayoutLayer, LayoutLayerKind, LayoutListArrange, LayoutListHover, LayoutListMix, LayoutRole, LayoutSection, LayoutSize,
3
+ } from './layout-language';
4
+ import { LIST_RHYTHMS } from './list-table';
5
+ import { LAYOUT_CHECK_VIEWPORT, layoutTextFits } from './layout-space';
6
+
7
+ /**
8
+ * Where a list sits in its section (list-ingredients-plan.md LI7, Doron 2026-11-22: "the page looks very empty"): a list
9
+ * whose items take less than its section's width — a deck is one card wide, any list can be set in a few columns — leaves
10
+ * a stretch of the section with nothing on it unless its words stand beside it. The judge reads the grid on the check's
11
+ * laptop (`LAYOUT_CHECK_VIEWPORT`); the pairing sets the section's words beside the list. Pure.
12
+ */
13
+
14
+ /** A deck is one card wide (LI4): at most this many px, and this share of its cell (the composer draws exactly this). */
15
+ export const LIST_DECK_MAX_PX = 440;
16
+ export const LIST_DECK_SHARE = 0.8;
17
+ /** The prompt's line for it (the layout brief reads it — one sentence, said once). */
18
+ export const LIST_WORDS_BESIDE_RULE =
19
+ 'a list that takes part of its section (a deck is one card wide) has its words beside it — a heading, a line, the link to all of it — or is centred under them; never a list beside an empty half';
20
+
21
+ /** The side of the section a list leaves empty: towards grid line 1 (`start`) or line 13 (`end`). */
22
+ export enum LayoutListSide {
23
+ Start = 'start',
24
+ End = 'end',
25
+ }
26
+
27
+ /** A list section that reads empty: the list layer, the side it leaves empty, and whether the section has words that read. */
28
+ export interface LayoutListBare {
29
+ layer: number;
30
+ side: `${LayoutListSide}`;
31
+ reads: boolean;
32
+ }
33
+
34
+ const GRID = 12;
35
+ const COLUMN_PX = LAYOUT_CHECK_VIEWPORT.width / GRID;
36
+ /** Columns with nothing on them at a list's rows, on one side, before the section reads empty (more than a third)… */
37
+ const BARE_COLUMNS = 5;
38
+ /** …unless the other side is as empty (a list centred under its words is a composition, not a gap). */
39
+ const BARE_SKEW = 2;
40
+ /** A list this many columns wide or fewer, with no words in its section, is a list on its own in the middle of nothing. */
41
+ const NARROW_COLUMNS = GRID / 2;
42
+ /** Paired: the words take the empty side's five columns, one column apart from the list's six. */
43
+ const PAIR_WORDS: Readonly<Record<LayoutListSide, [number, number]>> = { [LayoutListSide.Start]: [1, 6], [LayoutListSide.End]: [8, 13] };
44
+ const PAIR_LIST: Readonly<Record<LayoutListSide, [number, number]>> = { [LayoutListSide.Start]: [7, 13], [LayoutListSide.End]: [1, 7] };
45
+ /** The size a heading the pairing writes (the list's own name) is set at. */
46
+ const PAIR_HEADING_SIZE = LayoutSize.L;
47
+
48
+ const isList = (l: LayoutLayer) => l.kind === LayoutLayerKind.Gallery && !!l.gallery?.list && !!l.gallery?.source;
49
+ /** Words that read: a word, a heading, a line of text, a label, a number, a list of lines. */
50
+ const reads = (l: LayoutLayer) => LAYOUT_TEXT_KINDS.has(l.kind);
51
+ /** The section's words: what reads, and its buttons (the link to all of it). */
52
+ const isWords = (l: LayoutLayer) => reads(l) || l.kind === LayoutLayerKind.Button;
53
+ const placed = (l: LayoutLayer) => Array.isArray(l.col) && Array.isArray(l.row);
54
+ const overlaps = (p: readonly number[], q: readonly number[]) => p[0] < q[1] && q[0] < p[1];
55
+
56
+ /** The columns a list's items take on the laptop (grid lines, fractional): a deck a card wide in its cell's middle, any
57
+ * other arrangement its cell. */
58
+ export function layoutListDrawnCols(l: LayoutLayer): [number, number] {
59
+ const [a, b] = l.col;
60
+ if (l.gallery?.list?.arrange !== LayoutListArrange.Deck) return [a, b];
61
+ const cols = Math.min((b - a) * LIST_DECK_SHARE, LIST_DECK_MAX_PX / COLUMN_PX);
62
+ const mid = (a + b) / 2;
63
+ return [mid - cols / 2, mid + cols / 2];
64
+ }
65
+
66
+ /**
67
+ * The first list layer of a section that reads empty on the laptop, or null: at the list's rows, one side of the section
68
+ * has more than a third of its columns with nothing on them and the other side is not as empty, or the list is half the
69
+ * width or less and nothing in the section reads. A section that is not a grid of its own (ready-made, carried,
70
+ * sideways) is never judged.
71
+ */
72
+ export function layoutListBare(s: LayoutSection): LayoutListBare | null {
73
+ if (s.readyMade || s.carry || (s.track ?? 1) > 1 || !Array.isArray(s.layers)) return null;
74
+ const anyReads = s.layers.some(l => reads(l) && !!String(l.text ?? (l.items ?? []).join('')).trim());
75
+ for (let li = 0; li < s.layers.length; li++) {
76
+ const l = s.layers[li];
77
+ if (!isList(l) || !placed(l)) continue;
78
+ const [d0, d1] = layoutListDrawnCols(l);
79
+ const covered = Array.from({ length: GRID }, (_, k) => {
80
+ const centre = k + 1.5;
81
+ if (centre > d0 && centre < d1) return true;
82
+ return s.layers.some((o, oi) => oi !== li && placed(o) && overlaps(o.row, l.row) && centre > o.col[0] && centre < o.col[1]);
83
+ });
84
+ const start = covered.findIndex(c => c);
85
+ if (start < 0) continue;
86
+ const end = GRID - 1 - [...covered].reverse().findIndex(c => c);
87
+ const startRun = start;
88
+ const endRun = GRID - 1 - end;
89
+ const lopsided = Math.max(startRun, endRun) >= BARE_COLUMNS && Math.abs(startRun - endRun) >= BARE_SKEW;
90
+ const alone = !anyReads && d1 - d0 <= NARROW_COLUMNS;
91
+ if (lopsided || alone) return { layer: li, side: startRun >= endRun ? LayoutListSide.Start : LayoutListSide.End, reads: anyReads };
92
+ }
93
+ return null;
94
+ }
95
+
96
+ /**
97
+ * The pairing (LI7): the list takes six columns on its own side, the section's words — every word, heading, line and
98
+ * button, in reading order — the other five, stacked in the middle of the rows the list and its words spanned, each as
99
+ * tall as its words need. A section where nothing reads gets the list's own name as its heading (`heading` — the plan's
100
+ * name for the list, never a word made up). On a phone the words come first, then the list, then the rest as they were.
101
+ * Null when it cannot: another layer (a photo, a shape) stands where the words or the list would go, no words and no
102
+ * name, or more words than rows.
103
+ */
104
+ export function layoutListPair(s: LayoutSection, li: number, side: `${LayoutListSide}`, heading?: string | null): LayoutSection | null {
105
+ const list = s.layers?.[li];
106
+ if (!list || !isList(list) || !placed(list)) return null;
107
+ const next = structuredClone(s) as LayoutSection;
108
+ const name = String(heading ?? '').trim();
109
+ const anyReads = next.layers.some(l => reads(l) && !!String(l.text ?? (l.items ?? []).join('')).trim());
110
+ // What the words spanned before (the list's rows and theirs) is the pairing's height; a heading it writes has no place yet.
111
+ const before = next.layers.filter((l, i) => i !== li && isWords(l) && placed(l));
112
+ const r0 = Math.min(list.row[0], ...before.map(l => l.row[0]));
113
+ const r1 = Math.max(list.row[1], ...before.map(l => l.row[1]));
114
+ const rows = r1 - r0;
115
+ const added = anyReads ? -1 : next.layers.length;
116
+ if (!anyReads) {
117
+ if (!name) return null;
118
+ next.layers.push({ kind: LayoutLayerKind.Heading, role: LayoutRole.Support, text: name, size: PAIR_HEADING_SIZE, col: [1, 2], row: [r0, r0 + 1] });
119
+ }
120
+ const words = next.layers
121
+ .map((l, i) => ({ l, i }))
122
+ .filter(({ l, i }) => i !== li && isWords(l) && placed(l))
123
+ // The list's name it writes leads; the rest in reading order.
124
+ .sort((a, b) => Number(b.i === added) - Number(a.i === added) || a.l.row[0] - b.l.row[0] || a.l.col[0] - b.l.col[0] || a.i - b.i);
125
+ if (words.length > rows) return null;
126
+ const wordsCol = PAIR_WORDS[side as LayoutListSide];
127
+ const listCol = PAIR_LIST[side as LayoutListSide];
128
+ const others = next.layers.filter((l, i) => i !== li && !isWords(l) && placed(l));
129
+ if (others.some(o => overlaps(o.row, [r0, r1]) && (overlaps(o.col, wordsCol) || overlaps(o.col, listCol)))) return null;
130
+
131
+ // Each word as tall as its words need (one row at least), the block in the middle of the span.
132
+ const heights = words.map(() => 1);
133
+ const fits = (k: number) => layoutTextFits({ ...words[k].l, col: wordsCol, row: [0, heights[k]] }, next);
134
+ for (let grow = true; grow && heights.reduce((a, b) => a + b, 0) < rows;) {
135
+ const k = words.findIndex((_, j) => !fits(j));
136
+ grow = k >= 0;
137
+ if (grow) heights[k]++;
138
+ }
139
+ let at = r0 + Math.floor((rows - heights.reduce((a, b) => a + b, 0)) / 2);
140
+ words.forEach((w, k) => {
141
+ w.l.col = [...wordsCol];
142
+ w.l.row = [at, at + heights[k]];
143
+ at += heights[k];
144
+ });
145
+ next.layers[li].col = [...listCol];
146
+ next.layers[li].row = [r0, r1];
147
+
148
+ // A phone reads the words, then the list, then the rest in the order it had.
149
+ const was = Array.isArray(s.phone) && s.phone.length === s.layers.length ? s.phone : s.layers.map((_, i) => i);
150
+ const first = [...words.map(w => w.i), li];
151
+ next.phone = [...first, ...was.filter(i => !first.includes(i)), ...next.layers.map((_, i) => i).filter(i => !first.includes(i) && !was.includes(i))];
152
+ return next;
153
+ }
154
+
155
+ // ── AW11 (board award-lists, rule 2 "never cut"): the room a list paints past its items' boxes ─────────────────────
156
+
157
+ /** The room a list's frame keeps around its items, in px at the check's laptop: what leans, hangs or turns paints past
158
+ * its box, and its section clips (`overflow: clip`) — so the room is reserved INSIDE the frame, never left to chance. */
159
+ export interface ListOverhang {
160
+ blockStart: number;
161
+ blockEnd: number;
162
+ inline: number;
163
+ }
164
+
165
+ /** The box a turned item is measured on (a card a third of the laptop's row). */
166
+ const TURNED_ITEM = { width: 360, height: 480 } as const;
167
+ /** A card's own lift under the mouse (the look's card-lift is at most this), added where an item may rise. */
168
+ const LIFT_ROOM = 8;
169
+ const deg = (d: number) => (d * Math.PI) / 180;
170
+ const up4 = (px: number) => Math.ceil(px / 4) * 4;
171
+ /** How far a box's corner passes its own edge, turned by `d` degrees about its middle. */
172
+ function turnRoom(d: number): { block: number; inline: number } {
173
+ const t = deg(Math.abs(d));
174
+ const { width: w, height: h } = TURNED_ITEM;
175
+ return { block: (w / 2) * Math.sin(t) + (h / 2) * (1 - Math.cos(t)), inline: (h / 2) * Math.sin(t) + (w / 2) * (1 - Math.cos(t)) };
176
+ }
177
+
178
+ /**
179
+ * The room a list mix keeps (AW11, R-H-AW11-2) — from the contract's rhythms, never a guess: a gallery wall's items hang
180
+ * by margins (real room, inside the list), so it keeps only the lift of a picture under the mouse; a tilted list turns
181
+ * its items up to `tiltMaxDeg`; a hover tilt turns a card's ground by `hoverTiltDeg`. A fan holds its arc in its own
182
+ * height (the shared CSS), so it needs none here. Pure.
183
+ */
184
+ export function listOverhang(mix: Pick<LayoutListMix, 'arrange' | 'hover'>): ListOverhang {
185
+ let blockStart = 0;
186
+ let blockEnd = 0;
187
+ let inline = 0;
188
+ if (mix.arrange === LayoutListArrange.Hang) {
189
+ blockStart = LIFT_ROOM;
190
+ blockEnd = LIFT_ROOM;
191
+ }
192
+ if (mix.arrange === LayoutListArrange.Tilted) {
193
+ const room = turnRoom(LIST_RHYTHMS.tiltMaxDeg);
194
+ blockStart = Math.max(blockStart, room.block + LIFT_ROOM);
195
+ blockEnd = Math.max(blockEnd, room.block);
196
+ inline = Math.max(inline, room.inline);
197
+ }
198
+ if ((mix.hover ?? []).includes(LayoutListHover.Tilt)) {
199
+ const room = turnRoom(LIST_RHYTHMS.hoverTiltDeg);
200
+ blockStart = Math.max(blockStart, room.block);
201
+ blockEnd = Math.max(blockEnd, room.block);
202
+ inline = Math.max(inline, room.inline);
203
+ }
204
+ return { blockStart: up4(blockStart), blockEnd: up4(blockEnd), inline: up4(inline) };
205
+ }
@@ -37,3 +37,104 @@ export function listBuiltWords(k: ListIngredient): string[] {
37
37
  export function listMeaning(k: ListIngredient, word: string): string {
38
38
  return MEANINGS[`${k}.${word}`] ?? word;
39
39
  }
40
+
41
+ // ── AW11 (award-ingredients-plan.md §7.1f, board award-lists): the award tier, the rhythms, what each word needs ─────
42
+
43
+ /** AW-D23: a word every plan wears (`all`) or the award tier's alone (`pro`). */
44
+ export function listWordTier(k: ListIngredient, word: string): 'all' | 'pro' {
45
+ return (LIST_TABLE.tiers as Readonly<Record<string, string>>)[`${k}.${word}`] === 'pro' ? 'pro' : 'all';
46
+ }
47
+
48
+ /** May a build at `tier` wear this word? (`award` wears every word; anything else the `all` ones.) */
49
+ export function listWordOffered(k: ListIngredient, word: string, tier?: string | null): boolean {
50
+ return listWordTier(k, word) === 'all' || tier === 'award';
51
+ }
52
+
53
+ /** The word a round-two word is drawn as below the award tier (null: left out), from the contract's `belowPro`. */
54
+ export function listBelowPro(k: ListIngredient, word: string): string | null | undefined {
55
+ const stand = (LIST_TABLE.belowPro as Readonly<Record<string, string | null>>)[`${k}.${word}`];
56
+ return stand === undefined ? undefined : stand;
57
+ }
58
+
59
+ /** One step of a gallery wall: its share of a 12-column row and how far it hangs below the row's line (px). */
60
+ /** One step of the gallery wall: its share of a 12-column row, the bare columns before it (`start`), the margin it hangs
61
+ * below its row's line by, and its picture's shape. */
62
+ export interface ListHangStep { span: number; start?: number; drop: number; ratio: string }
63
+
64
+ /** The numbers the round-two arrangements are drawn with (the contract's `rhythms`, AW11-D3) — never the model's. */
65
+ export const LIST_RHYTHMS = LIST_TABLE.rhythms as unknown as {
66
+ readonly hang: ReadonlyArray<ListHangStep>;
67
+ readonly bento: ReadonlyArray<number>;
68
+ readonly tilt: ReadonlyArray<number>;
69
+ readonly tiltMaxDeg: number;
70
+ readonly fanRadius: number;
71
+ readonly hoverTiltDeg: number;
72
+ readonly hoverSettle: number;
73
+ readonly clipUpRise: number;
74
+ readonly numberBehindInk: number;
75
+ readonly colourRamp: ReadonlyArray<{ readonly ground: string; readonly ink: string }>;
76
+ };
77
+
78
+ /** The rules `checkList` holds, typed (the contract's `rules`). */
79
+ export const LIST_RULES = LIST_TABLE.rules as unknown as {
80
+ readonly minItems: number;
81
+ readonly strips: readonly [number, number];
82
+ readonly onlyStrips: { readonly how: ReadonlyArray<string>; readonly hover: ReadonlyArray<string> };
83
+ readonly onlyRow: { readonly who: ReadonlyArray<string>; readonly move: ReadonlyArray<string> };
84
+ readonly moving: ReadonlyArray<string>;
85
+ readonly neverSwipe: ReadonlyArray<string>;
86
+ readonly alone: ReadonlyArray<string>;
87
+ readonly counts: Readonly<Record<string, readonly [number, number]>>;
88
+ readonly bento: ReadonlyArray<number>;
89
+ readonly fanDragFrom: number;
90
+ readonly leaning: ReadonlyArray<string>;
91
+ readonly pictured: Readonly<Partial<Record<ListIngredient, ReadonlyArray<string>>>>;
92
+ readonly secondPicture: Readonly<Partial<Record<ListIngredient, ReadonlyArray<string>>>>;
93
+ readonly still: Readonly<Partial<Record<ListIngredient, ReadonlyArray<string>>>>;
94
+ readonly titleOnPhotoWords: number;
95
+ readonly rowsStandout: { readonly who: string; readonly how: string };
96
+ readonly middle?: ReadonlyArray<string>;
97
+ readonly notFirstScreen: Readonly<Partial<Record<ListIngredient, ReadonlyArray<string>>>>;
98
+ readonly onlyPictures: Readonly<Partial<Record<ListIngredient, ReadonlyArray<string>>>>;
99
+ };
100
+
101
+ /** The largest bento fill a list of `items` can show without a hole (3, 5 or 7), or null under the smallest. */
102
+ export function bentoFill(items: number): number | null {
103
+ const fills = LIST_RULES.bento.filter(n => n <= items);
104
+ return fills.length ? fills[fills.length - 1] : null;
105
+ }
106
+
107
+ /** Why a list cannot carry a word (R-H-AW11-7 — ONE table for the wire, the judge and Bindings ▸ List). */
108
+ export enum ListWordRefusal {
109
+ /** The award tier's word, on a plan below it (AW-D23). */
110
+ ProOnly = 'pro-only',
111
+ /** The word shows a picture in every item, and the list has none. */
112
+ NoPictures = 'no-pictures',
113
+ /** The word shows a second picture (the gallery role), and the list has none (AW11-D12). */
114
+ NoSecondPicture = 'no-second-picture',
115
+ /** The business type's lists never take it (L-D12, AW11-D7). */
116
+ Never = 'never',
117
+ }
118
+
119
+ /** What a list holds, as the word table reads it: its roles. */
120
+ export interface ListWordShape { readonly roles: ReadonlyArray<string> }
121
+
122
+ /** What a business's lists never do, as the word table reads it (`LayoutListNever`). */
123
+ export interface ListWordNever { readonly arranges: ReadonlyArray<string>; readonly moves: ReadonlyArray<string> }
124
+
125
+ const inRule = (rule: Readonly<Partial<Record<ListIngredient, ReadonlyArray<string>>>>, k: ListIngredient, w: string) => !!rule[k]?.includes(w);
126
+
127
+ /**
128
+ * Can this list carry this word — and if not, why (R-H-AW11-7)? The ONE answer the wire's offer, `checkList` and
129
+ * Bindings ▸ List read: a word the list's data cannot carry is never offered, never picked. `shape` null: nothing is
130
+ * known of the list (any word its tier allows). `tier` absent: no tier is judged (the judge's own tier step, the owner's
131
+ * builder).
132
+ */
133
+ export function listWordRefusal(k: ListIngredient, word: string, shape: ListWordShape | null, tier?: string | null, never?: ListWordNever | null): ListWordRefusal | null {
134
+ if (tier !== undefined && tier !== null && !listWordOffered(k, word, tier)) return ListWordRefusal.ProOnly;
135
+ if (never && ((k === 'arrange' && never.arranges.includes(word)) || (k === 'move' && never.moves.includes(word)))) return ListWordRefusal.Never;
136
+ if (!shape) return null;
137
+ if (inRule(LIST_RULES.pictured, k, word) && !shape.roles.includes('image')) return ListWordRefusal.NoPictures;
138
+ if (inRule(LIST_RULES.secondPicture, k, word) && !shape.roles.includes('gallery')) return ListWordRefusal.NoSecondPicture;
139
+ return null;
140
+ }
@@ -706,7 +706,8 @@ export const NODE_BASELINES: Readonly<Record<string, NodeBaseline>> = {
706
706
  "marqueeFade",
707
707
  "marqueePauseOnHover",
708
708
  "seam",
709
- "sectionShape"
709
+ "sectionShape",
710
+ "listMix"
710
711
  ],
711
712
  "styleTraits": [
712
713
  "position",
@@ -3251,6 +3252,7 @@ export const NODE_BASELINES: Readonly<Record<string, NodeBaseline>> = {
3251
3252
  "__effectsLabel",
3252
3253
  "effect",
3253
3254
  "speed",
3255
+ "creativePreset",
3254
3256
  "scrollPlays",
3255
3257
  "__navLabel",
3256
3258
  "controlsPlacement",
@@ -63,6 +63,8 @@ export * from './check-layout';
63
63
  export * from './check-list';
64
64
  export * from './list-table';
65
65
  export * from './layout-space';
66
+ export * from './list-space';
67
+ export * from './list-panel';
66
68
  export * from './layout-fingerprint';
67
69
  export * from './header-mix';
68
70
  export * from './header-edit';
@@ -14,6 +14,8 @@ export interface SerializedBinding {
14
14
  prop: string;
15
15
  source: string;
16
16
  path: string;
17
+ /** Render-time transforms (iox-ui `applyBindingPipes`) — AW11's colour block writes its ground and ink pipes. */
18
+ pipes?: Array<{ name: string; args?: unknown[] }>;
17
19
  }
18
20
 
19
21
  /** Per breakpoint: the styles a width overrides, and the component inputs it overrides (a slider's slides per view —
@@ -47,6 +47,9 @@ export enum ContentFieldControl {
47
47
  List = 'list',
48
48
  Number = 'number',
49
49
  Switch = 'switch',
50
+ /** AW11-D10: the item's own colour (a colour block's ground) — the admin's colour picker; a hex is drawn, a token or
51
+ * a gradient leaves the look's ramp in place. */
52
+ Colour = 'colorPicker',
50
53
  }
51
54
 
52
55
  /** How a field is stored. The schema editor's and the item editor's own list: anything else renders no input. */
@@ -66,6 +69,7 @@ export const FIELD_TYPE_OF_CONTROL: Readonly<Record<ContentFieldControl, Content
66
69
  [ContentFieldControl.List]: ContentFieldType.Array,
67
70
  [ContentFieldControl.Number]: ContentFieldType.Number,
68
71
  [ContentFieldControl.Switch]: ContentFieldType.Boolean,
72
+ [ContentFieldControl.Colour]: ContentFieldType.String,
69
73
  };
70
74
 
71
75
  export interface ContentFieldPlan {
@@ -106,6 +110,8 @@ export enum ContentRole {
106
110
  Person = 'person',
107
111
  /** LI0: where the item leads — its own page or an address. */
108
112
  Link = 'link',
113
+ /** AW11-D10: its own colour (a hex) — a colour block's ground; the ink on it is chosen when the page is drawn. */
114
+ Colour = 'colour',
109
115
  /** Commerce C-D21: the shop's own price — played only by the shop's fields (`SHOP_ROLES`), never a content type's. */
110
116
  Price = 'price',
111
117
  /** Commerce C-D21: the shop's earlier price, struck through. */