@takazudo/zdtp 0.4.4 → 0.4.5
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/CHANGELOG.md +22 -0
- package/README.md +113 -12
- package/dist/apply/apply-token-overrides.d.ts +139 -32
- package/dist/astro/host-adapter.js +39 -39
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-CmhI7q9j.js → autoload-state-DF7TsTgY.js} +1 -1
- package/dist/bin/server.js +116 -112
- package/dist/config/panel-config.d.ts +36 -1
- package/dist/export-modal.d.ts +5 -3
- package/dist/import-modal.d.ts +9 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2239 -2219
- package/dist/load-routing-LJ72261l.js +421 -0
- package/dist/{panel-config-CXTCcYQs.js → panel-config-CipeKMTz.js} +286 -234
- package/dist/server/create-apply-handler.d.ts +6 -0
- package/dist/server/index.js +1 -1
- package/dist/state/tweak-state.d.ts +137 -14
- package/dist/testing.js +5 -5
- package/dist/tokens/tier-model.d.ts +12 -0
- package/dist/tweak-state-xt-tSQ_t.js +1958 -0
- package/dist/utils/design-token-serde.d.ts +20 -12
- package/package.json +1 -1
- package/dist/load-routing-DtNTKoLW.js +0 -353
- package/dist/tweak-state-BeXkzoj8.js +0 -1858
|
@@ -3,65 +3,65 @@ class w extends Error {
|
|
|
3
3
|
super(t), this.name = "TierResolverError", Object.setPrototypeOf(this, w.prototype);
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function A(e, t) {
|
|
7
7
|
return e.tiers.find((n) => n.id === t);
|
|
8
8
|
}
|
|
9
9
|
function $(e, t) {
|
|
10
10
|
return e.items.find((n) => n.id === t);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const g =
|
|
12
|
+
function W(e, t, n, a) {
|
|
13
|
+
const g = A(e, t);
|
|
14
14
|
if (!g)
|
|
15
15
|
throw new w(
|
|
16
|
-
`Tier "${t}" not found in tab "${e.id}". Available tiers: ${e.tiers.map((
|
|
16
|
+
`Tier "${t}" not found in tab "${e.id}". Available tiers: ${e.tiers.map((l) => l.id).join(", ")}.`
|
|
17
17
|
);
|
|
18
18
|
const c = $(g, n);
|
|
19
19
|
if (!c)
|
|
20
20
|
throw new w(
|
|
21
21
|
`Item "${n}" not found in tier "${t}" of tab "${e.id}".`
|
|
22
22
|
);
|
|
23
|
-
const
|
|
23
|
+
const s = a[t]?.[n];
|
|
24
24
|
if (g.referencesTier !== void 0) {
|
|
25
|
-
const
|
|
25
|
+
const l = g.referencesTier, f = A(e, l);
|
|
26
26
|
if (!f)
|
|
27
27
|
throw new w(
|
|
28
|
-
`Tier "${t}" declares referencesTier "${
|
|
28
|
+
`Tier "${t}" declares referencesTier "${l}" but that tier does not exist in tab "${e.id}".`
|
|
29
29
|
);
|
|
30
|
-
const o = $(f,
|
|
30
|
+
const o = $(f, s ?? n);
|
|
31
31
|
if (!o) {
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
32
|
+
const u = $(f, c.default) ?? $(f, n) ?? f.items[0];
|
|
33
|
+
if (!u)
|
|
34
34
|
throw new w(
|
|
35
|
-
`Referenced tier "${
|
|
35
|
+
`Referenced tier "${l}" has no items; cannot resolve fallback for item "${n}" in tier "${t}" of tab "${e.id}".`
|
|
36
36
|
);
|
|
37
|
-
return { kind: "ref", targetCssVar:
|
|
37
|
+
return { kind: "ref", targetCssVar: u.cssVar };
|
|
38
38
|
}
|
|
39
39
|
return { kind: "ref", targetCssVar: o.cssVar };
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return s !== void 0 ? c.pill && s === c.pill.value ? { kind: "literal", value: c.pill.value } : { kind: "literal", value: s } : c.pill ? { kind: "literal", value: c.pill.customDefault } : { kind: "literal", value: c.default };
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function Y(e) {
|
|
44
44
|
return e.kind === "literal" ? e.value : `var(${e.targetCssVar})`;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
46
|
+
function D(e, t, n = [t]) {
|
|
47
|
+
const a = e.tab === void 0 || e.tab === t.id ? t : n.find((i) => i.id === e.tab);
|
|
48
|
+
if (!a)
|
|
49
49
|
throw new w(
|
|
50
|
-
`Cross-tab ref target tab "${e.tab}" not found. Available tabs: ${n.map((
|
|
50
|
+
`Cross-tab ref target tab "${e.tab}" not found. Available tabs: ${n.map((i) => i.id).join(", ")}.`
|
|
51
51
|
);
|
|
52
|
-
const g =
|
|
52
|
+
const g = A(a, e.tier);
|
|
53
53
|
if (!g)
|
|
54
54
|
throw new w(
|
|
55
|
-
`Cross-tab ref target tier "${e.tier}" not found in tab "${
|
|
55
|
+
`Cross-tab ref target tier "${e.tier}" not found in tab "${a.id}". Available tiers: ${a.tiers.map((i) => i.id).join(", ")}.`
|
|
56
56
|
);
|
|
57
57
|
const c = $(g, e.item);
|
|
58
58
|
if (!c)
|
|
59
59
|
throw new w(
|
|
60
|
-
`Cross-tab ref target item "${e.item}" not found in tier "${e.tier}" of tab "${
|
|
60
|
+
`Cross-tab ref target item "${e.item}" not found in tier "${e.tier}" of tab "${a.id}". Available items: ${g.items.map((i) => i.id).join(", ")}.`
|
|
61
61
|
);
|
|
62
62
|
return c.cssVar;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function I(e, t) {
|
|
65
65
|
return e.paletteCssVarTemplate.replace("{n}", String(t));
|
|
66
66
|
}
|
|
67
67
|
const M = /* @__PURE__ */ new Set([
|
|
@@ -224,36 +224,36 @@ const M = /* @__PURE__ */ new Set([
|
|
|
224
224
|
function H(e) {
|
|
225
225
|
return e.startsWith("#") || e.includes("(") || M.has(e.toLowerCase());
|
|
226
226
|
}
|
|
227
|
-
function N(e, t, n,
|
|
227
|
+
function N(e, t, n, a) {
|
|
228
228
|
const g = [], c = e.indexOf(":");
|
|
229
229
|
if (c !== -1) {
|
|
230
|
-
const
|
|
231
|
-
f && g.push({ tab: f.tab, tier: f.tier, item:
|
|
230
|
+
const s = e.slice(0, c), l = e.slice(c + 1), f = t.find((r) => r.tier === s);
|
|
231
|
+
f && g.push({ tab: f.tab, tier: f.tier, item: l });
|
|
232
232
|
}
|
|
233
|
-
const [
|
|
234
|
-
g.push({ tab:
|
|
235
|
-
for (const
|
|
233
|
+
const [i] = t;
|
|
234
|
+
g.push({ tab: i.tab, tier: i.tier, item: e });
|
|
235
|
+
for (const s of g)
|
|
236
236
|
try {
|
|
237
|
-
return
|
|
237
|
+
return D(s, n, a), { ref: s };
|
|
238
238
|
} catch {
|
|
239
239
|
}
|
|
240
240
|
return { ref: g[0] };
|
|
241
241
|
}
|
|
242
|
-
function K(e, t, n,
|
|
243
|
-
const
|
|
244
|
-
return
|
|
242
|
+
function K(e, t, n, a, g, c) {
|
|
243
|
+
const i = t.get(e.default);
|
|
244
|
+
return i !== void 0 ? i : e.default === "bg" || e.default === "fg" ? e.default : n && n.length > 0 && !H(e.default) ? N(e.default, n, a, g) : c ? (console.warn(
|
|
245
245
|
`[design-token-panel] semantic item "${e.id}" default "${e.default}" names no palette item; falling back to palette index 0`
|
|
246
246
|
), 0) : { literal: e.default };
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function V(e, t = [e]) {
|
|
249
249
|
const n = e.colorExtras;
|
|
250
250
|
if (!n) return;
|
|
251
|
-
const
|
|
251
|
+
const a = e.tiers.find(
|
|
252
252
|
(o) => !o.referencesTier && !o.semantic && o.items.length > 0 && o.items[0].type.kind === "color"
|
|
253
253
|
), g = e.tiers.find(
|
|
254
|
-
(o) =>
|
|
254
|
+
(o) => a && o.referencesTier === a.id || o.semantic === !0
|
|
255
255
|
);
|
|
256
|
-
if (!
|
|
256
|
+
if (!a && !g)
|
|
257
257
|
return {
|
|
258
258
|
id: n.id,
|
|
259
259
|
label: n.label,
|
|
@@ -267,16 +267,16 @@ function R(e, t = [e]) {
|
|
|
267
267
|
colorSchemes: n.colorSchemes,
|
|
268
268
|
panelSettings: n.panelSettings
|
|
269
269
|
};
|
|
270
|
-
const c =
|
|
270
|
+
const c = a?.items ?? [], i = c.length, s = c[0] ? c[0].cssVar.replace(/\d+$/, "{n}") : "--zudo-stub-p{n}", l = /* @__PURE__ */ new Map();
|
|
271
271
|
for (let o = 0; o < c.length; o++)
|
|
272
|
-
|
|
272
|
+
l.set(c[o].id, o);
|
|
273
273
|
const f = {}, r = {};
|
|
274
274
|
if (g) {
|
|
275
|
-
const o = !g.semantic;
|
|
275
|
+
const o = !g.semantic, u = n.semanticDefaults;
|
|
276
276
|
for (const d of g.items)
|
|
277
|
-
r[d.id] = d.cssVar, f[d.id] = K(
|
|
277
|
+
r[d.id] = d.cssVar, f[d.id] = u && d.id in u ? u[d.id] : K(
|
|
278
278
|
d,
|
|
279
|
-
|
|
279
|
+
l,
|
|
280
280
|
g.referencesRamps,
|
|
281
281
|
e,
|
|
282
282
|
t,
|
|
@@ -286,9 +286,9 @@ function R(e, t = [e]) {
|
|
|
286
286
|
return {
|
|
287
287
|
id: n.id,
|
|
288
288
|
label: n.label,
|
|
289
|
-
paletteSize:
|
|
289
|
+
paletteSize: i,
|
|
290
290
|
baseRoles: n.baseRoles,
|
|
291
|
-
paletteCssVarTemplate:
|
|
291
|
+
paletteCssVarTemplate: s,
|
|
292
292
|
semanticDefaults: f,
|
|
293
293
|
semanticCssNames: r,
|
|
294
294
|
baseDefaults: n.baseDefaults,
|
|
@@ -297,34 +297,34 @@ function R(e, t = [e]) {
|
|
|
297
297
|
panelSettings: n.panelSettings
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function X(e) {
|
|
301
301
|
const t = e.find((n) => n.id === "color");
|
|
302
302
|
if (t)
|
|
303
|
-
return
|
|
303
|
+
return V(t, e);
|
|
304
304
|
}
|
|
305
305
|
function z(e) {
|
|
306
306
|
const t = e.find((n) => n.id === "color-secondary");
|
|
307
|
-
return t ?
|
|
307
|
+
return t ? V(t, e) ?? null : null;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function S(e, t) {
|
|
310
310
|
if (Object.is(e, t)) return !0;
|
|
311
311
|
if (e === null || t === null || typeof e != typeof t || typeof e != "object") return !1;
|
|
312
312
|
if (Array.isArray(e)) {
|
|
313
313
|
if (!Array.isArray(t) || e.length !== t.length) return !1;
|
|
314
314
|
for (let c = 0; c < e.length; c++)
|
|
315
|
-
if (!
|
|
315
|
+
if (!S(e[c], t[c])) return !1;
|
|
316
316
|
return !0;
|
|
317
317
|
}
|
|
318
318
|
if (Array.isArray(t)) return !1;
|
|
319
|
-
const n = Object.keys(e),
|
|
320
|
-
if (n.length !==
|
|
321
|
-
const g = new Set(
|
|
319
|
+
const n = Object.keys(e), a = Object.keys(t);
|
|
320
|
+
if (n.length !== a.length) return !1;
|
|
321
|
+
const g = new Set(a);
|
|
322
322
|
for (const c of n)
|
|
323
|
-
if (!g.has(c) || !
|
|
323
|
+
if (!g.has(c) || !S(e[c], t[c]))
|
|
324
324
|
return !1;
|
|
325
325
|
return !0;
|
|
326
326
|
}
|
|
327
|
-
const
|
|
327
|
+
const O = {
|
|
328
328
|
storagePrefix: "zudo-design-token-panel",
|
|
329
329
|
consoleNamespace: "zudo",
|
|
330
330
|
modalClassPrefix: "zudo-design-token-panel-modal",
|
|
@@ -336,19 +336,20 @@ const V = {
|
|
|
336
336
|
// No bundled apply endpoint / routing — hosts wire their own.
|
|
337
337
|
applyEndpoint: void 0,
|
|
338
338
|
applyRouting: void 0
|
|
339
|
-
},
|
|
339
|
+
}, R = /* @__PURE__ */ Symbol.for("@takazudo/zdtp:singleton");
|
|
340
340
|
function y() {
|
|
341
341
|
const e = globalThis;
|
|
342
|
-
let t = e[
|
|
342
|
+
let t = e[R];
|
|
343
343
|
return t || (t = {
|
|
344
344
|
instances: /* @__PURE__ */ new Map(),
|
|
345
345
|
defaultPrefix: null,
|
|
346
346
|
pendingColorPresets: null,
|
|
347
347
|
pendingPostConfigureHooks: [],
|
|
348
|
-
lifecycleHooks: {}
|
|
349
|
-
|
|
348
|
+
lifecycleHooks: {},
|
|
349
|
+
colorSchemeOwners: /* @__PURE__ */ new Set()
|
|
350
|
+
}, e[R] = t), t;
|
|
350
351
|
}
|
|
351
|
-
function
|
|
352
|
+
function F(e) {
|
|
352
353
|
return {
|
|
353
354
|
instanceId: e,
|
|
354
355
|
open() {
|
|
@@ -370,7 +371,7 @@ function D(e) {
|
|
|
370
371
|
}
|
|
371
372
|
};
|
|
372
373
|
}
|
|
373
|
-
function
|
|
374
|
+
function Q(e) {
|
|
374
375
|
y().lifecycleHooks = {
|
|
375
376
|
configured: e.configured,
|
|
376
377
|
open: e.open,
|
|
@@ -379,40 +380,40 @@ function I(e) {
|
|
|
379
380
|
destroy: e.destroy
|
|
380
381
|
};
|
|
381
382
|
}
|
|
382
|
-
function
|
|
383
|
-
const t = y(), n = e.storagePrefix,
|
|
384
|
-
if (
|
|
383
|
+
function Z(e) {
|
|
384
|
+
const t = y(), n = e.storagePrefix, a = t.instances.get(n);
|
|
385
|
+
if (a) {
|
|
385
386
|
const f = (r) => ({ ...r, applySink: void 0 });
|
|
386
|
-
if (
|
|
387
|
-
return t.defaultPrefix = n,
|
|
387
|
+
if (S(f(a.suppliedConfig), f(e)))
|
|
388
|
+
return t.defaultPrefix = n, a.handle;
|
|
388
389
|
throw new Error(
|
|
389
390
|
`[design-token-panel] configurePanel() was already called with different values for storagePrefix "${n}". Configuration is one-shot per prefix per page lifecycle. To re-configure this prefix, call handle.destroy() first, then configurePanel() again. (Use a distinct storagePrefix for a second panel instance.)`
|
|
390
391
|
);
|
|
391
392
|
}
|
|
392
393
|
const g = t.pendingColorPresets, c = g ? { ...e, colorPresets: g } : { ...e };
|
|
393
394
|
t.pendingColorPresets = null;
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
const
|
|
395
|
+
const i = t.instances.size === 0, s = i ? [...t.pendingPostConfigureHooks] : [];
|
|
396
|
+
i && (t.pendingPostConfigureHooks.length = 0);
|
|
397
|
+
const l = {
|
|
397
398
|
config: c,
|
|
398
399
|
// Snapshot the as-supplied config before any runtime merges. Used by the
|
|
399
400
|
// idempotency guard so view-transition re-calls with the original inline
|
|
400
401
|
// config keep passing even after setPanelColorPresets mutates `config`.
|
|
401
402
|
suppliedConfig: { ...e },
|
|
402
403
|
pendingColorPresets: null,
|
|
403
|
-
postConfigureHooks:
|
|
404
|
-
handle:
|
|
404
|
+
postConfigureHooks: s,
|
|
405
|
+
handle: F(n)
|
|
405
406
|
};
|
|
406
|
-
t.instances.set(n,
|
|
407
|
-
for (const f of
|
|
407
|
+
t.instances.set(n, l), t.defaultPrefix = n;
|
|
408
|
+
for (const f of l.postConfigureHooks)
|
|
408
409
|
f();
|
|
409
|
-
return t.lifecycleHooks.configured?.(n),
|
|
410
|
+
return t.lifecycleHooks.configured?.(n), l.handle;
|
|
410
411
|
}
|
|
411
412
|
function x() {
|
|
412
413
|
const e = y();
|
|
413
414
|
return e.defaultPrefix === null ? null : e.instances.get(e.defaultPrefix) ?? null;
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
+
function ee(e) {
|
|
416
417
|
const t = x();
|
|
417
418
|
if (t === null) {
|
|
418
419
|
const n = y();
|
|
@@ -422,67 +423,83 @@ function Q(e) {
|
|
|
422
423
|
}
|
|
423
424
|
t.postConfigureHooks.includes(e) || (t.postConfigureHooks.push(e), e());
|
|
424
425
|
}
|
|
425
|
-
function
|
|
426
|
-
return x()?.config ??
|
|
426
|
+
function _() {
|
|
427
|
+
return x()?.config ?? O;
|
|
427
428
|
}
|
|
428
|
-
function
|
|
429
|
+
function te() {
|
|
429
430
|
return [...y().instances.values()].map((e) => e.config);
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
+
function ne(e) {
|
|
432
433
|
return y().instances.get(e)?.config ?? null;
|
|
433
434
|
}
|
|
434
|
-
function
|
|
435
|
+
function re() {
|
|
436
|
+
const e = y();
|
|
437
|
+
e.instances.clear(), e.defaultPrefix = null, e.pendingColorPresets = null, e.pendingPostConfigureHooks.length = 0, v().clear();
|
|
438
|
+
}
|
|
439
|
+
function v() {
|
|
435
440
|
const e = y();
|
|
436
|
-
e.
|
|
441
|
+
return e.colorSchemeOwners || (e.colorSchemeOwners = /* @__PURE__ */ new Set()), e.colorSchemeOwners;
|
|
437
442
|
}
|
|
438
|
-
function
|
|
443
|
+
function ie(e) {
|
|
444
|
+
v().add(e);
|
|
445
|
+
}
|
|
446
|
+
function oe(e) {
|
|
447
|
+
v().delete(e);
|
|
448
|
+
}
|
|
449
|
+
function se(e) {
|
|
450
|
+
return v().has(e);
|
|
451
|
+
}
|
|
452
|
+
function ae(e = _()) {
|
|
439
453
|
return z(e.tabs);
|
|
440
454
|
}
|
|
441
|
-
function
|
|
455
|
+
function le(e) {
|
|
442
456
|
return `${e.storagePrefix}-state-v2`;
|
|
443
457
|
}
|
|
444
|
-
function
|
|
458
|
+
function fe(e) {
|
|
445
459
|
return `${e.storagePrefix}-state-v3`;
|
|
446
460
|
}
|
|
447
|
-
function
|
|
461
|
+
function ce(e) {
|
|
462
|
+
return `${e.storagePrefix}-state-v4`;
|
|
463
|
+
}
|
|
464
|
+
function ge(e) {
|
|
448
465
|
return `${e.storagePrefix}-state`;
|
|
449
466
|
}
|
|
450
|
-
function
|
|
467
|
+
function ue(e) {
|
|
451
468
|
return `${e.storagePrefix}-open`;
|
|
452
469
|
}
|
|
453
|
-
function
|
|
470
|
+
function de(e) {
|
|
454
471
|
return `${e.storagePrefix}-position`;
|
|
455
472
|
}
|
|
456
|
-
function
|
|
473
|
+
function pe(e) {
|
|
457
474
|
return `${e.storagePrefix}-size`;
|
|
458
475
|
}
|
|
459
|
-
function
|
|
476
|
+
function ye(e) {
|
|
460
477
|
return `${e.storagePrefix}-density`;
|
|
461
478
|
}
|
|
462
|
-
function
|
|
479
|
+
function me(e) {
|
|
463
480
|
return `${e.storagePrefix}:visible`;
|
|
464
481
|
}
|
|
465
|
-
function
|
|
482
|
+
function he(e) {
|
|
466
483
|
return `${e.storagePrefix}:autoload`;
|
|
467
484
|
}
|
|
468
|
-
function
|
|
485
|
+
function be(e) {
|
|
469
486
|
return `${e.storagePrefix}-root`;
|
|
470
487
|
}
|
|
471
|
-
const
|
|
472
|
-
function
|
|
473
|
-
return e.storagePrefix ===
|
|
488
|
+
const q = O.storagePrefix, L = "toggle-design-token-panel";
|
|
489
|
+
function we(e) {
|
|
490
|
+
return e.storagePrefix === q ? L : e.toggleEvent ?? `toggle-${e.storagePrefix}`;
|
|
474
491
|
}
|
|
475
|
-
const
|
|
476
|
-
function
|
|
477
|
-
return `${
|
|
492
|
+
const J = "__zdtp:open-state-changed";
|
|
493
|
+
function ke(e) {
|
|
494
|
+
return `${J}:${e.storagePrefix}`;
|
|
478
495
|
}
|
|
479
|
-
function
|
|
496
|
+
function $e(e, t) {
|
|
480
497
|
return `${e.modalClassPrefix}${t}`;
|
|
481
498
|
}
|
|
482
|
-
function
|
|
499
|
+
function Ce(e) {
|
|
483
500
|
return `${e.exportFilenameBase}.json`;
|
|
484
501
|
}
|
|
485
|
-
function
|
|
502
|
+
function Pe(e) {
|
|
486
503
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
487
504
|
throw new Error("[design-token-panel] PanelConfig must be a non-null object");
|
|
488
505
|
const t = e;
|
|
@@ -497,7 +514,7 @@ function he(e) {
|
|
|
497
514
|
throw new Error(
|
|
498
515
|
`[design-token-panel] PanelConfig.${n} must be a non-empty string (got ${typeof t[n]})`
|
|
499
516
|
);
|
|
500
|
-
if (
|
|
517
|
+
if (B(t.tabs), t.toggleEvent !== void 0 && (typeof t.toggleEvent != "string" || t.toggleEvent.length === 0))
|
|
501
518
|
throw new Error(
|
|
502
519
|
`[design-token-panel] PanelConfig.toggleEvent must be a non-empty string when set (got ${typeof t.toggleEvent})`
|
|
503
520
|
);
|
|
@@ -508,8 +525,8 @@ function he(e) {
|
|
|
508
525
|
if (t.applyRouting !== void 0) {
|
|
509
526
|
if (t.applyRouting === null || typeof t.applyRouting != "object" || Array.isArray(t.applyRouting))
|
|
510
527
|
throw new Error("[design-token-panel] PanelConfig.applyRouting must be a plain object");
|
|
511
|
-
for (const [n,
|
|
512
|
-
if (typeof
|
|
528
|
+
for (const [n, a] of Object.entries(t.applyRouting))
|
|
529
|
+
if (typeof a != "string")
|
|
513
530
|
throw new Error(
|
|
514
531
|
`[design-token-panel] PanelConfig.applyRouting[${JSON.stringify(n)}] must be a string`
|
|
515
532
|
);
|
|
@@ -517,87 +534,106 @@ function he(e) {
|
|
|
517
534
|
if (t.legacyIdRenameMap !== void 0) {
|
|
518
535
|
if (t.legacyIdRenameMap === null || typeof t.legacyIdRenameMap != "object" || Array.isArray(t.legacyIdRenameMap))
|
|
519
536
|
throw new Error("[design-token-panel] PanelConfig.legacyIdRenameMap must be a plain object");
|
|
520
|
-
for (const [n,
|
|
521
|
-
if (
|
|
537
|
+
for (const [n, a] of Object.entries(t.legacyIdRenameMap))
|
|
538
|
+
if (a !== null && typeof a != "string")
|
|
522
539
|
throw new Error(
|
|
523
|
-
`[design-token-panel] PanelConfig.legacyIdRenameMap[${JSON.stringify(n)}] must be a string or null (got ${typeof
|
|
540
|
+
`[design-token-panel] PanelConfig.legacyIdRenameMap[${JSON.stringify(n)}] must be a string or null (got ${typeof a})`
|
|
524
541
|
);
|
|
525
542
|
}
|
|
526
543
|
}
|
|
527
|
-
function
|
|
544
|
+
function B(e) {
|
|
528
545
|
if (!Array.isArray(e))
|
|
529
546
|
throw new Error("[design-token-panel] PanelConfig.tabs must be an array");
|
|
530
547
|
const t = /* @__PURE__ */ new Set();
|
|
531
548
|
for (const n of e) {
|
|
532
549
|
if (n === null || typeof n != "object" || Array.isArray(n))
|
|
533
550
|
throw new Error("[design-token-panel] PanelConfig.tabs: each tab must be a non-null object");
|
|
534
|
-
const
|
|
535
|
-
if (typeof
|
|
551
|
+
const a = n;
|
|
552
|
+
if (typeof a.id != "string" || a.id.length === 0)
|
|
536
553
|
throw new Error("[design-token-panel] PanelConfig.tabs: each tab must have a non-empty string id");
|
|
537
|
-
if (t.has(
|
|
554
|
+
if (t.has(a.id))
|
|
538
555
|
throw new Error(
|
|
539
|
-
`[design-token-panel] PanelConfig.tabs: duplicate tab id "${
|
|
556
|
+
`[design-token-panel] PanelConfig.tabs: duplicate tab id "${a.id}"`
|
|
540
557
|
);
|
|
541
|
-
t.add(
|
|
558
|
+
t.add(a.id), U(a.id, a, e);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
function G(e) {
|
|
562
|
+
if (typeof e == "number" || e === "bg" || e === "fg") return !0;
|
|
563
|
+
if (e === null || typeof e != "object" || Array.isArray(e)) return !1;
|
|
564
|
+
const t = e;
|
|
565
|
+
if ("literal" in t) {
|
|
566
|
+
const n = t.literal;
|
|
567
|
+
if (typeof n == "string") return !0;
|
|
568
|
+
if (n === null || typeof n != "object" || Array.isArray(n)) return !1;
|
|
569
|
+
const a = n;
|
|
570
|
+
return typeof a.light == "string" && typeof a.dark == "string";
|
|
571
|
+
}
|
|
572
|
+
if ("ref" in t) {
|
|
573
|
+
const n = t.ref;
|
|
574
|
+
if (n === null || typeof n != "object" || Array.isArray(n)) return !1;
|
|
575
|
+
const a = n;
|
|
576
|
+
return !(typeof a.tier != "string" || typeof a.item != "string" || a.tab !== void 0 && typeof a.tab != "string");
|
|
542
577
|
}
|
|
578
|
+
return !1;
|
|
543
579
|
}
|
|
544
|
-
function
|
|
580
|
+
function U(e, t, n) {
|
|
545
581
|
if (!Array.isArray(t.tiers))
|
|
546
582
|
throw new Error(
|
|
547
583
|
`[design-token-panel] PanelConfig.tabs["${e}"].tiers must be an array`
|
|
548
584
|
);
|
|
549
|
-
const
|
|
550
|
-
for (const
|
|
551
|
-
if (
|
|
585
|
+
const a = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Map();
|
|
586
|
+
for (const i of t.tiers) {
|
|
587
|
+
if (i === null || typeof i != "object" || Array.isArray(i))
|
|
552
588
|
throw new Error(
|
|
553
589
|
`[design-token-panel] PanelConfig.tabs["${e}"].tiers: each tier must be a non-null object`
|
|
554
590
|
);
|
|
555
|
-
const
|
|
556
|
-
if (typeof
|
|
591
|
+
const s = i;
|
|
592
|
+
if (typeof s.id != "string" || s.id.length === 0)
|
|
557
593
|
throw new Error(
|
|
558
594
|
`[design-token-panel] PanelConfig.tabs["${e}"].tiers: each tier must have a non-empty string id`
|
|
559
595
|
);
|
|
560
|
-
if (
|
|
596
|
+
if (a.has(s.id))
|
|
561
597
|
throw new Error(
|
|
562
|
-
`[design-token-panel] PanelConfig.tabs["${e}"]: duplicate tier id "${
|
|
598
|
+
`[design-token-panel] PanelConfig.tabs["${e}"]: duplicate tier id "${s.id}"`
|
|
563
599
|
);
|
|
564
|
-
if (
|
|
600
|
+
if (a.add(s.id), s.semantic !== void 0 && s.semantic !== !0)
|
|
565
601
|
throw new Error(
|
|
566
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
602
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${s.id}"].semantic must be exactly \`true\` when present (got ${JSON.stringify(s.semantic)})`
|
|
567
603
|
);
|
|
568
|
-
if (!Array.isArray(
|
|
604
|
+
if (!Array.isArray(s.items))
|
|
569
605
|
throw new Error(
|
|
570
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
606
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${s.id}"].items must be an array`
|
|
571
607
|
);
|
|
572
|
-
let
|
|
573
|
-
for (const f of
|
|
608
|
+
let l;
|
|
609
|
+
for (const f of s.items) {
|
|
574
610
|
if (f === null || typeof f != "object" || Array.isArray(f)) continue;
|
|
575
611
|
const o = f.type;
|
|
576
612
|
if (o === null || typeof o != "object" || Array.isArray(o)) continue;
|
|
577
|
-
const
|
|
578
|
-
if (typeof
|
|
579
|
-
if (
|
|
580
|
-
|
|
581
|
-
else if (
|
|
613
|
+
const u = o.kind;
|
|
614
|
+
if (typeof u == "string") {
|
|
615
|
+
if (l === void 0)
|
|
616
|
+
l = u;
|
|
617
|
+
else if (l !== u)
|
|
582
618
|
throw new Error(
|
|
583
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
619
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${s.id}"]: mixed item kinds — found "${l}" and "${u}" in the same tier (all items must share the same kind)`
|
|
584
620
|
);
|
|
585
621
|
}
|
|
586
622
|
}
|
|
587
|
-
|
|
623
|
+
l !== void 0 && g.set(s.id, l);
|
|
588
624
|
}
|
|
589
625
|
const c = /* @__PURE__ */ new Set();
|
|
590
|
-
for (const
|
|
591
|
-
const
|
|
592
|
-
for (const f of
|
|
626
|
+
for (const i of t.tiers) {
|
|
627
|
+
const s = i, l = s.id;
|
|
628
|
+
for (const f of s.items) {
|
|
593
629
|
if (f === null || typeof f != "object" || Array.isArray(f))
|
|
594
630
|
throw new Error(
|
|
595
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
631
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].items: each item must be a non-null object`
|
|
596
632
|
);
|
|
597
633
|
const r = f;
|
|
598
634
|
if (typeof r.id != "string" || r.id.length === 0)
|
|
599
635
|
throw new Error(
|
|
600
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
636
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].items: each item must have a non-empty string id`
|
|
601
637
|
);
|
|
602
638
|
if (c.has(r.id))
|
|
603
639
|
throw new Error(
|
|
@@ -605,61 +641,61 @@ function B(e, t, n) {
|
|
|
605
641
|
);
|
|
606
642
|
if (c.add(r.id), typeof r.cssVar != "string" || !r.cssVar.startsWith("--"))
|
|
607
643
|
throw new Error(
|
|
608
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
644
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].items["${r.id}"].cssVar must start with "--" (got ${JSON.stringify(r.cssVar)})`
|
|
609
645
|
);
|
|
610
646
|
if (r.cssVar.length <= 2)
|
|
611
647
|
throw new Error(
|
|
612
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
648
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].items["${r.id}"].cssVar must be non-empty after "--"`
|
|
613
649
|
);
|
|
614
650
|
}
|
|
615
651
|
}
|
|
616
|
-
for (const
|
|
617
|
-
const
|
|
618
|
-
if (
|
|
619
|
-
if (typeof
|
|
652
|
+
for (const i of t.tiers) {
|
|
653
|
+
const s = i, l = s.id;
|
|
654
|
+
if (s.referencesTier !== void 0) {
|
|
655
|
+
if (typeof s.referencesTier != "string")
|
|
620
656
|
throw new Error(
|
|
621
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
657
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesTier must be a string`
|
|
622
658
|
);
|
|
623
|
-
const f =
|
|
624
|
-
if (!
|
|
659
|
+
const f = s.referencesTier;
|
|
660
|
+
if (!a.has(f))
|
|
625
661
|
throw new Error(
|
|
626
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
662
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesTier: tier "${f}" does not exist in this tab`
|
|
627
663
|
);
|
|
628
|
-
const r = g.get(
|
|
664
|
+
const r = g.get(l), o = g.get(f);
|
|
629
665
|
if (r !== void 0 && o !== void 0 && r !== "text" && r !== o)
|
|
630
666
|
throw new Error(
|
|
631
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
667
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesTier: referencing tier has kind "${r}" but referenced tier "${f}" has kind "${o}" (cross-kind reference is only allowed when the referencing tier has kind "text")`
|
|
632
668
|
);
|
|
633
669
|
}
|
|
634
670
|
}
|
|
635
|
-
for (const
|
|
636
|
-
const
|
|
637
|
-
if (
|
|
638
|
-
if (
|
|
671
|
+
for (const i of t.tiers) {
|
|
672
|
+
const s = i, l = s.id;
|
|
673
|
+
if (s.referencesRamps === void 0) continue;
|
|
674
|
+
if (s.semantic !== !0)
|
|
639
675
|
throw new Error(
|
|
640
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
676
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps is only valid on a tier with semantic: true`
|
|
641
677
|
);
|
|
642
|
-
if (!Array.isArray(
|
|
678
|
+
if (!Array.isArray(s.referencesRamps))
|
|
643
679
|
throw new Error(
|
|
644
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
680
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps must be an array`
|
|
645
681
|
);
|
|
646
|
-
const f = g.get(
|
|
682
|
+
const f = g.get(l), r = s.referencesRamps;
|
|
647
683
|
for (let o = 0; o < r.length; o++) {
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
684
|
+
const u = r[o];
|
|
685
|
+
if (u === null || typeof u != "object" || Array.isArray(u))
|
|
650
686
|
throw new Error(
|
|
651
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
687
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps[${o}] must be a non-null object`
|
|
652
688
|
);
|
|
653
|
-
const
|
|
654
|
-
if (typeof
|
|
689
|
+
const d = u;
|
|
690
|
+
if (typeof d.tier != "string" || d.tier.length === 0)
|
|
655
691
|
throw new Error(
|
|
656
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
692
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps[${o}].tier must be a non-empty string`
|
|
657
693
|
);
|
|
658
|
-
if (
|
|
694
|
+
if (d.tab !== void 0 && (typeof d.tab != "string" || d.tab.length === 0))
|
|
659
695
|
throw new Error(
|
|
660
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
696
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps[${o}].tab must be a non-empty string when set`
|
|
661
697
|
);
|
|
662
|
-
const m =
|
|
698
|
+
const m = d.tab === void 0 ? e : d.tab;
|
|
663
699
|
let k;
|
|
664
700
|
if (m === e)
|
|
665
701
|
k = t;
|
|
@@ -670,30 +706,30 @@ function B(e, t, n) {
|
|
|
670
706
|
if (!b) {
|
|
671
707
|
const p = n.filter((h) => h !== null && typeof h == "object" && !Array.isArray(h)).map((h) => h.id).join(", ");
|
|
672
708
|
throw new Error(
|
|
673
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
709
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps[${o}]: tab "${m}" does not exist. Available tabs: ${p}.`
|
|
674
710
|
);
|
|
675
711
|
}
|
|
676
712
|
k = b;
|
|
677
713
|
}
|
|
678
|
-
const
|
|
679
|
-
let
|
|
680
|
-
for (const b of
|
|
714
|
+
const C = Array.isArray(k.tiers) ? k.tiers : [], j = [];
|
|
715
|
+
let P;
|
|
716
|
+
for (const b of C) {
|
|
681
717
|
if (b === null || typeof b != "object" || Array.isArray(b)) continue;
|
|
682
718
|
const p = b;
|
|
683
|
-
typeof p.id == "string" && (
|
|
719
|
+
typeof p.id == "string" && (j.push(p.id), p.id === d.tier && (P = p));
|
|
684
720
|
}
|
|
685
|
-
if (!
|
|
721
|
+
if (!P)
|
|
686
722
|
throw new Error(
|
|
687
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
723
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps[${o}]: tier "${d.tier}" does not exist in tab "${m}". Available tiers: ${j.join(", ")}.`
|
|
688
724
|
);
|
|
689
725
|
if (f !== void 0) {
|
|
690
|
-
const b = Array.isArray(
|
|
726
|
+
const b = Array.isArray(P.items) ? P.items : [];
|
|
691
727
|
let p;
|
|
692
728
|
for (const h of b) {
|
|
693
729
|
if (h === null || typeof h != "object" || Array.isArray(h)) continue;
|
|
694
|
-
const
|
|
695
|
-
if (
|
|
696
|
-
const T =
|
|
730
|
+
const E = h.type;
|
|
731
|
+
if (E === null || typeof E != "object" || Array.isArray(E)) continue;
|
|
732
|
+
const T = E.kind;
|
|
697
733
|
if (typeof T == "string") {
|
|
698
734
|
p = T;
|
|
699
735
|
break;
|
|
@@ -701,42 +737,42 @@ function B(e, t, n) {
|
|
|
701
737
|
}
|
|
702
738
|
if (p !== void 0 && f !== p)
|
|
703
739
|
throw new Error(
|
|
704
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${
|
|
740
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${l}"].referencesRamps[${o}]: referencing semantic tier has kind "${f}" but target tier "${d.tier}" in tab "${m}" has kind "${p}" (cross-tab ramp sources must share the semantic tier's kind)`
|
|
705
741
|
);
|
|
706
742
|
}
|
|
707
743
|
}
|
|
708
744
|
}
|
|
709
745
|
if (t.colorExtras !== void 0) {
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
746
|
+
const i = t.colorExtras;
|
|
747
|
+
if (i === null || typeof i != "object" || Array.isArray(i))
|
|
712
748
|
throw new Error(
|
|
713
749
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras must be a plain object`
|
|
714
750
|
);
|
|
715
751
|
for (const r of ["id", "defaultShikiTheme"])
|
|
716
|
-
if (typeof
|
|
752
|
+
if (typeof i[r] != "string" || i[r].length === 0)
|
|
717
753
|
throw new Error(
|
|
718
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.${r} must be a non-empty string (got ${typeof
|
|
754
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.${r} must be a non-empty string (got ${typeof i[r]})`
|
|
719
755
|
);
|
|
720
756
|
for (const r of ["colorSchemes", "baseRoles", "baseDefaults"])
|
|
721
|
-
if (
|
|
757
|
+
if (i[r] === void 0 || i[r] === null || typeof i[r] != "object" || Array.isArray(i[r]))
|
|
722
758
|
throw new Error(
|
|
723
759
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.${r} must be a plain object`
|
|
724
760
|
);
|
|
725
|
-
if (
|
|
761
|
+
if (i.panelSettings === void 0 || i.panelSettings === null || typeof i.panelSettings != "object" || Array.isArray(i.panelSettings))
|
|
726
762
|
throw new Error(
|
|
727
763
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.panelSettings must be a plain object`
|
|
728
764
|
);
|
|
729
|
-
const
|
|
730
|
-
if (typeof
|
|
765
|
+
const s = i.panelSettings;
|
|
766
|
+
if (typeof s.colorScheme != "string" || s.colorScheme.length === 0)
|
|
731
767
|
throw new Error(
|
|
732
768
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.panelSettings.colorScheme must be a non-empty string`
|
|
733
769
|
);
|
|
734
|
-
if (
|
|
735
|
-
if (
|
|
770
|
+
if (s.colorMode !== !1) {
|
|
771
|
+
if (s.colorMode === null || typeof s.colorMode != "object" || Array.isArray(s.colorMode))
|
|
736
772
|
throw new Error(
|
|
737
773
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.panelSettings.colorMode must be false or a plain object`
|
|
738
774
|
);
|
|
739
|
-
const r =
|
|
775
|
+
const r = s.colorMode;
|
|
740
776
|
for (const o of ["lightScheme", "darkScheme"])
|
|
741
777
|
if (typeof r[o] != "string" || r[o].length === 0)
|
|
742
778
|
throw new Error(
|
|
@@ -747,39 +783,51 @@ function B(e, t, n) {
|
|
|
747
783
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.panelSettings.colorMode.defaultMode must be "light" or "dark" (got ${JSON.stringify(r.defaultMode)})`
|
|
748
784
|
);
|
|
749
785
|
}
|
|
786
|
+
if (i.semanticDefaults !== void 0) {
|
|
787
|
+
if (i.semanticDefaults === null || typeof i.semanticDefaults != "object" || Array.isArray(i.semanticDefaults))
|
|
788
|
+
throw new Error(
|
|
789
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.semanticDefaults must be a plain object`
|
|
790
|
+
);
|
|
791
|
+
const r = i.semanticDefaults;
|
|
792
|
+
for (const [o, u] of Object.entries(r))
|
|
793
|
+
if (!G(u))
|
|
794
|
+
throw new Error(
|
|
795
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.semanticDefaults["${o}"] must be a valid SemanticValue (number | 'bg' | 'fg' | { literal: string } | { literal: { light, dark } } | { ref: { tier, item, tab? } }), got ${JSON.stringify(u)}`
|
|
796
|
+
);
|
|
797
|
+
}
|
|
750
798
|
const f = t.tiers.find((r) => {
|
|
751
799
|
if (r.referencesTier !== void 0 || r.semantic === !0) return !1;
|
|
752
800
|
const o = r.items;
|
|
753
801
|
if (!Array.isArray(o) || o.length === 0) return !1;
|
|
754
|
-
const
|
|
755
|
-
if (
|
|
756
|
-
const
|
|
757
|
-
return
|
|
802
|
+
const u = o[0];
|
|
803
|
+
if (u === null || typeof u != "object" || Array.isArray(u)) return !1;
|
|
804
|
+
const d = u.type;
|
|
805
|
+
return d === null || typeof d != "object" || Array.isArray(d) ? !1 : d.kind === "color";
|
|
758
806
|
});
|
|
759
807
|
if (f) {
|
|
760
|
-
const r = f.id, o = f.items,
|
|
761
|
-
if (
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
808
|
+
const r = f.id, o = f.items, u = o[0]?.cssVar;
|
|
809
|
+
if (u !== void 0) {
|
|
810
|
+
const d = u.replace(/\d+$/, "{n}");
|
|
811
|
+
if (d.includes("{n}"))
|
|
764
812
|
for (let m = 0; m < o.length; m++) {
|
|
765
|
-
const k = o[m],
|
|
766
|
-
if (k.cssVar !==
|
|
813
|
+
const k = o[m], C = d.replace("{n}", String(m));
|
|
814
|
+
if (k.cssVar !== C)
|
|
767
815
|
throw new Error(
|
|
768
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${r}"].items[${m}].cssVar is ${JSON.stringify(k.cssVar)} but expected ${JSON.stringify(
|
|
816
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${r}"].items[${m}].cssVar is ${JSON.stringify(k.cssVar)} but expected ${JSON.stringify(C)} — palette item cssVars must share one prefix and be numbered 0..n-1 in tier order (template derived from first item: ${JSON.stringify(d)})`
|
|
769
817
|
);
|
|
770
818
|
}
|
|
771
819
|
else if (o.length > 1)
|
|
772
820
|
throw new Error(
|
|
773
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${r}"].items[0].cssVar ${JSON.stringify(
|
|
821
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${r}"].items[0].cssVar ${JSON.stringify(u)} has no trailing digit — palette item cssVars must share one prefix and be numbered 0..n-1 in tier order (e.g. "--pal-0" … "--pal-15")`
|
|
774
822
|
);
|
|
775
823
|
}
|
|
776
824
|
}
|
|
777
825
|
}
|
|
778
826
|
}
|
|
779
|
-
function
|
|
827
|
+
function Ee(e = _()) {
|
|
780
828
|
return e.applyRouting ?? {};
|
|
781
829
|
}
|
|
782
|
-
function
|
|
830
|
+
function ve(e) {
|
|
783
831
|
const t = x();
|
|
784
832
|
if (t === null) {
|
|
785
833
|
y().pendingColorPresets = e;
|
|
@@ -788,37 +836,41 @@ function we(e) {
|
|
|
788
836
|
t.config = { ...t.config, colorPresets: e };
|
|
789
837
|
}
|
|
790
838
|
export {
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
839
|
+
te as A,
|
|
840
|
+
ne as B,
|
|
841
|
+
be as C,
|
|
842
|
+
L as D,
|
|
843
|
+
X as E,
|
|
844
|
+
oe as F,
|
|
845
|
+
pe as G,
|
|
846
|
+
ye as H,
|
|
847
|
+
ie as I,
|
|
848
|
+
se as J,
|
|
849
|
+
re as _,
|
|
850
|
+
me as a,
|
|
851
|
+
le as b,
|
|
852
|
+
Z as c,
|
|
853
|
+
fe as d,
|
|
854
|
+
ce as e,
|
|
855
|
+
Pe as f,
|
|
856
|
+
_ as g,
|
|
857
|
+
ue as h,
|
|
858
|
+
de as i,
|
|
807
859
|
ge as j,
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
860
|
+
he as k,
|
|
861
|
+
S as l,
|
|
862
|
+
D as m,
|
|
863
|
+
Ce as n,
|
|
864
|
+
$e as o,
|
|
865
|
+
W as p,
|
|
866
|
+
Y as q,
|
|
867
|
+
I as r,
|
|
868
|
+
ve as s,
|
|
869
|
+
ae as t,
|
|
870
|
+
Ee as u,
|
|
871
|
+
V as v,
|
|
872
|
+
ke as w,
|
|
821
873
|
Q as x,
|
|
822
|
-
|
|
823
|
-
|
|
874
|
+
ee as y,
|
|
875
|
+
we as z
|
|
824
876
|
};
|