@vectoriox/iox-ui 5.141.0 → 5.143.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/composite-core/index.d.ts +40 -1
- package/design-core/index.d.ts +262 -28
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +155 -90
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +539 -268
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs +61 -4
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1547 -742
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +510 -20
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +170 -22
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/forms-core/index.d.ts +17 -3
- package/generation-core/index.d.ts +638 -148
- package/harness-core/index.d.ts +359 -20
- package/index.d.ts +94 -10
- package/package.json +1 -1
- package/src/composite-core/accordion.ts +16 -1
- package/src/composite-core/card.ts +22 -2
- package/src/composite-core/consent.ts +2 -2
- package/src/composite-core/recipe-parts.ts +7 -0
- package/src/composite-core/segmented.ts +17 -2
- package/src/composite-core/slider.ts +19 -3
- package/src/composite-core/tabs.ts +16 -1
- package/src/design-core/contrast-audit.ts +18 -0
- package/src/design-core/flavor-spec.generated.ts +212 -25
- package/src/design-core/ink-on-ground.ts +36 -0
- package/src/design-core/list-classes.ts +37 -0
- package/src/design-core/locale-direction.ts +24 -0
- package/src/design-core/menu-look.ts +2 -1
- package/src/design-core/node-classes.ts +3 -2
- package/src/design-core/public-api.ts +3 -0
- package/src/forms-core/form-presets.ts +72 -3
- package/src/generation-core/check-layout.ts +4 -1
- package/src/generation-core/check-list.ts +144 -5
- package/src/generation-core/compose-layout.ts +165 -20
- package/src/generation-core/compose-site.ts +58 -21
- package/src/generation-core/footer-mix.ts +8 -0
- package/src/generation-core/layout-fingerprint.ts +5 -1
- package/src/generation-core/layout-language.ts +5 -0
- package/src/generation-core/layout-wire.ts +64 -24
- package/src/generation-core/list-panel.ts +122 -0
- package/src/generation-core/list-space.ts +54 -1
- package/src/generation-core/list-table.ts +101 -0
- package/src/generation-core/nav-shape.ts +3 -2
- package/src/generation-core/node-baselines.generated.ts +3 -1
- package/src/generation-core/patterns.ts +4 -0
- package/src/generation-core/public-api.ts +1 -0
- package/src/generation-core/serialized-node.ts +2 -0
- package/src/generation-core/site-plan.model.ts +16 -2
- package/src/generation-core/site-spec.generated.ts +469 -201
- package/src/generation-core/validate-site-plan.ts +8 -4
- package/src/harness-core/business-types.ts +11 -0
- package/src/harness-core/film-idea.ts +178 -0
- package/src/harness-core/harness-spec.generated.ts +380 -18
- package/src/harness-core/intake.ts +8 -1
- package/src/harness-core/public-api.ts +1 -0
- package/styles/iox-design.css +420 -45
|
@@ -6,7 +6,7 @@ import { SEO_DESCRIPTION_MAX, SEO_TITLE_MAX } from '@vectoriox/iox-ui/seo-core';
|
|
|
6
6
|
import {
|
|
7
7
|
BindScope, patternById, patternHasForm, patternLinkSlots, patternNeedsBinding, patternOptionalParts, patternRoleNeeds, patternTakesBinding, patternScopes,
|
|
8
8
|
patternSlots, PatternGlobalPosition, slotBudget, SCENE_LEVEL, SCENE_OTHER_PAGES } from './patterns';
|
|
9
|
-
import { ContentFieldControl, FIELD_TYPE_OF_CONTROL,
|
|
9
|
+
import { ContentFieldControl, ContentRole, FIELD_TYPE_OF_CONTROL,
|
|
10
10
|
FACT_KEYS, GlobalSlot, PAGE_ARCHETYPES, SITE_NEED_IDS, PlanDataSourceMode, PlanDataSourceType, RelativeOp, REQUIRED_CONTENT_ROLES, ShopResource, SitePlan,
|
|
11
11
|
SitePlanSourceKind, SITE_LOCALES, SITE_PLAN_VERSION, GenerationTier, STAMPED_PAGE_ARCHETYPES,
|
|
12
12
|
} from './site-plan.model';
|
|
@@ -294,7 +294,8 @@ function validateContentTypes(c: Collector, list: unknown[]): Map<string, Conten
|
|
|
294
294
|
c.unique(names, j => `${path}.fields[${j}].name`, 'field');
|
|
295
295
|
const fieldSet = new Set(names.filter((n): n is string => !!n));
|
|
296
296
|
const fieldTypes = new Map(fields.filter(isObject).map(f => [f['name'], f['type']]));
|
|
297
|
-
const
|
|
297
|
+
const fieldControls = new Map(fields.filter(isObject).map(f => [f['name'], f['controller']]));
|
|
298
|
+
const roles = validateRoles(c, raw['roles'], `${path}.roles`, name, fieldSet, fieldTypes, fieldControls);
|
|
298
299
|
const seed = raw['seed'];
|
|
299
300
|
if (seed !== undefined) {
|
|
300
301
|
if (!isObject(seed)) c.add(SitePlanIssueCode.Shape, `${path}.seed`, 'must be an object');
|
|
@@ -324,14 +325,17 @@ function validateContentTypes(c: Collector, list: unknown[]): Map<string, Conten
|
|
|
324
325
|
|
|
325
326
|
const describeField = (f: Obj) => ({ name: String(f['name']), type: typeof f['type'] === 'string' ? f['type'] : undefined, controller: typeof f['controller'] === 'string' ? f['controller'] : undefined });
|
|
326
327
|
|
|
327
|
-
/** A content type's roles (L0-3): known roles only, each played by a field of the type; `title` always; `gallery` a list
|
|
328
|
-
|
|
328
|
+
/** A content type's roles (L0-3): known roles only, each played by a field of the type; `title` always; `gallery` a list;
|
|
329
|
+
* `colour` (AW11-D10) a colour-picker field — any other field would paint a block from words. */
|
|
330
|
+
function validateRoles(c: Collector, roles: unknown, path: string, typeName: string | null, fields: Set<string>, fieldTypes: Map<unknown, unknown>,
|
|
331
|
+
fieldControls: Map<unknown, unknown>): Record<string, string> {
|
|
329
332
|
if (!isObject(roles)) { c.add(SitePlanIssueCode.Shape, path, 'must be an object (which field plays each role)'); return {}; }
|
|
330
333
|
const out: Record<string, string> = {};
|
|
331
334
|
for (const [role, field] of Object.entries(roles)) {
|
|
332
335
|
if (!ROLE_KEYS.includes(role)) { c.add(SitePlanIssueCode.UnknownRole, `${path}.${role}`, `"${role}" is not a role (${ROLE_KEYS.join(', ')})`); continue; }
|
|
333
336
|
if (typeof field !== 'string' || !fields.has(field)) { c.add(SitePlanIssueCode.UnknownRole, `${path}.${role}`, `"${String(field)}" is not a field of ${typeName}`); continue; }
|
|
334
337
|
if (role === 'gallery' && fieldTypes.get(field) !== ARRAY_TYPE) { c.add(SitePlanIssueCode.UnknownRole, `${path}.${role}`, `"${field}" is not a list field — a gallery is a list of pictures`); continue; }
|
|
338
|
+
if (role === ContentRole.Colour && fieldControls.get(field) !== ContentFieldControl.Colour) { c.add(SitePlanIssueCode.UnknownRole, `${path}.${role}`, `"${field}" is not a colour field — a colour block's ground is a picked colour`); continue; }
|
|
335
339
|
out[role] = field;
|
|
336
340
|
}
|
|
337
341
|
for (const role of REQUIRED_CONTENT_ROLES) if (!out[role] && !has(roles, role)) c.add(SitePlanIssueCode.MissingRole, `${path}.${role}`, `every content type names its ${role} field`);
|
|
@@ -113,6 +113,15 @@ export interface BusinessTypeLists {
|
|
|
113
113
|
readonly say: ReadonlyArray<string>;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/** Award §0b + §0b.7 (AW-D26, AW-D32): how a type's opening film is suggested, and what it may show (`filmIdeaFor`). */
|
|
117
|
+
export interface BusinessTypeFilm {
|
|
118
|
+
/** offer · ifAsked · never — the default the owner's words move one step. */
|
|
119
|
+
readonly stance: string;
|
|
120
|
+
/** The ideas, in order (the first that fits is the site's). */
|
|
121
|
+
readonly ideas: ReadonlyArray<string>;
|
|
122
|
+
readonly why: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
116
125
|
export interface BusinessType {
|
|
117
126
|
readonly id: string;
|
|
118
127
|
readonly label: string;
|
|
@@ -136,6 +145,8 @@ export interface BusinessType {
|
|
|
136
145
|
/** List ingredients LI0 (list-ingredients-plan.md L-D12): what this type's lists never do — arrangements and moves
|
|
137
146
|
* the layout's list section is not offered, and the sentences saying why. Binds generated output only. */
|
|
138
147
|
readonly lists: BusinessTypeLists;
|
|
148
|
+
/** Award §0b + §0b.7 (AW-D26…D32): how a film is suggested to this type, and what it may show (`filmIdeaFor`). */
|
|
149
|
+
readonly film: BusinessTypeFilm;
|
|
139
150
|
readonly imagery: string;
|
|
140
151
|
/** M7: the picture world a site's made pictures start in (generation-core `artDirectionFor`; contract site.pictureWorlds). */
|
|
141
152
|
readonly world: `${PictureWorld}`;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { BusinessType, businessTypeById } from './business-types';
|
|
2
|
+
import { SPEC_FILM_IDEAS } from './harness-spec.generated';
|
|
3
|
+
import { keywordsIn } from './intake';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The opening film, SUGGESTED (award-ingredients-plan §0b + §0b.7, AW-D26…AW-D32 — "the same moment, not the same
|
|
7
|
+
* picture"; "it is not a must"). Two answers, both the harness's, never the model's:
|
|
8
|
+
* - the STANCE — whether the Plan step offers a film at all: `offer` (the line shows, ticked only when the prompt asked),
|
|
9
|
+
* `ifAsked` (the line shows only when the prompt asked), `never` (nothing). A type's default (contract `FILM_IDEAS`,
|
|
10
|
+
* on each type as `film.stance`) is moved one step by the owner's words.
|
|
11
|
+
* - the IDEA — what the film would show: the first idea of the type's row the site can carry.
|
|
12
|
+
* No film is ever made without the owner's tick, and nothing fails for a film that is missing. The owner's OWN uploaded
|
|
13
|
+
* video plays on any type (SC6b `placeFilm`) — this decides only a made film. Pure: no transport, no clock.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** The five ideas, in the contract's order. */
|
|
17
|
+
export enum FilmIdea {
|
|
18
|
+
Making = 'making',
|
|
19
|
+
Object = 'object',
|
|
20
|
+
Material = 'material',
|
|
21
|
+
Place = 'place',
|
|
22
|
+
None = 'none',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** How a film is suggested (AW-D32). */
|
|
26
|
+
export enum FilmStance {
|
|
27
|
+
/** The Plan step offers it; ticked only when the prompt asked. */
|
|
28
|
+
Offer = 'offer',
|
|
29
|
+
/** Offered only when the prompt asked. */
|
|
30
|
+
IfAsked = 'ifAsked',
|
|
31
|
+
/** Never offered — no made film. */
|
|
32
|
+
Never = 'never',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The picture a film starts from. */
|
|
36
|
+
export enum FilmStart {
|
|
37
|
+
/** The owner's own photo. */
|
|
38
|
+
Own = 'own',
|
|
39
|
+
/** An art-direction still (M7) — only for a type that takes made pictures (not STOCK_NEVER, AW-D28). */
|
|
40
|
+
Art = 'art',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** What a contract idea asks for its start picture. */
|
|
44
|
+
enum IdeaStart {
|
|
45
|
+
Own = 'own',
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Why there is no film idea, or why an idea of the row was passed over. */
|
|
49
|
+
export enum FilmIdeaReason {
|
|
50
|
+
/** The stance is never: no made film for this business. */
|
|
51
|
+
Never = 'never',
|
|
52
|
+
/** No such business type. */
|
|
53
|
+
Type = 'type',
|
|
54
|
+
/** `making` / `object` need the subject the owner named (AW-D27). */
|
|
55
|
+
NoSubject = 'no-subject',
|
|
56
|
+
/** The idea needs the owner's photo (making, object; any idea on a STOCK_NEVER type — AW-D28). */
|
|
57
|
+
NoOwnPhoto = 'no-own-photo',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** One idea of the row the harness passed over, and why. */
|
|
61
|
+
export interface FilmIdeaSkip {
|
|
62
|
+
readonly idea: FilmIdea;
|
|
63
|
+
readonly reason: FilmIdeaReason;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** What the owner's words did to the stance. */
|
|
67
|
+
export interface FilmWords {
|
|
68
|
+
/** Words asking for motion (cinematic, video, film…), as they appear in the list. */
|
|
69
|
+
readonly raised: ReadonlyArray<string>;
|
|
70
|
+
/** Words asking for calm (formal, minimal, serious…). */
|
|
71
|
+
readonly lowered: ReadonlyArray<string>;
|
|
72
|
+
/** The business reads as one that never takes a film (cyber security, finance…). */
|
|
73
|
+
readonly never: ReadonlyArray<string>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The harness's answer. */
|
|
77
|
+
export interface FilmIdeaChoice {
|
|
78
|
+
/** What the film would show (none: no made film). */
|
|
79
|
+
readonly idea: FilmIdea;
|
|
80
|
+
readonly stance: FilmStance;
|
|
81
|
+
/** The owner asked for motion: the Plan step's line starts ticked (still the owner's to untick). */
|
|
82
|
+
readonly asked: boolean;
|
|
83
|
+
/** The picture it starts from (null for none). */
|
|
84
|
+
readonly start: FilmStart | null;
|
|
85
|
+
/** The subject the owner named, trimmed (null when none). */
|
|
86
|
+
readonly subject: string | null;
|
|
87
|
+
/** Why there is no idea (null when there is one). */
|
|
88
|
+
readonly reason: FilmIdeaReason | null;
|
|
89
|
+
/** The ideas of the row passed over before the choice, each with why. */
|
|
90
|
+
readonly skipped: ReadonlyArray<FilmIdeaSkip>;
|
|
91
|
+
readonly words: FilmWords;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface FilmIdeaDef {
|
|
95
|
+
readonly shows: string;
|
|
96
|
+
readonly plays: { readonly pattern: string; readonly signature: string | null } | null;
|
|
97
|
+
readonly later: string | null;
|
|
98
|
+
readonly subject: boolean;
|
|
99
|
+
readonly start: string | null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The contract's five ideas, keyed by word. */
|
|
103
|
+
export const FILM_IDEAS: Readonly<Record<FilmIdea, FilmIdeaDef>> = SPEC_FILM_IDEAS.ideas;
|
|
104
|
+
|
|
105
|
+
/** The words that move the stance (contract `FILM_IDEAS`). */
|
|
106
|
+
export const FILM_WORDS = {
|
|
107
|
+
raise: SPEC_FILM_IDEAS.raise as ReadonlyArray<string>,
|
|
108
|
+
lower: SPEC_FILM_IDEAS.lower as ReadonlyArray<string>,
|
|
109
|
+
neverReads: SPEC_FILM_IDEAS.neverReads as ReadonlyArray<string>,
|
|
110
|
+
} as const;
|
|
111
|
+
|
|
112
|
+
const NONE_IDEAS: ReadonlyArray<string> = [FilmIdea.None];
|
|
113
|
+
|
|
114
|
+
/** The ideas a type's film may show, in order; `[none]` for an unknown type. */
|
|
115
|
+
export function filmIdeasOf(type: BusinessType | string | null | undefined): ReadonlyArray<FilmIdea> {
|
|
116
|
+
const t: BusinessType | undefined = typeof type === 'string' ? businessTypeById(type) : (type ?? undefined);
|
|
117
|
+
return (t?.film.ideas ?? NONE_IDEAS) as ReadonlyArray<FilmIdea>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** What the owner's words say about a film (the ONE no-model word rule, `keywordsIn`). */
|
|
121
|
+
export function filmWordsIn(prompt: string | null | undefined): FilmWords {
|
|
122
|
+
const text = prompt ?? '';
|
|
123
|
+
return { raised: keywordsIn(text, FILM_WORDS.raise), lowered: keywordsIn(text, FILM_WORDS.lower), never: keywordsIn(text, FILM_WORDS.neverReads) };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The stance for a business and the owner's words (AW-D32): the type's default, moved ONE step — motion words raise
|
|
128
|
+
* ifAsked → offer, calm words lower offer → ifAsked, both together cancel — and `never` moves for no word. A business that
|
|
129
|
+
* reads as cyber security / IT / finance is never; so is a site with no known type.
|
|
130
|
+
*/
|
|
131
|
+
export function filmStanceFor(type: BusinessType | undefined, words: FilmWords): FilmStance {
|
|
132
|
+
const base = (type?.film.stance ?? FilmStance.Never) as FilmStance;
|
|
133
|
+
if (base === FilmStance.Never || words.never.length) return FilmStance.Never;
|
|
134
|
+
const raise = words.raised.length > 0, lower = words.lowered.length > 0;
|
|
135
|
+
if (raise && !lower) return FilmStance.Offer;
|
|
136
|
+
if (lower && !raise) return FilmStance.IfAsked;
|
|
137
|
+
return base;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface FilmIdeaInput {
|
|
141
|
+
/** The reading's business type. */
|
|
142
|
+
readonly businessType: string | null | undefined;
|
|
143
|
+
/** The owner's own words (the prompt). */
|
|
144
|
+
readonly prompt?: string | null;
|
|
145
|
+
/** The reading's `film.subject` — the owner's words or a photo the vision step described, never the type's default. */
|
|
146
|
+
readonly subject?: string | null;
|
|
147
|
+
/** How many photos of their own the owner gave. */
|
|
148
|
+
readonly ownPhotos: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The film for a site (§0b.3 step 1 + §0b.7): its stance, and the first idea of the type's row the site can carry.
|
|
153
|
+
* - `never` → no idea: no made film (the owner's own video still plays).
|
|
154
|
+
* - `making` / `object` need the owner's subject AND photo — a film of a plate the potter never made is a fabricated product.
|
|
155
|
+
* - `material` / `place` start from the owner's photo, else an art-direction still — never for a STOCK_NEVER type.
|
|
156
|
+
*/
|
|
157
|
+
export function filmIdeaFor(input: FilmIdeaInput): FilmIdeaChoice {
|
|
158
|
+
const subject = input.subject?.trim() || null;
|
|
159
|
+
const words = filmWordsIn(input.prompt);
|
|
160
|
+
const t = businessTypeById(input.businessType);
|
|
161
|
+
const stance = filmStanceFor(t, words);
|
|
162
|
+
const asked = stance !== FilmStance.Never && words.raised.length > 0;
|
|
163
|
+
const none = (reason: FilmIdeaReason, skipped: FilmIdeaSkip[] = []): FilmIdeaChoice =>
|
|
164
|
+
({ idea: FilmIdea.None, stance, asked, start: null, subject, reason, skipped, words });
|
|
165
|
+
if (!t) return none(FilmIdeaReason.Type);
|
|
166
|
+
if (stance === FilmStance.Never) return none(FilmIdeaReason.Never);
|
|
167
|
+
const skipped: FilmIdeaSkip[] = [];
|
|
168
|
+
const hasOwn = input.ownPhotos > 0;
|
|
169
|
+
for (const idea of filmIdeasOf(t)) {
|
|
170
|
+
if (idea === FilmIdea.None) break;
|
|
171
|
+
const def = FILM_IDEAS[idea];
|
|
172
|
+
const reason = def.subject && !subject ? FilmIdeaReason.NoSubject
|
|
173
|
+
: !hasOwn && (def.start === IdeaStart.Own || !t.stock) ? FilmIdeaReason.NoOwnPhoto : null;
|
|
174
|
+
if (reason) { skipped.push({ idea, reason }); continue; }
|
|
175
|
+
return { idea, stance, asked, start: hasOwn ? FilmStart.Own : FilmStart.Art, subject, reason: null, skipped, words };
|
|
176
|
+
}
|
|
177
|
+
return none(skipped[skipped.length - 1]?.reason ?? FilmIdeaReason.Never, skipped);
|
|
178
|
+
}
|