@vectoriox/iox-ui 5.144.0 → 5.146.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 +10 -1
- package/design-core/index.d.ts +386 -44
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +2 -1
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +9 -6
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +523 -80
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +158 -28
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +108 -0
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +33 -11
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +85 -7
- package/harness-core/index.d.ts +91 -1
- package/index.d.ts +11 -4
- package/package.json +1 -1
- package/src/assist-core/site-look.ts +2 -1
- package/src/composite-core/shop.ts +1 -1
- package/src/composite-core/slider.ts +7 -4
- package/src/design-core/design-apply.ts +19 -2
- package/src/design-core/design-settings.ts +18 -7
- package/src/design-core/design-token.model.ts +11 -0
- package/src/design-core/flavor-spec.generated.ts +303 -25
- package/src/design-core/flavor-tokens.ts +7 -1
- package/src/design-core/list-classes.ts +14 -3
- package/src/design-core/locale-direction.ts +28 -0
- package/src/design-core/node-classes.ts +66 -1
- package/src/design-core/section-edge.ts +17 -19
- package/src/design-core/token-css.ts +48 -3
- package/src/generation-core/adjustments.ts +7 -3
- package/src/generation-core/compose-layout.ts +116 -3
- package/src/generation-core/compose-site.ts +50 -20
- package/src/generation-core/site-spec.generated.ts +26 -0
- package/src/generation-core/validate-site-plan.ts +1 -0
- package/src/harness-core/harness-spec.generated.ts +108 -0
- package/src/harness-core/starting-design.ts +1 -1
- package/styles/iox-design.css +38 -8
|
@@ -290,7 +290,7 @@ export function buildVariantPickerRecipe(create: CompositeNodeFactory): Composit
|
|
|
290
290
|
{ ...ROW, flexWrap: 'wrap', gap: '8px' });
|
|
291
291
|
const chip = button(create, 'variant-value', ShopRole.VariantValue, Style.Chip, 'Value', '', { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: 'auto', height: 'auto' });
|
|
292
292
|
chip.children = [text(create, 'variant-value-text', null, Style.Label, SHOP_RECIPE_WORDS.value, 'Text', WORDS, 'span')];
|
|
293
|
-
const swatch = button(create, 'variant-swatch', ShopRole.VariantSwatch, Style.Swatch, 'Swatch', 'Sand', {
|
|
293
|
+
const swatch = button(create, 'variant-swatch', ShopRole.VariantSwatch, Style.Swatch, 'Swatch', 'Sand', {}); // the swatch style owns its size and padding (iox-cms-client#89)
|
|
294
294
|
values.children = [chip, swatch];
|
|
295
295
|
const note = text(create, 'variant-note', ShopRole.VariantNote, Style.Small, SHOP_RECIPE_WORDS.note, 'Sold-out note');
|
|
296
296
|
group.children = [label, values, note];
|
|
@@ -178,11 +178,14 @@ const ZERO = '0px 0px 0px 0px';
|
|
|
178
178
|
/** A control in the bar: in flow, its own size, no offsets (the bar spaces its parts). */
|
|
179
179
|
const BAR_PART_LAYOUT: Readonly<Record<string, string>> = { position: 'static', top: 'auto', margin: ZERO };
|
|
180
180
|
/**
|
|
181
|
-
* The bar (M1.3): a row under the picture. Its inline padding keeps the PAGE's
|
|
182
|
-
* screen's edge — the
|
|
183
|
-
* width, the bar's containing block) — so in a padded section it is 0 and at full bleed it is the
|
|
181
|
+
* The bar (M1.3): a row under the picture. Its inline padding keeps the PAGE's inset when the slider bleeds to the
|
|
182
|
+
* screen's edge — the page's inset less however far the slider is already inset from the screen (`100%` is the slider's
|
|
183
|
+
* width, the bar's containing block) — so in a padded section it is 0 and at full bleed it is the page's inset.
|
|
184
|
+
* The page's inset is `space-inline` (award §0c.8, AW-D41) written in viewport units — `max(4vw, gutter, (100vw −
|
|
185
|
+
* content-width) / 2)` — because a `%` here is the SLIDER's, never the page's (T-CW2); the canvas rewrites `vw` to its
|
|
186
|
+
* frame. A classic scrollbar shifts it by ≤ 8px, the same trade as before.
|
|
184
187
|
*/
|
|
185
|
-
const BAR_INLINE_PAD = 'max(0px, calc(var(--iox-space-gutter, 24px) - (100vw - 100%) / 2))';
|
|
188
|
+
export const BAR_INLINE_PAD = 'max(0px, calc(max(4vw, var(--iox-space-gutter, 24px), (100vw - var(--iox-content-width, 100%)) / 2) - (100vw - 100%) / 2))';
|
|
186
189
|
const BAR_BASE: Readonly<Record<string, string>> = {
|
|
187
190
|
position: 'relative', display: 'flex', flexDirection: 'row', flexWrap: 'nowrap', alignItems: 'center', justifyContent: 'flex-start',
|
|
188
191
|
gap: '12px', width: '100%', height: 'auto', minHeight: '44px', margin: ZERO, padding: `12px ${BAR_INLINE_PAD} 0px ${BAR_INLINE_PAD}`, zIndex: '10',
|
|
@@ -61,6 +61,20 @@ function packDefaultsLookup(): (packId: string) => ReadonlyArray<Map<string, See
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Token values the contract SUPERSEDED for rows a v2 pack seeds — a machine row still holding one is untouched, so an
|
|
66
|
+
* Apply rewrites it and the builder load heals it (`designTokenRepairs`), the way DS9's contrast fixes reached studios:
|
|
67
|
+
* - guidance `56d6264` (award §0c CW0, AW-D41): `section-pad` and `nav-pad` read `space-inline` — before, every pattern
|
|
68
|
+
* section and the header padded by the bare `space-gutter`, and Glass's pill computed its own `10px 10px 10px 22px`.
|
|
69
|
+
* A spec pins every entry as no flavor's current value. Add one with every contract change of a seeded token's value.
|
|
70
|
+
*/
|
|
71
|
+
export const SUPERSEDED_TOKEN_VALUES: Readonly<Record<string, ReadonlyArray<string>>> = {
|
|
72
|
+
'section-pad': ['var(--iox-space-section) var(--iox-space-gutter)'],
|
|
73
|
+
'nav-pad': ['16px var(--iox-space-gutter)', '10px 10px 10px 22px'],
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const supersededOf = (name: string): SeedExpectation[] => (SUPERSEDED_TOKEN_VALUES[name] ?? []).map(value => ({ value }));
|
|
77
|
+
|
|
64
78
|
const present = (list: ReadonlyArray<SeedExpectation | undefined>): SeedExpectation[] => list.filter((e): e is SeedExpectation => !!e);
|
|
65
79
|
|
|
66
80
|
const FONT_ROLES: ReadonlySet<string> = new Set(FONT_FAMILY_TOKENS);
|
|
@@ -97,7 +111,7 @@ export function designBaseline(previous: StoredDesign): SeedBaseline {
|
|
|
97
111
|
if (stampedBy === SWISS_FLAVOR.id) return swiss.get(row.name);
|
|
98
112
|
const ownDefaults = stampedBy ? packDefaults(stampedBy).map(m => m.get(row.name)) : [];
|
|
99
113
|
const expected = [current.get(row.name), beforeTint.get(row.name), ...ownDefaults];
|
|
100
|
-
return present([...expected, ...expected.map(e => beforeScriptPartners(row.name, e))]);
|
|
114
|
+
return present([...expected, ...expected.map(e => beforeScriptPartners(row.name, e)), ...(stampedBy ? supersededOf(row.name) : [])]);
|
|
101
115
|
};
|
|
102
116
|
}
|
|
103
117
|
|
|
@@ -214,7 +228,9 @@ export function missingDesignRows(existing: ReadonlyArray<{ name: string }>, cho
|
|
|
214
228
|
* `accent-text` that reads on every ground — reach a studio that applied its look before them;
|
|
215
229
|
* - stamped by the current pack and still holding a font stack WITHOUT the Hebrew partner the pairing now
|
|
216
230
|
* names second (H1-2): a Hebrew page of a studio seeded before it would draw its headings in the browser's
|
|
217
|
-
* default face for good
|
|
231
|
+
* default face for good;
|
|
232
|
+
* - stamped by a v2 pack and still holding a value the contract superseded (`SUPERSEDED_TOKEN_VALUES`): the content
|
|
233
|
+
* column's one edge (award §0c, AW-D41) reaches a studio seeded before it.
|
|
218
234
|
* No author edit produces any of these shapes — the Tokens panel edited the light value only, and since DS8 an
|
|
219
235
|
* edit makes the row `source: user`, which this never touches.
|
|
220
236
|
*/
|
|
@@ -235,6 +251,7 @@ export function designTokenRepairs(existing: ReadonlyArray<StoredDesignTokenRow>
|
|
|
235
251
|
const machineWrote = present([
|
|
236
252
|
...(stampedBy ? packDefaults(stampedBy).map(m => m.get(row.name)) : []),
|
|
237
253
|
...(stampedBy === pack.id ? [beforeTint.get(row.name), beforeScriptPartners(row.name, want), beforeScriptPartners(row.name, beforeTint.get(row.name))] : []),
|
|
254
|
+
...(stampedBy ? supersededOf(row.name) : []),
|
|
238
255
|
]);
|
|
239
256
|
if (!darkOnly && !untouchedSeedRow(row, machineWrote)) continue;
|
|
240
257
|
out.push({ id: row._id, data: { value: want.value, values: want.values ?? {}, source: stamp, ...(want.group ? { group: want.group } : {}), ...(want.tier ? { tier: want.tier } : {}) } });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SPEC_AXES, SPEC_FONT_ROLES } from './flavor-spec.generated';
|
|
2
2
|
import { parseHexColor } from './brand';
|
|
3
3
|
import {
|
|
4
|
-
AnimateId, BetweenId, DesignChoices, DesignMode, DesignMotion, FlavorPackV2, FontRoleToken, PRE_MOTION, PRE_TINT_DEFAULT,
|
|
5
|
-
SPEC_FLAVORS, TintId,
|
|
4
|
+
AnimateId, BetweenId, ColumnId, DesignChoices, DesignMode, DesignMotion, FlavorPackV2, FontRoleToken, PRE_COLUMN, PRE_MOTION, PRE_TINT_DEFAULT,
|
|
5
|
+
ScrollId, SPEC_FLAVORS, TintId,
|
|
6
6
|
} from './design-token.model';
|
|
7
7
|
import type { FlavorRevertSnapshot } from './flavor-seed';
|
|
8
8
|
import { isArriveId, isMoveId } from './motion-language';
|
|
@@ -37,6 +37,8 @@ export enum DesignConfigKey {
|
|
|
37
37
|
PillButtons = 'pillButtons',
|
|
38
38
|
Mode = 'mode',
|
|
39
39
|
Tint = 'tint',
|
|
40
|
+
/** Award §0c: the site's content column (a `ColumnId`); absent on a row stored before it = wide (AW-D39). */
|
|
41
|
+
Column = 'column',
|
|
40
42
|
Fonts = 'fonts',
|
|
41
43
|
Scroll = 'scroll',
|
|
42
44
|
Animate = 'animate',
|
|
@@ -138,6 +140,7 @@ export function resolveDesignChoices(partial: Partial<DesignChoices> | null | un
|
|
|
138
140
|
pillButtons: asBoolean(partial?.pillButtons) ?? pack.defaults.pillButtons,
|
|
139
141
|
mode: (MODES.includes(asString(partial?.mode) ?? '') ? asString(partial?.mode) : pack.defaults.mode) as DesignMode,
|
|
140
142
|
tint: keyOf(SPEC_AXES.tints, asString(partial?.tint)) ?? pack.defaults.tint,
|
|
143
|
+
column: keyOf<ColumnId>(SPEC_AXES.columns, asString(partial?.column)) ?? pack.defaults.column,
|
|
141
144
|
...(fonts ? { fonts } : {}),
|
|
142
145
|
...resolveDesignMotion(partial),
|
|
143
146
|
...resolveMotionLanguageChoices(partial),
|
|
@@ -180,23 +183,29 @@ export function packDesignChoices(flavorId: string): DesignChoices {
|
|
|
180
183
|
/**
|
|
181
184
|
* What picking a pack card means, given the design the studio wears: the applied pack → the applied
|
|
182
185
|
* choices; another pack → that pack's defaults, CARRYING the author's chosen fonts (§5b — a font the
|
|
183
|
-
* author chose survives a pack switch unless the author changes it)
|
|
184
|
-
* how it scrolls and changes page is not a pack's, so a Look pick never resets it)
|
|
186
|
+
* author chose survives a pack switch unless the author changes it), the site's motion (rev 3.1 MO-D3 —
|
|
187
|
+
* how it scrolls and changes page is not a pack's, so a Look pick never resets it) and the site's content column
|
|
188
|
+
* (award §0c, AW-D39 — a width is the site's, not a style's). Both picker homes call this.
|
|
185
189
|
*/
|
|
186
190
|
export function choicesForPack(flavorId: string, applied: DesignChoices | null | undefined): DesignChoices {
|
|
187
191
|
const pack = flavorPackById(flavorId) ?? defaultPack();
|
|
188
192
|
if (applied && resolveDesignChoices(applied).flavorId === pack.id) return resolveDesignChoices(applied);
|
|
189
|
-
return resolveDesignChoices({
|
|
193
|
+
return resolveDesignChoices({
|
|
194
|
+
flavorId: pack.id, fonts: applied?.fonts, ...resolveDesignMotion(applied), ...(applied?.column ? { column: applied.column } : {}),
|
|
195
|
+
});
|
|
190
196
|
}
|
|
191
197
|
|
|
192
198
|
/**
|
|
193
199
|
* A stored `settings.design` config → the resolved design. No row (or no config) → Crisp's defaults. A
|
|
194
200
|
* row stored before DS9 has no `tint`: it was applied with the look's own palette, so it reads `neutral`
|
|
195
|
-
* (never the pack's new default — the studio's rows hold the palette, and nothing may repaint them unasked).
|
|
201
|
+
* (never the pack's new default — the studio's rows hold the palette, and nothing may repaint them unasked). Likewise a
|
|
202
|
+
* row stored before the content column has no `column`: its pages were built wide, so it reads `wide` (AW-D39, T-CW1 —
|
|
203
|
+
* the pack's `contained` would narrow every built studio on release).
|
|
196
204
|
*/
|
|
197
205
|
export function readDesignConfig(config: ReadonlyArray<DesignConfigEntry> | null | undefined, hasRow = !!config): StoredDesign {
|
|
198
206
|
const map = configMap(config);
|
|
199
207
|
const storedTint = asString(map.get(DesignConfigKey.Tint)) ?? (hasRow ? PRE_TINT_DEFAULT : null);
|
|
208
|
+
const storedColumn = asString(map.get(DesignConfigKey.Column)) ?? (hasRow ? PRE_COLUMN : null);
|
|
200
209
|
const storedFlavorId = asString(map.get(DesignConfigKey.FlavorId));
|
|
201
210
|
const storedSeed = asString(map.get(DesignConfigKey.BrandSeed));
|
|
202
211
|
const choices = resolveDesignChoices({
|
|
@@ -209,6 +218,7 @@ export function readDesignConfig(config: ReadonlyArray<DesignConfigEntry> | null
|
|
|
209
218
|
pillButtons: asBoolean(map.get(DesignConfigKey.PillButtons)) ?? undefined,
|
|
210
219
|
mode: map.get(DesignConfigKey.Mode) as DesignMode,
|
|
211
220
|
tint: (storedTint ?? undefined) as TintId | undefined,
|
|
221
|
+
column: (storedColumn ?? undefined) as ColumnId | undefined,
|
|
212
222
|
fonts: map.get(DesignConfigKey.Fonts) as DesignChoices['fonts'],
|
|
213
223
|
scroll: map.get(DesignConfigKey.Scroll) as ScrollId,
|
|
214
224
|
animate: map.get(DesignConfigKey.Animate) as AnimateId,
|
|
@@ -256,6 +266,7 @@ export function designConfigEntries(
|
|
|
256
266
|
{ key: DesignConfigKey.PillButtons, value: String(c.pillButtons) },
|
|
257
267
|
{ key: DesignConfigKey.Mode, value: c.mode },
|
|
258
268
|
{ key: DesignConfigKey.Tint, value: c.tint },
|
|
269
|
+
{ key: DesignConfigKey.Column, value: c.column },
|
|
259
270
|
{ key: DesignConfigKey.Scroll, value: c.scroll },
|
|
260
271
|
{ key: DesignConfigKey.Animate, value: c.animate },
|
|
261
272
|
{ key: DesignConfigKey.Between, value: c.between },
|
|
@@ -274,7 +285,7 @@ export function sameDesignChoices(a: DesignChoices, b: DesignChoices): boolean {
|
|
|
274
285
|
const y = resolveDesignChoices(b);
|
|
275
286
|
return x.flavorId === y.flavorId && x.seed.toLowerCase() === y.seed.toLowerCase() && x.pairId === y.pairId
|
|
276
287
|
&& x.shape === y.shape && x.density === y.density && x.motion === y.motion
|
|
277
|
-
&& x.pillButtons === y.pillButtons && x.mode === y.mode && x.tint === y.tint
|
|
288
|
+
&& x.pillButtons === y.pillButtons && x.mode === y.mode && x.tint === y.tint && x.column === y.column
|
|
278
289
|
&& x.scroll === y.scroll && x.animate === y.animate && x.between === y.between
|
|
279
290
|
&& (x.feel ?? '') === (y.feel ?? '') && (x.headings ?? '') === (y.headings ?? '')
|
|
280
291
|
&& (x.preloader ?? '') === (y.preloader ?? '')
|
|
@@ -46,6 +46,13 @@ export type TintId = keyof typeof SPEC_AXES.tints;
|
|
|
46
46
|
export const TINT_IDS = Object.keys(SPEC_AXES.tints) as ReadonlyArray<TintId>;
|
|
47
47
|
/** What a studio that stored its look BEFORE the tint existed wears: exactly the look's own palette. */
|
|
48
48
|
export const PRE_TINT_DEFAULT: TintId = 'neutral';
|
|
49
|
+
/** The content column (award plan §0c, AW-D33): Wide (the window minus the one gutter) · Contained · Narrow. */
|
|
50
|
+
export type ColumnId = keyof typeof SPEC_AXES.columns;
|
|
51
|
+
export const COLUMN_IDS = Object.keys(SPEC_AXES.columns) as ReadonlyArray<ColumnId>;
|
|
52
|
+
/** What a studio that stored its look BEFORE the column existed wears: Wide — exactly its pages (AW-D39). */
|
|
53
|
+
export const PRE_COLUMN: ColumnId = SPEC_AXES.columnChoices.pre as ColumnId;
|
|
54
|
+
/** What a NEW look starts on: one centred column (AW-D34; every pack's `defaults.column`). */
|
|
55
|
+
export const NEW_COLUMN: ColumnId = SPEC_AXES.columnChoices.new as ColumnId;
|
|
49
56
|
/** How the site scrolls (AI plan rev 3.1 §3p): Normal (the browser's own) · Smooth · Extra smooth. */
|
|
50
57
|
export type ScrollId = keyof typeof SPEC_AXES.scrolls;
|
|
51
58
|
/** How much the sections move in as they scroll into view: Still · Subtle · Standard · Lively. */
|
|
@@ -81,6 +88,9 @@ export interface DesignChoices {
|
|
|
81
88
|
/** Absent = the pack's default (`defaults.tint`). `readDesignConfig` reads a row stored before DS9 as
|
|
82
89
|
* `neutral` — the palette it was applied with. */
|
|
83
90
|
tint?: TintId;
|
|
91
|
+
/** The site's content column (award §0c). Absent = the pack's default (`defaults.column`, contained); `readDesignConfig`
|
|
92
|
+
* reads a row stored before the column as `wide` — the pages it was built with (AW-D39). */
|
|
93
|
+
column?: ColumnId;
|
|
84
94
|
fonts?: Partial<Record<FontRoleToken, string>>;
|
|
85
95
|
/** Absent = `PRE_MOTION` (a row stored before rev 3.1 reads what its site already did). */
|
|
86
96
|
scroll?: ScrollId;
|
|
@@ -149,6 +159,7 @@ export interface FlavorPackV2 {
|
|
|
149
159
|
readonly pillButtons: boolean;
|
|
150
160
|
readonly mode: DesignMode;
|
|
151
161
|
readonly tint: TintId;
|
|
162
|
+
readonly column: ColumnId;
|
|
152
163
|
};
|
|
153
164
|
readonly seed: string;
|
|
154
165
|
readonly seeds: ReadonlyArray<string>;
|