@plitzi/sdk-dev-tools 0.33.2 → 0.34.0
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 +16 -0
- package/dist/DevToolsContainer.mjs +50 -45
- package/dist/DevToolsContextProvider.mjs +1 -1
- package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +1 -1
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +32 -30
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +40 -34
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +13 -13
- package/dist/components/DevToolsPanel/ThemeControl.d.ts +2 -0
- package/dist/components/DevToolsPanel/ThemeControl.mjs +27 -0
- package/dist/components/DevToolsPanel/tabs/ActionsViewer/ActionsViewer.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/ActionsViewer/ActionsViewer.mjs +147 -0
- package/dist/components/DevToolsPanel/tabs/ActionsViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/ActionsViewer/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.mjs +23 -16
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.mjs +9 -9
- package/dist/components/DevToolsPanel/tabs/Logs/Log.mjs +30 -24
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogAction/LogAction.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogAction/LogAction.mjs +42 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogAction/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogAction/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.d.ts +3 -3
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.d.ts +2 -2
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.d.ts +2 -2
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.d.ts +7 -2
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +41 -24
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.d.ts +5 -5
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.mjs +2 -2
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionNote.d.ts +17 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionNote.mjs +72 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.d.ts +10 -3
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.mjs +27 -8
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.mjs +37 -22
- package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +27 -26
- package/dist/components/DevToolsPanel/tabs/TracingViewer/TracingViewer.mjs +34 -34
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/FlameFrame.mjs +3 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.mjs +48 -35
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.mjs +32 -32
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.mjs +40 -40
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.mjs +7 -7
- package/dist/components/DevToolsPanel/tabs/TracingViewer/helpers.d.ts +26 -1
- package/dist/components/DevToolsPanel/tabs/TracingViewer/helpers.mjs +106 -84
- package/dist/components/List/List.mjs +1 -1
- package/dist/useHydrated.d.ts +2 -0
- package/dist/useHydrated.mjs +5 -0
- package/dist/useRegisterRootStore.d.ts +11 -0
- package/dist/useRegisterRootStore.mjs +13 -0
- package/package.json +57 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @plitzi/sdk-dev-tools
|
|
2
2
|
|
|
3
|
+
## 0.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v0.34.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [5aceda0]
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- Updated dependencies [5aceda0]
|
|
14
|
+
- @plitzi/sdk-shared@0.34.0
|
|
15
|
+
- @plitzi/sdk-navigation@0.34.0
|
|
16
|
+
- @plitzi/sdk-schema@0.34.0
|
|
17
|
+
- @plitzi/sdk-style@0.34.0
|
|
18
|
+
|
|
3
19
|
## 0.33.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,54 +1,59 @@
|
|
|
1
1
|
import { useIsSelectedInstance as e } from "./instanceRegistry.mjs";
|
|
2
2
|
import t from "./components/DevToolsOverlay/index.mjs";
|
|
3
3
|
import n from "./DevToolsContextProvider.mjs";
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import r from "./useHydrated.mjs";
|
|
5
|
+
import i from "./useRegisterRootStore.mjs";
|
|
6
|
+
import a from "@plitzi/plitzi-ui/ContainerShadow";
|
|
7
|
+
import o from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
8
|
+
import s from "clsx";
|
|
9
|
+
import { useCallback as c, useRef as l, useState as u } from "react";
|
|
8
10
|
import { DevStoreScopeContext as d } from "@plitzi/nexus/react";
|
|
9
|
-
import
|
|
10
|
-
import p from "
|
|
11
|
+
import f from "@plitzi/sdk-shared/theme/useTheme";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
13
|
//#region src/DevToolsContainer.tsx
|
|
12
|
-
var
|
|
13
|
-
let {
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
j(
|
|
19
|
-
}, [k])
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
var h = "horizontal", g = 0, _ = ({ children: _, className: v, innerClassName: y, enabled: b = !1, instanceId: x, renderMode: S = "default", devToolsStyle: C = "", devToolsStyleLink: w = "" }) => {
|
|
15
|
+
let { resolvedTheme: T } = f(), [E, D] = o("plitzi-sdk.dev-tools.orientation", h), [O, k] = o("plitzi-sdk.dev-tools.collapsed", !0), [A, j] = o("plitzi-sdk.dev-tools.tab", "logs"), [M, N] = u(), P = l(void 0);
|
|
16
|
+
P.current ||= `sdk-instance-${++g}`;
|
|
17
|
+
let F = x || P.current, I = r(), L = I ? E : h, R = e(F, b);
|
|
18
|
+
i(b);
|
|
19
|
+
let z = c((e) => D(e), [D]), B = c((e) => {
|
|
20
|
+
e && j("logs"), N(e), k(!1);
|
|
21
|
+
}, [k, j]), V = c(() => k(!0), [k]), H = c((e) => {
|
|
22
|
+
N(void 0), j(e);
|
|
23
|
+
}, [j]);
|
|
24
|
+
return b ? /* @__PURE__ */ m("div", {
|
|
25
|
+
className: s("relative flex grow overflow-auto", {
|
|
26
|
+
"flex-col": L === "horizontal",
|
|
27
|
+
"h-screen": L === "vertical"
|
|
28
|
+
}, v),
|
|
29
|
+
children: [/* @__PURE__ */ p(d, {
|
|
30
|
+
value: F,
|
|
31
|
+
children: /* @__PURE__ */ p("div", {
|
|
32
|
+
className: s("grow basis-0 flex-col overflow-auto", y),
|
|
33
|
+
children: _
|
|
30
34
|
})
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
}), R && I && /* @__PURE__ */ m(n, { children: [S === "default" && /* @__PURE__ */ p(t, {
|
|
36
|
+
className: s({ dark: T === "dark" }),
|
|
37
|
+
collapsed: O,
|
|
38
|
+
orientation: L,
|
|
39
|
+
tabSelected: A,
|
|
40
|
+
logTypeFilter: M,
|
|
41
|
+
onOpen: B,
|
|
42
|
+
onCollapse: V,
|
|
43
|
+
onTabSelect: H,
|
|
44
|
+
onChangeOrientation: z
|
|
45
|
+
}), S === "shadow" && /* @__PURE__ */ m(a, { children: [w && /* @__PURE__ */ p(a.Link, { href: w }), /* @__PURE__ */ m(a.Content, { children: [/* @__PURE__ */ p("style", { dangerouslySetInnerHTML: { __html: C } }), /* @__PURE__ */ p(t, {
|
|
46
|
+
className: s({ dark: T === "dark" }),
|
|
47
|
+
collapsed: O,
|
|
48
|
+
orientation: L,
|
|
49
|
+
tabSelected: A,
|
|
50
|
+
logTypeFilter: M,
|
|
51
|
+
onOpen: B,
|
|
52
|
+
onCollapse: V,
|
|
53
|
+
onTabSelect: H,
|
|
54
|
+
onChangeOrientation: z
|
|
50
55
|
})] })] })] })]
|
|
51
|
-
}) :
|
|
56
|
+
}) : _;
|
|
52
57
|
};
|
|
53
58
|
//#endregion
|
|
54
|
-
export {
|
|
59
|
+
export { _ as default };
|
|
@@ -17,7 +17,7 @@ var l = ({ children: l }) => {
|
|
|
17
17
|
...n,
|
|
18
18
|
[e]: t
|
|
19
19
|
})), []), _ = e((e) => p((t) => s(t, [e])), []), v = e((e, ...t) => {
|
|
20
|
-
if (
|
|
20
|
+
if (e && typeof f[e] == "function") return f[e](...t);
|
|
21
21
|
}, [f]), y = e(() => d([]), []);
|
|
22
22
|
m.current ||= (c.setCallback(h), c.setCallbackAddProvider(g), c.setCallbackRemoveProvider(_), !0), t(() => (c.setCallback(h), c.setCallbackAddProvider(g), c.setCallbackRemoveProvider(_), c.processPendingLogs(), () => {
|
|
23
23
|
c.setCallback(void 0), c.setCallbackAddProvider(void 0), c.setCallbackRemoveProvider(void 0), c.flush();
|
|
@@ -26,7 +26,7 @@ var s = ({ className: s, onOpen: c }) => {
|
|
|
26
26
|
c
|
|
27
27
|
]);
|
|
28
28
|
return /* @__PURE__ */ a("div", {
|
|
29
|
-
className: e("
|
|
29
|
+
className: e("absolute bottom-3 left-3 z-[1000000]", s),
|
|
30
30
|
children: /* @__PURE__ */ o("button", {
|
|
31
31
|
className: e("flex cursor-pointer items-center gap-2 rounded border border-zinc-200 bg-white px-2 py-1.5 text-[12px]/[16px]", "font-bold text-zinc-600 shadow-md transition-colors select-none hover:bg-zinc-50", "dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"),
|
|
32
32
|
title: "Plitzi dev tools",
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import e from "./tabs/
|
|
2
|
-
import t from "./tabs/
|
|
3
|
-
import n from "./tabs/
|
|
4
|
-
import r from "./tabs/
|
|
5
|
-
import i from "./tabs/
|
|
6
|
-
import a from "./tabs/
|
|
7
|
-
import o from "./tabs/
|
|
8
|
-
import s from "
|
|
9
|
-
import
|
|
10
|
-
import l from "
|
|
11
|
-
import
|
|
1
|
+
import e from "./tabs/ActionsViewer/index.mjs";
|
|
2
|
+
import t from "./tabs/ElementsViewer/index.mjs";
|
|
3
|
+
import n from "./tabs/HistoryViewer/index.mjs";
|
|
4
|
+
import r from "./tabs/Logs/index.mjs";
|
|
5
|
+
import i from "./tabs/PluginsViewer/PluginsViewer.mjs";
|
|
6
|
+
import a from "./tabs/StoreViewer/index.mjs";
|
|
7
|
+
import o from "./tabs/TracingViewer/TracingViewer.mjs";
|
|
8
|
+
import s from "./tabs/VariablesViewer/index.mjs";
|
|
9
|
+
import c from "clsx";
|
|
10
|
+
import { use as l } from "react";
|
|
11
|
+
import u from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
12
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/DevToolsPanel/DevToolsBody.tsx
|
|
13
|
-
var
|
|
14
|
-
let { logs:
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
className:
|
|
17
|
-
children: /* @__PURE__ */
|
|
14
|
+
var p = ({ className: p, tabSelected: m, orientation: h, logTypeFilter: g, elementSelected: _, onSelectElement: v }) => {
|
|
15
|
+
let { logs: y, clearLogs: b } = l(u);
|
|
16
|
+
return /* @__PURE__ */ d("div", {
|
|
17
|
+
className: c("flex h-full w-full grow overflow-auto bg-white dark:bg-zinc-900", p),
|
|
18
|
+
children: /* @__PURE__ */ f("div", {
|
|
18
19
|
className: "flex w-full flex-col",
|
|
19
20
|
children: [
|
|
20
|
-
|
|
21
|
-
items:
|
|
22
|
-
orientation:
|
|
23
|
-
logTypeFilter:
|
|
24
|
-
onClear:
|
|
21
|
+
m === "logs" && /* @__PURE__ */ d(r, {
|
|
22
|
+
items: y,
|
|
23
|
+
orientation: h,
|
|
24
|
+
logTypeFilter: g,
|
|
25
|
+
onClear: b
|
|
25
26
|
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
elementSelected:
|
|
31
|
-
onSelectElement:
|
|
27
|
+
m === "store" && /* @__PURE__ */ d(a, { elementSelected: _ }),
|
|
28
|
+
m === "history" && /* @__PURE__ */ d(n, {}),
|
|
29
|
+
m === "variables" && /* @__PURE__ */ d(s, {}),
|
|
30
|
+
m === "elements" && /* @__PURE__ */ d(t, {
|
|
31
|
+
elementSelected: _,
|
|
32
|
+
onSelectElement: v
|
|
32
33
|
}),
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
m === "plugins" && /* @__PURE__ */ d(i, {}),
|
|
35
|
+
m === "tracing" && /* @__PURE__ */ d(o, {}),
|
|
36
|
+
m === "actions" && /* @__PURE__ */ d(e, {})
|
|
35
37
|
]
|
|
36
38
|
})
|
|
37
39
|
});
|
|
38
40
|
};
|
|
39
41
|
//#endregion
|
|
40
|
-
export {
|
|
42
|
+
export { p as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useScopeSelector as e } from "../../scope/useScope.mjs";
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import t from "./DevToolsButton.mjs";
|
|
3
|
+
import n from "./ThemeControl.mjs";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { useCallback as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
7
|
//#region src/components/DevToolsPanel/DevToolsHeader.tsx
|
|
6
|
-
var
|
|
8
|
+
var s = [
|
|
7
9
|
{
|
|
8
10
|
id: "logs",
|
|
9
11
|
label: "Logs",
|
|
@@ -38,57 +40,61 @@ var a = [
|
|
|
38
40
|
id: "tracing",
|
|
39
41
|
label: "Tracing",
|
|
40
42
|
icon: "fa-solid fa-gauge-high"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "actions",
|
|
46
|
+
label: "Actions",
|
|
47
|
+
icon: "fa-solid fa-bolt"
|
|
41
48
|
}
|
|
42
|
-
],
|
|
43
|
-
let { options:
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
return /* @__PURE__ */
|
|
49
|
+
], c = ({ tabSelected: c, orientation: l = "vertical", onChangeOrientation: u, onCollapse: d, onTabSelect: f }) => {
|
|
50
|
+
let { options: p, value: m, onSelect: h } = e(), g = i(() => {
|
|
51
|
+
u?.(l === "horizontal" ? "vertical" : "horizontal");
|
|
52
|
+
}, [l, u]), _ = i((e) => () => f?.(e), [f]), v = i((e) => h(e.target.value), [h]);
|
|
53
|
+
return /* @__PURE__ */ o("div", {
|
|
47
54
|
className: "flex shrink-0 items-stretch justify-between border-b border-zinc-200 bg-zinc-100 select-none dark:border-zinc-700 dark:bg-zinc-800",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ a("div", {
|
|
49
56
|
className: "flex items-stretch overflow-x-auto",
|
|
50
|
-
children:
|
|
51
|
-
let
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
onClick:
|
|
54
|
-
className:
|
|
55
|
-
"border-violet-500 text-violet-600 dark:text-violet-400":
|
|
56
|
-
"border-transparent text-zinc-500 hover:bg-zinc-200/70 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-zinc-100": !
|
|
57
|
+
children: s.map((e) => {
|
|
58
|
+
let t = c === e.id;
|
|
59
|
+
return /* @__PURE__ */ o("button", {
|
|
60
|
+
onClick: _(e.id),
|
|
61
|
+
className: r("flex cursor-pointer items-center gap-1.5 border-b-2 px-3 py-2 font-medium transition-colors", {
|
|
62
|
+
"border-violet-500 text-violet-600 dark:text-violet-400": t,
|
|
63
|
+
"border-transparent text-zinc-500 hover:bg-zinc-200/70 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-zinc-100": !t
|
|
57
64
|
}),
|
|
58
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ a("i", { className: r(e.icon, "text-[10px]") }), e.label]
|
|
59
66
|
}, e.id);
|
|
60
67
|
})
|
|
61
|
-
}), /* @__PURE__ */
|
|
68
|
+
}), /* @__PURE__ */ o("div", {
|
|
62
69
|
className: "flex shrink-0 items-center gap-1 border-l border-zinc-200 px-2 dark:border-zinc-700",
|
|
63
70
|
children: [
|
|
64
|
-
|
|
65
|
-
value:
|
|
66
|
-
onChange:
|
|
71
|
+
p.length > 0 && /* @__PURE__ */ a("select", {
|
|
72
|
+
value: m ?? "",
|
|
73
|
+
onChange: v,
|
|
67
74
|
title: "Instance / StoreProvider driving the panel",
|
|
68
75
|
className: "max-w-52 rounded border border-zinc-300 bg-white px-1 py-0.5 text-[11px] text-zinc-700 dark:border-zinc-600 dark:bg-zinc-900 dark:text-zinc-200",
|
|
69
|
-
children:
|
|
76
|
+
children: p.map((e) => /* @__PURE__ */ a("optgroup", {
|
|
70
77
|
label: e.label,
|
|
71
|
-
children: e.options.map((e) => /* @__PURE__ */
|
|
78
|
+
children: e.options.map((e) => /* @__PURE__ */ a("option", {
|
|
72
79
|
value: e.value,
|
|
73
80
|
children: e.label
|
|
74
81
|
}, e.value))
|
|
75
82
|
}, e.label))
|
|
76
83
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
/* @__PURE__ */ a(n, {}),
|
|
85
|
+
/* @__PURE__ */ a(t, {
|
|
86
|
+
iconClassName: r("fa-solid fa-table-columns", { "rotate-90": l === "vertical" }),
|
|
87
|
+
title: l === "horizontal" ? "Switch to side panel" : "Switch to bottom panel",
|
|
88
|
+
onClick: g
|
|
82
89
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
90
|
+
/* @__PURE__ */ a(t, {
|
|
91
|
+
iconClassName: "fa-solid fa-xmark",
|
|
85
92
|
title: "Collapse to the indicator",
|
|
86
|
-
onClick:
|
|
87
|
-
children: /* @__PURE__ */ r("i", { className: "fa-solid fa-xmark text-xs" })
|
|
93
|
+
onClick: d
|
|
88
94
|
})
|
|
89
95
|
]
|
|
90
96
|
})]
|
|
91
97
|
});
|
|
92
98
|
};
|
|
93
99
|
//#endregion
|
|
94
|
-
export {
|
|
100
|
+
export { c as default };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import e from "./DevToolsBody.mjs";
|
|
2
2
|
import t from "./DevToolsHeader.mjs";
|
|
3
3
|
import n from "./DevToolsSubHeader.mjs";
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import u from "
|
|
8
|
-
import d from "@plitzi/plitzi-ui/
|
|
4
|
+
import r from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
5
|
+
import i from "clsx";
|
|
6
|
+
import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import d from "@plitzi/plitzi-ui/ContainerResizable";
|
|
9
9
|
import { useCommonStore as f } from "@plitzi/sdk-shared/store";
|
|
10
10
|
//#region src/components/DevToolsPanel/DevToolsPanel.tsx
|
|
11
11
|
var p = "vertical", m = "horizontal", h = ({ className: p, orientation: m = "vertical", tabSelected: h, logTypeFilter: g, onCollapse: _, onTabSelect: v, onChangeOrientation: y }) => {
|
|
12
|
-
let [b, x] =
|
|
12
|
+
let [b, x] = r("plitzi-sdk.dev-tools.size", {
|
|
13
13
|
width: 500,
|
|
14
14
|
height: 200
|
|
15
|
-
}), [S] = f("navigation.currentPageId"), [C, w] =
|
|
15
|
+
}), [S] = f("navigation.currentPageId"), [C, w] = c(), T = o(() => m === "vertical" ? ["w"] : ["n"], [m]), E = s(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), D = a((e) => w(e), [w]), O = a((e, t) => x((n) => ({
|
|
16
16
|
width: Number.isFinite(e) ? e : n.width,
|
|
17
17
|
height: Number.isFinite(t) ? t : n.height
|
|
18
18
|
})), [x]);
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className:
|
|
19
|
+
return /* @__PURE__ */ l(d, {
|
|
20
|
+
className: i("component__container-resizable-sidebar relative z-[1000000] text-xs", p, { "h-full": m === "vertical" }),
|
|
21
21
|
minConstraintsX: m === "vertical" ? 500 : Infinity,
|
|
22
22
|
maxConstraintsX: m === "vertical" ? 1e3 : Infinity,
|
|
23
23
|
minConstraintsY: m === "vertical" ? Infinity : 34,
|
|
@@ -28,22 +28,22 @@ var p = "vertical", m = "horizontal", h = ({ className: p, orientation: m = "ver
|
|
|
28
28
|
parentRef: E,
|
|
29
29
|
autoGrow: !1,
|
|
30
30
|
onChange: O,
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ u("div", {
|
|
32
32
|
className: "flex h-full w-full flex-col bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",
|
|
33
33
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ l(t, {
|
|
35
35
|
orientation: m,
|
|
36
36
|
onChangeOrientation: y,
|
|
37
37
|
onCollapse: _,
|
|
38
38
|
onTabSelect: v,
|
|
39
39
|
tabSelected: h
|
|
40
40
|
}),
|
|
41
|
-
["store", "elements"].includes(h) && /* @__PURE__ */
|
|
41
|
+
["store", "elements"].includes(h) && /* @__PURE__ */ l(n, {
|
|
42
42
|
elementSelected: C,
|
|
43
43
|
onSelectElement: D,
|
|
44
44
|
currentPageId: S
|
|
45
45
|
}),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ l(e, {
|
|
47
47
|
orientation: m,
|
|
48
48
|
tabSelected: h,
|
|
49
49
|
logTypeFilter: g,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import e from "./DevToolsButton.mjs";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import n from "@plitzi/sdk-shared/theme/useTheme";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/DevToolsPanel/ThemeControl.tsx
|
|
6
|
+
var i = {
|
|
7
|
+
system: "light",
|
|
8
|
+
light: "dark",
|
|
9
|
+
dark: "system"
|
|
10
|
+
}, a = {
|
|
11
|
+
system: "fa-solid fa-desktop",
|
|
12
|
+
light: "fa-solid fa-sun",
|
|
13
|
+
dark: "fa-solid fa-moon"
|
|
14
|
+
}, o = {
|
|
15
|
+
system: "System",
|
|
16
|
+
light: "Light",
|
|
17
|
+
dark: "Dark"
|
|
18
|
+
}, s = () => {
|
|
19
|
+
let { theme: s, setTheme: c } = n(), l = t(() => c(i[s]), [s, c]);
|
|
20
|
+
return /* @__PURE__ */ r(e, {
|
|
21
|
+
iconClassName: a[s],
|
|
22
|
+
title: `Theme: ${o[s]} — click for ${o[i[s]]}`,
|
|
23
|
+
onClick: l
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { s as default };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { useCallback as t, useState as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { cancelActionRun as a, useActionRuns as o, useCommonStore as s } from "@plitzi/sdk-shared/store";
|
|
5
|
+
import c from "@plitzi/plitzi-ui/Button";
|
|
6
|
+
//#region src/components/DevToolsPanel/tabs/ActionsViewer/ActionsViewer.tsx
|
|
7
|
+
var l = {
|
|
8
|
+
running: "text-blue-600 dark:text-blue-400",
|
|
9
|
+
streaming: "text-blue-600 dark:text-blue-400",
|
|
10
|
+
accepted: "text-blue-600 dark:text-blue-400",
|
|
11
|
+
completed: "text-green-700 dark:text-green-400",
|
|
12
|
+
failed: "text-red-600 dark:text-red-400",
|
|
13
|
+
aborted: "text-amber-600 dark:text-amber-400",
|
|
14
|
+
skipped: "text-zinc-500"
|
|
15
|
+
}, u = (e) => new Date(e).toLocaleTimeString(), d = (e) => e.endedAt ? `${e.endedAt - e.startedAt}ms` : "…", f = (e) => e.endedAt === void 0, p = () => {
|
|
16
|
+
let { runs: p, clear: m } = o(), [h] = s("actions.endpoint"), [g, _] = n(), v = p.filter(f), y = t((e) => () => _((t) => t === e ? void 0 : e), []), b = t((e) => () => a(e), []);
|
|
17
|
+
return /* @__PURE__ */ i("div", {
|
|
18
|
+
className: "flex h-full w-full flex-col overflow-auto",
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ i("div", {
|
|
21
|
+
className: "flex items-center justify-between border-b border-zinc-200 px-2 py-1 dark:border-zinc-700",
|
|
22
|
+
children: [/* @__PURE__ */ i("div", {
|
|
23
|
+
className: "flex items-center gap-2",
|
|
24
|
+
children: [v.length > 0 && /* @__PURE__ */ i("span", {
|
|
25
|
+
className: "flex items-center gap-1 text-blue-600 dark:text-blue-400",
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ r("i", { className: "fa-solid fa-circle-notch fa-spin" }),
|
|
28
|
+
v.length,
|
|
29
|
+
" running"
|
|
30
|
+
]
|
|
31
|
+
}), /* @__PURE__ */ r("span", {
|
|
32
|
+
className: "text-xs text-zinc-500 dark:text-zinc-400",
|
|
33
|
+
children: h ? `Server actions run at ${h}` : "This page is served without a Plitzi server: every action step is inert"
|
|
34
|
+
})]
|
|
35
|
+
}), /* @__PURE__ */ r(c, {
|
|
36
|
+
size: "xs",
|
|
37
|
+
disabled: p.length === 0,
|
|
38
|
+
onClick: m,
|
|
39
|
+
children: "Clear"
|
|
40
|
+
})]
|
|
41
|
+
}),
|
|
42
|
+
p.length === 0 && /* @__PURE__ */ r("div", {
|
|
43
|
+
className: "p-3 text-xs text-zinc-500 dark:text-zinc-400",
|
|
44
|
+
children: "No server action has run on this page yet. A run appears the moment one is SENT — including the ones that never come back."
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ r("div", {
|
|
47
|
+
className: "flex flex-col",
|
|
48
|
+
children: p.map((t) => /* @__PURE__ */ i("div", {
|
|
49
|
+
className: "border-b border-zinc-100 dark:border-zinc-800",
|
|
50
|
+
children: [/* @__PURE__ */ i("div", {
|
|
51
|
+
className: "flex w-full items-center gap-2 px-2 hover:bg-zinc-50 dark:hover:bg-zinc-800",
|
|
52
|
+
children: [/* @__PURE__ */ i("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
className: "flex grow items-center gap-2 py-1 text-left text-xs",
|
|
55
|
+
onClick: y(t.id),
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ r("span", {
|
|
58
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
59
|
+
children: u(t.startedAt)
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ r("span", {
|
|
62
|
+
className: "font-medium",
|
|
63
|
+
children: t.actionId || "(no action named)"
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ r("span", {
|
|
66
|
+
className: "rounded-sm bg-zinc-100 px-1 text-[10px] uppercase dark:bg-zinc-800",
|
|
67
|
+
children: t.mode
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ r("span", {
|
|
70
|
+
className: e("ml-auto", l[t.status] ?? ""),
|
|
71
|
+
children: t.reason ?? t.status
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ r("span", {
|
|
74
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
75
|
+
children: d(t)
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}), f(t) && t.cancellable && /* @__PURE__ */ r(c, {
|
|
79
|
+
size: "xs",
|
|
80
|
+
intent: "secondary",
|
|
81
|
+
onClick: b(t.id),
|
|
82
|
+
children: "Cancel"
|
|
83
|
+
})]
|
|
84
|
+
}), g === t.id && /* @__PURE__ */ i("div", {
|
|
85
|
+
className: "flex flex-col gap-2 bg-zinc-50 px-3 py-2 text-xs dark:bg-zinc-800/50",
|
|
86
|
+
children: [
|
|
87
|
+
t.runId && /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("span", {
|
|
88
|
+
className: "text-zinc-500 dark:text-zinc-400",
|
|
89
|
+
children: "Run id: "
|
|
90
|
+
}), /* @__PURE__ */ r("span", {
|
|
91
|
+
className: "font-mono",
|
|
92
|
+
children: t.runId
|
|
93
|
+
})] }),
|
|
94
|
+
t.error && /* @__PURE__ */ r("div", {
|
|
95
|
+
className: "break-words text-red-600 dark:text-red-400",
|
|
96
|
+
children: t.error
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("div", {
|
|
99
|
+
className: "text-zinc-500 dark:text-zinc-400",
|
|
100
|
+
children: "Input"
|
|
101
|
+
}), /* @__PURE__ */ r("pre", {
|
|
102
|
+
className: "overflow-auto whitespace-pre-wrap",
|
|
103
|
+
children: JSON.stringify(t.input ?? {}, null, 2)
|
|
104
|
+
})] }),
|
|
105
|
+
t.output && /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ r("div", {
|
|
106
|
+
className: "text-zinc-500 dark:text-zinc-400",
|
|
107
|
+
children: "Output"
|
|
108
|
+
}), /* @__PURE__ */ r("pre", {
|
|
109
|
+
className: "overflow-auto whitespace-pre-wrap",
|
|
110
|
+
children: JSON.stringify(t.output, null, 2)
|
|
111
|
+
})] }),
|
|
112
|
+
t.progress.length > 0 && /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("div", {
|
|
113
|
+
className: "text-zinc-500 dark:text-zinc-400",
|
|
114
|
+
children: [
|
|
115
|
+
"Progress (",
|
|
116
|
+
t.progress.length,
|
|
117
|
+
")"
|
|
118
|
+
]
|
|
119
|
+
}), /* @__PURE__ */ r("pre", {
|
|
120
|
+
className: "overflow-auto whitespace-pre-wrap",
|
|
121
|
+
children: JSON.stringify(t.progress, null, 2)
|
|
122
|
+
})] }),
|
|
123
|
+
t.trace && /* @__PURE__ */ i("div", {
|
|
124
|
+
className: "flex flex-col gap-1",
|
|
125
|
+
children: [/* @__PURE__ */ r("div", {
|
|
126
|
+
className: "text-zinc-500 dark:text-zinc-400",
|
|
127
|
+
children: "Server steps"
|
|
128
|
+
}), t.trace.map((t, n) => {
|
|
129
|
+
let a = t.node, o = typeof t.status == "string" ? t.status : "";
|
|
130
|
+
return /* @__PURE__ */ i("div", {
|
|
131
|
+
className: "flex items-center justify-between rounded-sm border border-zinc-200 px-2 py-1 dark:border-zinc-700",
|
|
132
|
+
children: [/* @__PURE__ */ r("span", { children: a?.title ?? a?.action ?? "step" }), /* @__PURE__ */ r("span", {
|
|
133
|
+
className: e(l[o === "success" ? "completed" : "failed"]),
|
|
134
|
+
children: o
|
|
135
|
+
})]
|
|
136
|
+
}, `${String(a?.action)}-${n}`);
|
|
137
|
+
})]
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
})]
|
|
141
|
+
}, t.id))
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
//#endregion
|
|
147
|
+
export { p as default };
|