@takazudo/zdtp 0.4.9 → 0.4.10
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 +13 -0
- package/dist/astro/host-adapter.js +73 -60
- package/dist/autoload-state-CEkOpbGS.js +76 -0
- package/dist/{index-t74PT2zd.js → index-C5_Z29Nr.js} +1464 -1451
- package/dist/{index-CGev6ZiI.js → index-mxUJmEeO.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/utils/document-liveness.d.ts +53 -0
- package/package.json +1 -1
- package/dist/autoload-state-CFmRjtD-.js +0 -64
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.10
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- fix: guard deferred DOM access against torn-down documents — async adapter closures, public entry points, and Preact effect-flush paths now cancel quietly instead of throwing `document.getElementById is not a function` as an unhandled rejection when the host environment tears down or swaps the document mid-flight (reported downstream as zudolab/zudo-doc#3344) ([#568](https://github.com/Takazudo/zudo-design-token-panel/pull/568)) (4b5551a)
|
|
8
|
+
- fix: close straggler-state leaks in the document-teardown guards — a cancelled show no longer arms autoload, the open-state persistence effect cannot clobber seeded visibility, and a nulled `document` global is treated as dead ([#568](https://github.com/Takazudo/zudo-design-token-panel/pull/568)) (28b02b1)
|
|
9
|
+
- fix: null-tolerant liveness guards on the lifecycle bind paths ([#568](https://github.com/Takazudo/zudo-design-token-panel/pull/568)) (0774ea8)
|
|
10
|
+
|
|
11
|
+
### Other Changes
|
|
12
|
+
|
|
13
|
+
- docs: migrate the doc site to zudo-doc 4.x — S1–S6 series ([#556](https://github.com/Takazudo/zudo-design-token-panel/pull/556)–[#562](https://github.com/Takazudo/zudo-design-token-panel/pull/562)) (e2f36b5, 51c674c, ff38109, e36e718, e7838fb, c20cc83, f89a6bf)
|
|
14
|
+
- docs(l-make-release): auto-proceed Step 3 gate for routine bumps (45a5aca)
|
|
15
|
+
|
|
3
16
|
## 0.4.9
|
|
4
17
|
|
|
5
18
|
### Features
|
|
@@ -1,115 +1,128 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { g
|
|
3
|
-
import { s as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
import { c as P, g as p, a as m, b as D, d as _, e as A, f as k, i as I } from "../panel-config-BNLlUc_r.js";
|
|
2
|
+
import { g, Z as E } from "../tweak-state-Dti6XMoQ.js";
|
|
3
|
+
import { s as T, l as S, a as C, i as c, b as f, c as V, d as v, e as d } from "../autoload-state-CEkOpbGS.js";
|
|
4
|
+
const u = "tokenpanel-config";
|
|
5
|
+
function K() {
|
|
6
6
|
if (typeof document > "u")
|
|
7
7
|
throw new Error(
|
|
8
8
|
"[design-token-panel] host-adapter loaded without a document; expected to run in a browser context."
|
|
9
9
|
);
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
10
|
+
const n = document.getElementById(u);
|
|
11
|
+
if (!n)
|
|
12
12
|
throw new Error(
|
|
13
|
-
`[design-token-panel] Inline config script #${
|
|
13
|
+
`[design-token-panel] Inline config script #${u} not found. Ensure <DesignTokenPanelHost config={...} /> is rendered on this page before the host script runs.`
|
|
14
14
|
);
|
|
15
|
-
const
|
|
16
|
-
let
|
|
15
|
+
const t = n.textContent ?? "";
|
|
16
|
+
let e;
|
|
17
17
|
try {
|
|
18
|
-
|
|
18
|
+
e = JSON.parse(t);
|
|
19
19
|
} catch (a) {
|
|
20
20
|
throw new Error(
|
|
21
|
-
`[design-token-panel] Failed to parse inline config from #${
|
|
21
|
+
`[design-token-panel] Failed to parse inline config from #${u}: ${a.message}`
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return k(e), e;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function M(n) {
|
|
27
|
+
return n.__zudoDesignTokenPanelAdapter || (n.__zudoDesignTokenPanelAdapter = {}), n.__zudoDesignTokenPanelAdapter;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
let a =
|
|
32
|
-
return a || (a = { bound: !1, modulePromise: null },
|
|
29
|
+
function O(n, t) {
|
|
30
|
+
const e = M(n);
|
|
31
|
+
let a = e[t];
|
|
32
|
+
return a || (a = { bound: !1, modulePromise: null }, e[t] = a), a;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function x(n) {
|
|
35
35
|
try {
|
|
36
|
-
return window.localStorage.getItem(
|
|
36
|
+
return window.localStorage.getItem(n) === "1";
|
|
37
37
|
} catch {
|
|
38
38
|
return !1;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function N(n, t, e) {
|
|
42
42
|
try {
|
|
43
43
|
const a = window.localStorage;
|
|
44
|
-
return a.getItem(
|
|
44
|
+
return a.getItem(e) !== null || a.getItem(t) !== null || a.getItem(n) !== null;
|
|
45
45
|
} catch {
|
|
46
46
|
return !1;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
async function
|
|
50
|
-
return
|
|
49
|
+
async function r(n) {
|
|
50
|
+
return n.modulePromise === null && (n.modulePromise = import("@takazudo/zdtp").then((t) => {
|
|
51
51
|
try {
|
|
52
|
-
const
|
|
53
|
-
|
|
52
|
+
const e = p(), a = t.__panelConfigForTest();
|
|
53
|
+
e !== a && console.warn(
|
|
54
54
|
"[design-token-panel] Singleton-sharing check failed: the host adapter and the panel module observed different PanelConfig singletons. This indicates the package's `config/panel-config` module is no longer code-split into a single shared chunk. The panel may behave correctly today, but storage keys / namespaces / branding could diverge between the two surfaces in future bundles."
|
|
55
55
|
);
|
|
56
|
-
} catch (
|
|
56
|
+
} catch (e) {
|
|
57
57
|
console.warn(
|
|
58
|
-
"[design-token-panel] Singleton-sharing check could not run (likely an older dist without the __panelConfigForTest accessor): " +
|
|
58
|
+
"[design-token-panel] Singleton-sharing check could not run (likely an older dist without the __panelConfigForTest accessor): " + e.message
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
|
-
return
|
|
62
|
-
})),
|
|
61
|
+
return t;
|
|
62
|
+
})), n.modulePromise;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
await
|
|
72
|
-
|
|
64
|
+
function R(n, t, e, a, o) {
|
|
65
|
+
const i = n[t] ?? {};
|
|
66
|
+
i.showDesignPanel = async () => {
|
|
67
|
+
const s = d();
|
|
68
|
+
await r(e), c(s) && (f(o, !0), a.open());
|
|
69
|
+
}, i.hideDesignPanel = async () => {
|
|
70
|
+
const s = d();
|
|
71
|
+
await r(e), c(s) && a.close();
|
|
72
|
+
}, i.toggleDesignPanel = async () => {
|
|
73
|
+
const s = d();
|
|
74
|
+
if (await r(e), !c(s)) return;
|
|
75
|
+
a.toggle();
|
|
76
|
+
let l = !1;
|
|
73
77
|
try {
|
|
74
|
-
|
|
78
|
+
l = window.localStorage.getItem(g(o)) === "1";
|
|
75
79
|
} catch {
|
|
76
80
|
}
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
(await
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
l && f(o, !0);
|
|
82
|
+
}, i.enableAutoload = async () => {
|
|
83
|
+
const s = d(), l = await r(e);
|
|
84
|
+
c(s) && l.enableAutoload(o);
|
|
85
|
+
}, i.disableAutoload = async () => {
|
|
86
|
+
const s = d();
|
|
87
|
+
if (e.modulePromise !== null) {
|
|
88
|
+
const l = await r(e);
|
|
89
|
+
if (!c(s)) return;
|
|
90
|
+
l.disableAutoload(o);
|
|
83
91
|
return;
|
|
84
92
|
}
|
|
85
|
-
|
|
93
|
+
V(o), v(!1, o);
|
|
86
94
|
try {
|
|
87
|
-
window.localStorage.setItem(
|
|
95
|
+
window.localStorage.setItem(m(o), "0");
|
|
88
96
|
} catch {
|
|
89
97
|
}
|
|
90
98
|
try {
|
|
91
|
-
window.localStorage.removeItem(
|
|
99
|
+
window.localStorage.removeItem(g(o));
|
|
92
100
|
} catch {
|
|
93
101
|
}
|
|
94
|
-
},
|
|
102
|
+
}, n[t] = i;
|
|
95
103
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
104
|
+
function F(n, t) {
|
|
105
|
+
I({
|
|
98
106
|
show: async () => {
|
|
99
|
-
|
|
107
|
+
const e = d();
|
|
108
|
+
await r(n), c(e) && t.open();
|
|
100
109
|
},
|
|
101
110
|
hide: async () => {
|
|
102
|
-
|
|
111
|
+
const e = d();
|
|
112
|
+
await r(n), c(e) && t.close();
|
|
103
113
|
},
|
|
104
114
|
toggle: async () => {
|
|
105
|
-
|
|
115
|
+
const e = d();
|
|
116
|
+
await r(n), c(e) && t.toggle();
|
|
106
117
|
}
|
|
107
118
|
});
|
|
108
119
|
}
|
|
109
120
|
(function() {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
121
|
+
const t = K(), e = t.legacyIdRenameMap ? t : { ...t, legacyIdRenameMap: { ...E } }, a = P(e), o = p(), i = window, s = O(i, o.storagePrefix);
|
|
122
|
+
if (R(i, o.consoleNamespace, s, a, o), F(s, a), s.bound) return;
|
|
112
123
|
s.bound = !0;
|
|
113
|
-
const
|
|
114
|
-
(
|
|
124
|
+
const l = m(o), w = D(o), h = _(o), y = A(o);
|
|
125
|
+
(x(l) || N(w, h, y) || T(o) || S(o) || o.domTweaker !== void 0 && C(o)) && r(s).catch((b) => {
|
|
126
|
+
console.error("[design-token-panel] Eager panel-module load failed.", b);
|
|
127
|
+
});
|
|
115
128
|
})();
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { g as t, l as a } from "./panel-config-BNLlUc_r.js";
|
|
2
|
+
function l() {
|
|
3
|
+
return typeof document < "u" && document !== null && typeof document.getElementById == "function";
|
|
4
|
+
}
|
|
5
|
+
function c() {
|
|
6
|
+
return typeof document > "u" || document === null ? null : document;
|
|
7
|
+
}
|
|
8
|
+
function d(e) {
|
|
9
|
+
return e !== null && l() && document === e;
|
|
10
|
+
}
|
|
11
|
+
function o(e = t()) {
|
|
12
|
+
return `${e.storagePrefix}-elpath-enabled`;
|
|
13
|
+
}
|
|
14
|
+
function f(e = t()) {
|
|
15
|
+
try {
|
|
16
|
+
return localStorage.getItem(o(e)) === "1";
|
|
17
|
+
} catch {
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function i(e, n = t()) {
|
|
22
|
+
try {
|
|
23
|
+
localStorage.setItem(o(n), e ? "1" : "0");
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function r(e = t()) {
|
|
28
|
+
return `${e.storagePrefix}-domtweaker-enabled`;
|
|
29
|
+
}
|
|
30
|
+
function s(e = t()) {
|
|
31
|
+
try {
|
|
32
|
+
return localStorage.getItem(r(e)) === "1";
|
|
33
|
+
} catch {
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function m(e, n = t()) {
|
|
38
|
+
try {
|
|
39
|
+
localStorage.setItem(r(n), e ? "1" : "0");
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function g(e) {
|
|
44
|
+
if (typeof window > "u") return !1;
|
|
45
|
+
try {
|
|
46
|
+
return window.localStorage.getItem(a(e)) === "1";
|
|
47
|
+
} catch {
|
|
48
|
+
return !1;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function y(e, n) {
|
|
52
|
+
if (!(typeof window > "u"))
|
|
53
|
+
try {
|
|
54
|
+
window.localStorage.setItem(a(e), n ? "1" : "0");
|
|
55
|
+
} catch {
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function w(e) {
|
|
59
|
+
if (!(typeof window > "u"))
|
|
60
|
+
try {
|
|
61
|
+
window.localStorage.removeItem(a(e));
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
s as a,
|
|
67
|
+
y as b,
|
|
68
|
+
w as c,
|
|
69
|
+
i as d,
|
|
70
|
+
c as e,
|
|
71
|
+
l as f,
|
|
72
|
+
m as g,
|
|
73
|
+
d as i,
|
|
74
|
+
f as l,
|
|
75
|
+
g as s
|
|
76
|
+
};
|