@vectoriox/iox-ui 5.197.0 → 5.198.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composite-core/index.d.ts +16 -2
- package/design-core/index.d.ts +160 -28
- 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-design-core.mjs +259 -72
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1845 -396
- package/fesm2022/vectoriox-iox-ui-generation-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 +1286 -184
- package/package.json +1 -1
- package/src/composite-core/header.ts +34 -1
- 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/motion-language.ts +5 -14
- package/src/design-core/preloader.ts +4 -5
- package/src/generation-core/body-mix.ts +40 -102
- package/src/generation-core/check-free.ts +5 -2
- 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 +40 -18
- package/src/generation-core/compose-site.ts +92 -13
- package/src/generation-core/footer-mix.ts +102 -54
- package/src/generation-core/free-fallback.ts +6 -4
- package/src/generation-core/free-parts.ts +87 -0
- package/src/generation-core/free-slot-words.ts +30 -0
- package/src/generation-core/generation-tier.ts +6 -17
- package/src/generation-core/header-mix.ts +42 -1
- package/src/generation-core/layout-drawers.ts +3 -2
- package/src/generation-core/layout-wire.ts +10 -16
- 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/opening-mix.ts +7 -34
- package/src/generation-core/part-tier.ts +14 -0
- package/src/generation-core/plan-wire.ts +31 -43
- package/src/generation-core/public-api.ts +2 -0
- package/src/generation-core/site-spec.generated.ts +1127 -93
- package/src/generation-core/validate-site-plan.ts +4 -5
- package/styles/iox-design.css +137 -3
|
@@ -5,8 +5,8 @@ import { describeShapeKey, jsonAnyOf, jsonBoolean, jsonInteger, jsonListOf, json
|
|
|
5
5
|
import { patternLinkSlots, patternOptionalParts, patternSlots, SITE_PATTERNS } from './patterns';
|
|
6
6
|
import { withDerivedSources } from './plan-derived';
|
|
7
7
|
import { DEFAULT_HEADER_PATTERN, HeaderIngredient, headerMeaning, headerMix, headerMixFromWords, headerMixOfPlan, headerMixWords, headerPatternIdOf, headerWireWords } from './header-mix';
|
|
8
|
-
import { DEFAULT_FOOTER_PATTERN, FooterIngredient, footerMeaning, footerMix, footerMixFromWords, footerMixOfPlan, footerMixWords, footerPatternIdOf, footerWireWords, footerWords
|
|
9
|
-
import { openingHarnessWord, OpeningIngredient, openingMeaning, openingWireWords
|
|
8
|
+
import { DEFAULT_FOOTER_PATTERN, FooterIngredient, footerMeaning, footerMix, footerMixFromWords, footerMixOfPlan, footerMixWords, footerPatternIdOf, footerWireWords, footerWords } from './footer-mix';
|
|
9
|
+
import { openingHarnessWord, OpeningIngredient, openingMeaning, openingWireWords } from './opening-mix';
|
|
10
10
|
import { BodyIngredient, bodyMeaning, bodyMix, bodyMixWords, bodyWireWords } from './body-mix';
|
|
11
11
|
import { POPUP_LINK_WORD, POPUP_WIRE_INGREDIENTS, popupMeaning, popupWireWords } from './popup-plan';
|
|
12
12
|
import { shopCategoriesOf } from './shop-plan';
|
|
@@ -93,8 +93,6 @@ interface WireKey {
|
|
|
93
93
|
none?: string;
|
|
94
94
|
/** The part a top-level key is written in. */
|
|
95
95
|
part?: PlanPart;
|
|
96
|
-
/** AW-D23 (AW6 wire): a key only the award tier's request carries — every other tier's wire is without it, byte for byte. */
|
|
97
|
-
tier?: GenerationTier.Award;
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
const PLAN_SHAPE = SPEC_SITE_PLAN_SHAPE as unknown as Readonly<Record<string, ShapeEntry>>;
|
|
@@ -108,22 +106,19 @@ const roleWords = ROLE_KEYS.map(role => `${role}: ${describeShapeKey(PLAN_SHAPE[
|
|
|
108
106
|
/** The footer's words as the model reads them (LI5): each ingredient, its words and their meanings, from the contract. */
|
|
109
107
|
const FOOTER_WIRE_TEXT = 'string[] — the footer as ONE list of <ingredient>:<word> words: one word per ingredient but "holds", which lists '
|
|
110
108
|
+ `each block it holds (holds:pages, holds:contact); an ingredient left out is the default (${footerMixWords(footerMix()).join(', ')}). `
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
+ 'A word marked (award) is worn by an award build only — elsewhere it is mended. '
|
|
114
|
-
+ Object.values(FooterIngredient).map(k => `${k}: ${footerWords(k).map(w => `${w} (${footerMeaning(k, w)})${footerWordTier(k, w) === 'pro' ? ' (award)' : ''}`).join(' | ')}`).join('; ');
|
|
109
|
+
// AW-D42: every word is every tier's — none is marked, none is mended for a tier.
|
|
110
|
+
+ Object.values(FooterIngredient).map(k => `${k}: ${footerWords(k).map(w => `${w} (${footerMeaning(k, w)})`).join(' | ')}`).join('; ');
|
|
115
111
|
|
|
116
112
|
/** The wire's `globals` key the home page's opening travels in (AW8) — a mix beside the header's and the footer's. */
|
|
117
113
|
const OPENING_WIRE_KEY = 'opening';
|
|
118
114
|
|
|
119
|
-
/** The opening's words as the model reads them (AW8): each ingredient, the words the product draws
|
|
120
|
-
*
|
|
115
|
+
/** The opening's words as the model reads them (AW8): each ingredient, the words the product draws and their meanings,
|
|
116
|
+
* from the contract's opening table (every tier's since AW-D42). */
|
|
121
117
|
const OPENING_WIRE_TEXT = "string[] — the home page's opening (its first screen) as ONE list of <ingredient>:<word> words: one word per "
|
|
122
118
|
+ `ingredient but extras and motion, which list each they take; an ingredient left out is the default; [] = the home page opens with its first `
|
|
123
119
|
+ "section as written. The opening takes the place of the home page's first section when that is a hero (its words and pictures carried in); "
|
|
124
|
-
+
|
|
125
|
-
|
|
126
|
-
.map(w => `${w} (${openingMeaning(k, w)}${openingWordTier(k, w) === 'pro' ? ', award' : ''}${openingHarnessWord(k, w) ? ', the build\'s own — keep it where the plan has it, never choose it' : ''})`).join(' | ')}`).join('; ');
|
|
120
|
+
+ Object.values(OpeningIngredient).map(k => `${k}: ${openingWireWords().filter(w => w.startsWith(`${k}:`)).map(w => w.slice(k.length + 1))
|
|
121
|
+
.map(w => `${w} (${openingMeaning(k, w)}${openingHarnessWord(k, w) ? ', the build\'s own — keep it where the plan has it, never choose it' : ''})`).join(' | ')}`).join('; ');
|
|
127
122
|
|
|
128
123
|
/** The header's words as the model reads them (HI1): each ingredient, the words the product draws and their meanings,
|
|
129
124
|
* from the contract's header table. */
|
|
@@ -132,16 +127,16 @@ const HEADER_WIRE_TEXT = 'string[] — the header as ONE list of <ingredient>:<w
|
|
|
132
127
|
+ 'beside the name, pages either side of the name need a short name, two actions need a shop. '
|
|
133
128
|
+ Object.values(HeaderIngredient).map(k => `${k}: ${headerWireWords().filter(w => w.startsWith(`${k}:`)).map(w => w.slice(k.length + 1)).map(w => `${w} (${headerMeaning(k, w)})`).join(' | ')}`).join('; ');
|
|
134
129
|
|
|
135
|
-
/** The wire's `globals` key the site's body travels in (AW6) —
|
|
130
|
+
/** The wire's `globals` key the site's body travels in (AW6) — every tier's since AW-D42. */
|
|
136
131
|
const BODY_WIRE_KEY = 'body';
|
|
137
132
|
|
|
138
|
-
/** The body's words as the model reads them (AW6): each ingredient, the words
|
|
139
|
-
*
|
|
133
|
+
/** The body's words as the model reads them (AW6): each ingredient, the words a build may wear today and their meanings,
|
|
134
|
+
* from the contract's body table. */
|
|
140
135
|
const BODY_WIRE_TEXT = "string[] — the site's body as ONE list of <ingredient>:<word> words: how its sections meet and how their grounds "
|
|
141
136
|
+ `follow one another; one word per ingredient but sections, which lists each extra kind it takes; an ingredient left out is the default `
|
|
142
137
|
+ `(${bodyMixWords(bodyMix()).join(', ')}); [] = straight edges, each section's ground its own. An edge shows only where two neighbouring `
|
|
143
138
|
+ 'sections wear different grounds; a calm business (care, advice) never wears a torn or dripping edge. '
|
|
144
|
-
+ Object.values(BodyIngredient).map(k => [k, bodyWireWords(
|
|
139
|
+
+ Object.values(BodyIngredient).map(k => [k, bodyWireWords().filter(w => w.startsWith(`${k}:`)).map(w => w.slice(k.length + 1))] as const)
|
|
145
140
|
.filter(([, words]) => words.length)
|
|
146
141
|
.map(([k, words]) => `${k}: ${words.map(w => `${w} (${bodyMeaning(k, w)})`).join(' | ')}`).join('; ');
|
|
147
142
|
|
|
@@ -262,9 +257,9 @@ const WIRE_KEYS: Readonly<Record<`${PlanWireEntry}`, Readonly<Record<string, Wir
|
|
|
262
257
|
footer: { refs: ['globals.footer', 'plan.mixes', 'mixes.footer'], text: FOOTER_WIRE_TEXT },
|
|
263
258
|
// AW8: the home page's opening travels as its MIX, ONE list of `<ingredient>:<word>` words (opening-mix.ts); [] = none.
|
|
264
259
|
opening: { refs: ['plan.mixes', 'mixes.opening'], text: OPENING_WIRE_TEXT },
|
|
265
|
-
// AW6: the site's body travels as its MIX, ONE list of `<ingredient>:<word>` words (body-mix.ts); [] = none.
|
|
266
|
-
// tier's request
|
|
267
|
-
body: { refs: ['plan.mixes', 'mixes.body'], text: BODY_WIRE_TEXT
|
|
260
|
+
// AW6: the site's body travels as its MIX, ONE list of `<ingredient>:<word>` words (body-mix.ts); [] = none. Every
|
|
261
|
+
// tier's request carries it since AW-D42 (it was the award tier's alone, AW-D23).
|
|
262
|
+
body: { refs: ['plan.mixes', 'mixes.body'], text: BODY_WIRE_TEXT },
|
|
268
263
|
// PU3: the popup travels as its words, ONE list (popup-plan.ts); [] = none. Stamped only from the owner's lines (plan.popup).
|
|
269
264
|
popup: { refs: ['plan.mixes', 'mixes.popup'], text: POPUP_WIRE_TEXT },
|
|
270
265
|
},
|
|
@@ -321,28 +316,21 @@ const wireText = (spec: WireKey): string => {
|
|
|
321
316
|
return spec.none === undefined ? base : `${base} — ${spec.none} = none`;
|
|
322
317
|
};
|
|
323
318
|
|
|
324
|
-
/** What a plan request is asked at: its generation's tier
|
|
319
|
+
/** What a plan request is asked at: its generation's tier. Since AW-D42 every tier reads the same wire (the award tier's,
|
|
320
|
+
* body included); the tier is kept so its callers still read. */
|
|
325
321
|
export interface PlanWireOptions {
|
|
326
322
|
tier?: `${GenerationTier}`;
|
|
327
323
|
}
|
|
328
324
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
const wireShapeAt = (options: PlanWireOptions): Record<`${PlanWireEntry}`, ShapeEntry> => Object.fromEntries(
|
|
334
|
-
Object.entries(WIRE_KEYS).map(([entry, keys]) => [entry, Object.fromEntries(Object.entries(keys).filter(([, spec]) => asked(spec, options)).map(([k, spec]) => [k, wireText(spec)]))]),
|
|
325
|
+
/** The wire's shape table, in the plan table's words — what the model reads, and what the format is built from. ONE for
|
|
326
|
+
* every tier since AW-D42. */
|
|
327
|
+
export const PLAN_WIRE_SHAPE: Readonly<Record<`${PlanWireEntry}`, ShapeEntry>> = Object.fromEntries(
|
|
328
|
+
Object.entries(WIRE_KEYS).map(([entry, keys]) => [entry, Object.fromEntries(Object.entries(keys).map(([k, spec]) => [k, wireText(spec)]))]),
|
|
335
329
|
) as Record<`${PlanWireEntry}`, ShapeEntry>;
|
|
336
330
|
|
|
337
|
-
/** The wire's shape table
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
const AWARD_WIRE_SHAPE: Readonly<Record<`${PlanWireEntry}`, ShapeEntry>> = wireShapeAt({ tier: GenerationTier.Award });
|
|
342
|
-
|
|
343
|
-
/** The wire's shape table a request at `options` reads (AW6: the award tier's carries the body). Basic = `PLAN_WIRE_SHAPE`. */
|
|
344
|
-
export function planWireShape(options: PlanWireOptions = {}): Readonly<Record<`${PlanWireEntry}`, ShapeEntry>> {
|
|
345
|
-
return isAward(options) ? AWARD_WIRE_SHAPE : PLAN_WIRE_SHAPE;
|
|
331
|
+
/** The wire's shape table a request at `options` reads — `PLAN_WIRE_SHAPE` at every tier (AW-D42). */
|
|
332
|
+
export function planWireShape(_options: PlanWireOptions = {}): Readonly<Record<`${PlanWireEntry}`, ShapeEntry>> {
|
|
333
|
+
return PLAN_WIRE_SHAPE;
|
|
346
334
|
}
|
|
347
335
|
|
|
348
336
|
/** Each part's top-level keys, from the ONE wire table. */
|
|
@@ -482,8 +470,8 @@ const PLAN_TOP_SCHEMAS: Readonly<Record<string, (options: PlanWireOptions) => Js
|
|
|
482
470
|
globals: options => jsonShapedObject(planWireShape(options).globals, {
|
|
483
471
|
[GlobalSlot.Header]: jsonListOf(jsonOneOf(headerWireWords())),
|
|
484
472
|
[GlobalSlot.Footer]: jsonListOf(jsonOneOf(footerWireWords())),
|
|
485
|
-
[OPENING_WIRE_KEY]: jsonListOf(jsonOneOf(openingWireWords(
|
|
486
|
-
|
|
473
|
+
[OPENING_WIRE_KEY]: jsonListOf(jsonOneOf(openingWireWords())),
|
|
474
|
+
[BODY_WIRE_KEY]: jsonListOf(jsonOneOf(bodyWireWords())),
|
|
487
475
|
[POPUP_WIRE_KEY]: jsonListOf(jsonText()),
|
|
488
476
|
}, `wire ${PlanWireEntry.Globals}`),
|
|
489
477
|
direction: () => shaped(PlanWireEntry.Direction, { idea: jsonText(), cliche: jsonText(), flip: jsonText(), rules: jsonListOf(jsonText()) }),
|
|
@@ -505,8 +493,8 @@ export function planWirePartShape(part: PlanPart, options: PlanWireOptions = {})
|
|
|
505
493
|
|
|
506
494
|
/**
|
|
507
495
|
* The format a model writes one part of a plan in — one request each (vectoriox/iox-cms#47). The same for every studio
|
|
508
|
-
* and run
|
|
509
|
-
*
|
|
496
|
+
* and run: nothing in it is pinned, so the provider compiles each part's grammar once (one wire for every tier since
|
|
497
|
+
* AW-D42 — the Pages part carries `globals.body`).
|
|
510
498
|
*/
|
|
511
499
|
export function planWirePartJsonSchema(part: PlanPart, options: PlanWireOptions = {}): JsonSchema {
|
|
512
500
|
const gaps = planWireGaps();
|
|
@@ -754,11 +742,11 @@ const PLAN_TO_WIRE: Readonly<Record<string, (plan: SitePlan, options: PlanWireOp
|
|
|
754
742
|
contentTypes: plan => plan.contentTypes.map(type => contentTypeToWire(type)),
|
|
755
743
|
dataSources: plan => plan.dataSources.map(dataSourceToWire),
|
|
756
744
|
pages: plan => plan.pages.map(page => pageToWire(page)),
|
|
757
|
-
globals:
|
|
745
|
+
globals: plan => ({
|
|
758
746
|
...plan.globals, [GlobalSlot.Header]: headerMixWords(headerMixOfPlan(plan)), [GlobalSlot.Footer]: footerMixWords(footerMixOfPlan(plan)),
|
|
759
747
|
[OPENING_WIRE_KEY]: [...(plan.mixes?.opening ?? [])],
|
|
760
|
-
// AW6: the
|
|
761
|
-
|
|
748
|
+
// AW6: the wire writes the body ([] = none) — at every tier since AW-D42.
|
|
749
|
+
[BODY_WIRE_KEY]: [...(plan.mixes?.body ?? [])],
|
|
762
750
|
[POPUP_WIRE_KEY]: [...(plan.mixes?.popup ?? [])],
|
|
763
751
|
}),
|
|
764
752
|
direction: plan => ({ idea: plan.direction?.idea ?? NONE, cliche: plan.direction?.cliche ?? NONE, flip: plan.direction?.flip ?? NONE, rules: [...(plan.direction?.rules ?? [])] }),
|
|
@@ -71,6 +71,7 @@ export * from './check-free';
|
|
|
71
71
|
export * from './free-fallback';
|
|
72
72
|
export * from './free-slots';
|
|
73
73
|
export * from './compose-free';
|
|
74
|
+
export * from './free-parts';
|
|
74
75
|
export * from './free-render-check';
|
|
75
76
|
export * from './free-opening';
|
|
76
77
|
export * from './prompt-limits';
|
|
@@ -90,6 +91,7 @@ export * from './header-mix';
|
|
|
90
91
|
export * from './header-edit';
|
|
91
92
|
export * from './opening-mix';
|
|
92
93
|
export * from './body-mix';
|
|
94
|
+
export * from './colour-mix';
|
|
93
95
|
export * from './popup-plan';
|
|
94
96
|
export * from './opening-edit';
|
|
95
97
|
export * from './footer-mix';
|