@vectoriox/iox-ui 5.125.0 → 5.126.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.
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +3239 -155
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +482 -0
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/generation-core/index.d.ts +2889 -167
- package/harness-core/index.d.ts +270 -0
- package/package.json +1 -1
- package/src/generation-core/check-list.ts +28 -9
- package/src/generation-core/footer-mix.ts +67 -8
- package/src/generation-core/layout-language.ts +18 -0
- package/src/generation-core/site-spec.generated.ts +3016 -24
- package/src/harness-core/harness-spec.generated.ts +482 -0
|
@@ -24,22 +24,37 @@ export enum FooterIngredient {
|
|
|
24
24
|
Ground = 'ground',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/** The words, by the table (a word that waits for its phase too — `footerWords` offers only the drawn ones). */
|
|
27
28
|
export enum FooterArrange {
|
|
28
29
|
Columns = 'columns',
|
|
29
30
|
Centred = 'centred',
|
|
30
31
|
Line = 'line',
|
|
32
|
+
Ruled = 'ruled',
|
|
33
|
+
ListBig = 'list-big',
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export enum FooterHold {
|
|
34
37
|
Pages = 'pages',
|
|
35
38
|
Visit = 'visit',
|
|
36
39
|
Contact = 'contact',
|
|
40
|
+
Newsletter = 'newsletter',
|
|
41
|
+
Legal = 'legal',
|
|
42
|
+
Payments = 'payments',
|
|
43
|
+
Clock = 'clock',
|
|
44
|
+
Marquee = 'marquee',
|
|
45
|
+
Badges = 'badges',
|
|
46
|
+
Region = 'region',
|
|
47
|
+
Search = 'search',
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
export enum FooterClosing {
|
|
40
51
|
None = 'none',
|
|
41
52
|
Call = 'call',
|
|
42
53
|
Name = 'name',
|
|
54
|
+
Statement = 'statement',
|
|
55
|
+
Word = 'word',
|
|
56
|
+
Newsletter = 'newsletter',
|
|
57
|
+
NameAndAction = 'name-and-action',
|
|
43
58
|
}
|
|
44
59
|
|
|
45
60
|
export enum FooterGround {
|
|
@@ -47,6 +62,10 @@ export enum FooterGround {
|
|
|
47
62
|
Plain = 'plain',
|
|
48
63
|
Subtle = 'subtle',
|
|
49
64
|
Accent = 'accent',
|
|
65
|
+
Film = 'film',
|
|
66
|
+
Scene = 'scene',
|
|
67
|
+
Pattern = 'pattern',
|
|
68
|
+
Inset = 'inset',
|
|
50
69
|
}
|
|
51
70
|
|
|
52
71
|
/** One word per ingredient; `holds` several, in the table's order. */
|
|
@@ -62,22 +81,37 @@ export class FooterMixError extends Error {}
|
|
|
62
81
|
const INGREDIENTS = F.ingredients as unknown as Readonly<Record<string, ReadonlyArray<string>>>;
|
|
63
82
|
const MEANINGS = F.meanings as Readonly<Record<string, string>>;
|
|
64
83
|
const MANY: ReadonlyArray<string> = F.many;
|
|
84
|
+
/** A word the product does not draw yet (award-ingredients-plan.md AW0): the phase it waits for and the built word it is
|
|
85
|
+
* drawn as meanwhile (null: drawn without it). */
|
|
86
|
+
export interface FooterWait { phase: string; drawnAs: string | null }
|
|
87
|
+
const WAITS = F.waits as unknown as Readonly<Record<string, FooterWait>>;
|
|
65
88
|
|
|
66
89
|
/** The footer pattern a plan names when it names none the table knows (the Studio footer). */
|
|
67
90
|
export const DEFAULT_FOOTER_PATTERN = 'footer.three-column';
|
|
68
91
|
|
|
69
|
-
/**
|
|
70
|
-
export function
|
|
92
|
+
/** Every word of an ingredient in the table, waiting ones too. */
|
|
93
|
+
export function footerTableWords(ingredient: `${FooterIngredient}`): ReadonlyArray<string> {
|
|
71
94
|
return INGREDIENTS[ingredient] ?? [];
|
|
72
95
|
}
|
|
73
96
|
|
|
97
|
+
/** The wait of a word, or null when the product draws it. */
|
|
98
|
+
export function footerWait(ingredient: `${FooterIngredient}`, word: string): FooterWait | null {
|
|
99
|
+
return WAITS[`${ingredient}.${word}`] ?? null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The words an ingredient may take — the DRAWN ones, the only ones the wire, the brief and the mender offer
|
|
103
|
+
* (ingredients.md §3.3: offering a waiting word would put its stand-in on every site that asked for it). */
|
|
104
|
+
export function footerWords(ingredient: `${FooterIngredient}`): ReadonlyArray<string> {
|
|
105
|
+
return footerTableWords(ingredient).filter(w => !footerWait(ingredient, w));
|
|
106
|
+
}
|
|
107
|
+
|
|
74
108
|
/** What a word means, as the brief and the builder say it. */
|
|
75
109
|
export function footerMeaning(ingredient: `${FooterIngredient}`, word: string): string {
|
|
76
110
|
return MEANINGS[`${ingredient}.${word}`] ?? word;
|
|
77
111
|
}
|
|
78
112
|
|
|
79
113
|
/** A word list in the table's order, each once. */
|
|
80
|
-
const inOrder = (k: string, words: ReadonlyArray<string>): string[] =>
|
|
114
|
+
const inOrder = (k: string, words: ReadonlyArray<string>): string[] => footerTableWords(k as FooterIngredient).filter(w => words.includes(w));
|
|
81
115
|
|
|
82
116
|
/** A whole mix from part of one: what is not named is the default. Refuses a word the table lacks. */
|
|
83
117
|
export function footerMix(partial: Partial<FooterMix> = {}): FooterMix {
|
|
@@ -87,7 +121,7 @@ export function footerMix(partial: Partial<FooterMix> = {}): FooterMix {
|
|
|
87
121
|
if (!INGREDIENTS[k]) throw new FooterMixError(`no footer ingredient "${k}"`);
|
|
88
122
|
const words = typeof v === 'string' ? [v] : v as ReadonlyArray<string>;
|
|
89
123
|
if (MANY.includes(k) !== (typeof v !== 'string')) throw new FooterMixError(`a footer's ${k} is ${MANY.includes(k) ? 'a list of words' : 'one word'}`);
|
|
90
|
-
for (const w of words) if (!INGREDIENTS[k].includes(w)) throw new FooterMixError(`a footer's ${k} cannot be "${w}" (${
|
|
124
|
+
for (const w of words) if (!INGREDIENTS[k].includes(w)) throw new FooterMixError(`a footer's ${k} cannot be "${w}" (${footerWords(k as FooterIngredient).join(' · ')})`);
|
|
91
125
|
mix[k] = MANY.includes(k) ? inOrder(k, words) : words[0];
|
|
92
126
|
}
|
|
93
127
|
return mix as unknown as FooterMix;
|
|
@@ -113,9 +147,27 @@ export function footerMixWords(mix: FooterMix): string[] {
|
|
|
113
147
|
return Object.values(FooterIngredient).flatMap(k => (MANY.includes(k) ? mix[k] as ReadonlyArray<string> : [mix[k] as string]).map(w => `${k}:${w}`));
|
|
114
148
|
}
|
|
115
149
|
|
|
116
|
-
/** Every `<ingredient>:<word>` the wire may carry
|
|
150
|
+
/** Every `<ingredient>:<word>` the wire may carry: the drawn words only. */
|
|
117
151
|
export function footerWireWords(): string[] {
|
|
118
|
-
return Object.values(FooterIngredient).flatMap(k => footerWords(k).
|
|
152
|
+
return Object.values(FooterIngredient).flatMap(k => footerWords(k).map(w => `${k}:${w}`));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** A mix as the product can draw it today: every waiting word drawn as its stand-in (a held block with none is left
|
|
156
|
+
* out), and the words that waited, for the check to say. A drawn mix comes back unchanged. Pure. */
|
|
157
|
+
export function drawnFooterMix(mix: FooterMix): { mix: FooterMix; waited: Array<{ ingredient: FooterIngredient; word: string } & FooterWait> } {
|
|
158
|
+
const waited: Array<{ ingredient: FooterIngredient; word: string } & FooterWait> = [];
|
|
159
|
+
const drawn = (k: FooterIngredient, w: string): string | null => {
|
|
160
|
+
const wait = footerWait(k, w);
|
|
161
|
+
if (!wait) return w;
|
|
162
|
+
waited.push({ ingredient: k, word: w, ...wait });
|
|
163
|
+
return wait.drawnAs;
|
|
164
|
+
};
|
|
165
|
+
const one = (k: FooterIngredient): string => drawn(k, mix[k] as string) ?? (F.defaults as unknown as FooterMix)[k] as string;
|
|
166
|
+
// In the table's order, so the words that waited are said as the table reads.
|
|
167
|
+
const arrange = one(FooterIngredient.Arrange);
|
|
168
|
+
const holds = inOrder(FooterIngredient.Holds, mix.holds.map(h => drawn(FooterIngredient.Holds, h)).filter((h): h is string => !!h));
|
|
169
|
+
const out = { arrange, holds, closing: one(FooterIngredient.Closing), ground: one(FooterIngredient.Ground) };
|
|
170
|
+
return { mix: waited.length ? out : mix, waited };
|
|
119
171
|
}
|
|
120
172
|
|
|
121
173
|
/** The words back into a mix: an ingredient not named is the default; a `holds` named is the whole list. Refuses an unknown
|
|
@@ -168,6 +220,8 @@ export enum FooterRepairCode {
|
|
|
168
220
|
NameTooLong = 'name-too-long',
|
|
169
221
|
/** Another site already wears this footer: the nearest free one (`distinctFooter`). */
|
|
170
222
|
Worn = 'worn',
|
|
223
|
+
/** A word the product draws in a later phase: drawn as its stand-in meanwhile (the table's `waits`). */
|
|
224
|
+
Waits = 'waits',
|
|
171
225
|
}
|
|
172
226
|
|
|
173
227
|
export interface FooterRepair {
|
|
@@ -195,8 +249,12 @@ const nameWidthEm = (ctx: FooterContext): number => textWidthEm(ctx.name, elemen
|
|
|
195
249
|
* The ONE judge of a footer mix: what the table's rules refuse is mended to the nearest mix that keeps them, and each mend
|
|
196
250
|
* is said. Never throws on a well-formed mix. Pure.
|
|
197
251
|
*/
|
|
198
|
-
export function checkFooter(
|
|
252
|
+
export function checkFooter(given: FooterMix, ctx: FooterContext): { mix: FooterMix; repairs: FooterRepair[] } {
|
|
199
253
|
const repairs: FooterRepair[] = [];
|
|
254
|
+
const { mix, waited } = drawnFooterMix(given);
|
|
255
|
+
if (waited.length) {
|
|
256
|
+
repairs.push({ code: FooterRepairCode.Waits, said: waited.map(w => `the footer's ${w.ingredient} "${w.word}" is drawn in ${w.phase}: ${w.drawnAs ? `"${w.drawnAs}" meanwhile` : 'left out meanwhile'}`).join('; ') });
|
|
257
|
+
}
|
|
200
258
|
let holds = inOrder(FooterIngredient.Holds, mix.holds);
|
|
201
259
|
let closing = mix.closing;
|
|
202
260
|
if (mix.arrange === FooterArrange.Line) {
|
|
@@ -284,7 +342,8 @@ function bodyOf(mix: FooterMix, ctx: FooterContext): PatternNode[] {
|
|
|
284
342
|
}
|
|
285
343
|
|
|
286
344
|
/** A footer mix as a pattern: what the composer stamps as the site's footer (global, after the page). Check it first. */
|
|
287
|
-
export function footerPattern(
|
|
345
|
+
export function footerPattern(given: FooterMix, ctx: FooterContext): SitePattern {
|
|
346
|
+
const mix = drawnFooterMix(given).mix;
|
|
288
347
|
const plain = mix.ground === FooterGround.Plain;
|
|
289
348
|
const call = mix.closing === FooterClosing.Call ? [mix.arrange === FooterArrange.Columns ? part('call') : centred(part('call'))] : [];
|
|
290
349
|
const name = mix.closing === FooterClosing.Name ? [closingName(ctx)] : [];
|
|
@@ -168,9 +168,15 @@ export enum LayoutNavKind {
|
|
|
168
168
|
|
|
169
169
|
/** List ingredients (list-ingredients-plan.md §2): the seven choices a list section mixes. Held equal to the contract's
|
|
170
170
|
* `site.layout.list` by layout-language.spec. */
|
|
171
|
+
/** The list words, by the contract's table — a word that waits for its phase too (only `listBuiltWords` are offered;
|
|
172
|
+
* `checkList` draws a waiting one as its stand-in). */
|
|
171
173
|
export enum LayoutListItem {
|
|
172
174
|
Photo = 'photo',
|
|
173
175
|
Card = 'card',
|
|
176
|
+
TitleOnPhoto = 'title-on-photo',
|
|
177
|
+
Packshot = 'packshot',
|
|
178
|
+
ColourBlock = 'colour-block',
|
|
179
|
+
Numbered = 'numbered',
|
|
174
180
|
}
|
|
175
181
|
|
|
176
182
|
export enum LayoutListArrange {
|
|
@@ -179,6 +185,12 @@ export enum LayoutListArrange {
|
|
|
179
185
|
Masonry = 'masonry',
|
|
180
186
|
Strips = 'strips',
|
|
181
187
|
Deck = 'deck',
|
|
188
|
+
Hang = 'hang',
|
|
189
|
+
Bento = 'bento',
|
|
190
|
+
Rows = 'rows',
|
|
191
|
+
Stage = 'stage',
|
|
192
|
+
Fan = 'fan',
|
|
193
|
+
Tilted = 'tilted',
|
|
182
194
|
}
|
|
183
195
|
|
|
184
196
|
export enum LayoutListWho {
|
|
@@ -200,6 +212,7 @@ export enum LayoutListMove {
|
|
|
200
212
|
Drag = 'drag',
|
|
201
213
|
Auto = 'auto',
|
|
202
214
|
Page = 'page',
|
|
215
|
+
Rows = 'rows',
|
|
203
216
|
}
|
|
204
217
|
|
|
205
218
|
export enum LayoutListHover {
|
|
@@ -207,12 +220,17 @@ export enum LayoutListHover {
|
|
|
207
220
|
Open = 'open',
|
|
208
221
|
Zoom = 'zoom',
|
|
209
222
|
Dim = 'dim',
|
|
223
|
+
Swap = 'swap',
|
|
224
|
+
Unveil = 'unveil',
|
|
225
|
+
Fill = 'fill',
|
|
226
|
+
Tilt = 'tilt',
|
|
210
227
|
}
|
|
211
228
|
|
|
212
229
|
export enum LayoutListArrive {
|
|
213
230
|
Together = 'together',
|
|
214
231
|
OneByOne = 'one-by-one',
|
|
215
232
|
SlideIn = 'slide-in',
|
|
233
|
+
ClipUp = 'clip-up',
|
|
216
234
|
}
|
|
217
235
|
|
|
218
236
|
export enum LayoutListPhone {
|