@vectoriox/iox-ui 5.41.1 → 5.43.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/data-core/index.d.ts +360 -0
- package/data-core/package.json +3 -0
- package/design-core/index.d.ts +19 -2
- package/fesm2022/vectoriox-iox-ui-data-core.mjs +491 -0
- package/fesm2022/vectoriox-iox-ui-data-core.mjs.map +1 -0
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +40 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +12 -12
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +3 -475
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +12 -12
- package/index.d.ts +3 -360
- package/package.json +5 -1
- package/src/data-core/data-source-resolver.ts +378 -0
- package/src/data-core/public-api.ts +12 -0
- package/src/data-core/relative-sources.ts +282 -0
- package/src/design-core/design-apply.ts +56 -3
- package/src/generation-core/site-spec.generated.ts +12 -12
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { deriveBrandTokens } from './brand';
|
|
2
|
-
import { SPEC_LEGACY_ALIASES } from './flavor-spec.generated';
|
|
2
|
+
import { FLAVOR_SPEC_VERSION, SPEC_LEGACY_ALIASES } from './flavor-spec.generated';
|
|
3
3
|
import { SWISS_FLAVOR } from './flavor';
|
|
4
4
|
import { buildFlavorTokens, legacyFlavorTokens } from './flavor-tokens';
|
|
5
5
|
import {
|
|
6
|
-
FlavorRevertPlan, FlavorSeedOptions, FlavorSeedPlan, planFlavorRevert, planFlavorSeed, SeedBaseline,
|
|
6
|
+
FlavorRevertPlan, FlavorRevertSnapshot, FlavorSeedOptions, FlavorSeedPlan, flavorSeedWrites, planFlavorRevert, planFlavorSeed, SeedBaseline,
|
|
7
|
+
SeedExpectation, untouchedSeedRow,
|
|
7
8
|
} from './flavor-seed';
|
|
8
9
|
import { DesignChoices, DesignTokenRow, flavorSourceStamp, StoredDesignTokenRow } from './design-token.model';
|
|
9
10
|
import { fontFamilyKey, FontFamilyToken, fontRoleReferences, parseFontFamilies } from './fonts';
|
|
10
|
-
import { flavorPackById, isRetiredFlavorId, packDesignChoices, StoredDesign } from './design-settings';
|
|
11
|
+
import { DesignConfigEntry, DesignConfigKey, designConfigEntries, flavorPackById, isRetiredFlavorId, packDesignChoices, StoredDesign } from './design-settings';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Applying a look (design-system DS4): the COMPLETE `buildFlavorTokens` set for the chosen
|
|
@@ -125,6 +126,58 @@ export function planDesignRevert(current: ReadonlyArray<StoredDesignTokenRow>, d
|
|
|
125
126
|
return planFlavorRevert(current, snapshot.tokens, snapshot.wrote ?? designTokenRows(design.choices));
|
|
126
127
|
}
|
|
127
128
|
|
|
129
|
+
/** The revert snapshot an Apply stores in `settings.design` (board F7): design-core's snapshot plus the design
|
|
130
|
+
* row's previous config VERBATIM, so a revert restores every choice (pair, axes, mode, fonts), not only the
|
|
131
|
+
* flavor id and seed. */
|
|
132
|
+
export interface DesignRevertSnapshot extends FlavorRevertSnapshot {
|
|
133
|
+
fromConfig?: DesignConfigEntry[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* What an Apply of `plan` stores as its revert snapshot — the ONE rule the builder's Apply and the
|
|
138
|
+
* server-side site build (W2) share: the whole pre-apply token set, what the apply writes into each row,
|
|
139
|
+
* and where a revert goes back to — never a null flavor (a studio with no design row wore its design's
|
|
140
|
+
* defaults, so that is what it returns to). An apply that writes nothing keeps the previous snapshot:
|
|
141
|
+
* clobbering a useful one with "nothing changed" would be a lie.
|
|
142
|
+
*/
|
|
143
|
+
export function designApplySnapshot(
|
|
144
|
+
previous: StoredDesign,
|
|
145
|
+
previousConfig: ReadonlyArray<DesignConfigEntry> | null | undefined,
|
|
146
|
+
existing: ReadonlyArray<StoredDesignTokenRow>,
|
|
147
|
+
plan: FlavorSeedPlan,
|
|
148
|
+
appliedAt: number,
|
|
149
|
+
): DesignRevertSnapshot | null {
|
|
150
|
+
if (!plan.create.length && !plan.update.length) return previous.revert;
|
|
151
|
+
const origin: Pick<DesignRevertSnapshot, 'from' | 'fromConfig'> = previous.storedFlavorId
|
|
152
|
+
? {
|
|
153
|
+
from: { flavorId: previous.storedFlavorId, flavorVersion: previous.flavorVersion, brandSeed: previous.storedSeed },
|
|
154
|
+
fromConfig: (previousConfig ?? []).filter(kv => kv?.key !== DesignConfigKey.Revert),
|
|
155
|
+
}
|
|
156
|
+
: {
|
|
157
|
+
from: { flavorId: previous.choices.flavorId, flavorVersion: String(FLAVOR_SPEC_VERSION), brandSeed: previous.choices.seed },
|
|
158
|
+
fromConfig: designConfigEntries(previous.choices, FLAVOR_SPEC_VERSION, null),
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
appliedAt,
|
|
162
|
+
...origin,
|
|
163
|
+
tokens: (existing ?? []).map(r => ({ name: r.name, type: r.type, value: r.value, values: r.values, source: r.source, group: r.group, tier: r.tier })),
|
|
164
|
+
wrote: flavorSeedWrites(plan, existing),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** The config a revert puts back: the snapshot's verbatim config, else (a snapshot older than `fromConfig`)
|
|
169
|
+
* the identity it recorded. */
|
|
170
|
+
export function designRevertConfig(snapshot: DesignRevertSnapshot): DesignConfigEntry[] {
|
|
171
|
+
if (snapshot.fromConfig) return snapshot.fromConfig;
|
|
172
|
+
return [
|
|
173
|
+
...(snapshot.from.flavorId ? [
|
|
174
|
+
{ key: DesignConfigKey.FlavorId, value: snapshot.from.flavorId },
|
|
175
|
+
{ key: DesignConfigKey.FlavorVersion, value: snapshot.from.flavorVersion ?? '' },
|
|
176
|
+
] : []),
|
|
177
|
+
...(snapshot.from.brandSeed ? [{ key: DesignConfigKey.BrandSeed, value: snapshot.from.brandSeed }] : []),
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
|
|
128
181
|
/** The rows a design is missing by name — the builder-load top-up (never touches an existing row). */
|
|
129
182
|
export function missingDesignRows(existing: ReadonlyArray<{ name: string }>, choices: DesignChoices): DesignTokenRow[] {
|
|
130
183
|
const have = new Set((existing ?? []).map(r => r.name));
|
|
@@ -171,7 +171,7 @@ export const SPEC_SITE_PATTERNS = {
|
|
|
171
171
|
]
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
|
-
"footer.
|
|
174
|
+
"footer.three-column": {
|
|
175
175
|
"family": "footer",
|
|
176
176
|
"label": "Footer, three columns",
|
|
177
177
|
"global": "after",
|
|
@@ -385,7 +385,7 @@ export const SPEC_SITE_PATTERNS = {
|
|
|
385
385
|
]
|
|
386
386
|
}
|
|
387
387
|
},
|
|
388
|
-
"
|
|
388
|
+
"collection.card-grid": {
|
|
389
389
|
"family": "collection",
|
|
390
390
|
"label": "Project cards, three across",
|
|
391
391
|
"node": {
|
|
@@ -460,8 +460,8 @@ export const SPEC_SITE_PATTERNS = {
|
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
},
|
|
463
|
-
"
|
|
464
|
-
"family": "
|
|
463
|
+
"feature.triad": {
|
|
464
|
+
"family": "feature",
|
|
465
465
|
"label": "Three services",
|
|
466
466
|
"node": {
|
|
467
467
|
"t": "Section",
|
|
@@ -571,7 +571,7 @@ export const SPEC_SITE_PATTERNS = {
|
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
},
|
|
574
|
-
"cta.
|
|
574
|
+
"cta.banner": {
|
|
575
575
|
"family": "cta",
|
|
576
576
|
"label": "Call to action band",
|
|
577
577
|
"node": {
|
|
@@ -1951,14 +1951,14 @@ export const SPEC_SITE_TEMPLATES = {
|
|
|
1951
1951
|
"pattern": "hero.split"
|
|
1952
1952
|
},
|
|
1953
1953
|
{
|
|
1954
|
-
"pattern": "
|
|
1954
|
+
"pattern": "collection.card-grid",
|
|
1955
1955
|
"binding": "projectsLatest"
|
|
1956
1956
|
},
|
|
1957
1957
|
{
|
|
1958
|
-
"pattern": "
|
|
1958
|
+
"pattern": "feature.triad"
|
|
1959
1959
|
},
|
|
1960
1960
|
{
|
|
1961
|
-
"pattern": "cta.
|
|
1961
|
+
"pattern": "cta.banner"
|
|
1962
1962
|
}
|
|
1963
1963
|
]
|
|
1964
1964
|
},
|
|
@@ -1977,7 +1977,7 @@ export const SPEC_SITE_TEMPLATES = {
|
|
|
1977
1977
|
}
|
|
1978
1978
|
},
|
|
1979
1979
|
{
|
|
1980
|
-
"pattern": "
|
|
1980
|
+
"pattern": "collection.card-grid",
|
|
1981
1981
|
"binding": "projects",
|
|
1982
1982
|
"without": [
|
|
1983
1983
|
"header"
|
|
@@ -2004,7 +2004,7 @@ export const SPEC_SITE_TEMPLATES = {
|
|
|
2004
2004
|
"pattern": "project.next"
|
|
2005
2005
|
},
|
|
2006
2006
|
{
|
|
2007
|
-
"pattern": "cta.
|
|
2007
|
+
"pattern": "cta.banner"
|
|
2008
2008
|
}
|
|
2009
2009
|
]
|
|
2010
2010
|
},
|
|
@@ -2026,7 +2026,7 @@ export const SPEC_SITE_TEMPLATES = {
|
|
|
2026
2026
|
"pattern": "about.story"
|
|
2027
2027
|
},
|
|
2028
2028
|
{
|
|
2029
|
-
"pattern": "cta.
|
|
2029
|
+
"pattern": "cta.banner"
|
|
2030
2030
|
}
|
|
2031
2031
|
]
|
|
2032
2032
|
},
|
|
@@ -2045,7 +2045,7 @@ export const SPEC_SITE_TEMPLATES = {
|
|
|
2045
2045
|
],
|
|
2046
2046
|
"globals": {
|
|
2047
2047
|
"header": "nav.inline-cta",
|
|
2048
|
-
"footer": "footer.
|
|
2048
|
+
"footer": "footer.three-column"
|
|
2049
2049
|
}
|
|
2050
2050
|
}
|
|
2051
2051
|
} as const;
|