@plitzi/sdk-dev-tools 0.38.15 → 0.38.17
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 +110 -0
- package/dist/DevToolsContainer.mjs +2 -2
- package/dist/DevToolsContextProvider.mjs +6 -7
- package/dist/DevToolsRoot.mjs +14 -14
- package/dist/agentInspector/inspector.mjs +1 -1
- package/dist/agentInspector/report.mjs +1 -1
- package/dist/agentInspector/useAgentInspector.mjs +4 -4
- package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +2 -11
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +1 -1
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +1 -1
- package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +11 -11
- package/dist/components/DevToolsPanel/ThemeControl.mjs +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/components/ElementDetails/ElementDetails.mjs +1 -1
- package/dist/components/DevToolsPanel/tabs/ElementsViewer/helpers/renderTree.mjs +2 -2
- package/dist/components/DevToolsPanel/tabs/FlagsViewer/FlagSource.d.ts +1 -1
- package/dist/components/DevToolsPanel/tabs/FlagsViewer/FlagsListItem.d.ts +2 -1
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +33 -33
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +12 -12
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/InteractionNode.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeMetadata.mjs +7 -7
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +15 -15
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +26 -26
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationHeader.mjs +7 -7
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreHeader.mjs +8 -8
- package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.mjs +21 -21
- package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.mjs +2 -2
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.mjs +1 -1
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaRuleItem.mjs +10 -10
- package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +17 -17
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitCause/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DetailSidebar/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DurationLegend/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotSidebar/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarToggle/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/components/TracingToolbar/index.mjs +1 -2
- package/dist/components/DevToolsPanel/tabs/TracingViewer/index.mjs +1 -2
- package/dist/components/PayloadView/PayloadView.mjs +1 -1
- package/dist/qa/QaLayer.mjs +1 -1
- package/package.json +16 -1194
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,115 @@
|
|
|
1
1
|
# @plitzi/sdk-dev-tools
|
|
2
2
|
|
|
3
|
+
## 0.38.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4f8dc37: ## Packages
|
|
8
|
+
|
|
9
|
+
- **A library package is imported by its root and its folders, never by a file** (`@plitzi/sdk-shared`, `sdk-schema`,
|
|
10
|
+
`sdk-style`, `sdk-elements`, `sdk-interactions`, `sdk-auth`, `sdk-dev-tools`, `sdk-event-bridge`, `sdk-navigation`,
|
|
11
|
+
`sdk-plugins`, `sdk-variables`): each `exports` is now `"."` and `"./*"`, the latter a folder's `index`.
|
|
12
|
+
`@plitzi/sdk-shared/helpers/isRecord` becomes `import { isRecord } from '@plitzi/sdk-shared/helpers'`, and a default
|
|
13
|
+
export by the name its folder gives it — almost always its file's (`import usePlitzi from '…/hooks/usePlitzi'` →
|
|
14
|
+
`import { usePlitzi } from '@plitzi/sdk-shared/hooks'`). A file-level specifier now fails with `ERR_MODULE_NOT_FOUND`.
|
|
15
|
+
New entries where a folder barrel would have brought more than was asked for: `@plitzi/sdk-shared/project` and
|
|
16
|
+
`@plitzi/sdk-shared/plugins/bundle` (Node only), `@plitzi/sdk-interactions/declarations` (the global callbacks and
|
|
17
|
+
utility specs, without React), and `@plitzi/sdk-elements/elements/declarations`, which now also carries the
|
|
18
|
+
declarations' attribute types and the constants they are checked with. `RuleGroup` is exported by `@plitzi/sdk-shared`
|
|
19
|
+
with the document types that use it. `plitzi upgrade migrations` names every such import in a project, with the folder to
|
|
20
|
+
import it from instead.
|
|
21
|
+
- **`@plitzi/sdk-shared`'s root exports the document types, and only them** (`@plitzi/sdk-shared`): what the package
|
|
22
|
+
does is imported from its folder — `formatDate` from `@plitzi/sdk-shared/helpers`, `ThemeProvider` from
|
|
23
|
+
`@plitzi/sdk-shared/theme`, a GraphQL operation's types from `@plitzi/sdk-shared/network/graphql` — so a module that
|
|
24
|
+
imports a type from the root no longer loads every area of the package.
|
|
25
|
+
- **What one package alone used lives in that package** (`@plitzi/sdk-shared`, `@plitzi/sdk-elements`): the data
|
|
26
|
+
source hooks moved from `@plitzi/sdk-shared/dataSource/hooks` to `@plitzi/sdk-elements/dataSource`
|
|
27
|
+
(`useRegisterSource`, `useResolvedVariables`), and the Apollo links the builder's client is built with into the
|
|
28
|
+
builder.
|
|
29
|
+
- **The builder's panels are an entry of their own** (`@plitzi/sdk-style`, `@plitzi/sdk-variables`,
|
|
30
|
+
`@plitzi/sdk-elements`): the style inspector, the advanced style editor and `BuilderStyleContextProvider` are imported
|
|
31
|
+
from `@plitzi/sdk-style/builder`; the variables' lists and forms from `@plitzi/sdk-variables/builder`; the elements'
|
|
32
|
+
settings panels (`defaultElementsSettings`) from `@plitzi/sdk-elements/builder`. Each package's root keeps what a page
|
|
33
|
+
and a server use — `generateCache` no longer loads the inspector, on a server 227 modules down to 21.
|
|
34
|
+
|
|
35
|
+
## CLI
|
|
36
|
+
- **`plitzi upgrade`'s `renames` part is now `migrations`** (`@plitzi/cli`): what a version changed that a project's
|
|
37
|
+
own source must follow, one file per change in the CLI's `src/migrations/changes/` with the version it shipped in —
|
|
38
|
+
rewritten with `--write` when it has one right answer, said otherwise. The `--json` report carries `migrations` (each
|
|
39
|
+
with its `migration`, `since`, `file`, `line`, `what` and whether it was `written`) in place of `renames` and
|
|
40
|
+
`changes`. The changes of 0.38.0 (`canTemplate` → `canSnippet`, the `*Template` authoring names), 0.38.9 (a
|
|
41
|
+
`formControl` without `required` is optional) and 0.38.12 (`usePlitziServiceContext` → `usePlitzi`) are no longer
|
|
42
|
+
looked for: a project still on one of those versions makes them by hand.
|
|
43
|
+
|
|
44
|
+
- Updated dependencies [4f8dc37]
|
|
45
|
+
- @plitzi/sdk-schema@0.38.17
|
|
46
|
+
- @plitzi/sdk-shared@0.38.17
|
|
47
|
+
|
|
48
|
+
## 0.38.16
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 9cfdccb: ## Security
|
|
53
|
+
|
|
54
|
+
- **A site's credential reads nothing of the space over MCP** (`@plitzi/sdk-mcp`): the `render` token every published
|
|
55
|
+
page embeds — and a self-hosting `host` key — resolved to a grant naming the space, and the MCP served every read
|
|
56
|
+
under it: the unpublished draft, the change history with who made each change and every value before and after, the
|
|
57
|
+
functions' source, the space's private data, its action documents and connectors. Only an `agent` grant attaches a
|
|
58
|
+
space now; any other is a connection with no space (`plitzi_render` and the public guides), told so in the words
|
|
59
|
+
`NO_SPACE_ATTACHED` already uses. A deployment whose `getGrant` answered other scopes for reading must issue agent
|
|
60
|
+
grants for them.
|
|
61
|
+
|
|
62
|
+
## Agents
|
|
63
|
+
- **`plitzi space watch`** (`@plitzi/cli`): the space read again on every save of `src/space/`, `src/plugins/`,
|
|
64
|
+
`src/data/` or `public/data/`, and only what changed said — what the save did to the space element by element, the
|
|
65
|
+
findings and warnings it brought and fixed (one that only moved down its file is the same one), a save that changed
|
|
66
|
+
nothing, or that the space stopped authoring and why. `--json` is one event a line (`ready`, `pass`, `refused`,
|
|
67
|
+
`error`), for an agent to run in the background instead of `author` and `space lint` after every edit. Each pass reads
|
|
68
|
+
the space in a process of its own (`space watch-pass`, hidden). `space lint`'s reading is `spaceFindings`, shared.
|
|
69
|
+
- **A space's activity, followed** (`@plitzi/sdk-shared`, `@plitzi/sdk-mcp`, `@plitzi/cli`): what happened on a space
|
|
70
|
+
after a cursor — its draft changed (a person in the builder, an agent, the autofix), a version went out, a server
|
|
71
|
+
action failed or was refused — and, with nothing yet, waited for, up to 50 s. One vocabulary,
|
|
72
|
+
`@plitzi/sdk-shared/activity` (`SpaceActivity`, `SpaceActivityPage`, `activityLine`, `isSpaceActivityPage`, the
|
|
73
|
+
limits); the reader's own writes left out and counted (`skippedMine`), `mine` keeps them.
|
|
74
|
+
- **`plitzi_activity { after, wait, limit, mine }`** (`@plitzi/sdk-mcp`), on the new `getActivity` adapter
|
|
75
|
+
(`SSRAdapters`). The listing budget is 78k (was 77k) for it.
|
|
76
|
+
- **`plitzi space activity [--follow] [--after <cursor>] [--mine] [--limit <n>] [--json]`** (`@plitzi/cli`), over
|
|
77
|
+
the platform's `GET /spaces/:spaceId/activity`; `--follow` stays, one page a line with `--json`, and asks again
|
|
78
|
+
when the platform does not answer.
|
|
79
|
+
- **The people in the builder see the agent work** (`@plitzi/sdk-server`, `@plitzi/sdk-shared`, `@plitzi/sdk-mcp`,
|
|
80
|
+
`@plitzi/plitzi-builder`): an agent grant carries the application the member connected (`Grant.client`,
|
|
81
|
+
`StoredSpaceToken.client`, `SSRGrant.client`), and every MCP write `SSRWriteContext.client` — the history's
|
|
82
|
+
`client` for an agent, which was never set. A collaborator may be an agent (`SubscriptionCollaborator.agent`): the
|
|
83
|
+
builder draws it as a robot, names it `Claude · for ana` (`collaboratorTitle`) in the header, on the canvas and in
|
|
84
|
+
its notices. The deployment announces it — Plitzi's joins it on a write, selects what it changed, and lets it go
|
|
85
|
+
after a minute of nothing. `activityLine` names it the same way (`Claude for ana over the MCP, …`), so
|
|
86
|
+
`plitzi space activity` says which application wrote.
|
|
87
|
+
- A tool may declare `documents: false` (`ToolSpec`): the host loads none of the space for it, and passes the call's
|
|
88
|
+
abort signal through `ToolContext.activity`.
|
|
89
|
+
|
|
90
|
+
## Authoring
|
|
91
|
+
- **A file that does not parse is said at its line under any loader** (`@plitzi/sdk-authoring`): `moduleProblem` read
|
|
92
|
+
the first line of the error, and an esbuild transform (tsx, vitest) puts only `Transform failed with 1 error:` there
|
|
93
|
+
— the file, line and what is wrong are on the next. A line of the message that points at a file of the project is
|
|
94
|
+
now the problem (`src/space/hero.ts:139: Expected "}" but found ";"`), the project's root matched as given and as it
|
|
95
|
+
is on disk (`/var/…` and `/private/var/…` on macOS).
|
|
96
|
+
|
|
97
|
+
## Testing
|
|
98
|
+
- **`unusedPort` is chosen where the system never hands one out** (`@plitzi/sdk-server`): it answered a port the system
|
|
99
|
+
had just handed out (`listen(0)`), from the ephemeral range every outgoing connection takes its local port from — so
|
|
100
|
+
another worker's request could take it before the test listened, and CI failed `runtime.test.ts` with `EADDRINUSE`
|
|
101
|
+
(the page server then ends the process). It is a free port below that range now, at random, checked first.
|
|
102
|
+
|
|
103
|
+
## Docs
|
|
104
|
+
- **A self-hosted runtime's endpoints go in `data`**, as 0.38.15 moved them: `docs/en/runtimes.md`, the
|
|
105
|
+
`10-runtime` example and the website still put `served.stage` in `preAuth`, before the cross-site guard.
|
|
106
|
+
- New: `docs/en/activity.md`; `space watch` in `docs/en/agent-tooling.md`'s loop; the CLI README, the CLI skill, the
|
|
107
|
+
generated project's `AGENTS.md`, the MCP guide and README.
|
|
108
|
+
|
|
109
|
+
- Updated dependencies [9cfdccb]
|
|
110
|
+
- @plitzi/sdk-schema@0.38.16
|
|
111
|
+
- @plitzi/sdk-shared@0.38.16
|
|
112
|
+
|
|
3
113
|
## 0.38.15
|
|
4
114
|
|
|
5
115
|
### Patch Changes
|
|
@@ -10,8 +10,8 @@ import c from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
|
10
10
|
import l from "clsx";
|
|
11
11
|
import { Suspense as u, lazy as d, useCallback as f, useRef as p, useState as m } from "react";
|
|
12
12
|
import { DevStoreScopeContext as h } from "@plitzi/nexus/react";
|
|
13
|
-
import { DEV_TOOLS_ATTRIBUTE as g } from "@plitzi/sdk-shared/devTools
|
|
14
|
-
import _ from "@plitzi/sdk-shared/theme
|
|
13
|
+
import { DEV_TOOLS_ATTRIBUTE as g } from "@plitzi/sdk-shared/devTools";
|
|
14
|
+
import { useTheme as _ } from "@plitzi/sdk-shared/theme";
|
|
15
15
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
16
16
|
//#region src/DevToolsContainer.tsx
|
|
17
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 = "" }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { pConsole as s } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
|
|
2
|
+
import { DevToolsContext as a, pConsole as o } from "@plitzi/sdk-shared/devTools";
|
|
3
|
+
import { omit as s } from "@plitzi/plitzi-ui/helpers";
|
|
5
4
|
import { jsx as c } from "react/jsx-runtime";
|
|
6
5
|
//#region src/DevToolsContextProvider.tsx
|
|
7
6
|
var l = ({ children: l }) => {
|
|
@@ -16,11 +15,11 @@ var l = ({ children: l }) => {
|
|
|
16
15
|
}, [d]), g = e((e, t) => p((n) => ({
|
|
17
16
|
...n,
|
|
18
17
|
[e]: t
|
|
19
|
-
})), []), _ = e((e) => p((t) =>
|
|
18
|
+
})), []), _ = e((e) => p((t) => s(t, [e])), []), v = e((e, ...t) => {
|
|
20
19
|
if (e && typeof f[e] == "function") return f[e](...t);
|
|
21
20
|
}, [f]), y = e(() => d([]), []);
|
|
22
|
-
m.current ||= (
|
|
23
|
-
|
|
21
|
+
m.current ||= (o.setCallback(h), o.setCallbackAddProvider(g), o.setCallbackRemoveProvider(_), !0), t(() => (o.setCallback(h), o.setCallbackAddProvider(g), o.setCallbackRemoveProvider(_), o.processPendingLogs(), () => {
|
|
22
|
+
o.setCallback(void 0), o.setCallbackAddProvider(void 0), o.setCallbackRemoveProvider(void 0), o.flush();
|
|
24
23
|
}), [
|
|
25
24
|
h,
|
|
26
25
|
g,
|
|
@@ -39,7 +38,7 @@ var l = ({ children: l }) => {
|
|
|
39
38
|
y,
|
|
40
39
|
v
|
|
41
40
|
]);
|
|
42
|
-
return /* @__PURE__ */ c(
|
|
41
|
+
return /* @__PURE__ */ c(a, {
|
|
43
42
|
value: b,
|
|
44
43
|
children: l
|
|
45
44
|
});
|
package/dist/DevToolsRoot.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { use as e, useContext as t, useLayoutEffect as n, useRef as r } from "react";
|
|
2
2
|
import { StoreContext as i } from "@plitzi/nexus/react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import c from "
|
|
7
|
-
import l from "@plitzi/sdk-shared/
|
|
8
|
-
import u from "@plitzi/sdk-shared/
|
|
3
|
+
import { ThemeScopeContext as a } from "@plitzi/sdk-shared/theme";
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
import { ThemeContext as s } from "@plitzi/plitzi-ui/Provider";
|
|
6
|
+
import { createRoot as c } from "react-dom/client";
|
|
7
|
+
import { ComponentContext as l } from "@plitzi/sdk-shared/elements";
|
|
8
|
+
import { PluginsContext as u } from "@plitzi/sdk-shared/plugins";
|
|
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(
|
|
11
|
+
let p = r(null), m = r(void 0), h = r(void 0), g = t(i), _ = e(a), v = e(u), y = e(l), b = e(s);
|
|
12
12
|
return n(() => {
|
|
13
13
|
let e = p.current;
|
|
14
|
-
if (e) return clearTimeout(h.current), m.current ??=
|
|
14
|
+
if (e) return clearTimeout(h.current), m.current ??= c(e), () => {
|
|
15
15
|
let e = m.current;
|
|
16
16
|
h.current = setTimeout(() => {
|
|
17
17
|
e?.unmount(), m.current === e && (m.current = void 0);
|
|
18
18
|
}, 0);
|
|
19
19
|
};
|
|
20
20
|
}, []), n(() => {
|
|
21
|
-
m.current?.render(/* @__PURE__ */
|
|
21
|
+
m.current?.render(/* @__PURE__ */ o(i, {
|
|
22
22
|
value: g,
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ o(s, {
|
|
24
24
|
value: b,
|
|
25
|
-
children: /* @__PURE__ */ a
|
|
25
|
+
children: /* @__PURE__ */ o(a, {
|
|
26
26
|
value: _,
|
|
27
|
-
children: /* @__PURE__ */
|
|
27
|
+
children: /* @__PURE__ */ o(u, {
|
|
28
28
|
value: v,
|
|
29
|
-
children: /* @__PURE__ */
|
|
29
|
+
children: /* @__PURE__ */ o(l, {
|
|
30
30
|
value: y,
|
|
31
31
|
children: f
|
|
32
32
|
})
|
|
@@ -34,7 +34,7 @@ var d = { display: "contents" }, f = ({ children: f }) => {
|
|
|
34
34
|
})
|
|
35
35
|
})
|
|
36
36
|
}));
|
|
37
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ o("div", {
|
|
38
38
|
ref: p,
|
|
39
39
|
style: d
|
|
40
40
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { elementReport as e, plain as t, recordAt as n } from "./report.mjs";
|
|
2
|
-
import { isRecord as r } from "@plitzi/sdk-shared/helpers
|
|
2
|
+
import { isRecord as r } from "@plitzi/sdk-shared/helpers";
|
|
3
3
|
//#region src/agentInspector/inspector.ts
|
|
4
4
|
var i = "window.__plitzi — this page, in text (debug mode only):\n state(key?) runtime.state, or one key of it\n setState(key, value) writes runtime.state.<key>, as a setState step would\n sources(name?) every source's current value by name (apiContainer_site, list_products…), or one\n element(id) an element by its id, in a page or a component: type, attributes, what it reads, its own state,\n the component it places, copies, on screen, box\n flows(limit = 20) the last flows that ran: trigger, element, status, every step with its time and error\n watch(on = true) one console line per flow as it ends", a = (e, t) => r(e) && r(t) && Object.keys(t).some((t) => !Object.hasOwn(e, t)), o = ({ root: r, writeState: o, stores: s, runs: c, setWatching: l, document: u }) => ({
|
|
5
5
|
help: () => i,
|
|
@@ -2,21 +2,21 @@ import { flowRunLine as e, flowRunOf as t } from "./flowRuns.mjs";
|
|
|
2
2
|
import { createAgentInspector as n } from "./inspector.mjs";
|
|
3
3
|
import { useContext as r, useEffect as i } from "react";
|
|
4
4
|
import { StoreContext as a } from "@plitzi/nexus/react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { pConsole as o } from "@plitzi/sdk-shared/devTools";
|
|
6
|
+
import { getDevStoresSnapshot as s } from "@plitzi/nexus";
|
|
7
7
|
import { useCommonStoreSetter as c } from "@plitzi/sdk-shared/store";
|
|
8
8
|
//#region src/agentInspector/useAgentInspector.ts
|
|
9
9
|
var l = 100, u = (u) => {
|
|
10
10
|
let d = r(a), f = c();
|
|
11
11
|
i(() => {
|
|
12
12
|
if (!u || !d) return;
|
|
13
|
-
let r = [], i = !1, a =
|
|
13
|
+
let r = [], i = !1, a = o.addListener((n) => {
|
|
14
14
|
let a = t(n);
|
|
15
15
|
a && (r.push(a), r.length > l && r.shift(), i && console.info(e(a)));
|
|
16
16
|
}, { replay: !0 }), c = n({
|
|
17
17
|
root: d,
|
|
18
18
|
writeState: (e, t) => f(`runtime.state.${e}`, t),
|
|
19
|
-
stores: () =>
|
|
19
|
+
stores: () => s().map((e) => e.store),
|
|
20
20
|
runs: () => r,
|
|
21
21
|
setWatching: (e) => {
|
|
22
22
|
i = e;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import e from "clsx";
|
|
2
2
|
import { use as t, useCallback as n, useMemo as r } from "react";
|
|
3
|
-
import { DEV_TOOLS_ATTRIBUTE as i } from "@plitzi/sdk-shared/devTools
|
|
4
|
-
import a from "@plitzi/sdk-shared/devTools/DevToolsContext";
|
|
3
|
+
import { DEV_TOOLS_ATTRIBUTE as i, DevToolsContext as a } from "@plitzi/sdk-shared/devTools";
|
|
5
4
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
5
|
//#region src/components/DevToolsIndicator/DevToolsIndicator.tsx
|
|
7
6
|
var c = ({ className: c, onOpen: l }) => {
|
|
@@ -12,15 +11,7 @@ var c = ({ className: c, onOpen: l }) => {
|
|
|
12
11
|
errors: 0,
|
|
13
12
|
warnings: 0
|
|
14
13
|
}), [u]), p = n(() => {
|
|
15
|
-
|
|
16
|
-
l("danger");
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (f > 0) {
|
|
20
|
-
l("warning");
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
l();
|
|
14
|
+
d > 0 ? l("danger") : f > 0 ? l("warning") : l();
|
|
24
15
|
}, [
|
|
25
16
|
d,
|
|
26
17
|
f,
|
|
@@ -11,7 +11,7 @@ import l from "./tabs/TracingViewer/TracingViewer.mjs";
|
|
|
11
11
|
import u from "./tabs/VariablesViewer/index.mjs";
|
|
12
12
|
import d from "clsx";
|
|
13
13
|
import { use as f } from "react";
|
|
14
|
-
import p from "@plitzi/sdk-shared/devTools
|
|
14
|
+
import { DevToolsContext as p } from "@plitzi/sdk-shared/devTools";
|
|
15
15
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
16
16
|
//#region src/components/DevToolsPanel/DevToolsBody.tsx
|
|
17
17
|
var g = ({ className: g, tabSelected: _, orientation: v, logTypeFilter: y, elementSelected: b, onSelectElement: x, qa: S = !1 }) => {
|
|
@@ -4,7 +4,7 @@ import n from "./DevToolsSubHeader.mjs";
|
|
|
4
4
|
import r from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
5
5
|
import i from "clsx";
|
|
6
6
|
import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
7
|
-
import { DEV_TOOLS_ATTRIBUTE as l } from "@plitzi/sdk-shared/devTools
|
|
7
|
+
import { DEV_TOOLS_ATTRIBUTE as l } from "@plitzi/sdk-shared/devTools";
|
|
8
8
|
import { useCommonStore as u } from "@plitzi/sdk-shared/store";
|
|
9
9
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
10
|
import p from "@plitzi/plitzi-ui/ContainerResizable";
|
|
@@ -2,18 +2,18 @@ import e from "../../highlight/index.mjs";
|
|
|
2
2
|
import t from "./DevToolsButton.mjs";
|
|
3
3
|
import n from "clsx";
|
|
4
4
|
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { elementOf as s } from "@plitzi/sdk-shared/helpers";
|
|
6
|
+
import { throttle as c } from "@plitzi/plitzi-ui/helpers";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/DevToolsPanel/DevToolsSubHeader.tsx
|
|
9
9
|
var d = ({ className: d, elementSelected: f, currentPageId: p, onSelectElement: m }) => {
|
|
10
10
|
let [h, g] = o(!1), _ = r((e) => {
|
|
11
11
|
let { id: t } = e?.dataset ?? {};
|
|
12
12
|
m(t);
|
|
13
|
-
}, [m]), v = a(() =>
|
|
14
|
-
|
|
13
|
+
}, [m]), v = a(() => c(_, 100), [_]), y = r((e) => {
|
|
14
|
+
s(e.target)?.closest(".plitzi-sdk") && v(s(e.target)?.closest("[data-id]") ?? void 0);
|
|
15
15
|
}, [v]), b = r((e) => {
|
|
16
|
-
|
|
16
|
+
s(e.target)?.closest(".plitzi-sdk") && (e.stopPropagation(), e.preventDefault(), g(!1));
|
|
17
17
|
}, []), x = r((e) => {
|
|
18
18
|
e.stopPropagation(), e.preventDefault(), g(!0);
|
|
19
19
|
}, [g]), S = r(() => {
|
|
@@ -31,22 +31,22 @@ var d = ({ className: d, elementSelected: f, currentPageId: p, onSelectElement:
|
|
|
31
31
|
b,
|
|
32
32
|
y,
|
|
33
33
|
h
|
|
34
|
-
]), /* @__PURE__ */
|
|
34
|
+
]), /* @__PURE__ */ u("div", {
|
|
35
35
|
className: n("flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800", d),
|
|
36
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ u("div", {
|
|
37
37
|
className: "flex gap-1",
|
|
38
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ l(t, {
|
|
39
39
|
iconClassName: "fa-regular fa-hand-pointer",
|
|
40
40
|
title: "Select an element in the page to inspect it",
|
|
41
41
|
onClick: x,
|
|
42
42
|
isSelected: h
|
|
43
|
-
}), /* @__PURE__ */
|
|
43
|
+
}), /* @__PURE__ */ l(t, {
|
|
44
44
|
iconClassName: "fa-regular fa-file",
|
|
45
45
|
title: "Current Page",
|
|
46
46
|
onClick: S,
|
|
47
47
|
isSelected: f === p
|
|
48
48
|
})]
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ l(t, {
|
|
50
50
|
iconClassName: "fa-solid fa-ban",
|
|
51
51
|
onClick: C,
|
|
52
52
|
title: "Clear",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "./DevToolsButton.mjs";
|
|
2
2
|
import { useCallback as t } from "react";
|
|
3
|
-
import n from "@plitzi/sdk-shared/theme
|
|
3
|
+
import { useTheme as n } from "@plitzi/sdk-shared/theme";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/DevToolsPanel/ThemeControl.tsx
|
|
6
6
|
var i = {
|
|
@@ -4,7 +4,7 @@ import n from "../DetailsRuntime/index.mjs";
|
|
|
4
4
|
import { useMemo as r } from "react";
|
|
5
5
|
import { useCommonStore as i } from "@plitzi/sdk-shared/store";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
import { treeOf as s } from "@plitzi/sdk-schema
|
|
7
|
+
import { treeOf as s } from "@plitzi/sdk-schema";
|
|
8
8
|
import c from "@plitzi/plitzi-ui/ContainerTabs";
|
|
9
9
|
//#region src/components/DevToolsPanel/tabs/ElementsViewer/components/ElementDetails/ElementDetails.tsx
|
|
10
10
|
var l = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { componentNamed as e, isInstance as t } from "@plitzi/sdk-schema
|
|
2
|
-
import { resolveLayoutChain as n } from "@plitzi/sdk-shared/schema
|
|
1
|
+
import { componentNamed as e, isInstance as t } from "@plitzi/sdk-schema";
|
|
2
|
+
import { resolveLayoutChain as n } from "@plitzi/sdk-shared/schema";
|
|
3
3
|
//#region src/components/DevToolsPanel/tabs/ElementsViewer/helpers/renderTree.ts
|
|
4
4
|
var r = (e) => typeof e == "string" ? e : "", i = (e, n) => {
|
|
5
5
|
let i = [], a = /* @__PURE__ */ new Set(), o = (n, s) => {
|
package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as default };
|
|
1
|
+
export { default } from "./HistoryEntryItem.mjs";
|
package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as default };
|
|
1
|
+
export { default } from "./HistoryToolbar.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import e from "../../../../../../highlight/index.mjs";
|
|
2
2
|
import { useCallback as t, useMemo as n, useState as r } from "react";
|
|
3
3
|
import { useCommonStore as i } from "@plitzi/sdk-shared/store";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { formatDate as a } from "@plitzi/sdk-shared/helpers";
|
|
5
|
+
import { get as o } from "@plitzi/plitzi-ui/helpers";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.tsx
|
|
8
8
|
var l = ({ triggerName: l, startTime: u, endTime: d, duration: f, elementId: p, hostElementId: m }) => {
|
|
9
|
-
let [h] = i("schema.flat"), g = n(() => p ?
|
|
9
|
+
let [h] = i("schema.flat"), g = n(() => p ? o(h, p) : void 0, [p, h]), _ = n(() => a(u, "HH:mm:ss.SSS"), [u]), v = n(() => a(d, "HH:mm:ss.SSS"), [d]), y = n(() => {
|
|
10
10
|
if (typeof document < "u") return document.querySelector(`[data-id="${p}"]`);
|
|
11
11
|
}, [p]), b = t(() => {
|
|
12
12
|
y?.scrollIntoView({
|
|
@@ -17,34 +17,34 @@ var l = ({ triggerName: l, startTime: u, endTime: d, duration: f, elementId: p,
|
|
|
17
17
|
}, [y]), [x, S] = r(!1);
|
|
18
18
|
e(x ? p : void 0);
|
|
19
19
|
let C = t(() => S(!0), []), w = t(() => S(!1), []);
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ c("div", {
|
|
21
21
|
className: "flex justify-around gap-3",
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ c("div", {
|
|
24
24
|
className: "flex min-w-0 grow basis-0 flex-col",
|
|
25
|
-
children: [/* @__PURE__ */
|
|
25
|
+
children: [/* @__PURE__ */ c("div", {
|
|
26
26
|
className: "mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
-
}), /* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ s("i", { className: "fa-regular fa-clock" }), "Times"]
|
|
28
|
+
}), /* @__PURE__ */ c("div", {
|
|
29
29
|
className: "flex flex-col gap-0.5 font-mono text-zinc-700 dark:text-zinc-300",
|
|
30
30
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ c("div", {
|
|
32
32
|
className: "flex gap-1",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ s("span", {
|
|
34
34
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
35
35
|
children: "Start"
|
|
36
36
|
}), _]
|
|
37
37
|
}),
|
|
38
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ c("div", {
|
|
39
39
|
className: "flex gap-1",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ s("span", {
|
|
41
41
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
42
42
|
children: "End"
|
|
43
43
|
}), v]
|
|
44
44
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ c("div", {
|
|
46
46
|
className: "flex gap-1",
|
|
47
|
-
children: [/* @__PURE__ */
|
|
47
|
+
children: [/* @__PURE__ */ s("span", {
|
|
48
48
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
49
49
|
children: "Duration"
|
|
50
50
|
}), f]
|
|
@@ -52,53 +52,53 @@ var l = ({ triggerName: l, startTime: u, endTime: d, duration: f, elementId: p,
|
|
|
52
52
|
]
|
|
53
53
|
})]
|
|
54
54
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ s("div", { className: "w-px shrink-0 bg-zinc-200 dark:bg-zinc-800" }),
|
|
56
|
+
/* @__PURE__ */ c("div", {
|
|
57
57
|
className: "flex min-w-0 grow basis-0 flex-col",
|
|
58
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ c("div", {
|
|
59
59
|
className: "mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
60
|
-
children: [/* @__PURE__ */
|
|
61
|
-
}), /* @__PURE__ */
|
|
60
|
+
children: [/* @__PURE__ */ s("i", { className: "fa-solid fa-circle-info" }), "Details"]
|
|
61
|
+
}), /* @__PURE__ */ c("div", {
|
|
62
62
|
className: "flex flex-col gap-0.5 text-zinc-700 dark:text-zinc-300",
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ c("div", {
|
|
65
65
|
className: "flex gap-1",
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
children: [/* @__PURE__ */ s("span", {
|
|
67
67
|
className: "text-zinc-400 dark:text-zinc-500",
|
|
68
68
|
children: "Type"
|
|
69
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ s("span", { children: "Interaction" })]
|
|
70
70
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ c("div", {
|
|
72
72
|
className: "flex min-w-0 gap-1",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ s("span", {
|
|
74
74
|
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
75
75
|
children: "Trigger"
|
|
76
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ s("span", {
|
|
77
77
|
className: "truncate",
|
|
78
78
|
children: l
|
|
79
79
|
})]
|
|
80
80
|
}),
|
|
81
|
-
m && /* @__PURE__ */
|
|
81
|
+
m && /* @__PURE__ */ c("div", {
|
|
82
82
|
className: "flex min-w-0 gap-1",
|
|
83
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ s("span", {
|
|
84
84
|
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
85
85
|
children: "Fired on"
|
|
86
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ s("span", {
|
|
87
87
|
className: "truncate font-mono",
|
|
88
88
|
children: m
|
|
89
89
|
})]
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ c("div", {
|
|
92
92
|
className: "flex min-w-0 gap-1",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ s("span", {
|
|
94
94
|
className: "shrink-0 text-zinc-400 dark:text-zinc-500",
|
|
95
95
|
children: "Element"
|
|
96
|
-
}), /* @__PURE__ */
|
|
96
|
+
}), /* @__PURE__ */ c("span", {
|
|
97
97
|
className: "cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",
|
|
98
98
|
onClick: b,
|
|
99
99
|
onMouseEnter: C,
|
|
100
100
|
onMouseLeave: w,
|
|
101
|
-
children: [g?.definition.label, p && /* @__PURE__ */
|
|
101
|
+
children: [g?.definition.label, p && /* @__PURE__ */ c("span", {
|
|
102
102
|
className: "ml-1 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",
|
|
103
103
|
children: [
|
|
104
104
|
"[",
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import e from "./ExecutionTreeNode.mjs";
|
|
2
2
|
import t from "clsx";
|
|
3
3
|
import { useCallback as n, useMemo as r } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { getDurationMs as i } from "@plitzi/sdk-shared/helpers";
|
|
5
|
+
import { get as a } from "@plitzi/plitzi-ui/helpers";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.tsx
|
|
8
8
|
var c = ({ className: c, nodeId: l, nodes: u, selected: d, onSelect: f }) => {
|
|
9
9
|
let p = r(() => {
|
|
10
|
-
let e =
|
|
10
|
+
let e = a(u, l), t = [];
|
|
11
11
|
for (; e;) {
|
|
12
|
-
let { node: n, startTime: r, endTime:
|
|
12
|
+
let { node: n, startTime: r, endTime: o } = e, s = `${i(r, o)}ms`, c = n.id === l ? 0 : 1;
|
|
13
13
|
t.push({
|
|
14
14
|
id: n.id,
|
|
15
15
|
action: n.action,
|
|
16
16
|
title: n.title,
|
|
17
17
|
status: e.status,
|
|
18
18
|
level: c,
|
|
19
|
-
duration:
|
|
20
|
-
}), e =
|
|
19
|
+
duration: s
|
|
20
|
+
}), e = a(u, n.afterNode);
|
|
21
21
|
}
|
|
22
22
|
return t;
|
|
23
23
|
}, [l, u]), m = n((e) => f?.(e), [f]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ s("div", {
|
|
25
25
|
className: t("flex flex-col gap-1.5", c),
|
|
26
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ s("div", {
|
|
27
27
|
className: "flex items-center gap-1.5 px-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
}), /* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ o("i", { className: "fa-solid fa-code-merge" }), "Execution Tree"]
|
|
29
|
+
}), /* @__PURE__ */ o("div", {
|
|
30
30
|
className: "flex flex-col",
|
|
31
|
-
children: p.map((t, n) => /* @__PURE__ */
|
|
31
|
+
children: p.map((t, n) => /* @__PURE__ */ o(e, {
|
|
32
32
|
id: t.id,
|
|
33
33
|
action: t.action,
|
|
34
34
|
title: t.title,
|