@vectoriox/iox-ui 5.197.0 → 5.199.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/actions-core/index.d.ts +7 -1
- package/composite-core/index.d.ts +16 -2
- package/data-core/index.d.ts +11 -3
- package/design-core/index.d.ts +185 -28
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +6 -1
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +34 -2
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-data-core.mjs +30 -4
- package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +323 -72
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +17351 -15175
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +243 -38
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +2 -2
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1703 -264
- package/harness-core/index.d.ts +93 -6
- package/package.json +1 -1
- package/src/actions-core/element-actions.ts +6 -0
- package/src/composite-core/header.ts +34 -1
- package/src/data-core/placeholder-rows.ts +29 -4
- package/src/design-core/brand.ts +58 -5
- package/src/design-core/contrast-audit.ts +49 -22
- package/src/design-core/design-apply.ts +34 -3
- package/src/design-core/flavor-fixtures.generated.ts +123 -123
- package/src/design-core/flavor-spec.generated.ts +44 -4
- package/src/design-core/flavor-tokens.ts +1 -1
- package/src/design-core/header-behaviour.ts +72 -13
- package/src/design-core/menu-look.ts +23 -0
- package/src/design-core/motion-language.ts +5 -14
- package/src/design-core/node-classes.ts +39 -0
- package/src/design-core/preloader.ts +4 -5
- package/src/generation-core/body-mix.ts +40 -102
- package/src/generation-core/check-free.ts +22 -11
- package/src/generation-core/check-layout.ts +10 -4
- package/src/generation-core/check-list.ts +3 -25
- package/src/generation-core/colour-mix.ts +296 -0
- package/src/generation-core/compose-free.ts +47 -20
- package/src/generation-core/compose-site.ts +259 -59
- package/src/generation-core/footer-mix.ts +258 -64
- package/src/generation-core/free-fallback.ts +6 -4
- package/src/generation-core/free-opening.ts +13 -2
- package/src/generation-core/free-parts.ts +87 -0
- package/src/generation-core/free-slot-words.ts +30 -0
- package/src/generation-core/free-wire.ts +8 -0
- package/src/generation-core/generation-tier.ts +6 -17
- package/src/generation-core/header-mix.ts +73 -3
- package/src/generation-core/layout-drawers.ts +3 -2
- package/src/generation-core/layout-wire.ts +10 -16
- package/src/generation-core/legal.ts +24 -0
- package/src/generation-core/list-panel.ts +3 -3
- package/src/generation-core/list-table.ts +5 -14
- package/src/generation-core/list-words.ts +2 -1
- package/src/generation-core/menu-shelves.ts +138 -0
- package/src/generation-core/nav-shape.ts +138 -15
- package/src/generation-core/node-baselines.generated.ts +1 -0
- package/src/generation-core/opening-mix.ts +7 -34
- package/src/generation-core/part-tier.ts +14 -0
- package/src/generation-core/patterns.ts +7 -0
- package/src/generation-core/plan-wire.ts +32 -43
- package/src/generation-core/public-api.ts +3 -0
- package/src/generation-core/site-build-run.ts +8 -0
- package/src/generation-core/site-plan.model.ts +3 -0
- package/src/generation-core/site-spec.generated.ts +1383 -189
- package/src/generation-core/validate-site-plan.ts +6 -5
- package/src/harness-core/business-types.ts +4 -0
- package/src/harness-core/harness-spec.generated.ts +189 -30
- package/src/harness-core/popup-stance.ts +56 -3
- package/src/harness-core/run-compose-context.ts +25 -5
- package/styles/iox-design.css +162 -3
|
@@ -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),
|
|
10
|
-
*
|
|
11
|
-
* word, its meaning in both languages, whether the product draws it, its tier, each seam's geometry and each
|
|
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
|
|
14
|
-
* `
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
-
|
|
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
|
-
/**
|
|
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)
|
|
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,
|
|
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>/<
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
!
|
|
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
|
|
436
|
-
*
|
|
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
|
|
440
|
-
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
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
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
DesignTokenLike, elementStyleById, parseHexColor, ResolvedMode,
|
|
2
|
+
DesignTokenLike, elementStyleById, parseHexColor, ResolvedMode, schemeTokenResolver, wcagContrastRatio,
|
|
3
3
|
} from '@vectoriox/iox-ui/design-core';
|
|
4
4
|
import {
|
|
5
5
|
FREE_ELEMENT_STYLES, FREE_HOLDERS, FREE_LEAD_ROLE, FREE_MOVES, FREE_PHONE_LAYERS, FREE_WORD_TYPES, FreeLayer, FreeNode,
|
|
6
|
-
FreeNodeType, FreePage, FreePictures, FreePurpose, FreeStyle, FreeTrigger, walkFree,
|
|
6
|
+
FreeNodeType, FreePage, FreePictures, FreePurpose, freeSchemeOf, FreeStyle, FreeTrigger, walkFree,
|
|
7
7
|
} from './free-wire';
|
|
8
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
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
|
-
|
|
49
|
-
|
|
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
|
}
|
|
@@ -388,23 +391,31 @@ function groundHex(grounds: ReadonlyArray<string | null>, values: Readonly<Recor
|
|
|
388
391
|
return null;
|
|
389
392
|
}
|
|
390
393
|
|
|
394
|
+
/** The node types whose words the tree pair check judges: the words, and a Button's label (iox-ui#186). */
|
|
395
|
+
const PAIRED_TYPES: ReadonlyArray<FreeNodeType> = [FreeNodeType.Heading, FreeNodeType.Text, FreeNodeType.Button];
|
|
396
|
+
|
|
391
397
|
/**
|
|
392
|
-
* THE TREE PAIR CHECK (R-H12, gate 2's tree half — `auditDesignContrast` judges the look, not a tree): each Heading's
|
|
393
|
-
* Text's ink token against the ground token of the nearest painted node, resolved in every mode the site
|
|
394
|
-
* (4.5, 3 for display / h1 / h2).
|
|
395
|
-
*
|
|
398
|
+
* THE TREE PAIR CHECK (R-H12, gate 2's tree half — `auditDesignContrast` judges the look, not a tree): each Heading's,
|
|
399
|
+
* Text's and Button's ink token against the ground token of the nearest painted node, resolved in every mode the site
|
|
400
|
+
* shows, AA (4.5, 3 for display / h1 / h2). Every token is resolved INSIDE the schemes the stamp gives the boxes above
|
|
401
|
+
* (`freeSchemeOf`, iox-ui#186) — so a dark band's plain `text` reads its light ink, as it renders. A Button is judged too:
|
|
402
|
+
* its element style paints its ink (and, when it paints none, the ground beneath shows through — an outline button on a
|
|
403
|
+
* band the look never audited). A pair that is not two hex tokens (a colour-mix, a picture behind) is left to the
|
|
404
|
+
* real-pixel check.
|
|
396
405
|
*/
|
|
397
406
|
export function freeContrastIssues(page: FreePage, ctx: Pick<FreeJudgeContext, 'tokens' | 'modes'>): FreeIssue[] {
|
|
398
407
|
const out: FreeIssue[] = [];
|
|
399
|
-
const resolved = (ctx.modes?.length ? ctx.modes : (['light'] as ResolvedMode[])).map(mode => ({ mode,
|
|
408
|
+
const resolved = (ctx.modes?.length ? ctx.modes : (['light'] as ResolvedMode[])).map(mode => ({ mode, valuesIn: schemeTokenResolver(ctx.tokens, mode) }));
|
|
400
409
|
for (const { node, path, up, section } of walkFree(page?.sections ?? [])) {
|
|
401
410
|
if (page.sections[section]?.readyMade) continue;
|
|
402
|
-
if (
|
|
411
|
+
if (!PAIRED_TYPES.includes(node.type)) continue;
|
|
403
412
|
const ink = inkOf(node, up);
|
|
404
413
|
if (!ink) continue;
|
|
405
414
|
const grounds = groundsOf(node, up);
|
|
415
|
+
const schemes = up.map(freeSchemeOf).filter((s): s is string => !!s);
|
|
406
416
|
const need = LARGE_STYLES.includes(node.elementStyle ?? '') ? FREE_CONTRAST.large : FREE_CONTRAST.text;
|
|
407
|
-
for (const { mode,
|
|
417
|
+
for (const { mode, valuesIn } of resolved) {
|
|
418
|
+
const values = valuesIn(schemes.length ? schemes : 'default');
|
|
408
419
|
const a = values[ink];
|
|
409
420
|
const ground = groundHex(grounds, values);
|
|
410
421
|
if (!a || !ground || !parseHexColor(a)) continue;
|
|
@@ -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,
|
|
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
|
-
/**
|
|
82
|
-
* it (`
|
|
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(...
|
|
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,
|
|
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
|
-
/**
|
|
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
|
|
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) {
|