@takazudo/zdtp 0.4.1 → 0.4.3
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 +63 -0
- package/README.md +78 -25
- package/dist/apply/apply-token-overrides.d.ts +0 -1
- package/dist/apply/build-apply-overrides.d.ts +4 -3
- package/dist/apply/route-tokens-to-files.d.ts +0 -1
- package/dist/apply/tier-resolver.d.ts +0 -1
- package/dist/apply-modal.d.ts +0 -1
- package/dist/astro/DesignTokenPanelHost.astro +2 -4
- package/dist/astro/host-adapter.d.ts +0 -1
- package/dist/astro/host-adapter.js +69 -46
- package/dist/astro/index.d.ts +0 -1
- package/dist/astro/index.js +1 -1
- package/dist/autoload-state-B1MWY_Pp.js +46 -0
- package/dist/bin/cors.d.ts +0 -1
- package/dist/bin/parse-args.d.ts +0 -1
- package/dist/bin/server.d.ts +0 -1
- package/dist/bin/server.js +1 -1
- package/dist/components/color-picker/color-field.d.ts +0 -1
- package/dist/components/color-picker/color-picker.d.ts +12 -3
- package/dist/components/color-picker/custom-slider.d.ts +0 -1
- package/dist/components/color-picker/index.d.ts +0 -1
- package/dist/components/palette-chart/index.d.ts +0 -1
- package/dist/components/palette-chart/palette-chart.d.ts +0 -1
- package/dist/config/cluster-config.d.ts +0 -1
- package/dist/config/color-scheme-utils.d.ts +0 -1
- package/dist/config/color-schemes.d.ts +0 -1
- package/dist/config/panel-config.d.ts +19 -1
- package/dist/controls/dismiss-layer.d.ts +55 -0
- package/dist/controls/pill-slider-row.d.ts +0 -1
- package/dist/controls/role-button.d.ts +0 -1
- package/dist/controls/sanitize-css-value.d.ts +0 -1
- package/dist/controls/select-row.d.ts +0 -1
- package/dist/controls/slider-row.d.ts +0 -1
- package/dist/controls/text-row.d.ts +0 -1
- package/dist/controls/tier-ref-selector.d.ts +0 -1
- package/dist/controls/token-label.d.ts +0 -1
- package/dist/controls/tooltip.d.ts +0 -1
- package/dist/controls/use-dialog-backdrop-close.d.ts +32 -0
- package/dist/element-path/build-element-path.d.ts +0 -1
- package/dist/element-path/element-path-context.d.ts +0 -1
- package/dist/element-path/element-path-orchestrator.d.ts +0 -1
- package/dist/element-path/element-path-state.d.ts +3 -3
- package/dist/element-path/element-path-toast.d.ts +0 -1
- package/dist/element-path/element-path-toggle-button.d.ts +0 -1
- package/dist/element-path/index.d.ts +0 -1
- package/dist/element-path/inspector-overlay.d.ts +0 -1
- package/dist/export-modal.d.ts +0 -1
- package/dist/highlight/find-elements.d.ts +0 -1
- package/dist/highlight/highlight-orchestrator.d.ts +0 -1
- package/dist/highlight/highlight-overlay.d.ts +0 -1
- package/dist/highlight/highlight-settings-popover.d.ts +0 -1
- package/dist/highlight/highlight-state.d.ts +0 -1
- package/dist/highlight/highlight-toggle-button.d.ts +0 -1
- package/dist/import-modal.d.ts +0 -1
- package/dist/index.d.ts +39 -1
- package/dist/index.js +3067 -3956
- package/dist/{load-routing-XyKgftpe.js → load-routing-DtNTKoLW.js} +1 -1
- package/dist/panel-config-3tBEHjvZ.js +493 -0
- package/dist/panel.d.ts +0 -1
- package/dist/server/create-apply-handler.d.ts +0 -1
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.js +1 -1
- package/dist/server/load-routing.d.ts +0 -1
- package/dist/server/path-safety.d.ts +0 -1
- package/dist/server/serialize-write.d.ts +0 -1
- package/dist/state/autoload-state.d.ts +91 -0
- package/dist/state/persist.d.ts +0 -3
- package/dist/state/tweak-state.d.ts +47 -7
- package/dist/styles/z-index-tokens.d.ts +35 -0
- package/dist/tabs/_generic-item-editor.d.ts +0 -1
- package/dist/tabs/color-tab.d.ts +7 -5
- package/dist/tabs/font-tab.d.ts +0 -1
- package/dist/tabs/generic-tab.d.ts +1 -2
- package/dist/tabs/palette/palette-check-view.d.ts +0 -1
- package/dist/tabs/palette/palette-edit-view.d.ts +0 -1
- package/dist/tabs/palette/palette-readout.d.ts +0 -1
- package/dist/tabs/palette/palette-tab.d.ts +0 -1
- package/dist/tabs/size-tab.d.ts +0 -1
- package/dist/tabs/spacing-tab.d.ts +0 -1
- package/dist/testing.d.ts +0 -1
- package/dist/testing.js +2 -2
- package/dist/tokens/manifest.d.ts +0 -1
- package/dist/tokens/tier-model.d.ts +0 -1
- package/dist/tweak-state-BEx1SHu7.js +1773 -0
- package/dist/utils/color-convert.d.ts +0 -1
- package/dist/utils/color-hsla.d.ts +0 -1
- package/dist/utils/color-oklch.d.ts +0 -1
- package/dist/utils/copy-to-clipboard.d.ts +0 -1
- package/dist/utils/design-token-serde.d.ts +2 -2
- package/dist/utils/palette-curve.d.ts +0 -1
- package/dist/utils/structural-equal.d.ts +0 -1
- package/dist/utils/use-portal-mount.d.ts +0 -1
- package/dist/utils/wcag-contrast.d.ts +0 -1
- package/dist/zdtp.css +1 -1
- package/package.json +24 -11
- package/dist/apply/apply-token-overrides.d.ts.map +0 -1
- package/dist/apply/build-apply-overrides.d.ts.map +0 -1
- package/dist/apply/route-tokens-to-files.d.ts.map +0 -1
- package/dist/apply/tier-resolver.d.ts.map +0 -1
- package/dist/apply-modal.d.ts.map +0 -1
- package/dist/astro/host-adapter.d.ts.map +0 -1
- package/dist/astro/index.d.ts.map +0 -1
- package/dist/bin/cors.d.ts.map +0 -1
- package/dist/bin/parse-args.d.ts.map +0 -1
- package/dist/bin/server.d.ts.map +0 -1
- package/dist/components/color-picker/color-field.d.ts.map +0 -1
- package/dist/components/color-picker/color-picker.d.ts.map +0 -1
- package/dist/components/color-picker/custom-slider.d.ts.map +0 -1
- package/dist/components/color-picker/index.d.ts.map +0 -1
- package/dist/components/palette-chart/index.d.ts.map +0 -1
- package/dist/components/palette-chart/palette-chart.d.ts.map +0 -1
- package/dist/config/cluster-config.d.ts.map +0 -1
- package/dist/config/color-scheme-utils.d.ts.map +0 -1
- package/dist/config/color-schemes.d.ts.map +0 -1
- package/dist/config/panel-config.d.ts.map +0 -1
- package/dist/controls/pill-slider-row.d.ts.map +0 -1
- package/dist/controls/role-button.d.ts.map +0 -1
- package/dist/controls/sanitize-css-value.d.ts.map +0 -1
- package/dist/controls/select-row.d.ts.map +0 -1
- package/dist/controls/slider-row.d.ts.map +0 -1
- package/dist/controls/text-row.d.ts.map +0 -1
- package/dist/controls/tier-ref-selector.d.ts.map +0 -1
- package/dist/controls/token-label.d.ts.map +0 -1
- package/dist/controls/tooltip.d.ts.map +0 -1
- package/dist/element-path/build-element-path.d.ts.map +0 -1
- package/dist/element-path/element-path-context.d.ts.map +0 -1
- package/dist/element-path/element-path-orchestrator.d.ts.map +0 -1
- package/dist/element-path/element-path-state.d.ts.map +0 -1
- package/dist/element-path/element-path-toast.d.ts.map +0 -1
- package/dist/element-path/element-path-toggle-button.d.ts.map +0 -1
- package/dist/element-path/index.d.ts.map +0 -1
- package/dist/element-path/inspector-overlay.d.ts.map +0 -1
- package/dist/export-modal.d.ts.map +0 -1
- package/dist/highlight/find-elements.d.ts.map +0 -1
- package/dist/highlight/highlight-orchestrator.d.ts.map +0 -1
- package/dist/highlight/highlight-overlay.d.ts.map +0 -1
- package/dist/highlight/highlight-settings-popover.d.ts.map +0 -1
- package/dist/highlight/highlight-state.d.ts.map +0 -1
- package/dist/highlight/highlight-toggle-button.d.ts.map +0 -1
- package/dist/import-modal.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/panel-config-066BPYJD.js +0 -411
- package/dist/panel.d.ts.map +0 -1
- package/dist/server/create-apply-handler.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/load-routing.d.ts.map +0 -1
- package/dist/server/path-safety.d.ts.map +0 -1
- package/dist/server/serialize-write.d.ts.map +0 -1
- package/dist/state/persist.d.ts.map +0 -1
- package/dist/state/tweak-state.d.ts.map +0 -1
- package/dist/tabs/_generic-item-editor.d.ts.map +0 -1
- package/dist/tabs/color-tab.d.ts.map +0 -1
- package/dist/tabs/font-tab.d.ts.map +0 -1
- package/dist/tabs/generic-tab.d.ts.map +0 -1
- package/dist/tabs/palette/palette-check-view.d.ts.map +0 -1
- package/dist/tabs/palette/palette-edit-view.d.ts.map +0 -1
- package/dist/tabs/palette/palette-readout.d.ts.map +0 -1
- package/dist/tabs/palette/palette-tab.d.ts.map +0 -1
- package/dist/tabs/size-tab.d.ts.map +0 -1
- package/dist/tabs/spacing-tab.d.ts.map +0 -1
- package/dist/testing.d.ts.map +0 -1
- package/dist/tokens/manifest.d.ts.map +0 -1
- package/dist/tokens/tier-model.d.ts.map +0 -1
- package/dist/tweak-state-Do5gj6Nw.js +0 -730
- package/dist/utils/color-convert.d.ts.map +0 -1
- package/dist/utils/color-hsla.d.ts.map +0 -1
- package/dist/utils/color-oklch.d.ts.map +0 -1
- package/dist/utils/copy-to-clipboard.d.ts.map +0 -1
- package/dist/utils/design-token-serde.d.ts.map +0 -1
- package/dist/utils/palette-curve.d.ts.map +0 -1
- package/dist/utils/structural-equal.d.ts.map +0 -1
- package/dist/utils/use-portal-mount.d.ts.map +0 -1
- package/dist/utils/wcag-contrast.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.3
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **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)
|
|
8
|
+
- **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)
|
|
9
|
+
- **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)
|
|
10
|
+
- **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)
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `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)
|
|
15
|
+
- `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)
|
|
16
|
+
- 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)
|
|
17
|
+
- 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)
|
|
18
|
+
- 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)
|
|
19
|
+
- 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)
|
|
20
|
+
- 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)
|
|
21
|
+
- 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)
|
|
22
|
+
- 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)
|
|
23
|
+
- `release.yml` `dry_run` builds the package again, as its description advertises (8ce3d8b)
|
|
24
|
+
|
|
25
|
+
### Other Changes
|
|
26
|
+
|
|
27
|
+
- 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)
|
|
28
|
+
- 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)
|
|
29
|
+
- 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)
|
|
30
|
+
- 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)
|
|
31
|
+
- 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)
|
|
32
|
+
- Browser test files now run serially — parallel files share one origin and raced each other's localStorage (fd37774)
|
|
33
|
+
- Deps: bump @takazudo/* toolchain (zfb next.76, zudo-doc 2.5.0) (62b62f6)
|
|
34
|
+
|
|
35
|
+
## 0.4.2
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
- **OKLCH color tab — the reserved `color` tab now honors `format: 'oklch'`.** A cluster-based color tab whose palette tier items declare `type: { kind: 'color', format: 'oklch' }` now edits its palette swatches through the lossless OKLCH `ColorField` (the `valueFormat: 'oklch'` picker added in 0.3.3) while keeping the full color-cluster feature set — base roles, semantic→palette mappings, the "Scheme…" preset dropdown, and the secondary cluster. The palette `format` is read from `tab.tiers` (the flattened cluster drops per-item format), and both the primary and secondary cluster palettes honor it. Absent / `'hex'` format keeps the existing native hex behavior, so existing consumers and the highlight popover are unchanged. ([#436](https://github.com/Takazudo/zudo-design-token-panel/issues/436), epic [#434](https://github.com/Takazudo/zudo-design-token-panel/issues/434), supersedes [#433](https://github.com/Takazudo/zudo-design-token-panel/issues/433)) (ab761b6)
|
|
40
|
+
|
|
41
|
+
- **Owner-only autoload.** A new `${storagePrefix}:autoload` `localStorage` flag lets the site owner load the panel in their own browser without touching general visitors. When the flag is set, the panel bundle loads eagerly on every page visit and mounts CLOSED — the **Alt+click element-path inspector** is armed immediately even while the panel UI stays hidden. General visitors (no flag) receive zero panel JS.
|
|
42
|
+
|
|
43
|
+
New package-root exports: `enableAutoload()`, `disableAutoload()`, `shouldAutoload()`. The Astro host-adapter also installs `window[consoleNamespace].enableAutoload()` and `window[consoleNamespace].disableAutoload()` on the console API surface.
|
|
44
|
+
|
|
45
|
+
The existing on-demand flow (`showDesignPanel()` / `hideDesignPanel()` / `toggleDesignPanel()`) is unchanged. Owner-autoload is an opt-in layer on top of it, not a replacement.
|
|
46
|
+
|
|
47
|
+
**Auto-remember:** any action that opens the panel also writes `${storagePrefix}:autoload = '1'`. Once an owner opens the panel, subsequent page loads reload it automatically without another explicit `enableAutoload()` call.
|
|
48
|
+
|
|
49
|
+
**Lazy-load gate updated from 2 to 4 signals:** the host-adapter gate now fires on `wasVisible() || hasPersistedOverrides() || shouldAutoload() || loadElementPathEnabled()`. The last two signals are new; the previous two-signal behavior is a strict subset of the new gate, so existing consumers see no change.
|
|
50
|
+
|
|
51
|
+
([#419](https://github.com/Takazudo/zudo-design-token-panel/issues/419), [#420](https://github.com/Takazudo/zudo-design-token-panel/issues/420), [#421](https://github.com/Takazudo/zudo-design-token-panel/issues/421), [#422](https://github.com/Takazudo/zudo-design-token-panel/issues/422), [#423](https://github.com/Takazudo/zudo-design-token-panel/issues/423))
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- **Runtime preserves OKLCH through seed / apply / persist.** `initColorFromSchemeData` no longer eagerly normalizes the whole palette to sRGB hex via a canvas `fillStyle` round-trip — raw `oklch(...)` palette values now survive seeding (wide-gamut chroma intact; no collapse to `#000000` under jsdom / engines whose 2D canvas can't parse `oklch`), and `colorRefToIndex` is format-tolerant + alpha-aware. Non-`oklch` entries are still sanitized through `cssColorToHex`, so an invalid bundled-scheme string (e.g. `Default Dark`'s slot-9 `"18"`, referenced by `background: 9`) cannot leak into a CSS custom property. ([#435](https://github.com/Takazudo/zudo-design-token-panel/issues/435)) (162bf8e, 8d54e07)
|
|
56
|
+
|
|
57
|
+
- **Owner-autoload review fixes** — `disableAutoload()` now unmounts the panel, and element-path storage keys are per-instance. ([#424](https://github.com/Takazudo/zudo-design-token-panel/issues/424)) (ecfd745)
|
|
58
|
+
|
|
59
|
+
### Other Changes
|
|
60
|
+
|
|
61
|
+
- **Panel is draggable, movable & resizable on narrow windows**; `defaultSize()` is clamped to the `MIN_PANEL` floor on phone-width viewports; and Element-Path-Copy keeps working while the panel is closed. ([#415](https://github.com/Takazudo/zudo-design-token-panel/pull/415)) (2dc40a1, 8fb99b5, f163625)
|
|
62
|
+
- Wave-2 OKLCH cluster end-to-end test plus runtime / color-tab coverage. ([#437](https://github.com/Takazudo/zudo-design-token-panel/issues/437)) (8da36c6, 47e4d83, fad4ded)
|
|
63
|
+
- Bump the `@takazudo/*` toolchain (zfb next.72, zudo-doc 2.1.2). (d711839)
|
|
64
|
+
- Doc-site migration to zudo-doc v2 — doc-site only, no package impact. ([#432](https://github.com/Takazudo/zudo-design-token-panel/pull/432))
|
|
65
|
+
|
|
3
66
|
## 0.4.1
|
|
4
67
|
|
|
5
68
|
### Fixed
|
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
|
|
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
|
|
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.
|
|
329
332
|
|
|
330
|
-
|
|
333
|
+
**You do not need to import `@takazudo/zdtp/styles`** — the panel is visually self-contained out of the box.
|
|
334
|
+
|
|
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
|
-
//
|
|
338
|
+
// Optional — pull CSS into your own pipeline if needed
|
|
334
339
|
import '@takazudo/zdtp/styles';
|
|
335
340
|
```
|
|
336
341
|
|
|
337
|
-
|
|
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
|
|
|
@@ -530,8 +533,8 @@ const handle = configurePanel({
|
|
|
530
533
|
The Astro entry point (`<DesignTokenPanelHost>`) handles mounting for you. Internally:
|
|
531
534
|
|
|
532
535
|
- The console API (`showDesignPanel` etc.) is **always installed eagerly**, even when the panel module has not loaded — calling them is what triggers the lazy import for cold-start users.
|
|
533
|
-
- The panel module is **dynamically imported on first need**:
|
|
534
|
-
- This gating keeps the panel out of the initial JS bundle for first-time visitors while still re-applying overrides on hard reload for users who have tweaked things.
|
|
536
|
+
- The panel module is **dynamically imported on first need**: when the user calls a console helper, OR when first-paint detects any of four gate signals in `localStorage` — `${storagePrefix}:visible` set to `1`, persisted overrides (`${storagePrefix}-state-v3`), the owner-autoload flag (`${storagePrefix}:autoload` set to `1`), or the element-path inspector enabled.
|
|
537
|
+
- This gating keeps the panel out of the initial JS bundle for first-time visitors while still re-applying overrides on hard reload for users who have tweaked things. **General visitors** (none of the four signals set) pay zero bundle cost.
|
|
535
538
|
|
|
536
539
|
For a Vite-only / non-Astro host, mount it yourself by importing the adapter module after `configurePanel(...)`. See §11.5.
|
|
537
540
|
|
|
@@ -891,6 +894,7 @@ Behaviour notes:
|
|
|
891
894
|
| `open` | `${storagePrefix}-open` | Mirror of the panel's `open` boolean (synchronous mount-time read — preserves user intent across reloads, fixes #1549). |
|
|
892
895
|
| `position` | `${storagePrefix}-position` | Drag position `{ top, right }` so the panel reappears where the user left it. |
|
|
893
896
|
| `visible` | `${storagePrefix}:visible` | Adapter-level visibility-intent flag, owned by the lazy-load gate. |
|
|
897
|
+
| `autoload` | `${storagePrefix}:autoload` | Owner-mode autoload flag. When `'1'`, the panel bundle fetches eagerly on every page load and mounts CLOSED so the Alt+click element-path inspector is armed without opening the panel UI. Set by `enableAutoload()` and cleared by `disableAutoload()`. See §10.1. |
|
|
894
898
|
|
|
895
899
|
For example, with `storagePrefix: 'myapp-design-token-panel'`:
|
|
896
900
|
|
|
@@ -901,11 +905,12 @@ myapp-design-token-panel-state
|
|
|
901
905
|
myapp-design-token-panel-open
|
|
902
906
|
myapp-design-token-panel-position
|
|
903
907
|
myapp-design-token-panel:visible
|
|
908
|
+
myapp-design-token-panel:autoload
|
|
904
909
|
```
|
|
905
910
|
|
|
906
|
-
### Note: colon vs dash
|
|
911
|
+
### Note: colon vs dash — `visible` and `autoload`
|
|
907
912
|
|
|
908
|
-
The `visible`
|
|
913
|
+
The `visible` and `autoload` keys use a literal `:` separator, not `-`. Every other derived key uses `-`. The colon form is intentional for these adapter-level flags — see [`PORTABLE-CONTRACT.md`](./PORTABLE-CONTRACT.md) §2 for the historical reason. Don't try to "normalize" them; the unit tests assert this specific shape.
|
|
909
914
|
|
|
910
915
|
### Scheme changes and the global tweak model
|
|
911
916
|
|
|
@@ -924,19 +929,27 @@ Two consequences worth knowing as a host integrator:
|
|
|
924
929
|
|
|
925
930
|
## 10. Console API contract
|
|
926
931
|
|
|
927
|
-
Once `configurePanel` has run, the package installs
|
|
932
|
+
Once `configurePanel` has run, the package installs async helpers on the global `window[consoleNamespace]` object:
|
|
928
933
|
|
|
929
934
|
```ts
|
|
930
|
-
window.myapp.showDesignPanel();
|
|
931
|
-
window.myapp.hideDesignPanel();
|
|
932
|
-
window.myapp.toggleDesignPanel(); // toggle
|
|
935
|
+
window.myapp.showDesignPanel(); // open the panel (lazy-loads the bundle on first call)
|
|
936
|
+
window.myapp.hideDesignPanel(); // close the panel
|
|
937
|
+
window.myapp.toggleDesignPanel(); // toggle open/closed
|
|
938
|
+
|
|
939
|
+
// Owner-autoload (see §10.1)
|
|
940
|
+
window.myapp.enableAutoload(); // arm owner-mode; panel loads CLOSED with Alt+click ready
|
|
941
|
+
window.myapp.disableAutoload(); // disarm owner-mode; unmounts the panel
|
|
933
942
|
```
|
|
934
943
|
|
|
935
|
-
All
|
|
944
|
+
All helpers are **async** — the first call lazy-imports the panel module. Subsequent calls share the memoised module promise and resolve synchronously after the first import completes.
|
|
945
|
+
|
|
946
|
+
### Backward-compatible: the on-demand flow is unchanged
|
|
947
|
+
|
|
948
|
+
The pre-existing on-demand usage — calling `window.<consoleNamespace>.showDesignPanel()` / `hideDesignPanel()` / `toggleDesignPanel()` to lazy-import and initialize the panel — is **unchanged and fully supported**. Owner-autoload (§10.1) is an opt-in layered on top, not a replacement. If you never call `enableAutoload()`, the panel behaves exactly as it always did: nothing loads for any visitor until the first console call.
|
|
936
949
|
|
|
937
950
|
### Co-existing helpers on the same namespace
|
|
938
951
|
|
|
939
|
-
The adapter **merges** its
|
|
952
|
+
The adapter **merges** its helpers into any existing object at `window[namespace]` rather than overwriting the namespace wholesale. This means a host can share a namespace between multiple dev tools (e.g. `window.myapp.ogpDebug.show()` from a separate package, alongside `window.myapp.showDesignPanel()` from this one) without collisions.
|
|
940
953
|
|
|
941
954
|
### Default
|
|
942
955
|
|
|
@@ -944,6 +957,44 @@ There is no default `consoleNamespace` exposed to consumers — the field is req
|
|
|
944
957
|
|
|
945
958
|
---
|
|
946
959
|
|
|
960
|
+
### 10.1 Owner-autoload — loading the panel only for you
|
|
961
|
+
|
|
962
|
+
**Use case:** you are deploying a public site and want the design-token panel available to yourself (the site owner) without loading any panel JS for general visitors. Once armed, every page load fetches the bundle eagerly and mounts the panel CLOSED — the Alt+click element-path inspector is ready immediately, and you can open the panel UI at any time.
|
|
963
|
+
|
|
964
|
+
#### API surface
|
|
965
|
+
|
|
966
|
+
Both the Astro host-adapter (`window[consoleNamespace].*`) and the package-root exports expose the same interface:
|
|
967
|
+
|
|
968
|
+
| Call | Effect |
|
|
969
|
+
|------|--------|
|
|
970
|
+
| `window.myapp.enableAutoload()` | Sets `${storagePrefix}:autoload` to `'1'`, arms the element-path inspector (`-elpath-enabled`), loads the panel bundle, mounts CLOSED. |
|
|
971
|
+
| `window.myapp.disableAutoload()` | Clears `:autoload`, `:visible`, `-elpath-enabled`, and the open-state key; unmounts the panel. |
|
|
972
|
+
| `enableAutoload()` (package-root export) | Same as the console form — for non-Astro hosts. |
|
|
973
|
+
| `disableAutoload()` (package-root export) | Same as the console form — for non-Astro hosts. |
|
|
974
|
+
| `shouldAutoload()` (package-root export) | Returns `true` iff the flag is currently set. |
|
|
975
|
+
|
|
976
|
+
#### The `${storagePrefix}:autoload` flag
|
|
977
|
+
|
|
978
|
+
Stored in `localStorage` as `'1'` when armed, removed or `'0'` otherwise. The host-adapter's lazy-load gate reads this flag on every page load — when it is `'1'`, the panel bundle loads eagerly (the same as when the panel was previously visible or overrides are persisted). **General visitors** who have never called `enableAutoload()` have no flag and pay zero bundle cost.
|
|
979
|
+
|
|
980
|
+
#### Auto-remember on open
|
|
981
|
+
|
|
982
|
+
Opening the panel by any means — `showDesignPanel()`, `toggleDesignPanel()`, or clicking the panel's own header close button to re-open it — **automatically sets the `:autoload` flag**. This means once you open the panel you will be in owner-mode on subsequent page loads without calling `enableAutoload()` explicitly.
|
|
983
|
+
|
|
984
|
+
#### Element-path coupling
|
|
985
|
+
|
|
986
|
+
`enableAutoload()` arms the Alt+click element-path inspector by writing `-elpath-enabled = '1'`. The inspector runs inside the Preact shell; mounting the shell CLOSED (rather than unmounted) keeps the inspector functional even while the panel UI is hidden. You can still turn the inspector off via the in-panel toggle — `disableAutoload()` clears it as part of full teardown.
|
|
987
|
+
|
|
988
|
+
#### Auto-remember footgun
|
|
989
|
+
|
|
990
|
+
Because **any open trigger sets `:autoload`**, a visible "open panel" button, keyboard shortcut, or similar affordance on your site becomes a de-facto owner-mode opt-in for anyone who clicks it. On an owner-only public site:
|
|
991
|
+
|
|
992
|
+
- Gate or omit such triggers (hide them behind a login check, remove them from the production build, etc.).
|
|
993
|
+
- Rely on the console `enableAutoload()` call as the owner's explicit opt-in.
|
|
994
|
+
- See the [Load the panel only for you](/docs/recipes/owner-autoload) recipe for a safe worked example.
|
|
995
|
+
|
|
996
|
+
---
|
|
997
|
+
|
|
947
998
|
## 11. Tailwind not required
|
|
948
999
|
|
|
949
1000
|
The panel ships its own bundled CSS scoped under a panel-private namespace:
|
|
@@ -985,23 +1036,25 @@ The CSS variables the panel **writes to** (the `cssVar` field on each `TokenDef`
|
|
|
985
1036
|
|
|
986
1037
|
## 12. Bundler notes
|
|
987
1038
|
|
|
988
|
-
The package builds in **Vite library mode
|
|
989
|
-
|
|
990
|
-
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:
|
|
991
1040
|
|
|
992
1041
|
```ts
|
|
993
|
-
|
|
1042
|
+
// src/index.tsx (shipped in dist/index.js)
|
|
1043
|
+
import panelCss from './styles/panel.css?inline'; // string — survives Vite library build
|
|
994
1044
|
```
|
|
995
1045
|
|
|
996
|
-
|
|
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):
|
|
997
1049
|
|
|
998
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:
|
|
999
1054
|
import '@takazudo/zdtp/styles.css';
|
|
1000
1055
|
```
|
|
1001
1056
|
|
|
1002
|
-
If
|
|
1003
|
-
|
|
1004
|
-
(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.
|
|
1005
1058
|
|
|
1006
1059
|
### 12.1 Host-adapter side-effect import (paired-unit contract)
|
|
1007
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
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Consumes the `TweakState` shape directly:
|
|
7
7
|
*
|
|
8
8
|
* Color tokens:
|
|
9
|
-
* - `state.color.palette: string[]` — palette hex
|
|
9
|
+
* - `state.color.palette: string[]` — palette color values (hex, or
|
|
10
|
+
* `oklch(...)` when the palette tier declares `type.format: 'oklch'`)
|
|
10
11
|
* - `state.color.semanticMappings: Record<string, number | 'bg' | 'fg'>` —
|
|
11
12
|
* semantic-token → palette-index map
|
|
12
13
|
* - `state.color.background` / `foreground` — palette indices used when a
|
|
@@ -27,7 +28,8 @@
|
|
|
27
28
|
* Specifically:
|
|
28
29
|
*
|
|
29
30
|
* - Palette slots (resolved via `resolvePaletteCssVar(cluster, i)`) —
|
|
30
|
-
* EMITTED as hex
|
|
31
|
+
* EMITTED as the stored color value (hex, or `oklch(...)` for
|
|
32
|
+
* oklch-format palettes).
|
|
31
33
|
* - Semantic tokens (`cluster.semanticCssNames` entries) — EMITTED as
|
|
32
34
|
* `var(--<paletteSlotName>)` so the rewrite preserves the indirection
|
|
33
35
|
* that the hand-authored CSS relies on.
|
|
@@ -68,4 +70,3 @@ import type { TabConfig } from '../tokens/tier-model';
|
|
|
68
70
|
* non-color token resolution works without a live panel config singleton.
|
|
69
71
|
*/
|
|
70
72
|
export declare function buildApplyOverrides(state: TweakState, colorDefaults: ColorTweakState | undefined, cluster?: ColorClusterConfig, tabs?: readonly TabConfig[]): Record<string, string>;
|
|
71
|
-
//# sourceMappingURL=build-apply-overrides.d.ts.map
|
|
@@ -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,3 @@ 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
|
package/dist/apply-modal.d.ts
CHANGED
|
@@ -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
|
-
* //
|
|
13
|
-
* //
|
|
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>
|
|
@@ -1,79 +1,102 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { Z as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { c as h, g as u, a as g, b as w, d as y, e as P } from "../panel-config-3tBEHjvZ.js";
|
|
2
|
+
import { g as d, Z as b } from "../tweak-state-BEx1SHu7.js";
|
|
3
|
+
import { s as _, l as A, a as c, c as k, b as I } from "../autoload-state-B1MWY_Pp.js";
|
|
4
|
+
const l = "tokenpanel-config";
|
|
5
|
+
function E() {
|
|
5
6
|
if (typeof document > "u")
|
|
6
7
|
throw new Error(
|
|
7
8
|
"[design-token-panel] host-adapter loaded without a document; expected to run in a browser context."
|
|
8
9
|
);
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
10
|
+
const n = document.getElementById(l);
|
|
11
|
+
if (!n)
|
|
11
12
|
throw new Error(
|
|
12
|
-
`[design-token-panel] Inline config script #${
|
|
13
|
+
`[design-token-panel] Inline config script #${l} not found. Ensure <DesignTokenPanelHost config={...} /> is rendered on this page before the host script runs.`
|
|
13
14
|
);
|
|
14
|
-
const
|
|
15
|
-
let
|
|
15
|
+
const o = n.textContent ?? "";
|
|
16
|
+
let e;
|
|
16
17
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
18
|
+
e = JSON.parse(o);
|
|
19
|
+
} catch (a) {
|
|
19
20
|
throw new Error(
|
|
20
|
-
`[design-token-panel] Failed to parse inline config from #${
|
|
21
|
+
`[design-token-panel] Failed to parse inline config from #${l}: ${a.message}`
|
|
21
22
|
);
|
|
22
23
|
}
|
|
23
|
-
return
|
|
24
|
+
return P(e), e;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
26
|
+
function C(n) {
|
|
27
|
+
return n.__zudoDesignTokenPanelAdapter || (n.__zudoDesignTokenPanelAdapter = {}), n.__zudoDesignTokenPanelAdapter;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
let
|
|
31
|
-
return
|
|
29
|
+
function S(n, o) {
|
|
30
|
+
const e = C(n);
|
|
31
|
+
let a = e[o];
|
|
32
|
+
return a || (a = { bound: !1, modulePromise: null }, e[o] = a), a;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function T(n) {
|
|
34
35
|
try {
|
|
35
|
-
return window.localStorage.getItem(
|
|
36
|
+
return window.localStorage.getItem(n) === "1";
|
|
36
37
|
} catch {
|
|
37
38
|
return !1;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function v(n, o) {
|
|
41
42
|
try {
|
|
42
|
-
const
|
|
43
|
-
return
|
|
43
|
+
const e = window.localStorage;
|
|
44
|
+
return e.getItem(o) !== null || e.getItem(n) !== null;
|
|
44
45
|
} catch {
|
|
45
46
|
return !1;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
async function
|
|
49
|
-
return
|
|
49
|
+
async function i(n) {
|
|
50
|
+
return n.modulePromise === null && (n.modulePromise = import("@takazudo/zdtp").then((o) => {
|
|
50
51
|
try {
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
const e = u(), a = o.__panelConfigForTest();
|
|
53
|
+
e !== a && console.warn(
|
|
53
54
|
"[design-token-panel] Singleton-sharing check failed: the host adapter and the panel module observed different PanelConfig singletons. This indicates the package's `config/panel-config` module is no longer code-split into a single shared chunk. The panel may behave correctly today, but storage keys / namespaces / branding could diverge between the two surfaces in future bundles."
|
|
54
55
|
);
|
|
55
|
-
} catch (
|
|
56
|
+
} catch (e) {
|
|
56
57
|
console.warn(
|
|
57
|
-
"[design-token-panel] Singleton-sharing check could not run (likely an older dist without the __panelConfigForTest accessor): " +
|
|
58
|
+
"[design-token-panel] Singleton-sharing check could not run (likely an older dist without the __panelConfigForTest accessor): " + e.message
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
|
-
return
|
|
61
|
-
})),
|
|
61
|
+
return o;
|
|
62
|
+
})), n.modulePromise;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
await
|
|
67
|
-
},
|
|
68
|
-
await
|
|
69
|
-
},
|
|
70
|
-
await
|
|
71
|
-
|
|
64
|
+
function D(n, o, e, a, t) {
|
|
65
|
+
const s = n[o] ?? {};
|
|
66
|
+
s.showDesignPanel = async () => {
|
|
67
|
+
c(t, !0), await i(e), a.open();
|
|
68
|
+
}, s.hideDesignPanel = async () => {
|
|
69
|
+
await i(e), a.close();
|
|
70
|
+
}, s.toggleDesignPanel = async () => {
|
|
71
|
+
await i(e), a.toggle();
|
|
72
|
+
let r = !1;
|
|
73
|
+
try {
|
|
74
|
+
r = window.localStorage.getItem(d(t)) === "1";
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
r && c(t, !0);
|
|
78
|
+
}, s.enableAutoload = async () => {
|
|
79
|
+
(await i(e)).enableAutoload(t);
|
|
80
|
+
}, s.disableAutoload = async () => {
|
|
81
|
+
if (e.modulePromise !== null) {
|
|
82
|
+
(await i(e)).disableAutoload(t);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
k(t), I(!1, t);
|
|
86
|
+
try {
|
|
87
|
+
window.localStorage.setItem(g(t), "0");
|
|
88
|
+
} catch {
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
window.localStorage.removeItem(d(t));
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
}, n[o] = s;
|
|
72
95
|
}
|
|
73
96
|
(function() {
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
(
|
|
97
|
+
const o = E(), e = o.legacyIdRenameMap ? o : { ...o, legacyIdRenameMap: { ...b } }, a = h(e), t = u(), s = window, r = S(s, t.storagePrefix);
|
|
98
|
+
if (D(s, t.consoleNamespace, r, a, t), r.bound) return;
|
|
99
|
+
r.bound = !0;
|
|
100
|
+
const f = g(t), p = w(t), m = y(t);
|
|
101
|
+
(T(f) || v(p, m) || _(t) || A(t)) && i(r);
|
|
79
102
|
})();
|
package/dist/astro/index.d.ts
CHANGED
|
@@ -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
|
package/dist/astro/index.js
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { g as a, j as o } from "./panel-config-3tBEHjvZ.js";
|
|
2
|
+
function n(e = a()) {
|
|
3
|
+
return `${e.storagePrefix}-elpath-enabled`;
|
|
4
|
+
}
|
|
5
|
+
function l(e = a()) {
|
|
6
|
+
try {
|
|
7
|
+
return localStorage.getItem(n(e)) === "1";
|
|
8
|
+
} catch {
|
|
9
|
+
return !1;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function c(e, t = a()) {
|
|
13
|
+
try {
|
|
14
|
+
localStorage.setItem(n(t), e ? "1" : "0");
|
|
15
|
+
} catch {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function d(e) {
|
|
19
|
+
if (typeof window > "u") return !1;
|
|
20
|
+
try {
|
|
21
|
+
return window.localStorage.getItem(o(e)) === "1";
|
|
22
|
+
} catch {
|
|
23
|
+
return !1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function u(e, t) {
|
|
27
|
+
if (!(typeof window > "u"))
|
|
28
|
+
try {
|
|
29
|
+
window.localStorage.setItem(o(e), t ? "1" : "0");
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function f(e) {
|
|
34
|
+
if (!(typeof window > "u"))
|
|
35
|
+
try {
|
|
36
|
+
window.localStorage.removeItem(o(e));
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
u as a,
|
|
42
|
+
c as b,
|
|
43
|
+
f as c,
|
|
44
|
+
l,
|
|
45
|
+
d as s
|
|
46
|
+
};
|
package/dist/bin/cors.d.ts
CHANGED
package/dist/bin/parse-args.d.ts
CHANGED
|
@@ -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
|
package/dist/bin/server.d.ts
CHANGED
package/dist/bin/server.js
CHANGED
|
@@ -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-
|
|
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/
|
|
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
|