@takazudo/zdtp 0.5.0 → 0.5.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 +71 -0
- package/PORTABLE-CONTRACT.md +101 -18
- package/README.md +7 -5
- package/dist/astro/host-adapter.js +46 -50
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-DmTY6tRy.js → autoload-state-BI4-9A58.js} +1 -1
- package/dist/config/panel-config.d.ts +7 -0
- package/dist/constants.d.ts +24 -4
- package/dist/constants.js +20 -11
- package/dist/controls/actions-menu-popover.d.ts +5 -1
- package/dist/controls/role-button.d.ts +4 -1
- package/dist/dom-tweaker/dom-tweaker-toggle-button.d.ts +3 -1
- package/dist/element-inspect/element-inspect-toggle-button.d.ts +3 -1
- package/dist/element-path/element-path-toggle-button.d.ts +3 -1
- package/dist/{index-By6zFdp4.js → index-CAQf4HKm.js} +2 -2
- package/dist/{index-CHzTi0y5.js → index-ChsJ5u4d.js} +2130 -2063
- package/dist/index.d.ts +2 -0
- package/dist/index.js +28 -27
- package/dist/{panel-config-BSu6TUht.js → panel-config-CqbuB0nh.js} +145 -141
- package/dist/tabs/_generic-item-editor.d.ts +2 -2
- package/dist/tabs/flat/token-row.d.ts +3 -1
- package/dist/testing.js +2 -2
- package/dist/{tweak-state-B7ok3Ob3.js → tweak-state-c53KtLHq.js} +1 -1
- package/dist/zdtp.css +1 -1
- package/package.json +2 -2
package/dist/constants.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
return e.storagePrefix === void 0 || e.storagePrefix ===
|
|
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
4
|
}
|
|
5
|
-
const
|
|
5
|
+
const s = {
|
|
6
6
|
":visible": { acceptedValues: ["1"], requiredConfig: null },
|
|
7
7
|
"-open": { acceptedValues: ["1"], requiredConfig: null },
|
|
8
8
|
":autoload": { acceptedValues: ["1", "auto"], requiredConfig: null },
|
|
9
9
|
"-elpath-enabled": { acceptedValues: ["1"], requiredConfig: null },
|
|
10
10
|
"-domtweaker-enabled": { acceptedValues: ["1"], requiredConfig: "domTweaker" }
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
);
|
|
14
22
|
},
|
|
15
23
|
valueRules: {
|
|
16
24
|
blank: !1,
|
|
@@ -22,9 +30,10 @@ const a = {
|
|
|
22
30
|
}
|
|
23
31
|
};
|
|
24
32
|
export {
|
|
25
|
-
|
|
33
|
+
o as DEFAULT_STORAGE_PREFIX,
|
|
26
34
|
l as DEFAULT_TOGGLE_EVENT,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
30
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
|
|
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,
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { ComponentChildren, JSX } from 'preact';
|
|
13
13
|
export interface ActionsMenuAction {
|
|
14
|
+
/** Stable action id, emitted as `data-zdtp-action` on the rendered item.
|
|
15
|
+
* Required so the DOM hook can never silently go missing; labels are
|
|
16
|
+
* display strings and must not be used as the key (PORTABLE-CONTRACT §7.6). */
|
|
17
|
+
id: string;
|
|
14
18
|
label: string;
|
|
15
19
|
onSelect: () => void;
|
|
16
20
|
disabled?: boolean;
|
|
@@ -16,5 +16,8 @@ export interface RoleButtonProps {
|
|
|
16
16
|
title?: string;
|
|
17
17
|
'aria-label'?: string;
|
|
18
18
|
'data-testid'?: string;
|
|
19
|
+
/** Stable per-action DOM hook for consumer tests (see PORTABLE-CONTRACT §7.6).
|
|
20
|
+
* Keyed on an action id, never on the display label. */
|
|
21
|
+
'data-zdtp-action'?: string;
|
|
19
22
|
}
|
|
20
|
-
export declare function RoleButton({ children, onClick, className, 'aria-disabled': ariaDisabled, ariaProps, tabIndex, elementRef, id, title, 'aria-label': ariaLabel, 'data-testid': testId, }: RoleButtonProps): JSX.Element;
|
|
23
|
+
export declare function RoleButton({ children, onClick, className, 'aria-disabled': ariaDisabled, ariaProps, tabIndex, elementRef, id, title, 'aria-label': ariaLabel, 'data-testid': testId, 'data-zdtp-action': zdtpAction, }: RoleButtonProps): JSX.Element;
|
|
@@ -6,4 +6,6 @@
|
|
|
6
6
|
* import through DomTweakerOrchestrator.
|
|
7
7
|
*/
|
|
8
8
|
import type { JSX } from 'preact';
|
|
9
|
-
export declare function DomTweakerToggleButton(
|
|
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(
|
|
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(
|
|
13
|
+
export declare function ElementPathToggleButton({ compact }?: {
|
|
14
|
+
compact?: boolean;
|
|
15
|
+
}): JSX.Element | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as y, jsxs as K, Fragment as kt } from "preact/jsx-runtime";
|
|
2
2
|
import { useEffect as P, useState as Y, useRef as O, useMemo as J, useCallback as X } from "preact/hooks";
|
|
3
|
-
import { b as ft, p as wt, u as ht, a as Ne, A as bt, Z as gt } from "./index-
|
|
4
|
-
import { g as vt, m as j } from "./panel-config-
|
|
3
|
+
import { b as ft, p as wt, u as ht, a as Ne, A as bt, Z as gt } from "./index-ChsJ5u4d.js";
|
|
4
|
+
import { g as vt, m as j } from "./panel-config-CqbuB0nh.js";
|
|
5
5
|
const xt = (e, o) => {
|
|
6
6
|
const t = new Array(e.length + o.length);
|
|
7
7
|
for (let r = 0; r < e.length; r++)
|