@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.
Files changed (55) hide show
  1. package/CHANGELOG.md +162 -1
  2. package/dist/DevToolsContainer.d.ts +11 -1
  3. package/dist/DevToolsContainer.mjs +68 -62
  4. package/dist/DevToolsContextProvider.mjs +5 -3
  5. package/dist/PageContext.d.ts +7 -0
  6. package/dist/PageContext.mjs +6 -0
  7. package/dist/agentInspector/flowRuns.d.ts +1 -1
  8. package/dist/agentInspector/flowRuns.mjs +22 -15
  9. package/dist/agentInspector/index.d.ts +2 -0
  10. package/dist/agentInspector/index.mjs +1 -0
  11. package/dist/agentInspector/inspector.d.ts +31 -1
  12. package/dist/agentInspector/inspector.mjs +57 -19
  13. package/dist/agentInspector/report.d.ts +27 -2
  14. package/dist/agentInspector/report.mjs +59 -38
  15. package/dist/agentInspector/useAgentInspector.d.ts +3 -2
  16. package/dist/agentInspector/useAgentInspector.mjs +20 -16
  17. package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +47 -25
  18. package/dist/components/DevToolsIndicator/sideAt.d.ts +7 -0
  19. package/dist/components/DevToolsIndicator/sideAt.mjs +4 -0
  20. package/dist/components/DevToolsOverlay/DevToolsOverlay.d.ts +3 -4
  21. package/dist/components/DevToolsOverlay/DevToolsOverlay.mjs +4 -4
  22. package/dist/components/DevToolsPanel/DevToolsBody.d.ts +4 -1
  23. package/dist/components/DevToolsPanel/DevToolsBody.mjs +33 -31
  24. package/dist/components/DevToolsPanel/DevToolsButton.d.ts +3 -1
  25. package/dist/components/DevToolsPanel/DevToolsButton.mjs +4 -3
  26. package/dist/components/DevToolsPanel/DevToolsHeader.d.ts +3 -1
  27. package/dist/components/DevToolsPanel/DevToolsHeader.mjs +52 -34
  28. package/dist/components/DevToolsPanel/DevToolsPanel.d.ts +3 -1
  29. package/dist/components/DevToolsPanel/DevToolsPanel.mjs +50 -47
  30. package/dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.mjs +2 -2
  31. package/dist/components/DevToolsPanel/tabs/RunViewer/RunReport.d.ts +7 -0
  32. package/dist/components/DevToolsPanel/tabs/RunViewer/RunReport.mjs +97 -0
  33. package/dist/components/DevToolsPanel/tabs/RunViewer/RunTaskRow.d.ts +6 -0
  34. package/dist/components/DevToolsPanel/tabs/RunViewer/RunTaskRow.mjs +79 -0
  35. package/dist/components/DevToolsPanel/tabs/RunViewer/RunViewer.d.ts +11 -0
  36. package/dist/components/DevToolsPanel/tabs/RunViewer/RunViewer.mjs +222 -0
  37. package/dist/components/DevToolsPanel/tabs/RunViewer/index.d.ts +3 -0
  38. package/dist/components/DevToolsPanel/tabs/RunViewer/index.mjs +6 -0
  39. package/dist/components/DevToolsPanel/tabs/RunViewer/reportHelpers.d.ts +9 -0
  40. package/dist/components/DevToolsPanel/tabs/RunViewer/reportHelpers.mjs +39 -0
  41. package/dist/components/DevToolsPanel/tabs/RunViewer/stepRecorder.d.ts +27 -0
  42. package/dist/components/DevToolsPanel/tabs/RunViewer/stepRecorder.mjs +51 -0
  43. package/dist/components/DevToolsPanel/tabs/RunViewer/usePointAt.d.ts +14 -0
  44. package/dist/components/DevToolsPanel/tabs/RunViewer/usePointAt.mjs +33 -0
  45. package/dist/components/DevToolsPanel/tabs/RunViewer/useRunSnapshot.d.ts +9 -0
  46. package/dist/components/DevToolsPanel/tabs/RunViewer/useRunSnapshot.mjs +22 -0
  47. package/dist/qa/QaContext.d.ts +2 -5
  48. package/dist/qa/QaContext.mjs +28 -31
  49. package/dist/qa/QaLayer.mjs +78 -77
  50. package/dist/qa/overlays/QaInspector.mjs +28 -27
  51. package/dist/qa/overlays/QaTabOrder.mjs +2 -2
  52. package/dist/qa/overlays/QaXrayTags.mjs +22 -22
  53. package/dist/useNarrowWindow.d.ts +8 -0
  54. package/dist/useNarrowWindow.mjs +13 -0
  55. package/package.json +4 -4
@@ -1,63 +1,64 @@
1
- import { NO_FINDINGS as e } from "./findings.mjs";
2
- import { QA_CHECKS as t, QA_FINDING_ATTRIBUTE as n, QA_PAGE_ATTRIBUTE as r, REDUCED_MOTION_CLASS as i, isQaActive as a } from "./qaSettings.mjs";
3
- import { NO_XRAY_COUNTS as o, XRAY_ATTRIBUTE as s, xrayMarksOf as c } from "./xray.mjs";
4
- import l from "./QaContext.mjs";
5
- import { CHECKS as u } from "./checks/index.mjs";
6
- import d from "./overlays/QaGrid.mjs";
7
- import f from "./overlays/QaInspector.mjs";
8
- import p from "./overlays/QaTabOrder.mjs";
9
- import m from "./overlays/QaViewport.mjs";
10
- import h from "./overlays/QaXrayTags.mjs";
11
- import { VISION_MATRIX as g, qaCss as _, visionFilterId as v } from "./qaCss.mjs";
12
- import y from "./usePageBox.mjs";
13
- import { use as b, useEffect as x, useMemo as S } from "react";
14
- import { useCommonStore as C } from "@plitzi/sdk-shared/store";
15
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
16
- import { treeOf as D } from "@plitzi/sdk-schema";
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 O = "http://www.w3.org/2000/svg", k = 250, A = 1e3, j = 200, M = .25, N = () => {
19
- let { settings: N, pageRef: P, round: F, setFindings: I, setXrayCounts: L } = b(l), [[R, z, B]] = C([
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
- ]), V = y(P), H = a(N), U = S(() => _(N), [N]), W = S(() => t.filter((e) => N.checks[e]).join(" "), [N.checks]);
24
- return x(() => {
25
- let e = P.current;
26
- if (e && H) return e.setAttribute(r, ""), () => e.removeAttribute(r);
27
- }, [H, P]), x(() => {
28
- if (!U) return;
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 = U, document.head.append(e), () => e.remove();
31
- }, [U]), x(() => {
32
- if (N.reducedMotion) return document.documentElement.classList.add(i), () => document.documentElement.classList.remove(i);
33
- }, [N.reducedMotion]), x(() => {
34
- let e = N.vision;
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(O, "svg");
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(O, "filter");
39
- n.setAttribute("id", v(e));
40
- let r = document.createElementNS(O, "feColorMatrix");
41
- return r.setAttribute("type", "matrix"), r.setAttribute("values", g[e]), n.append(r), t.append(n), document.body.append(t), () => t.remove();
42
- }, [N.vision]), x(() => {
43
- let e = P.current;
44
- if (!e || !N.xray) {
45
- L(o);
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 = { ...o };
50
+ let t = { ...s };
50
51
  e.querySelectorAll("[data-plitzi-el]").forEach((e) => {
51
- let n = e.getAttribute("data-plitzi-el") ?? "", r = D({
52
- flat: z,
53
- components: B
54
- }, n)?.flat[n]?.definition, i = r ? c(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(s) : e.getAttribute("data-plitzi-qa-xray") !== i.join(" ") && e.setAttribute(s, i.join(" "));
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, j);
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(`[${s}]`).forEach((e) => e.removeAttribute(s));
69
+ clearTimeout(t), i.disconnect(), e.querySelectorAll(`[${c}]`).forEach((e) => e.removeAttribute(c));
69
70
  };
70
71
  }, [
71
- N.xray,
72
- P,
73
- z,
74
- B,
72
+ P.xray,
75
73
  R,
74
+ B,
75
+ V,
76
+ z,
76
77
  L
77
- ]), x(() => {
78
- let e = P.current;
79
- if (!e || !N.slowMotion) return;
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(M);
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
- }, [N.slowMotion, P]), x(() => {
87
- let r = P.current, i = t.filter((e) => W.split(" ").includes(e));
88
- if (!r || i.length === 0) {
89
- I(e);
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(n));
94
- let t = { ...e };
95
- for (let e of i) t[e] = u[e].run(r);
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) => t[e].forEach(({ element: t }) => o.set(t, [...o.get(t) ?? [], e]))), o.forEach((e, t) => t.setAttribute(n, e.join(" "))), a = [...o.keys()], I(t);
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: A }) : o();
100
- }, d = () => {
101
- clearTimeout(s), c !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(c), s = setTimeout(l, k);
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 d(), window.addEventListener("resize", d), () => {
104
- clearTimeout(s), c !== void 0 && typeof cancelIdleCallback == "function" && cancelIdleCallback(c), window.removeEventListener("resize", d), a.forEach((e) => e.removeAttribute(n));
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
- W,
108
- P,
109
- F,
108
+ G,
110
109
  R,
110
+ F,
111
+ z,
111
112
  I
112
- ]), /* @__PURE__ */ E(w, { children: [
113
- N.grid && /* @__PURE__ */ T(d, { box: V }),
114
- N.xray && N.xrayFilter !== "none" && /* @__PURE__ */ T(h, { filter: N.xrayFilter }),
115
- N.tabOrder && /* @__PURE__ */ T(p, {}),
116
- N.inspect && /* @__PURE__ */ T(f, {}),
117
- N.viewport && /* @__PURE__ */ T(m, { box: V })
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 { N as default };
122
+ export { P as default };
@@ -1,50 +1,51 @@
1
- import e from "../QaContext.mjs";
2
- import t from "./QaBoxModel.mjs";
3
- import n from "./QaMeasure.mjs";
4
- import r from "./QaTooltip.mjs";
5
- import { use as i, useEffect as a, useState as o } from "react";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
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 u = () => {
9
- let { pageRef: u, pinned: d, setPinned: f, setSetting: p } = i(e), [m, h] = o(), [g, _] = o(!1), [, v] = o(0);
10
- a(() => {
11
- let e = u.current;
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(() => v((e) => e + 1));
15
+ cancelAnimationFrame(n), n = requestAnimationFrame(() => y((e) => e + 1));
15
16
  }, i = (e) => {
16
- _(e.altKey), h(t(e.target) ? e.target : void 0);
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
- _(e.altKey), e.type === "keydown" && e.key === "Escape" && p("inspect", !1);
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
- u,
27
+ m,
27
28
  f,
28
29
  p
29
30
  ]);
30
- let y = d?.isConnected ? d : void 0, b = y?.getBoundingClientRect();
31
- return /* @__PURE__ */ l(s, { children: [
32
- b && /* @__PURE__ */ c("div", {
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: b.left,
36
- top: b.top,
37
- width: b.width,
38
- height: b.height
36
+ left: x.left,
37
+ top: x.top,
38
+ width: x.width,
39
+ height: x.height
39
40
  }
40
41
  }),
41
- m && m !== y && /* @__PURE__ */ c(t, { element: m }),
42
- y && m && m !== y && g && /* @__PURE__ */ c(n, {
43
- from: y,
44
- to: m
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
- m && !g && /* @__PURE__ */ c(r, { element: m })
47
+ h && !_ && /* @__PURE__ */ l(i, { element: h })
47
48
  ] });
48
49
  };
49
50
  //#endregion
50
- export { u as default };
51
+ export { d as default };
@@ -1,10 +1,10 @@
1
- import e from "../QaContext.mjs";
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 { pageRef: c } = n(e), [l, u] = i([]), [, d] = i(0);
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 { XRAY as e, XRAY_ATTRIBUTE as t, XRAY_MARKS as n } from "../xray.mjs";
2
- import r from "../QaContext.mjs";
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) => n.some((t) => t === e), p = (e, n) => {
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(`[${t}]`)) {
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 (n !== "all" && !e.includes(n)) continue;
12
- let t = a.getBoundingClientRect();
13
- if (t.width === 0 || t.bottom < 0 || t.top > window.innerHeight) continue;
14
- let o = (e) => `${String(Math.round(t.left))}:${String(Math.round(e))}`, s = t.top >= d ? t.top - d + 1 : Math.max(t.top, 0);
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: t.left,
19
+ left: n.left,
20
20
  top: s
21
21
  }));
22
22
  }
23
23
  return r;
24
- }, m = ({ filter: n }) => {
25
- let { pageRef: u } = i(r), [d, f] = o([]);
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 r = 0, i = () => {
30
- cancelAnimationFrame(r), r = requestAnimationFrame(() => f(p(e, n)));
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: [t]
37
+ attributeFilter: [n]
38
38
  }), document.addEventListener("scroll", i, !0), window.addEventListener("resize", i), () => {
39
- cancelAnimationFrame(r), a.disconnect(), document.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
39
+ cancelAnimationFrame(t), a.disconnect(), document.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
40
40
  };
41
- }, [u, n]), /* @__PURE__ */ c(s, { children: d.map(({ id: t, marks: n, left: r, top: i }) => /* @__PURE__ */ l("span", {
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((t) => /* @__PURE__ */ c("span", {
48
- title: e[t].label,
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[t].colour }
51
- }, t)), /* @__PURE__ */ c("span", {
50
+ style: { backgroundColor: t[e].colour }
51
+ }, e)), /* @__PURE__ */ c("span", {
52
52
  className: "truncate",
53
- children: t
53
+ children: e
54
54
  })]
55
- }, `${t}-${String(r)}-${String(i)}`)) });
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.38.24",
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.34",
48
- "@plitzi/sdk-schema": "0.38.24",
49
- "@plitzi/sdk-shared": "0.38.24",
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
  }