@plitzi/sdk-dev-tools 0.30.19 → 0.31.1
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 +30 -3
- package/dist/DevToolsContextProvider.mjs +4 -4
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +25 -23
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +7 -2
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +33 -32
- package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +10 -10
- 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 +6 -6
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.mjs +57 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.d.ts +12 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.mjs +37 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.d.ts +13 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.mjs +45 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/helpers.d.ts +4 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/helpers.mjs +15 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +30 -30
- 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/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.d.ts +5 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +32 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.mjs +20 -20
- package/package.json +63 -12
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/DataSourceViewer.d.ts +0 -5
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/DataSourceViewer.mjs +0 -30
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/index.d.ts +0 -3
- package/dist/components/DevToolsPanel/tabs/DataSourceViewer/index.mjs +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @plitzi/sdk-dev-tools
|
|
2
2
|
|
|
3
|
+
## 0.31.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- v0.31.1
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @plitzi/nexus@0.31.1
|
|
10
|
+
- @plitzi/sdk-navigation@0.31.1
|
|
11
|
+
- @plitzi/sdk-schema@0.31.1
|
|
12
|
+
- @plitzi/sdk-shared@0.31.1
|
|
13
|
+
- @plitzi/sdk-style@0.31.1
|
|
14
|
+
|
|
15
|
+
## 0.31.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- v0.31.0
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @plitzi/sdk-navigation@0.31.0
|
|
25
|
+
- @plitzi/sdk-schema@0.31.0
|
|
26
|
+
- @plitzi/sdk-shared@0.31.0
|
|
27
|
+
- @plitzi/nexus@0.31.0
|
|
28
|
+
- @plitzi/sdk-style@0.31.0
|
|
29
|
+
|
|
3
30
|
## 0.30.19
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -10,7 +37,7 @@
|
|
|
10
37
|
- @plitzi/sdk-navigation@0.30.19
|
|
11
38
|
- @plitzi/sdk-schema@0.30.19
|
|
12
39
|
- @plitzi/sdk-shared@0.30.19
|
|
13
|
-
- @plitzi/
|
|
40
|
+
- @plitzi/nexus@0.30.19
|
|
14
41
|
- @plitzi/sdk-style@0.30.19
|
|
15
42
|
|
|
16
43
|
## 0.30.18
|
|
@@ -23,7 +50,7 @@
|
|
|
23
50
|
- @plitzi/sdk-navigation@0.30.18
|
|
24
51
|
- @plitzi/sdk-schema@0.30.18
|
|
25
52
|
- @plitzi/sdk-shared@0.30.18
|
|
26
|
-
- @plitzi/
|
|
53
|
+
- @plitzi/nexus@0.30.18
|
|
27
54
|
- @plitzi/sdk-style@0.30.18
|
|
28
55
|
|
|
29
56
|
## 0.30.17
|
|
@@ -36,7 +63,7 @@
|
|
|
36
63
|
- @plitzi/sdk-navigation@0.30.17
|
|
37
64
|
- @plitzi/sdk-schema@0.30.17
|
|
38
65
|
- @plitzi/sdk-shared@0.30.17
|
|
39
|
-
- @plitzi/
|
|
66
|
+
- @plitzi/nexus@0.30.17
|
|
40
67
|
- @plitzi/sdk-style@0.30.17
|
|
41
68
|
|
|
42
69
|
## 0.30.16
|
|
@@ -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 { omit as o } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
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) => o(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
|
return m.current ||= (c.setCallback(h), c.setCallbackAddProvider(g), c.setCallbackRemoveProvider(_), !0), t(() => (c.setCallback(h), c.setCallbackAddProvider(g), c.setCallbackRemoveProvider(_), c.processPendingLogs(), () => {
|
|
@@ -25,7 +25,7 @@ var l = ({ children: l }) => {
|
|
|
25
25
|
h,
|
|
26
26
|
g,
|
|
27
27
|
_
|
|
28
|
-
]), /* @__PURE__ */
|
|
28
|
+
]), /* @__PURE__ */ s(a, {
|
|
29
29
|
value: n(() => ({
|
|
30
30
|
providers: f,
|
|
31
31
|
logs: u,
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import e from "./tabs/
|
|
2
|
-
import t from "./tabs/
|
|
1
|
+
import e from "./tabs/ElementsViewer/index.mjs";
|
|
2
|
+
import t from "./tabs/HistoryViewer/index.mjs";
|
|
3
3
|
import n from "./tabs/Logs/index.mjs";
|
|
4
4
|
import r from "./tabs/PluginsViewer/PluginsViewer.mjs";
|
|
5
|
-
import i from "./tabs/
|
|
6
|
-
import a from "
|
|
7
|
-
import
|
|
8
|
-
import s from "
|
|
9
|
-
import
|
|
5
|
+
import i from "./tabs/StoreViewer/index.mjs";
|
|
6
|
+
import a from "./tabs/VariablesViewer/index.mjs";
|
|
7
|
+
import o from "clsx";
|
|
8
|
+
import { use as s } from "react";
|
|
9
|
+
import c from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/DevToolsPanel/DevToolsBody.tsx
|
|
11
|
-
var
|
|
12
|
-
let { logs:
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
className:
|
|
15
|
-
children: /* @__PURE__ */
|
|
12
|
+
var d = ({ className: d, tabSelected: f, orientation: p, elementSelected: m, onSelectElement: h }) => {
|
|
13
|
+
let { logs: g, clearLogs: _ } = s(c);
|
|
14
|
+
return /* @__PURE__ */ l("div", {
|
|
15
|
+
className: o("flex h-full w-full grow overflow-auto bg-white dark:bg-zinc-900", d),
|
|
16
|
+
children: /* @__PURE__ */ u("div", {
|
|
16
17
|
className: "flex w-full flex-col",
|
|
17
18
|
children: [
|
|
18
|
-
|
|
19
|
-
items:
|
|
20
|
-
orientation:
|
|
21
|
-
onClear:
|
|
19
|
+
f === "logs" && /* @__PURE__ */ l(n, {
|
|
20
|
+
items: g,
|
|
21
|
+
orientation: p,
|
|
22
|
+
onClear: _
|
|
22
23
|
}),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
f === "store" && /* @__PURE__ */ l(i, { elementSelected: m }),
|
|
25
|
+
f === "history" && /* @__PURE__ */ l(t, {}),
|
|
26
|
+
f === "variables" && /* @__PURE__ */ l(a, {}),
|
|
27
|
+
f === "elements" && /* @__PURE__ */ l(e, {
|
|
28
|
+
elementSelected: m,
|
|
29
|
+
onSelectElement: h
|
|
28
30
|
}),
|
|
29
|
-
|
|
31
|
+
f === "plugins" && /* @__PURE__ */ l(r, {})
|
|
30
32
|
]
|
|
31
33
|
})
|
|
32
34
|
});
|
|
33
35
|
};
|
|
34
36
|
//#endregion
|
|
35
|
-
export {
|
|
37
|
+
export { d as default };
|
|
@@ -9,10 +9,15 @@ var i = [
|
|
|
9
9
|
icon: "fa-solid fa-terminal"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
id: "
|
|
13
|
-
label: "
|
|
12
|
+
id: "store",
|
|
13
|
+
label: "Store",
|
|
14
14
|
icon: "fa-solid fa-database"
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
id: "history",
|
|
18
|
+
label: "History",
|
|
19
|
+
icon: "fa-solid fa-clock-rotate-left"
|
|
20
|
+
},
|
|
16
21
|
{
|
|
17
22
|
id: "elements",
|
|
18
23
|
label: "Elements",
|
|
@@ -2,47 +2,48 @@ import e from "./DevToolsBody.mjs";
|
|
|
2
2
|
import t from "./DevToolsHeader.mjs";
|
|
3
3
|
import n from "./DevToolsSubHeader.mjs";
|
|
4
4
|
import r from "@plitzi/plitzi-ui/ContainerResizable";
|
|
5
|
-
import i from "
|
|
6
|
-
import
|
|
7
|
-
import u from "
|
|
8
|
-
import
|
|
5
|
+
import i from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
6
|
+
import a from "clsx";
|
|
7
|
+
import { use as o, useCallback as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
8
|
+
import d from "@plitzi/sdk-navigation/NavigationContext";
|
|
9
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/DevToolsPanel/DevToolsPanel.tsx
|
|
10
|
-
var
|
|
11
|
-
let [
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
className:
|
|
14
|
-
minConstraintsX:
|
|
15
|
-
maxConstraintsX:
|
|
16
|
-
minConstraintsY:
|
|
17
|
-
maxConstraintsY:
|
|
18
|
-
width:
|
|
19
|
-
height:
|
|
20
|
-
resizeHandles:
|
|
21
|
-
parentRef:
|
|
11
|
+
var m = "vertical", h = "horizontal", g = ({ className: m, orientation: h = "vertical", onChangeOrientation: g }) => {
|
|
12
|
+
let [_, v] = i("plitzi-sdk.dev-tools.tab", "logs"), { currentPageId: y } = o(d), [b, x] = u(), S = c(() => h === "vertical" ? ["w"] : ["n"], [h]), C = l(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), w = s((e) => v(e), [v]), T = s((e) => x(e), [x]);
|
|
13
|
+
return /* @__PURE__ */ f(r, {
|
|
14
|
+
className: a("component__container-resizable-sidebar text-xs", m, { "h-full": h === "vertical" }),
|
|
15
|
+
minConstraintsX: h === "vertical" ? 500 : Infinity,
|
|
16
|
+
maxConstraintsX: h === "vertical" ? 1e3 : Infinity,
|
|
17
|
+
minConstraintsY: h === "vertical" ? Infinity : 34,
|
|
18
|
+
maxConstraintsY: h === "vertical" ? Infinity : 600,
|
|
19
|
+
width: h === "vertical" ? 500 : Infinity,
|
|
20
|
+
height: h === "vertical" ? Infinity : 200,
|
|
21
|
+
resizeHandles: S,
|
|
22
|
+
parentRef: C,
|
|
22
23
|
autoGrow: !1,
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
+
children: /* @__PURE__ */ p("div", {
|
|
24
25
|
className: "flex h-full w-full flex-col bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",
|
|
25
26
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
orientation:
|
|
28
|
-
onChangeOrientation:
|
|
29
|
-
onTabSelect:
|
|
30
|
-
tabSelected:
|
|
27
|
+
/* @__PURE__ */ f(t, {
|
|
28
|
+
orientation: h,
|
|
29
|
+
onChangeOrientation: g,
|
|
30
|
+
onTabSelect: w,
|
|
31
|
+
tabSelected: _
|
|
31
32
|
}),
|
|
32
|
-
["
|
|
33
|
-
elementSelected:
|
|
34
|
-
onSelectElement:
|
|
35
|
-
currentPageId:
|
|
33
|
+
["store", "elements"].includes(_) && /* @__PURE__ */ f(n, {
|
|
34
|
+
elementSelected: b,
|
|
35
|
+
onSelectElement: T,
|
|
36
|
+
currentPageId: y
|
|
36
37
|
}),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
orientation:
|
|
39
|
-
tabSelected:
|
|
40
|
-
elementSelected:
|
|
41
|
-
onSelectElement:
|
|
38
|
+
/* @__PURE__ */ f(e, {
|
|
39
|
+
orientation: h,
|
|
40
|
+
tabSelected: _,
|
|
41
|
+
elementSelected: b,
|
|
42
|
+
onSelectElement: T
|
|
42
43
|
})
|
|
43
44
|
]
|
|
44
45
|
})
|
|
45
46
|
});
|
|
46
47
|
};
|
|
47
48
|
//#endregion
|
|
48
|
-
export {
|
|
49
|
+
export { h as ORIENTATION_HORIZONTAL, m as ORIENTATION_VERTICAL, g 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 { 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,23 +1,23 @@
|
|
|
1
1
|
import { useCallback as e, useMemo as t } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { createStoreHook as n } from "@plitzi/nexus/createStore";
|
|
3
|
+
import { get as r } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
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 { useStore: l } =
|
|
8
|
-
return /* @__PURE__ */
|
|
7
|
+
let { useStore: l } = n(), [u] = l("schema.flat"), d = e((e) => () => c?.(e), [c]);
|
|
8
|
+
return /* @__PURE__ */ i("div", {
|
|
9
9
|
className: "grow basis-0 truncate",
|
|
10
|
-
children: t(() => a === "items" && s && Array.isArray(o) ? /* @__PURE__ */
|
|
10
|
+
children: t(() => a === "items" && s && Array.isArray(o) ? /* @__PURE__ */ i("div", {
|
|
11
11
|
className: "flex flex-col",
|
|
12
|
-
children: o.map((e, t) => /* @__PURE__ */
|
|
12
|
+
children: o.map((e, t) => /* @__PURE__ */ i("div", {
|
|
13
13
|
className: "cursor-pointer text-purple-400",
|
|
14
14
|
onClick: d(e),
|
|
15
|
-
children:
|
|
15
|
+
children: r(u, `${e}.definition.label`, e)
|
|
16
16
|
}, t))
|
|
17
|
-
}) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */
|
|
17
|
+
}) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */ i("div", {
|
|
18
18
|
className: "cursor-pointer text-purple-400",
|
|
19
19
|
onClick: d(o),
|
|
20
|
-
children:
|
|
20
|
+
children: r(u, `${o}.definition.label`, o)
|
|
21
21
|
}) : 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, [
|
|
22
22
|
a,
|
|
23
23
|
s,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "./DetailsAttributes.mjs";
|
|
2
2
|
import t from "./DetailsDefinition.mjs";
|
|
3
|
-
import
|
|
4
|
-
import i from "
|
|
3
|
+
import n from "@plitzi/plitzi-ui/ContainerTabs";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
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__ */
|
|
6
|
+
var a = [{ label: "Definition" }, { label: "Attributes" }], o = ({ definition: o, attributes: s, onSelectElement: c }) => /* @__PURE__ */ i(n, {
|
|
7
7
|
className: "w-full grow gap-4 overflow-hidden p-4",
|
|
8
8
|
children: [
|
|
9
|
-
/* @__PURE__ */ n
|
|
10
|
-
/* @__PURE__ */ n
|
|
9
|
+
/* @__PURE__ */ r(n.Tabs, { items: a }),
|
|
10
|
+
/* @__PURE__ */ r(n.TabContent, {
|
|
11
11
|
className: "flex-col",
|
|
12
|
-
children: /* @__PURE__ */
|
|
12
|
+
children: /* @__PURE__ */ r(t, {
|
|
13
13
|
definition: o,
|
|
14
14
|
onSelectElement: c
|
|
15
15
|
})
|
|
16
16
|
}),
|
|
17
|
-
/* @__PURE__ */ n
|
|
17
|
+
/* @__PURE__ */ r(n.TabContent, { children: /* @__PURE__ */ r(e, { attributes: s }) })
|
|
18
18
|
]
|
|
19
19
|
});
|
|
20
20
|
//#endregion
|
|
@@ -1,30 +1,30 @@
|
|
|
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 = ({ elements: c, elementSelected: l, onSelect: u }) => {
|
|
8
8
|
let [d, f] = r(""), p = n(() => (c ?? []).filter((e) => e.definition.label.toLowerCase().includes(d.toLowerCase())), [c, d]);
|
|
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: d,
|
|
15
15
|
onChange: t((e) => f(e), []),
|
|
16
16
|
placeholder: "Search elements...",
|
|
17
17
|
size: "sm"
|
|
18
18
|
})
|
|
19
|
-
}), /* @__PURE__ */
|
|
19
|
+
}), /* @__PURE__ */ a("div", {
|
|
20
20
|
className: "flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",
|
|
21
|
-
children: p.length === 0 ? /* @__PURE__ */
|
|
21
|
+
children: p.length === 0 ? /* @__PURE__ */ a("div", {
|
|
22
22
|
className: "p-4 text-center text-zinc-400 dark:text-zinc-600",
|
|
23
23
|
children: "No elements"
|
|
24
|
-
}) : p.map((t, n) => /* @__PURE__ */
|
|
24
|
+
}) : p.map((t, n) => /* @__PURE__ */ a(e, {
|
|
25
25
|
name: t.definition.label,
|
|
26
26
|
isSelected: l === t.id,
|
|
27
|
-
isVisible:
|
|
27
|
+
isVisible: i(t, "definition.initialState.visibility", !0),
|
|
28
28
|
id: t.id,
|
|
29
29
|
onSelect: u
|
|
30
30
|
}, n))
|
|
@@ -3,18 +3,18 @@ import t from "./ElementsList.mjs";
|
|
|
3
3
|
import n from "clsx";
|
|
4
4
|
import { use as r, useCallback as i, useMemo as a } from "react";
|
|
5
5
|
import o from "@plitzi/sdk-navigation/NavigationContext";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { createStoreHook as s } from "@plitzi/nexus/createStore";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.tsx
|
|
9
9
|
var u = ({ className: u, elementSelected: d, onSelectElement: f }) => {
|
|
10
|
-
let { currentPageId: p } = r(o), { useStore: m } =
|
|
11
|
-
return /* @__PURE__ */
|
|
10
|
+
let { currentPageId: p } = r(o), { useStore: m } = s(), [h] = m("schema.flat"), g = a(() => Object.values(h).filter((e) => e.definition.rootId === p), [h, p]), _ = a(() => g.find((e) => e.id === d), [g, d]), v = i((e) => f(e), [f]);
|
|
11
|
+
return /* @__PURE__ */ l("div", {
|
|
12
12
|
className: n("flex h-full w-full", u),
|
|
13
|
-
children: [/* @__PURE__ */
|
|
13
|
+
children: [/* @__PURE__ */ c(t, {
|
|
14
14
|
elements: g,
|
|
15
15
|
elementSelected: d,
|
|
16
16
|
onSelect: v
|
|
17
|
-
}), d && /* @__PURE__ */
|
|
17
|
+
}), d && /* @__PURE__ */ c(e, {
|
|
18
18
|
definition: _?.definition,
|
|
19
19
|
attributes: _?.attributes,
|
|
20
20
|
onSelectElement: f
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { matchesFilter as e } from "./helpers.mjs";
|
|
2
|
+
import t from "./components/HistoryEntryItem/HistoryEntryItem.mjs";
|
|
3
|
+
import n from "./components/HistoryToolbar/HistoryToolbar.mjs";
|
|
4
|
+
import { useCallback as r, useMemo as i, useState as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { useStoreHistory as c } from "@plitzi/nexus/history";
|
|
7
|
+
//#region src/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.tsx
|
|
8
|
+
var l = () => {
|
|
9
|
+
let { entries: l, index: u, canUndo: d, canRedo: f, undo: p, redo: m, travelTo: h, clear: g } = c(), [_, v] = a(""), y = i(() => l.map((e, t) => ({
|
|
10
|
+
entry: e,
|
|
11
|
+
originalIndex: t
|
|
12
|
+
})).filter(({ entry: t }) => e(t, _)).reverse(), [l, _]), b = r((e) => {
|
|
13
|
+
if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
let t = y.findIndex((e) => e.originalIndex === u), n;
|
|
16
|
+
n = t === -1 ? e.key === "ArrowDown" ? 0 : y.length - 1 : e.key === "ArrowUp" ? t - 1 : t + 1, !(n < 0 || n >= y.length) && h(y[n].originalIndex);
|
|
17
|
+
}, [
|
|
18
|
+
y,
|
|
19
|
+
u,
|
|
20
|
+
h
|
|
21
|
+
]);
|
|
22
|
+
return /* @__PURE__ */ s("div", {
|
|
23
|
+
className: "flex h-full w-full flex-col",
|
|
24
|
+
children: [/* @__PURE__ */ o(n, {
|
|
25
|
+
index: u,
|
|
26
|
+
total: l.length,
|
|
27
|
+
canUndo: d,
|
|
28
|
+
canRedo: f,
|
|
29
|
+
filter: _,
|
|
30
|
+
onUndo: p,
|
|
31
|
+
onRedo: m,
|
|
32
|
+
onClear: g,
|
|
33
|
+
onFilterChange: v
|
|
34
|
+
}), /* @__PURE__ */ s("div", {
|
|
35
|
+
tabIndex: 0,
|
|
36
|
+
onKeyDown: b,
|
|
37
|
+
className: "flex flex-1 flex-col overflow-y-auto outline-none",
|
|
38
|
+
children: [y.length === 0 && /* @__PURE__ */ s("div", {
|
|
39
|
+
className: "flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",
|
|
40
|
+
children: [/* @__PURE__ */ o("i", { className: "fa-solid fa-clock-rotate-left text-3xl opacity-20" }), /* @__PURE__ */ o("span", {
|
|
41
|
+
className: "text-xs",
|
|
42
|
+
children: _ ? "No entries match the filter" : "No history yet"
|
|
43
|
+
})]
|
|
44
|
+
}), y.map(({ entry: e, originalIndex: n }) => /* @__PURE__ */ o(t, {
|
|
45
|
+
index: n,
|
|
46
|
+
path: e.path,
|
|
47
|
+
value: e.value,
|
|
48
|
+
timestamp: e.timestamp,
|
|
49
|
+
isSelected: n === u,
|
|
50
|
+
isFuture: n > u,
|
|
51
|
+
onSelect: h
|
|
52
|
+
}, n))]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { l as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Path } from '@plitzi/nexus';
|
|
2
|
+
export type HistoryEntryItemProps = {
|
|
3
|
+
index: number;
|
|
4
|
+
path?: Path;
|
|
5
|
+
value?: unknown;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
isSelected: boolean;
|
|
8
|
+
isFuture: boolean;
|
|
9
|
+
onSelect: (index: number) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const HistoryEntryItem: ({ index, path, value, timestamp, isSelected, isFuture, onSelect }: HistoryEntryItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default HistoryEntryItem;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { formatTime as e, previewValue as t } from "../../helpers.mjs";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import { useCallback as r, useEffect as i, useRef as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.tsx
|
|
6
|
+
var c = ({ index: c, path: l, value: u, timestamp: d, isSelected: f, isFuture: p, onSelect: m }) => {
|
|
7
|
+
let h = a(null), g = r(() => m(c), [m, c]);
|
|
8
|
+
return i(() => {
|
|
9
|
+
f && h.current?.scrollIntoView({ block: "nearest" });
|
|
10
|
+
}, [f]), /* @__PURE__ */ s("button", {
|
|
11
|
+
ref: h,
|
|
12
|
+
onClick: g,
|
|
13
|
+
className: n("flex w-full flex-col gap-0.5 border-b border-zinc-100 px-3 py-1.5 text-left font-mono text-xs dark:border-zinc-800", {
|
|
14
|
+
"bg-violet-600 text-white dark:bg-violet-600": f,
|
|
15
|
+
"text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800/60": !f,
|
|
16
|
+
"opacity-50": p
|
|
17
|
+
}),
|
|
18
|
+
children: [/* @__PURE__ */ s("div", {
|
|
19
|
+
className: "flex w-full items-center gap-2",
|
|
20
|
+
children: [/* @__PURE__ */ o("span", {
|
|
21
|
+
className: "grow truncate",
|
|
22
|
+
children: l ?? /* @__PURE__ */ o("span", {
|
|
23
|
+
className: "italic opacity-70",
|
|
24
|
+
children: c === 0 ? "initial state" : "replace"
|
|
25
|
+
})
|
|
26
|
+
}), /* @__PURE__ */ o("span", {
|
|
27
|
+
className: "shrink-0 text-[10px] opacity-70",
|
|
28
|
+
children: e(d)
|
|
29
|
+
})]
|
|
30
|
+
}), u !== void 0 && /* @__PURE__ */ o("span", {
|
|
31
|
+
className: "w-full truncate text-[10px] opacity-70",
|
|
32
|
+
children: t(u)
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { c as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type HistoryToolbarProps = {
|
|
2
|
+
index: number;
|
|
3
|
+
total: number;
|
|
4
|
+
canUndo: boolean;
|
|
5
|
+
canRedo: boolean;
|
|
6
|
+
filter: string;
|
|
7
|
+
onUndo: () => void;
|
|
8
|
+
onRedo: () => void;
|
|
9
|
+
onClear: () => void;
|
|
10
|
+
onFilterChange: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const HistoryToolbar: ({ index, total, canUndo, canRedo, filter, onUndo, onRedo, onClear, onFilterChange }: HistoryToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default HistoryToolbar;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import n from "@plitzi/plitzi-ui/Input";
|
|
3
|
+
//#region src/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.tsx
|
|
4
|
+
var r = ({ index: r, total: i, canUndo: a, canRedo: o, filter: s, onUndo: c, onRedo: l, onClear: u, onFilterChange: d }) => /* @__PURE__ */ t("div", {
|
|
5
|
+
className: "flex shrink-0 flex-col gap-1.5 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",
|
|
6
|
+
children: [/* @__PURE__ */ t("div", {
|
|
7
|
+
className: "flex items-center gap-1",
|
|
8
|
+
children: [
|
|
9
|
+
/* @__PURE__ */ t("button", {
|
|
10
|
+
onClick: c,
|
|
11
|
+
disabled: !a,
|
|
12
|
+
className: "flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",
|
|
13
|
+
children: [/* @__PURE__ */ e("i", { className: "fa-solid fa-rotate-left" }), "Undo"]
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ t("button", {
|
|
16
|
+
onClick: l,
|
|
17
|
+
disabled: !o,
|
|
18
|
+
className: "flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",
|
|
19
|
+
children: [/* @__PURE__ */ e("i", { className: "fa-solid fa-rotate-right" }), "Redo"]
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ t("div", {
|
|
22
|
+
className: "ml-auto flex items-center gap-2",
|
|
23
|
+
children: [/* @__PURE__ */ t("span", {
|
|
24
|
+
className: "text-[10px] text-zinc-400 dark:text-zinc-500",
|
|
25
|
+
children: [
|
|
26
|
+
r + 1,
|
|
27
|
+
" / ",
|
|
28
|
+
i
|
|
29
|
+
]
|
|
30
|
+
}), /* @__PURE__ */ t("button", {
|
|
31
|
+
onClick: u,
|
|
32
|
+
className: "flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700",
|
|
33
|
+
children: [/* @__PURE__ */ e("i", { className: "fa-solid fa-trash" }), "Clear"]
|
|
34
|
+
})]
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}), /* @__PURE__ */ e(n, {
|
|
38
|
+
value: s,
|
|
39
|
+
onChange: d,
|
|
40
|
+
placeholder: "Filter by path...",
|
|
41
|
+
size: "sm"
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
export { r as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HistoryEntry } from '@plitzi/nexus/history';
|
|
2
|
+
export declare const formatTime: (timestamp: number) => string;
|
|
3
|
+
export declare const previewValue: (value: unknown) => string;
|
|
4
|
+
export declare const matchesFilter: <TState>(entry: HistoryEntry<TState>, filter: string) => boolean;
|