@takazudo/zdtp 0.4.12 → 0.4.14
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 +86 -27
- package/PORTABLE-CONTRACT.md +36 -6
- package/README.md +4 -4
- package/dist/astro/host-adapter.js +3 -3
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-CTDDBxI8.js → autoload-state-IlkEci88.js} +1 -1
- package/dist/components/palette-chart/palette-chart.d.ts +14 -3
- package/dist/config/panel-config.d.ts +0 -25
- package/dist/index-Ds4bCeiC.js +7591 -0
- package/dist/{index-C8GR1TU-.js → index-EdhZv8Ru.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/{panel-config-7Xg59uKj.js → panel-config-SgA84Uqe.js} +139 -114
- package/dist/tabs/palette/palette-check-view.d.ts +0 -13
- package/dist/testing.js +2 -2
- package/dist/tokens/tier-model.d.ts +7 -5
- package/dist/{tweak-state-DRKV1uYj.js → tweak-state-DGLrzIwq.js} +259 -237
- package/dist/utils/color-oklch.d.ts +13 -0
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
- package/dist/index-BeYH-tJD.js +0 -7582
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to `@takazudo/zdtp` are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on Keep a Changelog, and release notes are generated from the changelog MDX pages.
|
|
6
|
+
|
|
7
|
+
## [0.4.14] - 2026-08-29
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- fix(zdtp): silence compatible global alias warning (2630d84)
|
|
12
|
+
|
|
13
|
+
### Other Changes
|
|
14
|
+
|
|
15
|
+
- test(zdtp): cover partial global alias shape (6314a7f)
|
|
16
|
+
- Merge pull request [#647](https://github.com/Takazudo/zudo-design-token-panel/pull/647) from Takazudo/fix/646-compatible-zdtp-alias: fix(zdtp): silence warnings for compatible global aliases (44f6ca4)
|
|
17
|
+
|
|
18
|
+
## [0.4.13] - 2026-08-29
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- feat(zdtp): normalize static CSS colors (20567e7)
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- fix(zdtp): expose readonly swatches as selectable (c3c8c28)
|
|
27
|
+
- fix(zdtp): restrict referencesRamps to Color tabs (8894399)
|
|
28
|
+
- fix(zdtp): enforce readonly Palette editing (5c2445c)
|
|
29
|
+
- fix(zdtp): guard palette validity transitions (73a59fb)
|
|
30
|
+
- fix(zdtp): preserve invalid palette slots as n-a (0e456e5)
|
|
31
|
+
- fix(doc): align preview with latest zfb (9cd81bb)
|
|
32
|
+
|
|
33
|
+
### Other Changes
|
|
34
|
+
|
|
35
|
+
- Merge pull request [#636](https://github.com/Takazudo/zudo-design-token-panel/pull/636) from Takazudo/base/sweep-260829: fix(zdtp): correct Palette behavior and public contracts (db3ee47)
|
|
36
|
+
- docs(zdtp): document referencesRamps tab restriction (555b562)
|
|
37
|
+
- Merge pull request [#645](https://github.com/Takazudo/zudo-design-token-panel/pull/645) from Takazudo/base/sweep-260829-portable-contract-docs: fix(zdtp): align portable contracts and ramp validation (452fc32)
|
|
38
|
+
- Merge topic/630-reference-color-mode-docs (7abfa37)
|
|
39
|
+
- docs: clarify reference emission and color modes (f447a99)
|
|
40
|
+
- Merge topic/632-references-ramps-color-tabs (7df5b55)
|
|
41
|
+
- Merge topic/631-required-write-root-docs (ae76e2b)
|
|
42
|
+
- Merge topic/629-shipped-semantic-contract (0ba0294)
|
|
43
|
+
- docs(zdtp): sync shipped semantic tier contract (4bbc5d5)
|
|
44
|
+
- docs: require write-root in apply guidance (10c76b1)
|
|
45
|
+
- Merge pull request [#640](https://github.com/Takazudo/zudo-design-token-panel/pull/640) from Takazudo/base/sweep-260829-palette-correctness: fix(zdtp): correct Palette color and readonly behavior (36c0972)
|
|
46
|
+
- Merge branch 'topic/626-palette-readonly' into base/sweep-260829-palette-correctness (53575d9)
|
|
47
|
+
- Merge branch 'topic/625-palette-invalid-na' into base/sweep-260829-palette-correctness (73c2c6c)
|
|
48
|
+
- Merge branch 'topic/624-static-css-color-normalization' into base/sweep-260829-palette-correctness (858c131)
|
|
49
|
+
- Merge pull request [#635](https://github.com/Takazudo/zudo-design-token-panel/pull/635) from Takazudo/base/sweep-260829-zudo-dependency-refresh: chore(doc): refresh stable zudo dependencies (db555eb)
|
|
50
|
+
- Merge branch 'topic/621-zudo-dependency-family' into base/sweep-260829-zudo-dependency-refresh (16ed6cd)
|
|
51
|
+
- chore(doc): bump stable zudo dependency family (579671a)
|
|
52
|
+
- Merge pull request [#615](https://github.com/Takazudo/zudo-design-token-panel/pull/615) from Takazudo/fix/populate-doc-changelog-20260823: docs: populate changelog release history (9ce99a1)
|
|
53
|
+
- docs: clarify changelog source and locale history (7a0c194)
|
|
54
|
+
- docs: populate changelog release history (559a9c5)
|
|
55
|
+
- Merge pull request [#614](https://github.com/Takazudo/zudo-design-token-panel/pull/614) from Takazudo/agent-fix/zdtp-lint-warnings-20260823: chore: resolve zdtp lint warnings (9f16688)
|
|
56
|
+
- chore: resolve zdtp lint warnings (ed175ca)
|
|
57
|
+
- Merge pull request [#612](https://github.com/Takazudo/zudo-design-token-panel/pull/612) from Takazudo/agent-fix/actions-cache-node24-20260823: ci: update actions/cache to Node 24 (ab0ad0d)
|
|
58
|
+
- ci: update actions/cache to Node 24 (234459b)
|
|
59
|
+
- Merge pull request [#610](https://github.com/Takazudo/zudo-design-token-panel/pull/610) from Takazudo/chore/bump-zudo-deps-20260823: chore(doc): update zudo stack and preview wiring (d6d0d54)
|
|
60
|
+
- chore(doc): bump zudo dependencies (6d50555)
|
|
61
|
+
|
|
62
|
+
## [0.4.12] - 2026-08-20
|
|
4
63
|
|
|
5
64
|
### Fixed
|
|
6
65
|
|
|
@@ -29,7 +88,7 @@
|
|
|
29
88
|
- = start portable storage contract epic = [skip ci] (1605c3e)
|
|
30
89
|
- = start sweep-260820 super-epic = [skip ci] (c29cc50)
|
|
31
90
|
|
|
32
|
-
## 0.4.11
|
|
91
|
+
## [0.4.11] - 2026-08-19
|
|
33
92
|
|
|
34
93
|
### Features
|
|
35
94
|
|
|
@@ -56,7 +115,7 @@
|
|
|
56
115
|
- test: complete the lazy-load gate decision-matrix coverage ([#591](https://github.com/Takazudo/zudo-design-token-panel/pull/591)) (76cb4a3)
|
|
57
116
|
- test: confirm multi-instance spawn geometry in a real browser ([#595](https://github.com/Takazudo/zudo-design-token-panel/pull/595)) (11988d6)
|
|
58
117
|
|
|
59
|
-
## 0.4.10
|
|
118
|
+
## [0.4.10] - 2026-08-10
|
|
60
119
|
|
|
61
120
|
### Fixed
|
|
62
121
|
|
|
@@ -69,7 +128,7 @@
|
|
|
69
128
|
- 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)
|
|
70
129
|
- docs(l-make-release): auto-proceed Step 3 gate for routine bumps (45a5aca)
|
|
71
130
|
|
|
72
|
-
## 0.4.9
|
|
131
|
+
## [0.4.9] - 2026-07-13
|
|
73
132
|
|
|
74
133
|
### Features
|
|
75
134
|
|
|
@@ -88,7 +147,7 @@
|
|
|
88
147
|
- test: record color picker close control VRT (aa66eba)
|
|
89
148
|
- chore: start panel UI tweaks 540 (57fb4c7)
|
|
90
149
|
|
|
91
|
-
## 0.4.8
|
|
150
|
+
## [0.4.8] - 2026-07-13
|
|
92
151
|
|
|
93
152
|
### Features
|
|
94
153
|
|
|
@@ -100,7 +159,7 @@
|
|
|
100
159
|
- chore(dom-tweaker): remove consumed prototype resource ([#539](https://github.com/Takazudo/zudo-design-token-panel/pull/539)) (9a0ac51)
|
|
101
160
|
- docs(l-make-release): add autonomy-after-the-gate principle (7f64206)
|
|
102
161
|
|
|
103
|
-
## 0.4.7
|
|
162
|
+
## [0.4.7] - 2026-07-12
|
|
104
163
|
|
|
105
164
|
### Fixed
|
|
106
165
|
|
|
@@ -110,7 +169,7 @@
|
|
|
110
169
|
|
|
111
170
|
- chore(deps): resolve 19 pnpm audit security advisories ([#525](https://github.com/Takazudo/zudo-design-token-panel/pull/525)) (80c9a0e)
|
|
112
171
|
|
|
113
|
-
## 0.4.6
|
|
172
|
+
## [0.4.6] - 2026-07-12
|
|
114
173
|
|
|
115
174
|
### Features
|
|
116
175
|
|
|
@@ -134,7 +193,7 @@
|
|
|
134
193
|
- test: VRT baselines re-recorded for zdtp title + square corners; broad coverage added for notes tab, help icons, unit cycling
|
|
135
194
|
- chore: removed consumed `_temp-resource/` prototype scaffold (ccbd18a)
|
|
136
195
|
|
|
137
|
-
## 0.4.5
|
|
196
|
+
## [0.4.5] - 2026-07-07
|
|
138
197
|
|
|
139
198
|
### Features
|
|
140
199
|
|
|
@@ -156,7 +215,7 @@
|
|
|
156
215
|
- docs: truth-up schemaId docs, tighten Import modal copy, export `SCHEMA_V1`/`SCHEMA_V2`/`SCHEMA_V3` ([#505](https://github.com/Takazudo/zudo-design-token-panel/issues/505)) (8088281)
|
|
157
216
|
- docs: replace zmodular references with Takazudo Modular markdown links (afcfea2)
|
|
158
217
|
|
|
159
|
-
## 0.4.4
|
|
218
|
+
## [0.4.4] - 2026-07-06
|
|
160
219
|
|
|
161
220
|
### Features
|
|
162
221
|
|
|
@@ -202,7 +261,7 @@
|
|
|
202
261
|
- chore(deps): bump `@takazudo/zudo-doc` and `zudo-doc-history-server` to `^2.5.1` (d6c05dd)
|
|
203
262
|
- chore(doc): sync generated `claude/index.mdx` with build output (d763238)
|
|
204
263
|
|
|
205
|
-
## 0.4.3
|
|
264
|
+
## [0.4.3] - 2026-07-04
|
|
206
265
|
|
|
207
266
|
### Features
|
|
208
267
|
|
|
@@ -234,7 +293,7 @@
|
|
|
234
293
|
- Browser test files now run serially — parallel files share one origin and raced each other's localStorage (fd37774)
|
|
235
294
|
- Deps: bump @takazudo/* toolchain (zfb next.76, zudo-doc 2.5.0) (62b62f6)
|
|
236
295
|
|
|
237
|
-
## 0.4.2
|
|
296
|
+
## [0.4.2] - 2026-06-30
|
|
238
297
|
|
|
239
298
|
### Features
|
|
240
299
|
|
|
@@ -265,13 +324,13 @@
|
|
|
265
324
|
- Bump the `@takazudo/*` toolchain (zfb next.72, zudo-doc 2.1.2). (d711839)
|
|
266
325
|
- Doc-site migration to zudo-doc v2 — doc-site only, no package impact. ([#432](https://github.com/Takazudo/zudo-design-token-panel/pull/432))
|
|
267
326
|
|
|
268
|
-
## 0.4.1
|
|
327
|
+
## [0.4.1] - 2026-06-30
|
|
269
328
|
|
|
270
329
|
### Fixed
|
|
271
330
|
|
|
272
331
|
- **Palette tab no longer renders unstyled for self-injection consumers.** The 0.4.0 palette-tab CSS (`palette-chart` / `palette-edit` / `palette-readout`) reached `dist/zdtp.css` but was missing from the stylesheet the panel self-injects at runtime, so consumers using `import('@takazudo/zdtp')` + `configurePanel(...)` without importing `@takazudo/zdtp/styles` saw collapsed swatch bars and a missing curve-editor canvas. The two palette stylesheets are now `@import`ed into the single `panel.css` aggregate (matching `color-picker.css`) so both CSS delivery paths stay in sync, guarded by a new static `Invariant G` test. ([#413](https://github.com/Takazudo/zudo-design-token-panel/issues/413))
|
|
273
332
|
|
|
274
|
-
## 0.4.0
|
|
333
|
+
## [0.4.0] - 2026-06-29
|
|
275
334
|
|
|
276
335
|
### Features
|
|
277
336
|
|
|
@@ -289,7 +348,7 @@
|
|
|
289
348
|
- Integration + serde + browser-confirm test coverage for the palette tab. ([#396](https://github.com/Takazudo/zudo-design-token-panel/issues/396))
|
|
290
349
|
- Add a grouped palette tab recipe + reference docs (EN + JA). ([#397](https://github.com/Takazudo/zudo-design-token-panel/issues/397))
|
|
291
350
|
|
|
292
|
-
## 0.3.3
|
|
351
|
+
## [0.3.3] - 2026-06-23
|
|
293
352
|
|
|
294
353
|
### Features
|
|
295
354
|
|
|
@@ -308,7 +367,7 @@
|
|
|
308
367
|
|
|
309
368
|
- Add an end-to-end test asserting the oklch round-trip (panel `onChange` + apply path both emit `oklch(...)`) and wide-gamut P3 preservation. ([#379](https://github.com/Takazudo/zudo-design-token-panel/issues/379)) (0595f28)
|
|
310
369
|
|
|
311
|
-
## 0.3.2
|
|
370
|
+
## [0.3.2] - 2026-06-23
|
|
312
371
|
|
|
313
372
|
### Fixed
|
|
314
373
|
|
|
@@ -316,7 +375,7 @@
|
|
|
316
375
|
|
|
317
376
|
- **Dedupe the reserved toggle event across listeners.** When a custom-prefix host opts into the reserved `toggle-design-token-panel` name via `config.toggleEvent`, both the eager default listener and the instance's own listener fired on one dispatch and resolved to the same instance — toggling it twice (open, then immediately close). The handler now dedupes per dispatch by resolved instance id carried on the shared Event object, so the panel opens exactly once. ([#371](https://github.com/Takazudo/zudo-design-token-panel/pull/371))
|
|
318
377
|
|
|
319
|
-
## 0.3.1
|
|
378
|
+
## [0.3.1] - 2026-06-23
|
|
320
379
|
|
|
321
380
|
### Fixed
|
|
322
381
|
|
|
@@ -324,7 +383,7 @@
|
|
|
324
383
|
|
|
325
384
|
- **Skip the bin integration test suite when `dist/bin/server.js` is absent.** `server.integration.test.ts` spawns the built bin and previously threw in `beforeAll` when it was missing, failing the `node` vitest project on a fresh checkout (before a build). It now gates the suite with `describe.skipIf` on build presence (with a console warning) instead of hard-failing; CI builds before testing, so the suite still runs there. ([#360](https://github.com/Takazudo/zudo-design-token-panel/issues/360))
|
|
326
385
|
|
|
327
|
-
## 0.3.0
|
|
386
|
+
## [0.3.0] - 2026-06-22
|
|
328
387
|
|
|
329
388
|
### Features
|
|
330
389
|
|
|
@@ -336,7 +395,7 @@
|
|
|
336
395
|
|
|
337
396
|
- **`PanelConfig.applySink`.** An optional `{ apply(pairs), clear(names) }` sink routes this instance's CSS-var writes and clears through a caller-supplied object instead of `document.documentElement`. Useful for shadow DOM, iframe, or test-spy contexts. `apply` = upsert; `clear` = remove. Reset sends the full token-name set for the instance to `sink.clear` so the sink target is completely cleaned. Sink errors are non-fatal (`console.warn`). The host owns the sink target's lifecycle. `applySink` carries function references and must not be passed through the Astro inline JSON config. ([#355](https://github.com/Takazudo/zudo-design-token-panel/issues/355))
|
|
338
397
|
|
|
339
|
-
## 0.2.3
|
|
398
|
+
## [0.2.3] - 2026-06-15
|
|
340
399
|
|
|
341
400
|
### Bug Fixes
|
|
342
401
|
|
|
@@ -351,13 +410,13 @@
|
|
|
351
410
|
- docs: document the global (not scheme-scoped) tweak model in README §9 — on a host `color-scheme-changed` event the panel drops its inline overrides and re-seeds the live state from the new scheme, leaving `localStorage` untouched until the next edit. (238b4db, [#343](https://github.com/Takazudo/zudo-design-token-panel/issues/343))
|
|
352
411
|
- ci: drop the stale npm `next` dist-tag on stable releases when it lags `latest`, so `@takazudo/zdtp@next` can no longer silently resolve to an older prerelease. (215ec59, [#345](https://github.com/Takazudo/zudo-design-token-panel/issues/345))
|
|
353
412
|
|
|
354
|
-
## 0.2.2
|
|
413
|
+
## [0.2.2] - 2026-06-15
|
|
355
414
|
|
|
356
415
|
### Other Changes
|
|
357
416
|
|
|
358
417
|
- Post-review internal cleanups for the Element Path Copy feature (no behavior change): single source of truth for the highlight / element-path portal-mount ids (`HIGHLIGHT_PORTAL_MOUNT_ID` / `ELPATH_PORTAL_MOUNT_ID`, folded into `PANEL_EXCLUSION_SELECTOR`); `ElementPathToast` now owns its own fixed top-center positioning and z-index; `buildSummary` escapes the id consistently with the selector line; the always-on `mousemove` listener is passive + non-capture; and the hover-label summary is memoized. (0fdcbd6)
|
|
359
418
|
|
|
360
|
-
## 0.2.1
|
|
419
|
+
## [0.2.1] - 2026-06-14
|
|
361
420
|
|
|
362
421
|
### Features
|
|
363
422
|
|
|
@@ -369,7 +428,7 @@
|
|
|
369
428
|
- Bump GitHub Actions off the deprecated Node 20 runtime: `checkout` / `setup-node` / pnpm-setup and the artifact actions to their Node-24-matched versions. (08d5b48, b46fd66, [#339](https://github.com/Takazudo/zudo-design-token-panel/pull/339), [#341](https://github.com/Takazudo/zudo-design-token-panel/pull/341))
|
|
370
429
|
- Add a web-env bootstrap for Claude Code on the web. (23f00c3)
|
|
371
430
|
|
|
372
|
-
## 0.2.0
|
|
431
|
+
## [0.2.0] - 2026-06-09
|
|
373
432
|
|
|
374
433
|
First clean stable release on the `latest` dist-tag, promoting the
|
|
375
434
|
`0.2.0-next.1` / `0.2.0-next.2` prerelease line. A tagless
|
|
@@ -389,13 +448,13 @@ First clean stable release on the `latest` dist-tag, promoting the
|
|
|
389
448
|
- Drop slider-describing prose and min/max examples from `README.md`, `PORTABLE-CONTRACT.md`, and the doc-site reference pages (`token-manifest.mdx`, `architecture.mdx`, `configure-panel.mdx`). (e210a2d, 9262585)
|
|
390
449
|
- Resolve all `pnpm audit` advisories (1 critical, 3 high, 7 moderate, 1 low) in dev/doc-only tooling — none ship in the published package. (f3574e0)
|
|
391
450
|
|
|
392
|
-
## 0.2.0-next.2
|
|
451
|
+
## [0.2.0-next.2] - 2026-05-27
|
|
393
452
|
|
|
394
453
|
### Features
|
|
395
454
|
|
|
396
455
|
- **Token-name tooltip parity across all tabs (Size / Font / Spacing / Easing / GenericTab).** The Color tab already showed a rich custom tooltip with the full token name on hover; every other tab fell back to the native HTML `title` attribute. A new shared `TokenLabel` component renders the same `.tokenpanel-tooltip` primitive at every token-name display site. `TooltipProvider` was lifted from `color-tab.tsx` to `panel.tsx` so all tabs share a single provider. (559c59f, 426e9c6, 84f5981, [#330](https://github.com/Takazudo/zudo-design-token-panel/issues/330), [#337](https://github.com/Takazudo/zudo-design-token-panel/pull/337))
|
|
397
456
|
|
|
398
|
-
## 0.2.0-next.1
|
|
457
|
+
## [0.2.0-next.1] - 2026-05-27
|
|
399
458
|
|
|
400
459
|
### Breaking Changes
|
|
401
460
|
|
|
@@ -408,7 +467,7 @@ First clean stable release on the `latest` dist-tag, promoting the
|
|
|
408
467
|
- Update `packages/zdtp/README.md` and `packages/zdtp/PORTABLE-CONTRACT.md` to drop slider-describing prose and the min/max examples. (e210a2d)
|
|
409
468
|
- Update doc-site reference pages (`token-manifest.mdx`, `architecture.mdx`, `configure-panel.mdx`) to drop the min/max examples and slider-UI prose. (9262585)
|
|
410
469
|
|
|
411
|
-
## 0.1.0-next.3
|
|
470
|
+
## [0.1.0-next.3] - 2026-05-27
|
|
412
471
|
|
|
413
472
|
### Features
|
|
414
473
|
|
|
@@ -418,7 +477,7 @@ First clean stable release on the `latest` dist-tag, promoting the
|
|
|
418
477
|
|
|
419
478
|
- **Number inputs no longer overwrite the user's draft mid-keystroke.** `SliderRow` and the generic-tab item editor used to parse-and-clamp on every keystroke, immediately commit the clamped value, and round-trip it back into the input — so typing `2` then `2` (expecting `22`) snapped the input to `6` when the token's `max` was `6`. Out-of-range or empty drafts are now flagged with a `--invalid` red border and held without committing; on blur, an invalid draft reverts to the last known-good value. The slider thumb continues to scrub live. (21d3afa) ([#313](https://github.com/Takazudo/zudo-design-token-panel/issues/313))
|
|
420
479
|
|
|
421
|
-
## 0.1.0-next.2
|
|
480
|
+
## [0.1.0-next.2] - 2026-05-25
|
|
422
481
|
|
|
423
482
|
### Fixed
|
|
424
483
|
|
|
@@ -439,7 +498,7 @@ First clean stable release on the `latest` dist-tag, promoting the
|
|
|
439
498
|
base tokens get the same visibility toggle as palette and semantic tokens. The
|
|
440
499
|
eye is omitted only when the cluster declares no `cssVar` for that role.
|
|
441
500
|
|
|
442
|
-
## 0.1.0-next.1
|
|
501
|
+
## [0.1.0-next.1] - 2026-05-25
|
|
443
502
|
|
|
444
503
|
### Fixed — Astro consumers: `@takazudo/zdtp/astro` value import broke real npm installs ([#308](https://github.com/Takazudo/zudo-design-token-panel/issues/308))
|
|
445
504
|
|
|
@@ -465,7 +524,7 @@ First clean stable release on the `latest` dist-tag, promoting the
|
|
|
465
524
|
side-effect import is unchanged. Docs (README, PORTABLE-CONTRACT, doc-site
|
|
466
525
|
recipes) updated to the direct-subexport form.
|
|
467
526
|
|
|
468
|
-
## 0.1.0-next.0
|
|
527
|
+
## [0.1.0-next.0] - 2026-05-24
|
|
469
528
|
|
|
470
529
|
### Renamed — npm package is now `@takazudo/zdtp`
|
|
471
530
|
|
package/PORTABLE-CONTRACT.md
CHANGED
|
@@ -401,6 +401,15 @@ export interface PillSpec {
|
|
|
401
401
|
customDefault: string;
|
|
402
402
|
}
|
|
403
403
|
|
|
404
|
+
/** Mapping value for a semantic color token (legacy and ramp-native forms). */
|
|
405
|
+
export type SemanticValue =
|
|
406
|
+
| number
|
|
407
|
+
| 'bg'
|
|
408
|
+
| 'fg'
|
|
409
|
+
| { literal: string }
|
|
410
|
+
| { literal: { light: string; dark: string } }
|
|
411
|
+
| { ref: { tab?: string; tier: string; item: string } };
|
|
412
|
+
|
|
404
413
|
/** A single editable or reference token within a tier. */
|
|
405
414
|
export interface TierItem {
|
|
406
415
|
/** Stable id used as the key in persisted state (e.g. `hsp-2xs`). */
|
|
@@ -435,8 +444,26 @@ export interface TierConfig {
|
|
|
435
444
|
* pipeline emits `var(--target-cssvar)` for ref-tier items at apply time.
|
|
436
445
|
*/
|
|
437
446
|
referencesTier?: string;
|
|
447
|
+
/**
|
|
448
|
+
* Marks a Color-tab tier as semantic data whose items hold `SemanticValue`
|
|
449
|
+
* mappings rather than raw palette entries. It is never treated as the
|
|
450
|
+
* palette tier, so a Color tab may contain a lone semantic tier.
|
|
451
|
+
*/
|
|
452
|
+
semantic?: true;
|
|
453
|
+
/**
|
|
454
|
+
* Valid only when this semantic tier belongs to a tab whose id is exactly
|
|
455
|
+
* `color` or `color-secondary`; other owning tab ids are rejected at
|
|
456
|
+
* configure time. Declares one or more permitted same- or cross-tab ramp
|
|
457
|
+
* sources for per-row semantic `{ ref }` mappings. Each entry names a tier
|
|
458
|
+
* and optional tab (`tab` omitted means this tab); unlike `referencesTier`,
|
|
459
|
+
* this is a multi-source allow-list for individual semantic mappings.
|
|
460
|
+
*/
|
|
461
|
+
referencesRamps?: readonly { tab?: string; tier: string }[];
|
|
438
462
|
}
|
|
439
463
|
|
|
464
|
+
For the full `SemanticValue` mapping and emission behavior, see the maintained
|
|
465
|
+
[Color-cluster reference](https://zudo-design-token-panel.takazudomodular.com/docs/reference/color-cluster/).
|
|
466
|
+
|
|
440
467
|
/**
|
|
441
468
|
* Color-cluster extras — the non-tier fields required for the color tab.
|
|
442
469
|
* Palette and semantic data move into the tier model as TierItems; ColorClusterExtras
|
|
@@ -629,7 +656,9 @@ export interface ColorClusterExtras {
|
|
|
629
656
|
/**
|
|
630
657
|
* Optional light/dark pairing. When set to an object, the panel honours
|
|
631
658
|
* `document.documentElement[data-theme]` and switches schemes accordingly
|
|
632
|
-
* on init. Set to `false` to disable
|
|
659
|
+
* on init. Set to `false` to disable scheme-to-`data-theme` binding; this
|
|
660
|
+
* does not disable per-mode literal editing or emitted `light-dark(...)`
|
|
661
|
+
* values.
|
|
633
662
|
*/
|
|
634
663
|
colorMode: false | { defaultMode: 'light' | 'dark'; lightScheme: string; darkScheme: string };
|
|
635
664
|
};
|
|
@@ -1075,11 +1104,12 @@ window.zdtp.toggle = () => void | Promise<void>; // toggle the panel
|
|
|
1075
1104
|
always installs first ("first install wins" — see the next point). The
|
|
1076
1105
|
package-root install site is therefore reached only by non-Astro hosts.
|
|
1077
1106
|
- **Never clobbers a host-defined `window.zdtp`.** If `window.zdtp` already
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1107
|
+
exposes callable `show` / `hide` / `toggle` methods, the install is skipped
|
|
1108
|
+
silently — this supports hosts that pre-claim the alias before lazily loading
|
|
1109
|
+
the panel bundle. Other pre-existing values are also left untouched, but
|
|
1110
|
+
produce a `console.warn`. (This includes the edge case of a host that picks
|
|
1111
|
+
`consoleNamespace: 'zdtp'`: the namespace object installed at §6.4 does not
|
|
1112
|
+
expose the fixed-name alias shape, so the second install site warns and skips.)
|
|
1083
1113
|
- **Auto-remember carries over for free.** `zdtp.show()` routes through the
|
|
1084
1114
|
same `showDesignTokenPanel()` / `handle.open()` core as every other open
|
|
1085
1115
|
path, so it arms `${storagePrefix}:autoload = 'auto'` exactly like
|
package/README.md
CHANGED
|
@@ -112,8 +112,8 @@ pnpm exec zdtp-server --help
|
|
|
112
112
|
| Flag | Required | Purpose | Default |
|
|
113
113
|
|---|---|---|---|
|
|
114
114
|
| `--routing <path>` | yes | Path to the routing JSON file (cluster id → repo-relative CSS file path). Absolute, or relative to `--root`. See §3.2. | — |
|
|
115
|
-
| `--write-root <dir>` |
|
|
116
|
-
| `--root <dir>` | no |
|
|
115
|
+
| `--write-root <dir>` | yes | Required write boundary: the only directory tree the bin is allowed to write into. Absolute, or relative to `--root`. | — |
|
|
116
|
+
| `--root <dir>` | no | CWD/resolution base used to resolve `--routing` and `--write-root`. | `process.cwd()` |
|
|
117
117
|
| `--port <number>` | no | TCP port to bind. `0` asks the OS for an ephemeral port (the bin logs the assigned port on startup). | `24681` |
|
|
118
118
|
| `--host <addr>` | no | Bind address. Use `0.0.0.0` to expose on the LAN (off by default). | `127.0.0.1` |
|
|
119
119
|
| `--allow-origin <origin>` | repeatable | Origin allowed to POST to `/apply` (scheme + host + port, no trailing slash). At least one is required for any browser to apply. | none (all origins denied) |
|
|
@@ -170,7 +170,7 @@ For the full token-overrides payload schema and the `PanelConfig` shape, see §5
|
|
|
170
170
|
The bin is **dev-only** and is built with three independent guards:
|
|
171
171
|
|
|
172
172
|
- **Loopback default.** Binds to `127.0.0.1` so only requests from the same machine are accepted. Override with `--host` if you actually want LAN access.
|
|
173
|
-
- **Write sandbox (`--write-root`).** Every routing entry is resolved against `--root` and verified to sit strictly inside `--write-root` before any file I/O happens. An entry whose resolved path escapes the sandbox — via `..` segments or an absolute path that points elsewhere — fails the apply with a 400 and a descriptive error message. `--
|
|
173
|
+
- **Write sandbox (`--write-root`).** `--write-root` is required and defines the narrow directory tree the bin is allowed to write into. Every routing entry is resolved against `--root` and verified to sit strictly inside `--write-root` before any file I/O happens. An entry whose resolved path escapes the sandbox — via `..` segments or an absolute path that points elsewhere — fails the apply with a 400 and a descriptive error message. `--root` is the CWD/resolution base for relative `--routing` and `--write-root` paths and defaults to `process.cwd()`.
|
|
174
174
|
- **CORS allow-list.** By default, **all origins are denied**. To let a browser POST to `/apply` you must list its origin explicitly with `--allow-origin <url>` (repeatable). Without a matching `--allow-origin`, the OPTIONS preflight returns 403 and POST returns 403 — no `Access-Control-Allow-Origin` header is emitted. Origin matching is **verbatim** on the full scheme + host + port string: `http://localhost:5173` and `http://127.0.0.1:5173` are different origins.
|
|
175
175
|
|
|
176
176
|
**Atomic writes.** The bin serialises per-file writes through a small mutex and uses a write-temp-file-then-rename strategy, so a failure mid-write never leaves a half-rewritten CSS file on disk. If any file in a multi-file apply fails to write, every file that was already persisted is restored from the in-memory snapshot taken before the apply started.
|
|
@@ -1053,7 +1053,7 @@ zdtp.toggle(); // toggle open/closed
|
|
|
1053
1053
|
- **Available on both integration paths:**
|
|
1054
1054
|
- Non-Astro hosts get it as soon as `@takazudo/zdtp`'s package-root module has loaded (it installs the alias at module init).
|
|
1055
1055
|
- Astro hosts get it as soon as the host-adapter `<script>` has run — **before** the panel bundle itself has loaded. The first `zdtp.*` call lazy-imports the bundle, exactly like `window[consoleNamespace].*`.
|
|
1056
|
-
- **Never clobbers a host-defined `window.zdtp`.** If
|
|
1056
|
+
- **Never clobbers a host-defined `window.zdtp`.** If the existing value exposes callable `show`, `hide`, and `toggle` methods, the package treats it as an intentional host alias and stays silent — enabling hosts to pre-claim the alias before lazily loading the panel bundle. Other existing values are still left untouched and produce a `console.warn`, including the edge case of choosing `consoleNamespace: 'zdtp'` yourself.
|
|
1057
1057
|
- **Auto-remember applies too** — `zdtp.show()` arms the `:autoload` flag with `'auto'` provenance exactly like `showDesignPanel()` (§10.1's Auto-remember footgun note applies here as well).
|
|
1058
1058
|
|
|
1059
1059
|
See `PORTABLE-CONTRACT.md` §6.5 for the full install-site and no-clobber/no-double-install contract.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as y, g as m, a as w, b, i as P } from "../panel-config-
|
|
2
|
-
import { g, Z as k } from "../tweak-state-
|
|
3
|
-
import { s as A, l as D, a as E, i as c, r as f, c as _, b as I, d } from "../autoload-state-
|
|
1
|
+
import { c as y, g as m, a as w, b, i as P } from "../panel-config-SgA84Uqe.js";
|
|
2
|
+
import { g, Z as k } from "../tweak-state-DGLrzIwq.js";
|
|
3
|
+
import { s as A, l as D, a as E, i as c, r as f, c as _, b as I, d } from "../autoload-state-IlkEci88.js";
|
|
4
4
|
const u = "tokenpanel-config";
|
|
5
5
|
function S() {
|
|
6
6
|
if (typeof document > "u")
|
package/dist/astro/index.js
CHANGED
|
@@ -35,8 +35,19 @@ import { type Oklcha } from '../../utils/color-oklch';
|
|
|
35
35
|
export type { Oklcha } from '../../utils/color-oklch';
|
|
36
36
|
export type { Channel } from '../../utils/palette-curve';
|
|
37
37
|
export interface PaletteChartProps {
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Dense palette slots in OKLCH space. A null slot preserves its index/band,
|
|
40
|
+
* but has no numeric curve node and is not editable.
|
|
41
|
+
*/
|
|
42
|
+
colors: Array<Oklcha | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Dense per-index write permission, separate from color validity. A valid
|
|
45
|
+
* readonly color remains painted in the bands/curves, but receives no node
|
|
46
|
+
* hit target and is excluded from whole-curve editing.
|
|
47
|
+
*/
|
|
48
|
+
editable: boolean[];
|
|
49
|
+
/** Dense stable item identities used to invalidate stale index-based gestures. */
|
|
50
|
+
identities: string[];
|
|
40
51
|
/** Index of the currently selected color/step (highlighted band + node column). */
|
|
41
52
|
selectedIndex: number;
|
|
42
53
|
/** Which curves are drawn. Owned by the parent; chart only consumes. */
|
|
@@ -64,7 +75,7 @@ export interface PaletteChartProps {
|
|
|
64
75
|
*/
|
|
65
76
|
onChangeEnd?: () => void;
|
|
66
77
|
}
|
|
67
|
-
declare function PaletteChartImpl({ colors, selectedIndex, visibleChannels, onChange, onSelectIndex, onChangeStart, onChangeEnd, }: PaletteChartProps): JSX.Element;
|
|
78
|
+
declare function PaletteChartImpl({ colors, editable, identities, selectedIndex, visibleChannels, onChange, onSelectIndex, onChangeStart, onChangeEnd, }: PaletteChartProps): JSX.Element;
|
|
68
79
|
/**
|
|
69
80
|
* Memoized so parent re-renders that don't change props don't re-walk every
|
|
70
81
|
* band/curve/node. The drag state lives in refs, so a controlled-value update
|
|
@@ -532,31 +532,6 @@ export interface ZdtpGlobalApi {
|
|
|
532
532
|
hide: () => void | Promise<void>;
|
|
533
533
|
toggle: () => void | Promise<void>;
|
|
534
534
|
}
|
|
535
|
-
/**
|
|
536
|
-
* Install `window.zdtp = { show, hide, toggle }`, the fixed-name console
|
|
537
|
-
* sugar for the common single-panel case (issue #523).
|
|
538
|
-
*
|
|
539
|
-
* Guard rules:
|
|
540
|
-
* - A pre-existing `window.zdtp` WITHOUT this package's marker is assumed to
|
|
541
|
-
* be host-defined — never overwritten. Logs a `console.warn` so the host
|
|
542
|
-
* can see why `zdtp.show()` did not appear.
|
|
543
|
-
* - A pre-existing `window.zdtp` WITH the marker means this package already
|
|
544
|
-
* installed the alias (from the other call site, or an earlier run of this
|
|
545
|
-
* same one). First install wins — the call is a silent no-op. In the Astro
|
|
546
|
-
* flow this manifests as "the adapter wins": its bootstrap script always
|
|
547
|
-
* runs (and installs the alias) before the panel module's lazy dynamic
|
|
548
|
-
* import can resolve and reach the package-root install site.
|
|
549
|
-
*
|
|
550
|
-
* `show` / `hide` / `toggle` are caller-supplied closures, so which instance
|
|
551
|
-
* they target is up to the caller — the package-root install site (below,
|
|
552
|
-
* `index.tsx`) wraps `showDesignTokenPanel()` etc., which re-resolve
|
|
553
|
-
* `getPanelConfig()` (the CURRENT default instance) on every call; the Astro
|
|
554
|
-
* host-adapter install site instead binds to the specific `PanelInstanceHandle`
|
|
555
|
-
* captured at its own install time, which does NOT track a later change of
|
|
556
|
-
* default (see PORTABLE-CONTRACT.md §6.5 for the full nuance). Either way,
|
|
557
|
-
* for a multi-instance page use `configurePanel(cfg).open()` etc. on the
|
|
558
|
-
* specific instance's own handle instead of relying on this alias.
|
|
559
|
-
*/
|
|
560
535
|
export declare function installZdtpGlobalAlias(api: ZdtpGlobalApi): void;
|
|
561
536
|
/**
|
|
562
537
|
* Runtime validation at the host-adapter trust boundary. The Astro inline
|