@takazudo/zdtp 0.4.0 → 0.4.2
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 +37 -0
- package/README.md +58 -10
- package/dist/apply/build-apply-overrides.d.ts +4 -2
- package/dist/apply/build-apply-overrides.d.ts.map +1 -1
- package/dist/astro/host-adapter.js +67 -44
- package/dist/astro/index.js +1 -1
- package/dist/autoload-state-DsvvPDih.js +46 -0
- package/dist/components/palette-chart/palette-chart.d.ts +0 -1
- package/dist/components/palette-chart/palette-chart.d.ts.map +1 -1
- package/dist/config/panel-config.d.ts +8 -0
- package/dist/config/panel-config.d.ts.map +1 -1
- package/dist/element-path/element-path-state.d.ts +3 -2
- package/dist/element-path/element-path-state.d.ts.map +1 -1
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2596 -3626
- package/dist/{panel-config-066BPYJD.js → panel-config-DyVRQ2n1.js} +37 -33
- package/dist/panel.d.ts.map +1 -1
- package/dist/state/autoload-state.d.ts +92 -0
- package/dist/state/autoload-state.d.ts.map +1 -0
- package/dist/state/tweak-state.d.ts +18 -1
- package/dist/state/tweak-state.d.ts.map +1 -1
- package/dist/tabs/color-tab.d.ts +7 -4
- package/dist/tabs/color-tab.d.ts.map +1 -1
- package/dist/tabs/generic-tab.d.ts +1 -1
- package/dist/tabs/palette/palette-edit-view.d.ts +0 -1
- package/dist/tabs/palette/palette-edit-view.d.ts.map +1 -1
- package/dist/testing.js +2 -2
- package/dist/tweak-state-DzZVbY25.js +1779 -0
- package/dist/utils/design-token-serde.d.ts +2 -1
- package/dist/utils/design-token-serde.d.ts.map +1 -1
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
- package/dist/tweak-state-Do5gj6Nw.js +0 -730
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.2
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **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)
|
|
8
|
+
|
|
9
|
+
- **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.
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
The existing on-demand flow (`showDesignPanel()` / `hideDesignPanel()` / `toggleDesignPanel()`) is unchanged. Owner-autoload is an opt-in layer on top of it, not a replacement.
|
|
14
|
+
|
|
15
|
+
**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.
|
|
16
|
+
|
|
17
|
+
**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.
|
|
18
|
+
|
|
19
|
+
([#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))
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **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)
|
|
24
|
+
|
|
25
|
+
- **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)
|
|
26
|
+
|
|
27
|
+
### Other Changes
|
|
28
|
+
|
|
29
|
+
- **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)
|
|
30
|
+
- 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)
|
|
31
|
+
- Bump the `@takazudo/*` toolchain (zfb next.72, zudo-doc 2.1.2). (d711839)
|
|
32
|
+
- Doc-site migration to zudo-doc v2 — doc-site only, no package impact. ([#432](https://github.com/Takazudo/zudo-design-token-panel/pull/432))
|
|
33
|
+
|
|
34
|
+
## 0.4.1
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **Palette tab no longer renders unstyled for self-injection consumers.** The 0.4.0 palette-tab CSS (`palette-chart` / `palette-edit` / `palette-readout`) reached `dist/zdtp.css` but was missing from the stylesheet the panel self-injects at runtime, so consumers using `import('@takazudo/zdtp')` + `configurePanel(...)` without importing `@takazudo/zdtp/styles` saw collapsed swatch bars and a missing curve-editor canvas. The two palette stylesheets are now `@import`ed into the single `panel.css` aggregate (matching `color-picker.css`) so both CSS delivery paths stay in sync, guarded by a new static `Invariant G` test. ([#413](https://github.com/Takazudo/zudo-design-token-panel/issues/413))
|
|
39
|
+
|
|
3
40
|
## 0.4.0
|
|
4
41
|
|
|
5
42
|
### Features
|
package/README.md
CHANGED
|
@@ -530,8 +530,8 @@ const handle = configurePanel({
|
|
|
530
530
|
The Astro entry point (`<DesignTokenPanelHost>`) handles mounting for you. Internally:
|
|
531
531
|
|
|
532
532
|
- 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.
|
|
533
|
+
- 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.
|
|
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. **General visitors** (none of the four signals set) pay zero bundle cost.
|
|
535
535
|
|
|
536
536
|
For a Vite-only / non-Astro host, mount it yourself by importing the adapter module after `configurePanel(...)`. See §11.5.
|
|
537
537
|
|
|
@@ -891,6 +891,7 @@ Behaviour notes:
|
|
|
891
891
|
| `open` | `${storagePrefix}-open` | Mirror of the panel's `open` boolean (synchronous mount-time read — preserves user intent across reloads, fixes #1549). |
|
|
892
892
|
| `position` | `${storagePrefix}-position` | Drag position `{ top, right }` so the panel reappears where the user left it. |
|
|
893
893
|
| `visible` | `${storagePrefix}:visible` | Adapter-level visibility-intent flag, owned by the lazy-load gate. |
|
|
894
|
+
| `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
895
|
|
|
895
896
|
For example, with `storagePrefix: 'myapp-design-token-panel'`:
|
|
896
897
|
|
|
@@ -901,11 +902,12 @@ myapp-design-token-panel-state
|
|
|
901
902
|
myapp-design-token-panel-open
|
|
902
903
|
myapp-design-token-panel-position
|
|
903
904
|
myapp-design-token-panel:visible
|
|
905
|
+
myapp-design-token-panel:autoload
|
|
904
906
|
```
|
|
905
907
|
|
|
906
|
-
### Note: colon vs dash
|
|
908
|
+
### Note: colon vs dash — `visible` and `autoload`
|
|
907
909
|
|
|
908
|
-
The `visible`
|
|
910
|
+
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
911
|
|
|
910
912
|
### Scheme changes and the global tweak model
|
|
911
913
|
|
|
@@ -924,19 +926,27 @@ Two consequences worth knowing as a host integrator:
|
|
|
924
926
|
|
|
925
927
|
## 10. Console API contract
|
|
926
928
|
|
|
927
|
-
Once `configurePanel` has run, the package installs
|
|
929
|
+
Once `configurePanel` has run, the package installs async helpers on the global `window[consoleNamespace]` object:
|
|
928
930
|
|
|
929
931
|
```ts
|
|
930
|
-
window.myapp.showDesignPanel();
|
|
931
|
-
window.myapp.hideDesignPanel();
|
|
932
|
-
window.myapp.toggleDesignPanel(); // toggle
|
|
932
|
+
window.myapp.showDesignPanel(); // open the panel (lazy-loads the bundle on first call)
|
|
933
|
+
window.myapp.hideDesignPanel(); // close the panel
|
|
934
|
+
window.myapp.toggleDesignPanel(); // toggle open/closed
|
|
935
|
+
|
|
936
|
+
// Owner-autoload (see §10.1)
|
|
937
|
+
window.myapp.enableAutoload(); // arm owner-mode; panel loads CLOSED with Alt+click ready
|
|
938
|
+
window.myapp.disableAutoload(); // disarm owner-mode; unmounts the panel
|
|
933
939
|
```
|
|
934
940
|
|
|
935
|
-
All
|
|
941
|
+
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.
|
|
942
|
+
|
|
943
|
+
### Backward-compatible: the on-demand flow is unchanged
|
|
944
|
+
|
|
945
|
+
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
946
|
|
|
937
947
|
### Co-existing helpers on the same namespace
|
|
938
948
|
|
|
939
|
-
The adapter **merges** its
|
|
949
|
+
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
950
|
|
|
941
951
|
### Default
|
|
942
952
|
|
|
@@ -944,6 +954,44 @@ There is no default `consoleNamespace` exposed to consumers — the field is req
|
|
|
944
954
|
|
|
945
955
|
---
|
|
946
956
|
|
|
957
|
+
### 10.1 Owner-autoload — loading the panel only for you
|
|
958
|
+
|
|
959
|
+
**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.
|
|
960
|
+
|
|
961
|
+
#### API surface
|
|
962
|
+
|
|
963
|
+
Both the Astro host-adapter (`window[consoleNamespace].*`) and the package-root exports expose the same interface:
|
|
964
|
+
|
|
965
|
+
| Call | Effect |
|
|
966
|
+
|------|--------|
|
|
967
|
+
| `window.myapp.enableAutoload()` | Sets `${storagePrefix}:autoload` to `'1'`, arms the element-path inspector (`-elpath-enabled`), loads the panel bundle, mounts CLOSED. |
|
|
968
|
+
| `window.myapp.disableAutoload()` | Clears `:autoload`, `:visible`, `-elpath-enabled`, and the open-state key; unmounts the panel. |
|
|
969
|
+
| `enableAutoload()` (package-root export) | Same as the console form — for non-Astro hosts. |
|
|
970
|
+
| `disableAutoload()` (package-root export) | Same as the console form — for non-Astro hosts. |
|
|
971
|
+
| `shouldAutoload()` (package-root export) | Returns `true` iff the flag is currently set. |
|
|
972
|
+
|
|
973
|
+
#### The `${storagePrefix}:autoload` flag
|
|
974
|
+
|
|
975
|
+
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.
|
|
976
|
+
|
|
977
|
+
#### Auto-remember on open
|
|
978
|
+
|
|
979
|
+
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.
|
|
980
|
+
|
|
981
|
+
#### Element-path coupling
|
|
982
|
+
|
|
983
|
+
`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.
|
|
984
|
+
|
|
985
|
+
#### Auto-remember footgun
|
|
986
|
+
|
|
987
|
+
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:
|
|
988
|
+
|
|
989
|
+
- Gate or omit such triggers (hide them behind a login check, remove them from the production build, etc.).
|
|
990
|
+
- Rely on the console `enableAutoload()` call as the owner's explicit opt-in.
|
|
991
|
+
- See the [Load the panel only for you](/docs/recipes/owner-autoload) recipe for a safe worked example.
|
|
992
|
+
|
|
993
|
+
---
|
|
994
|
+
|
|
947
995
|
## 11. Tailwind not required
|
|
948
996
|
|
|
949
997
|
The panel ships its own bundled CSS scoped under a panel-private namespace:
|
|
@@ -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.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-apply-overrides.d.ts","sourceRoot":"","sources":["../../src/apply/build-apply-overrides.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"build-apply-overrides.d.ts","sourceRoot":"","sources":["../../src/apply/build-apply-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,aAAa,EAAE,eAAe,GAAG,SAAS,EAC1C,OAAO,GAAE,kBAA8C,EACvD,IAAI,GAAE,SAAS,SAAS,EAA0B,GACjD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8ExB"}
|
|
@@ -1,79 +1,102 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { Z as
|
|
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";
|
|
3
4
|
const i = "tokenpanel-config";
|
|
4
|
-
function
|
|
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(i);
|
|
11
|
+
if (!n)
|
|
11
12
|
throw new Error(
|
|
12
13
|
`[design-token-panel] Inline config script #${i} 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 #${i}: ${
|
|
21
|
+
`[design-token-panel] Failed to parse inline config from #${i}: ${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 l(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 l(e), a.open();
|
|
68
|
+
}, s.hideDesignPanel = async () => {
|
|
69
|
+
await l(e), a.close();
|
|
70
|
+
}, s.toggleDesignPanel = async () => {
|
|
71
|
+
await l(e);
|
|
72
|
+
let r = !1;
|
|
73
|
+
try {
|
|
74
|
+
r = window.localStorage.getItem(d(t)) !== "1";
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
a.toggle(), r && c(t, !0);
|
|
78
|
+
}, s.enableAutoload = async () => {
|
|
79
|
+
(await l(e)).enableAutoload(t);
|
|
80
|
+
}, s.disableAutoload = async () => {
|
|
81
|
+
if (e.modulePromise !== null) {
|
|
82
|
+
(await l(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)) && l(r);
|
|
79
102
|
})();
|
package/dist/astro/index.js
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { g as a, j as o } from "./panel-config-DyVRQ2n1.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
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette-chart.d.ts","sourceRoot":"","sources":["../../../src/components/palette-chart/palette-chart.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"palette-chart.d.ts","sourceRoot":"","sources":["../../../src/components/palette-chart/palette-chart.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,YAAY,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAsDzD,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,mFAAmF;IACnF,aAAa,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,eAAe,EAAE;QAAE,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACxD,4FAA4F;IAC5F,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,wCAAwC;IACxC,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,kFAAkF;IAClF,eAAe,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAsCD,iBAAS,gBAAgB,CAAC,EACxB,MAAM,EACN,aAAa,EACb,eAAe,EACf,QAAQ,EACR,aAAa,EAIb,aAAa,EACb,WAAW,GACZ,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAgYjC;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,yBAAyB,CAAC;AAEnD,eAAe,YAAY,CAAC"}
|
|
@@ -398,6 +398,14 @@ export declare function storageKey_density(cfg: PanelConfig): string;
|
|
|
398
398
|
* continuity.
|
|
399
399
|
*/
|
|
400
400
|
export declare function storageKey_visible(cfg: PanelConfig): string;
|
|
401
|
+
/**
|
|
402
|
+
* Adapter-level owner-autoload intent flag, paired with `:visible`.
|
|
403
|
+
*
|
|
404
|
+
* Marks this browser as the site-owner device so the host-adapter eagerly
|
|
405
|
+
* loads the bundle on every subsequent visit. Uses the same `:` separator as
|
|
406
|
+
* `:visible` (distinct from the `-` separator on all other derived keys).
|
|
407
|
+
*/
|
|
408
|
+
export declare function storageKey_autoload(cfg: PanelConfig): string;
|
|
401
409
|
/** DOM id of the root element the Preact panel tree mounts into. */
|
|
402
410
|
export declare function panelRootId(cfg: PanelConfig): string;
|
|
403
411
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-config.d.ts","sourceRoot":"","sources":["../../src/config/panel-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IAC7D,KAAK,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,gHAAgH;IAChH,gBAAgB,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B;;;;;;;;;;;;;;OAcG;IACH,IAAI,EAAE,SAAS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,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAEvD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,WAAW,CAqEnF;AAkMD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,WAA8B,GAAG,eAAe,CAExF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI,CAO/E"}
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
* `panelConfig.storagePrefix` at call-time (never at module init) so a host's
|
|
11
11
|
* `configurePanel({ storagePrefix })` is respected.
|
|
12
12
|
*/
|
|
13
|
+
import type { PanelConfig } from '../config/panel-config';
|
|
13
14
|
/**
|
|
14
15
|
* Load the persisted enabled flag from localStorage. Defaults to `false`
|
|
15
16
|
* (inspect mode off) on any parse/access failure or when absent.
|
|
16
17
|
*/
|
|
17
|
-
export declare function loadElementPathEnabled(): boolean;
|
|
18
|
+
export declare function loadElementPathEnabled(cfg?: PanelConfig): boolean;
|
|
18
19
|
/** Persist the enabled flag to localStorage. Degrades silently when storage is unavailable. */
|
|
19
|
-
export declare function saveElementPathEnabled(enabled: boolean): void;
|
|
20
|
+
export declare function saveElementPathEnabled(enabled: boolean, cfg?: PanelConfig): void;
|
|
20
21
|
//# sourceMappingURL=element-path-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-path-state.d.ts","sourceRoot":"","sources":["../../src/element-path/element-path-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"element-path-state.d.ts","sourceRoot":"","sources":["../../src/element-path/element-path-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAqB1D;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,WAA8B,GAAG,OAAO,CAMnF;AAED,+FAA+F;AAC/F,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,GAAG,GAAE,WAA8B,GAClC,IAAI,CAMN"}
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,45 @@ export { emptyOverrides } from './state/tweak-state';
|
|
|
63
63
|
export declare function showDesignTokenPanel(): void;
|
|
64
64
|
export declare function hideDesignTokenPanel(): void;
|
|
65
65
|
export declare function toggleDesignPanel(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Arm the owner-autoload flag for a panel instance (defaults to the active
|
|
68
|
+
* default instance).
|
|
69
|
+
*
|
|
70
|
+
* For non-Astro hosts (e.g. the doc site bootstrapped via `@takazudo/zudo-doc`)
|
|
71
|
+
* that cannot use the Astro console adapter (S2); the adapter also delegates its
|
|
72
|
+
* per-namespace `enableAutoload` here with the captured `cfg` so it targets the
|
|
73
|
+
* right instance on multi-instance pages. Mirrors the S2 contract from
|
|
74
|
+
* `autoload-state.ts §enableAutoload()`:
|
|
75
|
+
* 1. Sets `:autoload = '1'`.
|
|
76
|
+
* 2. Sets `-elpath-enabled = '1'` to arm the alt+click inspector.
|
|
77
|
+
* 3. Mounts the Preact shell CLOSED (element-path inspector activates without
|
|
78
|
+
* opening the panel UI).
|
|
79
|
+
*/
|
|
80
|
+
export declare function enableAutoload(cfg?: PanelConfig): void;
|
|
81
|
+
/**
|
|
82
|
+
* Disarm the owner-autoload flag for a panel instance (defaults to the active
|
|
83
|
+
* default instance) and fully tear down the owner-mode state.
|
|
84
|
+
*
|
|
85
|
+
* The Astro host adapter delegates its per-namespace `disableAutoload` here with
|
|
86
|
+
* the captured `cfg`, so the live Alt+click inspector is unmounted immediately
|
|
87
|
+
* (not merely closed) and the right instance is targeted on multi-instance
|
|
88
|
+
* pages. Mirrors the S2 contract from `autoload-state.ts §disableAutoload()`:
|
|
89
|
+
* 1. Clears `:autoload`.
|
|
90
|
+
* 2. Clears `:visible` (sets to `'0'`).
|
|
91
|
+
* 3. Clears `-elpath-enabled` (sets to `'0'`).
|
|
92
|
+
* 4. Removes the open-state key so the next mount starts closed.
|
|
93
|
+
* 5. Unmounts the Preact shell (drives effect cleanups, removes root).
|
|
94
|
+
*/
|
|
95
|
+
export declare function disableAutoload(cfg?: PanelConfig): void;
|
|
96
|
+
/**
|
|
97
|
+
* Return `true` iff the default panel instance has the owner-autoload flag set.
|
|
98
|
+
* Thin wrapper over `shouldAutoload(cfg)` from `./state/autoload-state` that
|
|
99
|
+
* reads the default instance's config so non-Astro hosts do not need to import
|
|
100
|
+
* from the internal sub-path.
|
|
101
|
+
*/
|
|
102
|
+
export declare function shouldAutoload(): boolean;
|
|
103
|
+
/** Test-only: invoke `reapplyFromStorage` with the current active config. */
|
|
104
|
+
export declare function __reapplyFromStorageForTests(): void;
|
|
66
105
|
/**
|
|
67
106
|
* Apply persisted token overrides directly to `:root` BEFORE any Preact
|
|
68
107
|
* render. Called at adapter module init (and again on every `astro:page-load`)
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AASH,OAAO,oBAAoB,CAAC;AAc5B,OAAO,EAUL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AASH,OAAO,oBAAoB,CAAC;AAc5B,OAAO,EAUL,KAAK,WAAW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