@takazudo/zdtp 0.4.15 → 0.5.1

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.
@@ -0,0 +1,86 @@
1
+ /** Default storage-key prefix used by the single-panel configuration. */
2
+ export declare const DEFAULT_STORAGE_PREFIX = "zudo-design-token-panel";
3
+ /** Historical public window-event name for the default panel instance. */
4
+ export declare const DEFAULT_TOGGLE_EVENT = "toggle-design-token-panel";
5
+ /**
6
+ * Resolve the window-event name that toggles a panel instance.
7
+ *
8
+ * The default prefix keeps the historical event name, even when a host
9
+ * supplies a `toggleEvent`. Other prefixes honor an explicit event name and
10
+ * otherwise derive one from the prefix.
11
+ */
12
+ export declare function resolveToggleEventName(cfg: {
13
+ storagePrefix?: string;
14
+ toggleEvent?: string;
15
+ }): string;
16
+ /**
17
+ * The five fixed eager-load signals, keyed by suffix relative to storagePrefix.
18
+ * Only acceptedValues activate a flag; presence alone is insufficient.
19
+ * requiredConfig means that property must be !== undefined in the panel config.
20
+ * This excludes preference keys and is NOT the whole gate: also inspect
21
+ * EAGER_LOAD_GATE_STATE_FAMILY, whose keys require a content check.
22
+ */
23
+ export declare const EAGER_LOAD_GATE_KEY_SUFFIXES: {
24
+ readonly ':visible': {
25
+ readonly acceptedValues: readonly ["1"];
26
+ readonly requiredConfig: null;
27
+ };
28
+ readonly '-open': {
29
+ readonly acceptedValues: readonly ["1"];
30
+ readonly requiredConfig: null;
31
+ };
32
+ readonly ':autoload': {
33
+ readonly acceptedValues: readonly ["1", "auto"];
34
+ readonly requiredConfig: null;
35
+ };
36
+ readonly '-elpath-enabled': {
37
+ readonly acceptedValues: readonly ["1"];
38
+ readonly requiredConfig: null;
39
+ };
40
+ readonly '-domtweaker-enabled': {
41
+ readonly acceptedValues: readonly ["1"];
42
+ readonly requiredConfig: "domTweaker";
43
+ };
44
+ };
45
+ /**
46
+ * The single registry of state-key suffixes the current loader can read.
47
+ *
48
+ * EVERY storage-format version bump must update this registry in the same
49
+ * change that teaches the loader to read that version. The synchronous eager
50
+ * gate intentionally probes only these bounded, readable versions; speculative
51
+ * future versions would promise recovery that the loader cannot perform.
52
+ */
53
+ export declare const READABLE_STATE_KEY_SUFFIXES: {
54
+ readonly v1: "-state";
55
+ readonly v2: "-state-v2";
56
+ readonly v3: "-state-v3";
57
+ readonly v4: "-state-v4";
58
+ };
59
+ /**
60
+ * The sixth eager-load signal: exact readable state keys, with a content
61
+ * check. Missing keys and raw empty strings are blank;
62
+ * JSON null and empty objects/arrays do not activate. Non-empty collections and
63
+ * all other parsed primitives (even false, 0, or JSON "") activate. Malformed
64
+ * JSON fails open so the panel can migrate or reject the stored payload.
65
+ *
66
+ * matchesKey compares complete strings constructed from the literal prefix, so
67
+ * regex metacharacters are safe and sibling-instance keys are excluded.
68
+ * These are storage signal descriptions, not a storage reader or panel bootstrap.
69
+ */
70
+ export declare const EAGER_LOAD_GATE_STATE_FAMILY: {
71
+ readonly keySuffixes: {
72
+ readonly v1: "-state";
73
+ readonly v2: "-state-v2";
74
+ readonly v3: "-state-v3";
75
+ readonly v4: "-state-v4";
76
+ };
77
+ readonly matchesKey: (storagePrefix: string, key: string) => boolean;
78
+ readonly valueRules: {
79
+ readonly blank: false;
80
+ readonly jsonNull: false;
81
+ readonly object: "non-empty";
82
+ readonly array: "non-empty";
83
+ readonly primitive: true;
84
+ readonly malformedJson: true;
85
+ };
86
+ };
@@ -0,0 +1,39 @@
1
+ const o = "zudo-design-token-panel", l = "toggle-design-token-panel";
2
+ function r(e) {
3
+ return e.storagePrefix === void 0 || e.storagePrefix === o ? l : e.toggleEvent ?? `toggle-${e.storagePrefix}`;
4
+ }
5
+ const s = {
6
+ ":visible": { acceptedValues: ["1"], requiredConfig: null },
7
+ "-open": { acceptedValues: ["1"], requiredConfig: null },
8
+ ":autoload": { acceptedValues: ["1", "auto"], requiredConfig: null },
9
+ "-elpath-enabled": { acceptedValues: ["1"], requiredConfig: null },
10
+ "-domtweaker-enabled": { acceptedValues: ["1"], requiredConfig: "domTweaker" }
11
+ }, t = {
12
+ v1: "-state",
13
+ v2: "-state-v2",
14
+ v3: "-state-v3",
15
+ v4: "-state-v4"
16
+ }, u = {
17
+ keySuffixes: t,
18
+ matchesKey(e, a) {
19
+ return Object.values(t).some(
20
+ (n) => a === e + n
21
+ );
22
+ },
23
+ valueRules: {
24
+ blank: !1,
25
+ jsonNull: !1,
26
+ object: "non-empty",
27
+ array: "non-empty",
28
+ primitive: !0,
29
+ malformedJson: !0
30
+ }
31
+ };
32
+ export {
33
+ o as DEFAULT_STORAGE_PREFIX,
34
+ l as DEFAULT_TOGGLE_EVENT,
35
+ s as EAGER_LOAD_GATE_KEY_SUFFIXES,
36
+ u as EAGER_LOAD_GATE_STATE_FAMILY,
37
+ t as READABLE_STATE_KEY_SUFFIXES,
38
+ r as resolveToggleEventName
39
+ };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * ActionsMenuPopover — narrow-panel replacement for the header action links
3
3
  * (Export / Load from JSON… / Apply / Reset), collapsed behind the kebab
4
- * trigger below the panel's <480px container-query breakpoint (#518).
4
+ * trigger when the header yields through its CSS container query (#787).
5
5
  *
6
6
  * A PLAIN popover of ordinary action RoleButtons, NOT an ARIA menu:
7
7
  * role="menu"/menuitem demands arrow-key navigation and focus management,
@@ -6,4 +6,6 @@
6
6
  * import through DomTweakerOrchestrator.
7
7
  */
8
8
  import type { JSX } from 'preact';
9
- export declare function DomTweakerToggleButton(): JSX.Element | null;
9
+ export declare function DomTweakerToggleButton({ compact }?: {
10
+ compact?: boolean;
11
+ }): JSX.Element | null;
@@ -1,3 +1,5 @@
1
1
  import type { JSX } from 'preact';
2
2
  /** Header control for the element → tokens picker. */
3
- export declare function ElementInspectToggleButton(): JSX.Element | null;
3
+ export declare function ElementInspectToggleButton({ compact }?: {
4
+ compact?: boolean;
5
+ }): JSX.Element | null;
@@ -10,4 +10,6 @@
10
10
  * through its `ariaProps` bag.
11
11
  */
12
12
  import type { JSX } from 'preact';
13
- export declare function ElementPathToggleButton(): JSX.Element | null;
13
+ export declare function ElementPathToggleButton({ compact }?: {
14
+ compact?: boolean;
15
+ }): JSX.Element | null;