@reopt-ai/opt-devtool 1.0.1 → 1.0.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 +22 -0
- package/README.md +4 -2
- package/dist/brandapp/index.cjs +11 -8
- package/dist/brandapp/index.d.cts +14 -17
- package/dist/brandapp/index.d.ts +14 -17
- package/dist/brandapp/index.js +11 -8
- package/dist/datagrid/index.cjs +5 -5
- package/dist/datagrid/index.d.cts +3 -6
- package/dist/datagrid/index.d.ts +3 -6
- package/dist/datagrid/index.js +5 -5
- package/dist/editor/index.cjs +5 -5
- package/dist/editor/index.d.cts +3 -6
- package/dist/editor/index.d.ts +3 -6
- package/dist/editor/index.js +5 -5
- package/dist/harness/index.cjs +1 -1
- package/dist/harness/index.d.cts +6 -8
- package/dist/harness/index.d.ts +6 -8
- package/dist/harness/index.js +1 -2
- package/dist/{harness-DU8hP98g.js → harness-CJZXBH3w.js} +15 -23
- package/dist/{harness-CoRqiJWO.cjs → harness-CPOp9Wlj.cjs} +21 -23
- package/dist/index.cjs +46 -80
- package/dist/index.d.cts +7 -13
- package/dist/index.d.ts +7 -13
- package/dist/index.js +44 -78
- package/dist/{provider-Bn7CAE_Y.js → provider-Cjg2rSYG.js} +6 -12
- package/dist/{provider-CLRiXjfD.cjs → provider-H53ZWHCo.cjs} +8 -15
- package/dist/theme/index.cjs +9 -7
- package/dist/theme/index.d.cts +5 -8
- package/dist/theme/index.d.ts +5 -8
- package/dist/theme/index.js +9 -7
- package/dist/{theme-isolate-F-oX2d4W.js → theme-isolate-BOo3J259.js} +2 -3
- package/dist/{theme-isolate-DgSS935z.cjs → theme-isolate-D9AMkYrD.cjs} +2 -3
- package/dist/{types-DvhcaPXA.js → types-BKmW0EBr.js} +1 -2
- package/dist/{types-B_abMm2B.cjs → types-Bz4DijhU.cjs} +1 -2
- package/dist/{types-oHbLkgEH.d.ts → types-D_lNT2Nr.d.cts} +0 -4
- package/dist/{types-oHbLkgEH.d.cts → types-D_lNT2Nr.d.ts} +0 -4
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -2
- package/package.json +4 -4
package/dist/harness/index.d.cts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { ShellDevtoolSnapshot } from "@reopt-ai/opt-shell";
|
|
3
|
-
|
|
4
|
-
interface UseShellDevtoolBridgeOptions {
|
|
4
|
+
export interface UseShellDevtoolBridgeOptions {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
7
7
|
order?: number;
|
|
8
8
|
/** URL to the harness manager UI (e.g. "/builder/shells"). Shown as a link in the panel. */
|
|
9
9
|
managerHref?: string;
|
|
10
10
|
}
|
|
11
|
-
interface RegisteredShellDevtoolBridge {
|
|
11
|
+
export interface RegisteredShellDevtoolBridge {
|
|
12
12
|
inspect: (snapshot: ShellDevtoolSnapshot) => void;
|
|
13
13
|
}
|
|
14
|
-
declare function ShellOverlay({ snapshot }: {
|
|
14
|
+
export declare function ShellOverlay({ snapshot }: {
|
|
15
15
|
snapshot: ShellDevtoolSnapshot | null;
|
|
16
|
-
}):
|
|
16
|
+
}): React.JSX.Element | null;
|
|
17
17
|
/**
|
|
18
18
|
* Register the harness devtool bridge.
|
|
19
19
|
*
|
|
@@ -25,6 +25,4 @@ declare function ShellOverlay({ snapshot }: {
|
|
|
25
25
|
* different tab. The other bridges only render inside their tab and so can
|
|
26
26
|
* keep their snapshot fully local.
|
|
27
27
|
*/
|
|
28
|
-
declare function useShellDevtoolBridge({ id, label, order, managerHref }: UseShellDevtoolBridgeOptions): RegisteredShellDevtoolBridge;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { RegisteredShellDevtoolBridge, ShellOverlay, UseShellDevtoolBridgeOptions, useShellDevtoolBridge };
|
|
28
|
+
export declare function useShellDevtoolBridge({ id, label, order, managerHref }: UseShellDevtoolBridgeOptions): RegisteredShellDevtoolBridge;
|
package/dist/harness/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { ShellDevtoolSnapshot } from "@reopt-ai/opt-shell";
|
|
3
|
-
|
|
4
|
-
interface UseShellDevtoolBridgeOptions {
|
|
4
|
+
export interface UseShellDevtoolBridgeOptions {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
7
7
|
order?: number;
|
|
8
8
|
/** URL to the harness manager UI (e.g. "/builder/shells"). Shown as a link in the panel. */
|
|
9
9
|
managerHref?: string;
|
|
10
10
|
}
|
|
11
|
-
interface RegisteredShellDevtoolBridge {
|
|
11
|
+
export interface RegisteredShellDevtoolBridge {
|
|
12
12
|
inspect: (snapshot: ShellDevtoolSnapshot) => void;
|
|
13
13
|
}
|
|
14
|
-
declare function ShellOverlay({ snapshot }: {
|
|
14
|
+
export declare function ShellOverlay({ snapshot }: {
|
|
15
15
|
snapshot: ShellDevtoolSnapshot | null;
|
|
16
|
-
}):
|
|
16
|
+
}): React.JSX.Element | null;
|
|
17
17
|
/**
|
|
18
18
|
* Register the harness devtool bridge.
|
|
19
19
|
*
|
|
@@ -25,6 +25,4 @@ declare function ShellOverlay({ snapshot }: {
|
|
|
25
25
|
* different tab. The other bridges only render inside their tab and so can
|
|
26
26
|
* keep their snapshot fully local.
|
|
27
27
|
*/
|
|
28
|
-
declare function useShellDevtoolBridge({ id, label, order, managerHref }: UseShellDevtoolBridgeOptions): RegisteredShellDevtoolBridge;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { RegisteredShellDevtoolBridge, ShellOverlay, UseShellDevtoolBridgeOptions, useShellDevtoolBridge };
|
|
28
|
+
export declare function useShellDevtoolBridge({ id, label, order, managerHref }: UseShellDevtoolBridgeOptions): RegisteredShellDevtoolBridge;
|
package/dist/harness/index.js
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { i as _objectSpread2, n as useOptDevtoolPlugin } from "./provider-
|
|
3
|
-
import { t as ISOLATE_STYLE } from "./theme-isolate-
|
|
2
|
+
import { i as _objectSpread2, n as useOptDevtoolPlugin } from "./provider-Cjg2rSYG.js";
|
|
3
|
+
import { t as ISOLATE_STYLE } from "./theme-isolate-BOo3J259.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/harness-store.ts
|
|
6
|
+
// src/shell-events.ts
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* Window event names emitted by `@reopt-ai/opt-shell`.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* The auto-listener wiring is **lazy**: a `SHELL_SNAPSHOT_EVENT` listener
|
|
16
|
-
* is only attached the first time `subscribeShellSnapshot()` is called.
|
|
17
|
-
* Direct callers of `getShellSnapshot()` without a subscription will see
|
|
18
|
-
* `null` until something subscribes. This avoids attaching window listeners
|
|
19
|
-
* during SSR or in test environments that never read the store.
|
|
20
|
-
*
|
|
21
|
-
* For tests, use `__resetShellStore()` to clear all module state between
|
|
22
|
-
* cases.
|
|
10
|
+
* Mirrored as literals (instead of imported) so the devtool root entry does
|
|
11
|
+
* not statically import opt-shell, which is an optional peer. Parity with the
|
|
12
|
+
* opt-shell constants is asserted in `__tests__/shell-events.test.ts`.
|
|
23
13
|
*/
|
|
14
|
+
const SHELL_SNAPSHOT_EVENT = "opt-shell:snapshot";
|
|
15
|
+
const SHELL_THEME_EVENT = "opt-shell:theme";
|
|
16
|
+
// src/harness-store.ts
|
|
24
17
|
let snapshot = null;
|
|
25
18
|
const snapshotListeners = /* @__PURE__ */ new Set();
|
|
26
19
|
function notifySnapshot() {
|
|
@@ -89,8 +82,7 @@ function setShellManagerHref(href) {
|
|
|
89
82
|
function getShellManagerHref() {
|
|
90
83
|
return managerHref;
|
|
91
84
|
}
|
|
92
|
-
|
|
93
|
-
//#region src/harness/index.tsx
|
|
85
|
+
// src/harness/index.tsx
|
|
94
86
|
function StatusDot({ active, label }) {
|
|
95
87
|
return /* @__PURE__ */ jsxs("span", {
|
|
96
88
|
className: "inline-flex items-center gap-1",
|
|
@@ -512,7 +504,7 @@ function useShellDevtoolBridge({ id, label, order = 10, managerHref }) {
|
|
|
512
504
|
setShellManagerHref(void 0);
|
|
513
505
|
};
|
|
514
506
|
}, [managerHref]);
|
|
515
|
-
|
|
507
|
+
const plugin = React.useMemo(() => ({
|
|
516
508
|
id,
|
|
517
509
|
label,
|
|
518
510
|
order,
|
|
@@ -529,8 +521,8 @@ function useShellDevtoolBridge({ id, label, order = 10, managerHref }) {
|
|
|
529
521
|
order,
|
|
530
522
|
snapshot,
|
|
531
523
|
showOverlay
|
|
532
|
-
])
|
|
524
|
+
]);
|
|
525
|
+
useOptDevtoolPlugin(plugin);
|
|
533
526
|
return { inspect };
|
|
534
527
|
}
|
|
535
|
-
|
|
536
|
-
export { getShellSnapshot as a, toggleShellOverlay as c, getShellOverlay as i, useShellDevtoolBridge as n, subscribeShellOverlay as o, getShellManagerHref as r, subscribeShellSnapshot as s, ShellOverlay as t };
|
|
528
|
+
export { getShellSnapshot as a, toggleShellOverlay as c, getShellOverlay as i, SHELL_THEME_EVENT as l, useShellDevtoolBridge as n, subscribeShellOverlay as o, getShellManagerHref as r, subscribeShellSnapshot as s, ShellOverlay as t };
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const require_provider = require("./provider-
|
|
3
|
-
const require_theme_isolate = require("./theme-isolate-
|
|
2
|
+
const require_provider = require("./provider-H53ZWHCo.cjs");
|
|
3
|
+
const require_theme_isolate = require("./theme-isolate-D9AMkYrD.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
react = require_provider.__toESM(react, 1);
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
|
|
8
|
-
//#region src/harness-store.ts
|
|
7
|
+
// src/shell-events.ts
|
|
9
8
|
/**
|
|
10
|
-
*
|
|
9
|
+
* Window event names emitted by `@reopt-ai/opt-shell`.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* The auto-listener wiring is **lazy**: a `SHELL_SNAPSHOT_EVENT` listener
|
|
17
|
-
* is only attached the first time `subscribeShellSnapshot()` is called.
|
|
18
|
-
* Direct callers of `getShellSnapshot()` without a subscription will see
|
|
19
|
-
* `null` until something subscribes. This avoids attaching window listeners
|
|
20
|
-
* during SSR or in test environments that never read the store.
|
|
21
|
-
*
|
|
22
|
-
* For tests, use `__resetShellStore()` to clear all module state between
|
|
23
|
-
* cases.
|
|
11
|
+
* Mirrored as literals (instead of imported) so the devtool root entry does
|
|
12
|
+
* not statically import opt-shell, which is an optional peer. Parity with the
|
|
13
|
+
* opt-shell constants is asserted in `__tests__/shell-events.test.ts`.
|
|
24
14
|
*/
|
|
15
|
+
const SHELL_SNAPSHOT_EVENT = "opt-shell:snapshot";
|
|
16
|
+
const SHELL_THEME_EVENT = "opt-shell:theme";
|
|
17
|
+
// src/harness-store.ts
|
|
25
18
|
let snapshot = null;
|
|
26
19
|
const snapshotListeners = /* @__PURE__ */ new Set();
|
|
27
20
|
function notifySnapshot() {
|
|
@@ -51,7 +44,7 @@ let autoListenerInitialized = false;
|
|
|
51
44
|
function initAutoListener() {
|
|
52
45
|
if (autoListenerInitialized || typeof window === "undefined") return;
|
|
53
46
|
autoListenerInitialized = true;
|
|
54
|
-
window.addEventListener(
|
|
47
|
+
window.addEventListener(SHELL_SNAPSHOT_EVENT, ((e) => {
|
|
55
48
|
const detail = e.detail;
|
|
56
49
|
if (detail) {
|
|
57
50
|
setShellSnapshot(detail.snapshot);
|
|
@@ -90,8 +83,7 @@ function setShellManagerHref(href) {
|
|
|
90
83
|
function getShellManagerHref() {
|
|
91
84
|
return managerHref;
|
|
92
85
|
}
|
|
93
|
-
|
|
94
|
-
//#region src/harness/index.tsx
|
|
86
|
+
// src/harness/index.tsx
|
|
95
87
|
function StatusDot({ active, label }) {
|
|
96
88
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
97
89
|
className: "inline-flex items-center gap-1",
|
|
@@ -513,7 +505,7 @@ function useShellDevtoolBridge({ id, label, order = 10, managerHref }) {
|
|
|
513
505
|
setShellManagerHref(void 0);
|
|
514
506
|
};
|
|
515
507
|
}, [managerHref]);
|
|
516
|
-
|
|
508
|
+
const plugin = react.useMemo(() => ({
|
|
517
509
|
id,
|
|
518
510
|
label,
|
|
519
511
|
order,
|
|
@@ -530,10 +522,16 @@ function useShellDevtoolBridge({ id, label, order = 10, managerHref }) {
|
|
|
530
522
|
order,
|
|
531
523
|
snapshot,
|
|
532
524
|
showOverlay
|
|
533
|
-
])
|
|
525
|
+
]);
|
|
526
|
+
require_provider.useOptDevtoolPlugin(plugin);
|
|
534
527
|
return { inspect };
|
|
535
528
|
}
|
|
536
|
-
|
|
529
|
+
Object.defineProperty(exports, "SHELL_THEME_EVENT", {
|
|
530
|
+
enumerable: true,
|
|
531
|
+
get: function() {
|
|
532
|
+
return SHELL_THEME_EVENT;
|
|
533
|
+
}
|
|
534
|
+
});
|
|
537
535
|
Object.defineProperty(exports, "ShellOverlay", {
|
|
538
536
|
enumerable: true,
|
|
539
537
|
get: function() {
|
package/dist/index.cjs
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_provider = require("./provider-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const require_harness = require("./harness-CoRqiJWO.cjs");
|
|
3
|
+
const require_provider = require("./provider-H53ZWHCo.cjs");
|
|
4
|
+
const require_theme_isolate = require("./theme-isolate-D9AMkYrD.cjs");
|
|
5
|
+
const require_harness = require("./harness-CPOp9Wlj.cjs");
|
|
7
6
|
const require_theme_index = require("./theme/index.cjs");
|
|
7
|
+
const require_types = require("./types-Bz4DijhU.cjs");
|
|
8
8
|
let react = require("react");
|
|
9
9
|
react = require_provider.__toESM(react, 1);
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
let _reopt_ai_opt_ui = require("@reopt-ai/opt-ui");
|
|
12
12
|
let _reopt_ai_opt_ui_id_registry = require("@reopt-ai/opt-ui/id-registry");
|
|
13
13
|
let _reopt_ai_opt_palette = require("@reopt-ai/opt-palette");
|
|
14
|
-
|
|
15
|
-
//#region src/scanning/constants.ts
|
|
14
|
+
// src/scanning/constants.ts
|
|
16
15
|
/**
|
|
17
|
-
* @deprecated since 0.1.0 — opt-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* @deprecated since 0.1.0 — `@reopt-ai/opt-ui`가 1.2.x까지 공개 export하던
|
|
17
|
+
* `OPT_UI_HELPER_CONFIGURE_EVENT`(UIDebugger, 2026-04-04 제거)의 이벤트
|
|
18
|
+
* 이름입니다. 해당 버전을 쓰던 앱이 아직 dispatch할 수 있으므로 리스너를
|
|
19
|
+
* 유지합니다. 신규 소비자는 {@link OPT_DEVTOOL_CONFIGURE_EVENT}만 사용하세요.
|
|
20
|
+
* 다음 major(2.0.0)에서 제거 예정.
|
|
20
21
|
*/
|
|
21
22
|
const LEGACY_OPT_UI_HELPER_CONFIGURE_EVENT = "opt-ui-helper-configure";
|
|
22
23
|
const TABBABLE = [
|
|
@@ -206,8 +207,7 @@ const CORNER_LABELS = [
|
|
|
206
207
|
label: "↘"
|
|
207
208
|
}
|
|
208
209
|
];
|
|
209
|
-
|
|
210
|
-
//#region src/scanning/visibility.ts
|
|
210
|
+
// src/scanning/visibility.ts
|
|
211
211
|
/** isVisible — see usage in callers. */
|
|
212
212
|
function isVisible(el) {
|
|
213
213
|
if (!el.offsetParent && getComputedStyle(el).position !== "fixed") return false;
|
|
@@ -221,8 +221,7 @@ function safeRect(el) {
|
|
|
221
221
|
if (rect.width === 0 && rect.height === 0) return null;
|
|
222
222
|
return rect;
|
|
223
223
|
}
|
|
224
|
-
|
|
225
|
-
//#region src/scanning/tabbable.ts
|
|
224
|
+
// src/scanning/tabbable.ts
|
|
226
225
|
/** getTabbable — see usage in callers. */
|
|
227
226
|
function getTabbable() {
|
|
228
227
|
const els = Array.from(document.querySelectorAll(TABBABLE)).filter((el) => {
|
|
@@ -238,8 +237,7 @@ function getTabbable() {
|
|
|
238
237
|
positive.sort((a, b) => a.tabIndex - b.tabIndex);
|
|
239
238
|
return [...positive, ...zero];
|
|
240
239
|
}
|
|
241
|
-
|
|
242
|
-
//#region src/scanning/attributes.ts
|
|
240
|
+
// src/scanning/attributes.ts
|
|
243
241
|
/** getAriaAttrs — see usage in callers. */
|
|
244
242
|
function getAriaAttrs(el) {
|
|
245
243
|
return Array.from(el.attributes).filter((attribute) => attribute.name.startsWith("aria-")).map((attribute) => [attribute.name, attribute.value]);
|
|
@@ -307,8 +305,7 @@ function getOptIdentityFromAncestors(el) {
|
|
|
307
305
|
}
|
|
308
306
|
return null;
|
|
309
307
|
}
|
|
310
|
-
|
|
311
|
-
//#region src/scanning/fiber.ts
|
|
308
|
+
// src/scanning/fiber.ts
|
|
312
309
|
/** getOpsUIComponentType — see usage in callers. */
|
|
313
310
|
function getOpsUIComponentType(name) {
|
|
314
311
|
if (OPS_UI_BLOCKS.has(name)) return "block";
|
|
@@ -427,8 +424,7 @@ function findOpsUIComponents() {
|
|
|
427
424
|
} catch (_unused3) {}
|
|
428
425
|
return results;
|
|
429
426
|
}
|
|
430
|
-
|
|
431
|
-
//#region src/scanning/composite.ts
|
|
427
|
+
// src/scanning/composite.ts
|
|
432
428
|
/** getCompositeItems — see usage in callers. */
|
|
433
429
|
function getCompositeItems(container) {
|
|
434
430
|
return Array.from(container.querySelectorAll(ITEM_ROLES)).filter((item) => {
|
|
@@ -626,14 +622,12 @@ function getCompositeInfo(el) {
|
|
|
626
622
|
arrows
|
|
627
623
|
}, loopWrap);
|
|
628
624
|
}
|
|
629
|
-
|
|
630
|
-
//#region src/scanning/spatial.ts
|
|
625
|
+
// src/scanning/spatial.ts
|
|
631
626
|
/** getProtectedDirs — see usage in callers. */
|
|
632
627
|
function getProtectedDirs(el) {
|
|
633
628
|
return ALL_DIRS.filter((direction) => (0, _reopt_ai_opt_ui.shouldSkipArrow)(el, direction));
|
|
634
629
|
}
|
|
635
|
-
|
|
636
|
-
//#region src/i18n/ko.ts
|
|
630
|
+
// src/i18n/ko.ts
|
|
637
631
|
/** opt-devtool Korean label catalog. Used as the package default. */
|
|
638
632
|
const koDevtoolLabels = {
|
|
639
633
|
panelTitle: "opt-devtool",
|
|
@@ -689,8 +683,7 @@ const koDevtoolLabels = {
|
|
|
689
683
|
filterPrimitives: "Primitives",
|
|
690
684
|
filterAll: "전체"
|
|
691
685
|
};
|
|
692
|
-
|
|
693
|
-
//#region src/panels/shared.tsx
|
|
686
|
+
// src/panels/shared.tsx
|
|
694
687
|
/** elLabel — see usage in callers. */
|
|
695
688
|
function elLabel(el) {
|
|
696
689
|
const tag = el.tagName.toLowerCase();
|
|
@@ -826,8 +819,7 @@ function Toggle({ active, onToggle, children }) {
|
|
|
826
819
|
children
|
|
827
820
|
});
|
|
828
821
|
}
|
|
829
|
-
|
|
830
|
-
//#region src/panels/component-trace.tsx
|
|
822
|
+
// src/panels/component-trace.tsx
|
|
831
823
|
/** ComponentTree — see usage in callers. */
|
|
832
824
|
function ComponentTree({ chain }) {
|
|
833
825
|
const reversed = [...chain].reverse();
|
|
@@ -853,8 +845,7 @@ function ComponentTree({ chain }) {
|
|
|
853
845
|
})
|
|
854
846
|
});
|
|
855
847
|
}
|
|
856
|
-
|
|
857
|
-
//#region src/panels/component-tree.tsx
|
|
848
|
+
// src/panels/component-tree.tsx
|
|
858
849
|
const { useMemo: useMemo$2 } = react;
|
|
859
850
|
/** buildComponentHierarchy — see usage in callers. */
|
|
860
851
|
function buildComponentHierarchy(components, displayedEl) {
|
|
@@ -926,8 +917,7 @@ function ComponentTreeViewer({ displayedEl, opsUIComponents }) {
|
|
|
926
917
|
children: hierarchy.map((root) => renderNode(root, 0))
|
|
927
918
|
});
|
|
928
919
|
}
|
|
929
|
-
|
|
930
|
-
//#region src/panels/snapshot-text.ts
|
|
920
|
+
// src/panels/snapshot-text.ts
|
|
931
921
|
/** buildSnapshotText — see usage in callers. */
|
|
932
922
|
function buildSnapshotText(el, componentChain, tabInfo, composite, ariaAttrs, dataAttrs, spatialTargets, trappedContext, protectedDirs, optIdentity = null) {
|
|
933
923
|
const lines = ["=== opt-devtool Snapshot ==="];
|
|
@@ -973,8 +963,7 @@ function buildSnapshotText(el, componentChain, tabInfo, composite, ariaAttrs, da
|
|
|
973
963
|
}
|
|
974
964
|
return lines.join("\n");
|
|
975
965
|
}
|
|
976
|
-
|
|
977
|
-
//#region src/panels/theme-panel.tsx
|
|
966
|
+
// src/panels/theme-panel.tsx
|
|
978
967
|
const { useCallback: useCallback$7, useEffect: useEffect$14, useMemo: useMemo$1, useState: useState$12 } = react;
|
|
979
968
|
const COLOR_TOKENS = {
|
|
980
969
|
primary: [
|
|
@@ -1411,8 +1400,7 @@ function ThemePanel({ visible }) {
|
|
|
1411
1400
|
]
|
|
1412
1401
|
});
|
|
1413
1402
|
}
|
|
1414
|
-
|
|
1415
|
-
//#region src/panels/harness-panel.tsx
|
|
1403
|
+
// src/panels/harness-panel.tsx
|
|
1416
1404
|
const { useCallback: useCallback$6, useEffect: useEffect$13, useState: useState$11, useSyncExternalStore: useSyncExternalStore$1 } = react;
|
|
1417
1405
|
const DEFAULTS = {
|
|
1418
1406
|
density: "comfortable",
|
|
@@ -1838,8 +1826,7 @@ function ShellPanel() {
|
|
|
1838
1826
|
]
|
|
1839
1827
|
});
|
|
1840
1828
|
}
|
|
1841
|
-
|
|
1842
|
-
//#region src/overlays/shared.tsx
|
|
1829
|
+
// src/overlays/shared.tsx
|
|
1843
1830
|
/** HighlightRing — see usage in callers. */
|
|
1844
1831
|
function HighlightRing({ rect, color, solid }) {
|
|
1845
1832
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2026,8 +2013,7 @@ function ProtectedDirBadges({ rect, dirs }) {
|
|
|
2026
2013
|
}, dir);
|
|
2027
2014
|
}) });
|
|
2028
2015
|
}
|
|
2029
|
-
|
|
2030
|
-
//#region src/overlays/focus-guide.tsx
|
|
2016
|
+
// src/overlays/focus-guide.tsx
|
|
2031
2017
|
const { useCallback: useCallback$5, useEffect: useEffect$12, useRef: useRef$6, useState: useState$10 } = react;
|
|
2032
2018
|
/** FocusOverlays — see usage in callers. */
|
|
2033
2019
|
function FocusOverlays({ current, tabNext, tabPrev, arrows, spatialTargets, protectedDirs }) {
|
|
@@ -2167,8 +2153,7 @@ function FocusOverlays({ current, tabNext, tabPrev, arrows, spatialTargets, prot
|
|
|
2167
2153
|
]
|
|
2168
2154
|
});
|
|
2169
2155
|
}
|
|
2170
|
-
|
|
2171
|
-
//#region src/overlays/tab-order.tsx
|
|
2156
|
+
// src/overlays/tab-order.tsx
|
|
2172
2157
|
const { useCallback: useCallback$4, useEffect: useEffect$11, useRef: useRef$5, useState: useState$9 } = react;
|
|
2173
2158
|
/** TabOrderBadges — see usage in callers. */
|
|
2174
2159
|
function TabOrderBadges({ tabbable, current }) {
|
|
@@ -2221,8 +2206,7 @@ function TabOrderBadges({ tabbable, current }) {
|
|
|
2221
2206
|
}, badge.index))
|
|
2222
2207
|
});
|
|
2223
2208
|
}
|
|
2224
|
-
|
|
2225
|
-
//#region src/overlays/inspect-tool.tsx
|
|
2209
|
+
// src/overlays/inspect-tool.tsx
|
|
2226
2210
|
const { useCallback: useCallback$3, useEffect: useEffect$10, useRef: useRef$4, useState: useState$8 } = react;
|
|
2227
2211
|
/** InspectOverlay — see usage in callers. */
|
|
2228
2212
|
function InspectOverlay({ element, pinned }) {
|
|
@@ -2259,8 +2243,7 @@ function InspectOverlay({ element, pinned }) {
|
|
|
2259
2243
|
})
|
|
2260
2244
|
});
|
|
2261
2245
|
}
|
|
2262
|
-
|
|
2263
|
-
//#region src/overlays/component-labels.tsx
|
|
2246
|
+
// src/overlays/component-labels.tsx
|
|
2264
2247
|
const { useCallback: useCallback$2, useEffect: useEffect$9, useRef: useRef$3, useState: useState$7 } = react;
|
|
2265
2248
|
/** ComponentLabelsOverlay — see usage in callers. */
|
|
2266
2249
|
function ComponentLabelsOverlay({ components }) {
|
|
@@ -2330,8 +2313,7 @@ function ComponentLabelsOverlay({ components }) {
|
|
|
2330
2313
|
})] }, label.id))]
|
|
2331
2314
|
});
|
|
2332
2315
|
}
|
|
2333
|
-
|
|
2334
|
-
//#region src/overlays/composite-bounds.tsx
|
|
2316
|
+
// src/overlays/composite-bounds.tsx
|
|
2335
2317
|
const { useCallback: useCallback$1, useEffect: useEffect$8, useRef: useRef$2, useState: useState$6 } = react;
|
|
2336
2318
|
/** CompositeBoundsOverlay — see usage in callers. */
|
|
2337
2319
|
function CompositeBoundsOverlay({ zones }) {
|
|
@@ -2406,8 +2388,7 @@ function CompositeBoundsOverlay({ zones }) {
|
|
|
2406
2388
|
})] }, bound.id))
|
|
2407
2389
|
});
|
|
2408
2390
|
}
|
|
2409
|
-
|
|
2410
|
-
//#region src/hooks/use-devtool-keybinding.ts
|
|
2391
|
+
// src/hooks/use-devtool-keybinding.ts
|
|
2411
2392
|
/**
|
|
2412
2393
|
* Bind Ctrl+Shift+F to toggle the devtool panel.
|
|
2413
2394
|
* Pure side-effect hook — relies on the caller's state setter.
|
|
@@ -2424,8 +2405,7 @@ function useDevtoolKeybinding(toggle) {
|
|
|
2424
2405
|
return () => window.removeEventListener("keydown", onKey);
|
|
2425
2406
|
}, [toggle]);
|
|
2426
2407
|
}
|
|
2427
|
-
|
|
2428
|
-
//#region src/hooks/use-devtool-config-event.ts
|
|
2408
|
+
// src/hooks/use-devtool-config-event.ts
|
|
2429
2409
|
/**
|
|
2430
2410
|
* Listen for `OPT_DEVTOOL_CONFIGURE_EVENT` (and the legacy
|
|
2431
2411
|
* `opt-ui-helper-configure`) and forward the payload to a consumer-supplied
|
|
@@ -2447,8 +2427,7 @@ function useDevtoolConfigEvent(apply) {
|
|
|
2447
2427
|
};
|
|
2448
2428
|
}, [apply]);
|
|
2449
2429
|
}
|
|
2450
|
-
|
|
2451
|
-
//#region src/hooks/use-focus-tracking.ts
|
|
2430
|
+
// src/hooks/use-focus-tracking.ts
|
|
2452
2431
|
const FOCUS_HISTORY_LIMIT = 10;
|
|
2453
2432
|
/** Returns the event target as an HTMLElement only if outside the devtool overlay. */
|
|
2454
2433
|
function getExternalTarget$2(event) {
|
|
@@ -2489,8 +2468,7 @@ function useFocusTracking({ enabled }) {
|
|
|
2489
2468
|
tabbable
|
|
2490
2469
|
};
|
|
2491
2470
|
}
|
|
2492
|
-
|
|
2493
|
-
//#region src/hooks/use-inspect-mode.ts
|
|
2471
|
+
// src/hooks/use-inspect-mode.ts
|
|
2494
2472
|
/** Returns the event target as an HTMLElement only if outside the devtool overlay. */
|
|
2495
2473
|
function getExternalTarget$1(event) {
|
|
2496
2474
|
const el = event.target;
|
|
@@ -2538,8 +2516,7 @@ function useInspectMode({ enabled }) {
|
|
|
2538
2516
|
pinned
|
|
2539
2517
|
};
|
|
2540
2518
|
}
|
|
2541
|
-
|
|
2542
|
-
//#region src/hooks/use-scan-ops-ui-components.ts
|
|
2519
|
+
// src/hooks/use-scan-ops-ui-components.ts
|
|
2543
2520
|
const SCAN_ATTR_FILTER$1 = [
|
|
2544
2521
|
"hidden",
|
|
2545
2522
|
"aria-hidden",
|
|
@@ -2609,8 +2586,7 @@ function useScanOpsUIComponents({ enabled }) {
|
|
|
2609
2586
|
}, [enabled]);
|
|
2610
2587
|
return components;
|
|
2611
2588
|
}
|
|
2612
|
-
|
|
2613
|
-
//#region src/hooks/use-scan-composite-bounds.ts
|
|
2589
|
+
// src/hooks/use-scan-composite-bounds.ts
|
|
2614
2590
|
const SCAN_ATTR_FILTER = [
|
|
2615
2591
|
"hidden",
|
|
2616
2592
|
"aria-hidden",
|
|
@@ -2749,8 +2725,7 @@ function useEventLog({ enabled }) {
|
|
|
2749
2725
|
clear: () => setEntries([])
|
|
2750
2726
|
};
|
|
2751
2727
|
}
|
|
2752
|
-
|
|
2753
|
-
//#region src/components/devtool-header.tsx
|
|
2728
|
+
// src/components/devtool-header.tsx
|
|
2754
2729
|
/**
|
|
2755
2730
|
* Sticky panel header — title, copy button, corner picker, and close button.
|
|
2756
2731
|
* Pure presentational; all state lives in the caller.
|
|
@@ -2823,8 +2798,7 @@ function DevtoolHeader({ labels, copied, panelCorner, onCopy, onCornerChange, on
|
|
|
2823
2798
|
})]
|
|
2824
2799
|
});
|
|
2825
2800
|
}
|
|
2826
|
-
|
|
2827
|
-
//#region src/components/devtool-tab-bar.tsx
|
|
2801
|
+
// src/components/devtool-tab-bar.tsx
|
|
2828
2802
|
/** Top-level tab switcher (component / editor / theme / harness). */
|
|
2829
2803
|
function DevtoolTabBar({ active, labels, onChange }) {
|
|
2830
2804
|
const tabs = [
|
|
@@ -2894,8 +2868,7 @@ function DevtoolTabBar({ active, labels, onChange }) {
|
|
|
2894
2868
|
}, id))
|
|
2895
2869
|
});
|
|
2896
2870
|
}
|
|
2897
|
-
|
|
2898
|
-
//#region src/components/editor-tab-panel.tsx
|
|
2871
|
+
// src/components/editor-tab-panel.tsx
|
|
2899
2872
|
/**
|
|
2900
2873
|
* Editor tab body — switcher tabs across registered editor plugins, plus
|
|
2901
2874
|
* the active plugin's panel render. Renders an empty-state message when
|
|
@@ -2924,8 +2897,7 @@ function EditorTabPanel({ labels, plugins, activePlugin, onActivate }) {
|
|
|
2924
2897
|
})]
|
|
2925
2898
|
});
|
|
2926
2899
|
}
|
|
2927
|
-
|
|
2928
|
-
//#region src/components/brandapp-tab-panel.tsx
|
|
2900
|
+
// src/components/brandapp-tab-panel.tsx
|
|
2929
2901
|
/** Brandapp tab body for registered Brandapp SDK integration panels. */
|
|
2930
2902
|
function BrandappTabPanel({ labels, plugins, activePlugin, onActivate }) {
|
|
2931
2903
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2949,8 +2921,7 @@ function BrandappTabPanel({ labels, plugins, activePlugin, onActivate }) {
|
|
|
2949
2921
|
})]
|
|
2950
2922
|
});
|
|
2951
2923
|
}
|
|
2952
|
-
|
|
2953
|
-
//#region src/components/component-tab-panel.tsx
|
|
2924
|
+
// src/components/component-tab-panel.tsx
|
|
2954
2925
|
/**
|
|
2955
2926
|
* Body of the "component" tab. Renders all focus-driven sections (current
|
|
2956
2927
|
* focus, component trace, component tree, tab order, arrow keys, spatial
|
|
@@ -3274,8 +3245,7 @@ function ComponentTabPanel({ labels, displayedEl, isInspecting, pinnedInspect, c
|
|
|
3274
3245
|
]
|
|
3275
3246
|
});
|
|
3276
3247
|
}
|
|
3277
|
-
|
|
3278
|
-
//#region src/components/component-engine-plugins.tsx
|
|
3248
|
+
// src/components/component-engine-plugins.tsx
|
|
3279
3249
|
/**
|
|
3280
3250
|
* Body for the per-engine plugin panels rendered under the component tab.
|
|
3281
3251
|
* Mirrors {@link EditorTabPanel} but always renders the switcher (callers
|
|
@@ -3304,8 +3274,7 @@ function ComponentEnginePlugins({ labels, plugins, activePlugin, onActivate }) {
|
|
|
3304
3274
|
})]
|
|
3305
3275
|
});
|
|
3306
3276
|
}
|
|
3307
|
-
|
|
3308
|
-
//#region src/components/component-toggles-footer.tsx
|
|
3277
|
+
// src/components/component-toggles-footer.tsx
|
|
3309
3278
|
/**
|
|
3310
3279
|
* Sticky footer with the overlay/info-panel toggle groups for the component
|
|
3311
3280
|
* tab. Pure presentational — every toggle wires straight back to a setter.
|
|
@@ -3385,8 +3354,7 @@ function ToggleGroup({ heading, switches }) {
|
|
|
3385
3354
|
}, label))
|
|
3386
3355
|
})] });
|
|
3387
3356
|
}
|
|
3388
|
-
|
|
3389
|
-
//#region src/opt-devtool.tsx
|
|
3357
|
+
// src/opt-devtool.tsx
|
|
3390
3358
|
const { useCallback, useEffect, useMemo, useState, useSyncExternalStore } = react;
|
|
3391
3359
|
/**
|
|
3392
3360
|
* Auto-bridge: listens for ShellProvider theme CustomEvents and feeds
|
|
@@ -3405,8 +3373,8 @@ function AutoThemeBridge() {
|
|
|
3405
3373
|
const detail = e.detail;
|
|
3406
3374
|
if (detail) inspect(require_theme_index.themeConfigToSnapshot(detail));
|
|
3407
3375
|
}
|
|
3408
|
-
window.addEventListener(
|
|
3409
|
-
return () => window.removeEventListener(
|
|
3376
|
+
window.addEventListener(require_harness.SHELL_THEME_EVENT, handleTheme);
|
|
3377
|
+
return () => window.removeEventListener(require_harness.SHELL_THEME_EVENT, handleTheme);
|
|
3410
3378
|
}, [inspect]);
|
|
3411
3379
|
return null;
|
|
3412
3380
|
}
|
|
@@ -3699,8 +3667,7 @@ function OptDevtool({ defaultOpen = false, labels: labelsProp }) {
|
|
|
3699
3667
|
})
|
|
3700
3668
|
] });
|
|
3701
3669
|
}
|
|
3702
|
-
|
|
3703
|
-
//#region src/i18n/en.ts
|
|
3670
|
+
// src/i18n/en.ts
|
|
3704
3671
|
/** opt-devtool English label catalog. */
|
|
3705
3672
|
const enDevtoolLabels = {
|
|
3706
3673
|
panelTitle: "opt-devtool",
|
|
@@ -3756,7 +3723,6 @@ const enDevtoolLabels = {
|
|
|
3756
3723
|
filterPrimitives: "Primitives",
|
|
3757
3724
|
filterAll: "All"
|
|
3758
3725
|
};
|
|
3759
|
-
//#endregion
|
|
3760
3726
|
exports.OPT_DEVTOOL_CONFIGURE_EVENT = require_types.OPT_DEVTOOL_CONFIGURE_EVENT;
|
|
3761
3727
|
exports.OptDevtool = OptDevtool;
|
|
3762
3728
|
exports.OptDevtoolProvider = require_provider.OptDevtoolProvider;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as OptDevtoolPluginTab, i as OptDevtoolPlugin, n as OptDevtoolConfig, o as OptDevtoolProps, r as OptDevtoolLabels, s as koDevtoolLabels, t as OPT_DEVTOOL_CONFIGURE_EVENT } from "./types-
|
|
2
|
+
import { a as OptDevtoolPluginTab, i as OptDevtoolPlugin, n as OptDevtoolConfig, o as OptDevtoolProps, r as OptDevtoolLabels, s as koDevtoolLabels, t as OPT_DEVTOOL_CONFIGURE_EVENT } from "./types-D_lNT2Nr.cjs";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
//#region src/provider.d.ts
|
|
5
4
|
/** OptDevtoolProvider — see usage in callers. */
|
|
6
|
-
declare function OptDevtoolProvider({ children }: {
|
|
5
|
+
export declare function OptDevtoolProvider({ children }: {
|
|
7
6
|
children: React.ReactNode;
|
|
8
|
-
}):
|
|
7
|
+
}): React.JSX.Element;
|
|
9
8
|
/** useOptDevtoolPlugin — see usage in callers. */
|
|
10
|
-
declare function useOptDevtoolPlugin(plugin: OptDevtoolPlugin | null): void;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/opt-devtool.d.ts
|
|
9
|
+
export declare function useOptDevtoolPlugin(plugin: OptDevtoolPlugin | null): void;
|
|
13
10
|
/** OptDevtool — see usage in callers. */
|
|
14
|
-
declare function OptDevtool({ defaultOpen, labels: labelsProp }: OptDevtoolProps):
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/i18n/en.d.ts
|
|
11
|
+
export declare function OptDevtool({ defaultOpen, labels: labelsProp }: OptDevtoolProps): React.JSX.Element;
|
|
17
12
|
/** opt-devtool English label catalog. */
|
|
18
|
-
declare const enDevtoolLabels: OptDevtoolLabels;
|
|
19
|
-
|
|
20
|
-
export { OPT_DEVTOOL_CONFIGURE_EVENT, OptDevtool, type OptDevtoolConfig, type OptDevtoolLabels, type OptDevtoolPlugin, type OptDevtoolPluginTab, type OptDevtoolProps, OptDevtoolProvider, koDevtoolLabels as defaultLabels, koDevtoolLabels, enDevtoolLabels, useOptDevtoolPlugin };
|
|
13
|
+
export declare const enDevtoolLabels: OptDevtoolLabels;
|
|
14
|
+
export { OPT_DEVTOOL_CONFIGURE_EVENT, type OptDevtoolConfig, type OptDevtoolLabels, type OptDevtoolPlugin, type OptDevtoolPluginTab, type OptDevtoolProps, koDevtoolLabels as defaultLabels, koDevtoolLabels };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { a as OptDevtoolPluginTab, i as OptDevtoolPlugin, n as OptDevtoolConfig, o as OptDevtoolProps, r as OptDevtoolLabels, s as koDevtoolLabels, t as OPT_DEVTOOL_CONFIGURE_EVENT } from "./types-
|
|
2
|
+
import { a as OptDevtoolPluginTab, i as OptDevtoolPlugin, n as OptDevtoolConfig, o as OptDevtoolProps, r as OptDevtoolLabels, s as koDevtoolLabels, t as OPT_DEVTOOL_CONFIGURE_EVENT } from "./types-D_lNT2Nr.js";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
//#region src/provider.d.ts
|
|
5
4
|
/** OptDevtoolProvider — see usage in callers. */
|
|
6
|
-
declare function OptDevtoolProvider({ children }: {
|
|
5
|
+
export declare function OptDevtoolProvider({ children }: {
|
|
7
6
|
children: React.ReactNode;
|
|
8
|
-
}):
|
|
7
|
+
}): React.JSX.Element;
|
|
9
8
|
/** useOptDevtoolPlugin — see usage in callers. */
|
|
10
|
-
declare function useOptDevtoolPlugin(plugin: OptDevtoolPlugin | null): void;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/opt-devtool.d.ts
|
|
9
|
+
export declare function useOptDevtoolPlugin(plugin: OptDevtoolPlugin | null): void;
|
|
13
10
|
/** OptDevtool — see usage in callers. */
|
|
14
|
-
declare function OptDevtool({ defaultOpen, labels: labelsProp }: OptDevtoolProps):
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/i18n/en.d.ts
|
|
11
|
+
export declare function OptDevtool({ defaultOpen, labels: labelsProp }: OptDevtoolProps): React.JSX.Element;
|
|
17
12
|
/** opt-devtool English label catalog. */
|
|
18
|
-
declare const enDevtoolLabels: OptDevtoolLabels;
|
|
19
|
-
|
|
20
|
-
export { OPT_DEVTOOL_CONFIGURE_EVENT, OptDevtool, type OptDevtoolConfig, type OptDevtoolLabels, type OptDevtoolPlugin, type OptDevtoolPluginTab, type OptDevtoolProps, OptDevtoolProvider, koDevtoolLabels as defaultLabels, koDevtoolLabels, enDevtoolLabels, useOptDevtoolPlugin };
|
|
13
|
+
export declare const enDevtoolLabels: OptDevtoolLabels;
|
|
14
|
+
export { OPT_DEVTOOL_CONFIGURE_EVENT, type OptDevtoolConfig, type OptDevtoolLabels, type OptDevtoolPlugin, type OptDevtoolPluginTab, type OptDevtoolProps, koDevtoolLabels as defaultLabels, koDevtoolLabels };
|