@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
package/dist/qa/QaLayer.mjs
CHANGED
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import l from "./
|
|
5
|
-
import
|
|
6
|
-
import d from "./
|
|
7
|
-
import f from "./overlays/
|
|
8
|
-
import p from "./overlays/
|
|
9
|
-
import m from "./overlays/
|
|
10
|
-
import h from "./overlays/
|
|
11
|
-
import
|
|
12
|
-
import y from "./
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
1
|
+
import e from "../PageContext.mjs";
|
|
2
|
+
import { NO_FINDINGS as t } from "./findings.mjs";
|
|
3
|
+
import { QA_CHECKS as n, QA_FINDING_ATTRIBUTE as r, QA_PAGE_ATTRIBUTE as i, REDUCED_MOTION_CLASS as a, isQaActive as o } from "./qaSettings.mjs";
|
|
4
|
+
import { NO_XRAY_COUNTS as s, XRAY_ATTRIBUTE as c, xrayMarksOf as l } from "./xray.mjs";
|
|
5
|
+
import u from "./QaContext.mjs";
|
|
6
|
+
import { CHECKS as d } from "./checks/index.mjs";
|
|
7
|
+
import f from "./overlays/QaGrid.mjs";
|
|
8
|
+
import p from "./overlays/QaInspector.mjs";
|
|
9
|
+
import m from "./overlays/QaTabOrder.mjs";
|
|
10
|
+
import h from "./overlays/QaViewport.mjs";
|
|
11
|
+
import g from "./overlays/QaXrayTags.mjs";
|
|
12
|
+
import { VISION_MATRIX as _, qaCss as v, visionFilterId as y } from "./qaCss.mjs";
|
|
13
|
+
import b from "./usePageBox.mjs";
|
|
14
|
+
import { use as x, useEffect as S, useMemo as C } from "react";
|
|
15
|
+
import { useCommonStore as w } from "@plitzi/sdk-shared/store";
|
|
16
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
17
|
+
import { treeOf as O } from "@plitzi/sdk-schema";
|
|
17
18
|
//#region src/qa/QaLayer.tsx
|
|
18
|
-
var
|
|
19
|
-
let { settings:
|
|
19
|
+
var k = "http://www.w3.org/2000/svg", A = 250, j = 1e3, M = 200, N = .25, P = () => {
|
|
20
|
+
let { settings: P, round: F, setFindings: I, setXrayCounts: L } = x(u), R = x(e), [[z, B, V]] = w([
|
|
20
21
|
"navigation.currentPageId",
|
|
21
22
|
"schema.flat",
|
|
22
23
|
"schema.components"
|
|
23
|
-
]),
|
|
24
|
-
return
|
|
25
|
-
let e =
|
|
26
|
-
if (e &&
|
|
27
|
-
}, [
|
|
28
|
-
if (!
|
|
24
|
+
]), H = b(R), U = o(P), W = C(() => v(P), [P]), G = C(() => n.filter((e) => P.checks[e]).join(" "), [P.checks]);
|
|
25
|
+
return S(() => {
|
|
26
|
+
let e = R.current;
|
|
27
|
+
if (e && U) return e.setAttribute(i, ""), () => e.removeAttribute(i);
|
|
28
|
+
}, [U, R]), S(() => {
|
|
29
|
+
if (!W) return;
|
|
29
30
|
let e = document.createElement("style");
|
|
30
|
-
return e.setAttribute("data-plitzi-qa", ""), e.textContent =
|
|
31
|
-
}, [
|
|
32
|
-
if (
|
|
33
|
-
}, [
|
|
34
|
-
let e =
|
|
31
|
+
return e.setAttribute("data-plitzi-qa", ""), e.textContent = W, document.head.append(e), () => e.remove();
|
|
32
|
+
}, [W]), S(() => {
|
|
33
|
+
if (P.reducedMotion) return document.documentElement.classList.add(a), () => document.documentElement.classList.remove(a);
|
|
34
|
+
}, [P.reducedMotion]), S(() => {
|
|
35
|
+
let e = P.vision;
|
|
35
36
|
if (e !== "protanopia" && e !== "deuteranopia" && e !== "tritanopia") return;
|
|
36
|
-
let t = document.createElementNS(
|
|
37
|
+
let t = document.createElementNS(k, "svg");
|
|
37
38
|
t.setAttribute("aria-hidden", "true"), t.setAttribute("style", "position: absolute; width: 0; height: 0");
|
|
38
|
-
let n = document.createElementNS(
|
|
39
|
-
n.setAttribute("id",
|
|
40
|
-
let r = document.createElementNS(
|
|
41
|
-
return r.setAttribute("type", "matrix"), r.setAttribute("values",
|
|
42
|
-
}, [
|
|
43
|
-
let e =
|
|
44
|
-
if (!e || !
|
|
45
|
-
L(
|
|
39
|
+
let n = document.createElementNS(k, "filter");
|
|
40
|
+
n.setAttribute("id", y(e));
|
|
41
|
+
let r = document.createElementNS(k, "feColorMatrix");
|
|
42
|
+
return r.setAttribute("type", "matrix"), r.setAttribute("values", _[e]), n.append(r), t.append(n), document.body.append(t), () => t.remove();
|
|
43
|
+
}, [P.vision]), S(() => {
|
|
44
|
+
let e = R.current;
|
|
45
|
+
if (!e || !P.xray) {
|
|
46
|
+
L(s);
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
let t, n = () => {
|
|
49
|
-
let t = { ...
|
|
50
|
+
let t = { ...s };
|
|
50
51
|
e.querySelectorAll("[data-plitzi-el]").forEach((e) => {
|
|
51
|
-
let n = e.getAttribute("data-plitzi-el") ?? "", r =
|
|
52
|
-
flat:
|
|
53
|
-
components:
|
|
54
|
-
}, n)?.flat[n]?.definition, i = r ?
|
|
52
|
+
let n = e.getAttribute("data-plitzi-el") ?? "", r = O({
|
|
53
|
+
flat: B,
|
|
54
|
+
components: V
|
|
55
|
+
}, n)?.flat[n]?.definition, i = r ? l(r) : [];
|
|
55
56
|
i.forEach((e) => {
|
|
56
57
|
t[e] += 1;
|
|
57
|
-
}), i.length === 0 ? e.removeAttribute(
|
|
58
|
+
}), i.length === 0 ? e.removeAttribute(c) : e.getAttribute("data-plitzi-qa-xray") !== i.join(" ") && e.setAttribute(c, i.join(" "));
|
|
58
59
|
}), L(t);
|
|
59
60
|
}, r = () => {
|
|
60
|
-
clearTimeout(t), t = setTimeout(n,
|
|
61
|
+
clearTimeout(t), t = setTimeout(n, M);
|
|
61
62
|
};
|
|
62
63
|
n();
|
|
63
64
|
let i = new MutationObserver(r);
|
|
@@ -65,57 +66,57 @@ var O = "http://www.w3.org/2000/svg", k = 250, A = 1e3, j = 200, M = .25, N = ()
|
|
|
65
66
|
childList: !0,
|
|
66
67
|
subtree: !0
|
|
67
68
|
}), () => {
|
|
68
|
-
clearTimeout(t), i.disconnect(), e.querySelectorAll(`[${
|
|
69
|
+
clearTimeout(t), i.disconnect(), e.querySelectorAll(`[${c}]`).forEach((e) => e.removeAttribute(c));
|
|
69
70
|
};
|
|
70
71
|
}, [
|
|
71
|
-
|
|
72
|
-
P,
|
|
73
|
-
z,
|
|
74
|
-
B,
|
|
72
|
+
P.xray,
|
|
75
73
|
R,
|
|
74
|
+
B,
|
|
75
|
+
V,
|
|
76
|
+
z,
|
|
76
77
|
L
|
|
77
|
-
]),
|
|
78
|
-
let e =
|
|
79
|
-
if (!e || !
|
|
78
|
+
]), S(() => {
|
|
79
|
+
let e = R.current;
|
|
80
|
+
if (!e || !P.slowMotion) return;
|
|
80
81
|
let t = (t) => e.getAnimations({ subtree: !0 }).forEach((e) => {
|
|
81
82
|
e.playbackRate = t;
|
|
82
|
-
}), n = () => t(
|
|
83
|
+
}), n = () => t(N);
|
|
83
84
|
return n(), e.addEventListener("animationstart", n), e.addEventListener("transitionrun", n), () => {
|
|
84
85
|
e.removeEventListener("animationstart", n), e.removeEventListener("transitionrun", n), t(1);
|
|
85
86
|
};
|
|
86
|
-
}, [
|
|
87
|
-
let
|
|
88
|
-
if (!
|
|
89
|
-
I(
|
|
87
|
+
}, [P.slowMotion, R]), S(() => {
|
|
88
|
+
let e = R.current, i = n.filter((e) => G.split(" ").includes(e));
|
|
89
|
+
if (!e || i.length === 0) {
|
|
90
|
+
I(t);
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
93
|
let a = [], o = () => {
|
|
93
|
-
a.forEach((e) => e.removeAttribute(
|
|
94
|
-
let
|
|
95
|
-
for (let
|
|
94
|
+
a.forEach((e) => e.removeAttribute(r));
|
|
95
|
+
let n = { ...t };
|
|
96
|
+
for (let t of i) n[t] = d[t].run(e);
|
|
96
97
|
let o = /* @__PURE__ */ new Map();
|
|
97
|
-
i.forEach((e) =>
|
|
98
|
+
i.forEach((e) => n[e].forEach(({ element: t }) => o.set(t, [...o.get(t) ?? [], e]))), o.forEach((e, t) => t.setAttribute(r, e.join(" "))), a = [...o.keys()], I(n);
|
|
98
99
|
}, s, c, l = () => {
|
|
99
|
-
typeof requestIdleCallback == "function" ? c = requestIdleCallback(o, { timeout:
|
|
100
|
-
},
|
|
101
|
-
clearTimeout(s), c !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(c), s = setTimeout(l,
|
|
100
|
+
typeof requestIdleCallback == "function" ? c = requestIdleCallback(o, { timeout: j }) : o();
|
|
101
|
+
}, u = () => {
|
|
102
|
+
clearTimeout(s), c !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(c), s = setTimeout(l, A);
|
|
102
103
|
};
|
|
103
|
-
return
|
|
104
|
-
clearTimeout(s), c !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(c), window.removeEventListener("resize",
|
|
104
|
+
return u(), window.addEventListener("resize", u), () => {
|
|
105
|
+
clearTimeout(s), c !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(c), window.removeEventListener("resize", u), a.forEach((e) => e.removeAttribute(r));
|
|
105
106
|
};
|
|
106
107
|
}, [
|
|
107
|
-
|
|
108
|
-
P,
|
|
109
|
-
F,
|
|
108
|
+
G,
|
|
110
109
|
R,
|
|
110
|
+
F,
|
|
111
|
+
z,
|
|
111
112
|
I
|
|
112
|
-
]), /* @__PURE__ */
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
]), /* @__PURE__ */ D(T, { children: [
|
|
114
|
+
P.grid && /* @__PURE__ */ E(f, { box: H }),
|
|
115
|
+
P.xray && P.xrayFilter !== "none" && /* @__PURE__ */ E(g, { filter: P.xrayFilter }),
|
|
116
|
+
P.tabOrder && /* @__PURE__ */ E(m, {}),
|
|
117
|
+
P.inspect && /* @__PURE__ */ E(p, {}),
|
|
118
|
+
P.viewport && /* @__PURE__ */ E(h, { box: H })
|
|
118
119
|
] });
|
|
119
120
|
};
|
|
120
121
|
//#endregion
|
|
121
|
-
export {
|
|
122
|
+
export { P as default };
|
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "./
|
|
4
|
-
import r from "./
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import e from "../../PageContext.mjs";
|
|
2
|
+
import t from "../QaContext.mjs";
|
|
3
|
+
import n from "./QaBoxModel.mjs";
|
|
4
|
+
import r from "./QaMeasure.mjs";
|
|
5
|
+
import i from "./QaTooltip.mjs";
|
|
6
|
+
import { use as a, useEffect as o, useState as s } from "react";
|
|
7
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
8
|
//#region src/qa/overlays/QaInspector.tsx
|
|
8
|
-
var
|
|
9
|
-
let {
|
|
10
|
-
|
|
11
|
-
let e =
|
|
9
|
+
var d = () => {
|
|
10
|
+
let { pinned: d, setPinned: f, setSetting: p } = a(t), m = a(e), [h, g] = s(), [_, v] = s(!1), [, y] = s(0);
|
|
11
|
+
o(() => {
|
|
12
|
+
let e = m.current;
|
|
12
13
|
if (!e) return;
|
|
13
14
|
let t = (t) => t instanceof Element && e.contains(t), n = 0, r = () => {
|
|
14
|
-
cancelAnimationFrame(n), n = requestAnimationFrame(() =>
|
|
15
|
+
cancelAnimationFrame(n), n = requestAnimationFrame(() => y((e) => e + 1));
|
|
15
16
|
}, i = (e) => {
|
|
16
|
-
|
|
17
|
+
v(e.altKey), g(t(e.target) ? e.target : void 0);
|
|
17
18
|
}, a = (e) => {
|
|
18
19
|
t(e.target) && (e.preventDefault(), e.stopPropagation(), f(e.target));
|
|
19
20
|
}, o = (e) => {
|
|
20
|
-
|
|
21
|
+
v(e.altKey), e.type === "keydown" && e.key === "Escape" && p("inspect", !1);
|
|
21
22
|
};
|
|
22
23
|
return document.addEventListener("pointermove", i, !0), document.addEventListener("click", a, !0), document.addEventListener("keydown", o, !0), document.addEventListener("keyup", o, !0), document.addEventListener("scroll", r, !0), window.addEventListener("resize", r), () => {
|
|
23
24
|
cancelAnimationFrame(n), document.removeEventListener("pointermove", i, !0), document.removeEventListener("click", a, !0), document.removeEventListener("keydown", o, !0), document.removeEventListener("keyup", o, !0), document.removeEventListener("scroll", r, !0), window.removeEventListener("resize", r);
|
|
24
25
|
};
|
|
25
26
|
}, [
|
|
26
|
-
|
|
27
|
+
m,
|
|
27
28
|
f,
|
|
28
29
|
p
|
|
29
30
|
]);
|
|
30
|
-
let
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
31
|
+
let b = d?.isConnected ? d : void 0, x = b?.getBoundingClientRect();
|
|
32
|
+
return /* @__PURE__ */ u(c, { children: [
|
|
33
|
+
x && /* @__PURE__ */ l("div", {
|
|
33
34
|
className: "pointer-events-none fixed z-[999998] box-border outline-2 outline-violet-500",
|
|
34
35
|
style: {
|
|
35
|
-
left:
|
|
36
|
-
top:
|
|
37
|
-
width:
|
|
38
|
-
height:
|
|
36
|
+
left: x.left,
|
|
37
|
+
top: x.top,
|
|
38
|
+
width: x.width,
|
|
39
|
+
height: x.height
|
|
39
40
|
}
|
|
40
41
|
}),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
from:
|
|
44
|
-
to:
|
|
42
|
+
h && h !== b && /* @__PURE__ */ l(n, { element: h }),
|
|
43
|
+
b && h && h !== b && _ && /* @__PURE__ */ l(r, {
|
|
44
|
+
from: b,
|
|
45
|
+
to: h
|
|
45
46
|
}),
|
|
46
|
-
|
|
47
|
+
h && !_ && /* @__PURE__ */ l(i, { element: h })
|
|
47
48
|
] });
|
|
48
49
|
};
|
|
49
50
|
//#endregion
|
|
50
|
-
export {
|
|
51
|
+
export { d as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import e from "
|
|
1
|
+
import e from "../../PageContext.mjs";
|
|
2
2
|
import { tabOrderOf as t } from "../tabOrder.mjs";
|
|
3
3
|
import { use as n, useEffect as r, useState as i } from "react";
|
|
4
4
|
import { Fragment as a, jsx as o } from "react/jsx-runtime";
|
|
5
5
|
//#region src/qa/overlays/QaTabOrder.tsx
|
|
6
6
|
var s = 200, c = () => {
|
|
7
|
-
let
|
|
7
|
+
let c = n(e), [l, u] = i([]), [, d] = i(0);
|
|
8
8
|
return r(() => {
|
|
9
9
|
let e = c.current;
|
|
10
10
|
if (!e) return;
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import r from "../
|
|
1
|
+
import e from "../../PageContext.mjs";
|
|
2
|
+
import { XRAY as t, XRAY_ATTRIBUTE as n, XRAY_MARKS as r } from "../xray.mjs";
|
|
3
3
|
import { use as i, useEffect as a, useState as o } from "react";
|
|
4
4
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
//#region src/qa/overlays/QaXrayTags.tsx
|
|
6
|
-
var u = 150, d = 16, f = (e) =>
|
|
6
|
+
var u = 150, d = 16, f = (e) => r.some((t) => t === e), p = (e, t) => {
|
|
7
7
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
8
|
-
for (let a of e.querySelectorAll(`[${
|
|
8
|
+
for (let a of e.querySelectorAll(`[${n}]`)) {
|
|
9
9
|
if (r.length >= u) break;
|
|
10
10
|
let e = (a.getAttribute("data-plitzi-qa-xray") ?? "").split(" ").filter(f);
|
|
11
|
-
if (
|
|
12
|
-
let
|
|
13
|
-
if (
|
|
14
|
-
let o = (e) => `${String(Math.round(
|
|
11
|
+
if (t !== "all" && !e.includes(t)) continue;
|
|
12
|
+
let n = a.getBoundingClientRect();
|
|
13
|
+
if (n.width === 0 || n.bottom < 0 || n.top > window.innerHeight) continue;
|
|
14
|
+
let o = (e) => `${String(Math.round(n.left))}:${String(Math.round(e))}`, s = n.top >= d ? n.top - d + 1 : Math.max(n.top, 0);
|
|
15
15
|
for (let e = 0; e < 3 && i.has(o(s)); e += 1) s += d;
|
|
16
16
|
i.has(o(s)) || (i.add(o(s)), r.push({
|
|
17
17
|
id: a.getAttribute("data-plitzi-el") ?? "",
|
|
18
18
|
marks: e,
|
|
19
|
-
left:
|
|
19
|
+
left: n.left,
|
|
20
20
|
top: s
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
23
|
return r;
|
|
24
|
-
}, m = ({ filter:
|
|
25
|
-
let
|
|
24
|
+
}, m = ({ filter: r }) => {
|
|
25
|
+
let u = i(e), [d, f] = o([]);
|
|
26
26
|
return a(() => {
|
|
27
27
|
let e = u.current;
|
|
28
28
|
if (!e) return;
|
|
29
|
-
let
|
|
30
|
-
cancelAnimationFrame(
|
|
29
|
+
let t = 0, i = () => {
|
|
30
|
+
cancelAnimationFrame(t), t = requestAnimationFrame(() => f(p(e, r)));
|
|
31
31
|
};
|
|
32
32
|
i();
|
|
33
33
|
let a = new MutationObserver(i);
|
|
34
34
|
return a.observe(e, {
|
|
35
35
|
subtree: !0,
|
|
36
36
|
attributes: !0,
|
|
37
|
-
attributeFilter: [
|
|
37
|
+
attributeFilter: [n]
|
|
38
38
|
}), document.addEventListener("scroll", i, !0), window.addEventListener("resize", i), () => {
|
|
39
|
-
cancelAnimationFrame(
|
|
39
|
+
cancelAnimationFrame(t), a.disconnect(), document.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
|
|
40
40
|
};
|
|
41
|
-
}, [u,
|
|
41
|
+
}, [u, r]), /* @__PURE__ */ c(s, { children: d.map(({ id: e, marks: n, left: r, top: i }) => /* @__PURE__ */ l("span", {
|
|
42
42
|
className: "pointer-events-none fixed z-[999998] flex h-[15px] max-w-56 items-center gap-1 rounded-sm bg-zinc-900/85 px-1 font-mono text-[10px] leading-none text-white shadow-sm",
|
|
43
43
|
style: {
|
|
44
44
|
left: r,
|
|
45
45
|
top: i
|
|
46
46
|
},
|
|
47
|
-
children: [n.map((
|
|
48
|
-
title: e
|
|
47
|
+
children: [n.map((e) => /* @__PURE__ */ c("span", {
|
|
48
|
+
title: t[e].label,
|
|
49
49
|
className: "h-1.5 w-1.5 shrink-0 rounded-full",
|
|
50
|
-
style: { backgroundColor: e
|
|
51
|
-
},
|
|
50
|
+
style: { backgroundColor: t[e].colour }
|
|
51
|
+
}, e)), /* @__PURE__ */ c("span", {
|
|
52
52
|
className: "truncate",
|
|
53
|
-
children:
|
|
53
|
+
children: e
|
|
54
54
|
})]
|
|
55
|
-
}, `${
|
|
55
|
+
}, `${e}-${String(r)}-${String(i)}`)) });
|
|
56
56
|
};
|
|
57
57
|
//#endregion
|
|
58
58
|
export { m as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The narrowest window a side panel leaves a page beside it: the panel takes 500 px at least, and a page narrower than
|
|
3
|
+
* a phone's 400 is no page to work on — at 390 the side panel ran off the screen and covered the page whole.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SIDE_PANEL_WINDOW_MIN = 900;
|
|
6
|
+
/** Whether the window is too narrow for the panel beside the page — it docks at the bottom then — following it live. */
|
|
7
|
+
declare const useNarrowWindow: () => boolean;
|
|
8
|
+
export default useNarrowWindow;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
//#region src/useNarrowWindow.ts
|
|
3
|
+
var n = 900, r = "(max-width: 899px)", i = () => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(r) : void 0, a = () => {
|
|
4
|
+
let [n, r] = t(() => i()?.matches === !0);
|
|
5
|
+
return e(() => {
|
|
6
|
+
let e = i();
|
|
7
|
+
if (!e) return;
|
|
8
|
+
let t = () => r(e.matches);
|
|
9
|
+
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
10
|
+
}, []), n;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as SIDE_PANEL_WINDOW_MIN, a as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-dev-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.1",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@plitzi/nexus": "^1.4.0",
|
|
47
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
48
|
-
"@plitzi/sdk-schema": "0.
|
|
49
|
-
"@plitzi/sdk-shared": "0.
|
|
47
|
+
"@plitzi/plitzi-ui": "^1.6.36",
|
|
48
|
+
"@plitzi/sdk-schema": "0.39.1",
|
|
49
|
+
"@plitzi/sdk-shared": "0.39.1",
|
|
50
50
|
"@uiw/react-json-view": "^2.0.0-alpha.44",
|
|
51
51
|
"clsx": "^2.1.1"
|
|
52
52
|
}
|