@plitzi/sdk-dev-tools 0.32.24 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/DevToolsContainer.mjs +45 -29
- package/dist/DevToolsContextProvider.mjs +4 -4
- package/dist/components/DevToolsIndicator/DevToolsIndicator.d.ts +7 -0
- package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +50 -0
- package/dist/components/DevToolsIndicator/index.d.ts +3 -0
- package/dist/components/DevToolsIndicator/index.mjs +5 -0
- package/dist/components/DevToolsOverlay/DevToolsOverlay.d.ts +15 -0
- package/dist/components/DevToolsOverlay/DevToolsOverlay.mjs +18 -0
- package/dist/components/DevToolsOverlay/index.d.ts +3 -0
- package/dist/components/DevToolsOverlay/index.mjs +5 -0
- package/dist/components/DevToolsPanel/DevToolsBody.d.ts +3 -1
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +8 -7
- package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +2 -1
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +31 -22
- package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +7 -1
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +36 -34
- package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +9 -9
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.mjs +7 -7
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.mjs +9 -9
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.mjs +15 -16
- package/dist/components/DevToolsPanel/tabs/Logs/Log.mjs +23 -17
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.d.ts +4 -2
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.mjs +15 -15
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.d.ts +2 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +53 -43
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +11 -11
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +22 -15
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.d.ts +2 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.mjs +3 -2
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.d.ts +2 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.mjs +4 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +26 -26
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/LogNetwork.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/LogNetwork.mjs +52 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/index.mjs +5 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +31 -28
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/mapFunctionValues.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/mapFunctionValues.mjs +22 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/renderFunctionValue.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/StoreViewer/helpers/renderFunctionValue.mjs +13 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/TracingViewer.mjs +98 -99
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/CommitStrip.mjs +6 -4
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.mjs +32 -32
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.mjs +40 -40
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.mjs +7 -7
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.mjs +12 -12
- package/package.json +52 -8
package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import { useMemo as e } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { jsx as t, jsxs 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
|
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 [u] =
|
|
9
|
-
return /* @__PURE__ */
|
|
8
|
+
let [u] = r("schema.flat"), d = e(() => o ? i(u, o) : void 0, [o, u]);
|
|
9
|
+
return /* @__PURE__ */ n("div", {
|
|
10
10
|
className: "m-2 flex justify-around gap-4",
|
|
11
11
|
children: [
|
|
12
|
-
/* @__PURE__ */
|
|
12
|
+
/* @__PURE__ */ n("div", {
|
|
13
13
|
className: "flex min-w-0 grow basis-0 flex-col gap-2",
|
|
14
|
-
children: [/* @__PURE__ */
|
|
14
|
+
children: [/* @__PURE__ */ n("div", {
|
|
15
15
|
className: "flex items-center gap-1 font-bold",
|
|
16
|
-
children: [/* @__PURE__ */
|
|
17
|
-
}), /* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ t("i", { className: "fa-regular fa-clock" }), "Times"]
|
|
17
|
+
}), /* @__PURE__ */ n("div", {
|
|
18
18
|
className: "flex flex-col",
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ n("div", {
|
|
21
21
|
className: "flex gap-1",
|
|
22
|
-
children: [/* @__PURE__ */
|
|
22
|
+
children: [/* @__PURE__ */ t("span", { children: "Started:" }), typeof s == "string" ? s : a(s)]
|
|
23
23
|
}),
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ n("div", {
|
|
25
25
|
className: "flex gap-1",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ t("span", { children: "End:" }), typeof c == "string" ? c : a(c)]
|
|
27
27
|
}),
|
|
28
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ n("div", {
|
|
29
29
|
className: "flex gap-1",
|
|
30
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ t("span", { children: "Duration:" }), l]
|
|
31
31
|
})
|
|
32
32
|
]
|
|
33
33
|
})]
|
|
34
34
|
}),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ t("div", { className: "border-r border-gray-300" }),
|
|
36
|
+
/* @__PURE__ */ n("div", {
|
|
37
37
|
className: "flex min-w-0 grow basis-0 flex-col gap-2",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ n("div", {
|
|
39
39
|
className: "flex items-center gap-1",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
41
|
-
}), /* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ t("i", { className: "fa-solid fa-circle-info" }), "Details"]
|
|
41
|
+
}), /* @__PURE__ */ n("div", {
|
|
42
42
|
className: "flex flex-col",
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ n("div", {
|
|
45
45
|
className: "flex gap-1",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ t("span", { children: "Type:" }), /* @__PURE__ */ t("span", { children: "Navigation" })]
|
|
47
47
|
}),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ n("div", {
|
|
49
49
|
className: "flex gap-1",
|
|
50
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ t("span", { children: "Trigger:" }), /* @__PURE__ */ t("span", {
|
|
51
51
|
className: "truncate",
|
|
52
52
|
children: "-"
|
|
53
53
|
})]
|
|
54
54
|
}),
|
|
55
|
-
d && /* @__PURE__ */
|
|
55
|
+
d && /* @__PURE__ */ n("div", {
|
|
56
56
|
className: "flex gap-1",
|
|
57
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ t("span", { children: "Element:" }), /* @__PURE__ */ n("span", {
|
|
58
58
|
className: "cursor-pointer truncate text-blue-500",
|
|
59
59
|
children: [
|
|
60
60
|
d.definition.label,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LogNetwork as TLogNetwork } from '@plitzi/sdk-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type LogNetworkProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
message?: ReactNode;
|
|
6
|
+
params: TLogNetwork['params'];
|
|
7
|
+
time?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const LogNetwork: ({ time, message, params: { event, issues, payload } }: LogNetworkProps) => import("react").JSX.Element;
|
|
10
|
+
export default LogNetwork;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import e from "../../LogStatus.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "@plitzi/plitzi-ui/ContainerCollapsable";
|
|
4
|
+
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogNetwork/LogNetwork.tsx
|
|
5
|
+
var i = /* @__PURE__ */ t("i", { className: "fa-solid fa-angle-right text-[10px]" }), a = /* @__PURE__ */ t("i", { className: "fa-solid fa-angle-down text-[10px]" }), o = ({ time: o, message: s, params: { event: c, issues: l, payload: u } }) => /* @__PURE__ */ n(r, {
|
|
6
|
+
className: "last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-red-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",
|
|
7
|
+
collapsed: !0,
|
|
8
|
+
children: [/* @__PURE__ */ t(r.Header, {
|
|
9
|
+
title: /* @__PURE__ */ n("div", {
|
|
10
|
+
className: "flex w-full items-center gap-2 overflow-hidden",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ t("span", {
|
|
13
|
+
className: "shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",
|
|
14
|
+
children: o
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ t(e, {
|
|
17
|
+
logType: "danger",
|
|
18
|
+
children: "Invalid"
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ t("div", {
|
|
21
|
+
className: "grow basis-0 truncate text-zinc-700 dark:text-zinc-300",
|
|
22
|
+
children: s
|
|
23
|
+
})
|
|
24
|
+
]
|
|
25
|
+
}),
|
|
26
|
+
placement: "left",
|
|
27
|
+
className: { headerTitle: "overflow-hidden" },
|
|
28
|
+
iconCollapsed: i,
|
|
29
|
+
iconExpanded: a,
|
|
30
|
+
children: /* @__PURE__ */ t("span", {
|
|
31
|
+
className: "font-mono text-zinc-400 dark:text-zinc-500",
|
|
32
|
+
children: c
|
|
33
|
+
})
|
|
34
|
+
}), /* @__PURE__ */ t(r.Content, { children: /* @__PURE__ */ n("div", {
|
|
35
|
+
className: "flex flex-col gap-1 py-1 pl-4",
|
|
36
|
+
children: [l.map((e) => /* @__PURE__ */ n("div", {
|
|
37
|
+
className: "flex gap-2",
|
|
38
|
+
children: [/* @__PURE__ */ t("span", {
|
|
39
|
+
className: "font-mono text-red-600 dark:text-red-400",
|
|
40
|
+
children: e.path || "(root)"
|
|
41
|
+
}), /* @__PURE__ */ t("span", {
|
|
42
|
+
className: "text-zinc-600 dark:text-zinc-300",
|
|
43
|
+
children: e.message
|
|
44
|
+
})]
|
|
45
|
+
}, `${e.path}-${e.message}`)), u !== void 0 && /* @__PURE__ */ t("pre", {
|
|
46
|
+
className: "mt-1 overflow-x-auto rounded bg-zinc-50 p-2 text-[11px] text-zinc-600 dark:bg-zinc-800/60 dark:text-zinc-300",
|
|
47
|
+
children: JSON.stringify(u, null, 2)
|
|
48
|
+
})]
|
|
49
|
+
}) })]
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { o as default };
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "
|
|
4
|
-
import r from "
|
|
5
|
-
import
|
|
6
|
-
import o from "
|
|
7
|
-
import
|
|
8
|
-
import l from "
|
|
9
|
-
import
|
|
10
|
-
import
|
|
1
|
+
import e from "./helpers/mapFunctionValues.mjs";
|
|
2
|
+
import t from "./helpers/renderFunctionValue.mjs";
|
|
3
|
+
import { useSelectedStore as n } from "../../../../scope/useScope.mjs";
|
|
4
|
+
import r from "../../../../scope/useStoreState.mjs";
|
|
5
|
+
import i from "clsx";
|
|
6
|
+
import { use as a, useCallback as o, useMemo as s } from "react";
|
|
7
|
+
import c from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import d from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
10
|
+
import f from "@uiw/react-json-view";
|
|
11
|
+
import * as p from "@uiw/react-json-view/vscode";
|
|
12
|
+
import { emptyObject as m } from "@plitzi/sdk-shared/helpers/utils";
|
|
11
13
|
//#region src/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.tsx
|
|
12
|
-
var
|
|
13
|
-
...
|
|
14
|
+
var h = {
|
|
15
|
+
...p.vscodeTheme,
|
|
14
16
|
width: "100%",
|
|
15
17
|
height: "100%",
|
|
16
18
|
overflow: "auto",
|
|
17
19
|
padding: "8px",
|
|
18
20
|
fontSize: "14px"
|
|
19
|
-
},
|
|
20
|
-
let { getData:
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
}, g = (e) => i("cursor-pointer rounded px-2 py-0.5 font-medium transition-colors", e ? "bg-violet-500/15 text-violet-600 dark:text-violet-300" : "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"), _ = ({ elementSelected: i }) => {
|
|
22
|
+
let { getData: p } = a(c), _ = n(), [v, y] = d("plitzi-sdk.dev-tools.store.view", "own"), b = r(i ? void 0 : _, v === "merged"), x = o(() => y("own"), [y]), S = o(() => y("merged"), [y]), C = i ? p?.(`getElementDataSource-${i}`) : b, w = s(() => e(C), [C]);
|
|
23
|
+
return /* @__PURE__ */ u("div", {
|
|
22
24
|
className: "flex h-full w-full flex-col",
|
|
23
|
-
children: [!
|
|
25
|
+
children: [!i && /* @__PURE__ */ u("div", {
|
|
24
26
|
className: "flex shrink-0 items-center gap-1 border-b border-zinc-200 px-2 py-1 text-[11px] dark:border-zinc-800",
|
|
25
27
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ l("span", {
|
|
27
29
|
className: "mr-1 text-zinc-400 dark:text-zinc-500",
|
|
28
30
|
children: "View"
|
|
29
31
|
}),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
className:
|
|
32
|
-
onClick:
|
|
32
|
+
/* @__PURE__ */ l("button", {
|
|
33
|
+
className: g(v === "own"),
|
|
34
|
+
onClick: x,
|
|
33
35
|
title: "Only this scope's own layer",
|
|
34
36
|
children: "Own"
|
|
35
37
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
className:
|
|
38
|
-
onClick:
|
|
38
|
+
/* @__PURE__ */ l("button", {
|
|
39
|
+
className: g(v === "merged"),
|
|
40
|
+
onClick: S,
|
|
39
41
|
title: "Own layer merged over the parent scope chain",
|
|
40
42
|
children: "Merged"
|
|
41
43
|
})
|
|
42
44
|
]
|
|
43
|
-
}), /* @__PURE__ */
|
|
44
|
-
value:
|
|
45
|
-
style:
|
|
45
|
+
}), /* @__PURE__ */ l(f, {
|
|
46
|
+
value: w ?? m,
|
|
47
|
+
style: h,
|
|
46
48
|
enableClipboard: !1,
|
|
47
49
|
indentWidth: 15,
|
|
48
50
|
collapsed: 2,
|
|
49
51
|
displayObjectSize: !1,
|
|
50
|
-
displayDataTypes: !1
|
|
52
|
+
displayDataTypes: !1,
|
|
53
|
+
children: /* @__PURE__ */ l(f.String, { render: t })
|
|
51
54
|
})]
|
|
52
55
|
});
|
|
53
56
|
};
|
|
54
57
|
//#endregion
|
|
55
|
-
export {
|
|
58
|
+
export { _ as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/components/DevToolsPanel/tabs/StoreViewer/helpers/mapFunctionValues.ts
|
|
2
|
+
var e = "\0fn:", t = (t) => t.startsWith(e) ? t.slice(4) : "", n = (e) => Array.isArray(e), r = (e) => {
|
|
3
|
+
if (typeof e != "object" || !e) return !1;
|
|
4
|
+
let t = Object.getPrototypeOf(e);
|
|
5
|
+
return t === Object.prototype || t === null;
|
|
6
|
+
}, i = (t) => {
|
|
7
|
+
if (typeof t == "function") return `${e}ƒ ${t.name || "anonymous"}()`;
|
|
8
|
+
if (n(t)) {
|
|
9
|
+
let e = t.map(i);
|
|
10
|
+
return e.every((e, n) => e === t[n]) ? t : e;
|
|
11
|
+
}
|
|
12
|
+
if (!r(t)) return t;
|
|
13
|
+
let a = {}, o = !1;
|
|
14
|
+
for (let [e, n] of Object.entries(t)) a[e] = i(n), o ||= a[e] !== n;
|
|
15
|
+
return o ? a : t;
|
|
16
|
+
}, a = (e) => {
|
|
17
|
+
if (!e) return;
|
|
18
|
+
let t = i(e);
|
|
19
|
+
return r(t) ? t : e;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { a as default, t as readFunctionLabel };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { readFunctionLabel as e } from "./mapFunctionValues.mjs";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/DevToolsPanel/tabs/StoreViewer/helpers/renderFunctionValue.tsx
|
|
4
|
+
var n = (n, { type: r, value: i }) => {
|
|
5
|
+
if (r !== "value" || typeof i != "string") return null;
|
|
6
|
+
let a = e(i);
|
|
7
|
+
return a ? /* @__PURE__ */ t("span", {
|
|
8
|
+
className: "w-rjv-value text-violet-400 italic",
|
|
9
|
+
children: a
|
|
10
|
+
}) : null;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as default };
|
|
@@ -5,155 +5,154 @@ import i from "./components/HotspotsList/HotspotsList.mjs";
|
|
|
5
5
|
import a from "./components/RankedList/RankedList.mjs";
|
|
6
6
|
import o from "./components/TracingToolbar/TracingToolbar.mjs";
|
|
7
7
|
import s from "./useHighlightElement.mjs";
|
|
8
|
-
import c from "
|
|
9
|
-
import {
|
|
10
|
-
import h from "@plitzi/
|
|
8
|
+
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
import h from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
11
11
|
import { useCommonStore as g } from "@plitzi/sdk-shared/store";
|
|
12
|
-
import {
|
|
13
|
-
import { useTracing as y } from "@plitzi/sdk-shared/store/tracing";
|
|
12
|
+
import { useTracing as _ } from "@plitzi/sdk-shared/store/tracing";
|
|
14
13
|
//#region src/components/DevToolsPanel/tabs/TracingViewer/TracingViewer.tsx
|
|
15
|
-
var
|
|
16
|
-
let { enabled:
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
var v = () => {
|
|
15
|
+
let { enabled: v, hydrated: y, commits: b, tree: x, clear: S } = _(), [[C, w]] = g(["schema.flat", "navigation.currentPageId"]), [T, E] = h("plitzi-sdk.dev-tools.tracing.view", "ranked"), [D, O] = h("plitzi-sdk.dev-tools.tracing.persist", !1), [k, A] = h("plitzi-sdk.dev-tools.tracing.sidebar-open", !1), [j, M] = f(), [N, P] = f(), F = d(w);
|
|
16
|
+
l(() => {
|
|
17
|
+
F.current !== w && (F.current = w, D || (S(), M(void 0), P(void 0)));
|
|
19
18
|
}, [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
w,
|
|
20
|
+
D,
|
|
21
|
+
S
|
|
23
22
|
]);
|
|
24
|
-
let
|
|
25
|
-
if (!(!
|
|
23
|
+
let I = u(() => {
|
|
24
|
+
if (!(!y || b.length === 0)) return {
|
|
26
25
|
commitId: 0,
|
|
27
|
-
timestamp:
|
|
26
|
+
timestamp: b[0].timestamp,
|
|
28
27
|
duration: 0,
|
|
29
|
-
elementCount: Object.keys(
|
|
28
|
+
elementCount: Object.keys(x).length,
|
|
30
29
|
elements: [],
|
|
31
30
|
causes: []
|
|
32
31
|
};
|
|
33
32
|
}, [
|
|
33
|
+
y,
|
|
34
|
+
b,
|
|
35
|
+
x
|
|
36
|
+
]), L = u(() => I ? [I, ...b] : b, [I, b]), R = b[0]?.commitId, z = u(() => {
|
|
37
|
+
if (L.length === 0) return -1;
|
|
38
|
+
let e = L.findIndex((e) => e.commitId === j);
|
|
39
|
+
return e === -1 ? L.length - 1 : e;
|
|
40
|
+
}, [L, j]), B = z === -1 ? void 0 : L[z], V = B?.commitId === 0, H = u(() => B && !V ? e(B, x, C) : void 0, [
|
|
41
|
+
B,
|
|
42
|
+
V,
|
|
34
43
|
x,
|
|
35
|
-
S,
|
|
36
44
|
C
|
|
37
|
-
]),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, []), J = u((e) => {
|
|
55
|
-
I(e), e && M(!0);
|
|
56
|
-
}, [M]), Y = u(() => M((e) => !e), [M]), X = u((e) => {
|
|
57
|
-
let t = V + e;
|
|
58
|
-
t >= 0 && t < z.length && (P(z[t].commitId), I(void 0));
|
|
59
|
-
}, [z, V]), Z = u((e) => {
|
|
60
|
-
(e.key === "ArrowLeft" || e.key === "ArrowRight") && (e.preventDefault(), X(e.key === "ArrowLeft" ? -1 : 1));
|
|
61
|
-
}, [X]);
|
|
62
|
-
return b ? H ? /* @__PURE__ */ v("div", {
|
|
45
|
+
]), U = u(() => H?.nodes.find((e) => e.id === N), [H, N]);
|
|
46
|
+
s(U?.id);
|
|
47
|
+
let W = u(() => B ? t(B, y, B.commitId === R) : "update", [
|
|
48
|
+
B,
|
|
49
|
+
y,
|
|
50
|
+
R
|
|
51
|
+
]), G = c((e) => {
|
|
52
|
+
M(e), P(void 0);
|
|
53
|
+
}, []), K = c((e) => {
|
|
54
|
+
P(e), e && A(!0);
|
|
55
|
+
}, [A]), q = c(() => A((e) => !e), [A]), J = c((e) => {
|
|
56
|
+
let t = z + e;
|
|
57
|
+
t >= 0 && t < L.length && (M(L[t].commitId), P(void 0));
|
|
58
|
+
}, [L, z]), Y = c((e) => {
|
|
59
|
+
(e.key === "ArrowLeft" || e.key === "ArrowRight") && (e.preventDefault(), J(e.key === "ArrowLeft" ? -1 : 1));
|
|
60
|
+
}, [J]);
|
|
61
|
+
return v ? B ? /* @__PURE__ */ m("div", {
|
|
63
62
|
className: "flex h-full min-h-0 w-full flex-col",
|
|
64
|
-
onKeyDown:
|
|
63
|
+
onKeyDown: Y,
|
|
65
64
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
view:
|
|
68
|
-
persist:
|
|
69
|
-
commitCount:
|
|
70
|
-
onClear:
|
|
71
|
-
onViewChange:
|
|
72
|
-
onPersistChange:
|
|
65
|
+
/* @__PURE__ */ p(o, {
|
|
66
|
+
view: T,
|
|
67
|
+
persist: D,
|
|
68
|
+
commitCount: b.length,
|
|
69
|
+
onClear: S,
|
|
70
|
+
onViewChange: E,
|
|
71
|
+
onPersistChange: O
|
|
73
72
|
}),
|
|
74
|
-
|
|
75
|
-
commits:
|
|
76
|
-
selectedIndex:
|
|
77
|
-
hydrated:
|
|
78
|
-
onSelect:
|
|
73
|
+
T !== "hotspots" && /* @__PURE__ */ p(n, {
|
|
74
|
+
commits: L,
|
|
75
|
+
selectedIndex: z,
|
|
76
|
+
hydrated: y,
|
|
77
|
+
onSelect: G
|
|
79
78
|
}),
|
|
80
|
-
|
|
79
|
+
T !== "hotspots" && V && /* @__PURE__ */ m("div", {
|
|
81
80
|
className: "flex grow flex-col items-center justify-center gap-3 px-6 text-center text-zinc-500 dark:text-zinc-400",
|
|
82
81
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ p("i", { className: "fa-solid fa-server text-3xl opacity-30" }),
|
|
83
|
+
/* @__PURE__ */ p("span", {
|
|
85
84
|
className: "text-sm font-medium text-zinc-600 dark:text-zinc-300",
|
|
86
85
|
children: "Server render (SSR)"
|
|
87
86
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ m("span", {
|
|
89
88
|
className: "max-w-md text-xs leading-relaxed",
|
|
90
89
|
children: [
|
|
91
90
|
"This page was rendered on the server first. React's Profiler doesn't run during server rendering, so there's no per-element timing for it — this commit marks that baseline. Commit\xA0#",
|
|
92
|
-
|
|
91
|
+
R,
|
|
93
92
|
" ",
|
|
94
93
|
"is the client ",
|
|
95
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ p("span", {
|
|
96
95
|
className: "font-medium text-violet-600 dark:text-violet-400",
|
|
97
96
|
children: "hydration"
|
|
98
97
|
}),
|
|
99
98
|
" of this tree."
|
|
100
99
|
]
|
|
101
100
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ m("span", {
|
|
103
102
|
className: "text-[11px] opacity-70",
|
|
104
|
-
children: [
|
|
103
|
+
children: [B.elementCount, " elements in the rendered tree"]
|
|
105
104
|
})
|
|
106
105
|
]
|
|
107
106
|
}),
|
|
108
|
-
|
|
109
|
-
commit:
|
|
110
|
-
model:
|
|
111
|
-
active:
|
|
112
|
-
origin:
|
|
113
|
-
sidebarOpen:
|
|
114
|
-
onSelectElement:
|
|
115
|
-
onToggleSidebar:
|
|
107
|
+
T === "ranked" && H && /* @__PURE__ */ p(a, {
|
|
108
|
+
commit: B,
|
|
109
|
+
model: H,
|
|
110
|
+
active: U,
|
|
111
|
+
origin: W,
|
|
112
|
+
sidebarOpen: k,
|
|
113
|
+
onSelectElement: K,
|
|
114
|
+
onToggleSidebar: q
|
|
116
115
|
}),
|
|
117
|
-
|
|
118
|
-
commit:
|
|
119
|
-
model:
|
|
120
|
-
active:
|
|
121
|
-
origin:
|
|
122
|
-
sidebarOpen:
|
|
123
|
-
onSelectElement:
|
|
124
|
-
onToggleSidebar:
|
|
116
|
+
T === "flamegraph" && H && /* @__PURE__ */ p(r, {
|
|
117
|
+
commit: B,
|
|
118
|
+
model: H,
|
|
119
|
+
active: U,
|
|
120
|
+
origin: W,
|
|
121
|
+
sidebarOpen: k,
|
|
122
|
+
onSelectElement: K,
|
|
123
|
+
onToggleSidebar: q
|
|
125
124
|
}),
|
|
126
|
-
|
|
127
|
-
commits:
|
|
128
|
-
tree:
|
|
129
|
-
flat:
|
|
130
|
-
selectedId:
|
|
131
|
-
onSelectElement:
|
|
125
|
+
T === "hotspots" && /* @__PURE__ */ p(i, {
|
|
126
|
+
commits: b,
|
|
127
|
+
tree: x,
|
|
128
|
+
flat: C,
|
|
129
|
+
selectedId: N,
|
|
130
|
+
onSelectElement: K
|
|
132
131
|
})
|
|
133
132
|
]
|
|
134
|
-
}) : /* @__PURE__ */
|
|
133
|
+
}) : /* @__PURE__ */ m("div", {
|
|
135
134
|
className: "flex h-full min-h-0 w-full flex-col",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
-
view:
|
|
138
|
-
persist:
|
|
139
|
-
commitCount:
|
|
140
|
-
onClear:
|
|
141
|
-
onViewChange:
|
|
142
|
-
onPersistChange:
|
|
143
|
-
}), /* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ p(o, {
|
|
136
|
+
view: T,
|
|
137
|
+
persist: D,
|
|
138
|
+
commitCount: b.length,
|
|
139
|
+
onClear: S,
|
|
140
|
+
onViewChange: E,
|
|
141
|
+
onPersistChange: O
|
|
142
|
+
}), /* @__PURE__ */ m("div", {
|
|
144
143
|
className: "flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ p("i", { className: "fa-solid fa-chart-column text-3xl opacity-20" }), /* @__PURE__ */ p("span", {
|
|
146
145
|
className: "text-xs",
|
|
147
146
|
children: "No commits recorded yet — interact with the page"
|
|
148
147
|
})]
|
|
149
148
|
})]
|
|
150
|
-
}) : /* @__PURE__ */
|
|
149
|
+
}) : /* @__PURE__ */ m("div", {
|
|
151
150
|
className: "flex h-full w-full flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",
|
|
152
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ p("i", { className: "fa-solid fa-gauge-high text-3xl opacity-20" }), /* @__PURE__ */ p("span", {
|
|
153
152
|
className: "text-xs",
|
|
154
153
|
children: "Enable debugMode to record render tracing"
|
|
155
154
|
})]
|
|
156
155
|
});
|
|
157
156
|
};
|
|
158
157
|
//#endregion
|
|
159
|
-
export {
|
|
158
|
+
export { v as default };
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/CommitStrip.mjs
CHANGED
|
@@ -5,10 +5,12 @@ import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
|
5
5
|
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/CommitStrip.tsx
|
|
6
6
|
var p = 6, m = ({ commits: m, selectedIndex: h, hydrated: g, onSelect: _ }) => {
|
|
7
7
|
let v = u(null), y = l(() => Math.max(1, ...m.map((e) => e.duration)), [m]), b = l(() => m.find((e) => e.commitId !== 0)?.commitId, [m]);
|
|
8
|
-
c(() =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
c(() => {
|
|
9
|
+
v.current?.scrollIntoView({
|
|
10
|
+
block: "nearest",
|
|
11
|
+
inline: "nearest"
|
|
12
|
+
});
|
|
13
|
+
}, [h]);
|
|
12
14
|
let x = s((e) => () => _(e), [_]), S = s((e) => {
|
|
13
15
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
14
16
|
e.preventDefault(), e.stopPropagation();
|