@plitzi/sdk-dev-tools 0.38.11 → 0.38.12
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 +109 -0
- package/dist/DevToolsContainer.mjs +33 -45
- package/dist/DevToolsRoot.mjs +5 -5
- package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/DetailShell/DetailShell.mjs +10 -24
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreBody.mjs +48 -48
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.mjs +9 -9
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.mjs +59 -61
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.mjs +71 -73
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.d.ts +7 -3
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.mjs +16 -24
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/index.d.ts +0 -1
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/index.mjs +1 -2
- package/dist/components/ResizableSidebar/ResizableSidebar.d.ts +12 -0
- package/dist/components/ResizableSidebar/ResizableSidebar.mjs +26 -0
- package/dist/components/ResizableSidebar/index.d.ts +3 -0
- package/dist/components/ResizableSidebar/index.mjs +5 -0
- package/package.json +16 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,114 @@
|
|
|
1
1
|
# @plitzi/sdk-dev-tools
|
|
2
2
|
|
|
3
|
+
## 0.38.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1301338: ## Builder
|
|
8
|
+
|
|
9
|
+
- **Icons in the canvas again** (`@plitzi/plitzi-builder`): the canvas inlined the SDK's Font Awesome sheet into its
|
|
10
|
+
`<style>`, where the sheet's `url(webfonts/…)` resolved against the editor's URL — a `srcdoc` frame takes it as its
|
|
11
|
+
base — so every icon was a 404 under `/spaces/<space>/webfonts/` and drew as an empty box. Only the Vite dev server,
|
|
12
|
+
which rewrites the URL, hid it. The canvas and the element preview now link the sheet from where the host serves it:
|
|
13
|
+
a new prop, `sdkIconsStylePath`, the one the host already gives the pages it renders
|
|
14
|
+
(`/sdk-assets/plitzi-sdk-icons.css` for sdk-server). Absent, the canvas links no icon sheet.
|
|
15
|
+
|
|
16
|
+
## Plugins
|
|
17
|
+
- **A plugin's other elements, hosted by `custom`** (`@plitzi/sdk-elements`): `custom({ renderType: 'jamDisc' })` on a
|
|
18
|
+
space with a plugin installed whose main element is another (`plitzi plugin pack` of several folders: the first is the
|
|
19
|
+
plugin, the rest go in it) rendered "Custom Component jamDisc Not Found" — the page registers only the plugin's main
|
|
20
|
+
element, and a `custom` host looked nowhere else. It now loads the type from the installed plugin that packs it, as
|
|
21
|
+
an element of the type itself always did, so the two ways the docs give to place a plugin's element are the same
|
|
22
|
+
everywhere: in a project `plitzi create` wrote, and once the project is on Plitzi.
|
|
23
|
+
- **One way to place a plugin's element** (`@plitzi/sdk-authoring`, `@plitzi/cli`, docs): from its declaration,
|
|
24
|
+
`const seatPicker = defineElement(declaration)` then `seatPicker({ id, … })` — typed by what it
|
|
25
|
+
declares, and the element the builder adds when somebody drops it. The welcome space `plitzi create` writes, the
|
|
26
|
+
plugin package's preview, `plitzi plugin add` and `plitzi explain` all write it so (the template's
|
|
27
|
+
`PluginHostOptions` now takes the plugin's `type` and `declaration: { from, attributes? }`; `custom`/`element` hosting
|
|
28
|
+
is gone). `pluginFolders(folder)` (`@plitzi/sdk-authoring/node`) reads each plugin with the folder it is in;
|
|
29
|
+
`pluginDeclarations` is built on it. A `custom({ renderType })` naming a plugin the space was handed the declaration
|
|
30
|
+
of is offered the declaration instead — suggestion `plugin-custom-host`. `custom` stays for a component registered
|
|
31
|
+
by name with no declaration. The skills, the CLI README, the MCP guide, `docs/en` and the website say the same.
|
|
32
|
+
- **`definePlugin`** (`@plitzi/sdk-authoring/plugin`, a new entry of 3 KB with nothing else in it): a plugin's
|
|
33
|
+
declaration written from what only it can say —
|
|
34
|
+
`definePlugin<SeatPickerAttributes>()({ type, label, attributes, triggers, callbacks })` — and every other field
|
|
35
|
+
at the default all plugins share (the builder's gestures, the catalogue entry, each attribute bindable, an empty
|
|
36
|
+
style). It answers the whole declaration, branded with its attributes, so `defineElement(declaration)` is typed
|
|
37
|
+
without a generic. `plitzi plugin add` and `create --plugin` write declarations with it (about a third of the lines).
|
|
38
|
+
- **`usePluginTrigger(declaration)`** (`@plitzi/plitzi-sdk`): fires a plugin's declared event on its element — the
|
|
39
|
+
event name and what each hands a flow typed off the declaration's `preview` — on a live page only. The hook every
|
|
40
|
+
plugin wrote for itself (and `plugin add` generated as `use<Name>Events`) is gone from the scaffold.
|
|
41
|
+
- **Attributes as the types their defaults are** (`@plitzi/sdk-elements`): a plugin's attribute bound from text — a
|
|
42
|
+
state, a row, a channel message — reaches its component as the number or the flag its declared default is (`'112'`
|
|
43
|
+
as 112, `'true'` as true). A plugin no longer types its props `number | string` and parses them.
|
|
44
|
+
|
|
45
|
+
## Server actions and functions
|
|
46
|
+
- **Task params with rules** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`): a task declares `required`, a text's
|
|
47
|
+
`maxLength` and a number's `min`/`max`, and the runner refuses a call that breaks any of them — every rule broken at
|
|
48
|
+
once, in the words the page shows (`Title is required; Seconds is at most 300`) — before the code runs. A `text` param
|
|
49
|
+
bound to a number arrives as its digits. The manifest keeps the rules, so the platform's sandbox checks the same.
|
|
50
|
+
- **`taskAction(task, { trigger })`** (`@plitzi/sdk-authoring`): the action that runs one of the space's tasks and
|
|
51
|
+
answers its result, derived from the task — its id (`<namespace>-<action>`), name, description and input (the task's
|
|
52
|
+
params, once). An action of more than one step is still `defineAction`.
|
|
53
|
+
- **`ctx.rateLimit(bucket, { …, refuse })`**: past the limit the call is refused with those words instead of answering
|
|
54
|
+
`allowed: false` for the code to check — natively and in the sandbox.
|
|
55
|
+
|
|
56
|
+
## Authoring
|
|
57
|
+
- **`runServerActionOrNotify(id, params, fallback)`**: a server action run and the notice the visitor reads when it
|
|
58
|
+
fails — the action's own refusal, or the fallback — as two steps to spread into a flow.
|
|
59
|
+
- **`repeated-shape` reads what copies bind**: copies whose bindings read their data in different forms (a count, a
|
|
60
|
+
total of a quota) and copies holding a provider resolved on the server (found by its own id) are no longer offered
|
|
61
|
+
as one component.
|
|
62
|
+
- **`element-color-inherited`** (suggestion): `elements` giving a heading, a text, a link… `color: inherit` or the
|
|
63
|
+
page's own colour. **A link inherits the page's colour** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-elements`) rather than
|
|
64
|
+
holding the SDK's grey — the same by default, and the space's palette inside a card that is a link. The template
|
|
65
|
+
every space starts from writes its colours once, on the page.
|
|
66
|
+
|
|
67
|
+
## Fixes
|
|
68
|
+
- **A dialog opened with an id** (`@plitzi/sdk-elements`): `openDialog('dialog', '{{ row.id }}')` reads the id as its
|
|
69
|
+
`content`, as `openModal` already did — a numeric id parsed as the number and the dialog's bindings read nothing.
|
|
70
|
+
- **A select's chevron** (`@plitzi/plitzi-sdk`): a drawn chevron in the field's own colour, sized by its type, in place
|
|
71
|
+
of the `▼` glyph — and laid out in the box, so it ends where the box's padding begins whatever that padding is, and
|
|
72
|
+
the chosen option stops short of it instead of running under it. A disabled select's is faded.
|
|
73
|
+
- **Every element has its settings** (`@plitzi/plitzi-builder`, `@plitzi/sdk-elements`): the builder found none for
|
|
74
|
+
`tabContainerHeader` (registered under a misspelt type), `themeToggle`, `dropdownPopup`, `loading` and `notFound`.
|
|
75
|
+
The theme toggle's panel sets its mode, its labels and whether it offers "System"; the registry is typed by element
|
|
76
|
+
type and must hold one for each.
|
|
77
|
+
- **A plugin's panel** (`@plitzi/cli`): `plitzi doctor` warns of a plugin with no `Settings.tsx`, or one its entry never
|
|
78
|
+
passes as `pluginSettings` (`plugin-settings-missing`); the example `create` writes has its panel, as every element
|
|
79
|
+
`plugin add` writes does, and the panels it generates are laid out as the project's Prettier lays them out.
|
|
80
|
+
- **A refused or failed run reaches `onFlowError` in every mode** (`@plitzi/sdk-interactions`): an awaited server
|
|
81
|
+
action the server refused fired no `onFlowError` on the element that started it, as `detached` and `stream` ones do
|
|
82
|
+
— a board rolling its edits back on a refusal never did; and a run answered `status: 'failed'` fired `onFlowEnd`
|
|
83
|
+
(detached) or nothing (awaited) rather than `onFlowError`.
|
|
84
|
+
- **A source renamed** (`@plitzi/sdk-shared`): the binding picker lists a provider, a form or a modal by the name its
|
|
85
|
+
element has now, not the one it had when it mounted.
|
|
86
|
+
- **A text's words in the builder** (`@plitzi/sdk-elements`): a `paragraph`, `text` or `heading` whose `content` is
|
|
87
|
+
`0` shows `0` while editing too, not its placeholder; one bound to nothing shows nothing rather than `null`.
|
|
88
|
+
- **Built-in declarations** (`@plitzi/sdk-shared`): `elementDeclaration` fills in what every element shares — the
|
|
89
|
+
builder's gestures, Plitzi's catalogue entry, a visible element with no bindings, its style named by its label —
|
|
90
|
+
from the defaults `definePlugin` uses; each element's declaration says only what is its own (a third of the lines).
|
|
91
|
+
|
|
92
|
+
## Typed for plugins and hosts
|
|
93
|
+
- **`usePlitzi()` and `PlitziProvider`** (`@plitzi/sdk-shared/hooks/usePlitzi`, `@plitzi/plitzi-sdk`): what were
|
|
94
|
+
`usePlitziServiceContext()` and `PlitziServiceProvider` (and `PlitziServiceContextValue`, now `PlitziContextValue`),
|
|
95
|
+
holding only what the host rendering a space knows — `settings`, `root`, `utils`. Its `contexts` and
|
|
96
|
+
`customContexts` are gone: every context it carried is a shared one already, imported from its own module
|
|
97
|
+
(`@plitzi/sdk-interactions/InteractionsContext`, `@plitzi/sdk-shared/network/NetworkContext`…), and
|
|
98
|
+
`PluginsContext` moves to `@plitzi/sdk-shared/plugins/PluginsContext` beside the others.
|
|
99
|
+
- **`InteractionsManagerApi`** (`@plitzi/sdk-shared`): the interactions manager as everything outside
|
|
100
|
+
`@plitzi/sdk-interactions` reaches it, declared where every package can name it and implemented by
|
|
101
|
+
`InteractionsManager`, so `use(InteractionsContext)` is typed — `interactionTrigger`, `createChildManager`… — where it
|
|
102
|
+
was `any`.
|
|
103
|
+
- **`getPathsFromObject`** (`@plitzi/sdk-shared/helpers/utils`), spelt right; `getPathsFromObeject` is gone.
|
|
104
|
+
- **`ElementWords` places itself** (`@plitzi/sdk-elements`): `contentPlacement` and the element's children, so a button
|
|
105
|
+
and a link write their words once.
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [1301338]
|
|
108
|
+
- @plitzi/sdk-plugins@0.38.12
|
|
109
|
+
- @plitzi/sdk-schema@0.38.12
|
|
110
|
+
- @plitzi/sdk-shared@0.38.12
|
|
111
|
+
|
|
3
112
|
## 0.38.11
|
|
4
113
|
|
|
5
114
|
### Patch Changes
|
|
@@ -14,67 +14,55 @@ import { DEV_TOOLS_ATTRIBUTE as g } from "@plitzi/sdk-shared/devTools/chrome";
|
|
|
14
14
|
import _ from "@plitzi/sdk-shared/theme/useTheme";
|
|
15
15
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
16
16
|
//#region src/DevToolsContainer.tsx
|
|
17
|
-
var b = d(() => import("./components/DevToolsOverlay/index.mjs")), x = "horizontal", S = 0, C = ({ children: d, className: C, innerClassName: w, enabled: T = !1, instanceId: E, renderMode: D = "default", scroll: O = "container", qa: k = !1, devToolsStyle:
|
|
18
|
-
let { resolvedTheme:
|
|
19
|
-
|
|
20
|
-
let
|
|
21
|
-
o(T), a(
|
|
22
|
-
let
|
|
23
|
-
e &&
|
|
24
|
-
}, [
|
|
25
|
-
|
|
26
|
-
}, [
|
|
17
|
+
var b = d(() => import("./components/DevToolsOverlay/index.mjs")), x = "horizontal", S = 0, C = ({ children: d, className: C, innerClassName: w, enabled: T = !1, instanceId: E, renderMode: D = "default", scroll: O = "container", qa: k = !1, devToolsStyle: ee = "", devToolsStyleLink: A = "", devToolsIconsLink: j = "" }) => {
|
|
18
|
+
let { resolvedTheme: M } = _(), [N, P] = c("plitzi-sdk.dev-tools.orientation", x), [F, I] = c("plitzi-sdk.dev-tools.collapsed", !0), [L, R] = c("plitzi-sdk.dev-tools.tab", "logs"), [z, B] = m(), V = p(void 0), H = p(null);
|
|
19
|
+
V.current ||= `sdk-instance-${++S}`;
|
|
20
|
+
let U = E || V.current, W = i(), G = W ? N : x, K = r(U, T);
|
|
21
|
+
o(T), a(K, U), e(K);
|
|
22
|
+
let q = f((e) => P(e), [P]), J = f((e) => {
|
|
23
|
+
e && R("logs"), B(e), I(!1);
|
|
24
|
+
}, [I, R]), Y = f(() => I(!0), [I]), X = f((e) => {
|
|
25
|
+
B(void 0), R(e);
|
|
26
|
+
}, [R]);
|
|
27
27
|
if (!T) return d;
|
|
28
|
-
let
|
|
28
|
+
let Z = O === "document" && (!W || F), Q = /* @__PURE__ */ v(b, {
|
|
29
|
+
className: l({ dark: M === "dark" }),
|
|
30
|
+
collapsed: F,
|
|
31
|
+
orientation: G,
|
|
32
|
+
tabSelected: L,
|
|
33
|
+
logTypeFilter: z,
|
|
34
|
+
onOpen: J,
|
|
35
|
+
onCollapse: Y,
|
|
36
|
+
onTabSelect: X,
|
|
37
|
+
onChangeOrientation: q,
|
|
38
|
+
pageRef: H,
|
|
39
|
+
qa: k
|
|
40
|
+
}), $ = K && W && /* @__PURE__ */ v(n, { children: /* @__PURE__ */ v(t, { children: /* @__PURE__ */ y(u, {
|
|
29
41
|
fallback: null,
|
|
30
|
-
children: [D === "default" && /* @__PURE__ */ v(
|
|
31
|
-
className: l({ dark: N === "dark" }),
|
|
32
|
-
collapsed: I,
|
|
33
|
-
orientation: K,
|
|
34
|
-
tabSelected: R,
|
|
35
|
-
logTypeFilter: B,
|
|
36
|
-
onOpen: Y,
|
|
37
|
-
onCollapse: X,
|
|
38
|
-
onTabSelect: Z,
|
|
39
|
-
onChangeOrientation: J,
|
|
40
|
-
pageRef: U,
|
|
41
|
-
qa: k
|
|
42
|
-
}), D === "shadow" && /* @__PURE__ */ v("div", {
|
|
42
|
+
children: [D === "default" && Q, D === "shadow" && /* @__PURE__ */ v("div", {
|
|
43
43
|
style: { display: "contents" },
|
|
44
44
|
[g]: "",
|
|
45
45
|
children: /* @__PURE__ */ y(s, { children: [
|
|
46
|
-
M && /* @__PURE__ */ v(s.Link, { href: M }),
|
|
47
46
|
j && /* @__PURE__ */ v(s.Link, { href: j }),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
collapsed: I,
|
|
51
|
-
orientation: K,
|
|
52
|
-
tabSelected: R,
|
|
53
|
-
logTypeFilter: B,
|
|
54
|
-
onOpen: Y,
|
|
55
|
-
onCollapse: X,
|
|
56
|
-
onTabSelect: Z,
|
|
57
|
-
onChangeOrientation: J,
|
|
58
|
-
pageRef: U,
|
|
59
|
-
qa: k
|
|
60
|
-
})] })
|
|
47
|
+
A && /* @__PURE__ */ v(s.Link, { href: A }),
|
|
48
|
+
/* @__PURE__ */ y(s.Content, { children: [/* @__PURE__ */ v("style", { dangerouslySetInnerHTML: { __html: ee } }), Q] })
|
|
61
49
|
] })
|
|
62
50
|
})]
|
|
63
51
|
}) }) });
|
|
64
52
|
return /* @__PURE__ */ y("div", {
|
|
65
53
|
className: l("relative flex min-w-0 grow", {
|
|
66
|
-
"overflow-auto": !
|
|
67
|
-
"flex-col":
|
|
68
|
-
"h-screen": !
|
|
54
|
+
"overflow-auto": !Z,
|
|
55
|
+
"flex-col": Z || G === "horizontal",
|
|
56
|
+
"h-screen": !Z && G === "vertical"
|
|
69
57
|
}, C),
|
|
70
58
|
children: [/* @__PURE__ */ v(h, {
|
|
71
|
-
value:
|
|
59
|
+
value: U,
|
|
72
60
|
children: /* @__PURE__ */ v("div", {
|
|
73
|
-
ref:
|
|
74
|
-
className: l("grow", { "basis-0 flex-col overflow-auto": !
|
|
61
|
+
ref: H,
|
|
62
|
+
className: l("grow", { "basis-0 flex-col overflow-auto": !Z }, w),
|
|
75
63
|
children: d
|
|
76
64
|
})
|
|
77
|
-
}),
|
|
65
|
+
}), Z ? /* @__PURE__ */ v("div", {
|
|
78
66
|
className: "sticky bottom-0 h-0",
|
|
79
67
|
children: $
|
|
80
68
|
}) : $]
|
package/dist/DevToolsRoot.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import { StoreContext as i } from "@plitzi/nexus/react";
|
|
|
3
3
|
import { jsx as a } from "react/jsx-runtime";
|
|
4
4
|
import { ThemeContext as o } from "@plitzi/plitzi-ui/Provider";
|
|
5
5
|
import { createRoot as s } from "react-dom/client";
|
|
6
|
-
import c from "@plitzi/sdk-
|
|
7
|
-
import l from "@plitzi/sdk-shared/
|
|
6
|
+
import c from "@plitzi/sdk-shared/elements/ComponentContext";
|
|
7
|
+
import l from "@plitzi/sdk-shared/plugins/PluginsContext";
|
|
8
8
|
import u from "@plitzi/sdk-shared/theme/ThemeScope";
|
|
9
9
|
//#region src/DevToolsRoot.tsx
|
|
10
10
|
var d = { display: "contents" }, f = ({ children: f }) => {
|
|
11
|
-
let p = r(null), m = r(void 0), h = r(void 0), g = t(i), _ = e(u), v = e(
|
|
11
|
+
let p = r(null), m = r(void 0), h = r(void 0), g = t(i), _ = e(u), v = e(l), y = e(c), b = e(o);
|
|
12
12
|
return n(() => {
|
|
13
13
|
let e = p.current;
|
|
14
14
|
if (e) return clearTimeout(h.current), m.current ??= s(e), () => {
|
|
@@ -24,9 +24,9 @@ var d = { display: "contents" }, f = ({ children: f }) => {
|
|
|
24
24
|
value: b,
|
|
25
25
|
children: /* @__PURE__ */ a(u, {
|
|
26
26
|
value: _,
|
|
27
|
-
children: /* @__PURE__ */ a(
|
|
27
|
+
children: /* @__PURE__ */ a(l, {
|
|
28
28
|
value: v,
|
|
29
|
-
children: /* @__PURE__ */ a(
|
|
29
|
+
children: /* @__PURE__ */ a(c, {
|
|
30
30
|
value: y,
|
|
31
31
|
children: f
|
|
32
32
|
})
|
package/dist/components/DevToolsPanel/tabs/ActionsViewer/components/DetailShell/DetailShell.mjs
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import r from "@plitzi/plitzi-ui/ContainerResizable";
|
|
1
|
+
import e from "../../../../../ResizableSidebar/index.mjs";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
3
|
//#region src/components/DevToolsPanel/tabs/ActionsViewer/components/DetailShell/DetailShell.tsx
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
axis: "x",
|
|
14
|
-
autoGrow: !1,
|
|
15
|
-
width: c,
|
|
16
|
-
minConstraintsX: i,
|
|
17
|
-
maxConstraintsX: a,
|
|
18
|
-
onChange: u,
|
|
19
|
-
children: /* @__PURE__ */ n("aside", {
|
|
20
|
-
className: "flex h-full w-full flex-col gap-1.5 overflow-auto bg-zinc-50 px-3 py-2 text-[10px] dark:bg-zinc-900/50",
|
|
21
|
-
children: s
|
|
22
|
-
})
|
|
23
|
-
});
|
|
24
|
-
};
|
|
4
|
+
var n = ({ children: n }) => /* @__PURE__ */ t(e, {
|
|
5
|
+
storageKey: "plitzi-sdk.dev-tools.actions.detail-width",
|
|
6
|
+
minWidth: 200,
|
|
7
|
+
maxWidth: 520,
|
|
8
|
+
defaultWidth: 280,
|
|
9
|
+
children: n
|
|
10
|
+
});
|
|
25
11
|
//#endregion
|
|
26
|
-
export {
|
|
12
|
+
export { n as default };
|
|
@@ -2,76 +2,76 @@ import e from "./helpers/buildDiff.mjs";
|
|
|
2
2
|
import t from "./helpers/buildHunks.mjs";
|
|
3
3
|
import n from "./helpers/buildSections.mjs";
|
|
4
4
|
import r from "clsx";
|
|
5
|
-
import { useCallback as i, useEffect as a,
|
|
6
|
-
import { jsx as
|
|
5
|
+
import { useCallback as i, useEffect as a, useEffectEvent as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreBody.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
v,
|
|
8
|
+
var f = ({ path: f, prev: p, next: m, contextLines: h = 10 }) => {
|
|
9
|
+
let g = c(null), [_, v] = l(0), y = s(() => e(p, m), [p, m]), b = s(() => t(y), [y]), x = s(() => n(y, b, h), [
|
|
11
10
|
y,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
b,
|
|
12
|
+
h
|
|
13
|
+
]), S = b.length > 0, C = _ === 0, w = _ === b.length - 1, T = i((e) => {
|
|
14
|
+
(g.current?.querySelector(`[data-hunk="${e}"]`))?.scrollIntoView({ block: "center" });
|
|
15
|
+
}, []), E = i((e) => {
|
|
16
|
+
let t = _ + e;
|
|
17
|
+
t < 0 || t >= b.length || (v(t), T(t));
|
|
18
18
|
}, [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
])
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
return /* @__PURE__ */
|
|
19
|
+
_,
|
|
20
|
+
b.length,
|
|
21
|
+
T
|
|
22
|
+
]), D = o(() => {
|
|
23
|
+
S && (v(0), T(0));
|
|
24
|
+
});
|
|
25
|
+
a(() => D(), [y]);
|
|
26
|
+
let O = i(() => E(-1), [E]), k = i(() => E(1), [E]);
|
|
27
|
+
return /* @__PURE__ */ d("div", {
|
|
28
28
|
className: "mx-2 my-1.5 flex flex-col gap-2 rounded border border-zinc-200 bg-zinc-50 font-mono dark:border-zinc-700 dark:bg-zinc-800/50",
|
|
29
|
-
children: [/* @__PURE__ */
|
|
29
|
+
children: [/* @__PURE__ */ d("div", {
|
|
30
30
|
className: "flex items-center justify-between border-b border-zinc-200 px-2 py-1 dark:border-zinc-700",
|
|
31
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ d("div", {
|
|
32
32
|
className: "flex min-w-0 items-center gap-1.5",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ u("span", {
|
|
34
34
|
className: "shrink-0 text-zinc-500 dark:text-zinc-400",
|
|
35
35
|
children: "path"
|
|
36
|
-
}), /* @__PURE__ */
|
|
36
|
+
}), /* @__PURE__ */ u("span", {
|
|
37
37
|
className: "truncate text-zinc-400 dark:text-zinc-500",
|
|
38
|
-
children:
|
|
38
|
+
children: f ?? "(full state)"
|
|
39
39
|
})]
|
|
40
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ d("div", {
|
|
41
41
|
className: "flex shrink-0 items-center gap-2",
|
|
42
42
|
children: [
|
|
43
|
-
|
|
43
|
+
S && /* @__PURE__ */ d("span", {
|
|
44
44
|
className: "text-zinc-400 tabular-nums dark:text-zinc-600",
|
|
45
45
|
children: [
|
|
46
|
-
|
|
46
|
+
_ + 1,
|
|
47
47
|
"/",
|
|
48
|
-
|
|
48
|
+
b.length
|
|
49
49
|
]
|
|
50
50
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
className: r("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600", { "cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30": !
|
|
53
|
-
disabled: !
|
|
54
|
-
onClick:
|
|
51
|
+
/* @__PURE__ */ u("button", {
|
|
52
|
+
className: r("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600", { "cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30": !S || C }),
|
|
53
|
+
disabled: !S || C,
|
|
54
|
+
onClick: O,
|
|
55
55
|
children: "↑ Prev"
|
|
56
56
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
className: r("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600", { "cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30": !
|
|
59
|
-
disabled: !
|
|
60
|
-
onClick:
|
|
57
|
+
/* @__PURE__ */ u("button", {
|
|
58
|
+
className: r("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600", { "cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30": !S || w }),
|
|
59
|
+
disabled: !S || w,
|
|
60
|
+
onClick: k,
|
|
61
61
|
children: "↓ Next"
|
|
62
62
|
})
|
|
63
63
|
]
|
|
64
64
|
})]
|
|
65
|
-
}), /* @__PURE__ */
|
|
66
|
-
ref:
|
|
65
|
+
}), /* @__PURE__ */ d("pre", {
|
|
66
|
+
ref: g,
|
|
67
67
|
className: "max-h-64 overflow-auto bg-zinc-50 text-xs leading-5 dark:bg-zinc-800",
|
|
68
|
-
children: [!
|
|
68
|
+
children: [!S && /* @__PURE__ */ u("div", {
|
|
69
69
|
className: "px-3 py-2 text-zinc-400 italic dark:text-zinc-600",
|
|
70
70
|
children: "No changes"
|
|
71
|
-
}),
|
|
71
|
+
}), x.map((e, t) => {
|
|
72
72
|
if (e.kind === "separator") {
|
|
73
|
-
let n = e.hunkIndex ===
|
|
74
|
-
return /* @__PURE__ */
|
|
73
|
+
let n = e.hunkIndex === _;
|
|
74
|
+
return /* @__PURE__ */ d("div", {
|
|
75
75
|
"data-hunk": e.hunkIndex,
|
|
76
76
|
className: r("px-3", {
|
|
77
77
|
"bg-violet-50 text-violet-600 dark:bg-violet-900/40 dark:text-violet-400": n,
|
|
@@ -86,22 +86,22 @@ var d = ({ path: d, prev: f, next: p, contextLines: m = 10 }) => {
|
|
|
86
86
|
]
|
|
87
87
|
}, `sep-${t}`);
|
|
88
88
|
}
|
|
89
|
-
let { line: n, diffIndex: i, hunkIndex: a } = e, o = a ===
|
|
90
|
-
return n.type === "removed" ? /* @__PURE__ */
|
|
89
|
+
let { line: n, diffIndex: i, hunkIndex: a } = e, o = a === _;
|
|
90
|
+
return n.type === "removed" ? /* @__PURE__ */ d("div", {
|
|
91
91
|
"data-hunk": a ?? void 0,
|
|
92
92
|
className: r("px-3", {
|
|
93
93
|
"bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-300": o,
|
|
94
94
|
"bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400": !o
|
|
95
95
|
}),
|
|
96
96
|
children: ["- ", n.text]
|
|
97
|
-
}, i) : n.type === "added" ? /* @__PURE__ */
|
|
97
|
+
}, i) : n.type === "added" ? /* @__PURE__ */ d("div", {
|
|
98
98
|
"data-hunk": a ?? void 0,
|
|
99
99
|
className: r("px-3", {
|
|
100
100
|
"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300": o,
|
|
101
101
|
"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400": !o
|
|
102
102
|
}),
|
|
103
103
|
children: ["+ ", n.text]
|
|
104
|
-
}, i) : /* @__PURE__ */
|
|
104
|
+
}, i) : /* @__PURE__ */ d("div", {
|
|
105
105
|
className: "px-3 text-zinc-400 dark:text-zinc-600",
|
|
106
106
|
children: [" ", n.text]
|
|
107
107
|
}, i);
|
|
@@ -110,4 +110,4 @@ var d = ({ path: d, prev: f, next: p, contextLines: m = 10 }) => {
|
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
112
|
//#endregion
|
|
113
|
-
export {
|
|
113
|
+
export { f as default };
|
|
@@ -3,16 +3,16 @@ import t from "../../../List/index.mjs";
|
|
|
3
3
|
import n from "clsx";
|
|
4
4
|
import { use as r, useCallback as i, useMemo as a, useState as o } from "react";
|
|
5
5
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
-
import l from "@plitzi/sdk-
|
|
7
|
-
import u from "@plitzi/sdk-shared/
|
|
6
|
+
import l from "@plitzi/sdk-shared/elements/ComponentContext";
|
|
7
|
+
import u from "@plitzi/sdk-shared/plugins/PluginsContext";
|
|
8
8
|
//#region src/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.tsx
|
|
9
9
|
var d = {
|
|
10
10
|
"local-custom": "Shipped with this space",
|
|
11
11
|
remote: "Installed"
|
|
12
12
|
}, f = ({ className: f }) => {
|
|
13
|
-
let { plugins: p } = r(
|
|
13
|
+
let { plugins: p } = r(u), { components: m } = r(l), h = m.current, g = a(() => {
|
|
14
14
|
let e = /* @__PURE__ */ new Map();
|
|
15
|
-
return Object.entries(
|
|
15
|
+
return Object.entries(h).forEach(([t, n]) => {
|
|
16
16
|
let { origin: r } = n;
|
|
17
17
|
(r === "local-custom" || r === "remote") && e.set(t, {
|
|
18
18
|
type: t,
|
|
@@ -43,15 +43,15 @@ var d = {
|
|
|
43
43
|
})]
|
|
44
44
|
})
|
|
45
45
|
}));
|
|
46
|
-
}, [p,
|
|
46
|
+
}, [p, h]), [_, v] = o(), y = i((e) => v(e), []);
|
|
47
47
|
return /* @__PURE__ */ c("div", {
|
|
48
48
|
className: n("flex h-full w-full", f),
|
|
49
49
|
children: [/* @__PURE__ */ s(t, {
|
|
50
50
|
className: "w-[240px]",
|
|
51
|
-
items:
|
|
52
|
-
value:
|
|
53
|
-
onSelect:
|
|
54
|
-
}),
|
|
51
|
+
items: g,
|
|
52
|
+
value: _,
|
|
53
|
+
onSelect: y
|
|
54
|
+
}), _ ? /* @__PURE__ */ s(e, { entry: _ }) : /* @__PURE__ */ c("div", {
|
|
55
55
|
className: "flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-600",
|
|
56
56
|
children: [/* @__PURE__ */ s("i", { className: "fa-solid fa-puzzle-piece text-2xl opacity-30" }), /* @__PURE__ */ s("span", { children: "Select a plugin" })]
|
|
57
57
|
})]
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.mjs
CHANGED
|
@@ -1,110 +1,108 @@
|
|
|
1
1
|
import { COMMIT_ORIGIN_LABEL as e } from "../../helpers.mjs";
|
|
2
2
|
import t from "../CommitCause/CommitCause.mjs";
|
|
3
|
-
import n from "../
|
|
4
|
-
import r from "../
|
|
5
|
-
import i from "../
|
|
6
|
-
import a from "
|
|
7
|
-
import o from "
|
|
8
|
-
import
|
|
9
|
-
import { useCallback as c, useMemo as l } from "react";
|
|
10
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import n from "../DurationLegend/DurationLegend.mjs";
|
|
4
|
+
import r from "../SidebarShell/SidebarShell.mjs";
|
|
5
|
+
import i from "../SidebarToggle/SidebarToggle.mjs";
|
|
6
|
+
import a from "./FlameFrame.mjs";
|
|
7
|
+
import { useCallback as o, useMemo as s } from "react";
|
|
8
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
9
|
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/Flamegraph.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
10
|
+
var u = 1e-6, d = 3e-4, f = ({ commit: f, model: p, active: m, origin: h, sidebarOpen: g, onSelectElement: _, onToggleSidebar: v }) => {
|
|
11
|
+
let y = s(() => {
|
|
14
12
|
let e = /* @__PURE__ */ new Map();
|
|
15
|
-
for (let t of
|
|
13
|
+
for (let t of p.nodes) e.set(t.id, t);
|
|
16
14
|
return e;
|
|
17
|
-
}, [
|
|
18
|
-
if (!
|
|
19
|
-
let e = [], t =
|
|
15
|
+
}, [p]), b = m, x = b ? b.x : 0, S = b ? b.width : 1, C = b ? b.depth : 0, w = s(() => {
|
|
16
|
+
if (!b) return [];
|
|
17
|
+
let e = [], t = b.parentId;
|
|
20
18
|
for (; t !== void 0;) {
|
|
21
|
-
let n =
|
|
19
|
+
let n = y.get(t);
|
|
22
20
|
if (!n) break;
|
|
23
21
|
e.push(n), t = n.parentId;
|
|
24
22
|
}
|
|
25
23
|
return e.reverse();
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
]),
|
|
36
|
-
return /* @__PURE__ */
|
|
24
|
+
}, [b, y]), T = s(() => p.nodes.filter((e) => e.depth >= C && e.x >= x - u && e.x + e.width <= x + S + u), [
|
|
25
|
+
p,
|
|
26
|
+
x,
|
|
27
|
+
S,
|
|
28
|
+
C
|
|
29
|
+
]), E = s(() => T.filter((e) => e.width / S >= d || e.id === m?.id), [
|
|
30
|
+
T,
|
|
31
|
+
S,
|
|
32
|
+
m
|
|
33
|
+
]), D = T.length - E.length, O = s(() => E.reduce((e, t) => Math.max(e, t.depth), C), [E, C]), k = o((e) => _(e.id === m?.id ? void 0 : e.id), [m, _]);
|
|
34
|
+
return /* @__PURE__ */ l("div", {
|
|
37
35
|
className: "flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
38
36
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ l("div", {
|
|
40
38
|
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",
|
|
41
39
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ l("span", {
|
|
43
41
|
className: "font-medium text-zinc-700 dark:text-zinc-200",
|
|
44
|
-
children: ["Commit #",
|
|
42
|
+
children: ["Commit #", f.commitId]
|
|
45
43
|
}),
|
|
46
|
-
|
|
44
|
+
h !== "update" && /* @__PURE__ */ c("span", {
|
|
47
45
|
className: "rounded bg-violet-100 px-1 text-[9px] font-medium text-violet-700 uppercase dark:bg-violet-500/20 dark:text-violet-300",
|
|
48
|
-
children: e[
|
|
46
|
+
children: e[h]
|
|
49
47
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ c("span", {
|
|
51
49
|
className: "opacity-60",
|
|
52
50
|
children: "click a frame to zoom · click the focused frame to zoom out"
|
|
53
51
|
}),
|
|
54
|
-
|
|
52
|
+
D > 0 && /* @__PURE__ */ l("span", {
|
|
55
53
|
className: "opacity-60",
|
|
56
54
|
title: "Frames too narrow to draw at this zoom level — zoom in to see them",
|
|
57
55
|
children: [
|
|
58
56
|
"· ",
|
|
59
|
-
|
|
57
|
+
D,
|
|
60
58
|
" too narrow to draw"
|
|
61
59
|
]
|
|
62
60
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
commit:
|
|
65
|
-
model:
|
|
66
|
-
active:
|
|
67
|
-
onSelectElement:
|
|
61
|
+
/* @__PURE__ */ c(t, {
|
|
62
|
+
commit: f,
|
|
63
|
+
model: p,
|
|
64
|
+
active: m,
|
|
65
|
+
onSelectElement: _
|
|
68
66
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ c(i, {
|
|
70
68
|
className: "ml-auto",
|
|
71
|
-
open:
|
|
72
|
-
onToggle:
|
|
69
|
+
open: g,
|
|
70
|
+
onToggle: v
|
|
73
71
|
})
|
|
74
72
|
]
|
|
75
73
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ l("div", {
|
|
77
75
|
className: "flex min-h-0 flex-1 overflow-hidden",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
76
|
+
children: [/* @__PURE__ */ c("div", {
|
|
79
77
|
className: "min-h-0 flex-1 overflow-auto p-1",
|
|
80
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ l("div", {
|
|
81
79
|
className: "relative w-full",
|
|
82
|
-
style: { height: (
|
|
83
|
-
children: [
|
|
80
|
+
style: { height: (O + 1) * 18 },
|
|
81
|
+
children: [w.map((e) => /* @__PURE__ */ c(a, {
|
|
84
82
|
node: e,
|
|
85
83
|
left: 0,
|
|
86
84
|
width: 100,
|
|
87
85
|
top: e.depth * 18,
|
|
88
|
-
selected: e.id ===
|
|
89
|
-
onClick:
|
|
90
|
-
}, e.id)),
|
|
86
|
+
selected: e.id === m?.id,
|
|
87
|
+
onClick: k
|
|
88
|
+
}, e.id)), E.map((e) => /* @__PURE__ */ c(a, {
|
|
91
89
|
node: e,
|
|
92
|
-
left: (e.x -
|
|
93
|
-
width: e.width /
|
|
90
|
+
left: (e.x - x) / S * 100,
|
|
91
|
+
width: e.width / S * 100,
|
|
94
92
|
top: e.depth * 18,
|
|
95
|
-
selected: e.id ===
|
|
96
|
-
onClick:
|
|
93
|
+
selected: e.id === m?.id,
|
|
94
|
+
onClick: k
|
|
97
95
|
}, e.id))]
|
|
98
96
|
})
|
|
99
|
-
}),
|
|
100
|
-
|
|
101
|
-
commit:
|
|
102
|
-
model:
|
|
103
|
-
})
|
|
97
|
+
}), g && /* @__PURE__ */ c(r, {
|
|
98
|
+
active: m,
|
|
99
|
+
commit: f,
|
|
100
|
+
model: p
|
|
101
|
+
})]
|
|
104
102
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ c(n, {})
|
|
106
104
|
]
|
|
107
105
|
});
|
|
108
106
|
};
|
|
109
107
|
//#endregion
|
|
110
|
-
export {
|
|
108
|
+
export { f as default };
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.mjs
CHANGED
|
@@ -1,157 +1,155 @@
|
|
|
1
1
|
import { COMMIT_ORIGIN_LABEL as e, durationColor as t, formatMs as n, formatPercent as r, rowDuration as i } from "../../helpers.mjs";
|
|
2
2
|
import a from "../CommitCause/CommitCause.mjs";
|
|
3
|
-
import o from "../
|
|
4
|
-
import s from "../
|
|
5
|
-
import c from "../
|
|
6
|
-
import l from "../
|
|
7
|
-
import u from "
|
|
8
|
-
import d from "
|
|
9
|
-
import f from "
|
|
10
|
-
import
|
|
11
|
-
import { useCallback as m, useEffect as h, useMemo as g, useRef as _ } from "react";
|
|
12
|
-
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import o from "../DurationLegend/DurationLegend.mjs";
|
|
4
|
+
import s from "../SidebarShell/SidebarShell.mjs";
|
|
5
|
+
import c from "../SidebarToggle/SidebarToggle.mjs";
|
|
6
|
+
import l from "../MetricToggle/MetricToggle.mjs";
|
|
7
|
+
import u from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
8
|
+
import d from "clsx";
|
|
9
|
+
import { useCallback as f, useEffect as p, useMemo as m, useRef as h } from "react";
|
|
10
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
13
11
|
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/RankedList.tsx
|
|
14
|
-
var
|
|
15
|
-
let [
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
if (e.key !== "ArrowUp" && e.key !== "ArrowDown" ||
|
|
12
|
+
var v = ({ commit: v, model: y, active: b, origin: x, sidebarOpen: S, onSelectElement: C, onToggleSidebar: w }) => {
|
|
13
|
+
let [T, E] = u("plitzi-sdk.dev-tools.tracing.metric", "self"), D = h(null), O = m(() => y.nodes.filter((e) => e.state === "rendered").sort((e, t) => i(t, T) - i(e, T)), [y, T]), k = m(() => O.reduce((e, t) => Math.max(e, i(t, T)), 0) || 1, [O, T]), A = m(() => O.findIndex((e) => e.id === b?.id), [O, b]);
|
|
14
|
+
p(() => D.current?.scrollIntoView({ block: "nearest" }), [b]);
|
|
15
|
+
let j = f((e) => {
|
|
16
|
+
if (e.key !== "ArrowUp" && e.key !== "ArrowDown" || O.length === 0) return;
|
|
19
17
|
e.preventDefault();
|
|
20
|
-
let t =
|
|
21
|
-
|
|
18
|
+
let t = A === -1 ? 0 : A, n = Math.max(0, Math.min(O.length - 1, t + (e.key === "ArrowUp" ? -1 : 1)));
|
|
19
|
+
C(O[n].id);
|
|
22
20
|
}, [
|
|
21
|
+
O,
|
|
23
22
|
A,
|
|
24
|
-
|
|
25
|
-
T
|
|
23
|
+
C
|
|
26
24
|
]);
|
|
27
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ _("div", {
|
|
28
26
|
className: "flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
29
27
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ _("div", {
|
|
31
29
|
className: "flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1 border-b border-zinc-200 px-2 py-1.5 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",
|
|
32
30
|
children: [
|
|
33
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ _("span", {
|
|
34
32
|
className: "font-medium text-zinc-700 dark:text-zinc-200",
|
|
35
|
-
children: ["Commit #",
|
|
33
|
+
children: ["Commit #", v.commitId]
|
|
36
34
|
}),
|
|
37
|
-
|
|
35
|
+
x !== "update" && /* @__PURE__ */ g("span", {
|
|
38
36
|
className: "rounded bg-violet-100 px-1 text-[9px] font-medium text-violet-700 uppercase dark:bg-violet-500/20 dark:text-violet-300",
|
|
39
|
-
children: e[
|
|
37
|
+
children: e[x]
|
|
40
38
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ _("span", { children: [n(v.duration), " total"] }),
|
|
40
|
+
/* @__PURE__ */ _("span", {
|
|
43
41
|
title: "Elements that re-rendered, of all in this commit's subtree",
|
|
44
42
|
children: [
|
|
45
43
|
"· ",
|
|
46
|
-
|
|
44
|
+
y.renderedCount,
|
|
47
45
|
" of ",
|
|
48
|
-
|
|
46
|
+
v.elementCount,
|
|
49
47
|
" rendered"
|
|
50
48
|
]
|
|
51
49
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
commit:
|
|
54
|
-
model:
|
|
55
|
-
active:
|
|
56
|
-
onSelectElement:
|
|
50
|
+
/* @__PURE__ */ g(a, {
|
|
51
|
+
commit: v,
|
|
52
|
+
model: y,
|
|
53
|
+
active: b,
|
|
54
|
+
onSelectElement: C
|
|
57
55
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ g(l, {
|
|
59
57
|
className: "ml-auto",
|
|
60
|
-
metric:
|
|
61
|
-
onChange:
|
|
58
|
+
metric: T,
|
|
59
|
+
onChange: E
|
|
62
60
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
open:
|
|
65
|
-
onToggle:
|
|
61
|
+
/* @__PURE__ */ g(c, {
|
|
62
|
+
open: S,
|
|
63
|
+
onToggle: w
|
|
66
64
|
})
|
|
67
65
|
]
|
|
68
66
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ _("div", {
|
|
70
68
|
className: "flex min-h-0 flex-1 overflow-hidden",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ _("div", {
|
|
72
70
|
role: "listbox",
|
|
73
71
|
"aria-label": "Rendered elements, ranked",
|
|
74
72
|
tabIndex: 0,
|
|
75
|
-
onKeyDown:
|
|
73
|
+
onKeyDown: j,
|
|
76
74
|
className: "min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-violet-400",
|
|
77
|
-
children: [
|
|
75
|
+
children: [O.length === 0 && /* @__PURE__ */ g("div", {
|
|
78
76
|
className: "px-2 py-3 text-center text-[10px] text-zinc-400 dark:text-zinc-500",
|
|
79
77
|
children: "No element re-rendered in this commit"
|
|
80
|
-
}),
|
|
81
|
-
let a = i(e,
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
ref: o ?
|
|
78
|
+
}), O.map((e) => {
|
|
79
|
+
let a = i(e, T), o = e.id === b?.id, s = y.totalSelf > 0 ? e.selfDuration / y.totalSelf : 0, c = e.phase !== "mount", l = c && (e.changedProps === void 0 || e.changedProps.length === 0 && e.trigger), u = c && e.changedProps?.length === 0 && !e.trigger, f = !!e.changedProps?.length && e.changedProps.every((e) => e.ref), p = e.changedProps?.map((e) => e.key).join(", "), m = p || (l ? "internal state / hook" : e.type);
|
|
80
|
+
return /* @__PURE__ */ _("button", {
|
|
81
|
+
ref: o ? D : void 0,
|
|
84
82
|
role: "option",
|
|
85
83
|
"aria-selected": o,
|
|
86
|
-
onClick: () =>
|
|
87
|
-
title: `${e.name} (${e.type})\n${n(e.selfDuration)} self · ${n(e.actualDuration)} total · ${n(e.baseDuration)} base\nphase: ${e.phase ?? "update"} · ${r(s)} of render work${u ? "\nno input changed — re-rendered by an ancestor" : l ? "\nno input changed — internal state/hook/context" :
|
|
88
|
-
className:
|
|
84
|
+
onClick: () => C(e.id === b?.id ? void 0 : e.id),
|
|
85
|
+
title: `${e.name} (${e.type})\n${n(e.selfDuration)} self · ${n(e.actualDuration)} total · ${n(e.baseDuration)} base\nphase: ${e.phase ?? "update"} · ${r(s)} of render work${u ? "\nno input changed — re-rendered by an ancestor" : l ? "\nno input changed — internal state/hook/context" : f ? `\nreference-only change (missing memo): ${p}` : p ? `\nchanged: ${p}` : ""}`,
|
|
86
|
+
className: d("flex w-full items-center gap-2 px-2 py-0.5 text-left", {
|
|
89
87
|
"bg-violet-500/10": o,
|
|
90
88
|
"hover:bg-zinc-50 dark:hover:bg-zinc-800/50": !o
|
|
91
89
|
}),
|
|
92
90
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ _("span", {
|
|
94
92
|
className: "flex w-40 shrink-0 flex-col",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ _("span", {
|
|
96
94
|
className: "flex items-center gap-1 text-zinc-700 dark:text-zinc-200",
|
|
97
95
|
children: [
|
|
98
|
-
e.trigger && /* @__PURE__ */
|
|
96
|
+
e.trigger && /* @__PURE__ */ g("i", {
|
|
99
97
|
className: "fa-solid fa-bolt shrink-0 text-[9px] text-violet-500",
|
|
100
98
|
title: "Trigger — a root cause of this commit"
|
|
101
99
|
}),
|
|
102
|
-
(u ||
|
|
100
|
+
(u || f) && /* @__PURE__ */ g("i", {
|
|
103
101
|
className: "fa-solid fa-triangle-exclamation shrink-0 text-[9px] text-amber-500",
|
|
104
102
|
title: u ? "Re-rendered without any input change — possible unnecessary re-render" : "Only reference-changed props (shallow-equal content) — likely a missing memo"
|
|
105
103
|
}),
|
|
106
|
-
!e.visible && /* @__PURE__ */
|
|
104
|
+
!e.visible && /* @__PURE__ */ g("i", {
|
|
107
105
|
className: "fa-solid fa-eye-slash shrink-0 text-[9px] text-amber-500",
|
|
108
106
|
title: "Hidden (visibility)"
|
|
109
107
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ g("span", {
|
|
111
109
|
className: "truncate",
|
|
112
110
|
children: e.name
|
|
113
111
|
})
|
|
114
112
|
]
|
|
115
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ g("span", {
|
|
116
114
|
className: "truncate text-[9px] text-zinc-400 dark:text-zinc-500",
|
|
117
115
|
children: m
|
|
118
116
|
})]
|
|
119
117
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
className:
|
|
118
|
+
/* @__PURE__ */ g("span", {
|
|
119
|
+
className: d("rounded px-1 text-[9px] uppercase", {
|
|
122
120
|
"bg-sky-500/15 text-sky-600 dark:text-sky-400": e.phase === "mount",
|
|
123
121
|
"bg-amber-500/15 text-amber-600 dark:text-amber-400": e.phase !== "mount"
|
|
124
122
|
}),
|
|
125
123
|
children: e.phase === "mount" ? "mount" : "update"
|
|
126
124
|
}),
|
|
127
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ g("div", {
|
|
128
126
|
className: "h-2 flex-1 overflow-hidden rounded-sm bg-zinc-100 dark:bg-zinc-800",
|
|
129
|
-
children: /* @__PURE__ */
|
|
130
|
-
style: { width: `${Math.max(2, Math.round(a /
|
|
131
|
-
className:
|
|
127
|
+
children: /* @__PURE__ */ g("div", {
|
|
128
|
+
style: { width: `${Math.max(2, Math.round(a / k * 100))}%` },
|
|
129
|
+
className: d("h-full rounded-sm", t(a))
|
|
132
130
|
})
|
|
133
131
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ g("span", {
|
|
135
133
|
className: "w-10 shrink-0 text-right text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",
|
|
136
134
|
title: "Share of this commit's total render work",
|
|
137
135
|
children: r(s)
|
|
138
136
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ g("span", {
|
|
140
138
|
className: "w-12 shrink-0 text-right text-zinc-500 tabular-nums dark:text-zinc-400",
|
|
141
139
|
children: n(a)
|
|
142
140
|
})
|
|
143
141
|
]
|
|
144
142
|
}, e.id);
|
|
145
143
|
})]
|
|
146
|
-
}),
|
|
147
|
-
|
|
148
|
-
commit:
|
|
149
|
-
model:
|
|
150
|
-
})
|
|
144
|
+
}), S && /* @__PURE__ */ g(s, {
|
|
145
|
+
active: b,
|
|
146
|
+
commit: v,
|
|
147
|
+
model: y
|
|
148
|
+
})]
|
|
151
149
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ g(o, {})
|
|
153
151
|
]
|
|
154
152
|
});
|
|
155
153
|
};
|
|
156
154
|
//#endregion
|
|
157
|
-
export {
|
|
155
|
+
export { v as default };
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlameModel, FlameNode } from '../../helpers';
|
|
2
|
+
import { CommitEntry } from '@plitzi/sdk-shared';
|
|
2
3
|
export type SidebarShellProps = {
|
|
3
|
-
|
|
4
|
+
/** The element picked in the view, if any: without one, the hint to pick one. */
|
|
5
|
+
active?: FlameNode;
|
|
6
|
+
commit: CommitEntry;
|
|
7
|
+
model: FlameModel;
|
|
4
8
|
};
|
|
5
|
-
declare const SidebarShell: ({
|
|
9
|
+
declare const SidebarShell: ({ active, commit, model }: SidebarShellProps) => import('react').JSX.Element;
|
|
6
10
|
export default SidebarShell;
|
package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.mjs
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import r from "
|
|
1
|
+
import e from "../../../../../ResizableSidebar/index.mjs";
|
|
2
|
+
import t from "../DetailSidebar/DetailSidebar.mjs";
|
|
3
|
+
import n from "./SidebarEmpty.mjs";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/SidebarShell.tsx
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
maxConstraintsX: a,
|
|
18
|
-
onChange: u,
|
|
19
|
-
children: /* @__PURE__ */ n("aside", {
|
|
20
|
-
className: "flex h-full w-full flex-col gap-1.5 overflow-auto bg-zinc-50 px-3 py-2 text-[10px] dark:bg-zinc-900/50",
|
|
21
|
-
children: s
|
|
22
|
-
})
|
|
23
|
-
});
|
|
24
|
-
};
|
|
6
|
+
var a = ({ active: a, commit: o, model: s }) => /* @__PURE__ */ i(e, {
|
|
7
|
+
storageKey: "plitzi-sdk.dev-tools.tracing.sidebar-width",
|
|
8
|
+
minWidth: 180,
|
|
9
|
+
maxWidth: 480,
|
|
10
|
+
defaultWidth: 224,
|
|
11
|
+
children: [a && /* @__PURE__ */ r(t, {
|
|
12
|
+
node: a,
|
|
13
|
+
commit: o,
|
|
14
|
+
model: s
|
|
15
|
+
}), !a && /* @__PURE__ */ r(n, {})]
|
|
16
|
+
});
|
|
25
17
|
//#endregion
|
|
26
|
-
export {
|
|
18
|
+
export { a as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ResizableSidebarProps = {
|
|
3
|
+
/** Where its width is remembered, across sessions and the panel opening and closing. */
|
|
4
|
+
storageKey: string;
|
|
5
|
+
minWidth: number;
|
|
6
|
+
maxWidth: number;
|
|
7
|
+
defaultWidth: number;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** A column at a tab's right edge, resized from its left border. */
|
|
11
|
+
declare const ResizableSidebar: ({ storageKey, minWidth, maxWidth, defaultWidth, children }: ResizableSidebarProps) => import('react').JSX.Element;
|
|
12
|
+
export default ResizableSidebar;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import e from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import r from "@plitzi/plitzi-ui/ContainerResizable";
|
|
5
|
+
//#region src/components/ResizableSidebar/ResizableSidebar.tsx
|
|
6
|
+
var i = ({ storageKey: i, minWidth: a, maxWidth: o, defaultWidth: s, children: c }) => {
|
|
7
|
+
let [l, u] = e(i, s), d = t((e) => {
|
|
8
|
+
Number.isFinite(e) && u(e);
|
|
9
|
+
}, [u]);
|
|
10
|
+
return /* @__PURE__ */ n(r, {
|
|
11
|
+
className: "shrink-0 border-l border-zinc-200 dark:border-zinc-800",
|
|
12
|
+
resizeHandles: ["w"],
|
|
13
|
+
axis: "x",
|
|
14
|
+
autoGrow: !1,
|
|
15
|
+
width: l,
|
|
16
|
+
minConstraintsX: a,
|
|
17
|
+
maxConstraintsX: o,
|
|
18
|
+
onChange: d,
|
|
19
|
+
children: /* @__PURE__ */ n("aside", {
|
|
20
|
+
className: "flex h-full w-full flex-col gap-1.5 overflow-auto bg-zinc-50 px-3 py-2 text-[10px] dark:bg-zinc-900/50",
|
|
21
|
+
children: c
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { i as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-dev-tools",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.12",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -978,6 +978,18 @@
|
|
|
978
978
|
"types": "./dist/components/PayloadView/index.d.ts",
|
|
979
979
|
"import": "./dist/components/PayloadView/index.mjs"
|
|
980
980
|
},
|
|
981
|
+
"./components/ResizableSidebar": {
|
|
982
|
+
"types": "./dist/components/ResizableSidebar/index.d.ts",
|
|
983
|
+
"import": "./dist/components/ResizableSidebar/index.mjs"
|
|
984
|
+
},
|
|
985
|
+
"./components/ResizableSidebar/ResizableSidebar": {
|
|
986
|
+
"types": "./dist/components/ResizableSidebar/ResizableSidebar.d.ts",
|
|
987
|
+
"import": "./dist/components/ResizableSidebar/ResizableSidebar.mjs"
|
|
988
|
+
},
|
|
989
|
+
"./components/ResizableSidebar/index": {
|
|
990
|
+
"types": "./dist/components/ResizableSidebar/index.d.ts",
|
|
991
|
+
"import": "./dist/components/ResizableSidebar/index.mjs"
|
|
992
|
+
},
|
|
981
993
|
"./freshness": {
|
|
982
994
|
"types": "./dist/freshness/index.d.ts",
|
|
983
995
|
"import": "./dist/freshness/index.mjs"
|
|
@@ -1211,9 +1223,9 @@
|
|
|
1211
1223
|
"dependencies": {
|
|
1212
1224
|
"@plitzi/nexus": "^1.4.0",
|
|
1213
1225
|
"@plitzi/plitzi-ui": "^1.6.33",
|
|
1214
|
-
"@plitzi/sdk-plugins": "0.38.
|
|
1215
|
-
"@plitzi/sdk-schema": "0.38.
|
|
1216
|
-
"@plitzi/sdk-shared": "0.38.
|
|
1226
|
+
"@plitzi/sdk-plugins": "0.38.12",
|
|
1227
|
+
"@plitzi/sdk-schema": "0.38.12",
|
|
1228
|
+
"@plitzi/sdk-shared": "0.38.12",
|
|
1217
1229
|
"@uiw/react-json-view": "^2.0.0-alpha.43",
|
|
1218
1230
|
"clsx": "^2.1.1"
|
|
1219
1231
|
}
|