@takazudo/zdtp 0.5.0 → 0.5.2
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 +71 -0
- package/PORTABLE-CONTRACT.md +101 -18
- package/README.md +7 -5
- package/dist/astro/host-adapter.js +46 -50
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-DmTY6tRy.js → autoload-state-BI4-9A58.js} +1 -1
- package/dist/config/panel-config.d.ts +7 -0
- package/dist/constants.d.ts +24 -4
- package/dist/constants.js +20 -11
- package/dist/controls/actions-menu-popover.d.ts +5 -1
- package/dist/controls/role-button.d.ts +4 -1
- package/dist/dom-tweaker/dom-tweaker-toggle-button.d.ts +3 -1
- package/dist/element-inspect/element-inspect-toggle-button.d.ts +3 -1
- package/dist/element-path/element-path-toggle-button.d.ts +3 -1
- package/dist/{index-By6zFdp4.js → index-CAQf4HKm.js} +2 -2
- package/dist/{index-CHzTi0y5.js → index-ChsJ5u4d.js} +2130 -2063
- package/dist/index.d.ts +2 -0
- package/dist/index.js +28 -27
- package/dist/{panel-config-BSu6TUht.js → panel-config-CqbuB0nh.js} +145 -141
- package/dist/tabs/_generic-item-editor.d.ts +2 -2
- package/dist/tabs/flat/token-row.d.ts +3 -1
- package/dist/testing.js +2 -2
- package/dist/{tweak-state-B7ok3Ob3.js → tweak-state-c53KtLHq.js} +1 -1
- package/dist/zdtp.css +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ import { type PanelConfig } from './config/panel-config';
|
|
|
43
43
|
* documented public API.
|
|
44
44
|
*/
|
|
45
45
|
export declare function __mountedSpawnSlotsForTests(): ReadonlyMap<string, number>;
|
|
46
|
+
/** Test-only entry point for focused persistence/allocation contract tests. */
|
|
47
|
+
export declare function __claimSpawnSlotForTests(cfg: PanelConfig): number;
|
|
46
48
|
/**
|
|
47
49
|
* Test-only: drop every registered slot. Unlike the bindings reset this has
|
|
48
50
|
* no listeners to drain — the registry holds plain numbers — so clearing the
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import "preact/jsx-runtime";
|
|
2
2
|
import "preact";
|
|
3
|
-
import { S as i, c as n, d as l, _ as d, e as _, f as p, g as m, h as g, i as P, j as
|
|
4
|
-
import { Z as
|
|
5
|
-
import { c as
|
|
6
|
-
import "./autoload-state-
|
|
3
|
+
import { S as i, c as n, d as l, _ as d, e as _, f as p, g as m, h as g, i as P, j as S, k as A, l as C, m as T, n as u, o as c, q as f, r as K, s as M, t as w, v as F, w as v, x, y as E, z as h, B as y } from "./index-ChsJ5u4d.js";
|
|
4
|
+
import { Z as k, a2 as H, x as L, w as b, a5 as O } from "./tweak-state-c53KtLHq.js";
|
|
5
|
+
import { c as Y, s as B } from "./panel-config-CqbuB0nh.js";
|
|
6
|
+
import "./autoload-state-BI4-9A58.js";
|
|
7
7
|
import "./constants.js";
|
|
8
8
|
export {
|
|
9
9
|
i as SCHEMA_V1,
|
|
10
10
|
n as SCHEMA_V2,
|
|
11
11
|
l as SCHEMA_V3,
|
|
12
|
-
|
|
13
|
-
d as
|
|
14
|
-
_ as
|
|
15
|
-
p as
|
|
16
|
-
m as
|
|
17
|
-
g as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
k as ZDTP_LEGACY_TYPOGRAPHY_RENAME_MAP,
|
|
13
|
+
d as __claimSpawnSlotForTests,
|
|
14
|
+
_ as __mountedSpawnSlotsForTests,
|
|
15
|
+
p as __panelConfigForTest,
|
|
16
|
+
m as __reapplyFromStorageForTests,
|
|
17
|
+
g as __resetInstanceBindingsForTests,
|
|
18
|
+
P as __resetSpawnSlotsForTests,
|
|
19
|
+
Y as configurePanel,
|
|
20
|
+
S as disableAutoload,
|
|
21
|
+
H as emptyOverrides,
|
|
21
22
|
A as enableAutoload,
|
|
22
|
-
|
|
23
|
+
L as getClusterDefaultMode,
|
|
23
24
|
C as hideDesignTokenPanel,
|
|
24
|
-
|
|
25
|
+
T as isColorKind,
|
|
25
26
|
u as isContentKind,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
c as isCursorKind,
|
|
28
|
+
f as isLengthKind,
|
|
29
|
+
K as isMaskImageKind,
|
|
30
|
+
M as isNumberKind,
|
|
31
|
+
w as isSelectKind,
|
|
32
|
+
F as isTextKind,
|
|
33
|
+
v as reapplyPersistedOverrides,
|
|
34
|
+
b as resolvePerModeLiteral,
|
|
35
|
+
O as resolveSemanticPreviewColor,
|
|
35
36
|
x as setLifecycleAdapter,
|
|
36
|
-
|
|
37
|
+
B as setPanelColorPresets,
|
|
37
38
|
E as shouldAutoload,
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
h as showDesignTokenPanel,
|
|
40
|
+
y as toggleDesignPanel
|
|
40
41
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { DEFAULT_STORAGE_PREFIX as
|
|
1
|
+
import { DEFAULT_STORAGE_PREFIX as N, resolveToggleEventName as M, READABLE_STATE_KEY_SUFFIXES as v } from "./constants.js";
|
|
2
2
|
class k extends Error {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
super(t), this.name = "TierResolverError", Object.setPrototypeOf(this, k.prototype);
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function S(e, t) {
|
|
8
8
|
return e.tiers.find((n) => n.id === t);
|
|
9
9
|
}
|
|
10
10
|
function $(e, t) {
|
|
11
11
|
return e.items.find((n) => n.id === t);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const u =
|
|
13
|
+
function te(e, t, n, i) {
|
|
14
|
+
const u = S(e, t);
|
|
15
15
|
if (!u)
|
|
16
16
|
throw new k(
|
|
17
17
|
`Tier "${t}" not found in tab "${e.id}". Available tiers: ${e.tiers.map((f) => f.id).join(", ")}.`
|
|
@@ -23,7 +23,7 @@ function ee(e, t, n, i) {
|
|
|
23
23
|
);
|
|
24
24
|
const r = i[t]?.[n];
|
|
25
25
|
if (u.referencesTier !== void 0) {
|
|
26
|
-
const f = u.referencesTier, l =
|
|
26
|
+
const f = u.referencesTier, l = S(e, f);
|
|
27
27
|
if (!l)
|
|
28
28
|
throw new k(
|
|
29
29
|
`Tier "${t}" declares referencesTier "${f}" but that tier does not exist in tab "${e.id}".`
|
|
@@ -41,16 +41,16 @@ function ee(e, t, n, i) {
|
|
|
41
41
|
}
|
|
42
42
|
return r !== void 0 ? d.pill && r === d.pill.value ? { kind: "literal", value: d.pill.value } : { kind: "literal", value: r } : d.pill ? { kind: "literal", value: d.pill.customDefault } : { kind: "literal", value: d.default };
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ne(e) {
|
|
45
45
|
return e.kind === "literal" ? e.value : `var(${e.targetCssVar})`;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function D(e, t, n = [t]) {
|
|
48
48
|
const i = e.tab === void 0 || e.tab === t.id ? t : n.find((s) => s.id === e.tab);
|
|
49
49
|
if (!i)
|
|
50
50
|
throw new k(
|
|
51
51
|
`Cross-tab ref target tab "${e.tab}" not found. Available tabs: ${n.map((s) => s.id).join(", ")}.`
|
|
52
52
|
);
|
|
53
|
-
const u =
|
|
53
|
+
const u = S(i, e.tier);
|
|
54
54
|
if (!u)
|
|
55
55
|
throw new k(
|
|
56
56
|
`Cross-tab ref target tier "${e.tier}" not found in tab "${i.id}". Available tiers: ${i.tiers.map((s) => s.id).join(", ")}.`
|
|
@@ -62,10 +62,10 @@ function M(e, t, n = [t]) {
|
|
|
62
62
|
);
|
|
63
63
|
return d.cssVar;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function re(e, t) {
|
|
66
66
|
return e.paletteCssVarTemplate.replace("{n}", String(t));
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const H = /* @__PURE__ */ new Set([
|
|
69
69
|
"aliceblue",
|
|
70
70
|
"antiquewhite",
|
|
71
71
|
"aqua",
|
|
@@ -222,10 +222,10 @@ const D = /* @__PURE__ */ new Set([
|
|
|
222
222
|
"revert",
|
|
223
223
|
"revert-layer"
|
|
224
224
|
]);
|
|
225
|
-
function
|
|
226
|
-
return e.startsWith("#") || e.includes("(") ||
|
|
225
|
+
function B(e) {
|
|
226
|
+
return e.startsWith("#") || e.includes("(") || H.has(e.toLowerCase());
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function L(e, t, n, i) {
|
|
229
229
|
const u = [], d = e.indexOf(":");
|
|
230
230
|
if (d !== -1) {
|
|
231
231
|
const r = e.slice(0, d), f = e.slice(d + 1), l = t.find((o) => o.tier === r);
|
|
@@ -235,18 +235,18 @@ function B(e, t, n, i) {
|
|
|
235
235
|
u.push({ tab: s.tab, tier: s.tier, item: e });
|
|
236
236
|
for (const r of u)
|
|
237
237
|
try {
|
|
238
|
-
return
|
|
238
|
+
return D(r, n, i), { ref: r };
|
|
239
239
|
} catch {
|
|
240
240
|
}
|
|
241
241
|
return { ref: u[0] };
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function F(e, t, n, i, u, d) {
|
|
244
244
|
const s = t.get(e.default);
|
|
245
|
-
return s !== void 0 ? s : e.default === "bg" || e.default === "fg" ? e.default : n && n.length > 0 && !
|
|
245
|
+
return s !== void 0 ? s : e.default === "bg" || e.default === "fg" ? e.default : n && n.length > 0 && !B(e.default) ? L(e.default, n, i, u) : d ? (console.warn(
|
|
246
246
|
`[design-token-panel] semantic item "${e.id}" default "${e.default}" names no palette item; falling back to palette index 0`
|
|
247
247
|
), 0) : { literal: e.default };
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function _(e, t = [e]) {
|
|
250
250
|
const n = e.colorExtras;
|
|
251
251
|
if (!n) return;
|
|
252
252
|
const i = e.tiers.find(
|
|
@@ -275,7 +275,7 @@ function V(e, t = [e]) {
|
|
|
275
275
|
if (u) {
|
|
276
276
|
const a = !u.semantic, g = n.semanticDefaults;
|
|
277
277
|
for (const c of u.items)
|
|
278
|
-
o[c.id] = c.cssVar, l[c.id] = g && c.id in g ? g[c.id] :
|
|
278
|
+
o[c.id] = c.cssVar, l[c.id] = g && c.id in g ? g[c.id] : F(
|
|
279
279
|
c,
|
|
280
280
|
f,
|
|
281
281
|
u.referencesRamps,
|
|
@@ -298,22 +298,22 @@ function V(e, t = [e]) {
|
|
|
298
298
|
panelSettings: n.panelSettings
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function oe(e) {
|
|
302
302
|
const t = e.find((n) => n.id === "color");
|
|
303
303
|
if (t)
|
|
304
|
-
return
|
|
304
|
+
return _(t, e);
|
|
305
305
|
}
|
|
306
306
|
function J(e) {
|
|
307
307
|
const t = e.find((n) => n.id === "color-secondary");
|
|
308
|
-
return t ?
|
|
308
|
+
return t ? _(t, e) ?? null : null;
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function x(e, t) {
|
|
311
311
|
if (Object.is(e, t)) return !0;
|
|
312
312
|
if (e === null || t === null || typeof e != typeof t || typeof e != "object") return !1;
|
|
313
313
|
if (Array.isArray(e)) {
|
|
314
314
|
if (!Array.isArray(t) || e.length !== t.length) return !1;
|
|
315
315
|
for (let d = 0; d < e.length; d++)
|
|
316
|
-
if (!
|
|
316
|
+
if (!x(e[d], t[d])) return !1;
|
|
317
317
|
return !0;
|
|
318
318
|
}
|
|
319
319
|
if (Array.isArray(t)) return !1;
|
|
@@ -321,12 +321,12 @@ function S(e, t) {
|
|
|
321
321
|
if (n.length !== i.length) return !1;
|
|
322
322
|
const u = new Set(i);
|
|
323
323
|
for (const d of n)
|
|
324
|
-
if (!u.has(d) || !
|
|
324
|
+
if (!u.has(d) || !x(e[d], t[d]))
|
|
325
325
|
return !1;
|
|
326
326
|
return !0;
|
|
327
327
|
}
|
|
328
328
|
const q = {
|
|
329
|
-
storagePrefix:
|
|
329
|
+
storagePrefix: N,
|
|
330
330
|
consoleNamespace: "zudo",
|
|
331
331
|
modalClassPrefix: "zudo-design-token-panel-modal",
|
|
332
332
|
schemaId: "zudo-design-tokens/v1",
|
|
@@ -337,10 +337,10 @@ const q = {
|
|
|
337
337
|
// No bundled apply endpoint / routing — hosts wire their own.
|
|
338
338
|
applyEndpoint: void 0,
|
|
339
339
|
applyRouting: void 0
|
|
340
|
-
},
|
|
340
|
+
}, V = /* @__PURE__ */ Symbol.for("@takazudo/zdtp:singleton");
|
|
341
341
|
function m() {
|
|
342
342
|
const e = globalThis;
|
|
343
|
-
let t = e[
|
|
343
|
+
let t = e[V];
|
|
344
344
|
return t || (t = {
|
|
345
345
|
instances: /* @__PURE__ */ new Map(),
|
|
346
346
|
defaultPrefix: null,
|
|
@@ -348,9 +348,9 @@ function m() {
|
|
|
348
348
|
pendingPostConfigureHooks: [],
|
|
349
349
|
lifecycleHooks: {},
|
|
350
350
|
colorSchemeOwners: /* @__PURE__ */ new Set()
|
|
351
|
-
}, e[
|
|
351
|
+
}, e[V] = t), t;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function G(e) {
|
|
354
354
|
return {
|
|
355
355
|
instanceId: e,
|
|
356
356
|
open() {
|
|
@@ -372,7 +372,7 @@ function F(e) {
|
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function ie(e) {
|
|
376
376
|
m().lifecycleHooks = {
|
|
377
377
|
configured: e.configured,
|
|
378
378
|
open: e.open,
|
|
@@ -381,11 +381,11 @@ function oe(e) {
|
|
|
381
381
|
destroy: e.destroy
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function se(e) {
|
|
385
385
|
const t = m(), n = e.storagePrefix, i = t.instances.get(n);
|
|
386
386
|
if (i) {
|
|
387
387
|
const l = (o) => ({ ...o, applySink: void 0 });
|
|
388
|
-
if (
|
|
388
|
+
if (x(l(i.suppliedConfig), l(e)))
|
|
389
389
|
return t.defaultPrefix = n, i.handle;
|
|
390
390
|
throw new Error(
|
|
391
391
|
`[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.)`
|
|
@@ -403,19 +403,19 @@ function ie(e) {
|
|
|
403
403
|
suppliedConfig: { ...e },
|
|
404
404
|
pendingColorPresets: null,
|
|
405
405
|
postConfigureHooks: r,
|
|
406
|
-
handle:
|
|
406
|
+
handle: G(n)
|
|
407
407
|
};
|
|
408
408
|
t.instances.set(n, f), t.defaultPrefix = n;
|
|
409
409
|
for (const l of f.postConfigureHooks)
|
|
410
410
|
l();
|
|
411
411
|
return t.lifecycleHooks.configured?.(n), f.handle;
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function j() {
|
|
414
414
|
const e = m();
|
|
415
415
|
return e.defaultPrefix === null ? null : e.instances.get(e.defaultPrefix) ?? null;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
const t =
|
|
417
|
+
function ae(e) {
|
|
418
|
+
const t = j();
|
|
419
419
|
if (t === null) {
|
|
420
420
|
const n = m();
|
|
421
421
|
if (n.pendingPostConfigureHooks.includes(e)) return;
|
|
@@ -424,109 +424,112 @@ function se(e) {
|
|
|
424
424
|
}
|
|
425
425
|
t.postConfigureHooks.includes(e) || (t.postConfigureHooks.push(e), e());
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
return
|
|
427
|
+
function T() {
|
|
428
|
+
return j()?.config ?? q;
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function le() {
|
|
431
431
|
return [...m().instances.values()].map((e) => e.config);
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function fe(e) {
|
|
434
434
|
return m().instances.get(e)?.config ?? null;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function ce() {
|
|
437
437
|
const e = m();
|
|
438
|
-
e.instances.clear(), e.defaultPrefix = null, e.pendingColorPresets = null, e.pendingPostConfigureHooks.length = 0,
|
|
438
|
+
e.instances.clear(), e.defaultPrefix = null, e.pendingColorPresets = null, e.pendingPostConfigureHooks.length = 0, A().clear();
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function A() {
|
|
441
441
|
const e = m();
|
|
442
442
|
return e.colorSchemeOwners || (e.colorSchemeOwners = /* @__PURE__ */ new Set()), e.colorSchemeOwners;
|
|
443
443
|
}
|
|
444
|
-
function ce(e) {
|
|
445
|
-
E().add(e);
|
|
446
|
-
}
|
|
447
444
|
function ge(e) {
|
|
448
|
-
|
|
445
|
+
A().add(e);
|
|
449
446
|
}
|
|
450
447
|
function de(e) {
|
|
451
|
-
|
|
448
|
+
A().delete(e);
|
|
452
449
|
}
|
|
453
|
-
function ue(e
|
|
454
|
-
return
|
|
450
|
+
function ue(e) {
|
|
451
|
+
return A().has(e);
|
|
455
452
|
}
|
|
456
|
-
function pe(e) {
|
|
457
|
-
return
|
|
453
|
+
function pe(e = T()) {
|
|
454
|
+
return J(e.tabs);
|
|
458
455
|
}
|
|
459
456
|
function ye(e) {
|
|
460
|
-
return
|
|
457
|
+
return e.storagePrefix + v.v2;
|
|
461
458
|
}
|
|
462
459
|
function me(e) {
|
|
463
|
-
return
|
|
460
|
+
return e.storagePrefix + v.v3;
|
|
464
461
|
}
|
|
465
462
|
function he(e) {
|
|
466
|
-
return
|
|
463
|
+
return e.storagePrefix + v.v4;
|
|
467
464
|
}
|
|
468
465
|
function we(e) {
|
|
469
|
-
return
|
|
466
|
+
return e.storagePrefix + v.v1;
|
|
470
467
|
}
|
|
471
468
|
function be(e) {
|
|
472
|
-
return `${e.storagePrefix}-
|
|
469
|
+
return `${e.storagePrefix}-spawn-ordinal`;
|
|
473
470
|
}
|
|
474
471
|
function ke(e) {
|
|
475
|
-
return `${e.storagePrefix}-
|
|
472
|
+
return `${e.storagePrefix}-open`;
|
|
476
473
|
}
|
|
477
474
|
function $e(e) {
|
|
478
|
-
return `${e.storagePrefix}-
|
|
475
|
+
return `${e.storagePrefix}-position`;
|
|
479
476
|
}
|
|
480
477
|
function Ce(e) {
|
|
481
|
-
return `${e.storagePrefix}-
|
|
478
|
+
return `${e.storagePrefix}-size`;
|
|
482
479
|
}
|
|
483
480
|
function Pe(e) {
|
|
484
|
-
return `${e.storagePrefix}-
|
|
481
|
+
return `${e.storagePrefix}-dock`;
|
|
482
|
+
}
|
|
483
|
+
function Ee(e) {
|
|
484
|
+
return `${e.storagePrefix}-dock-size`;
|
|
485
485
|
}
|
|
486
486
|
function ve(e) {
|
|
487
|
+
return `${e.storagePrefix}-density`;
|
|
488
|
+
}
|
|
489
|
+
function Ae(e) {
|
|
487
490
|
return `${e.storagePrefix}-specimen`;
|
|
488
491
|
}
|
|
489
|
-
function
|
|
492
|
+
function Se(e, t) {
|
|
490
493
|
return `${e.storagePrefix}-snapshot-${t}`;
|
|
491
494
|
}
|
|
492
|
-
function
|
|
495
|
+
function xe(e) {
|
|
493
496
|
return `${e.storagePrefix}-last-applied`;
|
|
494
497
|
}
|
|
495
|
-
function
|
|
498
|
+
function je(e) {
|
|
496
499
|
return `${e.storagePrefix}:visible`;
|
|
497
500
|
}
|
|
498
|
-
function
|
|
501
|
+
function Te(e) {
|
|
499
502
|
return `${e.storagePrefix}:autoload`;
|
|
500
503
|
}
|
|
501
|
-
function
|
|
504
|
+
function Oe(e) {
|
|
502
505
|
return `${e.storagePrefix}-root`;
|
|
503
506
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
507
|
+
function Re(e) {
|
|
508
|
+
return M(e);
|
|
506
509
|
}
|
|
507
|
-
const
|
|
508
|
-
function
|
|
509
|
-
return `${
|
|
510
|
+
const U = "__zdtp:open-state-changed";
|
|
511
|
+
function Ve(e) {
|
|
512
|
+
return `${U}:${e.storagePrefix}`;
|
|
510
513
|
}
|
|
511
|
-
function
|
|
514
|
+
function _e(e, t) {
|
|
512
515
|
return `${e.modalClassPrefix}${t}`;
|
|
513
516
|
}
|
|
514
|
-
function
|
|
517
|
+
function Ke(e) {
|
|
515
518
|
return `${e.exportFilenameBase}.json`;
|
|
516
519
|
}
|
|
517
|
-
const
|
|
520
|
+
const K = /* @__PURE__ */ Symbol.for("@takazudo/zdtp:global-alias-marker");
|
|
518
521
|
function z(e) {
|
|
519
522
|
return typeof e == "object" && e !== null || typeof e == "function";
|
|
520
523
|
}
|
|
521
|
-
function
|
|
524
|
+
function W(e) {
|
|
522
525
|
if (!z(e)) return !1;
|
|
523
526
|
try {
|
|
524
|
-
return e[
|
|
527
|
+
return e[K] === !0;
|
|
525
528
|
} catch {
|
|
526
529
|
return !1;
|
|
527
530
|
}
|
|
528
531
|
}
|
|
529
|
-
function
|
|
532
|
+
function Y(e) {
|
|
530
533
|
if (!z(e)) return !1;
|
|
531
534
|
try {
|
|
532
535
|
const t = e;
|
|
@@ -535,11 +538,11 @@ function W(e) {
|
|
|
535
538
|
return !1;
|
|
536
539
|
}
|
|
537
540
|
}
|
|
538
|
-
function
|
|
541
|
+
function ze(e) {
|
|
539
542
|
if (typeof window > "u") return;
|
|
540
543
|
const t = window, n = t.zdtp;
|
|
541
544
|
if (n !== void 0) {
|
|
542
|
-
if (
|
|
545
|
+
if (W(n) || Y(n))
|
|
543
546
|
return;
|
|
544
547
|
console.warn(
|
|
545
548
|
"[design-token-panel] window.zdtp already exists and was not installed by this package. Skipping the zdtp.show() / zdtp.hide() / zdtp.toggle() global alias to avoid clobbering it. Use window[consoleNamespace].* or the configurePanel(cfg) handle instead."
|
|
@@ -547,9 +550,9 @@ function _e(e) {
|
|
|
547
550
|
return;
|
|
548
551
|
}
|
|
549
552
|
const i = { ...e };
|
|
550
|
-
i[
|
|
553
|
+
i[K] = !0, t.zdtp = i;
|
|
551
554
|
}
|
|
552
|
-
function
|
|
555
|
+
function Ne(e) {
|
|
553
556
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
554
557
|
throw new Error("[design-token-panel] PanelConfig must be a non-null object");
|
|
555
558
|
const t = e;
|
|
@@ -641,10 +644,10 @@ function Z(e) {
|
|
|
641
644
|
throw new Error(
|
|
642
645
|
`[design-token-panel] PanelConfig.tabs: duplicate tab id "${i.id}"`
|
|
643
646
|
);
|
|
644
|
-
t.add(i.id),
|
|
647
|
+
t.add(i.id), Q(i.id, i, e);
|
|
645
648
|
}
|
|
646
649
|
}
|
|
647
|
-
function
|
|
650
|
+
function X(e) {
|
|
648
651
|
if (typeof e == "number" || e === "bg" || e === "fg") return !0;
|
|
649
652
|
if (e === null || typeof e != "object" || Array.isArray(e)) return !1;
|
|
650
653
|
const t = e;
|
|
@@ -663,7 +666,7 @@ function Y(e) {
|
|
|
663
666
|
}
|
|
664
667
|
return !1;
|
|
665
668
|
}
|
|
666
|
-
function
|
|
669
|
+
function Q(e, t, n) {
|
|
667
670
|
if (!Array.isArray(t.tiers))
|
|
668
671
|
throw new Error(
|
|
669
672
|
`[design-token-panel] PanelConfig.tabs["${e}"].tiers must be an array`
|
|
@@ -860,27 +863,27 @@ function X(e, t, n) {
|
|
|
860
863
|
}
|
|
861
864
|
h = b;
|
|
862
865
|
}
|
|
863
|
-
const C = Array.isArray(h.tiers) ? h.tiers : [],
|
|
866
|
+
const C = Array.isArray(h.tiers) ? h.tiers : [], O = [];
|
|
864
867
|
let P;
|
|
865
868
|
for (const b of C) {
|
|
866
869
|
if (b === null || typeof b != "object" || Array.isArray(b)) continue;
|
|
867
870
|
const y = b;
|
|
868
|
-
typeof y.id == "string" && (
|
|
871
|
+
typeof y.id == "string" && (O.push(y.id), y.id === c.tier && (P = y));
|
|
869
872
|
}
|
|
870
873
|
if (!P)
|
|
871
874
|
throw new Error(
|
|
872
|
-
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${f}"].referencesRamps[${a}]: tier "${c.tier}" does not exist in tab "${p}". Available tiers: ${
|
|
875
|
+
`[design-token-panel] PanelConfig.tabs["${e}"].tiers["${f}"].referencesRamps[${a}]: tier "${c.tier}" does not exist in tab "${p}". Available tiers: ${O.join(", ")}.`
|
|
873
876
|
);
|
|
874
877
|
if (l !== void 0) {
|
|
875
878
|
const b = Array.isArray(P.items) ? P.items : [];
|
|
876
879
|
let y;
|
|
877
880
|
for (const w of b) {
|
|
878
881
|
if (w === null || typeof w != "object" || Array.isArray(w)) continue;
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
const
|
|
882
|
-
if (typeof
|
|
883
|
-
y =
|
|
882
|
+
const E = w.type;
|
|
883
|
+
if (E === null || typeof E != "object" || Array.isArray(E)) continue;
|
|
884
|
+
const R = E.kind;
|
|
885
|
+
if (typeof R == "string") {
|
|
886
|
+
y = R;
|
|
884
887
|
break;
|
|
885
888
|
}
|
|
886
889
|
}
|
|
@@ -939,7 +942,7 @@ function X(e, t, n) {
|
|
|
939
942
|
);
|
|
940
943
|
const o = s.semanticDefaults;
|
|
941
944
|
for (const [a, g] of Object.entries(o))
|
|
942
|
-
if (!
|
|
945
|
+
if (!X(g))
|
|
943
946
|
throw new Error(
|
|
944
947
|
`[design-token-panel] PanelConfig.tabs["${e}"].colorExtras.semanticDefaults["${a}"] must be a valid SemanticValue (number | 'bg' | 'fg' | { literal: string } | { literal: { light, dark } } | { ref: { tier, item, tab? } }), got ${JSON.stringify(g)}`
|
|
945
948
|
);
|
|
@@ -996,14 +999,14 @@ function X(e, t, n) {
|
|
|
996
999
|
`[design-token-panel] PanelConfig.tabs["${e}"].notesExtras must only be set on a tab with id "notes"`
|
|
997
1000
|
);
|
|
998
1001
|
}
|
|
999
|
-
function
|
|
1002
|
+
function I(e = T()) {
|
|
1000
1003
|
return e.applyRouting ?? {};
|
|
1001
1004
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return !!e.applyEndpoint && Object.keys(
|
|
1005
|
+
function Me(e = T()) {
|
|
1006
|
+
return !!e.applyEndpoint && Object.keys(I(e)).length > 0;
|
|
1004
1007
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const t =
|
|
1008
|
+
function De(e) {
|
|
1009
|
+
const t = j();
|
|
1007
1010
|
if (t === null) {
|
|
1008
1011
|
m().pendingColorPresets = e;
|
|
1009
1012
|
return;
|
|
@@ -1011,47 +1014,48 @@ function Ne(e) {
|
|
|
1011
1014
|
t.config = { ...t.config, colorPresets: e };
|
|
1012
1015
|
}
|
|
1013
1016
|
export {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
te as
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1017
|
+
D as A,
|
|
1018
|
+
_ as B,
|
|
1019
|
+
x as C,
|
|
1020
|
+
Ke as D,
|
|
1021
|
+
I as E,
|
|
1022
|
+
Me as F,
|
|
1023
|
+
xe as G,
|
|
1024
|
+
Se as H,
|
|
1025
|
+
Ae as I,
|
|
1026
|
+
Ve as J,
|
|
1027
|
+
ie as K,
|
|
1028
|
+
ae as L,
|
|
1029
|
+
Re as M,
|
|
1030
|
+
le as N,
|
|
1031
|
+
fe as O,
|
|
1032
|
+
Oe as P,
|
|
1033
|
+
be as Q,
|
|
1034
|
+
ce as _,
|
|
1035
|
+
je as a,
|
|
1036
|
+
Ne as b,
|
|
1037
|
+
se as c,
|
|
1038
|
+
ke as d,
|
|
1039
|
+
$e as e,
|
|
1040
|
+
we as f,
|
|
1041
|
+
T as g,
|
|
1042
|
+
ye as h,
|
|
1043
|
+
ze as i,
|
|
1044
|
+
Te as j,
|
|
1045
|
+
he as k,
|
|
1046
|
+
me as l,
|
|
1047
|
+
_e as m,
|
|
1048
|
+
de as n,
|
|
1049
|
+
pe as o,
|
|
1050
|
+
te as p,
|
|
1051
|
+
ne as q,
|
|
1052
|
+
oe as r,
|
|
1053
|
+
De as s,
|
|
1054
|
+
Ce as t,
|
|
1055
|
+
ve as u,
|
|
1056
|
+
Ee as v,
|
|
1057
|
+
Pe as w,
|
|
1058
|
+
re as x,
|
|
1059
|
+
ge as y,
|
|
1060
|
+
ue as z
|
|
1057
1061
|
};
|
|
@@ -18,6 +18,6 @@ export interface GenericItemEditorProps {
|
|
|
18
18
|
/** Called with (itemId, newValue). */
|
|
19
19
|
onChange: (itemId: string, next: string) => void;
|
|
20
20
|
}
|
|
21
|
-
declare function
|
|
22
|
-
declare const _default: typeof
|
|
21
|
+
declare function GenericItemEditor(props: GenericItemEditorProps): import("preact").JSX.Element;
|
|
22
|
+
declare const _default: typeof GenericItemEditor;
|
|
23
23
|
export default _default;
|
|
@@ -7,6 +7,8 @@ export interface TokenRowProps {
|
|
|
7
7
|
onChange: (address: TokenAddress, next: string) => void;
|
|
8
8
|
onDelete: (address: TokenAddress) => void;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/** The grid allocates this box; the row inside may query it without
|
|
11
|
+
* containing an intrinsically sized editor or nesting pill containers. */
|
|
12
|
+
declare function TokenRow(props: TokenRowProps): import("preact").JSX.Element;
|
|
11
13
|
declare const _default: typeof TokenRow;
|
|
12
14
|
export default _default;
|