@takazudo/zdtp 0.4.6 → 0.4.7

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.7
4
+
5
+ ### Fixed
6
+
7
+ - fix(server): coalesce same-file token groups in createApplyHandler ([#527](https://github.com/Takazudo/zudo-design-token-panel/pull/527)) (1d84c94)
8
+
9
+ ### Other Changes
10
+
11
+ - chore(deps): resolve 19 pnpm audit security advisories ([#525](https://github.com/Takazudo/zudo-design-token-panel/pull/525)) (80c9a0e)
12
+
3
13
  ## 0.4.6
4
14
 
5
15
  ### Features
@@ -2,7 +2,7 @@
2
2
  import { realpathSync as E } from "node:fs";
3
3
  import { createServer as H } from "node:http";
4
4
  import { resolve as p } from "node:path";
5
- import { l as $, c as x } from "../load-routing-LJ72261l.js";
5
+ import { l as $, c as x } from "../load-routing-D4H2VOl5.js";
6
6
  function g(o, t) {
7
7
  return typeof o != "string" || o.length === 0 || t.length === 0 ? !1 : t.includes(o);
8
8
  }
@@ -1,87 +1,87 @@
1
- import { promises as y, readFileSync as I } from "node:fs";
2
- import { relative as T, isAbsolute as q, sep as L, resolve as _, dirname as j, join as x } from "node:path";
3
- import { randomBytes as A } from "node:crypto";
4
- import { r as D } from "./route-tokens-to-files-1DvmWBdj.js";
5
- const b = /* @__PURE__ */ new Map();
1
+ import { promises as b, readFileSync as q } from "node:fs";
2
+ import { relative as P, isAbsolute as L, sep as _, resolve as D, dirname as T, join as j } from "node:path";
3
+ import { randomBytes as x } from "node:crypto";
4
+ import { r as Z } from "./route-tokens-to-files-1DvmWBdj.js";
5
+ const F = /* @__PURE__ */ new Map();
6
6
  async function B(t, r) {
7
- const e = (b.get(t) ?? Promise.resolve()).then(r, r), o = e.then(
7
+ const e = (F.get(t) ?? Promise.resolve()).then(r, r), o = e.then(
8
8
  () => {
9
9
  },
10
10
  () => {
11
11
  }
12
12
  );
13
- b.set(t, o);
13
+ F.set(t, o);
14
14
  try {
15
15
  return await e;
16
16
  } finally {
17
- b.get(t) === o && b.delete(t);
17
+ F.get(t) === o && F.delete(t);
18
18
  }
19
19
  }
20
- function Z(t) {
20
+ function H(t) {
21
21
  return t.replace(/[\r\n\\;{}]/g, "");
22
22
  }
23
- const H = /^--[a-zA-Z0-9_-]+$/;
24
- function U(t) {
25
- return typeof t == "string" && H.test(t);
23
+ const U = /^--[a-zA-Z0-9_-]+$/;
24
+ function G(t) {
25
+ return typeof t == "string" && U.test(t);
26
26
  }
27
- function G(t, r) {
27
+ function K(t, r) {
28
28
  if (!r.endsWith(".css")) return !1;
29
- const n = T(t, r);
30
- return !(n === "" || n === "." || q(n) || n === ".." || n.startsWith(`..${L}`) || n.startsWith("../"));
29
+ const n = P(t, r);
30
+ return !(n === "" || n === "." || L(n) || n === ".." || n.startsWith(`..${_}`) || n.startsWith("../"));
31
31
  }
32
- function K(t) {
32
+ function Q(t) {
33
33
  const r = {};
34
34
  for (const [n, e] of Object.entries(t)) {
35
- if (!U(n))
35
+ if (!G(n))
36
36
  return { error: `Invalid cssVar name: ${JSON.stringify(n)}` };
37
37
  if (typeof e != "string")
38
38
  return { error: `Value for ${n} must be a string` };
39
- r[n] = Z(e);
39
+ r[n] = H(e);
40
40
  }
41
41
  return { sanitized: r };
42
42
  }
43
- class F extends Error {
43
+ class S extends Error {
44
44
  constructor(r = 'No top-level ":root { ... }" or "@theme { ... }" block found in source.') {
45
- super(r), this.name = "NoTokenBlockError", Object.setPrototypeOf(this, F.prototype);
45
+ super(r), this.name = "NoTokenBlockError", Object.setPrototypeOf(this, S.prototype);
46
46
  }
47
47
  }
48
48
  function E(t, r, n) {
49
- const e = t.length, o = r.length, s = r[0];
50
- let i = 0, f = 0;
51
- for (; i < e; ) {
52
- const d = t[i];
53
- if (d === "/" && t[i + 1] === "*") {
54
- const c = t.indexOf("*/", i + 2);
49
+ const e = t.length, o = r.length, i = r[0];
50
+ let s = 0, u = 0;
51
+ for (; s < e; ) {
52
+ const f = t[s];
53
+ if (f === "/" && t[s + 1] === "*") {
54
+ const c = t.indexOf("*/", s + 2);
55
55
  if (c === -1) return null;
56
- i = c + 2;
56
+ s = c + 2;
57
57
  continue;
58
58
  }
59
- if (d === '"' || d === "'") {
60
- const c = d;
61
- for (i++; i < e && t[i] !== c; )
62
- t[i] === "\\" && i + 1 < e && i++, i++;
63
- i++;
59
+ if (f === '"' || f === "'") {
60
+ const c = f;
61
+ for (s++; s < e && t[s] !== c; )
62
+ t[s] === "\\" && s + 1 < e && s++, s++;
63
+ s++;
64
64
  continue;
65
65
  }
66
- if (d === "{") {
67
- f++, i++;
66
+ if (f === "{") {
67
+ u++, s++;
68
68
  continue;
69
69
  }
70
- if (d === "}") {
71
- f > 0 && f--, i++;
70
+ if (f === "}") {
71
+ u > 0 && u--, s++;
72
72
  continue;
73
73
  }
74
- if (f === 0 && d === s && t.startsWith(r, i)) {
75
- const c = i + o, p = t[c] ?? "";
76
- if (!S(p)) {
77
- const k = n ? X(t, c) : Q(t, c);
74
+ if (u === 0 && f === i && t.startsWith(r, s)) {
75
+ const c = s + o, p = t[c] ?? "";
76
+ if (!$(p)) {
77
+ const k = n ? Y(t, c) : X(t, c);
78
78
  if (k !== -1) {
79
- const g = k + 1, l = Y(t, g);
80
- return l !== -1 ? { contentStart: g, contentEnd: l } : null;
79
+ const m = k + 1, l = tt(t, m);
80
+ return l !== -1 ? { contentStart: m, contentEnd: l } : null;
81
81
  }
82
82
  }
83
83
  }
84
- i++;
84
+ s++;
85
85
  }
86
86
  return null;
87
87
  }
@@ -91,10 +91,10 @@ function C(t) {
91
91
  function N(t) {
92
92
  return E(t, "@theme", !0);
93
93
  }
94
- function S(t) {
94
+ function $(t) {
95
95
  return /[A-Za-z0-9_-]/.test(t);
96
96
  }
97
- function Q(t, r) {
97
+ function X(t, r) {
98
98
  const n = t.length;
99
99
  let e = r;
100
100
  for (; e < n; ) {
@@ -105,16 +105,16 @@ function Q(t, r) {
105
105
  continue;
106
106
  }
107
107
  if (o === "/" && t[e + 1] === "*") {
108
- const s = t.indexOf("*/", e + 2);
109
- if (s === -1) return -1;
110
- e = s + 2;
108
+ const i = t.indexOf("*/", e + 2);
109
+ if (i === -1) return -1;
110
+ e = i + 2;
111
111
  continue;
112
112
  }
113
113
  return o === "{" ? e : -1;
114
114
  }
115
115
  return -1;
116
116
  }
117
- function X(t, r) {
117
+ function Y(t, r) {
118
118
  const n = t.length;
119
119
  let e = r;
120
120
  for (; e < n; ) {
@@ -125,43 +125,43 @@ function X(t, r) {
125
125
  continue;
126
126
  }
127
127
  if (o === "/" && t[e + 1] === "*") {
128
- const s = t.indexOf("*/", e + 2);
129
- if (s === -1) return -1;
130
- e = s + 2;
128
+ const i = t.indexOf("*/", e + 2);
129
+ if (i === -1) return -1;
130
+ e = i + 2;
131
131
  continue;
132
132
  }
133
133
  if (o === "{") return e;
134
- if (S(o)) {
135
- for (e++; e < n && S(t[e]); ) e++;
134
+ if ($(o)) {
135
+ for (e++; e < n && $(t[e]); ) e++;
136
136
  continue;
137
137
  }
138
138
  return -1;
139
139
  }
140
140
  return -1;
141
141
  }
142
- function Y(t, r) {
142
+ function tt(t, r) {
143
143
  const n = t.length;
144
144
  let e = r, o = 1;
145
145
  for (; e < n; ) {
146
- const s = t[e];
147
- if (s === "/" && t[e + 1] === "*") {
148
- const i = t.indexOf("*/", e + 2);
149
- if (i === -1) return -1;
150
- e = i + 2;
146
+ const i = t[e];
147
+ if (i === "/" && t[e + 1] === "*") {
148
+ const s = t.indexOf("*/", e + 2);
149
+ if (s === -1) return -1;
150
+ e = s + 2;
151
151
  continue;
152
152
  }
153
- if (s === '"' || s === "'") {
154
- const i = s;
155
- for (e++; e < n && t[e] !== i; )
153
+ if (i === '"' || i === "'") {
154
+ const s = i;
155
+ for (e++; e < n && t[e] !== s; )
156
156
  t[e] === "\\" && e + 1 < n && e++, e++;
157
157
  e++;
158
158
  continue;
159
159
  }
160
- if (s === "{") {
160
+ if (i === "{") {
161
161
  o++, e++;
162
162
  continue;
163
163
  }
164
- if (s === "}") {
164
+ if (i === "}") {
165
165
  if (o--, o === 0) return e;
166
166
  e++;
167
167
  continue;
@@ -170,26 +170,26 @@ function Y(t, r) {
170
170
  }
171
171
  return -1;
172
172
  }
173
- function tt(t) {
173
+ function et(t) {
174
174
  return t.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
175
175
  }
176
- function V(t) {
176
+ function M(t) {
177
177
  return t.replace(/\/\*[\s\S]*?\*\//g, (r) => " ".repeat(r.length));
178
178
  }
179
- function M(t) {
180
- const r = t.startsWith("--") ? t.slice(2) : t, n = tt(r);
179
+ function V(t) {
180
+ const r = t.startsWith("--") ? t.slice(2) : t, n = et(r);
181
181
  return new RegExp("(?<![\\w-])(--" + n + ":)(\\s*)([\\s\\S]+?);");
182
182
  }
183
183
  function R(t, r) {
184
- return M(r).test(V(t));
184
+ return V(r).test(M(t));
185
185
  }
186
- function P(t, r, n) {
187
- const e = M(r), o = V(t), s = e.exec(o);
188
- if (!s) return { content: t, status: "unknown" };
189
- const [i, f, d] = s, c = s.index, p = c + i.length, k = c + f.length + d.length, g = p - 1, u = t.slice(k, g).trim(), v = n.trim();
190
- return u === v ? { content: t, status: "unchanged" } : { content: t.slice(0, c) + f + d + n + ";" + t.slice(p), status: "changed" };
186
+ function A(t, r, n) {
187
+ const e = V(r), o = M(t), i = e.exec(o);
188
+ if (!i) return { content: t, status: "unknown" };
189
+ const [s, u, f] = i, c = i.index, p = c + s.length, k = c + u.length + f.length, m = p - 1, d = t.slice(k, m).trim(), y = n.trim();
190
+ return d === y ? { content: t, status: "unchanged" } : { content: t.slice(0, c) + u + f + n + ";" + t.slice(p), status: "changed" };
191
191
  }
192
- function et(t, r) {
192
+ function nt(t, r) {
193
193
  const n = Object.keys(r), e = C(t), o = N(t);
194
194
  if (!e && !o)
195
195
  return {
@@ -199,43 +199,43 @@ function et(t, r) {
199
199
  unknown: [...n],
200
200
  unknownOutsideBlock: n.filter((l) => R(t, l))
201
201
  };
202
- let s = e ? t.slice(e.contentStart, e.contentEnd) : null, i = o ? t.slice(o.contentStart, o.contentEnd) : null;
203
- const f = [], d = [], c = [];
202
+ let i = e ? t.slice(e.contentStart, e.contentEnd) : null, s = o ? t.slice(o.contentStart, o.contentEnd) : null;
203
+ const u = [], f = [], c = [];
204
204
  for (const l of n) {
205
- if (s !== null) {
206
- const u = P(s, l, r[l]);
207
- if (u.status !== "unknown") {
208
- s = u.content, u.status === "changed" ? f.push(l) : d.push(l);
205
+ if (i !== null) {
206
+ const d = A(i, l, r[l]);
207
+ if (d.status !== "unknown") {
208
+ i = d.content, d.status === "changed" ? u.push(l) : f.push(l);
209
209
  continue;
210
210
  }
211
211
  }
212
- if (i !== null) {
213
- const u = P(i, l, r[l]);
214
- if (u.status !== "unknown") {
215
- i = u.content, u.status === "changed" ? f.push(l) : d.push(l);
212
+ if (s !== null) {
213
+ const d = A(s, l, r[l]);
214
+ if (d.status !== "unknown") {
215
+ s = d.content, d.status === "changed" ? u.push(l) : f.push(l);
216
216
  continue;
217
217
  }
218
218
  }
219
219
  c.push(l);
220
220
  }
221
221
  const p = [];
222
- e && s !== null && p.push({ start: e.contentStart, end: e.contentEnd, content: s }), o && i !== null && p.push({
222
+ e && i !== null && p.push({ start: e.contentStart, end: e.contentEnd, content: i }), o && s !== null && p.push({
223
223
  start: o.contentStart,
224
224
  end: o.contentEnd,
225
- content: i
226
- }), p.sort((l, u) => u.start - l.start);
225
+ content: s
226
+ }), p.sort((l, d) => d.start - l.start);
227
227
  let k = t;
228
228
  for (const l of p)
229
229
  k = k.slice(0, l.start) + l.content + k.slice(l.end);
230
- const g = c.filter((l) => R(t, l));
231
- return { updated: k, changed: f, unchanged: d, unknown: c, unknownOutsideBlock: g };
230
+ const m = c.filter((l) => R(t, l));
231
+ return { updated: k, changed: u, unchanged: f, unknown: c, unknownOutsideBlock: m };
232
232
  }
233
- function nt(t, r) {
234
- if (!rt(t))
235
- throw new F();
236
- return et(t, r);
233
+ function rt(t, r) {
234
+ if (!ot(t))
235
+ throw new S();
236
+ return nt(t, r);
237
237
  }
238
- function rt(t) {
238
+ function ot(t) {
239
239
  return C(t) !== null || N(t) !== null;
240
240
  }
241
241
  function h(t, r = 200) {
@@ -244,8 +244,8 @@ function h(t, r = 200) {
244
244
  headers: { "Content-Type": "application/json" }
245
245
  });
246
246
  }
247
- async function ot(t, r, n) {
248
- const e = await y.readFile(t, "utf-8"), o = nt(e, n);
247
+ async function st(t, r, n) {
248
+ const e = await b.readFile(t, "utf-8"), o = rt(e, n);
249
249
  return {
250
250
  absPath: t,
251
251
  relPath: r,
@@ -260,92 +260,97 @@ async function ot(t, r, n) {
260
260
  async function it(t) {
261
261
  if (t.changed.length !== 0)
262
262
  return B(t.absPath, async () => {
263
- const r = j(t.absPath), n = x(r, `.tmp-${A(8).toString("hex")}.css`);
263
+ const r = T(t.absPath), n = j(r, `.tmp-${x(8).toString("hex")}.css`);
264
264
  try {
265
- await y.writeFile(n, t.updated, "utf-8"), await y.rename(n, t.absPath);
265
+ await b.writeFile(n, t.updated, "utf-8"), await b.rename(n, t.absPath);
266
266
  } catch (e) {
267
267
  try {
268
- await y.unlink(n);
268
+ await b.unlink(n);
269
269
  } catch {
270
270
  }
271
271
  throw e;
272
272
  }
273
273
  });
274
274
  }
275
- async function st(t) {
275
+ async function at(t) {
276
276
  return B(t.absPath, async () => {
277
- const r = j(t.absPath), n = x(r, `.tmp-${A(8).toString("hex")}.css`);
277
+ const r = T(t.absPath), n = j(r, `.tmp-${x(8).toString("hex")}.css`);
278
278
  try {
279
- return await y.writeFile(n, t.original, "utf-8"), await y.rename(n, t.absPath), { ok: !0 };
279
+ return await b.writeFile(n, t.original, "utf-8"), await b.rename(n, t.absPath), { ok: !0 };
280
280
  } catch (e) {
281
281
  console.error("[design-token-panel/server] Restore failed for", t.relPath, e);
282
282
  try {
283
- await y.unlink(n);
283
+ await b.unlink(n);
284
284
  } catch {
285
285
  }
286
286
  return { ok: !1, error: e };
287
287
  }
288
288
  });
289
289
  }
290
- function dt(t) {
290
+ function ht(t) {
291
291
  const { rootDir: r, writeRoot: n, routing: e } = t;
292
- return async function(s) {
293
- let i;
292
+ return async function(i) {
293
+ let s;
294
294
  try {
295
- i = await s.json();
295
+ s = await i.json();
296
296
  } catch {
297
297
  return h({ ok: !1, error: "Invalid JSON in request body" }, 400);
298
298
  }
299
- if (typeof i != "object" || i === null || Array.isArray(i))
299
+ if (typeof s != "object" || s === null || Array.isArray(s))
300
300
  return h({ ok: !1, error: "Request body must be a JSON object" }, 400);
301
- const { tokens: f } = i;
302
- if (typeof f != "object" || f === null || Array.isArray(f))
301
+ const { tokens: u } = s;
302
+ if (typeof u != "object" || u === null || Array.isArray(u))
303
303
  return h({ ok: !1, error: "tokens must be a JSON object" }, 400);
304
- if (Object.entries(f).length === 0)
304
+ if (Object.entries(u).length === 0)
305
305
  return h({ ok: !1, error: "tokens must contain at least one entry" }, 400);
306
- const { sanitized: c, error: p } = K(f);
306
+ const { sanitized: c, error: p } = Q(u);
307
307
  if (p || !c)
308
308
  return h({ ok: !1, error: p ?? "Invalid tokens" }, 400);
309
- const { groups: k, rejected: g } = D(c, e);
310
- if (g.length > 0)
311
- return h({ ok: !1, error: "Unsupported cssVar prefix", rejected: g }, 400);
309
+ const { groups: k, rejected: m } = Z(c, e);
310
+ if (m.length > 0)
311
+ return h({ ok: !1, error: "Unsupported cssVar prefix", rejected: m }, 400);
312
312
  if (k.length === 0)
313
313
  return h({ ok: !1, error: "No routable tokens supplied" }, 400);
314
- const l = [];
314
+ const l = /* @__PURE__ */ new Map();
315
315
  for (const a of k) {
316
- const m = _(r, a.relativePath);
317
- if (!G(n, m))
316
+ const g = D(r, a.relativePath);
317
+ if (!K(n, g))
318
318
  return h({ ok: !1, error: `Path not allowed: ${a.relativePath}` }, 400);
319
- l.push({ absPath: m, relPath: a.relativePath, groupTokens: a.tokens });
319
+ const w = l.get(g);
320
+ w ? Object.assign(w.groupTokens, a.tokens) : l.set(g, {
321
+ absPath: g,
322
+ relPath: a.relativePath,
323
+ groupTokens: { ...a.tokens }
324
+ });
320
325
  }
321
- const u = [];
322
- for (const { absPath: a, relPath: m, groupTokens: O } of l)
326
+ const d = Array.from(l.values()), y = [];
327
+ for (const { absPath: a, relPath: g, groupTokens: w } of d)
323
328
  try {
324
- u.push(await ot(a, m, O));
325
- } catch (w) {
326
- return w instanceof F ? (console.error("[design-token-panel/server] No :root or @theme block in", m), h(
329
+ y.push(await st(a, g, w));
330
+ } catch (v) {
331
+ return v instanceof S ? (console.error("[design-token-panel/server] No :root or @theme block in", g), h(
327
332
  {
328
333
  ok: !1,
329
- error: `No top-level :root { ... } or @theme { ... } block in ${m}`
334
+ error: `No top-level :root { ... } or @theme { ... } block in ${g}`
330
335
  },
331
336
  409
332
- )) : (console.error(`[design-token-panel/server] Error computing ${m}:`, w), h({ ok: !1, error: "Failed to read or parse source file" }, 500));
337
+ )) : (console.error(`[design-token-panel/server] Error computing ${g}:`, v), h({ ok: !1, error: "Failed to read or parse source file" }, 500));
333
338
  }
334
- const v = [];
335
- for (const a of u)
339
+ const O = [];
340
+ for (const a of y)
336
341
  try {
337
- await it(a), v.push(a);
338
- } catch (m) {
339
- console.error(`[design-token-panel/server] Write failed for ${a.relPath}:`, m);
340
- const O = [];
341
- for (let w = v.length - 1; w >= 0; w--)
342
- (await st(v[w])).ok || O.push(v[w].relPath);
343
- return O.length > 0 ? h(
342
+ await it(a), O.push(a);
343
+ } catch (g) {
344
+ console.error(`[design-token-panel/server] Write failed for ${a.relPath}:`, g);
345
+ const w = [];
346
+ for (let v = O.length - 1; v >= 0; v--)
347
+ (await at(O[v])).ok || w.push(O[v].relPath);
348
+ return w.length > 0 ? h(
344
349
  {
345
350
  ok: !1,
346
- error: `Failed to write file ${a.relPath}; rollback also failed for ${O.length} file(s) — disk state is inconsistent. Inspect the listed files manually.`,
351
+ error: `Failed to write file ${a.relPath}; rollback also failed for ${w.length} file(s) — disk state is inconsistent. Inspect the listed files manually.`,
347
352
  failedFile: a.relPath,
348
- restoreFailures: O
353
+ restoreFailures: w
349
354
  },
350
355
  500
351
356
  ) : h(
@@ -357,8 +362,8 @@ function dt(t) {
357
362
  500
358
363
  );
359
364
  }
360
- const $ = u.flatMap((a) => a.unknown), J = u.flatMap((a) => a.unchanged), W = u.flatMap((a) => a.unknownOutsideBlock), z = u.map((a) => ({
361
- file: a.relPath.startsWith("/") ? T(r, a.relPath) : a.relPath,
365
+ const J = y.flatMap((a) => a.unknown), W = y.flatMap((a) => a.unchanged), z = y.flatMap((a) => a.unknownOutsideBlock), I = y.map((a) => ({
366
+ file: a.relPath.startsWith("/") ? P(r, a.relPath) : a.relPath,
362
367
  changed: a.changed,
363
368
  unchanged: a.unchanged,
364
369
  unknown: a.unknown,
@@ -366,30 +371,30 @@ function dt(t) {
366
371
  }));
367
372
  return h({
368
373
  ok: !0,
369
- updated: z,
370
- unknownCssVars: $,
371
- unchangedCssVars: J,
372
- unknownOutsideBlockCssVars: W
374
+ updated: I,
375
+ unknownCssVars: J,
376
+ unchangedCssVars: W,
377
+ unknownOutsideBlockCssVars: z
373
378
  });
374
379
  };
375
380
  }
376
- function ht(t) {
381
+ function pt(t) {
377
382
  let r;
378
383
  try {
379
- r = I(t, "utf-8");
380
- } catch (s) {
384
+ r = q(t, "utf-8");
385
+ } catch (i) {
381
386
  throw new Error(
382
387
  `[design-token-panel] loadRoutingFromFile: cannot read file at ${t}
383
- Cause: ${s.message}`
388
+ Cause: ${i.message}`
384
389
  );
385
390
  }
386
391
  let n;
387
392
  try {
388
393
  n = JSON.parse(r);
389
- } catch (s) {
394
+ } catch (i) {
390
395
  throw new Error(
391
396
  `[design-token-panel] loadRoutingFromFile: invalid JSON in ${t}
392
- Cause: ${s.message}`
397
+ Cause: ${i.message}`
393
398
  );
394
399
  }
395
400
  if (n === null || typeof n != "object" || Array.isArray(n))
@@ -401,21 +406,21 @@ function ht(t) {
401
406
  throw new Error(
402
407
  `[design-token-panel] loadRoutingFromFile: routing map must not be empty (in ${t})`
403
408
  );
404
- for (const s of o) {
405
- const i = e[s];
406
- if (typeof i != "string" || i.trim() === "")
409
+ for (const i of o) {
410
+ const s = e[i];
411
+ if (typeof s != "string" || s.trim() === "")
407
412
  throw new Error(
408
- `[design-token-panel] loadRoutingFromFile: every value must be a non-empty string, but key "${s}" has value ${JSON.stringify(i)} (in ${t})`
413
+ `[design-token-panel] loadRoutingFromFile: every value must be a non-empty string, but key "${i}" has value ${JSON.stringify(s)} (in ${t})`
409
414
  );
410
415
  }
411
416
  return e;
412
417
  }
413
418
  export {
414
- H as C,
415
- U as a,
416
- dt as c,
417
- G as i,
418
- ht as l,
419
+ U as C,
420
+ G as a,
421
+ ht as c,
422
+ K as i,
423
+ pt as l,
419
424
  B as s,
420
- K as v
425
+ Q as v
421
426
  };
@@ -1,4 +1,4 @@
1
- import { C as s, c as i, i as l, a as r, l as t, s as o, v as d } from "../load-routing-LJ72261l.js";
1
+ import { C as s, c as i, i as l, a as r, l as t, s as o, v as d } from "../load-routing-D4H2VOl5.js";
2
2
  export {
3
3
  s as CSS_VAR_NAME_RE,
4
4
  i as createApplyHandler,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takazudo/zdtp",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Dynamic design-token tweak panel — host-config-driven, framework-agnostic Preact UI.",
5
5
  "private": false,
6
6
  "license": "MIT",