@plitzi/sdk-dev-tools 0.30.19 → 0.31.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/DevToolsContextProvider.mjs +4 -4
  3. package/dist/components/DevToolsPanel/DevToolsBody.mjs +25 -23
  4. package/dist/components/DevToolsPanel/DevToolsHeader.mjs +7 -2
  5. package/dist/components/DevToolsPanel/DevToolsPanel.mjs +33 -32
  6. package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +8 -8
  7. package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +10 -10
  8. package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.mjs +7 -7
  9. package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.mjs +9 -9
  10. package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.mjs +6 -6
  11. package/dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.d.ts +2 -0
  12. package/dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.mjs +57 -0
  13. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.d.ts +12 -0
  14. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.mjs +37 -0
  15. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.d.ts +2 -0
  16. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.mjs +2 -0
  17. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.d.ts +13 -0
  18. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.mjs +45 -0
  19. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.d.ts +2 -0
  20. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.mjs +2 -0
  21. package/dist/components/DevToolsPanel/tabs/HistoryViewer/helpers.d.ts +4 -0
  22. package/dist/components/DevToolsPanel/tabs/HistoryViewer/helpers.mjs +15 -0
  23. package/dist/components/DevToolsPanel/tabs/HistoryViewer/index.d.ts +3 -0
  24. package/dist/components/DevToolsPanel/tabs/HistoryViewer/index.mjs +5 -0
  25. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.mjs +8 -8
  26. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +30 -30
  27. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +11 -11
  28. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +26 -26
  29. package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.d.ts +5 -0
  30. package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +32 -0
  31. package/dist/components/DevToolsPanel/tabs/StoreViewer/index.d.ts +3 -0
  32. package/dist/components/DevToolsPanel/tabs/StoreViewer/index.mjs +5 -0
  33. package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.mjs +20 -20
  34. package/package.json +63 -12
  35. package/dist/components/DevToolsPanel/tabs/DataSourceViewer/DataSourceViewer.d.ts +0 -5
  36. package/dist/components/DevToolsPanel/tabs/DataSourceViewer/DataSourceViewer.mjs +0 -30
  37. package/dist/components/DevToolsPanel/tabs/DataSourceViewer/index.d.ts +0 -3
  38. package/dist/components/DevToolsPanel/tabs/DataSourceViewer/index.mjs +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @plitzi/sdk-dev-tools
2
2
 
3
+ ## 0.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - v0.31.0
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @plitzi/sdk-navigation@0.31.0
13
+ - @plitzi/sdk-schema@0.31.0
14
+ - @plitzi/sdk-shared@0.31.0
15
+ - @plitzi/sdk-store@0.31.0
16
+ - @plitzi/sdk-style@0.31.0
17
+
3
18
  ## 0.30.19
4
19
 
5
20
  ### Patch Changes
@@ -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 { jsx as o } from "react/jsx-runtime";
4
- import { omit as s } from "@plitzi/plitzi-ui/helpers";
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) => s(t, [e])), []), v = e((e, ...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__ */ o(a, {
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/DataSourceViewer/index.mjs";
2
- import t from "./tabs/ElementsViewer/index.mjs";
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/VariablesViewer/index.mjs";
6
- import a from "clsx";
7
- import { use as o } from "react";
8
- import s from "@plitzi/sdk-shared/devTools/DevToolsContext";
9
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
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 u = ({ className: u, tabSelected: d, orientation: f, elementSelected: p, onSelectElement: m }) => {
12
- let { logs: h, clearLogs: g } = o(s);
13
- return /* @__PURE__ */ c("div", {
14
- className: a("flex h-full w-full grow overflow-auto bg-white dark:bg-zinc-900", u),
15
- children: /* @__PURE__ */ l("div", {
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
- d === "logs" && /* @__PURE__ */ c(n, {
19
- items: h,
20
- orientation: f,
21
- onClear: g
19
+ f === "logs" && /* @__PURE__ */ l(n, {
20
+ items: g,
21
+ orientation: p,
22
+ onClear: _
22
23
  }),
23
- d === "dataSources" && /* @__PURE__ */ c(e, { elementSelected: p }),
24
- d === "variables" && /* @__PURE__ */ c(i, {}),
25
- d === "elements" && /* @__PURE__ */ c(t, {
26
- elementSelected: p,
27
- onSelectElement: m
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
- d === "plugins" && /* @__PURE__ */ c(r, {})
31
+ f === "plugins" && /* @__PURE__ */ l(r, {})
30
32
  ]
31
33
  })
32
34
  });
33
35
  };
34
36
  //#endregion
35
- export { u as default };
37
+ export { d as default };
@@ -9,10 +9,15 @@ var i = [
9
9
  icon: "fa-solid fa-terminal"
10
10
  },
11
11
  {
12
- id: "dataSources",
13
- label: "Sources",
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 "clsx";
6
- import { use as a, useCallback as o, useMemo as s, useRef as c, useState as l } from "react";
7
- import u from "@plitzi/sdk-navigation/NavigationContext";
8
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
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 p = "vertical", m = "horizontal", h = ({ className: p, orientation: m = "vertical", onChangeOrientation: h }) => {
11
- let [g, _] = l("logs"), { currentPageId: v } = a(u), [y, b] = l(), x = s(() => m === "vertical" ? ["w"] : ["n"], [m]), S = c(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), C = o((e) => _(e), []), w = o((e) => b(e), [b]);
12
- return /* @__PURE__ */ d(r, {
13
- className: i("component__container-resizable-sidebar text-xs", p, { "h-full": m === "vertical" }),
14
- minConstraintsX: m === "vertical" ? 500 : Infinity,
15
- maxConstraintsX: m === "vertical" ? 1e3 : Infinity,
16
- minConstraintsY: m === "vertical" ? Infinity : 34,
17
- maxConstraintsY: m === "vertical" ? Infinity : 600,
18
- width: m === "vertical" ? 500 : Infinity,
19
- height: m === "vertical" ? Infinity : 200,
20
- resizeHandles: x,
21
- parentRef: S,
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__ */ f("div", {
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__ */ d(t, {
27
- orientation: m,
28
- onChangeOrientation: h,
29
- onTabSelect: C,
30
- tabSelected: g
27
+ /* @__PURE__ */ f(t, {
28
+ orientation: h,
29
+ onChangeOrientation: g,
30
+ onTabSelect: w,
31
+ tabSelected: _
31
32
  }),
32
- ["dataSources", "elements"].includes(g) && /* @__PURE__ */ d(n, {
33
- elementSelected: y,
34
- onSelectElement: w,
35
- currentPageId: v
33
+ ["store", "elements"].includes(_) && /* @__PURE__ */ f(n, {
34
+ elementSelected: b,
35
+ onSelectElement: T,
36
+ currentPageId: y
36
37
  }),
37
- /* @__PURE__ */ d(e, {
38
- orientation: m,
39
- tabSelected: g,
40
- elementSelected: y,
41
- onSelectElement: w
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 { m as ORIENTATION_HORIZONTAL, p as ORIENTATION_VERTICAL, h as default };
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 { jsx as o, jsxs as s } from "react/jsx-runtime";
5
- import { throttle as c } from "@plitzi/plitzi-ui/helpers";
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(() => c(h, 100), [h]), _ = n((e) => {
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__ */ s("div", {
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__ */ s("div", {
40
+ children: [/* @__PURE__ */ c("div", {
41
41
  className: "flex gap-1",
42
- children: [/* @__PURE__ */ o(e, {
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__ */ o(e, {
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__ */ o(e, {
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 { jsx as n } from "react/jsx-runtime";
3
- import { createStoreHook as r } from "@plitzi/sdk-store/createStore";
4
- import { get as i } from "@plitzi/plitzi-ui/helpers";
2
+ import { createStoreHook as n } from "@plitzi/sdk-store/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 } = r(), [u] = l("schema.flat"), d = e((e) => () => c?.(e), [c]);
8
- return /* @__PURE__ */ n("div", {
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__ */ n("div", {
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__ */ n("div", {
12
+ children: o.map((e, t) => /* @__PURE__ */ i("div", {
13
13
  className: "cursor-pointer text-purple-400",
14
14
  onClick: d(e),
15
- children: i(u, `${e}.definition.label`, e)
15
+ children: r(u, `${e}.definition.label`, e)
16
16
  }, t))
17
- }) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */ n("div", {
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: i(u, `${o}.definition.label`, o)
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 { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import i from "@plitzi/plitzi-ui/ContainerTabs";
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__ */ r(i, {
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(i.Tabs, { items: a }),
10
- /* @__PURE__ */ n(i.TabContent, {
9
+ /* @__PURE__ */ r(n.Tabs, { items: a }),
10
+ /* @__PURE__ */ r(n.TabContent, {
11
11
  className: "flex-col",
12
- children: /* @__PURE__ */ n(t, {
12
+ children: /* @__PURE__ */ r(t, {
13
13
  definition: o,
14
14
  onSelectElement: c
15
15
  })
16
16
  }),
17
- /* @__PURE__ */ n(i.TabContent, { children: /* @__PURE__ */ n(e, { attributes: s }) })
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 { jsx as i, jsxs as a } from "react/jsx-runtime";
4
- import { get as o } from "@plitzi/plitzi-ui/helpers";
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__ */ a("div", {
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__ */ i("div", {
11
+ children: [/* @__PURE__ */ a("div", {
12
12
  className: "px-2 pt-2",
13
- children: /* @__PURE__ */ i(s, {
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__ */ i("div", {
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__ */ i("div", {
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__ */ i(e, {
24
+ }) : p.map((t, n) => /* @__PURE__ */ a(e, {
25
25
  name: t.definition.label,
26
26
  isSelected: l === t.id,
27
- isVisible: o(t, "definition.initialState.visibility", !0),
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 { jsx as s, jsxs as c } from "react/jsx-runtime";
7
- import { createStoreHook as l } from "@plitzi/sdk-store/createStore";
6
+ import { createStoreHook as s } from "@plitzi/sdk-store/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 } = l(), [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__ */ c("div", {
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__ */ s(t, {
13
+ children: [/* @__PURE__ */ c(t, {
14
14
  elements: g,
15
15
  elementSelected: d,
16
16
  onSelect: v
17
- }), d && /* @__PURE__ */ s(e, {
17
+ }), d && /* @__PURE__ */ c(e, {
18
18
  definition: _?.definition,
19
19
  attributes: _?.attributes,
20
20
  onSelectElement: f
@@ -0,0 +1,2 @@
1
+ declare const HistoryViewer: () => import("react/jsx-runtime").JSX.Element;
2
+ export default HistoryViewer;
@@ -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/sdk-store/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/sdk-store';
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,2 @@
1
+ export { default } from './HistoryEntryItem';
2
+ export type { HistoryEntryItemProps } from './HistoryEntryItem';
@@ -0,0 +1,2 @@
1
+ import e from "./HistoryEntryItem.mjs";
2
+ export { e 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,2 @@
1
+ export { default } from './HistoryToolbar';
2
+ export type { HistoryToolbarProps } from './HistoryToolbar';
@@ -0,0 +1,2 @@
1
+ import e from "./HistoryToolbar.mjs";
2
+ export { e as default };
@@ -0,0 +1,4 @@
1
+ import { HistoryEntry } from '@plitzi/sdk-store/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;
@@ -0,0 +1,15 @@
1
+ //#region src/components/DevToolsPanel/tabs/HistoryViewer/helpers.ts
2
+ var e = (e) => new Date(e).toLocaleTimeString(void 0, { hour12: !1 }) + "." + String(e % 1e3).padStart(3, "0"), t = (e) => {
3
+ if (e === void 0) return "";
4
+ if (typeof e == "string") return e;
5
+ if (typeof e == "number" || typeof e == "boolean") return String(e);
6
+ let t = Array.isArray(e) ? "[…]" : "{…}", n;
7
+ try {
8
+ n = JSON.stringify(e) || t;
9
+ } catch {
10
+ n = t;
11
+ }
12
+ return n.length > 120 ? n.slice(0, 120) + "…" : n;
13
+ }, n = (e, t) => t ? (e.path ?? "").toLowerCase().includes(t.toLowerCase()) : !0;
14
+ //#endregion
15
+ export { e as formatTime, n as matchesFilter, t as previewValue };
@@ -0,0 +1,3 @@
1
+ import { default as HistoryViewer } from './HistoryViewer';
2
+ export * from './HistoryViewer';
3
+ export default HistoryViewer;
@@ -0,0 +1,5 @@
1
+ import e from "./HistoryViewer.mjs";
2
+ //#region src/components/DevToolsPanel/tabs/HistoryViewer/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -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 { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import { get as c } from "@plitzi/plitzi-ui/helpers";
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(() => c(d, `${f}`), [f, d]), h = r((e) => p(e), []);
10
- return /* @__PURE__ */ s("div", {
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__ */ o(e, {
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__ */ o("div", { className: "mx-1 w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
21
- f && /* @__PURE__ */ o("div", {
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__ */ o(t, {
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 { jsx as n, jsxs as r } from "react/jsx-runtime";
3
- import { createStoreHook as i } from "@plitzi/sdk-store/createStore";
4
- import { get as a } from "@plitzi/plitzi-ui/helpers";
2
+ import { createStoreHook as n } from "@plitzi/sdk-store/createStore";
3
+ import { get as r } from "@plitzi/plitzi-ui/helpers";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
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 }) => {
8
- let { useStore: f } = i(), [p] = f("schema.flat"), m = t(() => d ? a(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(() => {
8
+ let { useStore: f } = n(), [p] = f("schema.flat"), m = t(() => d ? r(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__ */ r("div", {
21
+ return /* @__PURE__ */ a("div", {
22
22
  className: "flex justify-around gap-3",
23
23
  children: [
24
- /* @__PURE__ */ r("div", {
24
+ /* @__PURE__ */ a("div", {
25
25
  className: "flex min-w-0 grow basis-0 flex-col",
26
- children: [/* @__PURE__ */ r("div", {
26
+ children: [/* @__PURE__ */ a("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__ */ n("i", { className: "fa-regular fa-clock" }), "Times"]
29
- }), /* @__PURE__ */ r("div", {
28
+ children: [/* @__PURE__ */ i("i", { className: "fa-regular fa-clock" }), "Times"]
29
+ }), /* @__PURE__ */ a("div", {
30
30
  className: "flex flex-col gap-0.5 font-mono text-zinc-700 dark:text-zinc-300",
31
31
  children: [
32
- /* @__PURE__ */ r("div", {
32
+ /* @__PURE__ */ a("div", {
33
33
  className: "flex gap-1",
34
- children: [/* @__PURE__ */ n("span", {
34
+ children: [/* @__PURE__ */ i("span", {
35
35
  className: "text-zinc-400 dark:text-zinc-500",
36
36
  children: "Start"
37
37
  }), h]
38
38
  }),
39
- /* @__PURE__ */ r("div", {
39
+ /* @__PURE__ */ a("div", {
40
40
  className: "flex gap-1",
41
- children: [/* @__PURE__ */ n("span", {
41
+ children: [/* @__PURE__ */ i("span", {
42
42
  className: "text-zinc-400 dark:text-zinc-500",
43
43
  children: "End"
44
44
  }), g]
45
45
  }),
46
- /* @__PURE__ */ r("div", {
46
+ /* @__PURE__ */ a("div", {
47
47
  className: "flex gap-1",
48
- children: [/* @__PURE__ */ n("span", {
48
+ children: [/* @__PURE__ */ i("span", {
49
49
  className: "text-zinc-400 dark:text-zinc-500",
50
50
  children: "Duration"
51
51
  }), u]
@@ -53,43 +53,43 @@ var s = ({ triggerName: s, startTime: c, endTime: l, duration: u, elementId: d }
53
53
  ]
54
54
  })]
55
55
  }),
56
- /* @__PURE__ */ n("div", { className: "w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
57
- /* @__PURE__ */ r("div", {
56
+ /* @__PURE__ */ i("div", { className: "w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
57
+ /* @__PURE__ */ a("div", {
58
58
  className: "flex min-w-0 grow basis-0 flex-col",
59
- children: [/* @__PURE__ */ r("div", {
59
+ children: [/* @__PURE__ */ a("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__ */ n("i", { className: "fa-solid fa-circle-info" }), "Details"]
62
- }), /* @__PURE__ */ r("div", {
61
+ children: [/* @__PURE__ */ i("i", { className: "fa-solid fa-circle-info" }), "Details"]
62
+ }), /* @__PURE__ */ a("div", {
63
63
  className: "flex flex-col gap-0.5 text-zinc-700 dark:text-zinc-300",
64
64
  children: [
65
- /* @__PURE__ */ r("div", {
65
+ /* @__PURE__ */ a("div", {
66
66
  className: "flex gap-1",
67
- children: [/* @__PURE__ */ n("span", {
67
+ children: [/* @__PURE__ */ i("span", {
68
68
  className: "text-zinc-400 dark:text-zinc-500",
69
69
  children: "Type"
70
- }), /* @__PURE__ */ n("span", { children: "Interaction" })]
70
+ }), /* @__PURE__ */ i("span", { children: "Interaction" })]
71
71
  }),
72
- /* @__PURE__ */ r("div", {
72
+ /* @__PURE__ */ a("div", {
73
73
  className: "flex min-w-0 gap-1",
74
- children: [/* @__PURE__ */ n("span", {
74
+ children: [/* @__PURE__ */ i("span", {
75
75
  className: "shrink-0 text-zinc-400 dark:text-zinc-500",
76
76
  children: "Trigger"
77
- }), /* @__PURE__ */ n("span", {
77
+ }), /* @__PURE__ */ i("span", {
78
78
  className: "truncate",
79
79
  children: s
80
80
  })]
81
81
  }),
82
- /* @__PURE__ */ r("div", {
82
+ /* @__PURE__ */ a("div", {
83
83
  className: "flex min-w-0 gap-1",
84
- children: [/* @__PURE__ */ n("span", {
84
+ children: [/* @__PURE__ */ i("span", {
85
85
  className: "shrink-0 text-zinc-400 dark:text-zinc-500",
86
86
  children: "Element"
87
- }), /* @__PURE__ */ r("span", {
87
+ }), /* @__PURE__ */ a("span", {
88
88
  className: "cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",
89
89
  onClick: v,
90
90
  onMouseEnter: y,
91
91
  onMouseLeave: b,
92
- children: [m?.definition.label, d && /* @__PURE__ */ r("span", {
92
+ children: [m?.definition.label, d && /* @__PURE__ */ a("span", {
93
93
  className: "ml-1 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",
94
94
  children: [
95
95
  "[",
@@ -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 { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import { get as o } from "@plitzi/plitzi-ui/helpers";
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 = o(u, l), t = [];
10
+ let e = i(u, l), t = [];
11
11
  for (; e;) {
12
- let { node: n, startTime: r, endTime: i } = e, a = `${s(r, i)}ms`, c = n.id === l ? 0 : 1;
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: a
20
- }), e = o(u, n.afterNode);
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__ */ a("div", {
24
+ return /* @__PURE__ */ o("div", {
25
25
  className: t("flex flex-col gap-1.5", c),
26
- children: [/* @__PURE__ */ a("div", {
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__ */ i("i", { className: "fa-solid fa-code-merge" }), "Execution Tree"]
29
- }), /* @__PURE__ */ i("div", {
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__ */ i(e, {
31
+ children: p.map((t, n) => /* @__PURE__ */ a(e, {
32
32
  id: t.id,
33
33
  action: t.action,
34
34
  title: t.title,
@@ -1,60 +1,60 @@
1
1
  import { useMemo as e } from "react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { createStoreHook as r } from "@plitzi/sdk-store/createStore";
4
- import { get as i } from "@plitzi/plitzi-ui/helpers";
2
+ import { createStoreHook as t } from "@plitzi/sdk-store/createStore";
3
+ import { get as n } from "@plitzi/plitzi-ui/helpers";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  import { formatDate as a } from "@plitzi/sdk-shared/helpers";
6
6
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.tsx
7
7
  var o = ({ elementId: o, startTime: s, endTime: c, duration: l }) => {
8
- let { useStore: u } = r(), [d] = u("schema.flat"), f = e(() => o ? i(d, o) : void 0, [o, d]);
9
- return /* @__PURE__ */ n("div", {
8
+ let { useStore: u } = t(), [d] = u("schema.flat"), f = e(() => o ? n(d, o) : void 0, [o, d]);
9
+ return /* @__PURE__ */ i("div", {
10
10
  className: "m-2 flex justify-around gap-4",
11
11
  children: [
12
- /* @__PURE__ */ n("div", {
12
+ /* @__PURE__ */ i("div", {
13
13
  className: "flex min-w-0 grow basis-0 flex-col gap-2",
14
- children: [/* @__PURE__ */ n("div", {
14
+ children: [/* @__PURE__ */ i("div", {
15
15
  className: "flex items-center gap-1 font-bold",
16
- children: [/* @__PURE__ */ t("i", { className: "fa-regular fa-clock" }), "Times"]
17
- }), /* @__PURE__ */ n("div", {
16
+ children: [/* @__PURE__ */ r("i", { className: "fa-regular fa-clock" }), "Times"]
17
+ }), /* @__PURE__ */ i("div", {
18
18
  className: "flex flex-col",
19
19
  children: [
20
- /* @__PURE__ */ n("div", {
20
+ /* @__PURE__ */ i("div", {
21
21
  className: "flex gap-1",
22
- children: [/* @__PURE__ */ t("span", { children: "Started:" }), typeof s == "string" ? s : a(s)]
22
+ children: [/* @__PURE__ */ r("span", { children: "Started:" }), typeof s == "string" ? s : a(s)]
23
23
  }),
24
- /* @__PURE__ */ n("div", {
24
+ /* @__PURE__ */ i("div", {
25
25
  className: "flex gap-1",
26
- children: [/* @__PURE__ */ t("span", { children: "End:" }), typeof c == "string" ? c : a(c)]
26
+ children: [/* @__PURE__ */ r("span", { children: "End:" }), typeof c == "string" ? c : a(c)]
27
27
  }),
28
- /* @__PURE__ */ n("div", {
28
+ /* @__PURE__ */ i("div", {
29
29
  className: "flex gap-1",
30
- children: [/* @__PURE__ */ t("span", { children: "Duration:" }), l]
30
+ children: [/* @__PURE__ */ r("span", { children: "Duration:" }), l]
31
31
  })
32
32
  ]
33
33
  })]
34
34
  }),
35
- /* @__PURE__ */ t("div", { className: "border-r border-gray-300" }),
36
- /* @__PURE__ */ n("div", {
35
+ /* @__PURE__ */ r("div", { className: "border-r border-gray-300" }),
36
+ /* @__PURE__ */ i("div", {
37
37
  className: "flex min-w-0 grow basis-0 flex-col gap-2",
38
- children: [/* @__PURE__ */ n("div", {
38
+ children: [/* @__PURE__ */ i("div", {
39
39
  className: "flex items-center gap-1",
40
- children: [/* @__PURE__ */ t("i", { className: "fa-solid fa-circle-info" }), "Details"]
41
- }), /* @__PURE__ */ n("div", {
40
+ children: [/* @__PURE__ */ r("i", { className: "fa-solid fa-circle-info" }), "Details"]
41
+ }), /* @__PURE__ */ i("div", {
42
42
  className: "flex flex-col",
43
43
  children: [
44
- /* @__PURE__ */ n("div", {
44
+ /* @__PURE__ */ i("div", {
45
45
  className: "flex gap-1",
46
- children: [/* @__PURE__ */ t("span", { children: "Type:" }), /* @__PURE__ */ t("span", { children: "Navigation" })]
46
+ children: [/* @__PURE__ */ r("span", { children: "Type:" }), /* @__PURE__ */ r("span", { children: "Navigation" })]
47
47
  }),
48
- /* @__PURE__ */ n("div", {
48
+ /* @__PURE__ */ i("div", {
49
49
  className: "flex gap-1",
50
- children: [/* @__PURE__ */ t("span", { children: "Trigger:" }), /* @__PURE__ */ t("span", {
50
+ children: [/* @__PURE__ */ r("span", { children: "Trigger:" }), /* @__PURE__ */ r("span", {
51
51
  className: "truncate",
52
52
  children: "-"
53
53
  })]
54
54
  }),
55
- f && /* @__PURE__ */ n("div", {
55
+ f && /* @__PURE__ */ i("div", {
56
56
  className: "flex gap-1",
57
- children: [/* @__PURE__ */ t("span", { children: "Element:" }), /* @__PURE__ */ n("span", {
57
+ children: [/* @__PURE__ */ r("span", { children: "Element:" }), /* @__PURE__ */ i("span", {
58
58
  className: "cursor-pointer truncate text-blue-500",
59
59
  children: [
60
60
  f.definition.label,
@@ -0,0 +1,5 @@
1
+ export type StoreViewerProps = {
2
+ elementSelected?: string;
3
+ };
4
+ declare const StoreViewer: ({ elementSelected }: StoreViewerProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default StoreViewer;
@@ -0,0 +1,32 @@
1
+ import { use as e } from "react";
2
+ import t from "@plitzi/sdk-shared/devTools/DevToolsContext";
3
+ import { createStoreHook as n } from "@plitzi/sdk-store/createStore";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import i from "@uiw/react-json-view";
6
+ import * as a from "@uiw/react-json-view/vscode";
7
+ import { emptyObject as o } from "@plitzi/sdk-shared/helpers/utils";
8
+ //#region src/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.tsx
9
+ var s = {
10
+ ...a.vscodeTheme,
11
+ width: "100%",
12
+ height: "100%",
13
+ overflow: "auto",
14
+ padding: "8px",
15
+ fontSize: "14px"
16
+ }, c = ({ elementSelected: a }) => {
17
+ let { getData: c } = e(t), { useStore: l } = n(), [u] = l();
18
+ return /* @__PURE__ */ r("div", {
19
+ className: "flex h-full w-full flex-col",
20
+ children: /* @__PURE__ */ r(i, {
21
+ value: (a ? c?.(`getElementDataSource-${a}`) : u) ?? o,
22
+ style: s,
23
+ enableClipboard: !1,
24
+ indentWidth: 15,
25
+ collapsed: 2,
26
+ displayObjectSize: !1,
27
+ displayDataTypes: !1
28
+ })
29
+ });
30
+ };
31
+ //#endregion
32
+ export { c as default };
@@ -0,0 +1,3 @@
1
+ import { default as StoreViewer } from './StoreViewer';
2
+ export * from './StoreViewer';
3
+ export default StoreViewer;
@@ -0,0 +1,5 @@
1
+ import e from "./StoreViewer.mjs";
2
+ //#region src/components/DevToolsPanel/tabs/StoreViewer/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,33 +1,33 @@
1
1
  import e from "./VariablesList.mjs";
2
2
  import t from "./VariablesStyleList.mjs";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { createStoreHook as i } from "@plitzi/sdk-store/createStore";
5
- import a from "@plitzi/sdk-shared/dataSource/hooks/useDataSource";
3
+ import { createStoreHook as n } from "@plitzi/sdk-store/createStore";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
5
  //#region src/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.tsx
7
- var o = () => {
8
- let { useStore: o } = i(), [[s, c]] = o(["schema.variables", "style.variables"]), { variables: l } = a({
9
- id: "",
10
- mode: "read"
11
- });
12
- return /* @__PURE__ */ r("div", {
6
+ var a = () => {
7
+ let { useStore: a } = n(), [[o, s, c]] = a([
8
+ "schema.variables",
9
+ "style.variables",
10
+ "runtime.sources.variables"
11
+ ]);
12
+ return /* @__PURE__ */ i("div", {
13
13
  className: "flex w-full flex-col gap-4 overflow-y-auto p-3",
14
- children: [/* @__PURE__ */ r("section", {
14
+ children: [/* @__PURE__ */ i("section", {
15
15
  className: "flex flex-col gap-1.5",
16
- children: [/* @__PURE__ */ r("div", {
16
+ children: [/* @__PURE__ */ i("div", {
17
17
  className: "flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
18
- children: [/* @__PURE__ */ n("i", { className: "fa-solid fa-code" }), "Schema Variables"]
19
- }), /* @__PURE__ */ n(e, {
20
- variables: s,
21
- variablesParsed: l
18
+ children: [/* @__PURE__ */ r("i", { className: "fa-solid fa-code" }), "Schema Variables"]
19
+ }), /* @__PURE__ */ r(e, {
20
+ variables: o,
21
+ variablesParsed: c
22
22
  })]
23
- }), /* @__PURE__ */ r("section", {
23
+ }), /* @__PURE__ */ i("section", {
24
24
  className: "flex flex-col gap-1.5",
25
- children: [/* @__PURE__ */ r("div", {
25
+ children: [/* @__PURE__ */ i("div", {
26
26
  className: "flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
27
- children: [/* @__PURE__ */ n("i", { className: "fa-solid fa-palette" }), "Style Variables"]
28
- }), /* @__PURE__ */ n(t, { variables: c })]
27
+ children: [/* @__PURE__ */ r("i", { className: "fa-solid fa-palette" }), "Style Variables"]
28
+ }), /* @__PURE__ */ r(t, { variables: s })]
29
29
  })]
30
30
  });
31
31
  };
32
32
  //#endregion
33
- export { o as default };
33
+ export { a as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-dev-tools",
3
- "version": "0.30.19",
3
+ "version": "0.31.0",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -94,6 +94,46 @@
94
94
  "types": "./dist/components/DevToolsPanel/tabs/ElementsViewer/index.d.ts",
95
95
  "import": "./dist/components/DevToolsPanel/tabs/ElementsViewer/index.mjs"
96
96
  },
97
+ "./components/DevToolsPanel/tabs/HistoryViewer": {
98
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/index.d.ts",
99
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/index.mjs"
100
+ },
101
+ "./components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer": {
102
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.d.ts",
103
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.mjs"
104
+ },
105
+ "./components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem": {
106
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.d.ts",
107
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.mjs"
108
+ },
109
+ "./components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem": {
110
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.d.ts",
111
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.mjs"
112
+ },
113
+ "./components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index": {
114
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.d.ts",
115
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.mjs"
116
+ },
117
+ "./components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar": {
118
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.d.ts",
119
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.mjs"
120
+ },
121
+ "./components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar": {
122
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.d.ts",
123
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.mjs"
124
+ },
125
+ "./components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index": {
126
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.d.ts",
127
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.mjs"
128
+ },
129
+ "./components/DevToolsPanel/tabs/HistoryViewer/helpers": {
130
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/helpers.d.ts",
131
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/helpers.mjs"
132
+ },
133
+ "./components/DevToolsPanel/tabs/HistoryViewer/index": {
134
+ "types": "./dist/components/DevToolsPanel/tabs/HistoryViewer/index.d.ts",
135
+ "import": "./dist/components/DevToolsPanel/tabs/HistoryViewer/index.mjs"
136
+ },
97
137
  "./components/DevToolsPanel/tabs/Logs": {
98
138
  "types": "./dist/components/DevToolsPanel/tabs/Logs/index.d.ts",
99
139
  "import": "./dist/components/DevToolsPanel/tabs/Logs/index.mjs"
@@ -274,6 +314,18 @@
274
314
  "types": "./dist/components/DevToolsPanel/tabs/PluginsViewer/index.d.ts",
275
315
  "import": "./dist/components/DevToolsPanel/tabs/PluginsViewer/index.mjs"
276
316
  },
317
+ "./components/DevToolsPanel/tabs/StoreViewer": {
318
+ "types": "./dist/components/DevToolsPanel/tabs/StoreViewer/index.d.ts",
319
+ "import": "./dist/components/DevToolsPanel/tabs/StoreViewer/index.mjs"
320
+ },
321
+ "./components/DevToolsPanel/tabs/StoreViewer/StoreViewer": {
322
+ "types": "./dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.d.ts",
323
+ "import": "./dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs"
324
+ },
325
+ "./components/DevToolsPanel/tabs/StoreViewer/index": {
326
+ "types": "./dist/components/DevToolsPanel/tabs/StoreViewer/index.d.ts",
327
+ "import": "./dist/components/DevToolsPanel/tabs/StoreViewer/index.mjs"
328
+ },
277
329
  "./components/DevToolsPanel/tabs/VariablesViewer": {
278
330
  "types": "./dist/components/DevToolsPanel/tabs/VariablesViewer/index.d.ts",
279
331
  "import": "./dist/components/DevToolsPanel/tabs/VariablesViewer/index.mjs"
@@ -334,24 +386,23 @@
334
386
  "sideEffects": false,
335
387
  "devDependencies": {
336
388
  "eslint": "^9.39.4",
337
- "react": "^19.2.5",
338
- "react-dom": "^19.2.5",
389
+ "react": "^19.2.6",
390
+ "react-dom": "^19.2.6",
339
391
  "typescript": "^6.0.3",
340
- "vite": "^8.0.10"
392
+ "vite": "^8.0.14"
341
393
  },
342
394
  "peerDependencies": {
343
395
  "react": "^19",
344
396
  "react-dom": "^19"
345
397
  },
346
398
  "dependencies": {
347
- "@plitzi/plitzi-ui": "^1.6.2",
348
- "@plitzi/sdk-data-source": "0.30.19",
349
- "@plitzi/sdk-navigation": "0.30.19",
350
- "@plitzi/sdk-schema": "0.30.19",
351
- "@plitzi/sdk-shared": "0.30.19",
352
- "@plitzi/sdk-store": "0.30.19",
353
- "@plitzi/sdk-style": "0.30.19",
354
- "@uiw/react-json-view": "^2.0.0-alpha.42",
399
+ "@plitzi/plitzi-ui": "^1.6.9",
400
+ "@plitzi/sdk-navigation": "0.31.0",
401
+ "@plitzi/sdk-schema": "0.31.0",
402
+ "@plitzi/sdk-shared": "0.31.0",
403
+ "@plitzi/sdk-store": "0.31.0",
404
+ "@plitzi/sdk-style": "0.31.0",
405
+ "@uiw/react-json-view": "^2.0.0-alpha.43",
355
406
  "clsx": "^2.1.1"
356
407
  }
357
408
  }
@@ -1,5 +0,0 @@
1
- export type DataSourceViewerProps = {
2
- elementSelected?: string;
3
- };
4
- declare const DataSourceViewer: ({ elementSelected }: DataSourceViewerProps) => import("react/jsx-runtime").JSX.Element;
5
- export default DataSourceViewer;
@@ -1,30 +0,0 @@
1
- import { use as e } from "react";
2
- import t from "@plitzi/sdk-shared/devTools/DevToolsContext";
3
- import n from "@uiw/react-json-view";
4
- import * as r from "@uiw/react-json-view/vscode";
5
- import { jsx as i } from "react/jsx-runtime";
6
- //#region src/components/DevToolsPanel/tabs/DataSourceViewer/DataSourceViewer.tsx
7
- var a = {
8
- ...r.vscodeTheme,
9
- width: "100%",
10
- height: "100%",
11
- overflow: "auto",
12
- padding: "8px",
13
- fontSize: "14px"
14
- }, o = ({ elementSelected: r }) => {
15
- let { getData: o } = e(t);
16
- return /* @__PURE__ */ i("div", {
17
- className: "flex h-full w-full flex-col",
18
- children: /* @__PURE__ */ i(n, {
19
- value: r ? o?.(`getElementDataSource-${r}`) : {},
20
- style: a,
21
- enableClipboard: !1,
22
- indentWidth: 15,
23
- collapsed: 2,
24
- displayObjectSize: !1,
25
- displayDataTypes: !1
26
- })
27
- });
28
- };
29
- //#endregion
30
- export { o as default };
@@ -1,3 +0,0 @@
1
- import { default as DataSourceViewer } from './DataSourceViewer';
2
- export * from './DataSourceViewer';
3
- export default DataSourceViewer;
@@ -1,5 +0,0 @@
1
- import e from "./DataSourceViewer.mjs";
2
- //#region src/components/DevToolsPanel/tabs/DataSourceViewer/index.ts
3
- var t = e;
4
- //#endregion
5
- export { t as default };