@takazudo/zdtp 0.7.0 → 0.8.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/CHANGELOG.md +36 -0
- package/dist/apply/build-apply-overrides.d.ts +2 -0
- package/dist/astro/host-adapter.js +3 -3
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-CGnis85c.js → autoload-state-CtB0e8mY.js} +1 -1
- package/dist/config/cluster-config.d.ts +10 -2
- package/dist/dashboard/index.d.ts +2 -1
- package/dist/dashboard/index.js +314 -266
- package/dist/dashboard/model.d.ts +3 -1
- package/dist/dashboard/styles.css +107 -32
- package/dist/dashboard/token-dashboard.d.ts +8 -5
- package/dist/dashboard/types.d.ts +19 -3
- package/dist/import-modal.d.ts +21 -22
- package/dist/{index-BcqHRoxf.js → index-BH_IJp9W.js} +2 -2
- package/dist/index-blRjSavc.js +12890 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +39 -32
- package/dist/mode-dependence-Ci9avNt8.js +61 -0
- package/dist/{panel-config-Crn5QJGy.js → panel-config-DKfob-1r.js} +314 -301
- package/dist/state/tweak-state.d.ts +17 -7
- package/dist/tabs/modes-row.d.ts +39 -0
- package/dist/testing.js +2 -2
- package/dist/tokens/mode-dependence.d.ts +23 -0
- package/dist/tokens/tier-model.d.ts +9 -0
- package/dist/{tweak-state-Dhjqig0C.js → tweak-state-BiaKbhXN.js} +729 -671
- package/dist/utils/design-token-serde.d.ts +32 -2
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
- package/dist/index-CUWkR-Gb.js +0 -12322
package/dist/index.d.ts
CHANGED
|
@@ -76,8 +76,10 @@ export type { TierValueKind, PillSpec, TierItem, TierConfig, TabConfig, ColorClu
|
|
|
76
76
|
export { isLengthKind, isNumberKind, isSelectKind, isTextKind, isColorKind, isCursorKind, isContentKind, isMaskImageKind, } from "./tokens/tier-model.js";
|
|
77
77
|
export type { TweakState } from "./state/tweak-state.js";
|
|
78
78
|
export { emptyOverrides } from "./state/tweak-state.js";
|
|
79
|
-
export { SCHEMA_V1, SCHEMA_V2, SCHEMA_V3, } from "./utils/design-token-serde.js";
|
|
79
|
+
export { SCHEMA_V1, SCHEMA_V2, SCHEMA_V3, analyzeDesignTokenJson, deserialize, DesignTokenSchemaError, } from "./utils/design-token-serde.js";
|
|
80
|
+
export type { ImportAnalysis, DeserializeOptions, DeserializeResult } from "./utils/design-token-serde.js";
|
|
80
81
|
export { getClusterDefaultMode, resolvePerModeLiteral, resolveSemanticPreviewColor, } from "./state/tweak-state.js";
|
|
82
|
+
export { splitLightDark, resolveModeSides, isModeDependent } from "./tokens/mode-dependence.js";
|
|
81
83
|
export declare function showDesignTokenPanel(): void;
|
|
82
84
|
export declare function hideDesignTokenPanel(): void;
|
|
83
85
|
export declare function toggleDesignPanel(): void;
|
|
@@ -127,8 +129,8 @@ export declare function __reapplyFromStorageForTests(): void;
|
|
|
127
129
|
* Preact shell still mounts separately when visibility intent requires it via
|
|
128
130
|
* `reapplyFromStorage()`.
|
|
129
131
|
*
|
|
130
|
-
*
|
|
131
|
-
* corrupt state should never block the UI thread (stylesheet defaults paint
|
|
132
|
+
* With no persisted state, applies only explicit manifest mode pairs. Swallows
|
|
133
|
+
* errors — missing storage or corrupt state should never block the UI thread (stylesheet defaults paint
|
|
132
134
|
* instead, same as before this helper existed).
|
|
133
135
|
*/
|
|
134
136
|
export declare function reapplyPersistedOverrides(): void;
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,49 @@
|
|
|
1
1
|
import "preact/jsx-runtime";
|
|
2
2
|
import "preact";
|
|
3
|
-
import {
|
|
4
|
-
import { Z as
|
|
5
|
-
import { b as
|
|
6
|
-
import "./autoload-state-
|
|
3
|
+
import { D as t, S as n, c as l, d, _ as p, e as _, f as g, g as m, h as S, i as P, j as C, k as T, l as A, m as c, n as f, o as u, q as D, r as M, s as E, t as K, v as h, w as k, x as v, y as w, z as x, B as F, C as y, E as L } from "./index-blRjSavc.js";
|
|
4
|
+
import { Z as H, a3 as V, x as z, w as O, a6 as Y } from "./tweak-state-BiaKbhXN.js";
|
|
5
|
+
import { b as G, c as I, s as N } from "./panel-config-DKfob-1r.js";
|
|
6
|
+
import "./autoload-state-CtB0e8mY.js";
|
|
7
|
+
import { i as Z, r as j, s as q } from "./mode-dependence-Ci9avNt8.js";
|
|
7
8
|
import "./constants.js";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
n as
|
|
11
|
-
l as
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
t as DesignTokenSchemaError,
|
|
11
|
+
n as SCHEMA_V1,
|
|
12
|
+
l as SCHEMA_V2,
|
|
13
|
+
d as SCHEMA_V3,
|
|
14
|
+
H as ZDTP_LEGACY_TYPOGRAPHY_RENAME_MAP,
|
|
15
|
+
p as __claimSpawnSlotForTests,
|
|
14
16
|
_ as __mountedSpawnSlotsForTests,
|
|
15
|
-
|
|
17
|
+
g as __panelConfigForTest,
|
|
16
18
|
m as __reapplyFromStorageForTests,
|
|
17
|
-
|
|
19
|
+
S as __resetInstanceBindingsForTests,
|
|
18
20
|
P as __resetSpawnSlotsForTests,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
C as analyzeDesignTokenJson,
|
|
22
|
+
G as assertValidPanelConfig,
|
|
23
|
+
I as configurePanel,
|
|
24
|
+
T as deserialize,
|
|
25
|
+
A as disableAutoload,
|
|
26
|
+
V as emptyOverrides,
|
|
27
|
+
c as enableAutoload,
|
|
28
|
+
z as getClusterDefaultMode,
|
|
29
|
+
f as hideDesignTokenPanel,
|
|
30
|
+
u as isColorKind,
|
|
31
|
+
D as isContentKind,
|
|
32
|
+
M as isCursorKind,
|
|
33
|
+
E as isLengthKind,
|
|
30
34
|
K as isMaskImageKind,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
v as
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
Z as isModeDependent,
|
|
36
|
+
h as isNumberKind,
|
|
37
|
+
k as isSelectKind,
|
|
38
|
+
v as isTextKind,
|
|
39
|
+
w as reapplyPersistedOverrides,
|
|
40
|
+
j as resolveModeSides,
|
|
41
|
+
O as resolvePerModeLiteral,
|
|
42
|
+
Y as resolveSemanticPreviewColor,
|
|
37
43
|
x as setLifecycleAdapter,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
N as setPanelColorPresets,
|
|
45
|
+
F as shouldAutoload,
|
|
46
|
+
y as showDesignTokenPanel,
|
|
47
|
+
q as splitLightDark,
|
|
48
|
+
L as toggleDesignPanel
|
|
42
49
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function g(e) {
|
|
2
|
+
if (typeof e != "string") return null;
|
|
3
|
+
const n = e.trim(), l = /^light-dark\s*\(/i.exec(n);
|
|
4
|
+
if (!l) return null;
|
|
5
|
+
const s = l[0].lastIndexOf("(");
|
|
6
|
+
let i = 1, u = -1, o = -1;
|
|
7
|
+
for (let t = s + 1; t < n.length; t++) {
|
|
8
|
+
const r = n[t];
|
|
9
|
+
if (r === '"' || r === "'") {
|
|
10
|
+
const f = r;
|
|
11
|
+
let a = !1;
|
|
12
|
+
for (t++; t < n.length; t++)
|
|
13
|
+
if (n[t] === "\\")
|
|
14
|
+
t++;
|
|
15
|
+
else if (n[t] === f) {
|
|
16
|
+
a = !0;
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
if (!a) return null;
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (r === "/" && n[t + 1] === "*") {
|
|
23
|
+
const f = n.indexOf("*/", t + 2);
|
|
24
|
+
if (f === -1) return null;
|
|
25
|
+
t = f + 1;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (r === "(") {
|
|
29
|
+
if (/\blight-dark\s*$/i.test(n.slice(s + 1, t))) return null;
|
|
30
|
+
i++;
|
|
31
|
+
} else if (r === ")") {
|
|
32
|
+
if (i--, i < 0) return null;
|
|
33
|
+
if (i === 0) {
|
|
34
|
+
o = t;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
} else if (r === "," && i === 1) {
|
|
38
|
+
if (u !== -1) return null;
|
|
39
|
+
u = t;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (o === -1 || n.slice(o + 1).trim() !== "" || u === -1) return null;
|
|
43
|
+
const c = n.slice(s + 1, u).trim(), d = n.slice(u + 1, o).trim();
|
|
44
|
+
return c.length === 0 || d.length === 0 ? null : { light: c, dark: d };
|
|
45
|
+
}
|
|
46
|
+
function h(e, n) {
|
|
47
|
+
if (e.modes !== void 0) return { ...e.modes };
|
|
48
|
+
if (n !== null && typeof n == "object" && !Array.isArray(n) && "literal" in n) {
|
|
49
|
+
const l = n.literal;
|
|
50
|
+
return typeof l == "string" ? g(l) : { light: l.light, dark: l.dark };
|
|
51
|
+
}
|
|
52
|
+
return g(e.default);
|
|
53
|
+
}
|
|
54
|
+
function p(e, n) {
|
|
55
|
+
return h(e, n) !== null;
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
p as i,
|
|
59
|
+
h as r,
|
|
60
|
+
g as s
|
|
61
|
+
};
|