@plitzi/sdk-dev-tools 0.32.0 → 0.32.2
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 +24 -0
- package/dist/DevToolsContainer.d.ts +1 -1
- package/dist/DevToolsContextProvider.d.ts +1 -1
- package/dist/components/DevToolsPanel/DevToolsBody.d.ts +1 -1
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +24 -22
- package/dist/components/DevToolsPanel/DevToolsButton.d.ts +1 -1
- package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +1 -1
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +5 -0
- package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +1 -1
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +19 -12
- package/dist/components/DevToolsPanel/DevToolsSubHeader.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsAttributes.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsDefinition.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/DetailsValue.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementDetails.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsList.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsListItem.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/ElementsViewer.mjs +6 -6
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/HistoryViewer.mjs +1 -1
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/HistoryEntryItem.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/HistoryToolbar.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/Log.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/LogStatus.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/LogStatusIcon.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/Logs.mjs +3 -1
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummary.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/LogsSummary/LogsSummaryItem.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyContent.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +15 -15
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTreeNode.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/InteractionNode.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeHeader.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeMetadata.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeWhen.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionBody.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteractionHeader.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigation.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +4 -4
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationHeader.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStore.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreBody.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreHeader.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +3 -3
- package/dist/components/DevToolsPanel/tabs/TracingViewer/TracingViewer.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/TracingViewer.mjs +159 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitCause/CommitCause.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitCause/CommitCause.mjs +52 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitCause/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitCause/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/CommitStrip.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/CommitStrip.mjs +70 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DetailSidebar/DetailSidebar.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DetailSidebar/DetailSidebar.mjs +202 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DetailSidebar/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DetailSidebar/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DurationLegend/DurationLegend.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DurationLegend/DurationLegend.mjs +38 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DurationLegend/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DurationLegend/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/FlameFrame.d.ts +12 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/FlameFrame.mjs +29 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.d.ts +13 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.mjs +105 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotSidebar/HotspotSidebar.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotSidebar/HotspotSidebar.mjs +124 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotSidebar/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotSidebar/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.d.ts +10 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.mjs +139 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/MetricToggle.d.ts +8 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/MetricToggle.mjs +30 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.d.ts +13 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.mjs +157 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarEmpty.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarEmpty.mjs +11 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.mjs +26 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/index.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/index.mjs +3 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarToggle/SidebarToggle.d.ts +7 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarToggle/SidebarToggle.mjs +12 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarToggle/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarToggle/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/TracingToolbar/TracingToolbar.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/TracingToolbar/TracingToolbar.mjs +66 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/TracingToolbar/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/TracingToolbar/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/helpers.d.ts +86 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/helpers.mjs +175 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/index.d.ts +1 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/index.mjs +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/useHighlightElement.d.ts +2 -0
- package/dist/components/DevToolsPanel/tabs/TracingViewer/useHighlightElement.mjs +11 -0
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariableValue.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesList.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesListItem.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesStyleList.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/VariablesViewer/VariablesViewer.mjs +5 -5
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/ListItem.d.ts +1 -1
- package/package.json +181 -10
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BUBBLED_COLOR as e, DURATION_LEGEND as t } from "../../helpers.mjs";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/DurationLegend/DurationLegend.tsx
|
|
5
|
+
var a = () => /* @__PURE__ */ i("div", {
|
|
6
|
+
className: "flex shrink-0 items-center gap-2 overflow-x-auto border-t border-zinc-200 px-2 py-1 text-[9px] text-zinc-400 dark:border-zinc-800 dark:text-zinc-500",
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ r("span", {
|
|
9
|
+
className: "font-medium",
|
|
10
|
+
children: "Render budget"
|
|
11
|
+
}),
|
|
12
|
+
t.map((e) => /* @__PURE__ */ i("span", {
|
|
13
|
+
className: "flex shrink-0 items-center gap-1",
|
|
14
|
+
children: [/* @__PURE__ */ r("span", { className: n("h-2 w-2 rounded-sm", e.color) }), e.label]
|
|
15
|
+
}, e.label)),
|
|
16
|
+
/* @__PURE__ */ i("span", {
|
|
17
|
+
className: "flex shrink-0 items-center gap-1",
|
|
18
|
+
children: [/* @__PURE__ */ r("span", { className: n("h-2 w-2 rounded-sm", e) }), "subtree only"]
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ i("span", {
|
|
21
|
+
className: "flex shrink-0 items-center gap-1",
|
|
22
|
+
children: [/* @__PURE__ */ r("span", {
|
|
23
|
+
className: "h-2 w-2 rounded-sm border border-zinc-400/60 bg-zinc-200 dark:bg-zinc-800",
|
|
24
|
+
style: { backgroundImage: "repeating-linear-gradient(45deg, rgba(113,113,122,0.4) 0, rgba(113,113,122,0.4) 1px, transparent 1px, transparent 3px)" }
|
|
25
|
+
}), "no render"]
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ i("span", {
|
|
28
|
+
className: "flex shrink-0 items-center gap-1",
|
|
29
|
+
children: [/* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-sm bg-violet-600" }), "selected"]
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ r("span", {
|
|
32
|
+
className: "ml-auto shrink-0",
|
|
33
|
+
children: "60fps ≈ 16ms · 50ms long task"
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { a as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DurationLegend';
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/FlameFrame.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FlameNode } from '../../helpers';
|
|
2
|
+
export declare const ROW_HEIGHT = 18;
|
|
3
|
+
export type FlameFrameProps = {
|
|
4
|
+
node: FlameNode;
|
|
5
|
+
left: number;
|
|
6
|
+
width: number;
|
|
7
|
+
top: number;
|
|
8
|
+
selected: boolean;
|
|
9
|
+
onClick: (node: FlameNode) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const FlameFrame: ({ node, left, width, top, selected, onClick }: FlameFrameProps) => import("react").JSX.Element;
|
|
12
|
+
export default FlameFrame;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HATCH_STYLE as e, formatMs as t, formatPercent as n, frameColor as r, frameTextColor as i } from "../../helpers.mjs";
|
|
2
|
+
import a from "clsx";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
var c = ({ node: c, left: l, width: u, top: d, selected: f, onClick: p }) => {
|
|
5
|
+
let m = {
|
|
6
|
+
left: `${l}%`,
|
|
7
|
+
width: `${u}%`,
|
|
8
|
+
top: d,
|
|
9
|
+
height: 18,
|
|
10
|
+
...c.state === "hatched" && !f ? e : void 0
|
|
11
|
+
}, h = f ? "bg-violet-600" : c.state === "hatched" ? "bg-zinc-200 dark:bg-zinc-800" : r(c);
|
|
12
|
+
return /* @__PURE__ */ s("button", {
|
|
13
|
+
type: "button",
|
|
14
|
+
onClick: () => p(c),
|
|
15
|
+
title: `${c.name} (${c.type})${c.visible ? "" : " · hidden"}\n${t(c.selfDuration)} self · ${t(c.actualDuration)} total · ${n(c.baseDuration > 0 ? c.width : 0)} width`,
|
|
16
|
+
style: m,
|
|
17
|
+
className: a("absolute flex cursor-pointer items-center gap-1 overflow-hidden rounded-[1px] border border-zinc-50 px-1 text-left text-[11px] leading-none whitespace-nowrap dark:border-zinc-900", h, f ? "z-10 text-white" : a(i(c), "hover:brightness-110")),
|
|
18
|
+
children: [
|
|
19
|
+
c.trigger && /* @__PURE__ */ o("i", { className: "fa-solid fa-bolt shrink-0 text-[8px] text-violet-200" }),
|
|
20
|
+
!c.visible && /* @__PURE__ */ o("i", { className: "fa-solid fa-eye-slash shrink-0 text-[8px] opacity-80" }),
|
|
21
|
+
/* @__PURE__ */ o("span", {
|
|
22
|
+
className: "truncate",
|
|
23
|
+
children: c.name
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { c as default };
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommitOrigin, FlameModel, FlameNode } from '../../helpers';
|
|
2
|
+
import { CommitEntry } from '@plitzi/sdk-shared';
|
|
3
|
+
export type FlamegraphProps = {
|
|
4
|
+
commit: CommitEntry;
|
|
5
|
+
model: FlameModel;
|
|
6
|
+
active: FlameNode | undefined;
|
|
7
|
+
origin: CommitOrigin;
|
|
8
|
+
sidebarOpen: boolean;
|
|
9
|
+
onSelectElement: (id: string | undefined) => void;
|
|
10
|
+
onToggleSidebar: () => void;
|
|
11
|
+
};
|
|
12
|
+
declare const Flamegraph: ({ commit, model, active, origin, sidebarOpen, onSelectElement, onToggleSidebar }: FlamegraphProps) => import("react").JSX.Element;
|
|
13
|
+
export default Flamegraph;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { COMMIT_ORIGIN_LABEL as e } from "../../helpers.mjs";
|
|
2
|
+
import t from "../CommitCause/CommitCause.mjs";
|
|
3
|
+
import n from "../DetailSidebar/DetailSidebar.mjs";
|
|
4
|
+
import r from "../DurationLegend/DurationLegend.mjs";
|
|
5
|
+
import i from "../SidebarShell/SidebarShell.mjs";
|
|
6
|
+
import a from "../SidebarShell/SidebarEmpty.mjs";
|
|
7
|
+
import o from "../SidebarToggle/SidebarToggle.mjs";
|
|
8
|
+
import s from "./FlameFrame.mjs";
|
|
9
|
+
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.tsx
|
|
12
|
+
var m = 1e-6, h = ({ commit: h, model: g, active: _, origin: v, sidebarOpen: y, onSelectElement: b, onToggleSidebar: x }) => {
|
|
13
|
+
let [S, C] = d();
|
|
14
|
+
l(() => C(void 0), [h.commitId, g]);
|
|
15
|
+
let w = u(() => {
|
|
16
|
+
let e = /* @__PURE__ */ new Map();
|
|
17
|
+
for (let t of g.nodes) e.set(t.id, t);
|
|
18
|
+
return e;
|
|
19
|
+
}, [g]), T = S ? w.get(S) : void 0, E = T ? T.x : 0, D = T ? T.width : 1, O = T ? T.depth : 0, k = u(() => {
|
|
20
|
+
if (!T) return [];
|
|
21
|
+
let e = [], t = T.parentId;
|
|
22
|
+
for (; t !== void 0;) {
|
|
23
|
+
let n = w.get(t);
|
|
24
|
+
if (!n) break;
|
|
25
|
+
e.push(n), t = n.parentId;
|
|
26
|
+
}
|
|
27
|
+
return e.reverse();
|
|
28
|
+
}, [T, w]), A = u(() => g.nodes.filter((e) => e.depth >= O && e.x >= E - m && e.x + e.width <= E + D + m), [
|
|
29
|
+
g,
|
|
30
|
+
E,
|
|
31
|
+
D,
|
|
32
|
+
O
|
|
33
|
+
]), j = u(() => A.reduce((e, t) => Math.max(e, t.depth), O), [A, O]), M = c((e) => {
|
|
34
|
+
let t = e.id === _?.id;
|
|
35
|
+
b(t ? void 0 : e.id), C(t ? void 0 : e.id);
|
|
36
|
+
}, [_, b]), N = c((e) => {
|
|
37
|
+
let t = e.id === _?.id;
|
|
38
|
+
b(t ? void 0 : e.id), C(t ? void 0 : e.id);
|
|
39
|
+
}, [_, b]);
|
|
40
|
+
return /* @__PURE__ */ p("div", {
|
|
41
|
+
className: "flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ p("div", {
|
|
44
|
+
className: "flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-zinc-200 px-2 py-1 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ p("span", {
|
|
47
|
+
className: "font-medium text-zinc-700 dark:text-zinc-200",
|
|
48
|
+
children: ["Commit #", h.commitId]
|
|
49
|
+
}),
|
|
50
|
+
v !== "update" && /* @__PURE__ */ f("span", {
|
|
51
|
+
className: "rounded bg-violet-100 px-1 text-[9px] font-medium text-violet-700 uppercase dark:bg-violet-500/20 dark:text-violet-300",
|
|
52
|
+
children: e[v]
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ f("span", {
|
|
55
|
+
className: "opacity-60",
|
|
56
|
+
children: "click a frame to zoom · click the focused frame to zoom out"
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ f(t, {
|
|
59
|
+
commit: h,
|
|
60
|
+
model: g,
|
|
61
|
+
active: _,
|
|
62
|
+
onSelectElement: b
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ f(o, {
|
|
65
|
+
className: "ml-auto",
|
|
66
|
+
open: y,
|
|
67
|
+
onToggle: x
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ p("div", {
|
|
72
|
+
className: "flex min-h-0 flex-1 overflow-hidden",
|
|
73
|
+
children: [/* @__PURE__ */ f("div", {
|
|
74
|
+
className: "min-h-0 flex-1 overflow-auto p-1",
|
|
75
|
+
children: /* @__PURE__ */ p("div", {
|
|
76
|
+
className: "relative w-full",
|
|
77
|
+
style: { height: (j + 1) * 18 },
|
|
78
|
+
children: [k.map((e) => /* @__PURE__ */ f(s, {
|
|
79
|
+
node: e,
|
|
80
|
+
left: 0,
|
|
81
|
+
width: 100,
|
|
82
|
+
top: e.depth * 18,
|
|
83
|
+
selected: e.id === _?.id,
|
|
84
|
+
onClick: N
|
|
85
|
+
}, e.id)), A.map((e) => /* @__PURE__ */ f(s, {
|
|
86
|
+
node: e,
|
|
87
|
+
left: (e.x - E) / D * 100,
|
|
88
|
+
width: e.width / D * 100,
|
|
89
|
+
top: e.depth * 18,
|
|
90
|
+
selected: e.id === _?.id,
|
|
91
|
+
onClick: M
|
|
92
|
+
}, e.id))]
|
|
93
|
+
})
|
|
94
|
+
}), y && /* @__PURE__ */ f(i, { children: _ ? /* @__PURE__ */ f(n, {
|
|
95
|
+
node: _,
|
|
96
|
+
commit: h,
|
|
97
|
+
model: g
|
|
98
|
+
}) : /* @__PURE__ */ f(a, {}) })]
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ f(r, {})
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
105
|
+
export { h as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Flamegraph';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HotspotRow } from '../../helpers';
|
|
2
|
+
import { Element } from '@plitzi/sdk-shared';
|
|
3
|
+
export type HotspotSidebarProps = {
|
|
4
|
+
row: HotspotRow;
|
|
5
|
+
flat: Record<string, Element> | undefined;
|
|
6
|
+
sessionSelf: number;
|
|
7
|
+
};
|
|
8
|
+
declare const HotspotSidebar: ({ row, flat, sessionSelf }: HotspotSidebarProps) => import("react").JSX.Element;
|
|
9
|
+
export default HotspotSidebar;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { durationColor as e, elementVisible as t, formatMs as n, formatPercent as r } from "../../helpers.mjs";
|
|
2
|
+
import i from "clsx";
|
|
3
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/HotspotSidebar/HotspotSidebar.tsx
|
|
5
|
+
var s = ({ row: s, flat: c, sessionSelf: l }) => {
|
|
6
|
+
let u = t(s.id, c);
|
|
7
|
+
return /* @__PURE__ */ o("aside", {
|
|
8
|
+
className: "flex w-52 shrink-0 flex-col gap-1.5 overflow-auto border-l border-zinc-200 bg-zinc-50 px-3 py-2 text-[10px] dark:border-zinc-800 dark:bg-zinc-900/50",
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ o("div", {
|
|
11
|
+
className: "flex items-center gap-1.5",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ a("span", { className: i("h-2.5 w-2.5 shrink-0 rounded-sm", e(s.maxSelf)) }),
|
|
14
|
+
/* @__PURE__ */ a("span", {
|
|
15
|
+
className: "truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",
|
|
16
|
+
children: s.name
|
|
17
|
+
}),
|
|
18
|
+
!u && /* @__PURE__ */ a("i", {
|
|
19
|
+
className: "fa-solid fa-eye-slash shrink-0 text-amber-500",
|
|
20
|
+
title: "Hidden via visibility"
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ a("span", {
|
|
25
|
+
className: "truncate text-zinc-400 dark:text-zinc-500",
|
|
26
|
+
children: s.type
|
|
27
|
+
}),
|
|
28
|
+
!u && /* @__PURE__ */ a("span", {
|
|
29
|
+
className: "w-fit rounded bg-amber-500/15 px-1 py-0.5 text-[9px] text-amber-600 dark:text-amber-400",
|
|
30
|
+
children: "hidden (visibility)"
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ a("div", {
|
|
33
|
+
className: "mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",
|
|
34
|
+
children: "Renders (session)"
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ o("div", {
|
|
37
|
+
className: "flex justify-between gap-2",
|
|
38
|
+
children: [/* @__PURE__ */ a("span", {
|
|
39
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
40
|
+
children: "Total"
|
|
41
|
+
}), /* @__PURE__ */ o("span", {
|
|
42
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
43
|
+
children: [s.renders, "×"]
|
|
44
|
+
})]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ o("div", {
|
|
47
|
+
className: "flex justify-between gap-2",
|
|
48
|
+
children: [/* @__PURE__ */ a("span", {
|
|
49
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
50
|
+
children: "Mounts"
|
|
51
|
+
}), /* @__PURE__ */ a("span", {
|
|
52
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
53
|
+
children: s.mounts
|
|
54
|
+
})]
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ o("div", {
|
|
57
|
+
className: "flex justify-between gap-2",
|
|
58
|
+
children: [/* @__PURE__ */ a("span", {
|
|
59
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
60
|
+
children: "Updates"
|
|
61
|
+
}), /* @__PURE__ */ a("span", {
|
|
62
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
63
|
+
children: s.renders - s.mounts
|
|
64
|
+
})]
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ a("div", {
|
|
67
|
+
className: "mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",
|
|
68
|
+
children: "Self time"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ o("div", {
|
|
71
|
+
className: "flex justify-between gap-2",
|
|
72
|
+
children: [/* @__PURE__ */ a("span", {
|
|
73
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
74
|
+
children: "Total"
|
|
75
|
+
}), /* @__PURE__ */ a("span", {
|
|
76
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
77
|
+
children: n(s.totalSelf)
|
|
78
|
+
})]
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ o("div", {
|
|
81
|
+
className: "flex justify-between gap-2",
|
|
82
|
+
children: [/* @__PURE__ */ a("span", {
|
|
83
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
84
|
+
children: "Average"
|
|
85
|
+
}), /* @__PURE__ */ a("span", {
|
|
86
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
87
|
+
children: n(s.avgSelf)
|
|
88
|
+
})]
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ o("div", {
|
|
91
|
+
className: "flex justify-between gap-2",
|
|
92
|
+
children: [/* @__PURE__ */ a("span", {
|
|
93
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
94
|
+
children: "Max"
|
|
95
|
+
}), /* @__PURE__ */ a("span", {
|
|
96
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
97
|
+
children: n(s.maxSelf)
|
|
98
|
+
})]
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ o("div", {
|
|
101
|
+
className: "flex justify-between gap-2",
|
|
102
|
+
children: [/* @__PURE__ */ a("span", {
|
|
103
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
104
|
+
children: "Last"
|
|
105
|
+
}), /* @__PURE__ */ a("span", {
|
|
106
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
107
|
+
children: n(s.lastSelf)
|
|
108
|
+
})]
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ o("div", {
|
|
111
|
+
className: "flex justify-between gap-2",
|
|
112
|
+
children: [/* @__PURE__ */ a("span", {
|
|
113
|
+
className: "text-zinc-400 dark:text-zinc-500",
|
|
114
|
+
children: "% of session"
|
|
115
|
+
}), /* @__PURE__ */ a("span", {
|
|
116
|
+
className: "text-zinc-700 tabular-nums dark:text-zinc-200",
|
|
117
|
+
children: r(l > 0 ? s.totalSelf / l : 0)
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
export { s as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './HotspotSidebar';
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommitEntry, Element, TracingTree } from '@plitzi/sdk-shared';
|
|
2
|
+
export type HotspotsListProps = {
|
|
3
|
+
commits: CommitEntry[];
|
|
4
|
+
tree: TracingTree;
|
|
5
|
+
flat: Record<string, Element> | undefined;
|
|
6
|
+
selectedId: string | undefined;
|
|
7
|
+
onSelectElement: (id: string | undefined) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const HotspotsList: ({ commits, tree, flat, selectedId, onSelectElement }: HotspotsListProps) => import("react").JSX.Element;
|
|
10
|
+
export default HotspotsList;
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.mjs
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { buildHotspots as e, durationColor as t, formatMs as n } from "../../helpers.mjs";
|
|
2
|
+
import r from "../DurationLegend/DurationLegend.mjs";
|
|
3
|
+
import i from "../HotspotSidebar/HotspotSidebar.mjs";
|
|
4
|
+
import a from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
5
|
+
import o from "clsx";
|
|
6
|
+
import { useCallback as s, useEffect as c, useMemo as l, useRef as u } from "react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/HotspotsList.tsx
|
|
9
|
+
var p = [
|
|
10
|
+
{
|
|
11
|
+
id: "total",
|
|
12
|
+
label: "Total"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "renders",
|
|
16
|
+
label: "Renders"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "avg",
|
|
20
|
+
label: "Avg"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "max",
|
|
24
|
+
label: "Max"
|
|
25
|
+
}
|
|
26
|
+
], m = (e, t) => t === "renders" ? e.renders : t === "avg" ? e.avgSelf : t === "max" ? e.maxSelf : e.totalSelf, h = ({ commits: h, tree: g, flat: _, selectedId: v, onSelectElement: y }) => {
|
|
27
|
+
let [b, x] = a("plitzi-sdk.dev-tools.tracing.sort", "total"), S = u(null), C = l(() => e(h, g, _).sort((e, t) => m(t, b) - m(e, b)), [
|
|
28
|
+
h,
|
|
29
|
+
g,
|
|
30
|
+
_,
|
|
31
|
+
b
|
|
32
|
+
]), w = l(() => C.reduce((e, t) => Math.max(e, m(t, b)), 0) || 1, [C, b]), T = l(() => C.reduce((e, t) => e + t.totalSelf, 0), [C]), E = l(() => C.find((e) => e.id === v), [C, v]), D = l(() => C.findIndex((e) => e.id === v), [C, v]);
|
|
33
|
+
c(() => S.current?.scrollIntoView({ block: "nearest" }), [v]);
|
|
34
|
+
let O = s((e) => () => x(e), [x]), k = s((e) => {
|
|
35
|
+
if (e.key !== "ArrowUp" && e.key !== "ArrowDown" || C.length === 0) return;
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
let t = D === -1 ? 0 : D, n = Math.max(0, Math.min(C.length - 1, t + (e.key === "ArrowUp" ? -1 : 1)));
|
|
38
|
+
y(C[n].id);
|
|
39
|
+
}, [
|
|
40
|
+
C,
|
|
41
|
+
D,
|
|
42
|
+
y
|
|
43
|
+
]);
|
|
44
|
+
return /* @__PURE__ */ f("div", {
|
|
45
|
+
className: "flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ f("div", {
|
|
48
|
+
className: "flex shrink-0 items-center gap-2 border-b border-zinc-200 px-2 py-1.5 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ d("span", {
|
|
51
|
+
className: "font-medium text-zinc-700 dark:text-zinc-200",
|
|
52
|
+
children: "Session hotspots"
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ f("span", { children: [
|
|
55
|
+
"· ",
|
|
56
|
+
C.length,
|
|
57
|
+
" elements · ",
|
|
58
|
+
h.length,
|
|
59
|
+
" commits"
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ f("div", {
|
|
62
|
+
className: "ml-auto flex items-center gap-1",
|
|
63
|
+
children: [/* @__PURE__ */ d("span", { children: "sort" }), p.map((e) => /* @__PURE__ */ d("button", {
|
|
64
|
+
onClick: O(e.id),
|
|
65
|
+
"aria-pressed": b === e.id,
|
|
66
|
+
className: o("rounded px-1.5 py-0.5 text-[10px] font-medium", {
|
|
67
|
+
"bg-violet-500 text-white": b === e.id,
|
|
68
|
+
"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-700": b !== e.id
|
|
69
|
+
}),
|
|
70
|
+
children: e.label
|
|
71
|
+
}, e.id))]
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ f("div", {
|
|
76
|
+
className: "flex min-h-0 flex-1 overflow-hidden",
|
|
77
|
+
children: [/* @__PURE__ */ f("div", {
|
|
78
|
+
role: "listbox",
|
|
79
|
+
"aria-label": "Session hotspots",
|
|
80
|
+
tabIndex: 0,
|
|
81
|
+
onKeyDown: k,
|
|
82
|
+
className: "min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-violet-400",
|
|
83
|
+
children: [C.length === 0 && /* @__PURE__ */ d("div", {
|
|
84
|
+
className: "px-2 py-3 text-center text-[10px] text-zinc-400 dark:text-zinc-500",
|
|
85
|
+
children: "No renders recorded yet"
|
|
86
|
+
}), C.map((e) => {
|
|
87
|
+
let r = e.id === v, i = m(e, b), a = b === "renders" ? e.renders / w : i / w;
|
|
88
|
+
return /* @__PURE__ */ f("button", {
|
|
89
|
+
ref: r ? S : void 0,
|
|
90
|
+
role: "option",
|
|
91
|
+
"aria-selected": r,
|
|
92
|
+
onClick: () => y(r ? void 0 : e.id),
|
|
93
|
+
title: `${e.name} (${e.type})\n${e.renders} renders (${e.mounts} mount)\ntotal ${n(e.totalSelf)} · avg ${n(e.avgSelf)} · max ${n(e.maxSelf)} · last ${n(e.lastSelf)}`,
|
|
94
|
+
className: o("flex w-full items-center gap-2 px-2 py-0.5 text-left", {
|
|
95
|
+
"bg-violet-500/10": r,
|
|
96
|
+
"hover:bg-zinc-50 dark:hover:bg-zinc-800/50": !r
|
|
97
|
+
}),
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ f("span", {
|
|
100
|
+
className: "flex w-40 shrink-0 flex-col",
|
|
101
|
+
children: [/* @__PURE__ */ d("span", {
|
|
102
|
+
className: "truncate text-zinc-700 dark:text-zinc-200",
|
|
103
|
+
children: e.name
|
|
104
|
+
}), /* @__PURE__ */ d("span", {
|
|
105
|
+
className: "truncate text-[9px] text-zinc-400 dark:text-zinc-500",
|
|
106
|
+
children: e.type
|
|
107
|
+
})]
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ f("span", {
|
|
110
|
+
className: "w-12 shrink-0 text-right text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",
|
|
111
|
+
title: "Times this element rendered itself",
|
|
112
|
+
children: [e.renders, "×"]
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ d("div", {
|
|
115
|
+
className: "h-2 flex-1 overflow-hidden rounded-sm bg-zinc-100 dark:bg-zinc-800",
|
|
116
|
+
children: /* @__PURE__ */ d("div", {
|
|
117
|
+
style: { width: `${Math.max(2, Math.round(a * 100))}%` },
|
|
118
|
+
className: o("h-full rounded-sm", t(e.maxSelf))
|
|
119
|
+
})
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ d("span", {
|
|
122
|
+
className: "w-14 shrink-0 text-right text-zinc-500 tabular-nums dark:text-zinc-400",
|
|
123
|
+
children: b === "renders" ? `${e.renders}×` : n(i)
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
}, e.id);
|
|
127
|
+
})]
|
|
128
|
+
}), E && /* @__PURE__ */ d(i, {
|
|
129
|
+
row: E,
|
|
130
|
+
flat: _,
|
|
131
|
+
sessionSelf: T
|
|
132
|
+
})]
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ d(r, {})
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
//#endregion
|
|
139
|
+
export { h as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './HotspotsList';
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/MetricToggle.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DurationMetric } from '../../helpers';
|
|
2
|
+
export type MetricToggleProps = {
|
|
3
|
+
metric: DurationMetric;
|
|
4
|
+
onChange: (metric: DurationMetric) => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const MetricToggle: ({ metric, onChange, className }: MetricToggleProps) => import("react").JSX.Element;
|
|
8
|
+
export default MetricToggle;
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/MetricToggle.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/MetricToggle.tsx
|
|
5
|
+
var r = [{
|
|
6
|
+
id: "self",
|
|
7
|
+
label: "Self",
|
|
8
|
+
title: "Own render work — the real per-element cost"
|
|
9
|
+
}, {
|
|
10
|
+
id: "total",
|
|
11
|
+
label: "Total",
|
|
12
|
+
title: "Subtree-inclusive time (cascades up the tree)"
|
|
13
|
+
}], i = ({ metric: i, onChange: a, className: o }) => {
|
|
14
|
+
let s = t((e) => () => a(e), [a]);
|
|
15
|
+
return /* @__PURE__ */ n("div", {
|
|
16
|
+
className: e("flex items-center overflow-hidden rounded border border-zinc-200 dark:border-zinc-700", o),
|
|
17
|
+
children: r.map((t) => /* @__PURE__ */ n("button", {
|
|
18
|
+
title: t.title,
|
|
19
|
+
"aria-pressed": i === t.id,
|
|
20
|
+
onClick: s(t.id),
|
|
21
|
+
className: e("px-1.5 py-0.5 text-[10px] font-medium", {
|
|
22
|
+
"bg-violet-500 text-white": i === t.id,
|
|
23
|
+
"text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-700": i !== t.id
|
|
24
|
+
}),
|
|
25
|
+
children: t.label
|
|
26
|
+
}, t.id))
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { i as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MetricToggle';
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommitOrigin, FlameModel, FlameNode } from '../../helpers';
|
|
2
|
+
import { CommitEntry } from '@plitzi/sdk-shared';
|
|
3
|
+
export type RankedListProps = {
|
|
4
|
+
commit: CommitEntry;
|
|
5
|
+
model: FlameModel;
|
|
6
|
+
active: FlameNode | undefined;
|
|
7
|
+
origin: CommitOrigin;
|
|
8
|
+
sidebarOpen: boolean;
|
|
9
|
+
onSelectElement: (id: string | undefined) => void;
|
|
10
|
+
onToggleSidebar: () => void;
|
|
11
|
+
};
|
|
12
|
+
declare const RankedList: ({ commit, model, active, origin, sidebarOpen, onSelectElement, onToggleSidebar }: RankedListProps) => import("react").JSX.Element;
|
|
13
|
+
export default RankedList;
|