@plitzi/sdk-dev-tools 0.32.24 → 0.33.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 +25 -0
- package/dist/DevToolsContainer.mjs +45 -29
- package/dist/DevToolsContextProvider.mjs +4 -4
- package/dist/components/DevToolsIndicator/DevToolsIndicator.d.ts +7 -0
- package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +50 -0
- package/dist/components/DevToolsIndicator/index.d.ts +3 -0
- package/dist/components/DevToolsIndicator/index.mjs +5 -0
- package/dist/components/DevToolsOverlay/DevToolsOverlay.d.ts +15 -0
- package/dist/components/DevToolsOverlay/DevToolsOverlay.mjs +18 -0
- package/dist/components/DevToolsOverlay/index.d.ts +3 -0
- package/dist/components/DevToolsOverlay/index.mjs +5 -0
- package/dist/components/DevToolsPanel/DevToolsBody.d.ts +3 -1
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +8 -7
- package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +2 -1
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +31 -22
- package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +7 -1
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +36 -34
- package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +9 -9
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.mjs +7 -7
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.mjs +9 -9
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.mjs +15 -16
- package/dist/components/DevToolsPanel/tabs/Logs/Log.mjs +23 -17
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.d.ts +4 -2
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.mjs +15 -15
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.d.ts +2 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +53 -43
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +11 -11
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +22 -15
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.d.ts +2 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.mjs +3 -2
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.d.ts +2 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.mjs +4 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +26 -26
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/LogNetwork.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/LogNetwork.mjs +52 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +31 -28
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/mapFunctionValues.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/mapFunctionValues.mjs +22 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/renderFunctionValue.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/renderFunctionValue.mjs +13 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/TracingViewer.mjs +98 -99
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/CommitStrip.mjs +6 -4
- 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/VariablesViewer/VariablesViewer.mjs +12 -12
- package/package.json +52 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @plitzi/sdk-dev-tools
|
|
2
2
|
|
|
3
|
+
## 0.33.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v0.33.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @plitzi/sdk-navigation@0.33.0
|
|
13
|
+
- @plitzi/sdk-schema@0.33.0
|
|
14
|
+
- @plitzi/sdk-shared@0.33.0
|
|
15
|
+
- @plitzi/sdk-style@0.33.0
|
|
16
|
+
|
|
17
|
+
## 0.32.25
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- v0.32.25
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @plitzi/sdk-navigation@0.32.25
|
|
24
|
+
- @plitzi/sdk-schema@0.32.25
|
|
25
|
+
- @plitzi/sdk-shared@0.32.25
|
|
26
|
+
- @plitzi/sdk-style@0.32.25
|
|
27
|
+
|
|
3
28
|
## 0.32.24
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -1,38 +1,54 @@
|
|
|
1
1
|
import { useIsSelectedInstance as e } from "./instanceRegistry.mjs";
|
|
2
|
-
import t from "./components/
|
|
2
|
+
import t from "./components/DevToolsOverlay/index.mjs";
|
|
3
3
|
import n from "./DevToolsContextProvider.mjs";
|
|
4
|
-
import r from "
|
|
5
|
-
import i from "
|
|
6
|
-
import { use as a, useCallback as o, useRef as s } from "react";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { use as i, useCallback as a, useRef as o, useState as s } from "react";
|
|
7
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import f from "@plitzi/
|
|
7
|
+
import u from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
8
|
+
import { DevStoreScopeContext as d } from "@plitzi/nexus/react";
|
|
9
|
+
import { ThemeContext as f } from "@plitzi/sdk-shared";
|
|
10
|
+
import p from "@plitzi/plitzi-ui/ContainerShadow";
|
|
11
11
|
//#region src/DevToolsContainer.tsx
|
|
12
|
-
var
|
|
13
|
-
let { theme:
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
var m = 0, h = ({ children: h, className: g, innerClassName: _, enabled: v = !1, instanceId: y, renderMode: b = "default", devToolsStyle: x = "", devToolsStyleLink: S = "" }) => {
|
|
13
|
+
let { theme: C } = i(f), [w, T] = u("plitzi-sdk.dev-tools.orientation", "horizontal"), [E, D] = u("plitzi-sdk.dev-tools.collapsed", !0), [O, k] = u("plitzi-sdk.dev-tools.tab", "logs"), [A, j] = s(), M = o(void 0);
|
|
14
|
+
M.current ||= `sdk-instance-${++m}`;
|
|
15
|
+
let N = y || M.current, P = e(N, v), F = a((e) => T(e), [T]), I = a((e) => {
|
|
16
|
+
e && k("logs"), j(e), D(!1);
|
|
17
|
+
}, [D, k]), L = a(() => D(!0), [D]), R = a((e) => {
|
|
18
|
+
j(void 0), k(e);
|
|
19
|
+
}, [k]);
|
|
20
|
+
return v ? /* @__PURE__ */ l("div", {
|
|
21
|
+
className: r("flex grow overflow-auto", {
|
|
22
|
+
"flex-col": w === "horizontal",
|
|
23
|
+
"h-screen": w === "vertical"
|
|
24
|
+
}, g),
|
|
25
|
+
children: [/* @__PURE__ */ c(d, {
|
|
26
|
+
value: N,
|
|
23
27
|
children: /* @__PURE__ */ c("div", {
|
|
24
|
-
className:
|
|
25
|
-
children:
|
|
28
|
+
className: r("grow basis-0 flex-col overflow-auto", _),
|
|
29
|
+
children: h
|
|
26
30
|
})
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}), P && /* @__PURE__ */ l(n, { children: [b === "default" && /* @__PURE__ */ c(t, {
|
|
32
|
+
collapsed: E,
|
|
33
|
+
orientation: w,
|
|
34
|
+
tabSelected: O,
|
|
35
|
+
logTypeFilter: A,
|
|
36
|
+
onOpen: I,
|
|
37
|
+
onCollapse: L,
|
|
38
|
+
onTabSelect: R,
|
|
39
|
+
onChangeOrientation: F
|
|
40
|
+
}), b === "shadow" && /* @__PURE__ */ l(p, { children: [S && /* @__PURE__ */ c(p.Link, { href: S }), /* @__PURE__ */ l(p.Content, { children: [/* @__PURE__ */ c("style", { dangerouslySetInnerHTML: { __html: x } }), /* @__PURE__ */ c(t, {
|
|
41
|
+
className: r({ dark: C === "dark" }),
|
|
42
|
+
collapsed: E,
|
|
43
|
+
orientation: w,
|
|
44
|
+
tabSelected: O,
|
|
45
|
+
logTypeFilter: A,
|
|
46
|
+
onOpen: I,
|
|
47
|
+
onCollapse: L,
|
|
48
|
+
onTabSelect: R,
|
|
49
|
+
onChangeOrientation: F
|
|
34
50
|
})] })] })] })]
|
|
35
|
-
}) :
|
|
51
|
+
}) : h;
|
|
36
52
|
};
|
|
37
53
|
//#endregion
|
|
38
|
-
export {
|
|
54
|
+
export { h as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
2
|
import a from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
+
import { omit as s } from "@plitzi/plitzi-ui/helpers";
|
|
5
5
|
import { pConsole as c } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
|
|
6
6
|
//#region src/DevToolsContextProvider.tsx
|
|
7
7
|
var l = ({ children: l }) => {
|
|
@@ -16,7 +16,7 @@ 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) => s(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
22
|
m.current ||= (c.setCallback(h), c.setCallbackAddProvider(g), c.setCallbackRemoveProvider(_), !0), t(() => (c.setCallback(h), c.setCallbackAddProvider(g), c.setCallbackRemoveProvider(_), c.processPendingLogs(), () => {
|
|
@@ -39,7 +39,7 @@ var l = ({ children: l }) => {
|
|
|
39
39
|
y,
|
|
40
40
|
v
|
|
41
41
|
]);
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ o(a, {
|
|
43
43
|
value: b,
|
|
44
44
|
children: l
|
|
45
45
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LogType } from '@plitzi/sdk-shared';
|
|
2
|
+
export type DevToolsIndicatorProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
onOpen: (logType?: LogType) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const DevToolsIndicator: ({ className, onOpen }: DevToolsIndicatorProps) => import("react").JSX.Element;
|
|
7
|
+
export default DevToolsIndicator;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { use as t, useCallback as n, useMemo as r } from "react";
|
|
3
|
+
import i from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/DevToolsIndicator/DevToolsIndicator.tsx
|
|
6
|
+
var s = ({ className: s, onOpen: c }) => {
|
|
7
|
+
let { logs: l } = t(i), { errors: u, warnings: d } = r(() => l.reduce((e, { logType: t }) => ({
|
|
8
|
+
errors: t === "danger" ? e.errors + 1 : e.errors,
|
|
9
|
+
warnings: t === "warning" ? e.warnings + 1 : e.warnings
|
|
10
|
+
}), {
|
|
11
|
+
errors: 0,
|
|
12
|
+
warnings: 0
|
|
13
|
+
}), [l]), f = n(() => {
|
|
14
|
+
if (u > 0) {
|
|
15
|
+
c("danger");
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (d > 0) {
|
|
19
|
+
c("warning");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
c();
|
|
23
|
+
}, [
|
|
24
|
+
u,
|
|
25
|
+
d,
|
|
26
|
+
c
|
|
27
|
+
]);
|
|
28
|
+
return /* @__PURE__ */ a("div", {
|
|
29
|
+
className: e("fixed bottom-3 left-3 z-[1000000]", s),
|
|
30
|
+
children: /* @__PURE__ */ o("button", {
|
|
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
|
+
title: "Plitzi dev tools",
|
|
33
|
+
onClick: f,
|
|
34
|
+
children: [
|
|
35
|
+
"Plitzi",
|
|
36
|
+
u > 0 && /* @__PURE__ */ o("span", {
|
|
37
|
+
className: "flex items-center gap-1 text-red-600 dark:text-red-400",
|
|
38
|
+
children: [/* @__PURE__ */ a("i", { className: "fa-regular fa-circle-xmark text-[11px]" }), u]
|
|
39
|
+
}),
|
|
40
|
+
d > 0 && /* @__PURE__ */ o("span", {
|
|
41
|
+
className: "flex items-center gap-1 text-amber-600 dark:text-amber-400",
|
|
42
|
+
children: [/* @__PURE__ */ a("i", { className: "fa-solid fa-triangle-exclamation text-[11px]" }), d]
|
|
43
|
+
}),
|
|
44
|
+
u === 0 && d === 0 && /* @__PURE__ */ a("i", { className: "fa-solid fa-terminal text-[11px] text-zinc-400" })
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { s as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Orientation } from '../../DevToolsContainer';
|
|
2
|
+
import { LogType } from '@plitzi/sdk-shared';
|
|
3
|
+
export type DevToolsOverlayProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
orientation: Orientation;
|
|
7
|
+
tabSelected: string;
|
|
8
|
+
logTypeFilter?: LogType;
|
|
9
|
+
onOpen: (logType?: LogType) => void;
|
|
10
|
+
onCollapse: () => void;
|
|
11
|
+
onTabSelect: (tabSelected: string) => void;
|
|
12
|
+
onChangeOrientation: (orientation: Orientation) => void;
|
|
13
|
+
};
|
|
14
|
+
declare const DevToolsOverlay: ({ className, collapsed, orientation, tabSelected, logTypeFilter, onOpen, onCollapse, onTabSelect, onChangeOrientation }: DevToolsOverlayProps) => import("react").JSX.Element;
|
|
15
|
+
export default DevToolsOverlay;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "../DevToolsIndicator/index.mjs";
|
|
2
|
+
import t from "../DevToolsPanel/index.mjs";
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DevToolsOverlay/DevToolsOverlay.tsx
|
|
5
|
+
var a = ({ className: a, collapsed: o, orientation: s, tabSelected: c, logTypeFilter: l, onOpen: u, onCollapse: d, onTabSelect: f, onChangeOrientation: p }) => /* @__PURE__ */ i(n, { children: [o && /* @__PURE__ */ r(e, {
|
|
6
|
+
className: a,
|
|
7
|
+
onOpen: u
|
|
8
|
+
}), !o && /* @__PURE__ */ r(t, {
|
|
9
|
+
className: a,
|
|
10
|
+
orientation: s,
|
|
11
|
+
tabSelected: c,
|
|
12
|
+
logTypeFilter: l,
|
|
13
|
+
onCollapse: d,
|
|
14
|
+
onTabSelect: f,
|
|
15
|
+
onChangeOrientation: p
|
|
16
|
+
})] });
|
|
17
|
+
//#endregion
|
|
18
|
+
export { a as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { LogType } from '@plitzi/sdk-shared';
|
|
1
2
|
export type DevToolsBodyProps = {
|
|
2
3
|
className?: string;
|
|
3
4
|
tabSelected?: string;
|
|
4
5
|
orientation: 'horizontal' | 'vertical';
|
|
6
|
+
logTypeFilter?: LogType;
|
|
5
7
|
elementSelected?: string;
|
|
6
8
|
onSelectElement: (id?: string) => void;
|
|
7
9
|
};
|
|
8
|
-
declare const DevToolsBody: ({ className, tabSelected, orientation, elementSelected, onSelectElement }: DevToolsBodyProps) => import("react").JSX.Element;
|
|
10
|
+
declare const DevToolsBody: ({ className, tabSelected, orientation, logTypeFilter, elementSelected, onSelectElement }: DevToolsBodyProps) => import("react").JSX.Element;
|
|
9
11
|
export default DevToolsBody;
|
|
@@ -10,24 +10,25 @@ import { use as c } from "react";
|
|
|
10
10
|
import l from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
11
11
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/DevToolsPanel/DevToolsBody.tsx
|
|
13
|
-
var f = ({ className: f, tabSelected: p, orientation: m,
|
|
14
|
-
let { logs:
|
|
13
|
+
var f = ({ className: f, tabSelected: p, orientation: m, logTypeFilter: h, elementSelected: g, onSelectElement: _ }) => {
|
|
14
|
+
let { logs: v, clearLogs: y } = c(l);
|
|
15
15
|
return /* @__PURE__ */ u("div", {
|
|
16
16
|
className: s("flex h-full w-full grow overflow-auto bg-white dark:bg-zinc-900", f),
|
|
17
17
|
children: /* @__PURE__ */ d("div", {
|
|
18
18
|
className: "flex w-full flex-col",
|
|
19
19
|
children: [
|
|
20
20
|
p === "logs" && /* @__PURE__ */ u(n, {
|
|
21
|
-
items:
|
|
21
|
+
items: v,
|
|
22
22
|
orientation: m,
|
|
23
|
-
|
|
23
|
+
logTypeFilter: h,
|
|
24
|
+
onClear: y
|
|
24
25
|
}),
|
|
25
|
-
p === "store" && /* @__PURE__ */ u(i, { elementSelected:
|
|
26
|
+
p === "store" && /* @__PURE__ */ u(i, { elementSelected: g }),
|
|
26
27
|
p === "history" && /* @__PURE__ */ u(t, {}),
|
|
27
28
|
p === "variables" && /* @__PURE__ */ u(o, {}),
|
|
28
29
|
p === "elements" && /* @__PURE__ */ u(e, {
|
|
29
|
-
elementSelected:
|
|
30
|
-
onSelectElement:
|
|
30
|
+
elementSelected: g,
|
|
31
|
+
onSelectElement: _
|
|
31
32
|
}),
|
|
32
33
|
p === "plugins" && /* @__PURE__ */ u(r, {}),
|
|
33
34
|
p === "tracing" && /* @__PURE__ */ u(a, {})
|
|
@@ -4,7 +4,8 @@ export type DevToolsHeaderProps = {
|
|
|
4
4
|
tabSelected?: string;
|
|
5
5
|
orientation: Orientation;
|
|
6
6
|
onChangeOrientation?: (orientation: Orientation) => void;
|
|
7
|
+
onCollapse?: () => void;
|
|
7
8
|
onTabSelect?: (tabIndex: string) => void;
|
|
8
9
|
};
|
|
9
|
-
declare const DevToolsHeader: ({ tabSelected, orientation, onChangeOrientation, onTabSelect }: DevToolsHeaderProps) => import("react").JSX.Element;
|
|
10
|
+
declare const DevToolsHeader: ({ tabSelected, orientation, onChangeOrientation, onCollapse, onTabSelect }: DevToolsHeaderProps) => import("react").JSX.Element;
|
|
10
11
|
export default DevToolsHeader;
|
|
@@ -39,10 +39,10 @@ var a = [
|
|
|
39
39
|
label: "Tracing",
|
|
40
40
|
icon: "fa-solid fa-gauge-high"
|
|
41
41
|
}
|
|
42
|
-
], o = ({ tabSelected: o, orientation: s = "vertical", onChangeOrientation: c,
|
|
43
|
-
let { options:
|
|
42
|
+
], o = ({ tabSelected: o, orientation: s = "vertical", onChangeOrientation: c, onCollapse: l, onTabSelect: u }) => {
|
|
43
|
+
let { options: d, value: f, onSelect: p } = e(), m = n(() => {
|
|
44
44
|
c?.(s === "horizontal" ? "vertical" : "horizontal");
|
|
45
|
-
}, [s, c]),
|
|
45
|
+
}, [s, c]), h = n((e) => () => u?.(e), [u]), g = n((e) => p(e.target.value), [p]);
|
|
46
46
|
return /* @__PURE__ */ i("div", {
|
|
47
47
|
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
48
|
children: [/* @__PURE__ */ r("div", {
|
|
@@ -50,7 +50,7 @@ var a = [
|
|
|
50
50
|
children: a.map((e) => {
|
|
51
51
|
let n = o === e.id;
|
|
52
52
|
return /* @__PURE__ */ i("button", {
|
|
53
|
-
onClick:
|
|
53
|
+
onClick: h(e.id),
|
|
54
54
|
className: t("flex cursor-pointer items-center gap-1.5 border-b-2 px-3 py-2 font-medium transition-colors", {
|
|
55
55
|
"border-violet-500 text-violet-600 dark:text-violet-400": n,
|
|
56
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": !n
|
|
@@ -60,24 +60,33 @@ var a = [
|
|
|
60
60
|
})
|
|
61
61
|
}), /* @__PURE__ */ i("div", {
|
|
62
62
|
className: "flex shrink-0 items-center gap-1 border-l border-zinc-200 px-2 dark:border-zinc-700",
|
|
63
|
-
children: [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
children: [
|
|
64
|
+
d.length > 0 && /* @__PURE__ */ r("select", {
|
|
65
|
+
value: f ?? "",
|
|
66
|
+
onChange: g,
|
|
67
|
+
title: "Instance / StoreProvider driving the panel",
|
|
68
|
+
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: d.map((e) => /* @__PURE__ */ r("optgroup", {
|
|
70
|
+
label: e.label,
|
|
71
|
+
children: e.options.map((e) => /* @__PURE__ */ r("option", {
|
|
72
|
+
value: e.value,
|
|
73
|
+
children: e.label
|
|
74
|
+
}, e.value))
|
|
75
|
+
}, e.label))
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ r("button", {
|
|
78
|
+
className: "flex h-6 w-6 items-center justify-center rounded text-zinc-500 transition-colors hover:bg-zinc-200 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100",
|
|
79
|
+
title: s === "horizontal" ? "Switch to side panel" : "Switch to bottom panel",
|
|
80
|
+
onClick: m,
|
|
81
|
+
children: /* @__PURE__ */ r("i", { className: t("fa-solid fa-table-columns text-xs", { "rotate-90": s === "vertical" }) })
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ r("button", {
|
|
84
|
+
className: "flex h-6 w-6 cursor-pointer items-center justify-center rounded text-zinc-500 transition-colors hover:bg-zinc-200 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100",
|
|
85
|
+
title: "Collapse to the indicator",
|
|
86
|
+
onClick: l,
|
|
87
|
+
children: /* @__PURE__ */ r("i", { className: "fa-solid fa-xmark text-xs" })
|
|
88
|
+
})
|
|
89
|
+
]
|
|
81
90
|
})]
|
|
82
91
|
});
|
|
83
92
|
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { Orientation } from '../../DevToolsContainer';
|
|
2
|
+
import { LogType } from '@plitzi/sdk-shared';
|
|
2
3
|
export declare const ORIENTATION_VERTICAL = "vertical";
|
|
3
4
|
export declare const ORIENTATION_HORIZONTAL = "horizontal";
|
|
4
5
|
export type DevToolsPanelProps = {
|
|
5
6
|
className?: string;
|
|
6
7
|
orientation?: Orientation;
|
|
8
|
+
tabSelected: string;
|
|
9
|
+
/** Seeds the Logs filter when the panel is opened from the indicator, so a badge counting errors lands on them. */
|
|
10
|
+
logTypeFilter?: LogType;
|
|
11
|
+
onCollapse?: () => void;
|
|
12
|
+
onTabSelect: (tabSelected: string) => void;
|
|
7
13
|
onChangeOrientation?: (orientation: Orientation) => void;
|
|
8
14
|
};
|
|
9
|
-
declare const DevToolsPanel: ({ className, orientation, onChangeOrientation }: DevToolsPanelProps) => import("react").JSX.Element;
|
|
15
|
+
declare const DevToolsPanel: ({ className, orientation, tabSelected, logTypeFilter, onCollapse, onTabSelect, onChangeOrientation }: DevToolsPanelProps) => import("react").JSX.Element;
|
|
10
16
|
export default DevToolsPanel;
|
|
@@ -1,51 +1,53 @@
|
|
|
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 i from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import d from "@plitzi/
|
|
9
|
-
import {
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { useCallback as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
import u from "@plitzi/plitzi-ui/ContainerResizable";
|
|
8
|
+
import d from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
9
|
+
import { useCommonStore as f } from "@plitzi/sdk-shared/store";
|
|
10
10
|
//#region src/components/DevToolsPanel/DevToolsPanel.tsx
|
|
11
|
-
var
|
|
12
|
-
let [
|
|
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] = d("plitzi-sdk.dev-tools.size", {
|
|
13
13
|
width: 500,
|
|
14
14
|
height: 200
|
|
15
|
-
}),
|
|
15
|
+
}), [S] = f("navigation.currentPageId"), [C, w] = s(), T = a(() => m === "vertical" ? ["w"] : ["n"], [m]), E = o(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), D = i((e) => w(e), [w]), O = i((e, t) => x((n) => ({
|
|
16
16
|
width: Number.isFinite(e) ? e : n.width,
|
|
17
17
|
height: Number.isFinite(t) ? t : n.height
|
|
18
|
-
})), [
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className:
|
|
21
|
-
minConstraintsX:
|
|
22
|
-
maxConstraintsX:
|
|
23
|
-
minConstraintsY:
|
|
24
|
-
maxConstraintsY:
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
resizeHandles:
|
|
28
|
-
parentRef:
|
|
18
|
+
})), [x]);
|
|
19
|
+
return /* @__PURE__ */ c(u, {
|
|
20
|
+
className: r("component__container-resizable-sidebar relative z-[1000000] text-xs", p, { "h-full": m === "vertical" }),
|
|
21
|
+
minConstraintsX: m === "vertical" ? 500 : Infinity,
|
|
22
|
+
maxConstraintsX: m === "vertical" ? 1e3 : Infinity,
|
|
23
|
+
minConstraintsY: m === "vertical" ? Infinity : 34,
|
|
24
|
+
maxConstraintsY: m === "vertical" ? Infinity : 600,
|
|
25
|
+
width: m === "vertical" ? b.width : Infinity,
|
|
26
|
+
height: m === "vertical" ? Infinity : b.height,
|
|
27
|
+
resizeHandles: T,
|
|
28
|
+
parentRef: E,
|
|
29
29
|
autoGrow: !1,
|
|
30
30
|
onChange: O,
|
|
31
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ l("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__ */
|
|
35
|
-
orientation:
|
|
36
|
-
onChangeOrientation:
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
/* @__PURE__ */ c(t, {
|
|
35
|
+
orientation: m,
|
|
36
|
+
onChangeOrientation: y,
|
|
37
|
+
onCollapse: _,
|
|
38
|
+
onTabSelect: v,
|
|
39
|
+
tabSelected: h
|
|
39
40
|
}),
|
|
40
|
-
["store", "elements"].includes(
|
|
41
|
-
elementSelected:
|
|
41
|
+
["store", "elements"].includes(h) && /* @__PURE__ */ c(n, {
|
|
42
|
+
elementSelected: C,
|
|
42
43
|
onSelectElement: D,
|
|
43
|
-
currentPageId:
|
|
44
|
+
currentPageId: S
|
|
44
45
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
orientation:
|
|
47
|
-
tabSelected:
|
|
48
|
-
|
|
46
|
+
/* @__PURE__ */ c(e, {
|
|
47
|
+
orientation: m,
|
|
48
|
+
tabSelected: h,
|
|
49
|
+
logTypeFilter: g,
|
|
50
|
+
elementSelected: C,
|
|
49
51
|
onSelectElement: D
|
|
50
52
|
})
|
|
51
53
|
]
|
|
@@ -53,4 +55,4 @@ var m = "vertical", h = "horizontal", g = ({ className: m, orientation: h = "ver
|
|
|
53
55
|
});
|
|
54
56
|
};
|
|
55
57
|
//#endregion
|
|
56
|
-
export {
|
|
58
|
+
export { m as ORIENTATION_HORIZONTAL, p as ORIENTATION_VERTICAL, h as default };
|
|
@@ -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 { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
import { throttle as c } from "@plitzi/plitzi-ui/helpers";
|
|
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(() => c(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__ */ s("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__ */ s("div", {
|
|
41
41
|
className: "flex gap-1",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ o(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__ */ o(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__ */ o(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 { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useCommonStore as r } from "@plitzi/sdk-shared/store";
|
|
4
|
+
import { get as i } from "@plitzi/plitzi-ui/helpers";
|
|
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] = r("schema.flat"), u = e((e) => () => c?.(e), [c]), d = t(() => a === "items" && s && Array.isArray(o) ? /* @__PURE__ */ n("div", {
|
|
8
8
|
className: "flex flex-col",
|
|
9
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
9
|
+
children: o.map((e, t) => /* @__PURE__ */ n("div", {
|
|
10
10
|
className: "cursor-pointer text-purple-400",
|
|
11
11
|
onClick: u(e),
|
|
12
|
-
children:
|
|
12
|
+
children: i(l, `${e}.definition.label`, e)
|
|
13
13
|
}, t))
|
|
14
|
-
}) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */
|
|
14
|
+
}) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */ n("div", {
|
|
15
15
|
className: "cursor-pointer text-purple-400",
|
|
16
16
|
onClick: u(o),
|
|
17
|
-
children:
|
|
17
|
+
children: i(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__ */ n("div", {
|
|
26
26
|
className: "grow basis-0 truncate",
|
|
27
27
|
children: d
|
|
28
28
|
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "./DetailsAttributes.mjs";
|
|
2
2
|
import t from "./DetailsDefinition.mjs";
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import i from "@plitzi/plitzi-ui/ContainerTabs";
|
|
5
5
|
//#region src/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.tsx
|
|
6
|
-
var a = [{ label: "Definition" }, { label: "Attributes" }], o = ({ definition: o, attributes: s, onSelectElement: c }) => /* @__PURE__ */ i
|
|
6
|
+
var a = [{ label: "Definition" }, { label: "Attributes" }], o = ({ definition: o, attributes: s, onSelectElement: c }) => /* @__PURE__ */ r(i, {
|
|
7
7
|
className: "w-full grow gap-4 overflow-hidden p-4",
|
|
8
8
|
children: [
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
9
|
+
/* @__PURE__ */ n(i.Tabs, { items: a }),
|
|
10
|
+
/* @__PURE__ */ n(i.TabContent, {
|
|
11
11
|
className: "flex-col",
|
|
12
|
-
children: /* @__PURE__ */
|
|
12
|
+
children: /* @__PURE__ */ n(t, {
|
|
13
13
|
definition: o,
|
|
14
14
|
onSelectElement: c
|
|
15
15
|
})
|
|
16
16
|
}),
|
|
17
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ n(i.TabContent, { children: /* @__PURE__ */ n(e, { attributes: s }) })
|
|
18
18
|
]
|
|
19
19
|
});
|
|
20
20
|
//#endregion
|