@plitzi/sdk-dev-tools 0.38.11 → 0.38.13

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 CHANGED
@@ -1,5 +1,124 @@
1
1
  # @plitzi/sdk-dev-tools
2
2
 
3
+ ## 0.38.13
4
+
5
+ ### Patch Changes
6
+
7
+ - v0.38.13
8
+ - Updated dependencies
9
+ - @plitzi/sdk-plugins@0.38.13
10
+ - @plitzi/sdk-schema@0.38.13
11
+ - @plitzi/sdk-shared@0.38.13
12
+
13
+ ## 0.38.12
14
+
15
+ ### Patch Changes
16
+
17
+ - 1301338: ## Builder
18
+
19
+ - **Icons in the canvas again** (`@plitzi/plitzi-builder`): the canvas inlined the SDK's Font Awesome sheet into its
20
+ `<style>`, where the sheet's `url(webfonts/…)` resolved against the editor's URL — a `srcdoc` frame takes it as its
21
+ base — so every icon was a 404 under `/spaces/<space>/webfonts/` and drew as an empty box. Only the Vite dev server,
22
+ which rewrites the URL, hid it. The canvas and the element preview now link the sheet from where the host serves it:
23
+ a new prop, `sdkIconsStylePath`, the one the host already gives the pages it renders
24
+ (`/sdk-assets/plitzi-sdk-icons.css` for sdk-server). Absent, the canvas links no icon sheet.
25
+
26
+ ## Plugins
27
+ - **A plugin's other elements, hosted by `custom`** (`@plitzi/sdk-elements`): `custom({ renderType: 'jamDisc' })` on a
28
+ space with a plugin installed whose main element is another (`plitzi plugin pack` of several folders: the first is the
29
+ plugin, the rest go in it) rendered "Custom Component jamDisc Not Found" — the page registers only the plugin's main
30
+ element, and a `custom` host looked nowhere else. It now loads the type from the installed plugin that packs it, as
31
+ an element of the type itself always did, so the two ways the docs give to place a plugin's element are the same
32
+ everywhere: in a project `plitzi create` wrote, and once the project is on Plitzi.
33
+ - **One way to place a plugin's element** (`@plitzi/sdk-authoring`, `@plitzi/cli`, docs): from its declaration,
34
+ `const seatPicker = defineElement(declaration)` then `seatPicker({ id, … })` — typed by what it
35
+ declares, and the element the builder adds when somebody drops it. The welcome space `plitzi create` writes, the
36
+ plugin package's preview, `plitzi plugin add` and `plitzi explain` all write it so (the template's
37
+ `PluginHostOptions` now takes the plugin's `type` and `declaration: { from, attributes? }`; `custom`/`element` hosting
38
+ is gone). `pluginFolders(folder)` (`@plitzi/sdk-authoring/node`) reads each plugin with the folder it is in;
39
+ `pluginDeclarations` is built on it. A `custom({ renderType })` naming a plugin the space was handed the declaration
40
+ of is offered the declaration instead — suggestion `plugin-custom-host`. `custom` stays for a component registered
41
+ by name with no declaration. The skills, the CLI README, the MCP guide, `docs/en` and the website say the same.
42
+ - **`definePlugin`** (`@plitzi/sdk-authoring/plugin`, a new entry of 3 KB with nothing else in it): a plugin's
43
+ declaration written from what only it can say —
44
+ `definePlugin<SeatPickerAttributes>()({ type, label, attributes, triggers, callbacks })` — and every other field
45
+ at the default all plugins share (the builder's gestures, the catalogue entry, each attribute bindable, an empty
46
+ style). It answers the whole declaration, branded with its attributes, so `defineElement(declaration)` is typed
47
+ without a generic. `plitzi plugin add` and `create --plugin` write declarations with it (about a third of the lines).
48
+ - **`usePluginTrigger(declaration)`** (`@plitzi/plitzi-sdk`): fires a plugin's declared event on its element — the
49
+ event name and what each hands a flow typed off the declaration's `preview` — on a live page only. The hook every
50
+ plugin wrote for itself (and `plugin add` generated as `use<Name>Events`) is gone from the scaffold.
51
+ - **Attributes as the types their defaults are** (`@plitzi/sdk-elements`): a plugin's attribute bound from text — a
52
+ state, a row, a channel message — reaches its component as the number or the flag its declared default is (`'112'`
53
+ as 112, `'true'` as true). A plugin no longer types its props `number | string` and parses them.
54
+
55
+ ## Server actions and functions
56
+ - **Task params with rules** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`): a task declares `required`, a text's
57
+ `maxLength` and a number's `min`/`max`, and the runner refuses a call that breaks any of them — every rule broken at
58
+ once, in the words the page shows (`Title is required; Seconds is at most 300`) — before the code runs. A `text` param
59
+ bound to a number arrives as its digits. The manifest keeps the rules, so the platform's sandbox checks the same.
60
+ - **`taskAction(task, { trigger })`** (`@plitzi/sdk-authoring`): the action that runs one of the space's tasks and
61
+ answers its result, derived from the task — its id (`<namespace>-<action>`), name, description and input (the task's
62
+ params, once). An action of more than one step is still `defineAction`.
63
+ - **`ctx.rateLimit(bucket, { …, refuse })`**: past the limit the call is refused with those words instead of answering
64
+ `allowed: false` for the code to check — natively and in the sandbox.
65
+
66
+ ## Authoring
67
+ - **`runServerActionOrNotify(id, params, fallback)`**: a server action run and the notice the visitor reads when it
68
+ fails — the action's own refusal, or the fallback — as two steps to spread into a flow.
69
+ - **`repeated-shape` reads what copies bind**: copies whose bindings read their data in different forms (a count, a
70
+ total of a quota) and copies holding a provider resolved on the server (found by its own id) are no longer offered
71
+ as one component.
72
+ - **`element-color-inherited`** (suggestion): `elements` giving a heading, a text, a link… `color: inherit` or the
73
+ page's own colour. **A link inherits the page's colour** (`@plitzi/plitzi-sdk`, `@plitzi/sdk-elements`) rather than
74
+ holding the SDK's grey — the same by default, and the space's palette inside a card that is a link. The template
75
+ every space starts from writes its colours once, on the page.
76
+
77
+ ## Fixes
78
+ - **A dialog opened with an id** (`@plitzi/sdk-elements`): `openDialog('dialog', '{{ row.id }}')` reads the id as its
79
+ `content`, as `openModal` already did — a numeric id parsed as the number and the dialog's bindings read nothing.
80
+ - **A select's chevron** (`@plitzi/plitzi-sdk`): a drawn chevron in the field's own colour, sized by its type, in place
81
+ of the `▼` glyph — and laid out in the box, so it ends where the box's padding begins whatever that padding is, and
82
+ the chosen option stops short of it instead of running under it. A disabled select's is faded.
83
+ - **Every element has its settings** (`@plitzi/plitzi-builder`, `@plitzi/sdk-elements`): the builder found none for
84
+ `tabContainerHeader` (registered under a misspelt type), `themeToggle`, `dropdownPopup`, `loading` and `notFound`.
85
+ The theme toggle's panel sets its mode, its labels and whether it offers "System"; the registry is typed by element
86
+ type and must hold one for each.
87
+ - **A plugin's panel** (`@plitzi/cli`): `plitzi doctor` warns of a plugin with no `Settings.tsx`, or one its entry never
88
+ passes as `pluginSettings` (`plugin-settings-missing`); the example `create` writes has its panel, as every element
89
+ `plugin add` writes does, and the panels it generates are laid out as the project's Prettier lays them out.
90
+ - **A refused or failed run reaches `onFlowError` in every mode** (`@plitzi/sdk-interactions`): an awaited server
91
+ action the server refused fired no `onFlowError` on the element that started it, as `detached` and `stream` ones do
92
+ — a board rolling its edits back on a refusal never did; and a run answered `status: 'failed'` fired `onFlowEnd`
93
+ (detached) or nothing (awaited) rather than `onFlowError`.
94
+ - **A source renamed** (`@plitzi/sdk-shared`): the binding picker lists a provider, a form or a modal by the name its
95
+ element has now, not the one it had when it mounted.
96
+ - **A text's words in the builder** (`@plitzi/sdk-elements`): a `paragraph`, `text` or `heading` whose `content` is
97
+ `0` shows `0` while editing too, not its placeholder; one bound to nothing shows nothing rather than `null`.
98
+ - **Built-in declarations** (`@plitzi/sdk-shared`): `elementDeclaration` fills in what every element shares — the
99
+ builder's gestures, Plitzi's catalogue entry, a visible element with no bindings, its style named by its label —
100
+ from the defaults `definePlugin` uses; each element's declaration says only what is its own (a third of the lines).
101
+
102
+ ## Typed for plugins and hosts
103
+ - **`usePlitzi()` and `PlitziProvider`** (`@plitzi/sdk-shared/hooks/usePlitzi`, `@plitzi/plitzi-sdk`): what were
104
+ `usePlitziServiceContext()` and `PlitziServiceProvider` (and `PlitziServiceContextValue`, now `PlitziContextValue`),
105
+ holding only what the host rendering a space knows — `settings`, `root`, `utils`. Its `contexts` and
106
+ `customContexts` are gone: every context it carried is a shared one already, imported from its own module
107
+ (`@plitzi/sdk-interactions/InteractionsContext`, `@plitzi/sdk-shared/network/NetworkContext`…), and
108
+ `PluginsContext` moves to `@plitzi/sdk-shared/plugins/PluginsContext` beside the others.
109
+ - **`InteractionsManagerApi`** (`@plitzi/sdk-shared`): the interactions manager as everything outside
110
+ `@plitzi/sdk-interactions` reaches it, declared where every package can name it and implemented by
111
+ `InteractionsManager`, so `use(InteractionsContext)` is typed — `interactionTrigger`, `createChildManager`… — where it
112
+ was `any`.
113
+ - **`getPathsFromObject`** (`@plitzi/sdk-shared/helpers/utils`), spelt right; `getPathsFromObeject` is gone.
114
+ - **`ElementWords` places itself** (`@plitzi/sdk-elements`): `contentPlacement` and the element's children, so a button
115
+ and a link write their words once.
116
+
117
+ - Updated dependencies [1301338]
118
+ - @plitzi/sdk-plugins@0.38.12
119
+ - @plitzi/sdk-schema@0.38.12
120
+ - @plitzi/sdk-shared@0.38.12
121
+
3
122
  ## 0.38.11
4
123
 
5
124
  ### 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: A = "", devToolsStyleLink: j = "", devToolsIconsLink: M = "" }) => {
18
- let { resolvedTheme: N } = _(), [P, F] = c("plitzi-sdk.dev-tools.orientation", x), [I, L] = c("plitzi-sdk.dev-tools.collapsed", !0), [R, z] = c("plitzi-sdk.dev-tools.tab", "logs"), [B, V] = m(), H = p(void 0), U = p(null);
19
- H.current ||= `sdk-instance-${++S}`;
20
- let W = E || H.current, G = i(), K = G ? P : x, q = r(W, T);
21
- o(T), a(q, W), e(q);
22
- let J = f((e) => F(e), [F]), Y = f((e) => {
23
- e && z("logs"), V(e), L(!1);
24
- }, [L, z]), X = f(() => L(!0), [L]), Z = f((e) => {
25
- V(void 0), z(e);
26
- }, [z]);
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 Q = O === "document" && (!G || I), $ = q && G && /* @__PURE__ */ v(n, { children: /* @__PURE__ */ v(t, { children: /* @__PURE__ */ y(u, {
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(b, {
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
- /* @__PURE__ */ y(s.Content, { children: [/* @__PURE__ */ v("style", { dangerouslySetInnerHTML: { __html: A } }), /* @__PURE__ */ v(b, {
49
- className: l({ dark: N === "dark" }),
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": !Q,
67
- "flex-col": Q || K === "horizontal",
68
- "h-screen": !Q && K === "vertical"
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: W,
59
+ value: U,
72
60
  children: /* @__PURE__ */ v("div", {
73
- ref: U,
74
- className: l("grow", { "basis-0 flex-col overflow-auto": !Q }, w),
61
+ ref: H,
62
+ className: l("grow", { "basis-0 flex-col overflow-auto": !Z }, w),
75
63
  children: d
76
64
  })
77
- }), Q ? /* @__PURE__ */ v("div", {
65
+ }), Z ? /* @__PURE__ */ v("div", {
78
66
  className: "sticky bottom-0 h-0",
79
67
  children: $
80
68
  }) : $]
@@ -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-plugins/PluginsContext";
7
- import l from "@plitzi/sdk-shared/elements/ComponentContext";
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(c), y = e(l), b = e(o);
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(c, {
27
+ children: /* @__PURE__ */ a(l, {
28
28
  value: v,
29
- children: /* @__PURE__ */ a(l, {
29
+ children: /* @__PURE__ */ a(c, {
30
30
  value: y,
31
31
  children: f
32
32
  })
@@ -1,26 +1,12 @@
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";
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 i = 200, a = 520, o = 280, s = ({ children: s }) => {
7
- let [c, l] = e("plitzi-sdk.dev-tools.actions.detail-width", o), u = t((e) => {
8
- Number.isFinite(e) && l(e);
9
- }, [l]);
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: 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 { s as default };
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, useMemo as o, useRef as s, useState as c } from "react";
6
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
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 d = ({ path: d, prev: f, next: p, contextLines: m = 10 }) => {
9
- let h = s(null), [g, _] = c(0), v = o(() => e(f, p), [f, p]), y = o(() => t(v), [v]), b = o(() => n(v, y, m), [
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
- m
13
- ]), x = y.length > 0, S = g === 0, C = g === y.length - 1, w = i((e) => {
14
- (h.current?.querySelector(`[data-hunk="${e}"]`))?.scrollIntoView({ block: "center" });
15
- }, []), T = i((e) => {
16
- let t = g + e;
17
- t < 0 || t >= y.length || (_(t), w(t));
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
- g,
20
- y.length,
21
- w
22
- ]);
23
- a(() => {
24
- x && (_(0), w(0));
25
- }, [v]);
26
- let E = i(() => T(-1), [T]), D = i(() => T(1), [T]);
27
- return /* @__PURE__ */ u("div", {
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__ */ u("div", {
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__ */ u("div", {
31
+ children: [/* @__PURE__ */ d("div", {
32
32
  className: "flex min-w-0 items-center gap-1.5",
33
- children: [/* @__PURE__ */ l("span", {
33
+ children: [/* @__PURE__ */ u("span", {
34
34
  className: "shrink-0 text-zinc-500 dark:text-zinc-400",
35
35
  children: "path"
36
- }), /* @__PURE__ */ l("span", {
36
+ }), /* @__PURE__ */ u("span", {
37
37
  className: "truncate text-zinc-400 dark:text-zinc-500",
38
- children: d ?? "(full state)"
38
+ children: f ?? "(full state)"
39
39
  })]
40
- }), /* @__PURE__ */ u("div", {
40
+ }), /* @__PURE__ */ d("div", {
41
41
  className: "flex shrink-0 items-center gap-2",
42
42
  children: [
43
- x && /* @__PURE__ */ u("span", {
43
+ S && /* @__PURE__ */ d("span", {
44
44
  className: "text-zinc-400 tabular-nums dark:text-zinc-600",
45
45
  children: [
46
- g + 1,
46
+ _ + 1,
47
47
  "/",
48
- y.length
48
+ b.length
49
49
  ]
50
50
  }),
51
- /* @__PURE__ */ l("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": !x || S }),
53
- disabled: !x || S,
54
- onClick: E,
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__ */ l("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": !x || C }),
59
- disabled: !x || C,
60
- onClick: D,
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__ */ u("pre", {
66
- ref: h,
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: [!x && /* @__PURE__ */ l("div", {
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
- }), b.map((e, t) => {
71
+ }), x.map((e, t) => {
72
72
  if (e.kind === "separator") {
73
- let n = e.hunkIndex === g;
74
- return /* @__PURE__ */ u("div", {
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 === g;
90
- return n.type === "removed" ? /* @__PURE__ */ u("div", {
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__ */ u("div", {
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__ */ u("div", {
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 { d as default };
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-plugins/PluginsContext";
7
- import u from "@plitzi/sdk-shared/elements/ComponentContext";
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(l), { components: m } = r(u), h = a(() => {
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(m.current).forEach(([t, n]) => {
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, m.current]), [g, _] = o(), v = i((e) => _(e), []);
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: h,
52
- value: g,
53
- onSelect: v
54
- }), g ? /* @__PURE__ */ s(e, { entry: g }) : /* @__PURE__ */ c("div", {
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
  })]
@@ -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 "../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, 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 f = 1e-6, p = 3e-4, m = ({ commit: m, model: h, active: g, origin: _, sidebarOpen: v, onSelectElement: y, onToggleSidebar: b }) => {
13
- let x = l(() => {
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 h.nodes) e.set(t.id, t);
13
+ for (let t of p.nodes) e.set(t.id, t);
16
14
  return e;
17
- }, [h]), S = g, C = S ? S.x : 0, w = S ? S.width : 1, T = S ? S.depth : 0, E = l(() => {
18
- if (!S) return [];
19
- let e = [], t = S.parentId;
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 = x.get(t);
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
- }, [S, x]), D = l(() => h.nodes.filter((e) => e.depth >= T && e.x >= C - f && e.x + e.width <= C + w + f), [
27
- h,
28
- C,
29
- w,
30
- T
31
- ]), O = l(() => D.filter((e) => e.width / w >= p || e.id === g?.id), [
32
- D,
33
- w,
34
- g
35
- ]), k = D.length - O.length, A = l(() => O.reduce((e, t) => Math.max(e, t.depth), T), [O, T]), j = c((e) => y(e.id === g?.id ? void 0 : e.id), [g, y]);
36
- return /* @__PURE__ */ d("div", {
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__ */ d("div", {
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__ */ d("span", {
40
+ /* @__PURE__ */ l("span", {
43
41
  className: "font-medium text-zinc-700 dark:text-zinc-200",
44
- children: ["Commit #", m.commitId]
42
+ children: ["Commit #", f.commitId]
45
43
  }),
46
- _ !== "update" && /* @__PURE__ */ u("span", {
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__ */ u("span", {
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
- k > 0 && /* @__PURE__ */ d("span", {
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
- k,
57
+ D,
60
58
  " too narrow to draw"
61
59
  ]
62
60
  }),
63
- /* @__PURE__ */ u(t, {
64
- commit: m,
65
- model: h,
66
- active: g,
67
- onSelectElement: y
61
+ /* @__PURE__ */ c(t, {
62
+ commit: f,
63
+ model: p,
64
+ active: m,
65
+ onSelectElement: _
68
66
  }),
69
- /* @__PURE__ */ u(o, {
67
+ /* @__PURE__ */ c(i, {
70
68
  className: "ml-auto",
71
- open: v,
72
- onToggle: b
69
+ open: g,
70
+ onToggle: v
73
71
  })
74
72
  ]
75
73
  }),
76
- /* @__PURE__ */ d("div", {
74
+ /* @__PURE__ */ l("div", {
77
75
  className: "flex min-h-0 flex-1 overflow-hidden",
78
- children: [/* @__PURE__ */ u("div", {
76
+ children: [/* @__PURE__ */ c("div", {
79
77
  className: "min-h-0 flex-1 overflow-auto p-1",
80
- children: /* @__PURE__ */ d("div", {
78
+ children: /* @__PURE__ */ l("div", {
81
79
  className: "relative w-full",
82
- style: { height: (A + 1) * 18 },
83
- children: [E.map((e) => /* @__PURE__ */ u(s, {
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 === g?.id,
89
- onClick: j
90
- }, e.id)), O.map((e) => /* @__PURE__ */ u(s, {
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 - C) / w * 100,
93
- width: e.width / w * 100,
90
+ left: (e.x - x) / S * 100,
91
+ width: e.width / S * 100,
94
92
  top: e.depth * 18,
95
- selected: e.id === g?.id,
96
- onClick: j
93
+ selected: e.id === m?.id,
94
+ onClick: k
97
95
  }, e.id))]
98
96
  })
99
- }), v && /* @__PURE__ */ u(i, { children: g ? /* @__PURE__ */ u(n, {
100
- node: g,
101
- commit: m,
102
- model: h
103
- }) : /* @__PURE__ */ u(a, {}) })]
97
+ }), g && /* @__PURE__ */ c(r, {
98
+ active: m,
99
+ commit: f,
100
+ model: p
101
+ })]
104
102
  }),
105
- /* @__PURE__ */ u(r, {})
103
+ /* @__PURE__ */ c(n, {})
106
104
  ]
107
105
  });
108
106
  };
109
107
  //#endregion
110
- export { m as default };
108
+ export { f as default };
@@ -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 "../DetailSidebar/DetailSidebar.mjs";
4
- import s from "../DurationLegend/DurationLegend.mjs";
5
- import c from "../SidebarShell/SidebarShell.mjs";
6
- import l from "../SidebarShell/SidebarEmpty.mjs";
7
- import u from "../SidebarToggle/SidebarToggle.mjs";
8
- import d from "../MetricToggle/MetricToggle.mjs";
9
- import f from "@plitzi/plitzi-ui/hooks/useStorage";
10
- import p from "clsx";
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 b = ({ commit: b, model: x, active: S, origin: C, sidebarOpen: w, onSelectElement: T, onToggleSidebar: E }) => {
15
- let [D, O] = f("plitzi-sdk.dev-tools.tracing.metric", "self"), k = _(null), A = g(() => x.nodes.filter((e) => e.state === "rendered").sort((e, t) => i(t, D) - i(e, D)), [x, D]), j = g(() => A.reduce((e, t) => Math.max(e, i(t, D)), 0) || 1, [A, D]), M = g(() => A.findIndex((e) => e.id === S?.id), [A, S]);
16
- h(() => k.current?.scrollIntoView({ block: "nearest" }), [S]);
17
- let N = m((e) => {
18
- if (e.key !== "ArrowUp" && e.key !== "ArrowDown" || A.length === 0) return;
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 = M === -1 ? 0 : M, n = Math.max(0, Math.min(A.length - 1, t + (e.key === "ArrowUp" ? -1 : 1)));
21
- T(A[n].id);
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
- M,
25
- T
23
+ C
26
24
  ]);
27
- return /* @__PURE__ */ y("div", {
25
+ return /* @__PURE__ */ _("div", {
28
26
  className: "flex min-h-0 flex-1 flex-col overflow-hidden",
29
27
  children: [
30
- /* @__PURE__ */ y("div", {
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__ */ y("span", {
31
+ /* @__PURE__ */ _("span", {
34
32
  className: "font-medium text-zinc-700 dark:text-zinc-200",
35
- children: ["Commit #", b.commitId]
33
+ children: ["Commit #", v.commitId]
36
34
  }),
37
- C !== "update" && /* @__PURE__ */ v("span", {
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[C]
37
+ children: e[x]
40
38
  }),
41
- /* @__PURE__ */ y("span", { children: [n(b.duration), " total"] }),
42
- /* @__PURE__ */ y("span", {
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
- x.renderedCount,
44
+ y.renderedCount,
47
45
  " of ",
48
- b.elementCount,
46
+ v.elementCount,
49
47
  " rendered"
50
48
  ]
51
49
  }),
52
- /* @__PURE__ */ v(a, {
53
- commit: b,
54
- model: x,
55
- active: S,
56
- onSelectElement: T
50
+ /* @__PURE__ */ g(a, {
51
+ commit: v,
52
+ model: y,
53
+ active: b,
54
+ onSelectElement: C
57
55
  }),
58
- /* @__PURE__ */ v(d, {
56
+ /* @__PURE__ */ g(l, {
59
57
  className: "ml-auto",
60
- metric: D,
61
- onChange: O
58
+ metric: T,
59
+ onChange: E
62
60
  }),
63
- /* @__PURE__ */ v(u, {
64
- open: w,
65
- onToggle: E
61
+ /* @__PURE__ */ g(c, {
62
+ open: S,
63
+ onToggle: w
66
64
  })
67
65
  ]
68
66
  }),
69
- /* @__PURE__ */ y("div", {
67
+ /* @__PURE__ */ _("div", {
70
68
  className: "flex min-h-0 flex-1 overflow-hidden",
71
- children: [/* @__PURE__ */ y("div", {
69
+ children: [/* @__PURE__ */ _("div", {
72
70
  role: "listbox",
73
71
  "aria-label": "Rendered elements, ranked",
74
72
  tabIndex: 0,
75
- onKeyDown: N,
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: [A.length === 0 && /* @__PURE__ */ v("div", {
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
- }), A.map((e) => {
81
- let a = i(e, D), o = e.id === S?.id, s = x.totalSelf > 0 ? e.selfDuration / x.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, d = !!e.changedProps?.length && e.changedProps.every((e) => e.ref), f = e.changedProps?.map((e) => e.key).join(", "), m = f || (l ? "internal state / hook" : e.type);
82
- return /* @__PURE__ */ y("button", {
83
- ref: o ? k : void 0,
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: () => T(e.id === S?.id ? void 0 : e.id),
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" : d ? `\nreference-only change (missing memo): ${f}` : f ? `\nchanged: ${f}` : ""}`,
88
- className: p("flex w-full items-center gap-2 px-2 py-0.5 text-left", {
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__ */ y("span", {
91
+ /* @__PURE__ */ _("span", {
94
92
  className: "flex w-40 shrink-0 flex-col",
95
- children: [/* @__PURE__ */ y("span", {
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__ */ v("i", {
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 || d) && /* @__PURE__ */ v("i", {
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__ */ v("i", {
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__ */ v("span", {
108
+ /* @__PURE__ */ g("span", {
111
109
  className: "truncate",
112
110
  children: e.name
113
111
  })
114
112
  ]
115
- }), /* @__PURE__ */ v("span", {
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__ */ v("span", {
121
- className: p("rounded px-1 text-[9px] uppercase", {
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__ */ v("div", {
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__ */ v("div", {
130
- style: { width: `${Math.max(2, Math.round(a / j * 100))}%` },
131
- className: p("h-full rounded-sm", t(a))
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__ */ v("span", {
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__ */ v("span", {
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
- }), w && /* @__PURE__ */ v(c, { children: S ? /* @__PURE__ */ v(o, {
147
- node: S,
148
- commit: b,
149
- model: x
150
- }) : /* @__PURE__ */ v(l, {}) })]
144
+ }), S && /* @__PURE__ */ g(s, {
145
+ active: b,
146
+ commit: v,
147
+ model: y
148
+ })]
151
149
  }),
152
- /* @__PURE__ */ v(s, {})
150
+ /* @__PURE__ */ g(o, {})
153
151
  ]
154
152
  });
155
153
  };
156
154
  //#endregion
157
- export { b as default };
155
+ export { v as default };
@@ -1,6 +1,10 @@
1
- import { ReactNode } from 'react';
1
+ import { FlameModel, FlameNode } from '../../helpers';
2
+ import { CommitEntry } from '@plitzi/sdk-shared';
2
3
  export type SidebarShellProps = {
3
- children: ReactNode;
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: ({ children }: SidebarShellProps) => import('react').JSX.Element;
9
+ declare const SidebarShell: ({ active, commit, model }: SidebarShellProps) => import('react').JSX.Element;
6
10
  export default SidebarShell;
@@ -1,26 +1,18 @@
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";
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 i = 180, a = 480, o = 224, s = ({ children: s }) => {
7
- let [c, l] = e("plitzi-sdk.dev-tools.tracing.sidebar-width", o), u = t((e) => {
8
- Number.isFinite(e) && l(e);
9
- }, [l]);
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: 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
- };
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 { s as default };
18
+ export { a as default };
@@ -1,2 +1 @@
1
1
  export { default } from './SidebarShell';
2
- export { default as SidebarEmpty } from './SidebarEmpty';
@@ -1,3 +1,2 @@
1
1
  import e from "./SidebarShell.mjs";
2
- import t from "./SidebarEmpty.mjs";
3
- export { t as SidebarEmpty, e as default };
2
+ export { e 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 };
@@ -0,0 +1,3 @@
1
+ import { default as ResizableSidebar } from './ResizableSidebar';
2
+ export * from './ResizableSidebar';
3
+ export default ResizableSidebar;
@@ -0,0 +1,5 @@
1
+ import e from "./ResizableSidebar.mjs";
2
+ //#region src/components/ResizableSidebar/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-dev-tools",
3
- "version": "0.38.11",
3
+ "version": "0.38.13",
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.11",
1215
- "@plitzi/sdk-schema": "0.38.11",
1216
- "@plitzi/sdk-shared": "0.38.11",
1226
+ "@plitzi/sdk-plugins": "0.38.13",
1227
+ "@plitzi/sdk-schema": "0.38.13",
1228
+ "@plitzi/sdk-shared": "0.38.13",
1217
1229
  "@uiw/react-json-view": "^2.0.0-alpha.43",
1218
1230
  "clsx": "^2.1.1"
1219
1231
  }