@plitzi/sdk-dev-tools 0.32.25 → 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.
Files changed (52) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/DevToolsContainer.mjs +45 -29
  3. package/dist/DevToolsContextProvider.mjs +4 -4
  4. package/dist/components/DevToolsIndicator/DevToolsIndicator.d.ts +7 -0
  5. package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +50 -0
  6. package/dist/components/DevToolsIndicator/index.d.ts +3 -0
  7. package/dist/components/DevToolsIndicator/index.mjs +5 -0
  8. package/dist/components/DevToolsOverlay/DevToolsOverlay.d.ts +15 -0
  9. package/dist/components/DevToolsOverlay/DevToolsOverlay.mjs +18 -0
  10. package/dist/components/DevToolsOverlay/index.d.ts +3 -0
  11. package/dist/components/DevToolsOverlay/index.mjs +5 -0
  12. package/dist/components/DevToolsPanel/DevToolsBody.d.ts +3 -1
  13. package/dist/components/DevToolsPanel/DevToolsBody.mjs +8 -7
  14. package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +2 -1
  15. package/dist/components/DevToolsPanel/DevToolsHeader.mjs +31 -22
  16. package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +7 -1
  17. package/dist/components/DevToolsPanel/DevToolsPanel.mjs +36 -34
  18. package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +8 -8
  19. package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +9 -9
  20. package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.mjs +7 -7
  21. package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.mjs +9 -9
  22. package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.mjs +15 -16
  23. package/dist/components/DevToolsPanel/tabs/Logs/Log.mjs +23 -17
  24. package/dist/components/DevToolsPanel/tabs/Logs/Logs.d.ts +4 -2
  25. package/dist/components/DevToolsPanel/tabs/Logs/Logs.mjs +15 -15
  26. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.mjs +8 -8
  27. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.d.ts +2 -1
  28. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +53 -43
  29. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +11 -11
  30. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.d.ts +1 -1
  31. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +22 -15
  32. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.d.ts +2 -1
  33. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.mjs +3 -2
  34. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.d.ts +2 -1
  35. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.mjs +4 -0
  36. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +26 -26
  37. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/LogNetwork.d.ts +10 -0
  38. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/LogNetwork.mjs +52 -0
  39. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/index.d.ts +3 -0
  40. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/index.mjs +5 -0
  41. package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +31 -28
  42. package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/mapFunctionValues.d.ts +3 -0
  43. package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/mapFunctionValues.mjs +22 -0
  44. package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/renderFunctionValue.d.ts +3 -0
  45. package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/renderFunctionValue.mjs +13 -0
  46. package/dist/components/DevToolsPanel/tabs/TracingViewer/TracingViewer.mjs +98 -99
  47. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/CommitStrip.mjs +6 -4
  48. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.mjs +32 -32
  49. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.mjs +40 -40
  50. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.mjs +7 -7
  51. package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.mjs +12 -12
  52. package/package.json +52 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
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
+
3
17
  ## 0.32.25
4
18
 
5
19
  ### Patch Changes
@@ -1,38 +1,54 @@
1
1
  import { useIsSelectedInstance as e } from "./instanceRegistry.mjs";
2
- import t from "./components/DevToolsPanel/index.mjs";
2
+ import t from "./components/DevToolsOverlay/index.mjs";
3
3
  import n from "./DevToolsContextProvider.mjs";
4
- import r from "@plitzi/plitzi-ui/hooks/useStorage";
5
- import i from "clsx";
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 { DevStoreScopeContext as u } from "@plitzi/nexus/react";
9
- import { ThemeContext as d } from "@plitzi/sdk-shared";
10
- import f from "@plitzi/plitzi-ui/ContainerShadow";
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 p = 0, m = ({ children: m, className: h, innerClassName: g, enabled: _ = !1, instanceId: v, renderMode: y = "default", devToolsStyle: b = "", devToolsStyleLink: x = "" }) => {
13
- let { theme: S } = a(d), [C, w] = r("plitzi-sdk.dev-tools.orientation", "horizontal"), T = s(void 0);
14
- T.current ||= `sdk-instance-${++p}`;
15
- let E = v || T.current, D = e(E, _), O = o((e) => w(e), [w]);
16
- return _ ? /* @__PURE__ */ l("div", {
17
- className: i("flex grow overflow-auto", {
18
- "flex-col": C === "horizontal",
19
- "h-screen": C === "vertical"
20
- }, h),
21
- children: [/* @__PURE__ */ c(u, {
22
- value: E,
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: i("grow basis-0 flex-col overflow-auto", g),
25
- children: m
28
+ className: r("grow basis-0 flex-col overflow-auto", _),
29
+ children: h
26
30
  })
27
- }), D && /* @__PURE__ */ l(n, { children: [y === "default" && /* @__PURE__ */ c(t, {
28
- orientation: C,
29
- onChangeOrientation: O
30
- }), y === "shadow" && /* @__PURE__ */ l(f, { children: [x && /* @__PURE__ */ c(f.Link, { href: x }), /* @__PURE__ */ l(f.Content, { children: [/* @__PURE__ */ c("style", { dangerouslySetInnerHTML: { __html: b } }), /* @__PURE__ */ c(t, {
31
- className: i({ dark: S === "dark" }),
32
- orientation: C,
33
- onChangeOrientation: O
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
- }) : m;
51
+ }) : h;
36
52
  };
37
53
  //#endregion
38
- export { m as default };
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 { omit as o } from "@plitzi/plitzi-ui/helpers";
4
- import { jsx as s } from "react/jsx-runtime";
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) => o(t, [e])), []), v = e((e, ...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__ */ s(a, {
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,3 @@
1
+ import { default as DevToolsIndicator } from './DevToolsIndicator';
2
+ export * from './DevToolsIndicator';
3
+ export default DevToolsIndicator;
@@ -0,0 +1,5 @@
1
+ import e from "./DevToolsIndicator.mjs";
2
+ //#region src/components/DevToolsIndicator/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t 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 };
@@ -0,0 +1,3 @@
1
+ import { default as DevToolsOverlay } from './DevToolsOverlay';
2
+ export * from './DevToolsOverlay';
3
+ export default DevToolsOverlay;
@@ -0,0 +1,5 @@
1
+ import e from "./DevToolsOverlay.mjs";
2
+ //#region src/components/DevToolsOverlay/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t 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, elementSelected: h, onSelectElement: g }) => {
14
- let { logs: _, clearLogs: v } = c(l);
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
- onClear: v
23
+ logTypeFilter: h,
24
+ onClear: y
24
25
  }),
25
- p === "store" && /* @__PURE__ */ u(i, { elementSelected: h }),
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: h,
30
- onSelectElement: g
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, onTabSelect: l }) => {
43
- let { options: u, value: d, onSelect: f } = e(), p = n(() => {
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]), m = n((e) => () => l?.(e), [l]), h = n((e) => f(e.target.value), [f]);
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: m(e.id),
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: [u.length > 0 && /* @__PURE__ */ r("select", {
64
- value: d ?? "",
65
- onChange: h,
66
- title: "Instance / StoreProvider driving the panel",
67
- 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",
68
- children: u.map((e) => /* @__PURE__ */ r("optgroup", {
69
- label: e.label,
70
- children: e.options.map((e) => /* @__PURE__ */ r("option", {
71
- value: e.value,
72
- children: e.label
73
- }, e.value))
74
- }, e.label))
75
- }), /* @__PURE__ */ r("button", {
76
- 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",
77
- title: s === "horizontal" ? "Switch to side panel" : "Switch to bottom panel",
78
- onClick: p,
79
- children: /* @__PURE__ */ r("i", { className: t("fa-solid fa-table-columns text-xs", { "rotate-90": s === "vertical" }) })
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 "@plitzi/plitzi-ui/ContainerResizable";
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";
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 m = "vertical", h = "horizontal", g = ({ className: m, orientation: h = "vertical", onChangeOrientation: g }) => {
12
- let [_, v] = i("plitzi-sdk.dev-tools.tab", "logs"), [y, b] = i("plitzi-sdk.dev-tools.size", {
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
- }), { currentPageId: x } = o(d), [S, C] = u(), w = c(() => h === "vertical" ? ["w"] : ["n"], [h]), T = l(typeof document < "u" ? document.querySelector(".plitzi-sdk") : null), E = s((e) => v(e), [v]), D = s((e) => C(e), [C]), O = s((e, t) => b((n) => ({
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
- })), [b]);
19
- return /* @__PURE__ */ f(r, {
20
- className: a("component__container-resizable-sidebar relative z-[1000000] text-xs", m, { "h-full": h === "vertical" }),
21
- minConstraintsX: h === "vertical" ? 500 : Infinity,
22
- maxConstraintsX: h === "vertical" ? 1e3 : Infinity,
23
- minConstraintsY: h === "vertical" ? Infinity : 34,
24
- maxConstraintsY: h === "vertical" ? Infinity : 600,
25
- width: h === "vertical" ? y.width : Infinity,
26
- height: h === "vertical" ? Infinity : y.height,
27
- resizeHandles: w,
28
- parentRef: T,
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__ */ p("div", {
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__ */ f(t, {
35
- orientation: h,
36
- onChangeOrientation: g,
37
- onTabSelect: E,
38
- tabSelected: _
34
+ /* @__PURE__ */ c(t, {
35
+ orientation: m,
36
+ onChangeOrientation: y,
37
+ onCollapse: _,
38
+ onTabSelect: v,
39
+ tabSelected: h
39
40
  }),
40
- ["store", "elements"].includes(_) && /* @__PURE__ */ f(n, {
41
- elementSelected: S,
41
+ ["store", "elements"].includes(h) && /* @__PURE__ */ c(n, {
42
+ elementSelected: C,
42
43
  onSelectElement: D,
43
- currentPageId: x
44
+ currentPageId: S
44
45
  }),
45
- /* @__PURE__ */ f(e, {
46
- orientation: h,
47
- tabSelected: _,
48
- elementSelected: S,
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 { h as ORIENTATION_HORIZONTAL, m as ORIENTATION_VERTICAL, g as default };
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 { throttle as o } from "@plitzi/plitzi-ui/helpers";
5
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
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(() => o(h, 100), [h]), _ = n((e) => {
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__ */ c("div", {
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__ */ c("div", {
40
+ children: [/* @__PURE__ */ s("div", {
41
41
  className: "flex gap-1",
42
- children: [/* @__PURE__ */ s(e, {
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__ */ s(e, {
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__ */ s(e, {
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 { useCommonStore as n } from "@plitzi/sdk-shared/store";
3
- import { get as r } from "@plitzi/plitzi-ui/helpers";
4
- import { jsx as i } from "react/jsx-runtime";
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] = n("schema.flat"), u = e((e) => () => c?.(e), [c]), d = t(() => a === "items" && s && Array.isArray(o) ? /* @__PURE__ */ i("div", {
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__ */ i("div", {
9
+ children: o.map((e, t) => /* @__PURE__ */ n("div", {
10
10
  className: "cursor-pointer text-purple-400",
11
11
  onClick: u(e),
12
- children: r(l, `${e}.definition.label`, e)
12
+ children: i(l, `${e}.definition.label`, e)
13
13
  }, t))
14
- }) : a && ["rootId", "parentId"].includes(a) && s ? /* @__PURE__ */ i("div", {
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: r(l, `${o}.definition.label`, o)
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__ */ i("div", {
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 "@plitzi/plitzi-ui/ContainerTabs";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
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(n, {
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__ */ r(n.Tabs, { items: a }),
10
- /* @__PURE__ */ r(n.TabContent, {
9
+ /* @__PURE__ */ n(i.Tabs, { items: a }),
10
+ /* @__PURE__ */ n(i.TabContent, {
11
11
  className: "flex-col",
12
- children: /* @__PURE__ */ r(t, {
12
+ children: /* @__PURE__ */ n(t, {
13
13
  definition: o,
14
14
  onSelectElement: c
15
15
  })
16
16
  }),
17
- /* @__PURE__ */ r(n.TabContent, { children: /* @__PURE__ */ r(e, { attributes: s }) })
17
+ /* @__PURE__ */ n(i.TabContent, { children: /* @__PURE__ */ n(e, { attributes: s }) })
18
18
  ]
19
19
  });
20
20
  //#endregion