@vectoriox/iox-ui 5.198.0 → 5.200.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/data-core/index.d.ts +11 -3
- package/design-core/index.d.ts +479 -52
- 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-data-core.mjs +30 -4
- package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +704 -55
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs +5 -2
- package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +16659 -15146
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +653 -70
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +5 -2
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +883 -235
- package/harness-core/index.d.ts +372 -9
- package/package.json +1 -1
- package/src/actions-core/element-actions.ts +6 -0
- package/src/data-core/placeholder-rows.ts +29 -4
- package/src/design-core/brand-neutrals.ts +125 -3
- package/src/design-core/colour-words.ts +48 -0
- package/src/design-core/design-settings.ts +24 -5
- package/src/design-core/design-token.model.ts +8 -0
- package/src/design-core/flavor-fixtures.generated.ts +272 -2
- package/src/design-core/flavor-spec.generated.ts +310 -40
- package/src/design-core/flavor-tokens.ts +5 -1
- package/src/design-core/menu-look.ts +23 -0
- package/src/design-core/node-classes.ts +39 -0
- package/src/design-core/public-api.ts +2 -0
- package/src/design-core/signature-move.ts +107 -0
- package/src/design-core/style-presets.ts +9 -3
- package/src/design-core/token-css.ts +59 -1
- package/src/forms-core/form-presets.ts +5 -2
- package/src/generation-core/body-mix.ts +41 -0
- package/src/generation-core/check-free.ts +17 -9
- package/src/generation-core/check-layout.ts +17 -7
- package/src/generation-core/colour-mix.ts +53 -3
- package/src/generation-core/compose-free.ts +7 -2
- package/src/generation-core/compose-site.ts +298 -78
- package/src/generation-core/composition.ts +320 -0
- package/src/generation-core/footer-mix.ts +202 -16
- package/src/generation-core/footer-sign-up.ts +51 -0
- package/src/generation-core/free-opening.ts +13 -2
- package/src/generation-core/free-wire.ts +8 -0
- package/src/generation-core/header-edit.ts +15 -0
- package/src/generation-core/header-mix.ts +31 -2
- package/src/generation-core/legal.ts +24 -0
- 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-edit.ts +17 -3
- package/src/generation-core/opening-mix.ts +69 -5
- package/src/generation-core/patterns.ts +7 -0
- package/src/generation-core/plan-wire.ts +23 -5
- package/src/generation-core/public-api.ts +3 -0
- package/src/generation-core/site-build-run.ts +11 -0
- package/src/generation-core/site-plan.model.ts +6 -0
- package/src/generation-core/site-spec.generated.ts +472 -166
- package/src/generation-core/type-led.ts +4 -2
- package/src/generation-core/validate-site-plan.ts +4 -1
- package/src/harness-core/business-types.ts +31 -0
- package/src/harness-core/harness-spec.generated.ts +564 -56
- package/src/harness-core/motion.ts +19 -2
- package/src/harness-core/popup-stance.ts +56 -3
- package/src/harness-core/run-compose-context.ts +32 -6
- package/src/harness-core/starting-design.ts +15 -7
- package/styles/iox-design.css +35 -0
- package/styles/iox-forms.css +53 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { GroundTone, sectionPictured } from './body-mix';
|
|
1
|
+
import { BodyMix, bodyMix, BodySectionWord, GroundTone, sectionPictured } from './body-mix';
|
|
2
2
|
import { LayoutIssue, LayoutIssueCode, LayoutSection, LayoutSectionKind } from './layout-language';
|
|
3
|
-
import {
|
|
3
|
+
import { ColourWordKey, DesignChoices, resolveColourWords, resolveDesignChoices } from '@vectoriox/iox-ui/design-core';
|
|
4
|
+
|
|
5
|
+
import { layoutPresetOf } from './layout-look';
|
|
6
|
+
import { GenerationTier, SitePlan } from './site-plan.model';
|
|
4
7
|
import { SPEC_SITE_LAYOUT } from './site-spec.generated';
|
|
5
8
|
|
|
6
9
|
/**
|
|
@@ -133,6 +136,32 @@ export function presetColourMix(presetId: string | null | undefined): ColourMix
|
|
|
133
136
|
return colourMix(C.presets[presetId ?? ''] ?? {});
|
|
134
137
|
}
|
|
135
138
|
|
|
139
|
+
/** CV2: the colour mix a plan wears — its style preset's §6 row (CV-D13) with the plan's own words (`mixes.colour`) over
|
|
140
|
+
* it: an ingredient the plan leaves out is the preset's. A plan whose words do not read wears its preset's row (the
|
|
141
|
+
* validator names the word). Pure. */
|
|
142
|
+
export function colourMixOfPlan(plan: Pick<SitePlan, 'mixes' | 'design'>): ColourMix {
|
|
143
|
+
const presetId = layoutPresetOf(resolveDesignChoices(JSON.parse(JSON.stringify(plan.design ?? {})))).id;
|
|
144
|
+
const row = C.presets[presetId] ?? {};
|
|
145
|
+
try {
|
|
146
|
+
return colourMix({ ...row, ...colourWordsPartial(plan.mixes?.colour ?? []) });
|
|
147
|
+
} catch {
|
|
148
|
+
return colourMix(row); // the validator names the word
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** CV2 + CV3: the colour words a look carries as TOKENS (ground · dark · button · wash), as drawn — the rest are judged,
|
|
153
|
+
* never painted. */
|
|
154
|
+
export function colourDesignWords(mix: ColourMix): Pick<DesignChoices, ColourWordKey> {
|
|
155
|
+
const { drawn } = drawnColourMix(mix);
|
|
156
|
+
return resolveColourWords({ ground: drawn.ground, dark: drawn.dark, action: drawn.action, wash: drawn.wash });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** CV2: the ONE design a plan is built and composed with — its design and its colour words (the build's Look step writes
|
|
160
|
+
* these; every compose of the plan judges against them). Pure. */
|
|
161
|
+
export function planDesignChoices(plan: Pick<SitePlan, 'mixes' | 'design'>): DesignChoices {
|
|
162
|
+
return resolveDesignChoices({ ...JSON.parse(JSON.stringify(plan.design ?? {})), ...colourDesignWords(colourMixOfPlan(plan)) });
|
|
163
|
+
}
|
|
164
|
+
|
|
136
165
|
/** A mix on the wire: one `<ingredient>:<word>` per ingredient, in the table's order. */
|
|
137
166
|
export function colourMixWords(mix: ColourMix): string[] {
|
|
138
167
|
return ORDER.map(k => `${k}:${mix[k]}`);
|
|
@@ -140,6 +169,11 @@ export function colourMixWords(mix: ColourMix): string[] {
|
|
|
140
169
|
|
|
141
170
|
/** The words back into a mix. Refuses an unknown word and two words for one ingredient. */
|
|
142
171
|
export function colourMixFromWords(words: ReadonlyArray<string>): ColourMix {
|
|
172
|
+
return colourMix(colourWordsPartial(words));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** The ingredients the words name, and only those. Refuses an unknown word and two words for one ingredient. */
|
|
176
|
+
function colourWordsPartial(words: ReadonlyArray<string>): Record<string, string> {
|
|
143
177
|
const partial: Record<string, string> = {};
|
|
144
178
|
for (const pair of words) {
|
|
145
179
|
const [k, w] = String(pair).split(':');
|
|
@@ -147,7 +181,7 @@ export function colourMixFromWords(words: ReadonlyArray<string>): ColourMix {
|
|
|
147
181
|
if (partial[k] !== undefined && partial[k] !== w) throw new ColourMixError(`a site has one colour ${k} ("${partial[k]}" and "${w}")`);
|
|
148
182
|
partial[k] = w;
|
|
149
183
|
}
|
|
150
|
-
return
|
|
184
|
+
return partial;
|
|
151
185
|
}
|
|
152
186
|
|
|
153
187
|
export interface ColourGap {
|
|
@@ -170,6 +204,22 @@ export function drawnColourMix(mix: ColourMix): { drawn: ColourMix; gaps: Colour
|
|
|
170
204
|
return { drawn: drawn as ColourMix, gaps };
|
|
171
205
|
}
|
|
172
206
|
|
|
207
|
+
/** CV2: the colour words `checkLayout` judges, as DRAWN — spread into its context (`{ ...checkContext, ...colourCheckOf(plan) }`)
|
|
208
|
+
* so the accent word's budget, the grounds cap and the rhythm read the plan's own words (else its preset's row, CV-D13). */
|
|
209
|
+
export function colourCheckOf(plan: Pick<SitePlan, 'mixes' | 'design'>): { accent: string; rhythm: string } {
|
|
210
|
+
const { drawn } = drawnColourMix(colourMixOfPlan(plan));
|
|
211
|
+
return { accent: drawn.accent, rhythm: drawn.rhythm };
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** CV-D9: `bands.inset` reuses AW6's inset card — the body the site wears with the colour's bands folded in (`inset`
|
|
215
|
+
* adds `sections:inset-card`, so every section that wears a scheme stands as a rounded card on the page's ground). The
|
|
216
|
+
* same body back when the bands are `full` or the card is already asked. Pure. */
|
|
217
|
+
export function bodyWithColourBands(body: BodyMix | null, mix: ColourMix): BodyMix | null {
|
|
218
|
+
if (drawnColourMix(mix).drawn.bands !== ColourBands.Inset) return body;
|
|
219
|
+
if (body?.sections.includes(BodySectionWord.InsetCard)) return body;
|
|
220
|
+
return bodyMix({ ...(body ?? {}), sections: [...(body?.sections ?? []), BodySectionWord.InsetCard] });
|
|
221
|
+
}
|
|
222
|
+
|
|
173
223
|
/** The fingerprint's prefix for a site's colour. */
|
|
174
224
|
export const COLOUR_TOKEN = 'colour';
|
|
175
225
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CarouselFrom, ContentFieldLike, NO_ELEMENT_STYLE } from '@vectoriox/iox-ui/composite-core';
|
|
2
|
-
import { LinkType } from '@vectoriox/iox-ui/design-core';
|
|
2
|
+
import { LinkType, setColorScheme } from '@vectoriox/iox-ui/design-core';
|
|
3
3
|
import { VideoMode, VideoSource } from '@vectoriox/iox-ui/media-core';
|
|
4
4
|
|
|
5
5
|
import { composeListFrame, LayoutListBinding } from './compose-layout';
|
|
@@ -7,7 +7,7 @@ import { composeListAccordion, composeListLightbox, composeListTabs, composePres
|
|
|
7
7
|
import { FREE_OPEN_LIGHTBOX, freeSlotOf, FreeSlotKind } from './free-slot-words';
|
|
8
8
|
import { freeNodeId } from './free-render-check';
|
|
9
9
|
import { freeStyleToSlots } from './free-slots';
|
|
10
|
-
import { FREE_BUILDER_TYPE, FreeLayer, FreeNode, FreeNodeType, FreePage, FreeStyle, FreeTrigger } from './free-wire';
|
|
10
|
+
import { FREE_BUILDER_TYPE, freeSchemeOf, FreeLayer, FreeNode, FreeNodeType, FreePage, FreeStyle, FreeTrigger } from './free-wire';
|
|
11
11
|
import { LAYOUT_BEAT_DELAY, LAYOUT_DEPTH_ON_PHONE, LAYOUT_EASING, LAYOUT_PACE, LAYOUT_RISE, LayoutEase, LayoutPace, LayoutRole, LayoutSite } from './layout-language';
|
|
12
12
|
import { listMixFromWords } from './layout-wire';
|
|
13
13
|
import { ComposeError, createSerializedNode, SerializedNode, setStyleProps } from './serialized-node';
|
|
@@ -118,6 +118,11 @@ function composeNode(n: FreeNode, ctx: Ctx, beat: number): SerializedNode {
|
|
|
118
118
|
if (n.href?.startsWith(SECTION_LINK)) ctx.links.push({ node, to: n.href.slice(1) });
|
|
119
119
|
}
|
|
120
120
|
styleInto(node, n, ctx);
|
|
121
|
+
// iox-ui#186: a box painted a scheme's own ground (a dark band, `var(--iox-inverse-bg)`) wears that scheme, so every
|
|
122
|
+
// token the look reads inside — a button's ink and outline, a line, a link — is the ground's, not only the words the
|
|
123
|
+
// answer coloured by hand. `freeContrastIssues` judges the tree in the same schemes (`freeSchemeOf`).
|
|
124
|
+
const scheme = freeSchemeOf(n);
|
|
125
|
+
if (scheme) setColorScheme(node, scheme);
|
|
121
126
|
const move = moveOf(n, id, ctx, beat);
|
|
122
127
|
if (move) node.interactions = [...node.interactions, move];
|
|
123
128
|
if (n.type === FreeNodeType.Slot) node.children = slotOf(n, id, ctx);
|