@plitzi/sdk-dev-tools 0.37.2 → 0.37.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 +1152 -0
- package/dist/DevToolsContainer.d.ts +11 -1
- package/dist/DevToolsContainer.mjs +65 -57
- package/dist/DevToolsContextProvider.mjs +8 -8
- package/dist/DevToolsRoot.mjs +9 -9
- package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +9 -9
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.mjs +10 -10
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +33 -33
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +11 -11
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +26 -26
- package/dist/scope/useScope.mjs +14 -14
- package/dist/useRegisterQueriesStore.mjs +3 -3
- package/package.json +8 -8
|
@@ -9,6 +9,16 @@ export type DevToolsContainerProps = {
|
|
|
9
9
|
devToolsStyle?: string;
|
|
10
10
|
devToolsStyleLink?: string;
|
|
11
11
|
renderMode?: 'default' | 'shadow';
|
|
12
|
+
/**
|
|
13
|
+
* What scrolls while the panel is folded away.
|
|
14
|
+
*
|
|
15
|
+
* `container` (the default) keeps the wrapped app in a box of its own, which is what an application shell that fills
|
|
16
|
+
* its window wants — the builder. `document` is for a PAGE: while the panel is collapsed the page lays out and
|
|
17
|
+
* scrolls exactly as it does without dev tools, so `position: sticky` and `fixed`, scroll restoration and a
|
|
18
|
+
* full-page screenshot mean in development what they mean in production. Opening the panel docks it beside the page
|
|
19
|
+
* either way; a docked panel needs the split.
|
|
20
|
+
*/
|
|
21
|
+
scroll?: 'container' | 'document';
|
|
12
22
|
};
|
|
13
|
-
declare const DevToolsContainer: ({ children, className, innerClassName, enabled, instanceId, renderMode, devToolsStyle, devToolsStyleLink }: DevToolsContainerProps) => string | number | bigint | boolean |
|
|
23
|
+
declare const DevToolsContainer: ({ children, className, innerClassName, enabled, instanceId, renderMode, scroll, devToolsStyle, devToolsStyleLink }: DevToolsContainerProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
14
24
|
export default DevToolsContainer;
|
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./
|
|
4
|
-
import r from "./
|
|
5
|
-
import i from "./
|
|
6
|
-
import a from "./
|
|
7
|
-
import o from "
|
|
8
|
-
import s from "@plitzi/plitzi-ui/
|
|
9
|
-
import c from "
|
|
10
|
-
import l from "
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
1
|
+
import e from "./DevToolsContextProvider.mjs";
|
|
2
|
+
import t from "./DevToolsRoot.mjs";
|
|
3
|
+
import { useIsSelectedInstance as n } from "./instanceRegistry.mjs";
|
|
4
|
+
import r from "./useHydrated.mjs";
|
|
5
|
+
import i from "./useRegisterQueriesStore.mjs";
|
|
6
|
+
import a from "./useRegisterRootStore.mjs";
|
|
7
|
+
import o from "@plitzi/plitzi-ui/ContainerShadow";
|
|
8
|
+
import s from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
9
|
+
import c from "clsx";
|
|
10
|
+
import { Suspense as l, lazy as u, useCallback as d, useRef as f, useState as p } from "react";
|
|
11
|
+
import { DevStoreScopeContext as m } from "@plitzi/nexus/react";
|
|
12
|
+
import h from "@plitzi/sdk-shared/theme/useTheme";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
15
14
|
//#region src/DevToolsContainer.tsx
|
|
16
|
-
var
|
|
17
|
-
let { resolvedTheme:
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
e &&
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
var v = u(() => import("./components/DevToolsOverlay/index.mjs")), y = "horizontal", b = 0, x = ({ children: u, className: x, innerClassName: S, enabled: C = !1, instanceId: w, renderMode: T = "default", scroll: E = "container", devToolsStyle: D = "", devToolsStyleLink: O = "" }) => {
|
|
16
|
+
let { resolvedTheme: k } = h(), [A, j] = s("plitzi-sdk.dev-tools.orientation", y), [M, N] = s("plitzi-sdk.dev-tools.collapsed", !0), [P, F] = s("plitzi-sdk.dev-tools.tab", "logs"), [I, L] = p(), R = f(void 0);
|
|
17
|
+
R.current ||= `sdk-instance-${++b}`;
|
|
18
|
+
let z = w || R.current, B = r(), V = B ? A : y, H = n(z, C);
|
|
19
|
+
a(C), i(H, z);
|
|
20
|
+
let U = d((e) => j(e), [j]), W = d((e) => {
|
|
21
|
+
e && F("logs"), L(e), N(!1);
|
|
22
|
+
}, [N, F]), G = d(() => N(!0), [N]), K = d((e) => {
|
|
23
|
+
L(void 0), F(e);
|
|
24
|
+
}, [F]);
|
|
25
|
+
if (!C) return u;
|
|
26
|
+
let q = E === "document" && (!B || M), J = H && B && /* @__PURE__ */ g(t, { children: /* @__PURE__ */ g(e, { children: /* @__PURE__ */ _(l, {
|
|
27
|
+
fallback: null,
|
|
28
|
+
children: [T === "default" && /* @__PURE__ */ g(v, {
|
|
29
|
+
className: c({ dark: k === "dark" }),
|
|
30
|
+
collapsed: M,
|
|
31
|
+
orientation: V,
|
|
32
|
+
tabSelected: P,
|
|
33
|
+
logTypeFilter: I,
|
|
34
|
+
onOpen: W,
|
|
35
|
+
onCollapse: G,
|
|
36
|
+
onTabSelect: K,
|
|
37
|
+
onChangeOrientation: U
|
|
38
|
+
}), T === "shadow" && /* @__PURE__ */ _(o, { children: [O && /* @__PURE__ */ g(o.Link, { href: O }), /* @__PURE__ */ _(o.Content, { children: [/* @__PURE__ */ g("style", { dangerouslySetInnerHTML: { __html: D } }), /* @__PURE__ */ g(v, {
|
|
39
|
+
className: c({ dark: k === "dark" }),
|
|
40
|
+
collapsed: M,
|
|
41
|
+
orientation: V,
|
|
42
|
+
tabSelected: P,
|
|
43
|
+
logTypeFilter: I,
|
|
44
|
+
onOpen: W,
|
|
45
|
+
onCollapse: G,
|
|
46
|
+
onTabSelect: K,
|
|
47
|
+
onChangeOrientation: U
|
|
48
|
+
})] })] })]
|
|
49
|
+
}) }) });
|
|
50
|
+
return /* @__PURE__ */ _("div", {
|
|
51
|
+
className: c("relative flex min-w-0 grow", {
|
|
52
|
+
"overflow-auto": !q,
|
|
53
|
+
"flex-col": q || V === "horizontal",
|
|
54
|
+
"h-screen": !q && V === "vertical"
|
|
55
|
+
}, x),
|
|
56
|
+
children: [/* @__PURE__ */ g(m, {
|
|
57
|
+
value: z,
|
|
58
|
+
children: /* @__PURE__ */ g("div", {
|
|
59
|
+
className: c("grow", { "basis-0 flex-col overflow-auto": !q }, S),
|
|
60
|
+
children: u
|
|
36
61
|
})
|
|
37
|
-
}),
|
|
38
|
-
className:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
logTypeFilter: P,
|
|
43
|
-
onOpen: H,
|
|
44
|
-
onCollapse: U,
|
|
45
|
-
onTabSelect: W,
|
|
46
|
-
onChangeOrientation: V
|
|
47
|
-
}), w === "shadow" && /* @__PURE__ */ g(s, { children: [E && /* @__PURE__ */ h(s.Link, { href: E }), /* @__PURE__ */ g(s.Content, { children: [/* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: T } }), /* @__PURE__ */ h(t, {
|
|
48
|
-
className: l({ dark: D === "dark" }),
|
|
49
|
-
collapsed: A,
|
|
50
|
-
orientation: z,
|
|
51
|
-
tabSelected: M,
|
|
52
|
-
logTypeFilter: P,
|
|
53
|
-
onOpen: H,
|
|
54
|
-
onCollapse: U,
|
|
55
|
-
onTabSelect: W,
|
|
56
|
-
onChangeOrientation: V
|
|
57
|
-
})] })] })] }) })]
|
|
58
|
-
}) : y;
|
|
62
|
+
}), q ? /* @__PURE__ */ g("div", {
|
|
63
|
+
className: "sticky bottom-0 h-0",
|
|
64
|
+
children: J
|
|
65
|
+
}) : J]
|
|
66
|
+
});
|
|
59
67
|
};
|
|
60
68
|
//#endregion
|
|
61
|
-
export {
|
|
69
|
+
export { x as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
|
-
import a from "@plitzi/
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { omit as a } from "@plitzi/plitzi-ui/helpers";
|
|
3
|
+
import o from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
4
|
+
import { pConsole as s } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
|
|
5
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
6
6
|
//#region src/DevToolsContextProvider.tsx
|
|
7
7
|
var l = ({ children: l }) => {
|
|
8
8
|
let [u, d] = i([]), [f, p] = i({}), m = r(!1), h = e((e, t, n, r, i) => {
|
|
@@ -16,11 +16,11 @@ var l = ({ children: l }) => {
|
|
|
16
16
|
}, [d]), g = e((e, t) => p((n) => ({
|
|
17
17
|
...n,
|
|
18
18
|
[e]: t
|
|
19
|
-
})), []), _ = e((e) => p((t) =>
|
|
19
|
+
})), []), _ = e((e) => p((t) => a(t, [e])), []), v = e((e, ...t) => {
|
|
20
20
|
if (e && typeof f[e] == "function") return f[e](...t);
|
|
21
21
|
}, [f]), y = e(() => d([]), []);
|
|
22
|
-
m.current ||= (
|
|
23
|
-
|
|
22
|
+
m.current ||= (s.setCallback(h), s.setCallbackAddProvider(g), s.setCallbackRemoveProvider(_), !0), t(() => (s.setCallback(h), s.setCallbackAddProvider(g), s.setCallbackRemoveProvider(_), s.processPendingLogs(), () => {
|
|
23
|
+
s.setCallback(void 0), s.setCallbackAddProvider(void 0), s.setCallbackRemoveProvider(void 0), s.flush();
|
|
24
24
|
}), [
|
|
25
25
|
h,
|
|
26
26
|
g,
|
|
@@ -39,7 +39,7 @@ var l = ({ children: l }) => {
|
|
|
39
39
|
y,
|
|
40
40
|
v
|
|
41
41
|
]);
|
|
42
|
-
return /* @__PURE__ */ o
|
|
42
|
+
return /* @__PURE__ */ c(o, {
|
|
43
43
|
value: b,
|
|
44
44
|
children: l
|
|
45
45
|
});
|
package/dist/DevToolsRoot.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { use as e, useContext as t, useLayoutEffect as n, useRef as r } from "react";
|
|
2
2
|
import { StoreContext as i } from "@plitzi/nexus/react";
|
|
3
3
|
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
-
import o from "@plitzi/
|
|
5
|
-
import s from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import { ThemeContext as o } from "@plitzi/plitzi-ui/Provider";
|
|
5
|
+
import { createRoot as s } from "react-dom/client";
|
|
6
|
+
import c from "@plitzi/sdk-plugins/PluginsContext";
|
|
7
|
+
import l from "@plitzi/sdk-shared/elements/ComponentContext";
|
|
8
8
|
import u from "@plitzi/sdk-shared/theme/ThemeScope";
|
|
9
9
|
//#region src/DevToolsRoot.tsx
|
|
10
10
|
var d = { display: "contents" }, f = ({ children: f }) => {
|
|
11
|
-
let p = r(null), m = r(void 0), h = r(void 0), g = t(i), _ = e(u), v = e(
|
|
11
|
+
let p = r(null), m = r(void 0), h = r(void 0), g = t(i), _ = e(u), v = e(c), y = e(l), b = e(o);
|
|
12
12
|
return n(() => {
|
|
13
13
|
let e = p.current;
|
|
14
|
-
if (e) return clearTimeout(h.current), m.current ??=
|
|
14
|
+
if (e) return clearTimeout(h.current), m.current ??= s(e), () => {
|
|
15
15
|
let e = m.current;
|
|
16
16
|
h.current = setTimeout(() => {
|
|
17
17
|
e?.unmount(), m.current === e && (m.current = void 0);
|
|
@@ -20,13 +20,13 @@ var d = { display: "contents" }, f = ({ children: f }) => {
|
|
|
20
20
|
}, []), n(() => {
|
|
21
21
|
m.current?.render(/* @__PURE__ */ a(i, {
|
|
22
22
|
value: g,
|
|
23
|
-
children: /* @__PURE__ */ a(
|
|
23
|
+
children: /* @__PURE__ */ a(o, {
|
|
24
24
|
value: b,
|
|
25
25
|
children: /* @__PURE__ */ a(u, {
|
|
26
26
|
value: _,
|
|
27
|
-
children: /* @__PURE__ */ a(
|
|
27
|
+
children: /* @__PURE__ */ a(c, {
|
|
28
28
|
value: v,
|
|
29
|
-
children: /* @__PURE__ */ a(
|
|
29
|
+
children: /* @__PURE__ */ a(l, {
|
|
30
30
|
value: y,
|
|
31
31
|
children: f
|
|
32
32
|
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import e from "./DevToolsButton.mjs";
|
|
2
2
|
import t from "clsx";
|
|
3
3
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { throttle as o } from "@plitzi/plitzi-ui/helpers";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/DevToolsPanel/DevToolsSubHeader.tsx
|
|
7
7
|
var l = ({ className: l, elementSelected: u, currentPageId: d, onSelectElement: f }) => {
|
|
8
8
|
let [p, m] = a(!1), h = n((e) => {
|
|
9
9
|
let { id: t } = e?.dataset ?? {};
|
|
10
10
|
f(t);
|
|
11
|
-
}, [f]), g = i(() =>
|
|
11
|
+
}, [f]), g = i(() => o(h, 100), [h]), _ = n((e) => {
|
|
12
12
|
e.target.closest(".plitzi-sdk") && g(e.target.closest("[data-id]"));
|
|
13
13
|
}, [g]), v = n((e) => {
|
|
14
14
|
e.target.closest(".plitzi-sdk") && (e.stopPropagation(), e.preventDefault(), m(!1));
|
|
@@ -35,22 +35,22 @@ var l = ({ className: l, elementSelected: u, currentPageId: d, onSelectElement:
|
|
|
35
35
|
v,
|
|
36
36
|
_,
|
|
37
37
|
p
|
|
38
|
-
]), /* @__PURE__ */
|
|
38
|
+
]), /* @__PURE__ */ c("div", {
|
|
39
39
|
className: t("flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800", l),
|
|
40
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ c("div", {
|
|
41
41
|
className: "flex gap-1",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ s(e, {
|
|
43
43
|
iconClassName: "fa-regular fa-hand-pointer",
|
|
44
44
|
title: "Select an element in the page to inspect it",
|
|
45
45
|
onClick: y,
|
|
46
46
|
isSelected: p
|
|
47
|
-
}), /* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ s(e, {
|
|
48
48
|
iconClassName: "fa-regular fa-file",
|
|
49
49
|
title: "Current Page",
|
|
50
50
|
onClick: b,
|
|
51
51
|
isSelected: u === d
|
|
52
52
|
})]
|
|
53
|
-
}), /* @__PURE__ */
|
|
53
|
+
}), /* @__PURE__ */ s(e, {
|
|
54
54
|
iconClassName: "fa-solid fa-ban",
|
|
55
55
|
onClick: x,
|
|
56
56
|
title: "Clear",
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { useCallback as e, useMemo as t } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { get as n } from "@plitzi/plitzi-ui/helpers";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { useCommonStore as i } from "@plitzi/sdk-shared/store";
|
|
5
5
|
//#region src/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.tsx
|
|
6
6
|
var a = ({ attribute: a, value: o, isDefinition: s = !1, onSelectElement: c }) => {
|
|
7
|
-
let [l] =
|
|
7
|
+
let [l] = i("schema.flat"), u = e((e) => () => c?.(e), [c]), d = t(() => a === "items" && s && Array.isArray(o) ? /* @__PURE__ */ r("div", {
|
|
8
8
|
className: "flex flex-col",
|
|
9
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
9
|
+
children: o.map((e, t) => /* @__PURE__ */ r("div", {
|
|
10
10
|
className: "cursor-pointer text-purple-400",
|
|
11
11
|
onClick: u(e),
|
|
12
|
-
children:
|
|
12
|
+
children: n(l, `${e}.definition.label`, e)
|
|
13
13
|
}, t))
|
|
14
|
-
}) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */
|
|
14
|
+
}) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */ r("div", {
|
|
15
15
|
className: "cursor-pointer text-purple-400",
|
|
16
16
|
onClick: u(o),
|
|
17
|
-
children:
|
|
17
|
+
children: n(l, `${o}.definition.label`, o)
|
|
18
18
|
}) : a === "styleSelectors" && s && o && typeof o == "object" ? Object.values(o).join(", ") : typeof o == "object" && o ? JSON.stringify(o) : typeof o == "boolean" ? o ? "True" : "False" : o, [
|
|
19
19
|
a,
|
|
20
20
|
s,
|
|
@@ -22,7 +22,7 @@ var a = ({ attribute: a, value: o, isDefinition: s = !1, onSelectElement: c }) =
|
|
|
22
22
|
u,
|
|
23
23
|
l
|
|
24
24
|
]);
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ r("div", {
|
|
26
26
|
className: "grow basis-0 truncate",
|
|
27
27
|
children: d
|
|
28
28
|
});
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import e from "./ElementsListItem.mjs";
|
|
2
2
|
import { useCallback as t, useMemo as n, useState as r } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { get as i } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
5
|
import s from "@plitzi/plitzi-ui/Input";
|
|
6
6
|
//#region src/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.tsx
|
|
7
7
|
var c = 200, l = ({ elements: l, elementSelected: u, onSelect: d }) => {
|
|
8
8
|
let [f, p] = r(""), m = n(() => (l ?? []).filter((e) => e.definition.label.toLowerCase().includes(f.toLowerCase())), [l, f]), h = n(() => m.slice(0, c), [m]), g = m.length - h.length, _ = t((e) => p(e), []);
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ o("div", {
|
|
10
10
|
className: "flex h-full w-[280px] shrink-0 flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",
|
|
11
|
-
children: [/* @__PURE__ */
|
|
11
|
+
children: [/* @__PURE__ */ a("div", {
|
|
12
12
|
className: "px-2 pt-2",
|
|
13
|
-
children: /* @__PURE__ */
|
|
13
|
+
children: /* @__PURE__ */ a(s, {
|
|
14
14
|
value: f,
|
|
15
15
|
onChange: _,
|
|
16
16
|
placeholder: "Search elements...",
|
|
17
17
|
size: "sm"
|
|
18
18
|
})
|
|
19
|
-
}), /* @__PURE__ */
|
|
19
|
+
}), /* @__PURE__ */ o("div", {
|
|
20
20
|
className: "flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",
|
|
21
21
|
children: [
|
|
22
|
-
h.length === 0 && /* @__PURE__ */
|
|
22
|
+
h.length === 0 && /* @__PURE__ */ a("div", {
|
|
23
23
|
className: "p-4 text-center text-zinc-400 dark:text-zinc-600",
|
|
24
24
|
children: "No elements"
|
|
25
25
|
}),
|
|
26
|
-
h.map((t) => /* @__PURE__ */
|
|
26
|
+
h.map((t) => /* @__PURE__ */ a(e, {
|
|
27
27
|
name: t.definition.label,
|
|
28
28
|
isSelected: u === t.id,
|
|
29
|
-
isVisible:
|
|
29
|
+
isVisible: i(t, "definition.initialState.visibility", !0),
|
|
30
30
|
id: t.id,
|
|
31
31
|
onSelect: d
|
|
32
32
|
}, t.id)),
|
|
33
|
-
g > 0 && /* @__PURE__ */
|
|
33
|
+
g > 0 && /* @__PURE__ */ o("div", {
|
|
34
34
|
className: "p-3 text-center text-[11px] text-zinc-400 dark:text-zinc-600",
|
|
35
35
|
children: [g, " more — narrow the search to reach them"]
|
|
36
36
|
})
|
|
@@ -2,25 +2,25 @@ import e from "./ExecutionTree/index.mjs";
|
|
|
2
2
|
import t from "./InteractionNode/index.mjs";
|
|
3
3
|
import n from "clsx";
|
|
4
4
|
import { useCallback as r, useMemo as i, useState as a } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { get as o } from "@plitzi/plitzi-ui/helpers";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.tsx
|
|
8
8
|
var l = ({ className: l, node: u, nodes: d }) => {
|
|
9
|
-
let [f, p] = a(u.id), m = i(() =>
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
let [f, p] = a(u.id), m = i(() => o(d, `${f}`), [f, d]), h = r((e) => p(e), []);
|
|
10
|
+
return /* @__PURE__ */ c("div", {
|
|
11
11
|
className: n("flex", l),
|
|
12
12
|
children: [
|
|
13
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ s(e, {
|
|
14
14
|
className: "grow basis-0",
|
|
15
15
|
nodeId: u.id,
|
|
16
16
|
nodes: d,
|
|
17
17
|
selected: f,
|
|
18
18
|
onSelect: h
|
|
19
19
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
f && /* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ s("div", { className: "mx-1 w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
|
|
21
|
+
f && /* @__PURE__ */ s("div", {
|
|
22
22
|
className: "flex min-w-0 grow basis-0",
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ s(t, {
|
|
24
24
|
whenParams: m.whenParams,
|
|
25
25
|
status: m.status,
|
|
26
26
|
name: m.node.title,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCallback as e, useMemo as t } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { get as n } from "@plitzi/plitzi-ui/helpers";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { useCommonStore as a } from "@plitzi/sdk-shared/store";
|
|
5
5
|
import { formatDate as o } from "@plitzi/sdk-shared/helpers";
|
|
6
6
|
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.tsx
|
|
7
7
|
var s = ({ triggerName: s, startTime: c, endTime: l, duration: u, elementId: d, hostElementId: f }) => {
|
|
8
|
-
let [p] =
|
|
8
|
+
let [p] = a("schema.flat"), m = t(() => d ? n(p, d) : void 0, [d, p]), h = t(() => o(c, "HH:mm:ss.SSS"), [c]), g = t(() => o(l, "HH:mm:ss.SSS"), [l]), _ = t(() => {
|
|
9
9
|
if (typeof document < "u") return document.querySelector(`[data-id="${d}"]`);
|
|
10
10
|
}, [d]), v = e(() => {
|
|
11
11
|
_?.scrollIntoView({
|
|
@@ -18,34 +18,34 @@ var s = ({ triggerName: s, startTime: c, endTime: l, duration: u, elementId: d,
|
|
|
18
18
|
}, [_]), b = e(() => {
|
|
19
19
|
_?.classList.remove("devtools-element-hovered");
|
|
20
20
|
}, [_]);
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ i("div", {
|
|
22
22
|
className: "flex justify-around gap-3",
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ i("div", {
|
|
25
25
|
className: "flex min-w-0 grow basis-0 flex-col",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ i("div", {
|
|
27
27
|
className: "mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
}), /* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ r("i", { className: "fa-regular fa-clock" }), "Times"]
|
|
29
|
+
}), /* @__PURE__ */ i("div", {
|
|
30
30
|
className: "flex flex-col gap-0.5 font-mono text-zinc-700 dark:text-zinc-300",
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ i("div", {
|
|
33
33
|
className: "flex gap-1",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ r("span", {
|
|
35
35
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
36
36
|
children: "Start"
|
|
37
37
|
}), h]
|
|
38
38
|
}),
|
|
39
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ i("div", {
|
|
40
40
|
className: "flex gap-1",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ r("span", {
|
|
42
42
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
43
43
|
children: "End"
|
|
44
44
|
}), g]
|
|
45
45
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ i("div", {
|
|
47
47
|
className: "flex gap-1",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ r("span", {
|
|
49
49
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
50
50
|
children: "Duration"
|
|
51
51
|
}), u]
|
|
@@ -53,53 +53,53 @@ var s = ({ triggerName: s, startTime: c, endTime: l, duration: u, elementId: d,
|
|
|
53
53
|
]
|
|
54
54
|
})]
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ r("div", { className: "w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
|
|
57
|
+
/* @__PURE__ */ i("div", {
|
|
58
58
|
className: "flex min-w-0 grow basis-0 flex-col",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ i("div", {
|
|
60
60
|
className: "mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
62
|
-
}), /* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ r("i", { className: "fa-solid fa-circle-info" }), "Details"]
|
|
62
|
+
}), /* @__PURE__ */ i("div", {
|
|
63
63
|
className: "flex flex-col gap-0.5 text-zinc-700 dark:text-zinc-300",
|
|
64
64
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ i("div", {
|
|
66
66
|
className: "flex gap-1",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
67
|
+
children: [/* @__PURE__ */ r("span", {
|
|
68
68
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
69
69
|
children: "Type"
|
|
70
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ r("span", { children: "Interaction" })]
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ i("div", {
|
|
73
73
|
className: "flex min-w-0 gap-1",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ r("span", {
|
|
75
75
|
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
76
76
|
children: "Trigger"
|
|
77
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ r("span", {
|
|
78
78
|
className: "truncate",
|
|
79
79
|
children: s
|
|
80
80
|
})]
|
|
81
81
|
}),
|
|
82
|
-
f && /* @__PURE__ */
|
|
82
|
+
f && /* @__PURE__ */ i("div", {
|
|
83
83
|
className: "flex min-w-0 gap-1",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
84
|
+
children: [/* @__PURE__ */ r("span", {
|
|
85
85
|
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
86
86
|
children: "Fired on"
|
|
87
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ r("span", {
|
|
88
88
|
className: "truncate font-mono",
|
|
89
89
|
children: f
|
|
90
90
|
})]
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ i("div", {
|
|
93
93
|
className: "flex min-w-0 gap-1",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ r("span", {
|
|
95
95
|
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
96
96
|
children: "Element"
|
|
97
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ i("span", {
|
|
98
98
|
className: "cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",
|
|
99
99
|
onClick: v,
|
|
100
100
|
onMouseEnter: y,
|
|
101
101
|
onMouseLeave: b,
|
|
102
|
-
children: [m?.definition.label, d && /* @__PURE__ */
|
|
102
|
+
children: [m?.definition.label, d && /* @__PURE__ */ i("span", {
|
|
103
103
|
className: "ml-1 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",
|
|
104
104
|
children: [
|
|
105
105
|
"[",
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import e from "./ExecutionTreeNode.mjs";
|
|
2
2
|
import t from "clsx";
|
|
3
3
|
import { useCallback as n, useMemo as r } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { get as i } from "@plitzi/plitzi-ui/helpers";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
import { getDurationMs as s } from "@plitzi/sdk-shared";
|
|
7
7
|
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.tsx
|
|
8
8
|
var c = ({ className: c, nodeId: l, nodes: u, selected: d, onSelect: f }) => {
|
|
9
9
|
let p = r(() => {
|
|
10
|
-
let e =
|
|
10
|
+
let e = i(u, l), t = [];
|
|
11
11
|
for (; e;) {
|
|
12
|
-
let { node: n, startTime: r, endTime:
|
|
12
|
+
let { node: n, startTime: r, endTime: a } = e, o = `${s(r, a)}ms`, c = n.id === l ? 0 : 1;
|
|
13
13
|
t.push({
|
|
14
14
|
id: n.id,
|
|
15
15
|
action: n.action,
|
|
16
16
|
title: n.title,
|
|
17
17
|
status: e.status,
|
|
18
18
|
level: c,
|
|
19
|
-
duration:
|
|
20
|
-
}), e =
|
|
19
|
+
duration: o
|
|
20
|
+
}), e = i(u, n.afterNode);
|
|
21
21
|
}
|
|
22
22
|
return t;
|
|
23
23
|
}, [l, u]), m = n((e) => f?.(e), [f]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ o("div", {
|
|
25
25
|
className: t("flex flex-col gap-1.5", c),
|
|
26
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ o("div", {
|
|
27
27
|
className: "flex items-center gap-1.5 px-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
}), /* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ a("i", { className: "fa-solid fa-code-merge" }), "Execution Tree"]
|
|
29
|
+
}), /* @__PURE__ */ a("div", {
|
|
30
30
|
className: "flex flex-col",
|
|
31
|
-
children: p.map((t, n) => /* @__PURE__ */
|
|
31
|
+
children: p.map((t, n) => /* @__PURE__ */ a(e, {
|
|
32
32
|
id: t.id,
|
|
33
33
|
action: t.action,
|
|
34
34
|
title: t.title,
|