@takazudo/zdtp 0.4.2 → 0.4.4

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.
Files changed (173) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +20 -15
  3. package/dist/apply/apply-token-overrides.d.ts +0 -1
  4. package/dist/apply/build-apply-overrides.d.ts +20 -5
  5. package/dist/apply/route-tokens-to-files.d.ts +0 -1
  6. package/dist/apply/tier-resolver.d.ts +28 -1
  7. package/dist/apply-modal.d.ts +0 -1
  8. package/dist/astro/DesignTokenPanelHost.astro +2 -4
  9. package/dist/astro/host-adapter.d.ts +0 -1
  10. package/dist/astro/host-adapter.js +16 -16
  11. package/dist/astro/index.d.ts +0 -1
  12. package/dist/astro/index.js +1 -1
  13. package/dist/{autoload-state-DsvvPDih.js → autoload-state-CmhI7q9j.js} +1 -1
  14. package/dist/bin/cors.d.ts +0 -1
  15. package/dist/bin/parse-args.d.ts +0 -1
  16. package/dist/bin/server.d.ts +0 -1
  17. package/dist/bin/server.js +1 -1
  18. package/dist/components/color-picker/color-field.d.ts +0 -1
  19. package/dist/components/color-picker/color-picker.d.ts +12 -3
  20. package/dist/components/color-picker/custom-slider.d.ts +0 -1
  21. package/dist/components/color-picker/index.d.ts +0 -1
  22. package/dist/components/palette-chart/index.d.ts +0 -1
  23. package/dist/components/palette-chart/palette-chart.d.ts +0 -1
  24. package/dist/config/cluster-config.d.ts +36 -14
  25. package/dist/config/color-scheme-utils.d.ts +0 -1
  26. package/dist/config/color-schemes.d.ts +0 -1
  27. package/dist/config/panel-config.d.ts +11 -1
  28. package/dist/controls/dismiss-layer.d.ts +55 -0
  29. package/dist/controls/pill-slider-row.d.ts +0 -1
  30. package/dist/controls/role-button.d.ts +0 -1
  31. package/dist/controls/sanitize-css-value.d.ts +0 -1
  32. package/dist/controls/select-row.d.ts +0 -1
  33. package/dist/controls/slider-row.d.ts +0 -1
  34. package/dist/controls/text-row.d.ts +0 -1
  35. package/dist/controls/tier-ref-selector.d.ts +65 -22
  36. package/dist/controls/token-label.d.ts +0 -1
  37. package/dist/controls/tooltip.d.ts +0 -1
  38. package/dist/controls/use-dialog-backdrop-close.d.ts +32 -0
  39. package/dist/element-path/build-element-path.d.ts +0 -1
  40. package/dist/element-path/element-path-context.d.ts +0 -1
  41. package/dist/element-path/element-path-orchestrator.d.ts +0 -1
  42. package/dist/element-path/element-path-state.d.ts +0 -1
  43. package/dist/element-path/element-path-toast.d.ts +0 -1
  44. package/dist/element-path/element-path-toggle-button.d.ts +0 -1
  45. package/dist/element-path/index.d.ts +0 -1
  46. package/dist/element-path/inspector-overlay.d.ts +0 -1
  47. package/dist/export-modal.d.ts +0 -1
  48. package/dist/highlight/find-elements.d.ts +0 -1
  49. package/dist/highlight/highlight-orchestrator.d.ts +0 -1
  50. package/dist/highlight/highlight-overlay.d.ts +0 -1
  51. package/dist/highlight/highlight-settings-popover.d.ts +0 -1
  52. package/dist/highlight/highlight-state.d.ts +0 -1
  53. package/dist/highlight/highlight-toggle-button.d.ts +0 -1
  54. package/dist/import-modal.d.ts +0 -1
  55. package/dist/index.d.ts +1 -1
  56. package/dist/index.js +3432 -2717
  57. package/dist/{load-routing-XyKgftpe.js → load-routing-DtNTKoLW.js} +1 -1
  58. package/dist/panel-config-CXTCcYQs.js +824 -0
  59. package/dist/panel.d.ts +0 -1
  60. package/dist/server/create-apply-handler.d.ts +0 -1
  61. package/dist/server/index.d.ts +0 -1
  62. package/dist/server/index.js +1 -1
  63. package/dist/server/load-routing.d.ts +0 -1
  64. package/dist/server/path-safety.d.ts +0 -1
  65. package/dist/server/serialize-write.d.ts +0 -1
  66. package/dist/state/autoload-state.d.ts +0 -1
  67. package/dist/state/persist.d.ts +7 -3
  68. package/dist/state/tweak-state.d.ts +146 -10
  69. package/dist/styles/z-index-tokens.d.ts +35 -0
  70. package/dist/tabs/_generic-item-editor.d.ts +0 -1
  71. package/dist/tabs/color-tab.d.ts +13 -2
  72. package/dist/tabs/font-tab.d.ts +0 -1
  73. package/dist/tabs/generic-tab.d.ts +4 -3
  74. package/dist/tabs/palette/palette-check-view.d.ts +0 -1
  75. package/dist/tabs/palette/palette-edit-view.d.ts +0 -1
  76. package/dist/tabs/palette/palette-readout.d.ts +0 -1
  77. package/dist/tabs/palette/palette-tab.d.ts +0 -1
  78. package/dist/tabs/size-tab.d.ts +0 -1
  79. package/dist/tabs/spacing-tab.d.ts +0 -1
  80. package/dist/testing.d.ts +0 -1
  81. package/dist/testing.js +2 -2
  82. package/dist/tokens/manifest.d.ts +0 -1
  83. package/dist/tokens/tier-model.d.ts +50 -1
  84. package/dist/{tweak-state-DzZVbY25.js → tweak-state-BeXkzoj8.js} +662 -583
  85. package/dist/utils/color-convert.d.ts +0 -1
  86. package/dist/utils/color-hsla.d.ts +0 -1
  87. package/dist/utils/color-oklch.d.ts +0 -1
  88. package/dist/utils/copy-to-clipboard.d.ts +0 -1
  89. package/dist/utils/design-token-serde.d.ts +78 -11
  90. package/dist/utils/palette-curve.d.ts +0 -1
  91. package/dist/utils/structural-equal.d.ts +0 -1
  92. package/dist/utils/use-portal-mount.d.ts +0 -1
  93. package/dist/utils/wcag-contrast.d.ts +0 -1
  94. package/dist/zdtp.css +1 -1
  95. package/package.json +24 -11
  96. package/dist/apply/apply-token-overrides.d.ts.map +0 -1
  97. package/dist/apply/build-apply-overrides.d.ts.map +0 -1
  98. package/dist/apply/route-tokens-to-files.d.ts.map +0 -1
  99. package/dist/apply/tier-resolver.d.ts.map +0 -1
  100. package/dist/apply-modal.d.ts.map +0 -1
  101. package/dist/astro/host-adapter.d.ts.map +0 -1
  102. package/dist/astro/index.d.ts.map +0 -1
  103. package/dist/bin/cors.d.ts.map +0 -1
  104. package/dist/bin/parse-args.d.ts.map +0 -1
  105. package/dist/bin/server.d.ts.map +0 -1
  106. package/dist/components/color-picker/color-field.d.ts.map +0 -1
  107. package/dist/components/color-picker/color-picker.d.ts.map +0 -1
  108. package/dist/components/color-picker/custom-slider.d.ts.map +0 -1
  109. package/dist/components/color-picker/index.d.ts.map +0 -1
  110. package/dist/components/palette-chart/index.d.ts.map +0 -1
  111. package/dist/components/palette-chart/palette-chart.d.ts.map +0 -1
  112. package/dist/config/cluster-config.d.ts.map +0 -1
  113. package/dist/config/color-scheme-utils.d.ts.map +0 -1
  114. package/dist/config/color-schemes.d.ts.map +0 -1
  115. package/dist/config/panel-config.d.ts.map +0 -1
  116. package/dist/controls/pill-slider-row.d.ts.map +0 -1
  117. package/dist/controls/role-button.d.ts.map +0 -1
  118. package/dist/controls/sanitize-css-value.d.ts.map +0 -1
  119. package/dist/controls/select-row.d.ts.map +0 -1
  120. package/dist/controls/slider-row.d.ts.map +0 -1
  121. package/dist/controls/text-row.d.ts.map +0 -1
  122. package/dist/controls/tier-ref-selector.d.ts.map +0 -1
  123. package/dist/controls/token-label.d.ts.map +0 -1
  124. package/dist/controls/tooltip.d.ts.map +0 -1
  125. package/dist/element-path/build-element-path.d.ts.map +0 -1
  126. package/dist/element-path/element-path-context.d.ts.map +0 -1
  127. package/dist/element-path/element-path-orchestrator.d.ts.map +0 -1
  128. package/dist/element-path/element-path-state.d.ts.map +0 -1
  129. package/dist/element-path/element-path-toast.d.ts.map +0 -1
  130. package/dist/element-path/element-path-toggle-button.d.ts.map +0 -1
  131. package/dist/element-path/index.d.ts.map +0 -1
  132. package/dist/element-path/inspector-overlay.d.ts.map +0 -1
  133. package/dist/export-modal.d.ts.map +0 -1
  134. package/dist/highlight/find-elements.d.ts.map +0 -1
  135. package/dist/highlight/highlight-orchestrator.d.ts.map +0 -1
  136. package/dist/highlight/highlight-overlay.d.ts.map +0 -1
  137. package/dist/highlight/highlight-settings-popover.d.ts.map +0 -1
  138. package/dist/highlight/highlight-state.d.ts.map +0 -1
  139. package/dist/highlight/highlight-toggle-button.d.ts.map +0 -1
  140. package/dist/import-modal.d.ts.map +0 -1
  141. package/dist/index.d.ts.map +0 -1
  142. package/dist/panel-config-DyVRQ2n1.js +0 -415
  143. package/dist/panel.d.ts.map +0 -1
  144. package/dist/server/create-apply-handler.d.ts.map +0 -1
  145. package/dist/server/index.d.ts.map +0 -1
  146. package/dist/server/load-routing.d.ts.map +0 -1
  147. package/dist/server/path-safety.d.ts.map +0 -1
  148. package/dist/server/serialize-write.d.ts.map +0 -1
  149. package/dist/state/autoload-state.d.ts.map +0 -1
  150. package/dist/state/persist.d.ts.map +0 -1
  151. package/dist/state/tweak-state.d.ts.map +0 -1
  152. package/dist/tabs/_generic-item-editor.d.ts.map +0 -1
  153. package/dist/tabs/color-tab.d.ts.map +0 -1
  154. package/dist/tabs/font-tab.d.ts.map +0 -1
  155. package/dist/tabs/generic-tab.d.ts.map +0 -1
  156. package/dist/tabs/palette/palette-check-view.d.ts.map +0 -1
  157. package/dist/tabs/palette/palette-edit-view.d.ts.map +0 -1
  158. package/dist/tabs/palette/palette-readout.d.ts.map +0 -1
  159. package/dist/tabs/palette/palette-tab.d.ts.map +0 -1
  160. package/dist/tabs/size-tab.d.ts.map +0 -1
  161. package/dist/tabs/spacing-tab.d.ts.map +0 -1
  162. package/dist/testing.d.ts.map +0 -1
  163. package/dist/tokens/manifest.d.ts.map +0 -1
  164. package/dist/tokens/tier-model.d.ts.map +0 -1
  165. package/dist/utils/color-convert.d.ts.map +0 -1
  166. package/dist/utils/color-hsla.d.ts.map +0 -1
  167. package/dist/utils/color-oklch.d.ts.map +0 -1
  168. package/dist/utils/copy-to-clipboard.d.ts.map +0 -1
  169. package/dist/utils/design-token-serde.d.ts.map +0 -1
  170. package/dist/utils/palette-curve.d.ts.map +0 -1
  171. package/dist/utils/structural-equal.d.ts.map +0 -1
  172. package/dist/utils/use-portal-mount.d.ts.map +0 -1
  173. package/dist/utils/wcag-contrast.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,83 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.4
4
+
5
+ ### Features
6
+
7
+ - **Ramp-native Tier-2 color editor.** The Color tab gained a semantic-value tier model — a `semantic: true` tier holds `SemanticValue` mappings (palette index, literal OKLCH, per-mode `light-dark()` literal, or a cross-tab ramp `{ ref }`) instead of raw palette entries, and can ship as a lone semantic tier with no palette tier at all ([#459](https://github.com/Takazudo/zudo-design-token-panel/issues/459), closes [#458](https://github.com/Takazudo/zudo-design-token-panel/issues/458)) ([8ed93e1](https://github.com/Takazudo/zudo-design-token-panel/pull/476))
8
+ - Add semantic-tier marker + `SemanticValue` union (S1) ([#460](https://github.com/Takazudo/zudo-design-token-panel/pull/460)) (d7aa526)
9
+ - serde `SCHEMA_V3` object leaves for `SemanticValue` variants (S5) ([#462](https://github.com/Takazudo/zudo-design-token-panel/pull/462)) (0185477)
10
+ - Render literal semantic rows as editable OKLCH swatches (S3) ([#464](https://github.com/Takazudo/zudo-design-token-panel/pull/464)) (d8bceb3)
11
+ - Emit literal semantic values verbatim in both emitters (S4) ([#465](https://github.com/Takazudo/zudo-design-token-panel/pull/465)) (5961ed7)
12
+ - Cross-tab ref resolution + tabs-array cluster-bridge signature (S7a) ([#467](https://github.com/Takazudo/zudo-design-token-panel/pull/467)) (35ef368)
13
+ - Emit cross-tab semantic refs as `var(--target)` in both emitters (S7b) ([#468](https://github.com/Takazudo/zudo-design-token-panel/pull/468)) (ea2aa8a)
14
+ - Validate cross-tab ramp-source declarations (S8) ([#469](https://github.com/Takazudo/zudo-design-token-panel/pull/469)) (8558269)
15
+ - Grouped ref-or-literal picker + wire color-tab semantic rows (S9) ([#470](https://github.com/Takazudo/zudo-design-token-panel/pull/470)) (3d5e5f7)
16
+ - Per-mode literal `light-dark()` emission + `defaultMode` runtime (S11) ([#472](https://github.com/Takazudo/zudo-design-token-panel/pull/472)) (3a05623)
17
+ - Per-mode light/dark literal editor UI (S12) ([#473](https://github.com/Takazudo/zudo-design-token-panel/pull/473)) (1828458)
18
+
19
+ ### Fixed
20
+
21
+ - Seed Scheme preset load against the instance cluster, not the global default ([#491](https://github.com/Takazudo/zudo-design-token-panel/issues/491) audit) (a1b0dd8)
22
+ - Thread `instanceConfig` into `ColorTab` for multi-instance ref resolution ([#491](https://github.com/Takazudo/zudo-design-token-panel/issues/491)) (66447ec)
23
+ - Validate semantic marker shape + mixed-order palette-pick regression tests ([#487](https://github.com/Takazudo/zudo-design-token-panel/pull/487)) (0ebcc6e)
24
+ - Scheme/preset load is a no-op for a palette-less color cluster ([#488](https://github.com/Takazudo/zudo-design-token-panel/pull/488)) (23d61ba)
25
+ - Color-scheme lifecycle asymmetries in the applied-state ([#482](https://github.com/Takazudo/zudo-design-token-panel/pull/482)) (ef686fc)
26
+ - serde robustness — order-independent ref diff, stale-ref warning, integer index leaves (c0b4356)
27
+ - Restore legacy index-0 fallback + detect named-color literals ([#483](https://github.com/Takazudo/zudo-design-token-panel/pull/483)) (4f66b7d)
28
+ - Show a disabled unresolved placeholder for a dangling `TierRefSelector` ref ([#484](https://github.com/Takazudo/zudo-design-token-panel/issues/484)) (a4c222b)
29
+ - Thread owning color tab into `buildApplyOverrides` for secondary-cluster refs (D1) ([#481](https://github.com/Takazudo/zudo-design-token-panel/pull/481)) (60cbb7a)
30
+ - Skip an unresolvable semantic `{ ref }` in the DOM emitter too (87131ee)
31
+ - Drop phantom grayscale swatch for palette-less semantic tier ([#466](https://github.com/Takazudo/zudo-design-token-panel/pull/466) follow-up) (c955616)
32
+ - Derive semantic maps for a palette-less semantic tier (S2b) ([#463](https://github.com/Takazudo/zudo-design-token-panel/pull/463)) (7d617d1)
33
+ - Honor semantic-tier marker in palette detection + F4 (S2a) ([#461](https://github.com/Takazudo/zudo-design-token-panel/pull/461)) (ecb4482)
34
+
35
+ ### Other Changes
36
+
37
+ - Eliminate intermittent vitest unhandled-error flake ([#494](https://github.com/Takazudo/zudo-design-token-panel/issues/494)) (ab60f91)
38
+ - e2e confirm per-mode literal `light-dark()` + clear color-scheme on reset (S13) ([#474](https://github.com/Takazudo/zudo-design-token-panel/pull/474)) (a215c88)
39
+ - e2e confirm cross-tab semantic ref cascade (S10) ([#471](https://github.com/Takazudo/zudo-design-token-panel/pull/471)) (235bb30)
40
+ - e2e confirm lone literal semantic tier unblocks [#458](https://github.com/Takazudo/zudo-design-token-panel/issues/458) (S6) ([#466](https://github.com/Takazudo/zudo-design-token-panel/pull/466)) (8fb5136)
41
+ - docs: translate token-manifest reference page to Japanese ([#490](https://github.com/Takazudo/zudo-design-token-panel/issues/490), [#478](https://github.com/Takazudo/zudo-design-token-panel/issues/478)) (7bcd835)
42
+ - docs: translate color-cluster reference to Japanese ([#489](https://github.com/Takazudo/zudo-design-token-panel/issues/489), [#478](https://github.com/Takazudo/zudo-design-token-panel/issues/478)) (e033410)
43
+ - docs: fix EN documentation drift from [#459](https://github.com/Takazudo/zudo-design-token-panel/issues/459) (referencesRamps, bridge signature, color-scheme caveat) (a7d8709)
44
+ - docs: document ramp-native Tier-2 editor + example manifest + cascade test (S14) ([#475](https://github.com/Takazudo/zudo-design-token-panel/pull/475)) (136bcf6)
45
+ - docs: fix broken `SemanticValue` heading anchor (drop em-dash from slug) (ef3cd91)
46
+ - chore(deps): bump `@takazudo/zudo-doc` and `zudo-doc-history-server` to `^2.5.1` (d6c05dd)
47
+ - chore(doc): sync generated `claude/index.mdx` with build output (d763238)
48
+
49
+ ## 0.4.3
50
+
51
+ ### Features
52
+
53
+ - **Dismiss-layer arbitration for layered surfaces.** A shared dismiss-layer stack routes Escape to only the topmost open layer (nested popover → popover → panel), and all three modals gained gesture-aware backdrop dismissal (press+release must both land outside), fixing one-Escape-closes-everything, trigger-click reopen races, and text-selection drags closing modals ([#446](https://github.com/Takazudo/zudo-design-token-panel/issues/446)) (9119c7e, 8257b19)
54
+ - **CSS isolation architecture.** Panel z-indexes are now a semantic token scale shared by CSS and TSX (shell renders above common host chrome), a `box-sizing` reset is scoped to the panel subtree, panel geometry moved from rem to px so host root font-size cannot warp the panel, and `color-scheme` is declared on panel surfaces ([#448](https://github.com/Takazudo/zudo-design-token-panel/issues/448)) (62f8e4c)
55
+ - **Visual-regression test tier.** 8 Playwright baselines (palette chart, color-picker swatch + popover, panel chrome — light + dark) with a documented `test:vrt:update` flow, wired into CI ([#454](https://github.com/Takazudo/zudo-design-token-panel/issues/454)) (5241e02)
56
+ - **Real lint + doc-link gates.** oxlint wired for the panel and linkinator + html-validate for the doc site — the CI Lint step is no longer a no-op ([#443](https://github.com/Takazudo/zudo-design-token-panel/issues/443)) (4812160)
57
+
58
+ ### Fixed
59
+
60
+ - `configurePanel` re-runs no longer throw when combined with `setPanelColorPresets` (Astro view-transitions + lazy color presets recipe); sink instances seed from `panelSettings.colorScheme` instead of the host `data-theme`; palette cssVar templates and `colorExtras` are validated at configure time ([#440](https://github.com/Takazudo/zudo-design-token-panel/issues/440)) (afe8a36, 87df039, 4d5e611)
61
+ - `applyTokenOverrides` no longer rewrites the wrong declaration when one custom-property name is a suffix of another — `zdtp-server` could corrupt CSS files on disk ([#441](https://github.com/Takazudo/zudo-design-token-panel/issues/441)) (3be6865)
62
+ - Highlight subsystem: match cache is evicted on stylesheet changes (stale detached elements no longer stay highlighted), percentage values are classified as lengths, and a highlight probe runs one full-DOM walk instead of three ([#442](https://github.com/Takazudo/zudo-design-token-panel/issues/442)) (fc07e41)
63
+ - PaletteSelector listbox is fully keyboard-operable; ApplyModal's `onApplied` cleanup contract now holds on every dismissal route ([#446](https://github.com/Takazudo/zudo-design-token-panel/issues/446)) (8257b19)
64
+ - State persistence: changing a palette's size no longer discards spacing/typography/size/tab overrides; restored positions are viewport-clamped and finite; fresh-mount toggle intent; window-resize handling debounced; imported palette values pass the seed-time sanitizer; dead `panelPosition` path removed ([#447](https://github.com/Takazudo/zudo-design-token-panel/issues/447)) (8f67382)
65
+ - Astro soft navigation unmounts/remounts **all** registered panel instances (was: default only — other instances leaked listeners per navigation and vanished until re-toggled), and persisted overrides are reapplied for every instance, including hidden ones ([#449](https://github.com/Takazudo/zudo-design-token-panel/issues/449), [#457](https://github.com/Takazudo/zudo-design-token-panel/issues/457)) (908d6df, 8ce3d8b)
66
+ - CSS accessibility: `:focus-visible` styles for every native form control (host `outline: none` resets can no longer hide focus), raw color literals replaced by `--tokentweak-*` tokens, 24×24 minimum hit areas, `prefers-reduced-motion` support ([#450](https://github.com/Takazudo/zudo-design-token-panel/issues/450)) (fa36675)
67
+ - The panel's SVG defensive reset now survives a hostile `svg { fill: red !important }` host rule ([#452](https://github.com/Takazudo/zudo-design-token-panel/issues/452)) (6ac7129)
68
+ - Packaging: exports map gained `default` conditions and a `./package.json` export, broken declaration maps are no longer shipped, and a post-build check fails the build if any exports entry does not resolve against `dist/` ([#444](https://github.com/Takazudo/zudo-design-token-panel/issues/444)) (13862a4)
69
+ - `release.yml` `dry_run` builds the package again, as its description advertises (8ce3d8b)
70
+
71
+ ### Other Changes
72
+
73
+ - Docs now describe the real stylesheet mechanism — the panel self-injects its CSS via an inline import; no consumer CSS import is required — and stale pre-rename `packages/zudo-design-token-panel/` paths are purged ([#445](https://github.com/Takazudo/zudo-design-token-panel/issues/445)) (54756a2)
74
+ - CI overhaul: PR branch filters cover live `base/**` branches, tests gate main pushes and `v*` release tags, Playwright browsers are cached, duplicate builds removed, concurrency cancellation + job timeouts everywhere ([#443](https://github.com/Takazudo/zudo-design-token-panel/issues/443)) (dbf5704)
75
+ - New automated hostile-host isolation gate (Level 5): the panel's computed styles and viewport-fixed positioning are asserted inside a hostile host page, including a transform-ancestor scenario ([#452](https://github.com/Takazudo/zudo-design-token-panel/issues/452)) (6ac7129)
76
+ - 17 browser-mode gesture tests for panel drag-to-move / resize incl. viewport clamping and persistence ([#453](https://github.com/Takazudo/zudo-design-token-panel/issues/453)) (a4b25af)
77
+ - Test-suite hygiene: the DOM-policy static gate covers every panel TSX file and the full blocked-tag list, the palette drag browser test asserts for real, shared effect-flush helper, and a `test:unit` script runs the non-browser projects without Chromium ([#451](https://github.com/Takazudo/zudo-design-token-panel/issues/451)) (ebe0018, 8a7ee63, 4682139, 9b6c989)
78
+ - Browser test files now run serially — parallel files share one origin and raced each other's localStorage (fd37774)
79
+ - Deps: bump @takazudo/* toolchain (zfb next.76, zudo-doc 2.5.0) (62b62f6)
80
+
3
81
  ## 0.4.2
4
82
 
5
83
  ### Features
package/README.md CHANGED
@@ -292,7 +292,8 @@ The `<DesignTokenPanelHost>` component AND a paired `<script>` block that loads
292
292
  import { ClientRouter } from 'astro:transitions';
293
293
  import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
294
294
  import { myPanelConfig } from '../lib/my-panel-config';
295
- import '@takazudo/zdtp/styles';
295
+ // No CSS import needed — the panel self-injects its stylesheet on first mount.
296
+ // import '@takazudo/zdtp/styles'; // optional: pull CSS into your own pipeline
296
297
  ---
297
298
 
298
299
  <!doctype html>
@@ -325,18 +326,20 @@ window.myapp.toggleDesignPanel();
325
326
 
326
327
  Or wire a hidden keyboard shortcut / dev-only button to call the same helper.
327
328
 
328
- ### 4.1.4 Bundled CSS
329
+ ### 4.1.4 Stylesheet (self-injected — no consumer import required)
330
+
331
+ The panel injects its own stylesheet at runtime. When the panel first mounts, `ensurePanelStyles()` (called from `ensureMounted()` in `src/index.tsx`) appends a `<style>` element to `document.head` carrying the bundled CSS. The CSS is embedded in the JS bundle as a string via a `?inline` import, so it survives Vite library mode's build step and reaches the browser without any consumer-side stylesheet import.
332
+
333
+ **You do not need to import `@takazudo/zdtp/styles`** — the panel is visually self-contained out of the box.
329
334
 
330
- The package builds in Vite library mode, which extracts every CSS side-effect import from the source into a single emitted stylesheet at `dist/design-token-panel.css` and **strips the `import './styles/panel.css'` line from the emitted JS**. That means the consumer's bundler has no static reference to follow and the CSS will not arrive on its own — you MUST import the bundled stylesheet exactly once from somewhere on the consumer's static module graph (typically next to where you mount `<DesignTokenPanelHost>`):
335
+ The `./styles` (alias `./styles.css`) sub-export still resolves to `./dist/zdtp.css` and remains available if you prefer to pull the CSS into your own stylesheet pipeline (e.g. for SSR hydration, PostCSS processing, or bundler-level deduplication). This import is now optional:
331
336
 
332
337
  ```ts
333
- // Astro frontmatter, Vite entry, anywhere on the static import chain
338
+ // Optional — pull CSS into your own pipeline if needed
334
339
  import '@takazudo/zdtp/styles';
335
340
  ```
336
341
 
337
- The `./styles` (alias `./styles.css`) sub-export resolves to `./dist/design-token-panel.css` — the single combined chrome + tokens file Vite emits at build time. `package.json` still declares `sideEffects: ["**/*.css"]` so production bundlers don't tree-shake the import away.
338
-
339
- If you skip this line, the panel's JS will still run, `window.<ns>.showDesignPanel()` will mount `#…-design-token-panel-root`, and the shell DOM will render — but with no chrome rules applied (transparent background, default page font), so it appears invisible. See §13 for further notes on bundler behaviour.
342
+ If the panel looks unstyled after mounting, the most likely cause is that the panel module itself failed to load (network error, bundler misconfiguration, missing `preact` peer). The stylesheet is self-injected by the same JS that mounts the panel — if the JS ran, the CSS is present. See §12 for further notes on bundler behaviour.
340
343
 
341
344
  ### 4.1.5 Why the host-adapter import lives in your wrapper
342
345
 
@@ -1033,23 +1036,25 @@ The CSS variables the panel **writes to** (the `cssVar` field on each `TokenDef`
1033
1036
 
1034
1037
  ## 12. Bundler notes
1035
1038
 
1036
- The package builds in **Vite library mode**, which has a quirk that's important to understand: it extracts every `import './something.css'` from the source and emits a single combined stylesheet (`dist/design-token-panel.css`), but **removes the import statements from the emitted JS files**. The `dist/index.js` and `dist/astro/host-adapter.js` therefore have no static reference back to the CSS — `sideEffects: ["**/*.css"]` in `package.json` only protects existing imports from tree-shaking; it cannot resurrect an import the build step has already deleted.
1037
-
1038
- Net effect: the consumer MUST add a one-line side-effect import to their static module graph, as described in §3.4. The `./styles` sub-export is the canonical entry:
1039
+ The package builds in **Vite library mode**. Normally, Vite library mode extracts every `import './something.css'` from the source and emits a combined stylesheet (`dist/zdtp.css`), removing the import statements from the emitted JS files. This package works around that limitation via a `?inline` import:
1039
1040
 
1040
1041
  ```ts
1041
- import '@takazudo/zdtp/styles';
1042
+ // src/index.tsx (shipped in dist/index.js)
1043
+ import panelCss from './styles/panel.css?inline'; // string — survives Vite library build
1042
1044
  ```
1043
1045
 
1044
- `./styles.css` is provided as an alias for clarity in tooling that prefers explicit extensions:
1046
+ The `?inline` import is NOT stripped by Vite library mode — it emits the CSS as a JavaScript string constant inside `dist/index.js`. When `ensureMounted()` is called, `ensurePanelStyles()` uses that string to append a `<style>` element to `document.head`. **The panel is therefore visually self-contained: consumers do not need to import the stylesheet.**
1047
+
1048
+ The `./styles` sub-export (`dist/zdtp.css`) is still emitted alongside the JS bundle (via a retained side-effect import in `src/index.tsx`). It remains available for consumers who prefer to pull the CSS into their own pipeline (SSR hydration, PostCSS, bundler deduplication):
1045
1049
 
1046
1050
  ```ts
1051
+ // Optional — only needed if you want the CSS in your own pipeline
1052
+ import '@takazudo/zdtp/styles';
1053
+ // Alias with explicit extension:
1047
1054
  import '@takazudo/zdtp/styles.css';
1048
1055
  ```
1049
1056
 
1050
- If you forget the import, the JS layer still works — `window.<ns>.showDesignPanel()` mounts the shell DOM correctly — but every chrome rule is missing, so the panel appears invisible against the host page background. The fix is the import, not bundler reconfiguration.
1051
-
1052
- (Historical note: an earlier draft of this section claimed `sideEffects` alone was sufficient and consumers did not need to import CSS. That was incorrect — Vite library mode's CSS-extraction behaviour means `sideEffects` is necessary but not sufficient. The §3.4 + this section now reflect the actual contract.)
1057
+ If the panel appears unstyled, the JS module itself failed to load — the stylesheet is self-injected by the same code that mounts the panel. Adding a styles import will not fix a module-load failure.
1053
1058
 
1054
1059
  ### 12.1 Host-adapter side-effect import (paired-unit contract)
1055
1060
 
@@ -78,4 +78,3 @@ export declare function applyTokenOverridesOrThrow(source: string, overrides: Re
78
78
  * source contains at least one top-level `:root { ... }` block.
79
79
  */
80
80
  export declare function hasTopLevelRootBlock(source: string): boolean;
81
- //# sourceMappingURL=apply-token-overrides.d.ts.map
@@ -30,9 +30,17 @@
30
30
  * - Palette slots (resolved via `resolvePaletteCssVar(cluster, i)`) —
31
31
  * EMITTED as the stored color value (hex, or `oklch(...)` for
32
32
  * oklch-format palettes).
33
- * - Semantic tokens (`cluster.semanticCssNames` entries) — EMITTED as
34
- * `var(--<paletteSlotName>)` so the rewrite preserves the indirection
35
- * that the hand-authored CSS relies on.
33
+ * - Semantic tokens (`cluster.semanticCssNames` entries) — a legacy
34
+ * index/`bg`/`fg` mapping is EMITTED as `var(--<paletteSlotName>)` so the
35
+ * rewrite preserves the indirection that the hand-authored CSS relies on.
36
+ * A single-mode `{ literal: string }` mapping (#465) is instead EMITTED
37
+ * VERBATIM as the literal CSS value — there is no palette slot to
38
+ * reference. A cross-tab/tier `{ ref }` mapping (#468) is resolved via
39
+ * `resolveRefToCssVar` against the panel's full `tabs` array and EMITTED
40
+ * as `var(--<resolved-target>)`. Per-mode `{ literal: { light, dark } }`
41
+ * (#472) is EMITTED as `light-dark(<light>, <dark>)`, byte-identical to
42
+ * the DOM emitter (the required `color-scheme: light dark` is NOT settable
43
+ * via this pipeline — see the per-mode branch below for why).
36
44
  * - Base roles (`cluster.baseRoles` entries) — NOT emitted. They do not
37
45
  * belong to the apply pipeline's rewrite scope.
38
46
  * - Spacing / typography / size — EMITTED when the corresponding
@@ -68,6 +76,13 @@ import type { TabConfig } from '../tokens/tier-model';
68
76
  *
69
77
  * `tabs` defaults to the active panel config's tab list. Injected by tests so
70
78
  * non-color token resolution works without a live panel config singleton.
79
+ *
80
+ * `currentTab` is the color TabConfig `state.color`'s semantic mappings live
81
+ * on — needed so a cross-tab/tier `{ ref }` mapping (#468) with an omitted
82
+ * `ref.tab` resolves against the RIGHT tab. Defaults to the `'color'` tab
83
+ * (primary-cluster behavior, unchanged). Secondary-cluster callers MUST pass
84
+ * the `'color-secondary'` tab explicitly — mirroring the DOM emitter's
85
+ * `applyFullState`/`applyColorState` `currentTab` threading
86
+ * (`state/tweak-state.ts`).
71
87
  */
72
- export declare function buildApplyOverrides(state: TweakState, colorDefaults: ColorTweakState | undefined, cluster?: ColorClusterConfig, tabs?: readonly TabConfig[]): Record<string, string>;
73
- //# sourceMappingURL=build-apply-overrides.d.ts.map
88
+ export declare function buildApplyOverrides(state: TweakState, colorDefaults: ColorTweakState | undefined, cluster?: ColorClusterConfig, tabs?: readonly TabConfig[], currentTab?: TabConfig | undefined): Record<string, string>;
@@ -62,4 +62,3 @@ export declare const TOKEN_SOURCE_FILES: Readonly<ApplyRoutingMap>;
62
62
  * instead of silently no-oping.
63
63
  */
64
64
  export declare function routeTokensToFiles(overrides: Record<string, string>, routing?: ApplyRoutingMap): RouteResult;
65
- //# sourceMappingURL=route-tokens-to-files.d.ts.map
@@ -72,4 +72,31 @@ export declare function resolveTierItemValue(tab: TabConfig, tierId: string, ite
72
72
  * - Ref → returns `var(--targetCssVar)` (e.g. `var(--zfb-easing-ease-in)`).
73
73
  */
74
74
  export declare function emitTierItemCssValue(resolved: ResolvedTierItem): string;
75
- //# sourceMappingURL=tier-resolver.d.ts.map
75
+ /**
76
+ * A `SemanticValue`'s cross-tab ramp reference: names a target ramp item by
77
+ * `{ tab?, tier, item }`. An omitted `tab` means "the current tab" (intra-tab,
78
+ * back-compat). Mirrors the `{ ref }` variant of `SemanticValue` in
79
+ * `tokens/tier-model.ts`.
80
+ */
81
+ export type CrossTabRef = {
82
+ tab?: string;
83
+ tier: string;
84
+ item: string;
85
+ };
86
+ /**
87
+ * Resolve a `{ tab?, tier, item }` reference to the target item's `cssVar`
88
+ * so a downstream emitter (#468) can write `var(--target-cssvar)`.
89
+ *
90
+ * Resolution:
91
+ * - `tab` omitted (or equal to `currentTab.id`) → resolve within
92
+ * `currentTab` (intra-tab; keeps a lone-tab caller working with the
93
+ * default `tabs = [currentTab]`).
94
+ * - `tab` set → look the target tab up by id in `tabs` (the panel config's
95
+ * full tabs array), then find `tier` in it, then `item` in that tier.
96
+ *
97
+ * Throws `TierResolverError` with a precise message when the target tab, tier,
98
+ * or item does not exist. This is the single reachable cross-tab lookup path;
99
+ * #468 wraps the returned cssVar in `var(...)` and #469 validates source
100
+ * declarations up front.
101
+ */
102
+ export declare function resolveRefToCssVar(ref: CrossTabRef, currentTab: TabConfig, tabs?: readonly TabConfig[]): string;
@@ -56,4 +56,3 @@ export interface ApplyModalProps {
56
56
  instanceConfig?: PanelConfig;
57
57
  }
58
58
  export declare function ApplyModal(props: ApplyModalProps): import("preact").JSX.Element;
59
- //# sourceMappingURL=apply-modal.d.ts.map
@@ -9,10 +9,8 @@
9
9
  * ---
10
10
  * import DesignTokenPanelHost from '@takazudo/zdtp/astro/DesignTokenPanelHost.astro';
11
11
  * import { panelConfig } from './my-design-token-config';
12
- * // Required side-effect import for the package's bundled chrome CSS —
13
- * // Vite library mode strips the source CSS import from the emitted JS,
14
- * // so consumers must re-pull the extracted stylesheet explicitly.
15
- * import '@takazudo/zdtp/styles';
12
+ * // No CSS import needed — the panel self-injects its stylesheet on first mount.
13
+ * // Optional: import '@takazudo/zdtp/styles'; // pull CSS into your own pipeline
16
14
  * ---
17
15
  * <DesignTokenPanelHost config={panelConfig} />
18
16
  * <script>
@@ -44,4 +44,3 @@
44
44
  * `DesignTokenPanelHost.astro`), never by the lib bundle's `index.ts`.
45
45
  */
46
46
  export {};
47
- //# sourceMappingURL=host-adapter.d.ts.map
@@ -1,16 +1,16 @@
1
- import { c as h, g as u, a as g, b as w, d as y, e as P } from "../panel-config-DyVRQ2n1.js";
2
- import { g as d, Z as b } from "../tweak-state-DzZVbY25.js";
3
- import { s as _, l as A, a as c, c as k, b as I } from "../autoload-state-DsvvPDih.js";
4
- const i = "tokenpanel-config";
1
+ import { c as h, g as u, a as g, b as w, d as y, e as P } from "../panel-config-CXTCcYQs.js";
2
+ import { g as d, Z as b } from "../tweak-state-BeXkzoj8.js";
3
+ import { s as _, l as A, a as c, c as k, b as I } from "../autoload-state-CmhI7q9j.js";
4
+ const l = "tokenpanel-config";
5
5
  function E() {
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 n = document.getElementById(i);
10
+ const n = document.getElementById(l);
11
11
  if (!n)
12
12
  throw new Error(
13
- `[design-token-panel] Inline config script #${i} not found. Ensure <DesignTokenPanelHost config={...} /> is rendered on this page before the host script runs.`
13
+ `[design-token-panel] Inline config script #${l} not found. Ensure <DesignTokenPanelHost config={...} /> is rendered on this page before the host script runs.`
14
14
  );
15
15
  const o = n.textContent ?? "";
16
16
  let e;
@@ -18,7 +18,7 @@ function E() {
18
18
  e = JSON.parse(o);
19
19
  } catch (a) {
20
20
  throw new Error(
21
- `[design-token-panel] Failed to parse inline config from #${i}: ${a.message}`
21
+ `[design-token-panel] Failed to parse inline config from #${l}: ${a.message}`
22
22
  );
23
23
  }
24
24
  return P(e), e;
@@ -46,7 +46,7 @@ function v(n, o) {
46
46
  return !1;
47
47
  }
48
48
  }
49
- async function l(n) {
49
+ async function i(n) {
50
50
  return n.modulePromise === null && (n.modulePromise = import("@takazudo/zdtp").then((o) => {
51
51
  try {
52
52
  const e = u(), a = o.__panelConfigForTest();
@@ -64,22 +64,22 @@ async function l(n) {
64
64
  function D(n, o, e, a, t) {
65
65
  const s = n[o] ?? {};
66
66
  s.showDesignPanel = async () => {
67
- c(t, !0), await l(e), a.open();
67
+ c(t, !0), await i(e), a.open();
68
68
  }, s.hideDesignPanel = async () => {
69
- await l(e), a.close();
69
+ await i(e), a.close();
70
70
  }, s.toggleDesignPanel = async () => {
71
- await l(e);
71
+ await i(e), a.toggle();
72
72
  let r = !1;
73
73
  try {
74
- r = window.localStorage.getItem(d(t)) !== "1";
74
+ r = window.localStorage.getItem(d(t)) === "1";
75
75
  } catch {
76
76
  }
77
- a.toggle(), r && c(t, !0);
77
+ r && c(t, !0);
78
78
  }, s.enableAutoload = async () => {
79
- (await l(e)).enableAutoload(t);
79
+ (await i(e)).enableAutoload(t);
80
80
  }, s.disableAutoload = async () => {
81
81
  if (e.modulePromise !== null) {
82
- (await l(e)).disableAutoload(t);
82
+ (await i(e)).disableAutoload(t);
83
83
  return;
84
84
  }
85
85
  k(t), I(!1, t);
@@ -98,5 +98,5 @@ function D(n, o, e, a, t) {
98
98
  if (D(s, t.consoleNamespace, r, a, t), r.bound) return;
99
99
  r.bound = !0;
100
100
  const f = g(t), p = w(t), m = y(t);
101
- (T(f) || v(p, m) || _(t) || A(t)) && l(r);
101
+ (T(f) || v(p, m) || _(t) || A(t)) && i(r);
102
102
  })();
@@ -30,4 +30,3 @@ export { colorSchemes } from '../config/color-schemes';
30
30
  export { panelSettings, SEMANTIC_CSS_NAMES, SEMANTIC_DEFAULTS_ZD } from '../config/color-scheme-utils';
31
31
  export { GROUP_ORDER, FONT_GROUP_ORDER, SIZE_GROUP_ORDER, GROUP_TITLES } from '../tokens/manifest';
32
32
  export type { TokenDef, TokenManifest } from '../tokens/manifest';
33
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { s as t } from "../panel-config-DyVRQ2n1.js";
1
+ import { s as t } from "../panel-config-CXTCcYQs.js";
2
2
  import { c as d } from "../color-schemes-CgzOBqGO.js";
3
3
  import { F as r, G as m, a as g, S as z } from "../manifest-DCReQE0k.js";
4
4
  const e = {
@@ -1,4 +1,4 @@
1
- import { g as a, j as o } from "./panel-config-DyVRQ2n1.js";
1
+ import { g as a, j as o } from "./panel-config-CXTCcYQs.js";
2
2
  function n(e = a()) {
3
3
  return `${e.storagePrefix}-elpath-enabled`;
4
4
  }
@@ -21,4 +21,3 @@ export declare function isOriginAllowed(origin: string | null | undefined, allow
21
21
  * permitted.
22
22
  */
23
23
  export declare function buildCorsHeaders(origin: string): Record<string, string>;
24
- //# sourceMappingURL=cors.d.ts.map
@@ -35,4 +35,3 @@ export declare const HELP_TEXT = "Usage: zdtp-server [options]\n\nRun a small No
35
35
  * `ParsedArgs` record. Throws on malformed input — the bin handles the throw.
36
36
  */
37
37
  export declare function parseArgs(argv: readonly string[]): ParsedArgs;
38
- //# sourceMappingURL=parse-args.d.ts.map
@@ -20,4 +20,3 @@
20
20
  * - shuts down gracefully on SIGINT/SIGTERM
21
21
  */
22
22
  export {};
23
- //# sourceMappingURL=server.d.ts.map
@@ -2,7 +2,7 @@
2
2
  import { realpathSync as H } from "node:fs";
3
3
  import { createServer as C } from "node:http";
4
4
  import { resolve as d } from "node:path";
5
- import { l as x, c as N } from "../load-routing-XyKgftpe.js";
5
+ import { l as x, c as N } from "../load-routing-DtNTKoLW.js";
6
6
  function g(t, e) {
7
7
  return typeof t != "string" || t.length === 0 || e.length === 0 ? !1 : e.includes(t);
8
8
  }
@@ -35,4 +35,3 @@ export interface ColorFieldProps {
35
35
  */
36
36
  export declare function ColorField({ value, onChange, valueFormat, label, cssVar, readonly: isReadonly, }: ColorFieldProps): import("preact").JSX.Element;
37
37
  export default ColorField;
38
- //# sourceMappingURL=color-field.d.ts.map
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Issue #175 (Wave 2 of the OKLCH Picker epic, issue #174-base).
9
9
  *
10
- * Design rules (see packages/zudo-design-token-panel/CLAUDE.md):
10
+ * Design rules (see packages/zdtp/CLAUDE.md):
11
11
  * - All interactive elements use <div role="button" tabIndex={0}> with
12
12
  * explicit Enter/Space onKeyDown handlers. Native button and heading tags
13
13
  * are not used (hostile-host policy).
@@ -75,8 +75,18 @@ export declare function getFixedPopoverStyle(anchor: HTMLElement | null, estW: n
75
75
  *
76
76
  * Deliberately does NOT close on scroll — a scroll event on the host page
77
77
  * should not dismiss an in-flight color edit.
78
+ *
79
+ * `anchorRef` (F11): the popover's trigger element lives OUTSIDE `containerRef`.
80
+ * A pointerdown on the trigger while the popover is open must NOT trigger the
81
+ * outside-close, otherwise it races the trigger's own click-to-toggle: the
82
+ * pointerdown closes, then the click reopens, so the trigger can never dismiss
83
+ * its own popover. Excluding the anchor lets the click toggle it shut.
84
+ *
85
+ * Escape is arbitrated by the shared dismiss-layer stack (F10): only the
86
+ * topmost open popover consumes a single Escape, so one keypress never also
87
+ * tears down the panel underneath.
78
88
  */
79
- export declare function usePopoverClose(containerRef: React.RefObject<HTMLElement | null>, onClose: () => void): void;
89
+ export declare function usePopoverClose(containerRef: React.RefObject<HTMLElement | null>, onClose: () => void, anchorRef?: React.RefObject<HTMLElement | null>): void;
80
90
  /**
81
91
  * ColorPicker — popover body only.
82
92
  *
@@ -85,4 +95,3 @@ export declare function usePopoverClose(containerRef: React.RefObject<HTMLElemen
85
95
  */
86
96
  export declare function ColorPicker({ color, onChange, valueFormat, label, defaultMode, anchorRef, onClose, }: ColorPickerProps): JSX.Element;
87
97
  export default ColorPicker;
88
- //# sourceMappingURL=color-picker.d.ts.map
@@ -22,4 +22,3 @@ export interface CustomSliderProps {
22
22
  }
23
23
  export declare function CustomSlider({ config, value, gradient, onChange, onDragStart, onDragEnd, }: CustomSliderProps): JSX.Element;
24
24
  export default CustomSlider;
25
- //# sourceMappingURL=custom-slider.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { ColorPicker, type ColorPickerMode, type ColorPickerProps, LOCAL_STORAGE_KEY, getFixedPopoverStyle, usePopoverClose, } from './color-picker';
2
2
  export { default } from './color-picker';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { PaletteChart, type PaletteChartProps, type Oklcha, type Channel, } from './palette-chart';
2
2
  export { default } from './palette-chart';
3
- //# sourceMappingURL=index.d.ts.map
@@ -72,4 +72,3 @@ declare function PaletteChartImpl({ colors, selectedIndex, visibleChannels, onCh
72
72
  */
73
73
  export declare const PaletteChart: typeof PaletteChartImpl;
74
74
  export default PaletteChart;
75
- //# sourceMappingURL=palette-chart.d.ts.map
@@ -21,6 +21,8 @@
21
21
  * `panelConfig.colorCluster`.
22
22
  */
23
23
  import type { ColorScheme } from './color-schemes';
24
+ import type { SemanticValue } from '../tokens/tier-model';
25
+ export type { SemanticValue } from '../tokens/tier-model';
24
26
  /**
25
27
  * Base-role keys that a cluster may declare. Subset is allowed (a cluster may
26
28
  * ship zero base roles when its design system doesn't expose them as tokens).
@@ -76,8 +78,16 @@ export interface ColorClusterDataConfig {
76
78
  * `--brand-p{n}`, `--demo-palette-{n}`.
77
79
  */
78
80
  paletteCssVarTemplate: string;
79
- /** Semantic token name → default palette index. */
80
- semanticDefaults: Record<string, number>;
81
+ /**
82
+ * Semantic token name → default mapping. Historically always a palette
83
+ * index (`number`); widened to `SemanticValue` (#459) so a default can also
84
+ * be a literal color or a cross-tab ramp reference. `resolveColorClusterFromTab`
85
+ * now derives the `{ literal }` / best-effort `{ ref }` variants too (#463)
86
+ * for a `semantic: true` tier; actually resolving a `{ ref }` against the
87
+ * ramp tier it names (rendering + apply) is still downstream work
88
+ * (#467/#469).
89
+ */
90
+ semanticDefaults: Record<string, SemanticValue>;
81
91
  /** Semantic token name → CSS custom-property name. */
82
92
  semanticCssNames: Record<string, string>;
83
93
  /** Fallback indices used when a scheme doesn't declare a base role. */
@@ -104,23 +114,36 @@ import type { TabConfig } from '../tokens/tier-model';
104
114
  /**
105
115
  * Derive a `ColorClusterDataConfig` from a color `TabConfig`.
106
116
  *
107
- * - Palette items: the first tier whose items all have `kind: 'color'`.
108
- * Each item's `cssVar` becomes a palette slot; `paletteCssVarTemplate` is
109
- * synthesised as `"{item.cssVar}"` with `{n}` replaced by the slot index.
110
- * Because item cssVars are explicit (e.g. `--zfb-palette-0`) rather
111
- * than template-based, we derive the template from the first item by
112
- * replacing the terminal digit sequence with `{n}`.
117
+ * - Palette items: the first tier whose items all have `kind: 'color'` and
118
+ * are not `semantic: true`. Each item's `cssVar` becomes a palette slot;
119
+ * `paletteCssVarTemplate` is synthesised as `"{item.cssVar}"` with `{n}`
120
+ * replaced by the slot index. Because item cssVars are explicit (e.g.
121
+ * `--zfb-palette-0`) rather than template-based, we derive the template
122
+ * from the first item by replacing the terminal digit sequence with `{n}`.
113
123
  *
114
- * - Semantic items: the first tier with `referencesTier` set pointing at the
115
- * palette tier. Each item's `id` → `cssVar` mapping becomes `semanticCssNames`;
116
- * the item's `default` (a palette item id) is looked up to produce the index
117
- * for `semanticDefaults`.
124
+ * - Semantic items: either the first tier with `referencesTier` set pointing
125
+ * at the palette tier (legacy shape), or a tier explicitly marked
126
+ * `semantic: true` (#461) — the latter may have no palette sibling at all.
127
+ * Each item's `id` → `cssVar` mapping becomes `semanticCssNames`; the
128
+ * item's `default` is resolved to a `SemanticValue` by
129
+ * `deriveSemanticValue` (palette index / literal / ramp-ref — see there).
130
+ *
131
+ * - A tab with a semantic tier but NO palette tier still produces a usable
132
+ * cluster: `paletteSize` is `0` (the palette-driven UI has nothing to
133
+ * render) but `semanticDefaults`/`semanticCssNames` are populated from the
134
+ * semantic tier so the Semantic Tokens section isn't left empty (#463).
118
135
  *
119
136
  * - Metadata comes from `tab.colorExtras` (required on a color tab).
120
137
  *
138
+ * `tabs` is the panel config's full tabs array, used to resolve a semantic
139
+ * tier's cross-tab `{ ref }` mappings against a ramp tier living in ANOTHER
140
+ * tab (typically the grouped Palette tab). It defaults to `[tab]` so an
141
+ * existing single-argument call still works — intra-tab refs resolve, and a
142
+ * cross-tab ramp declaration falls back to its best-effort shape (#467).
143
+ *
121
144
  * Returns `undefined` when the tab has no `colorExtras` (not a color tab).
122
145
  */
123
- export declare function resolveColorClusterFromTab(tab: TabConfig): ColorClusterDataConfig | undefined;
146
+ export declare function resolveColorClusterFromTab(tab: TabConfig, tabs?: readonly TabConfig[]): ColorClusterDataConfig | undefined;
124
147
  /**
125
148
  * Find the primary color tab (id 'color') in the host's tabs array and
126
149
  * derive its `ColorClusterDataConfig`. Returns `undefined` when no color tab
@@ -132,4 +155,3 @@ export declare function resolvePrimaryColorCluster(tabs: readonly TabConfig[]):
132
155
  * `ColorClusterDataConfig`. Returns `null` when no secondary color tab exists.
133
156
  */
134
157
  export declare function resolveSecondaryColorClusterFromTabs(tabs: readonly TabConfig[]): ColorClusterDataConfig | null;
135
- //# sourceMappingURL=cluster-config.d.ts.map
@@ -102,4 +102,3 @@ export declare function resolveSemanticColors(scheme: ColorScheme): Record<strin
102
102
  export declare function schemeToCssPairs(scheme: ColorScheme): [string, string][];
103
103
  export declare function generateCssCustomProperties(): string;
104
104
  export declare function generateLightDarkCssProperties(): string;
105
- //# sourceMappingURL=color-scheme-utils.d.ts.map
@@ -85,4 +85,3 @@ export interface ColorScheme {
85
85
  * same indices.
86
86
  */
87
87
  export declare const colorSchemes: Record<string, ColorScheme>;
88
- //# sourceMappingURL=color-schemes.d.ts.map
@@ -337,6 +337,17 @@ export declare function registerPostConfigureHook(hook: () => void): void;
337
337
  * called `configurePanel`.
338
338
  */
339
339
  export declare function getPanelConfig(): PanelConfig;
340
+ /**
341
+ * Return the configs of ALL registered panel instances, in registration order.
342
+ * Returns an empty array when no instance has been configured yet.
343
+ *
344
+ * Used by the Astro lifecycle handlers (unmountForSwap / reapplyFromStorage)
345
+ * to loop every mounted instance rather than only the default one. Without
346
+ * this, non-default panels have their DOM roots removed by Astro's body swap
347
+ * WITHOUT `render(null, root)` being called, so their useEffect cleanups never
348
+ * fire and window/document listeners accumulate per soft navigation.
349
+ */
350
+ export declare function getAllPanelConfigs(): PanelConfig[];
340
351
  /**
341
352
  * Resolve the registered config for a SPECIFIC instance by its `storagePrefix`
342
353
  * (=== `instanceId`), or `null` when no such instance is registered.
@@ -483,4 +494,3 @@ export declare function resolveApplyRouting(cfg?: PanelConfig): ApplyRoutingMap;
483
494
  * registry level and merged into the first instance to be configured.
484
495
  */
485
496
  export declare function setPanelColorPresets(presets: Record<string, ColorScheme>): void;
486
- //# sourceMappingURL=panel-config.d.ts.map