@plitzi/sdk-dev-tools 0.38.24 → 0.39.1
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 +162 -1
- package/dist/DevToolsContainer.d.ts +11 -1
- package/dist/DevToolsContainer.mjs +68 -62
- package/dist/DevToolsContextProvider.mjs +5 -3
- package/dist/PageContext.d.ts +7 -0
- package/dist/PageContext.mjs +6 -0
- package/dist/agentInspector/flowRuns.d.ts +1 -1
- package/dist/agentInspector/flowRuns.mjs +22 -15
- package/dist/agentInspector/index.d.ts +2 -0
- package/dist/agentInspector/index.mjs +1 -0
- package/dist/agentInspector/inspector.d.ts +31 -1
- package/dist/agentInspector/inspector.mjs +57 -19
- package/dist/agentInspector/report.d.ts +27 -2
- package/dist/agentInspector/report.mjs +59 -38
- package/dist/agentInspector/useAgentInspector.d.ts +3 -2
- package/dist/agentInspector/useAgentInspector.mjs +20 -16
- package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +47 -25
- package/dist/components/DevToolsIndicator/sideAt.d.ts +7 -0
- package/dist/components/DevToolsIndicator/sideAt.mjs +4 -0
- package/dist/components/DevToolsOverlay/DevToolsOverlay.d.ts +3 -4
- package/dist/components/DevToolsOverlay/DevToolsOverlay.mjs +4 -4
- package/dist/components/DevToolsPanel/DevToolsBody.d.ts +4 -1
- package/dist/components/DevToolsPanel/DevToolsBody.mjs +33 -31
- package/dist/components/DevToolsPanel/DevToolsButton.d.ts +3 -1
- package/dist/components/DevToolsPanel/DevToolsButton.mjs +4 -3
- package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +3 -1
- package/dist/components/DevToolsPanel/DevToolsHeader.mjs +52 -34
- package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +3 -1
- package/dist/components/DevToolsPanel/DevToolsPanel.mjs +50 -47
- package/dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.mjs +2 -2
- package/dist/components/DevToolsPanel/tabs/RunViewer/RunReport.d.ts +7 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/RunReport.mjs +97 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/RunTaskRow.d.ts +6 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/RunTaskRow.mjs +79 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/RunViewer.d.ts +11 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/RunViewer.mjs +222 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/index.d.ts +3 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/index.mjs +6 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/reportHelpers.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/reportHelpers.mjs +39 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/stepRecorder.d.ts +27 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/stepRecorder.mjs +51 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/usePointAt.d.ts +14 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/usePointAt.mjs +33 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/useRunSnapshot.d.ts +9 -0
- package/dist/components/DevToolsPanel/tabs/RunViewer/useRunSnapshot.mjs +22 -0
- package/dist/qa/QaContext.d.ts +2 -5
- package/dist/qa/QaContext.mjs +28 -31
- package/dist/qa/QaLayer.mjs +78 -77
- package/dist/qa/overlays/QaInspector.mjs +28 -27
- package/dist/qa/overlays/QaTabOrder.mjs +2 -2
- package/dist/qa/overlays/QaXrayTags.mjs +22 -22
- package/dist/useNarrowWindow.d.ts +8 -0
- package/dist/useNarrowWindow.mjs +13 -0
- package/package.json +4 -4
|
@@ -14,11 +14,25 @@ export type ElementReport = {
|
|
|
14
14
|
source: string;
|
|
15
15
|
template?: string;
|
|
16
16
|
}[];
|
|
17
|
+
/**
|
|
18
|
+
* What each binding gave it now — `<category>.<to>`, from the sources it sees (a list's rows: the last row drawn): what a plugin
|
|
19
|
+
* received (the map's `hazards` after a filter), which the template alone does not say. Only while its sources can be
|
|
20
|
+
* read (debug mode).
|
|
21
|
+
*/
|
|
22
|
+
resolved?: Record<string, unknown>;
|
|
17
23
|
/** The element's own UI state — an open dropdown, a tab — as the runtime keeps it. */
|
|
18
24
|
state?: unknown;
|
|
19
25
|
/** How many copies are on the page: a list row's elements are one per row, a component's one per instance. */
|
|
20
26
|
copies: number;
|
|
27
|
+
/**
|
|
28
|
+
* What its first copy shows, as a visitor reads it — its bindings resolved — so a count that follows a filter is
|
|
29
|
+
* read, not worked out from the template. Cut at 300 characters.
|
|
30
|
+
*/
|
|
31
|
+
text?: string;
|
|
32
|
+
/** Whether a visitor sees its first copy — scrolling where the page lets them (`sightOf`), not only a box drawn. */
|
|
21
33
|
visible: boolean;
|
|
34
|
+
/** Why no visitor sees it — clipped, under another element — or the box they scroll to see it: said when either is so. */
|
|
35
|
+
sight?: string;
|
|
22
36
|
box?: {
|
|
23
37
|
x: number;
|
|
24
38
|
y: number;
|
|
@@ -35,8 +49,19 @@ export type ElementReport = {
|
|
|
35
49
|
*/
|
|
36
50
|
export declare const plain: (value: unknown, depth?: number, path?: WeakSet<object>) => unknown;
|
|
37
51
|
export declare const recordAt: (value: unknown, ...path: string[]) => Record<string, unknown>;
|
|
52
|
+
/** The element by its id in whichever tree holds it — the pages', or one component's — and that component. */
|
|
53
|
+
export declare const findElement: (schema: Record<string, unknown>, id: string) => {
|
|
54
|
+
element?: unknown;
|
|
55
|
+
inComponent?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* What each binding of `element` gives it from `sources` — the sources one copy of it sees — worked out as the element
|
|
59
|
+
* does (`getBindingsDetails`), so what is said is what it received.
|
|
60
|
+
*/
|
|
61
|
+
export declare const resolvedBindings: (element: unknown, sources: Record<string, unknown>) => Record<string, unknown> | undefined;
|
|
38
62
|
/**
|
|
39
63
|
* What an element is and how it is doing, read from the root store's state and the page: its type and attributes, what
|
|
40
|
-
* it binds to,
|
|
64
|
+
* it binds to, what they gave it (`sourcesOf`: the sources an element sees, by its id), its own state, and where it is
|
|
65
|
+
* on screen. Undefined for an id neither the document nor the page knows.
|
|
41
66
|
*/
|
|
42
|
-
export declare const elementReport: (state: unknown, id: string, document: Document) => ElementReport | undefined;
|
|
67
|
+
export declare const elementReport: (state: unknown, id: string, document: Document, sourcesOf?: (id: string) => unknown) => ElementReport | undefined;
|
|
@@ -1,58 +1,79 @@
|
|
|
1
1
|
import { isRecord as e } from "@plitzi/sdk-shared/helpers";
|
|
2
|
+
import { get as t } from "@plitzi/plitzi-ui/helpers";
|
|
3
|
+
import { getBindingsDetails as n } from "@plitzi/sdk-shared/dataSource";
|
|
4
|
+
import { sightOf as r, sightText as i } from "@plitzi/sdk-shared/devTools/sight";
|
|
2
5
|
//#region src/agentInspector/report.ts
|
|
3
|
-
var
|
|
6
|
+
var a = 300, o = (e) => {
|
|
7
|
+
let t = Reflect.get(e, "innerText");
|
|
8
|
+
return typeof t == "string" ? t : e.textContent;
|
|
9
|
+
}, s = (e, t = 0, n = /* @__PURE__ */ new WeakSet()) => {
|
|
4
10
|
if (typeof e == "function") return;
|
|
5
11
|
if (typeof e != "object" || !e) return e;
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
let
|
|
9
|
-
return
|
|
10
|
-
},
|
|
12
|
+
if (n.has(e) || t > 12) return "[…]";
|
|
13
|
+
n.add(e);
|
|
14
|
+
let r = Array.isArray(e) ? e.map((e) => s(e, t + 1, n)) : Object.fromEntries(Object.entries(e).map(([e, r]) => [e, s(r, t + 1, n)]).filter(([, e]) => e !== void 0));
|
|
15
|
+
return n.delete(e), r;
|
|
16
|
+
}, c = (t, ...n) => {
|
|
11
17
|
let r = t;
|
|
12
18
|
for (let t of n) r = e(r) ? r[t] : void 0;
|
|
13
19
|
return e(r) ? r : {};
|
|
14
|
-
},
|
|
15
|
-
let { to:
|
|
16
|
-
return typeof
|
|
20
|
+
}, l = (e) => Array.isArray(e) ? e : [], u = (e) => Object.entries(c(e, "definition", "bindings")).flatMap(([e, t]) => l(t).flatMap((t) => {
|
|
21
|
+
let { to: n, source: r, transformers: i } = c(t), a = l(i).map((e) => c(e, "params").template).find((e) => typeof e == "string");
|
|
22
|
+
return typeof n == "string" && typeof r == "string" ? [{
|
|
17
23
|
category: e,
|
|
18
|
-
to:
|
|
19
|
-
source:
|
|
20
|
-
...typeof
|
|
24
|
+
to: n,
|
|
25
|
+
source: r,
|
|
26
|
+
...typeof a == "string" ? { template: a } : {}
|
|
21
27
|
}] : [];
|
|
22
|
-
})),
|
|
23
|
-
let
|
|
24
|
-
if (Object.hasOwn(
|
|
25
|
-
for (let [
|
|
26
|
-
let e =
|
|
28
|
+
})), d = (e, t) => {
|
|
29
|
+
let n = c(e, "flat");
|
|
30
|
+
if (Object.hasOwn(n, t)) return { element: n[t] };
|
|
31
|
+
for (let [n, r] of Object.entries(c(e, "components"))) {
|
|
32
|
+
let e = c(r, "flat");
|
|
27
33
|
if (Object.hasOwn(e, t)) return {
|
|
28
34
|
element: e[t],
|
|
29
|
-
inComponent:
|
|
35
|
+
inComponent: n
|
|
30
36
|
};
|
|
31
37
|
}
|
|
32
38
|
return {};
|
|
33
|
-
},
|
|
34
|
-
let
|
|
35
|
-
if (
|
|
36
|
-
let
|
|
39
|
+
}, f = (e, r) => {
|
|
40
|
+
let i = u(e);
|
|
41
|
+
if (i.length === 0) return;
|
|
42
|
+
let a = n(r, {
|
|
43
|
+
attributes: c(e, "attributes"),
|
|
44
|
+
definition: c(e, "definition")
|
|
45
|
+
});
|
|
46
|
+
return Object.fromEntries(i.map(({ category: e, to: n }) => [`${e}.${n}`, s(t(a, e === "initialState" ? [
|
|
47
|
+
"definition",
|
|
48
|
+
"initialState",
|
|
49
|
+
n
|
|
50
|
+
] : [e, n]))]));
|
|
51
|
+
}, p = (t, n, l, p) => {
|
|
52
|
+
let { element: m, inComponent: h } = d(c(t, "schema"), n), g = Array.from(l.querySelectorAll(`[data-id="${n}"]`));
|
|
53
|
+
if (!e(m) && g.length === 0) return;
|
|
54
|
+
let _ = g.at(0), v = _?.getBoundingClientRect(), y = _ ? getComputedStyle(_) : void 0, b = _ && y?.display !== "none" && y?.visibility !== "hidden" ? r(_) : void 0, x = b?.seen === !0, S = b === void 0 || (b.seen ? b.scrolled === void 0 : b.why === "no-size") ? void 0 : i(b), C = c(m, "definition").type, w = c(m, "attributes"), T = C === "reference" && w.referenceType === "component" && typeof w.referenceId == "string" ? w.referenceId : void 0, E = c(t, "runtime", "elements")[n], D = _ instanceof HTMLElement ? o(_).replace(/\s+/g, " ").trim() : "", O = p?.(n), k = e(m) && e(O) ? f(m, O) : void 0;
|
|
37
55
|
return {
|
|
38
|
-
id:
|
|
39
|
-
...typeof
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
-
...e(
|
|
43
|
-
attributes:
|
|
44
|
-
bindings:
|
|
56
|
+
id: n,
|
|
57
|
+
...typeof C == "string" ? { type: C } : {},
|
|
58
|
+
...h === void 0 ? {} : { inComponent: h },
|
|
59
|
+
...T === void 0 ? {} : { instanceOf: T },
|
|
60
|
+
...e(m) ? {
|
|
61
|
+
attributes: c(s(m), "attributes"),
|
|
62
|
+
bindings: u(m)
|
|
45
63
|
} : {},
|
|
46
|
-
...
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
...
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
64
|
+
...k === void 0 ? {} : { resolved: k },
|
|
65
|
+
...E === void 0 ? {} : { state: s(E) },
|
|
66
|
+
copies: g.length,
|
|
67
|
+
...D ? { text: D.length > a ? `${D.slice(0, a)}…` : D } : {},
|
|
68
|
+
visible: x,
|
|
69
|
+
...S === void 0 ? {} : { sight: S },
|
|
70
|
+
...v ? { box: {
|
|
71
|
+
x: Math.round(v.x),
|
|
72
|
+
y: Math.round(v.y),
|
|
73
|
+
width: Math.round(v.width),
|
|
74
|
+
height: Math.round(v.height)
|
|
54
75
|
} } : {}
|
|
55
76
|
};
|
|
56
77
|
};
|
|
57
78
|
//#endregion
|
|
58
|
-
export {
|
|
79
|
+
export { p as elementReport, d as findElement, s as plain, c as recordAt, f as resolvedBindings };
|
|
@@ -6,10 +6,11 @@ declare global {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Puts the selected instance's state, sources, elements and flows on `window.__plitzi`, while the dev tools are on
|
|
9
|
+
* Puts the selected instance's state, sources, elements and flows on `window.__plitzi`, while the dev tools are on — or
|
|
10
|
+
* on another window's, `target`: the builder's canvas is an iframe whose document the SDK draws in from the editor's.
|
|
10
11
|
*
|
|
11
12
|
* The panel shows all of it to a person; an agent driving the page through a browser reads text, and was left inferring
|
|
12
13
|
* state from classes in the DOM. Every flow that ends is kept from the moment the dev tools mount.
|
|
13
14
|
*/
|
|
14
|
-
declare const useAgentInspector: (enabled: boolean) => void;
|
|
15
|
+
declare const useAgentInspector: (enabled: boolean, target?: Window | null) => void;
|
|
15
16
|
export default useAgentInspector;
|
|
@@ -6,30 +6,34 @@ import { pConsole as o } from "@plitzi/sdk-shared/devTools";
|
|
|
6
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
|
-
var l = 100, u = (u) => {
|
|
10
|
-
let
|
|
9
|
+
var l = 100, u = (u, d) => {
|
|
10
|
+
let f = r(a), p = c();
|
|
11
11
|
i(() => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
let r = d === void 0 ? window : d;
|
|
13
|
+
if (!u || !f || !r) return;
|
|
14
|
+
let i = [], a = !1, c = o.addListener((n) => {
|
|
15
|
+
let r = t(n);
|
|
16
|
+
r && (i.push(r), i.length > l && i.shift(), a && console.info(e(r)));
|
|
17
|
+
}, { replay: !0 }), m = n({
|
|
18
|
+
root: f,
|
|
19
|
+
writeState: (e, t) => p(`runtime.state.${e}`, t),
|
|
20
|
+
writeTestAccount: (e) => p("runtime.testAccount", e),
|
|
19
21
|
stores: () => s().map((e) => e.store),
|
|
20
|
-
runs: () =>
|
|
22
|
+
runs: () => i,
|
|
21
23
|
setWatching: (e) => {
|
|
22
|
-
|
|
24
|
+
a = e;
|
|
23
25
|
},
|
|
24
|
-
|
|
26
|
+
elementSources: (e) => o.providerData(`getElementDataSource-${e}`),
|
|
27
|
+
document: r.document
|
|
25
28
|
});
|
|
26
|
-
return
|
|
27
|
-
|
|
29
|
+
return r.__plitzi = m, () => {
|
|
30
|
+
c(), r.__plitzi === m && delete r.__plitzi;
|
|
28
31
|
};
|
|
29
32
|
}, [
|
|
30
33
|
u,
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
f,
|
|
35
|
+
p,
|
|
36
|
+
d
|
|
33
37
|
]);
|
|
34
38
|
};
|
|
35
39
|
//#endregion
|
|
@@ -1,44 +1,66 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { sideAt as e } from "./sideAt.mjs";
|
|
2
|
+
import t from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { use as r, useCallback as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
5
|
+
import { DEV_TOOLS_ATTRIBUTE as c } from "@plitzi/sdk-shared/devTools";
|
|
6
|
+
import { DevToolsContext as l } from "@plitzi/sdk-shared/devTools/react";
|
|
7
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
8
|
//#region src/components/DevToolsIndicator/DevToolsIndicator.tsx
|
|
7
|
-
var
|
|
8
|
-
let { logs:
|
|
9
|
+
var f = 5, p = ({ className: p, onOpen: m }) => {
|
|
10
|
+
let { logs: h } = r(l), [g, _] = t("plitzi-sdk.dev-tools.badge-side", "left"), [v, y] = s(), b = o(void 0), x = o(null), { errors: S, warnings: C } = a(() => h.reduce((e, { logType: t }) => ({
|
|
9
11
|
errors: t === "danger" ? e.errors + 1 : e.errors,
|
|
10
12
|
warnings: t === "warning" ? e.warnings + 1 : e.warnings
|
|
11
13
|
}), {
|
|
12
14
|
errors: 0,
|
|
13
15
|
warnings: 0
|
|
14
|
-
}), [
|
|
15
|
-
|
|
16
|
+
}), [h]), w = i((e) => {
|
|
17
|
+
b.current = {
|
|
18
|
+
x: e.clientX,
|
|
19
|
+
dragging: !1
|
|
20
|
+
}, e.currentTarget.setPointerCapture(e.pointerId);
|
|
21
|
+
}, []), T = i((e) => {
|
|
22
|
+
let t = b.current;
|
|
23
|
+
!t || !t.dragging && Math.abs(e.clientX - t.x) < f || (t.dragging = !0, y({
|
|
24
|
+
from: t.x,
|
|
25
|
+
x: e.clientX
|
|
26
|
+
}));
|
|
27
|
+
}, []), E = i((t) => {
|
|
28
|
+
let n = x.current?.offsetParent?.getBoundingClientRect();
|
|
29
|
+
b.current?.dragging && n && _(e(t.clientX, n)), y(void 0);
|
|
30
|
+
}, [_]), D = i(() => {
|
|
31
|
+
let e = b.current?.dragging === !0;
|
|
32
|
+
b.current = void 0, !e && (S > 0 ? m("danger") : C > 0 ? m("warning") : m());
|
|
16
33
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
34
|
+
S,
|
|
35
|
+
C,
|
|
36
|
+
m
|
|
20
37
|
]);
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
23
|
-
[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
38
|
+
return /* @__PURE__ */ u("div", {
|
|
39
|
+
ref: x,
|
|
40
|
+
className: n("absolute bottom-3 z-[1000000]", g === "right" ? "right-3" : "left-3", p),
|
|
41
|
+
style: v ? { translate: `${String(v.x - v.from)}px 0` } : void 0,
|
|
42
|
+
[c]: "",
|
|
43
|
+
children: /* @__PURE__ */ d("button", {
|
|
44
|
+
className: n("flex cursor-pointer touch-none items-center gap-2 rounded border border-zinc-200 bg-white px-2 py-1.5 text-[12px]/[16px]", "font-bold text-zinc-600 shadow-md transition-colors select-none hover:bg-zinc-50", "dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"),
|
|
45
|
+
title: "Plitzi dev tools — drag to the other corner",
|
|
46
|
+
onPointerDown: w,
|
|
47
|
+
onPointerMove: T,
|
|
48
|
+
onPointerUp: E,
|
|
49
|
+
onClick: D,
|
|
28
50
|
children: [
|
|
29
51
|
"Plitzi",
|
|
30
|
-
|
|
52
|
+
S > 0 && /* @__PURE__ */ d("span", {
|
|
31
53
|
className: "flex items-center gap-1 text-red-600 dark:text-red-400",
|
|
32
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ u("i", { className: "fa-regular fa-circle-xmark text-[11px]" }), S]
|
|
33
55
|
}),
|
|
34
|
-
|
|
56
|
+
C > 0 && /* @__PURE__ */ d("span", {
|
|
35
57
|
className: "flex items-center gap-1 text-amber-600 dark:text-amber-400",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ u("i", { className: "fa-solid fa-triangle-exclamation text-[11px]" }), C]
|
|
37
59
|
}),
|
|
38
|
-
|
|
60
|
+
S === 0 && C === 0 && /* @__PURE__ */ u("i", { className: "fa-solid fa-terminal text-[11px] text-zinc-400" })
|
|
39
61
|
]
|
|
40
62
|
})
|
|
41
63
|
});
|
|
42
64
|
};
|
|
43
65
|
//#endregion
|
|
44
|
-
export {
|
|
66
|
+
export { p as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The bottom corner the dev-tools badge sits in. */
|
|
2
|
+
export type IndicatorSide = 'left' | 'right';
|
|
3
|
+
/** The side a badge dropped at `x` lands on: whichever half of its container the pointer let go in. */
|
|
4
|
+
export declare const sideAt: (x: number, container: {
|
|
5
|
+
left: number;
|
|
6
|
+
width: number;
|
|
7
|
+
}) => IndicatorSide;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Orientation } from '../../DevToolsContainer';
|
|
2
2
|
import { LogType } from '@plitzi/sdk-shared';
|
|
3
|
-
import { RefObject } from 'react';
|
|
4
3
|
export type DevToolsOverlayProps = {
|
|
5
4
|
className?: string;
|
|
6
5
|
collapsed: boolean;
|
|
@@ -11,10 +10,10 @@ export type DevToolsOverlayProps = {
|
|
|
11
10
|
onCollapse: () => void;
|
|
12
11
|
onTabSelect: (tabSelected: string) => void;
|
|
13
12
|
onChangeOrientation: (orientation: Orientation) => void;
|
|
14
|
-
/** The page's own box, which the QA tools draw over and look in. */
|
|
15
|
-
pageRef: RefObject<HTMLElement | null>;
|
|
16
13
|
/** Whether the QA tab and its layer are offered: only over a page — see `DevToolsContainer`. */
|
|
17
14
|
qa: boolean;
|
|
15
|
+
/** Whether the page's server previews a run, for the Run tab — see `DevToolsContainer`. */
|
|
16
|
+
run: boolean;
|
|
18
17
|
};
|
|
19
|
-
declare const DevToolsOverlay: ({ className, collapsed, orientation, tabSelected, logTypeFilter, onOpen, onCollapse, onTabSelect, onChangeOrientation,
|
|
18
|
+
declare const DevToolsOverlay: ({ className, collapsed, orientation, tabSelected, logTypeFilter, onOpen, onCollapse, onTabSelect, onChangeOrientation, qa, run }: DevToolsOverlayProps) => import('react').JSX.Element;
|
|
20
19
|
export default DevToolsOverlay;
|
|
@@ -4,7 +4,7 @@ import n from "../../qa/QaLayer.mjs";
|
|
|
4
4
|
import r from "../DevToolsPanel/index.mjs";
|
|
5
5
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/DevToolsOverlay/DevToolsOverlay.tsx
|
|
7
|
-
var s = ({ className: s, collapsed: c, orientation: l, tabSelected: u, logTypeFilter: d, onOpen: f, onCollapse: p, onTabSelect: m, onChangeOrientation: h,
|
|
7
|
+
var s = ({ className: s, collapsed: c, orientation: l, tabSelected: u, logTypeFilter: d, onOpen: f, onCollapse: p, onTabSelect: m, onChangeOrientation: h, qa: g, run: _ }) => {
|
|
8
8
|
let v = /* @__PURE__ */ o(i, { children: [c && /* @__PURE__ */ a(e, {
|
|
9
9
|
className: s,
|
|
10
10
|
onOpen: f
|
|
@@ -13,13 +13,13 @@ var s = ({ className: s, collapsed: c, orientation: l, tabSelected: u, logTypeFi
|
|
|
13
13
|
orientation: l,
|
|
14
14
|
tabSelected: u,
|
|
15
15
|
logTypeFilter: d,
|
|
16
|
-
qa:
|
|
16
|
+
qa: g,
|
|
17
|
+
run: _,
|
|
17
18
|
onCollapse: p,
|
|
18
19
|
onTabSelect: m,
|
|
19
20
|
onChangeOrientation: h
|
|
20
21
|
})] });
|
|
21
|
-
return
|
|
22
|
-
pageRef: g,
|
|
22
|
+
return g ? /* @__PURE__ */ o(t, {
|
|
23
23
|
collapsed: c,
|
|
24
24
|
children: [/* @__PURE__ */ a(n, {}), v]
|
|
25
25
|
}) : v;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LogType } from '@plitzi/sdk-shared';
|
|
2
|
+
import { RunSnapshot } from '@plitzi/sdk-shared/runs';
|
|
2
3
|
export type DevToolsBodyProps = {
|
|
3
4
|
className?: string;
|
|
4
5
|
tabSelected?: string;
|
|
@@ -8,6 +9,8 @@ export type DevToolsBodyProps = {
|
|
|
8
9
|
onSelectElement: (id?: string) => void;
|
|
9
10
|
/** Whether the QA tab is offered. */
|
|
10
11
|
qa?: boolean;
|
|
12
|
+
/** The run of agents a preview serves the page from, when one does. */
|
|
13
|
+
run?: RunSnapshot;
|
|
11
14
|
};
|
|
12
|
-
declare const DevToolsBody: ({ className, tabSelected, orientation, logTypeFilter, elementSelected, onSelectElement, qa }: DevToolsBodyProps) => import('react').JSX.Element;
|
|
15
|
+
declare const DevToolsBody: ({ className, tabSelected, orientation, logTypeFilter, elementSelected, onSelectElement, qa, run }: DevToolsBodyProps) => import('react').JSX.Element;
|
|
13
16
|
export default DevToolsBody;
|
|
@@ -6,43 +6,45 @@ import i from "./tabs/HistoryViewer/index.mjs";
|
|
|
6
6
|
import a from "./tabs/Logs/index.mjs";
|
|
7
7
|
import o from "./tabs/PluginsViewer/PluginsViewer.mjs";
|
|
8
8
|
import s from "./tabs/QaViewer/index.mjs";
|
|
9
|
-
import c from "./tabs/
|
|
10
|
-
import l from "./tabs/
|
|
11
|
-
import u from "./tabs/
|
|
12
|
-
import d from "
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
9
|
+
import c from "./tabs/RunViewer/index.mjs";
|
|
10
|
+
import l from "./tabs/StoreViewer/index.mjs";
|
|
11
|
+
import u from "./tabs/TracingViewer/TracingViewer.mjs";
|
|
12
|
+
import d from "./tabs/VariablesViewer/index.mjs";
|
|
13
|
+
import f from "clsx";
|
|
14
|
+
import { use as p } from "react";
|
|
15
|
+
import { DevToolsContext as m } from "@plitzi/sdk-shared/devTools/react";
|
|
16
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
16
17
|
//#region src/components/DevToolsPanel/DevToolsBody.tsx
|
|
17
|
-
var
|
|
18
|
-
let { logs:
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className:
|
|
21
|
-
children: /* @__PURE__ */
|
|
22
|
-
className: "flex w-full flex-col",
|
|
18
|
+
var _ = ({ className: _, tabSelected: v, orientation: y, logTypeFilter: b, elementSelected: x, onSelectElement: S, qa: C = !1, run: w }) => {
|
|
19
|
+
let { logs: T, clearLogs: E } = p(m);
|
|
20
|
+
return /* @__PURE__ */ h("div", {
|
|
21
|
+
className: f("flex min-h-0 w-full flex-1 overflow-auto bg-white dark:bg-zinc-900", _),
|
|
22
|
+
children: /* @__PURE__ */ g("div", {
|
|
23
|
+
className: "flex min-h-0 w-full flex-col",
|
|
23
24
|
children: [
|
|
24
|
-
|
|
25
|
-
items:
|
|
26
|
-
orientation:
|
|
27
|
-
logTypeFilter:
|
|
28
|
-
onClear:
|
|
25
|
+
v === "logs" && /* @__PURE__ */ h(a, {
|
|
26
|
+
items: T,
|
|
27
|
+
orientation: y,
|
|
28
|
+
logTypeFilter: b,
|
|
29
|
+
onClear: E
|
|
29
30
|
}),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
elementSelected:
|
|
37
|
-
onSelectElement:
|
|
31
|
+
v === "store" && /* @__PURE__ */ h(l, { elementSelected: x }),
|
|
32
|
+
v === "cache" && /* @__PURE__ */ h(t, {}),
|
|
33
|
+
v === "history" && /* @__PURE__ */ h(i, {}),
|
|
34
|
+
v === "variables" && /* @__PURE__ */ h(d, {}),
|
|
35
|
+
v === "flags" && /* @__PURE__ */ h(r, {}),
|
|
36
|
+
v === "elements" && /* @__PURE__ */ h(n, {
|
|
37
|
+
elementSelected: x,
|
|
38
|
+
onSelectElement: S
|
|
38
39
|
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
v === "plugins" && /* @__PURE__ */ h(o, {}),
|
|
41
|
+
v === "tracing" && /* @__PURE__ */ h(u, {}),
|
|
42
|
+
v === "actions" && /* @__PURE__ */ h(e, {}),
|
|
43
|
+
C && v === "qa" && /* @__PURE__ */ h(s, {}),
|
|
44
|
+
v === "run" && /* @__PURE__ */ h(c, { snapshot: w })
|
|
43
45
|
]
|
|
44
46
|
})
|
|
45
47
|
});
|
|
46
48
|
};
|
|
47
49
|
//#endregion
|
|
48
|
-
export {
|
|
50
|
+
export { _ as default };
|
|
@@ -4,7 +4,9 @@ export type DevToolsButtonProps = {
|
|
|
4
4
|
isSelected?: boolean;
|
|
5
5
|
iconClassName?: string;
|
|
6
6
|
title?: string;
|
|
7
|
+
/** Offered and not to be pressed now: its title says why. */
|
|
8
|
+
disabled?: boolean;
|
|
7
9
|
onClick?: (e: MouseEvent) => void;
|
|
8
10
|
};
|
|
9
|
-
declare const DevToolsButton: ({ className, iconClassName, title, isSelected, onClick }: DevToolsButtonProps) => import('react').JSX.Element;
|
|
11
|
+
declare const DevToolsButton: ({ className, iconClassName, title, isSelected, disabled, onClick }: DevToolsButtonProps) => import('react').JSX.Element;
|
|
10
12
|
export default DevToolsButton;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import e from "clsx";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/DevToolsPanel/DevToolsButton.tsx
|
|
4
|
-
var n = ({ className: n, iconClassName: r, title: i, isSelected: a = !1,
|
|
5
|
-
className: e("flex h-6 w-6 cursor-pointer items-center justify-center rounded transition-colors", {
|
|
4
|
+
var n = ({ className: n, iconClassName: r, title: i, isSelected: a = !1, disabled: o = !1, onClick: s }) => /* @__PURE__ */ t("button", {
|
|
5
|
+
className: e("flex h-6 w-6 cursor-pointer items-center justify-center rounded transition-colors disabled:cursor-not-allowed disabled:opacity-40", {
|
|
6
6
|
"bg-violet-500/10 text-violet-600 dark:bg-violet-500/20 dark:text-violet-400": a,
|
|
7
7
|
"text-zinc-500 hover:bg-zinc-200 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100": !a
|
|
8
8
|
}, n),
|
|
9
9
|
title: i,
|
|
10
|
-
|
|
10
|
+
disabled: o,
|
|
11
|
+
onClick: s,
|
|
11
12
|
children: /* @__PURE__ */ t("i", { className: e("text-xs", r) })
|
|
12
13
|
});
|
|
13
14
|
//#endregion
|
|
@@ -8,6 +8,8 @@ export type DevToolsHeaderProps = {
|
|
|
8
8
|
onTabSelect?: (tabIndex: string) => void;
|
|
9
9
|
/** Whether the QA tab is offered. */
|
|
10
10
|
qa?: boolean;
|
|
11
|
+
/** Whether the Run tab is offered: a run's preview serves the page. */
|
|
12
|
+
run?: boolean;
|
|
11
13
|
};
|
|
12
|
-
declare const DevToolsHeader: ({ tabSelected, orientation, onChangeOrientation, onCollapse, onTabSelect, qa }: DevToolsHeaderProps) => import('react').JSX.Element;
|
|
14
|
+
declare const DevToolsHeader: ({ tabSelected, orientation, onChangeOrientation, onCollapse, onTabSelect, qa, run }: DevToolsHeaderProps) => import('react').JSX.Element;
|
|
13
15
|
export default DevToolsHeader;
|