pixelagent 0.1.4 → 0.1.6
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/dist/PixelAgent.d.ts +10 -2
- package/dist/PixelAgent.d.ts.map +1 -1
- package/dist/edit/submitApply.d.ts +5 -0
- package/dist/edit/submitApply.d.ts.map +1 -1
- package/dist/pixelagent.js +1106 -1051
- package/dist/pixelagent.js.map +1 -1
- package/package.json +3 -3
package/dist/pixelagent.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as A, useEffect as
|
|
3
|
-
import { getElementDisplayLabel as
|
|
1
|
+
import { jsxs as d, Fragment as Y, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, useEffect as B, useRef as V, useMemo as ue, useLayoutEffect as Ht, useCallback as I, useId as _t } from "react";
|
|
3
|
+
import { getElementDisplayLabel as $e, captureTextSnapshot as Ke, captureInlineStyles as je, restoreInlineStyles as he, restoreTextSnapshot as me, getPreviewTargets as xe, clearTailwindStatePreview as fe, applyTailwindStatePreview as Ie, setEditableTextPreview as qe, getRelevantComputedStyles as ge, getEditableTextInfo as oe, readReactSource as Fe, detectStylingSystem as mt, countElementInstances as ft, getScopeSelector as gt, getCssSelector as vt, copyToClipboard as bt, getWindowSelectionText as yt, getNearestReactComponentName as Vt, getDomPath as Ut, resolveElementFromEntry as wt, getAnnotationSessionDisplay as Wt, loadAnnotationSession as Yt, saveAnnotationSession as Xt, DEFAULT_PIXEL_AGENT_UI_SETTINGS as Gt, readHostThemeFromDocument as Je, resolvePixelAgentChrome as Kt, applyHostThemeToDocument as jt, pixelAgentRootAttributes as qt, getElementsInArea as Jt, formatAllAnnotations as Zt, formatAnnotation as Qt } from "@pixelagent/shared";
|
|
4
4
|
export * from "@pixelagent/shared";
|
|
5
|
-
import { createPortal as
|
|
6
|
-
function
|
|
5
|
+
import { createPortal as Be } from "react-dom";
|
|
6
|
+
function xt({
|
|
7
7
|
element: e,
|
|
8
8
|
selected: t,
|
|
9
9
|
multiSelected: i = [],
|
|
10
10
|
primarySelected: r = null
|
|
11
11
|
}) {
|
|
12
|
-
const [a,
|
|
13
|
-
if (
|
|
12
|
+
const [a, o] = A([]), s = r ?? t;
|
|
13
|
+
if (B(() => {
|
|
14
14
|
const l = /* @__PURE__ */ new Map(), p = i.length > 0;
|
|
15
15
|
e && !t && !p && l.set(e, !1), t && l.set(t, !0);
|
|
16
|
-
for (const
|
|
17
|
-
l.set(
|
|
16
|
+
for (const g of i)
|
|
17
|
+
l.set(g, !0);
|
|
18
18
|
if (l.size === 0) {
|
|
19
|
-
|
|
19
|
+
o([]);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const m = () => {
|
|
23
|
-
|
|
24
|
-
Array.from(l.entries()).map(([
|
|
25
|
-
rect:
|
|
26
|
-
label:
|
|
27
|
-
isSelected:
|
|
28
|
-
isPrimary:
|
|
23
|
+
o(
|
|
24
|
+
Array.from(l.entries()).map(([g, f]) => ({
|
|
25
|
+
rect: g.getBoundingClientRect(),
|
|
26
|
+
label: $e(g),
|
|
27
|
+
isSelected: f,
|
|
28
|
+
isPrimary: s !== null && g === s
|
|
29
29
|
}))
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
32
|
m();
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
return
|
|
33
|
+
const v = Array.from(l.keys()).map((g) => {
|
|
34
|
+
const f = new ResizeObserver(m);
|
|
35
|
+
return f.observe(g), f;
|
|
36
36
|
});
|
|
37
37
|
return window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
38
|
-
for (const
|
|
38
|
+
for (const g of v) g.disconnect();
|
|
39
39
|
window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
40
40
|
};
|
|
41
|
-
}, [e, t, i,
|
|
42
|
-
const
|
|
43
|
-
return /* @__PURE__ */
|
|
41
|
+
}, [e, t, i, s]), a.length === 0) return null;
|
|
42
|
+
const u = a.find((l) => l.isPrimary) ?? a.find((l) => l.isSelected) ?? a[0], c = a.filter((l) => l.isSelected).length;
|
|
43
|
+
return /* @__PURE__ */ d(Y, { children: [
|
|
44
44
|
a.map((l, p) => /* @__PURE__ */ n(
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
@@ -48,7 +48,7 @@ function gt({
|
|
|
48
48
|
"pa-highlight",
|
|
49
49
|
l.isSelected ? "pa-highlight-selected" : "",
|
|
50
50
|
l.isPrimary ? "pa-highlight-primary" : "",
|
|
51
|
-
l.isSelected && !l.isPrimary &&
|
|
51
|
+
l.isSelected && !l.isPrimary && c > 1 ? "pa-highlight-scope" : ""
|
|
52
52
|
].filter(Boolean).join(" "),
|
|
53
53
|
style: {
|
|
54
54
|
top: l.rect.top,
|
|
@@ -64,49 +64,49 @@ function gt({
|
|
|
64
64
|
{
|
|
65
65
|
className: "pa-tooltip",
|
|
66
66
|
style: {
|
|
67
|
-
top: Math.max(0,
|
|
68
|
-
left:
|
|
67
|
+
top: Math.max(0, u.rect.top - 28),
|
|
68
|
+
left: u.rect.left
|
|
69
69
|
},
|
|
70
|
-
children:
|
|
70
|
+
children: c > 1 ? `${c} instances · ${u.label}` : u.label
|
|
71
71
|
}
|
|
72
72
|
)
|
|
73
73
|
] });
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
75
|
+
const Nt = 0.35, en = 0.48;
|
|
76
|
+
function tn(e, t, i, r = Nt) {
|
|
77
77
|
if (e < 8 || t < 8) return null;
|
|
78
|
-
const a = 1,
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
82
|
-
const l =
|
|
83
|
-
let
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
for (let
|
|
87
|
-
for (let
|
|
88
|
-
const
|
|
89
|
-
Math.abs(h) >
|
|
78
|
+
const a = 1, o = Math.max(1, Math.round(e * a)), s = Math.max(1, Math.round(t * a)), u = document.createElement("canvas");
|
|
79
|
+
u.width = o, u.height = s;
|
|
80
|
+
const c = u.getContext("2d");
|
|
81
|
+
if (!c) return null;
|
|
82
|
+
const l = c.createImageData(o, s), p = l.data, m = Math.min(0.5, i / Math.min(e, t)), v = 0.3, g = 0.2, f = Math.max(0.4, m + 0.1);
|
|
83
|
+
let b = 0;
|
|
84
|
+
const E = new Float32Array(o * s * 2);
|
|
85
|
+
let k = 0;
|
|
86
|
+
for (let x = 0; x < s; x++)
|
|
87
|
+
for (let L = 0; L < o; L++) {
|
|
88
|
+
const P = L / o - 0.5, R = x / s - 0.5, N = nn(P, R, v, g, f), T = Ze(0.8, 0, N - 0.15), C = Ze(0, 1, T), h = (P * C + 0.5) * o - L, O = (R * C + 0.5) * s - x;
|
|
89
|
+
Math.abs(h) > b && (b = Math.abs(h)), Math.abs(O) > b && (b = Math.abs(O)), E[k++] = h, E[k++] = O;
|
|
90
90
|
}
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
for (let
|
|
95
|
-
const
|
|
96
|
-
p[
|
|
91
|
+
if (b === 0) return null;
|
|
92
|
+
b *= 0.4 * r;
|
|
93
|
+
let w = 0;
|
|
94
|
+
for (let x = 0; x < p.length; x += 4) {
|
|
95
|
+
const L = E[w++] / b + 0.5, P = E[w++] / b + 0.5;
|
|
96
|
+
p[x] = L * 255, p[x + 1] = P * 255, p[x + 2] = 0, p[x + 3] = 255;
|
|
97
97
|
}
|
|
98
|
-
return
|
|
99
|
-
href:
|
|
100
|
-
scale:
|
|
101
|
-
width:
|
|
102
|
-
height:
|
|
98
|
+
return c.putImageData(l, 0, 0), {
|
|
99
|
+
href: u.toDataURL("image/png"),
|
|
100
|
+
scale: b / a,
|
|
101
|
+
width: o,
|
|
102
|
+
height: s
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
return Math.min(Math.max(
|
|
105
|
+
function nn(e, t, i, r, a) {
|
|
106
|
+
const o = Math.abs(e) - i + a, s = Math.abs(t) - r + a;
|
|
107
|
+
return Math.min(Math.max(o, s), 0) + Math.hypot(Math.max(o, 0), Math.max(s, 0)) - a;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function Ze(e, t, i) {
|
|
110
110
|
const r = Math.max(0, Math.min(1, (i - e) / (t - e)));
|
|
111
111
|
return r * r * (3 - 2 * r);
|
|
112
112
|
}
|
|
@@ -115,48 +115,48 @@ function De() {
|
|
|
115
115
|
const e = navigator.userAgent;
|
|
116
116
|
return !(/AppleWebKit/i.test(e) && !/Chrome|Chromium|Edg|OPR|CriOS|FxiOS/i.test(e) || /Firefox/i.test(e));
|
|
117
117
|
}
|
|
118
|
-
const
|
|
118
|
+
const rn = {
|
|
119
119
|
default: "blur(4px) saturate(130%)",
|
|
120
120
|
/** Toolbar — slightly stronger frost + refraction chain. */
|
|
121
121
|
enhanced: "blur(6px) saturate(138%)"
|
|
122
122
|
};
|
|
123
|
-
function
|
|
124
|
-
const i =
|
|
123
|
+
function an(e, t = "default") {
|
|
124
|
+
const i = rn[t], a = e !== null && De() ? `${i} url(#${e})` : i;
|
|
125
125
|
return {
|
|
126
126
|
backdropFilter: a,
|
|
127
127
|
WebkitBackdropFilter: a
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
-
let
|
|
131
|
-
function
|
|
130
|
+
let on = 0;
|
|
131
|
+
function kt({
|
|
132
132
|
shape: e = "rect",
|
|
133
133
|
cornerRadius: t,
|
|
134
134
|
tint: i = "neutral",
|
|
135
135
|
intensity: r = "default",
|
|
136
136
|
className: a = "",
|
|
137
|
-
style:
|
|
138
|
-
children:
|
|
137
|
+
style: o,
|
|
138
|
+
children: s
|
|
139
139
|
}) {
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
if (!
|
|
144
|
-
let
|
|
145
|
-
const
|
|
146
|
-
cancelAnimationFrame(
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
R &&
|
|
140
|
+
const u = t ?? (e === "capsule" ? 9999 : 20), c = r === "enhanced" ? en : Nt, l = V(null), p = ue(() => `pa-lg-${++on}`, []), [m, v] = A(null);
|
|
141
|
+
Ht(() => {
|
|
142
|
+
const f = l.current;
|
|
143
|
+
if (!f) return;
|
|
144
|
+
let b = 0;
|
|
145
|
+
const E = () => {
|
|
146
|
+
cancelAnimationFrame(b), b = requestAnimationFrame(() => {
|
|
147
|
+
const w = f.getBoundingClientRect(), x = Math.round(w.width), L = Math.round(w.height);
|
|
148
|
+
if (x < 8 || L < 8) return;
|
|
149
|
+
const P = e === "capsule" ? L / 2 : Math.min(u, x / 2, L / 2), R = tn(x, L, P, c);
|
|
150
|
+
R && v(R);
|
|
151
151
|
});
|
|
152
152
|
};
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
cancelAnimationFrame(
|
|
153
|
+
E();
|
|
154
|
+
const k = new ResizeObserver(E);
|
|
155
|
+
return k.observe(f), () => {
|
|
156
|
+
cancelAnimationFrame(b), k.disconnect();
|
|
157
157
|
};
|
|
158
|
-
}, [e,
|
|
159
|
-
const
|
|
158
|
+
}, [e, u, c]);
|
|
159
|
+
const g = m && De() && typeof document < "u" ? Be(
|
|
160
160
|
/* @__PURE__ */ n(
|
|
161
161
|
"svg",
|
|
162
162
|
{
|
|
@@ -172,7 +172,7 @@ function bt({
|
|
|
172
172
|
overflow: "hidden",
|
|
173
173
|
pointerEvents: "none"
|
|
174
174
|
},
|
|
175
|
-
children: /* @__PURE__ */ n("defs", { children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ n("defs", { children: /* @__PURE__ */ d(
|
|
176
176
|
"filter",
|
|
177
177
|
{
|
|
178
178
|
id: p,
|
|
@@ -211,31 +211,31 @@ function bt({
|
|
|
211
211
|
),
|
|
212
212
|
document.body
|
|
213
213
|
) : null;
|
|
214
|
-
return /* @__PURE__ */
|
|
215
|
-
|
|
216
|
-
/* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ d(Y, { children: [
|
|
215
|
+
g,
|
|
216
|
+
/* @__PURE__ */ d(
|
|
217
217
|
"div",
|
|
218
218
|
{
|
|
219
219
|
ref: l,
|
|
220
220
|
className: `pa-glass-surface pa-glass-surface--${e} pa-glass-surface--${i} ${a}`.trim(),
|
|
221
221
|
style: {
|
|
222
|
-
borderRadius: e === "capsule" ? "999px" : `${
|
|
223
|
-
...
|
|
222
|
+
borderRadius: e === "capsule" ? "999px" : `${u}px`,
|
|
223
|
+
...an(
|
|
224
224
|
m && De() ? p : null,
|
|
225
225
|
r
|
|
226
226
|
),
|
|
227
|
-
...
|
|
227
|
+
...o
|
|
228
228
|
},
|
|
229
229
|
children: [
|
|
230
230
|
/* @__PURE__ */ n("div", { className: "pa-glass-surface-bg", "aria-hidden": "true" }),
|
|
231
231
|
/* @__PURE__ */ n("div", { className: "pa-glass-surface-shine", "aria-hidden": "true" }),
|
|
232
|
-
/* @__PURE__ */ n("div", { className: "pa-glass-surface-content", children:
|
|
232
|
+
/* @__PURE__ */ n("div", { className: "pa-glass-surface-content", children: s })
|
|
233
233
|
]
|
|
234
234
|
}
|
|
235
235
|
)
|
|
236
236
|
] });
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function H({
|
|
239
239
|
variant: e = "regular",
|
|
240
240
|
className: t = "",
|
|
241
241
|
children: i,
|
|
@@ -251,7 +251,7 @@ function B({
|
|
|
251
251
|
}
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function ke({
|
|
255
255
|
variant: e = "sheet",
|
|
256
256
|
side: t = "left",
|
|
257
257
|
className: i = "",
|
|
@@ -259,7 +259,7 @@ function Ne({
|
|
|
259
259
|
children: a
|
|
260
260
|
}) {
|
|
261
261
|
return /* @__PURE__ */ n(
|
|
262
|
-
|
|
262
|
+
kt,
|
|
263
263
|
{
|
|
264
264
|
shape: "rect",
|
|
265
265
|
cornerRadius: e === "popover" ? 16 : 20,
|
|
@@ -269,69 +269,69 @@ function Ne({
|
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Ct({
|
|
273
273
|
defaultPosition: e = null,
|
|
274
274
|
computeDefaultPosition: t
|
|
275
275
|
} = {}) {
|
|
276
|
-
const [i, r] = A(e), [a,
|
|
276
|
+
const [i, r] = A(e), [a, o] = A(!1), s = V(null), u = V(null), c = I(() => {
|
|
277
277
|
if (i !== null) return;
|
|
278
|
-
const
|
|
279
|
-
if (!
|
|
280
|
-
const
|
|
278
|
+
const g = u.current;
|
|
279
|
+
if (!g) return;
|
|
280
|
+
const f = g.getBoundingClientRect();
|
|
281
281
|
r(
|
|
282
|
-
t ? t(
|
|
283
|
-
x: (window.innerWidth -
|
|
284
|
-
y: window.innerHeight -
|
|
282
|
+
t ? t(f) : {
|
|
283
|
+
x: (window.innerWidth - f.width) / 2,
|
|
284
|
+
y: window.innerHeight - f.height - 24
|
|
285
285
|
}
|
|
286
286
|
);
|
|
287
287
|
}, [i, t]);
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}, [
|
|
291
|
-
const
|
|
292
|
-
r((
|
|
293
|
-
if (!
|
|
294
|
-
const
|
|
288
|
+
B(() => {
|
|
289
|
+
c();
|
|
290
|
+
}, [c]), B(() => {
|
|
291
|
+
const g = () => {
|
|
292
|
+
r((f) => {
|
|
293
|
+
if (!f || !u.current) return f;
|
|
294
|
+
const b = u.current.getBoundingClientRect();
|
|
295
295
|
return {
|
|
296
|
-
x: Math.min(
|
|
297
|
-
y: Math.min(
|
|
296
|
+
x: Math.min(f.x, window.innerWidth - b.width),
|
|
297
|
+
y: Math.min(f.y, window.innerHeight - b.height)
|
|
298
298
|
};
|
|
299
299
|
});
|
|
300
300
|
};
|
|
301
|
-
return window.addEventListener("resize",
|
|
301
|
+
return window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
|
|
302
302
|
}, []);
|
|
303
|
-
const l =
|
|
304
|
-
(
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
308
|
-
let
|
|
309
|
-
if (!
|
|
310
|
-
const
|
|
311
|
-
|
|
303
|
+
const l = I(
|
|
304
|
+
(g) => {
|
|
305
|
+
if (g.button !== 0) return;
|
|
306
|
+
const f = u.current;
|
|
307
|
+
if (!f) return;
|
|
308
|
+
let b = i;
|
|
309
|
+
if (!b) {
|
|
310
|
+
const E = f.getBoundingClientRect();
|
|
311
|
+
b = { x: E.left, y: E.top }, r(b);
|
|
312
312
|
}
|
|
313
|
-
|
|
314
|
-
pointerId:
|
|
315
|
-
startX:
|
|
316
|
-
startY:
|
|
317
|
-
originX:
|
|
318
|
-
originY:
|
|
319
|
-
},
|
|
313
|
+
s.current = {
|
|
314
|
+
pointerId: g.pointerId,
|
|
315
|
+
startX: g.clientX,
|
|
316
|
+
startY: g.clientY,
|
|
317
|
+
originX: b.x,
|
|
318
|
+
originY: b.y
|
|
319
|
+
}, o(!0), g.currentTarget.setPointerCapture(g.pointerId), g.preventDefault();
|
|
320
320
|
},
|
|
321
321
|
[i]
|
|
322
|
-
), p =
|
|
323
|
-
if (!
|
|
324
|
-
const
|
|
325
|
-
r({ x
|
|
326
|
-
}, []), m =
|
|
327
|
-
if (!(!
|
|
328
|
-
|
|
322
|
+
), p = I((g) => {
|
|
323
|
+
if (!s.current || s.current.pointerId !== g.pointerId) return;
|
|
324
|
+
const f = u.current, b = (f == null ? void 0 : f.offsetWidth) ?? 320, E = (f == null ? void 0 : f.offsetHeight) ?? 48, k = g.clientX - s.current.startX, w = g.clientY - s.current.startY, x = Math.max(8, Math.min(window.innerWidth - b - 8, s.current.originX + k)), L = Math.max(8, Math.min(window.innerHeight - E - 8, s.current.originY + w));
|
|
325
|
+
r({ x, y: L });
|
|
326
|
+
}, []), m = I((g) => {
|
|
327
|
+
if (!(!s.current || s.current.pointerId !== g.pointerId)) {
|
|
328
|
+
s.current = null, o(!1);
|
|
329
329
|
try {
|
|
330
|
-
|
|
330
|
+
g.currentTarget.releasePointerCapture(g.pointerId);
|
|
331
331
|
} catch {
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
}, []),
|
|
334
|
+
}, []), v = i !== null ? {
|
|
335
335
|
position: "fixed",
|
|
336
336
|
left: i.x,
|
|
337
337
|
top: i.y,
|
|
@@ -340,10 +340,10 @@ function yt({
|
|
|
340
340
|
bottom: "auto"
|
|
341
341
|
} : void 0;
|
|
342
342
|
return {
|
|
343
|
-
elementRef:
|
|
343
|
+
elementRef: u,
|
|
344
344
|
position: i,
|
|
345
345
|
isDragging: a,
|
|
346
|
-
style:
|
|
346
|
+
style: v,
|
|
347
347
|
dragHandleProps: {
|
|
348
348
|
onPointerDown: l,
|
|
349
349
|
onPointerMove: p,
|
|
@@ -352,8 +352,8 @@ function yt({
|
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
return /* @__PURE__ */
|
|
355
|
+
function sn({ className: e }) {
|
|
356
|
+
return /* @__PURE__ */ d("svg", { className: e, width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", children: [
|
|
357
357
|
/* @__PURE__ */ n(
|
|
358
358
|
"path",
|
|
359
359
|
{
|
|
@@ -378,8 +378,8 @@ function tn({ className: e }) {
|
|
|
378
378
|
)
|
|
379
379
|
] });
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
return /* @__PURE__ */
|
|
381
|
+
function ln({ className: e }) {
|
|
382
|
+
return /* @__PURE__ */ d("svg", { className: e, width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", children: [
|
|
383
383
|
/* @__PURE__ */ n(
|
|
384
384
|
"path",
|
|
385
385
|
{
|
|
@@ -404,8 +404,8 @@ function nn({ className: e }) {
|
|
|
404
404
|
)
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
|
-
const
|
|
408
|
-
function
|
|
407
|
+
const se = (e, t, i) => Math.min(i, Math.max(t, e));
|
|
408
|
+
function ze(e) {
|
|
409
409
|
const t = e.trim();
|
|
410
410
|
if (!t) return null;
|
|
411
411
|
const i = t.match(/^#([0-9a-f]{6})$/i);
|
|
@@ -417,167 +417,167 @@ function Be(e) {
|
|
|
417
417
|
};
|
|
418
418
|
const r = t.match(/^#([0-9a-f]{3})$/i);
|
|
419
419
|
if (r) {
|
|
420
|
-
const [
|
|
420
|
+
const [o, s, u] = r[1].split("");
|
|
421
421
|
return {
|
|
422
|
-
r: parseInt(
|
|
423
|
-
g: parseInt(
|
|
424
|
-
b: parseInt(
|
|
422
|
+
r: parseInt(o + o, 16),
|
|
423
|
+
g: parseInt(s + s, 16),
|
|
424
|
+
b: parseInt(u + u, 16)
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
427
|
const a = t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
|
|
428
428
|
return a ? {
|
|
429
|
-
r:
|
|
430
|
-
g:
|
|
431
|
-
b:
|
|
429
|
+
r: se(parseInt(a[1], 10), 0, 255),
|
|
430
|
+
g: se(parseInt(a[2], 10), 0, 255),
|
|
431
|
+
b: se(parseInt(a[3], 10), 0, 255)
|
|
432
432
|
} : null;
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
const t = (i) =>
|
|
434
|
+
function At(e) {
|
|
435
|
+
const t = (i) => se(Math.round(i), 0, 255).toString(16).padStart(2, "0");
|
|
436
436
|
return `#${t(e.r)}${t(e.g)}${t(e.b)}`;
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function cn(e) {
|
|
439
439
|
return `rgb(${e.r}, ${e.g}, ${e.b})`;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
const r = e / 255, a = t / 255,
|
|
441
|
+
function Mt({ r: e, g: t, b: i }) {
|
|
442
|
+
const r = e / 255, a = t / 255, o = i / 255, s = Math.max(r, a, o), u = Math.min(r, a, o), c = s - u;
|
|
443
443
|
let l = 0;
|
|
444
|
-
|
|
445
|
-
const p =
|
|
444
|
+
c !== 0 && (s === r ? l = (a - o) / c % 6 : s === a ? l = (o - r) / c + 2 : l = (r - a) / c + 4, l *= 60, l < 0 && (l += 360));
|
|
445
|
+
const p = s === 0 ? 0 : c / s * 100, m = s * 100;
|
|
446
446
|
return { h: l, s: p, v: m };
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
const r =
|
|
450
|
-
let
|
|
448
|
+
function St({ h: e, s: t, v: i }) {
|
|
449
|
+
const r = se(t, 0, 100) / 100, a = se(i, 0, 100) / 100, o = a * r, s = o * (1 - Math.abs(e / 60 % 2 - 1)), u = a - o;
|
|
450
|
+
let c = 0, l = 0, p = 0;
|
|
451
451
|
const m = (e % 360 + 360) % 360;
|
|
452
|
-
return m < 60 ? (
|
|
453
|
-
r: Math.round((
|
|
454
|
-
g: Math.round((l +
|
|
455
|
-
b: Math.round((p +
|
|
452
|
+
return m < 60 ? (c = o, l = s) : m < 120 ? (c = s, l = o) : m < 180 ? (l = o, p = s) : m < 240 ? (l = s, p = o) : m < 300 ? (c = s, p = o) : (c = o, p = s), {
|
|
453
|
+
r: Math.round((c + u) * 255),
|
|
454
|
+
g: Math.round((l + u) * 255),
|
|
455
|
+
b: Math.round((p + u) * 255)
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
const t =
|
|
460
|
-
return t ?
|
|
458
|
+
function Qe(e) {
|
|
459
|
+
const t = ze(e);
|
|
460
|
+
return t ? Mt(t) : { h: 0, s: 0, v: 45 };
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function dn(e) {
|
|
463
463
|
return e.replace(/^#/, "").toUpperCase().slice(0, 6);
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function un(e, t) {
|
|
466
466
|
const i = e.replace(/[^0-9a-f]/gi, "").slice(0, 6);
|
|
467
|
-
return i.length < 6 ? t :
|
|
467
|
+
return i.length < 6 ? t : ze(`#${i}`) ?? t;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
return
|
|
469
|
+
function pn(e) {
|
|
470
|
+
return At(St(e));
|
|
471
471
|
}
|
|
472
|
-
function
|
|
473
|
-
const r =
|
|
472
|
+
function hn(e, t, i) {
|
|
473
|
+
const r = et((e - i.left) / i.width), a = et((t - i.top) / i.height);
|
|
474
474
|
return { x: r * 100, y: a * 100 };
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function et(e) {
|
|
477
477
|
return Math.min(1, Math.max(0, e));
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function mn() {
|
|
480
480
|
if (typeof document > "u") return {};
|
|
481
481
|
const e = document.querySelector("[data-pixelagent-root]") ?? document.querySelector("[data-pixelagent-toolbar-portal]"), t = e == null ? void 0 : e.getAttribute("data-pa-chrome");
|
|
482
482
|
return t ? { "data-pa-chrome": t } : {};
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
const [r, a] = A(!1), [
|
|
486
|
-
|
|
487
|
-
|
|
484
|
+
function Te({ label: e, value: t, onChange: i }) {
|
|
485
|
+
const [r, a] = A(!1), [o, s] = A(() => Qe(t)), u = V(null), c = V(null), l = V(null), p = _t(), [m, v] = A({ top: 0, left: 0, width: 260 }), g = St(o), f = dn(At(g)), b = ze(t) ? t : cn(g), E = e.toLowerCase().includes("color") ? e : `${e} color`;
|
|
486
|
+
B(() => {
|
|
487
|
+
s(Qe(t));
|
|
488
488
|
}, [t]);
|
|
489
|
-
const
|
|
490
|
-
(
|
|
491
|
-
|
|
489
|
+
const k = I(
|
|
490
|
+
(N) => {
|
|
491
|
+
s(N), i(pn(N));
|
|
492
492
|
},
|
|
493
493
|
[i]
|
|
494
|
-
),
|
|
495
|
-
(
|
|
496
|
-
|
|
494
|
+
), w = I(
|
|
495
|
+
(N) => {
|
|
496
|
+
k(Mt(N));
|
|
497
497
|
},
|
|
498
|
-
[
|
|
499
|
-
),
|
|
500
|
-
const
|
|
501
|
-
if (!
|
|
502
|
-
const
|
|
503
|
-
let h =
|
|
504
|
-
h +
|
|
505
|
-
let
|
|
498
|
+
[k]
|
|
499
|
+
), x = I(() => {
|
|
500
|
+
const N = u.current;
|
|
501
|
+
if (!N) return;
|
|
502
|
+
const T = N.getBoundingClientRect(), C = 260;
|
|
503
|
+
let h = T.left;
|
|
504
|
+
h + C > window.innerWidth - 12 && (h = window.innerWidth - C - 12), h = Math.max(12, h);
|
|
505
|
+
let O = T.bottom + 8;
|
|
506
506
|
const U = 320;
|
|
507
|
-
|
|
507
|
+
O + U > window.innerHeight - 12 && (O = Math.max(12, T.top - U - 8)), v({ top: O, left: h, width: C });
|
|
508
508
|
}, []);
|
|
509
|
-
|
|
509
|
+
B(() => {
|
|
510
510
|
if (!r) return;
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
var
|
|
514
|
-
const h =
|
|
515
|
-
(
|
|
516
|
-
},
|
|
517
|
-
|
|
511
|
+
x();
|
|
512
|
+
const N = (C) => {
|
|
513
|
+
var O, U;
|
|
514
|
+
const h = C.target;
|
|
515
|
+
(O = u.current) != null && O.contains(h) || (U = c.current) != null && U.contains(h) || a(!1);
|
|
516
|
+
}, T = (C) => {
|
|
517
|
+
C.key === "Escape" && a(!1);
|
|
518
518
|
};
|
|
519
|
-
return window.addEventListener("mousedown",
|
|
520
|
-
window.removeEventListener("mousedown",
|
|
519
|
+
return window.addEventListener("mousedown", N, !0), window.addEventListener("keydown", T), window.addEventListener("resize", x), window.addEventListener("scroll", x, !0), () => {
|
|
520
|
+
window.removeEventListener("mousedown", N, !0), window.removeEventListener("keydown", T), window.removeEventListener("resize", x), window.removeEventListener("scroll", x, !0);
|
|
521
521
|
};
|
|
522
|
-
}, [r,
|
|
523
|
-
const
|
|
522
|
+
}, [r, x]);
|
|
523
|
+
const L = (N, T) => {
|
|
524
524
|
var U;
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
527
|
-
const { x: h, y:
|
|
528
|
-
|
|
529
|
-
},
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
window.removeEventListener("mousemove",
|
|
525
|
+
const C = (U = l.current) == null ? void 0 : U.getBoundingClientRect();
|
|
526
|
+
if (!C) return;
|
|
527
|
+
const { x: h, y: O } = hn(N, T, C);
|
|
528
|
+
k({ ...o, s: h, v: 100 - O });
|
|
529
|
+
}, P = (N) => {
|
|
530
|
+
N.preventDefault(), L(N.clientX, N.clientY);
|
|
531
|
+
const T = (h) => L(h.clientX, h.clientY), C = () => {
|
|
532
|
+
window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", C);
|
|
533
533
|
};
|
|
534
|
-
window.addEventListener("mousemove",
|
|
535
|
-
}, R = r ?
|
|
534
|
+
window.addEventListener("mousemove", T), window.addEventListener("mouseup", C);
|
|
535
|
+
}, R = r ? Be(
|
|
536
536
|
/* @__PURE__ */ n(
|
|
537
537
|
"div",
|
|
538
538
|
{
|
|
539
539
|
className: "pa-root pa-root--toolbar-portal pa-color-picker-portal",
|
|
540
540
|
"data-pixelagent-picker-portal": !0,
|
|
541
|
-
...
|
|
542
|
-
children: /* @__PURE__ */
|
|
541
|
+
...mn(),
|
|
542
|
+
children: /* @__PURE__ */ d(
|
|
543
543
|
"div",
|
|
544
544
|
{
|
|
545
|
-
ref:
|
|
545
|
+
ref: c,
|
|
546
546
|
id: p,
|
|
547
547
|
role: "dialog",
|
|
548
|
-
"aria-label":
|
|
548
|
+
"aria-label": E,
|
|
549
549
|
className: "pa-color-picker",
|
|
550
550
|
style: { top: m.top, left: m.left, width: m.width },
|
|
551
551
|
children: [
|
|
552
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ d("header", { className: "pa-color-picker-header", children: [
|
|
553
553
|
/* @__PURE__ */ n(
|
|
554
554
|
"span",
|
|
555
555
|
{
|
|
556
556
|
className: "pa-color-picker-preview",
|
|
557
|
-
style: { backgroundColor:
|
|
557
|
+
style: { backgroundColor: b },
|
|
558
558
|
"aria-hidden": "true"
|
|
559
559
|
}
|
|
560
560
|
),
|
|
561
|
-
/* @__PURE__ */ n("span", { className: "pa-color-picker-header-label", children:
|
|
561
|
+
/* @__PURE__ */ n("span", { className: "pa-color-picker-header-label", children: E })
|
|
562
562
|
] }),
|
|
563
563
|
/* @__PURE__ */ n(
|
|
564
564
|
"div",
|
|
565
565
|
{
|
|
566
566
|
ref: l,
|
|
567
567
|
className: "pa-color-picker-sb",
|
|
568
|
-
style: { "--pa-picker-h": String(Math.round(
|
|
569
|
-
onMouseDown:
|
|
568
|
+
style: { "--pa-picker-h": String(Math.round(o.h)) },
|
|
569
|
+
onMouseDown: P,
|
|
570
570
|
children: /* @__PURE__ */ n(
|
|
571
571
|
"span",
|
|
572
572
|
{
|
|
573
573
|
className: "pa-color-picker-sb-thumb",
|
|
574
|
-
style: { left: `${
|
|
574
|
+
style: { left: `${o.s}%`, top: `${100 - o.v}%` },
|
|
575
575
|
"aria-hidden": "true"
|
|
576
576
|
}
|
|
577
577
|
)
|
|
578
578
|
}
|
|
579
579
|
),
|
|
580
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ d("div", { className: "pa-color-picker-hue", children: [
|
|
581
581
|
/* @__PURE__ */ n(
|
|
582
582
|
"input",
|
|
583
583
|
{
|
|
@@ -585,35 +585,35 @@ function Ie({ label: e, value: t, onChange: i }) {
|
|
|
585
585
|
className: "pa-color-picker-hue-input",
|
|
586
586
|
min: 0,
|
|
587
587
|
max: 360,
|
|
588
|
-
value: Math.round(
|
|
588
|
+
value: Math.round(o.h),
|
|
589
589
|
"aria-label": "Hue",
|
|
590
|
-
onChange: (
|
|
590
|
+
onChange: (N) => k({ ...o, h: parseFloat(N.target.value) })
|
|
591
591
|
}
|
|
592
592
|
),
|
|
593
593
|
/* @__PURE__ */ n(
|
|
594
594
|
"span",
|
|
595
595
|
{
|
|
596
596
|
className: "pa-color-picker-hue-thumb",
|
|
597
|
-
style: { left: `${
|
|
597
|
+
style: { left: `${o.h / 360 * 100}%` },
|
|
598
598
|
"aria-hidden": "true"
|
|
599
599
|
}
|
|
600
600
|
)
|
|
601
601
|
] }),
|
|
602
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ d("label", { className: "pa-color-picker-field", children: [
|
|
603
603
|
/* @__PURE__ */ n("span", { className: "pa-color-picker-field-label", children: "Hex" }),
|
|
604
604
|
/* @__PURE__ */ n(
|
|
605
605
|
"input",
|
|
606
606
|
{
|
|
607
607
|
className: "pa-input pa-color-picker-input",
|
|
608
608
|
type: "text",
|
|
609
|
-
value:
|
|
609
|
+
value: f,
|
|
610
610
|
spellCheck: !1,
|
|
611
|
-
onChange: (
|
|
611
|
+
onChange: (N) => w(un(N.target.value, g))
|
|
612
612
|
}
|
|
613
613
|
)
|
|
614
614
|
] }),
|
|
615
|
-
/* @__PURE__ */ n("div", { className: "pa-color-picker-rgb", children: ["r", "g", "b"].map((
|
|
616
|
-
/* @__PURE__ */ n("span", { className: "pa-color-picker-field-label", children:
|
|
615
|
+
/* @__PURE__ */ n("div", { className: "pa-color-picker-rgb", children: ["r", "g", "b"].map((N) => /* @__PURE__ */ d("label", { className: "pa-color-picker-field pa-color-picker-field--rgb", children: [
|
|
616
|
+
/* @__PURE__ */ n("span", { className: "pa-color-picker-field-label", children: N.toUpperCase() }),
|
|
617
617
|
/* @__PURE__ */ n(
|
|
618
618
|
"input",
|
|
619
619
|
{
|
|
@@ -621,14 +621,14 @@ function Ie({ label: e, value: t, onChange: i }) {
|
|
|
621
621
|
type: "number",
|
|
622
622
|
min: 0,
|
|
623
623
|
max: 255,
|
|
624
|
-
value:
|
|
625
|
-
onChange: (
|
|
626
|
-
const
|
|
627
|
-
|
|
624
|
+
value: g[N],
|
|
625
|
+
onChange: (T) => {
|
|
626
|
+
const C = fn(parseInt(T.target.value, 10));
|
|
627
|
+
w({ ...g, [N]: C });
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
630
|
)
|
|
631
|
-
] },
|
|
631
|
+
] }, N)) })
|
|
632
632
|
]
|
|
633
633
|
}
|
|
634
634
|
)
|
|
@@ -636,22 +636,22 @@ function Ie({ label: e, value: t, onChange: i }) {
|
|
|
636
636
|
),
|
|
637
637
|
document.body
|
|
638
638
|
) : null;
|
|
639
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ d("div", { className: "pa-color-field", children: [
|
|
640
640
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: e }),
|
|
641
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ d(
|
|
642
642
|
"button",
|
|
643
643
|
{
|
|
644
|
-
ref:
|
|
644
|
+
ref: u,
|
|
645
645
|
type: "button",
|
|
646
646
|
className: "pa-color-field-trigger",
|
|
647
647
|
"aria-expanded": r,
|
|
648
648
|
"aria-haspopup": "dialog",
|
|
649
649
|
"aria-controls": r ? p : void 0,
|
|
650
650
|
onClick: () => {
|
|
651
|
-
r ||
|
|
651
|
+
r || x(), a((N) => !N);
|
|
652
652
|
},
|
|
653
653
|
children: [
|
|
654
|
-
/* @__PURE__ */ n("span", { className: "pa-color-field-swatch", style: { backgroundColor:
|
|
654
|
+
/* @__PURE__ */ n("span", { className: "pa-color-field-swatch", style: { backgroundColor: b }, "aria-hidden": "true" }),
|
|
655
655
|
/* @__PURE__ */ n(
|
|
656
656
|
"input",
|
|
657
657
|
{
|
|
@@ -669,19 +669,19 @@ function Ie({ label: e, value: t, onChange: i }) {
|
|
|
669
669
|
R
|
|
670
670
|
] });
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function fn(e) {
|
|
673
673
|
return Number.isFinite(e) ? Math.min(255, Math.max(0, e)) : 0;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
676
|
-
const [a,
|
|
677
|
-
return /* @__PURE__ */
|
|
678
|
-
/* @__PURE__ */
|
|
675
|
+
function re({ title: e, children: t, defaultOpen: i = !0, badge: r }) {
|
|
676
|
+
const [a, o] = A(i);
|
|
677
|
+
return /* @__PURE__ */ d("section", { className: `pa-edit-section ${a ? "pa-edit-section--open" : ""}`, children: [
|
|
678
|
+
/* @__PURE__ */ d(
|
|
679
679
|
"button",
|
|
680
680
|
{
|
|
681
681
|
type: "button",
|
|
682
682
|
className: "pa-edit-section-header",
|
|
683
683
|
"aria-expanded": a,
|
|
684
|
-
onClick: () =>
|
|
684
|
+
onClick: () => o((s) => !s),
|
|
685
685
|
children: [
|
|
686
686
|
/* @__PURE__ */ n("span", { className: "pa-edit-section-title", children: e }),
|
|
687
687
|
r ? /* @__PURE__ */ n("span", { className: "pa-edit-section-badge", children: r }) : null,
|
|
@@ -692,7 +692,7 @@ function ie({ title: e, children: t, defaultOpen: i = !0, badge: r }) {
|
|
|
692
692
|
a ? /* @__PURE__ */ n("div", { className: "pa-edit-section-body", children: t }) : null
|
|
693
693
|
] });
|
|
694
694
|
}
|
|
695
|
-
const
|
|
695
|
+
const ie = [
|
|
696
696
|
{ value: "Inter, system-ui, sans-serif", label: "Inter" },
|
|
697
697
|
{ value: "system-ui, sans-serif", label: "System UI" },
|
|
698
698
|
{
|
|
@@ -705,64 +705,64 @@ const ae = [
|
|
|
705
705
|
{ value: "Helvetica, Arial, sans-serif", label: "Helvetica" },
|
|
706
706
|
{ value: '"JetBrains Mono", ui-monospace, monospace', label: "JetBrains Mono" },
|
|
707
707
|
{ value: "ui-monospace, monospace", label: "Monospace" }
|
|
708
|
-
],
|
|
709
|
-
function
|
|
708
|
+
], Ne = "";
|
|
709
|
+
function ve(e) {
|
|
710
710
|
var i;
|
|
711
711
|
return (((i = e.split(",")[0]) == null ? void 0 : i.trim()) ?? "").replace(/^["']|["']$/g, "");
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function gn(e) {
|
|
714
714
|
const t = e.trim();
|
|
715
715
|
if (!t)
|
|
716
716
|
return {
|
|
717
|
-
selectValue:
|
|
718
|
-
options:
|
|
717
|
+
selectValue: Ne,
|
|
718
|
+
options: ie
|
|
719
719
|
};
|
|
720
|
-
const i =
|
|
721
|
-
(
|
|
720
|
+
const i = ve(t).toLowerCase(), r = ie.find(
|
|
721
|
+
(o) => o.value === t || ve(o.value).toLowerCase() === i
|
|
722
722
|
);
|
|
723
723
|
if (r)
|
|
724
|
-
return { selectValue: r.value, options:
|
|
725
|
-
const a =
|
|
726
|
-
const
|
|
727
|
-
return t.toLowerCase().includes(
|
|
724
|
+
return { selectValue: r.value, options: ie };
|
|
725
|
+
const a = ie.find((o) => {
|
|
726
|
+
const s = ve(o.value).toLowerCase();
|
|
727
|
+
return t.toLowerCase().includes(s) || s.includes(i);
|
|
728
728
|
});
|
|
729
|
-
return a ? { selectValue: a.value, options:
|
|
729
|
+
return a ? { selectValue: a.value, options: ie } : {
|
|
730
730
|
selectValue: t,
|
|
731
731
|
options: [
|
|
732
|
-
...
|
|
733
|
-
{ value: t, label:
|
|
732
|
+
...ie,
|
|
733
|
+
{ value: t, label: ve(t) || "Custom" }
|
|
734
734
|
]
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function vn({ value: e, onChange: t }) {
|
|
738
738
|
const { selectValue: i, options: r } = ue(
|
|
739
|
-
() =>
|
|
739
|
+
() => gn(e),
|
|
740
740
|
[e]
|
|
741
741
|
);
|
|
742
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ d("label", { className: "pa-edit-stack-field", children: [
|
|
743
743
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Font family" }),
|
|
744
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ d(
|
|
745
745
|
"select",
|
|
746
746
|
{
|
|
747
747
|
className: "pa-select pa-font-family-select",
|
|
748
|
-
value: i ||
|
|
748
|
+
value: i || Ne,
|
|
749
749
|
onChange: (a) => {
|
|
750
|
-
const
|
|
751
|
-
|
|
750
|
+
const o = a.target.value;
|
|
751
|
+
o && o !== Ne && t(o);
|
|
752
752
|
},
|
|
753
753
|
children: [
|
|
754
|
-
/* @__PURE__ */ n("option", { value:
|
|
754
|
+
/* @__PURE__ */ n("option", { value: Ne, disabled: !0, children: "Select font style" }),
|
|
755
755
|
r.map((a) => /* @__PURE__ */ n("option", { value: a.value, children: a.label }, a.value))
|
|
756
756
|
]
|
|
757
757
|
}
|
|
758
758
|
)
|
|
759
759
|
] });
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function He(e) {
|
|
762
762
|
const t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);
|
|
763
763
|
return t ? parseFloat(t[1]) : null;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function bn(e) {
|
|
766
766
|
const t = e.trim();
|
|
767
767
|
if (!t) return null;
|
|
768
768
|
if (t.endsWith("%")) {
|
|
@@ -772,21 +772,21 @@ function hn(e) {
|
|
|
772
772
|
const i = parseFloat(t);
|
|
773
773
|
return Number.isFinite(i) && i >= 0 && i <= 1 ? i : null;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
776
|
-
const t =
|
|
775
|
+
function yn(e) {
|
|
776
|
+
const t = Lt(e);
|
|
777
777
|
if (t !== null) return t > 0;
|
|
778
|
-
const i =
|
|
778
|
+
const i = He(e);
|
|
779
779
|
return i !== null && i > 0;
|
|
780
780
|
}
|
|
781
|
-
function
|
|
781
|
+
function Lt(e) {
|
|
782
782
|
const t = e.trim().split(/\s+/).filter(Boolean);
|
|
783
783
|
if (t.length === 0) return null;
|
|
784
|
-
const i = t.map((a) =>
|
|
784
|
+
const i = t.map((a) => He(a));
|
|
785
785
|
if (i.some((a) => a === null)) return null;
|
|
786
786
|
const r = i[0];
|
|
787
787
|
return i.every((a) => a === r) ? r : null;
|
|
788
788
|
}
|
|
789
|
-
const
|
|
789
|
+
const wn = {
|
|
790
790
|
padding: { kind: "uniform-px", min: 0, max: 80, step: 1 },
|
|
791
791
|
margin: { kind: "uniform-px", min: 0, max: 80, step: 1 },
|
|
792
792
|
width: { kind: "text" },
|
|
@@ -800,19 +800,19 @@ const fn = {
|
|
|
800
800
|
"border-radius": { kind: "px", min: 0, max: 48, step: 1 },
|
|
801
801
|
opacity: { kind: "opacity", min: 0, max: 1, step: 0.01 }
|
|
802
802
|
};
|
|
803
|
-
function
|
|
803
|
+
function xn(e, t, i) {
|
|
804
804
|
switch (i.kind) {
|
|
805
805
|
case "opacity":
|
|
806
|
-
return
|
|
806
|
+
return bn(t);
|
|
807
807
|
case "px":
|
|
808
|
-
return
|
|
808
|
+
return He(t);
|
|
809
809
|
case "uniform-px":
|
|
810
|
-
return
|
|
810
|
+
return Lt(t);
|
|
811
811
|
default:
|
|
812
812
|
return null;
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function Nn(e, t, i) {
|
|
816
816
|
switch (i.kind) {
|
|
817
817
|
case "opacity":
|
|
818
818
|
return String(Math.round(t * 100) / 100);
|
|
@@ -823,16 +823,16 @@ function vn(e, t, i) {
|
|
|
823
823
|
return String(t);
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Z({
|
|
827
827
|
property: e,
|
|
828
828
|
label: t,
|
|
829
829
|
value: i,
|
|
830
830
|
onChange: r,
|
|
831
831
|
compact: a = !1
|
|
832
832
|
}) {
|
|
833
|
-
const
|
|
834
|
-
if (!
|
|
835
|
-
return /* @__PURE__ */
|
|
833
|
+
const o = wn[e] ?? { kind: "text" }, s = xn(e, i, o), u = o.kind !== "text" && s !== null, c = a ? "pa-prop-row pa-prop-row--compact" : "pa-prop-row", l = a ? "pa-edit-field-label" : "pa-prop-label";
|
|
834
|
+
if (!u)
|
|
835
|
+
return /* @__PURE__ */ d("label", { className: c, children: [
|
|
836
836
|
/* @__PURE__ */ n("span", { className: l, children: t }),
|
|
837
837
|
/* @__PURE__ */ n(
|
|
838
838
|
"input",
|
|
@@ -840,16 +840,16 @@ function J({
|
|
|
840
840
|
className: "pa-input",
|
|
841
841
|
type: "text",
|
|
842
842
|
value: i,
|
|
843
|
-
onChange: (
|
|
843
|
+
onChange: (f) => r(f.target.value)
|
|
844
844
|
}
|
|
845
845
|
)
|
|
846
846
|
] });
|
|
847
|
-
const p =
|
|
848
|
-
r(
|
|
847
|
+
const p = o.min ?? 0, m = o.max ?? 100, v = o.step ?? 1, g = (f) => {
|
|
848
|
+
r(Nn(e, f, o));
|
|
849
849
|
};
|
|
850
|
-
return /* @__PURE__ */
|
|
850
|
+
return /* @__PURE__ */ d("label", { className: `${c} pa-prop-row--slider`, children: [
|
|
851
851
|
/* @__PURE__ */ n("span", { className: l, children: t }),
|
|
852
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ d("div", { className: "pa-prop-slider-wrap", children: [
|
|
853
853
|
/* @__PURE__ */ n(
|
|
854
854
|
"input",
|
|
855
855
|
{
|
|
@@ -857,10 +857,10 @@ function J({
|
|
|
857
857
|
className: "pa-slider",
|
|
858
858
|
min: p,
|
|
859
859
|
max: m,
|
|
860
|
-
step:
|
|
861
|
-
value:
|
|
860
|
+
step: v,
|
|
861
|
+
value: s,
|
|
862
862
|
"aria-valuetext": i,
|
|
863
|
-
onChange: (
|
|
863
|
+
onChange: (f) => g(parseFloat(f.target.value))
|
|
864
864
|
}
|
|
865
865
|
),
|
|
866
866
|
/* @__PURE__ */ n(
|
|
@@ -869,14 +869,14 @@ function J({
|
|
|
869
869
|
className: "pa-input pa-prop-slider-value",
|
|
870
870
|
type: "text",
|
|
871
871
|
value: i,
|
|
872
|
-
onChange: (
|
|
872
|
+
onChange: (f) => r(f.target.value),
|
|
873
873
|
"aria-label": `${t} value`
|
|
874
874
|
}
|
|
875
875
|
)
|
|
876
876
|
] })
|
|
877
877
|
] });
|
|
878
878
|
}
|
|
879
|
-
function
|
|
879
|
+
function kn(e) {
|
|
880
880
|
const t = e.trim().split(/\s+/).filter(Boolean), i = t[0] ?? "0px";
|
|
881
881
|
if (t.length <= 1) return { top: i, right: i, bottom: i, left: i };
|
|
882
882
|
const r = t[1];
|
|
@@ -884,86 +884,86 @@ function bn(e) {
|
|
|
884
884
|
const a = t[2];
|
|
885
885
|
return t.length === 3 ? { top: i, right: r, bottom: a, left: r } : { top: i, right: r, bottom: a, left: t[3] };
|
|
886
886
|
}
|
|
887
|
-
function
|
|
887
|
+
function Cn({ top: e, right: t, bottom: i, left: r }) {
|
|
888
888
|
return e === t && t === i && i === r ? e : e === i && t === r ? `${e} ${t}` : t === r ? `${e} ${t} ${i}` : `${e} ${t} ${i} ${r}`;
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function te(e) {
|
|
891
891
|
const t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);
|
|
892
892
|
return t ? t[1] : e;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function ne(e) {
|
|
895
895
|
const t = e.trim();
|
|
896
896
|
return t === "" ? "0px" : /^-?\d+(?:\.\d+)?$/.test(t) ? `${t}px` : t;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
return e === t ?
|
|
898
|
+
function tt(e, t) {
|
|
899
|
+
return e === t ? te(e) : `${te(e)}, ${te(t)}`;
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function nt(e, t) {
|
|
902
902
|
const i = e.split(",").map((r) => r.trim()).filter(Boolean);
|
|
903
903
|
if (i.length === 0) return [t, t];
|
|
904
904
|
if (i.length === 1) {
|
|
905
|
-
const r =
|
|
905
|
+
const r = ne(i[0]);
|
|
906
906
|
return [r, r];
|
|
907
907
|
}
|
|
908
|
-
return [
|
|
908
|
+
return [ne(i[0]), ne(i[1])];
|
|
909
909
|
}
|
|
910
|
-
const
|
|
911
|
-
width:
|
|
912
|
-
height:
|
|
910
|
+
const rt = 12, _e = {
|
|
911
|
+
width: rt,
|
|
912
|
+
height: rt,
|
|
913
913
|
viewBox: "0 0 12 12",
|
|
914
914
|
fill: "none",
|
|
915
915
|
"aria-hidden": !0
|
|
916
916
|
};
|
|
917
|
-
function
|
|
918
|
-
return /* @__PURE__ */
|
|
917
|
+
function An() {
|
|
918
|
+
return /* @__PURE__ */ d("svg", { ..._e, children: [
|
|
919
919
|
/* @__PURE__ */ n("rect", { x: "1.5", y: "1.5", width: "9", height: "9", stroke: "currentColor", strokeOpacity: "0.35" }),
|
|
920
920
|
/* @__PURE__ */ n("line", { x1: "1.5", y1: "1.5", x2: "1.5", y2: "10.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
921
921
|
/* @__PURE__ */ n("line", { x1: "10.5", y1: "1.5", x2: "10.5", y2: "10.5", stroke: "currentColor", strokeWidth: "1.5" })
|
|
922
922
|
] });
|
|
923
923
|
}
|
|
924
|
-
function
|
|
925
|
-
return /* @__PURE__ */
|
|
924
|
+
function Mn() {
|
|
925
|
+
return /* @__PURE__ */ d("svg", { ..._e, children: [
|
|
926
926
|
/* @__PURE__ */ n("rect", { x: "1.5", y: "1.5", width: "9", height: "9", stroke: "currentColor", strokeOpacity: "0.35" }),
|
|
927
927
|
/* @__PURE__ */ n("line", { x1: "1.5", y1: "1.5", x2: "10.5", y2: "1.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
928
928
|
/* @__PURE__ */ n("line", { x1: "1.5", y1: "10.5", x2: "10.5", y2: "10.5", stroke: "currentColor", strokeWidth: "1.5" })
|
|
929
929
|
] });
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function be({ side: e }) {
|
|
932
932
|
const t = {
|
|
933
933
|
top: { x1: 1.5, y1: 1.5, x2: 10.5, y2: 1.5 },
|
|
934
934
|
right: { x1: 10.5, y1: 1.5, x2: 10.5, y2: 10.5 },
|
|
935
935
|
bottom: { x1: 1.5, y1: 10.5, x2: 10.5, y2: 10.5 },
|
|
936
936
|
left: { x1: 1.5, y1: 1.5, x2: 1.5, y2: 10.5 }
|
|
937
937
|
}[e];
|
|
938
|
-
return /* @__PURE__ */
|
|
938
|
+
return /* @__PURE__ */ d("svg", { ..._e, children: [
|
|
939
939
|
/* @__PURE__ */ n("rect", { x: "1.5", y: "1.5", width: "9", height: "9", stroke: "currentColor", strokeOpacity: "0.35" }),
|
|
940
940
|
/* @__PURE__ */ n("line", { ...t, stroke: "currentColor", strokeWidth: "1.5" })
|
|
941
941
|
] });
|
|
942
942
|
}
|
|
943
|
-
function
|
|
944
|
-
return /* @__PURE__ */
|
|
943
|
+
function Sn() {
|
|
944
|
+
return /* @__PURE__ */ d("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: [
|
|
945
945
|
/* @__PURE__ */ n("rect", { x: "2", y: "2", width: "4", height: "4", stroke: "currentColor", strokeWidth: "1.2" }),
|
|
946
946
|
/* @__PURE__ */ n("rect", { x: "8", y: "2", width: "4", height: "4", stroke: "currentColor", strokeWidth: "1.2" }),
|
|
947
947
|
/* @__PURE__ */ n("rect", { x: "2", y: "8", width: "4", height: "4", stroke: "currentColor", strokeWidth: "1.2" }),
|
|
948
948
|
/* @__PURE__ */ n("rect", { x: "8", y: "8", width: "4", height: "4", stroke: "currentColor", strokeWidth: "1.2" })
|
|
949
949
|
] });
|
|
950
950
|
}
|
|
951
|
-
function
|
|
952
|
-
const [
|
|
953
|
-
return
|
|
954
|
-
|
|
955
|
-
}, [t]), /* @__PURE__ */
|
|
951
|
+
function ae({ icon: e, display: t, ariaLabel: i, mixed: r, onCommit: a }) {
|
|
952
|
+
const [o, s] = A(t);
|
|
953
|
+
return B(() => {
|
|
954
|
+
s(t);
|
|
955
|
+
}, [t]), /* @__PURE__ */ d("label", { className: `pa-spacing-cell ${r ? "pa-spacing-cell--mixed" : ""}`, children: [
|
|
956
956
|
/* @__PURE__ */ n("span", { className: "pa-spacing-cell-icon", children: e }),
|
|
957
957
|
/* @__PURE__ */ n(
|
|
958
958
|
"input",
|
|
959
959
|
{
|
|
960
960
|
className: "pa-input pa-spacing-cell-input",
|
|
961
961
|
type: "text",
|
|
962
|
-
value:
|
|
963
|
-
onChange: (
|
|
964
|
-
onBlur: () => a(
|
|
965
|
-
onKeyDown: (
|
|
966
|
-
|
|
962
|
+
value: o,
|
|
963
|
+
onChange: (u) => s(u.target.value),
|
|
964
|
+
onBlur: () => a(o),
|
|
965
|
+
onKeyDown: (u) => {
|
|
966
|
+
u.key === "Enter" && u.target.blur(), u.key === "Escape" && (s(t), u.target.blur());
|
|
967
967
|
},
|
|
968
968
|
"aria-label": i,
|
|
969
969
|
spellCheck: !1
|
|
@@ -971,13 +971,13 @@ function oe({ icon: e, display: t, ariaLabel: i, mixed: r, onCommit: a }) {
|
|
|
971
971
|
)
|
|
972
972
|
] });
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
const r =
|
|
976
|
-
i(
|
|
977
|
-
},
|
|
978
|
-
return /* @__PURE__ */
|
|
974
|
+
function it({ label: e, value: t, onChange: i }) {
|
|
975
|
+
const r = kn(t), [a, o] = A(!1), s = (l) => {
|
|
976
|
+
i(Cn({ ...r, ...l }));
|
|
977
|
+
}, u = r.left !== r.right, c = r.top !== r.bottom;
|
|
978
|
+
return /* @__PURE__ */ d("div", { className: "pa-prop-row pa-prop-row--compact pa-spacing-row", children: [
|
|
979
979
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: e }),
|
|
980
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ d(
|
|
981
981
|
"div",
|
|
982
982
|
{
|
|
983
983
|
className: `pa-spacing-control ${a ? "pa-spacing-control--split" : "pa-spacing-control--pair"}`,
|
|
@@ -986,68 +986,68 @@ function tt({ label: e, value: t, onChange: i }) {
|
|
|
986
986
|
// Grid mirrors pair-view columns:
|
|
987
987
|
// Col 1 (horizontal pair) → L on top, R on bottom
|
|
988
988
|
// Col 2 (vertical pair) → T on top, B on bottom
|
|
989
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ d("div", { className: "pa-spacing-grid", children: [
|
|
990
990
|
/* @__PURE__ */ n(
|
|
991
|
-
|
|
991
|
+
ae,
|
|
992
992
|
{
|
|
993
|
-
icon: /* @__PURE__ */ n(
|
|
994
|
-
display:
|
|
993
|
+
icon: /* @__PURE__ */ n(be, { side: "left" }),
|
|
994
|
+
display: te(r.left),
|
|
995
995
|
ariaLabel: `${e} left`,
|
|
996
|
-
onCommit: (l) =>
|
|
996
|
+
onCommit: (l) => s({ left: ne(l) })
|
|
997
997
|
}
|
|
998
998
|
),
|
|
999
999
|
/* @__PURE__ */ n(
|
|
1000
|
-
|
|
1000
|
+
ae,
|
|
1001
1001
|
{
|
|
1002
|
-
icon: /* @__PURE__ */ n(
|
|
1003
|
-
display:
|
|
1002
|
+
icon: /* @__PURE__ */ n(be, { side: "top" }),
|
|
1003
|
+
display: te(r.top),
|
|
1004
1004
|
ariaLabel: `${e} top`,
|
|
1005
|
-
onCommit: (l) =>
|
|
1005
|
+
onCommit: (l) => s({ top: ne(l) })
|
|
1006
1006
|
}
|
|
1007
1007
|
),
|
|
1008
1008
|
/* @__PURE__ */ n(
|
|
1009
|
-
|
|
1009
|
+
ae,
|
|
1010
1010
|
{
|
|
1011
|
-
icon: /* @__PURE__ */ n(
|
|
1012
|
-
display:
|
|
1011
|
+
icon: /* @__PURE__ */ n(be, { side: "right" }),
|
|
1012
|
+
display: te(r.right),
|
|
1013
1013
|
ariaLabel: `${e} right`,
|
|
1014
|
-
onCommit: (l) =>
|
|
1014
|
+
onCommit: (l) => s({ right: ne(l) })
|
|
1015
1015
|
}
|
|
1016
1016
|
),
|
|
1017
1017
|
/* @__PURE__ */ n(
|
|
1018
|
-
|
|
1018
|
+
ae,
|
|
1019
1019
|
{
|
|
1020
|
-
icon: /* @__PURE__ */ n(
|
|
1021
|
-
display:
|
|
1020
|
+
icon: /* @__PURE__ */ n(be, { side: "bottom" }),
|
|
1021
|
+
display: te(r.bottom),
|
|
1022
1022
|
ariaLabel: `${e} bottom`,
|
|
1023
|
-
onCommit: (l) =>
|
|
1023
|
+
onCommit: (l) => s({ bottom: ne(l) })
|
|
1024
1024
|
}
|
|
1025
1025
|
)
|
|
1026
1026
|
] })
|
|
1027
|
-
) : /* @__PURE__ */
|
|
1027
|
+
) : /* @__PURE__ */ d("div", { className: "pa-spacing-pair", children: [
|
|
1028
1028
|
/* @__PURE__ */ n(
|
|
1029
|
-
|
|
1029
|
+
ae,
|
|
1030
1030
|
{
|
|
1031
|
-
icon: /* @__PURE__ */ n(
|
|
1032
|
-
display:
|
|
1033
|
-
mixed:
|
|
1031
|
+
icon: /* @__PURE__ */ n(An, {}),
|
|
1032
|
+
display: tt(r.left, r.right),
|
|
1033
|
+
mixed: u,
|
|
1034
1034
|
ariaLabel: `${e} horizontal`,
|
|
1035
1035
|
onCommit: (l) => {
|
|
1036
|
-
const [p, m] =
|
|
1037
|
-
|
|
1036
|
+
const [p, m] = nt(l, r.left);
|
|
1037
|
+
s({ left: p, right: m });
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
),
|
|
1041
1041
|
/* @__PURE__ */ n(
|
|
1042
|
-
|
|
1042
|
+
ae,
|
|
1043
1043
|
{
|
|
1044
|
-
icon: /* @__PURE__ */ n(
|
|
1045
|
-
display:
|
|
1046
|
-
mixed:
|
|
1044
|
+
icon: /* @__PURE__ */ n(Mn, {}),
|
|
1045
|
+
display: tt(r.top, r.bottom),
|
|
1046
|
+
mixed: c,
|
|
1047
1047
|
ariaLabel: `${e} vertical`,
|
|
1048
1048
|
onCommit: (l) => {
|
|
1049
|
-
const [p, m] =
|
|
1050
|
-
|
|
1049
|
+
const [p, m] = nt(l, r.top);
|
|
1050
|
+
s({ top: p, bottom: m });
|
|
1051
1051
|
}
|
|
1052
1052
|
}
|
|
1053
1053
|
)
|
|
@@ -1057,11 +1057,11 @@ function tt({ label: e, value: t, onChange: i }) {
|
|
|
1057
1057
|
{
|
|
1058
1058
|
type: "button",
|
|
1059
1059
|
className: `pa-spacing-toggle ${a ? "pa-spacing-toggle--on" : ""}`,
|
|
1060
|
-
onClick: () =>
|
|
1060
|
+
onClick: () => o((l) => !l),
|
|
1061
1061
|
"aria-pressed": a,
|
|
1062
1062
|
"aria-label": a ? "Collapse to pair view" : "Expand to per-side view",
|
|
1063
1063
|
title: a ? "Collapse to pair view" : "Expand to per-side view",
|
|
1064
|
-
children: /* @__PURE__ */ n(
|
|
1064
|
+
children: /* @__PURE__ */ n(Sn, {})
|
|
1065
1065
|
}
|
|
1066
1066
|
)
|
|
1067
1067
|
]
|
|
@@ -1069,7 +1069,7 @@ function tt({ label: e, value: t, onChange: i }) {
|
|
|
1069
1069
|
)
|
|
1070
1070
|
] });
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function Ln({
|
|
1073
1073
|
options: e,
|
|
1074
1074
|
value: t,
|
|
1075
1075
|
ariaLabel: i,
|
|
@@ -1089,7 +1089,7 @@ function kn({
|
|
|
1089
1089
|
a.value
|
|
1090
1090
|
)) });
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function En({
|
|
1093
1093
|
options: e,
|
|
1094
1094
|
ariaLabel: t,
|
|
1095
1095
|
onToggle: i
|
|
@@ -1108,7 +1108,7 @@ function Cn({
|
|
|
1108
1108
|
r.id
|
|
1109
1109
|
)) });
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function In({ className: e }) {
|
|
1112
1112
|
return /* @__PURE__ */ n("svg", { className: e, width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1113
1113
|
"path",
|
|
1114
1114
|
{
|
|
@@ -1117,7 +1117,7 @@ function Mn({ className: e }) {
|
|
|
1117
1117
|
}
|
|
1118
1118
|
) });
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function Tn({ className: e }) {
|
|
1121
1121
|
return /* @__PURE__ */ n("svg", { className: e, width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1122
1122
|
"path",
|
|
1123
1123
|
{
|
|
@@ -1126,7 +1126,7 @@ function An({ className: e }) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
) });
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1129
|
+
function Pn({ className: e }) {
|
|
1130
1130
|
return /* @__PURE__ */ n("svg", { className: e, width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1131
1131
|
"path",
|
|
1132
1132
|
{
|
|
@@ -1135,10 +1135,10 @@ function Sn({ className: e }) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
) });
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1138
|
+
function Rn({ className: e }) {
|
|
1139
1139
|
return /* @__PURE__ */ n("svg", { className: e, width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { fill: "currentColor", d: "M2 3h12v1.5H2V3zm0 3.5h12v1.5H2V6.5zm0 3.5h12v1.5H2V10zm0 3.5h12v1.5H2V13.5z" }) });
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function Dn({ className: e }) {
|
|
1142
1142
|
return /* @__PURE__ */ n("svg", { className: e, width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1143
1143
|
"path",
|
|
1144
1144
|
{
|
|
@@ -1147,33 +1147,33 @@ function En({ className: e }) {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
) });
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function Et(e) {
|
|
1151
1151
|
const t = parseInt(e.trim(), 10);
|
|
1152
1152
|
return Number.isFinite(t) ? t >= 600 : e.trim() === "bold" || e.trim() === "bolder";
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1155
|
-
return
|
|
1154
|
+
function On(e) {
|
|
1155
|
+
return Et(e) ? "400" : "700";
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1157
|
+
function It(e) {
|
|
1158
1158
|
return e.trim() === "italic" || e.trim() === "oblique";
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1160
|
+
function $n(e) {
|
|
1161
|
+
return It(e) ? "normal" : "italic";
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1163
|
+
function at(e, t) {
|
|
1164
1164
|
return e.split(/\s+/).includes(t);
|
|
1165
1165
|
}
|
|
1166
|
-
function
|
|
1166
|
+
function ot(e, t) {
|
|
1167
1167
|
const i = new Set(
|
|
1168
1168
|
e.trim().split(/\s+/).filter((r) => r && r !== "none")
|
|
1169
1169
|
);
|
|
1170
1170
|
return i.has(t) ? i.delete(t) : i.add(t), i.size === 0 ? "none" : Array.from(i).join(" ");
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function Fn(e) {
|
|
1173
1173
|
const t = e.trim();
|
|
1174
1174
|
return t === "center" || t === "right" || t === "justify" ? t : "left";
|
|
1175
1175
|
}
|
|
1176
|
-
const
|
|
1176
|
+
const st = [
|
|
1177
1177
|
"none",
|
|
1178
1178
|
"solid",
|
|
1179
1179
|
"dashed",
|
|
@@ -1183,7 +1183,7 @@ const it = [
|
|
|
1183
1183
|
"ridge",
|
|
1184
1184
|
"inset",
|
|
1185
1185
|
"outset"
|
|
1186
|
-
],
|
|
1186
|
+
], lt = [
|
|
1187
1187
|
"block",
|
|
1188
1188
|
"inline",
|
|
1189
1189
|
"inline-block",
|
|
@@ -1193,39 +1193,39 @@ const it = [
|
|
|
1193
1193
|
"inline-grid",
|
|
1194
1194
|
"none",
|
|
1195
1195
|
"contents"
|
|
1196
|
-
],
|
|
1197
|
-
function
|
|
1196
|
+
], Bn = /* @__PURE__ */ new Set(["flex", "inline-flex", "grid", "inline-grid"]);
|
|
1197
|
+
function zn({
|
|
1198
1198
|
values: e,
|
|
1199
1199
|
onPropertyChange: t,
|
|
1200
1200
|
textKind: i,
|
|
1201
1201
|
textValue: r,
|
|
1202
1202
|
onTextChange: a,
|
|
1203
|
-
targetScope:
|
|
1204
|
-
onTargetScopeChange:
|
|
1205
|
-
elementState:
|
|
1206
|
-
onElementStateChange:
|
|
1203
|
+
targetScope: o,
|
|
1204
|
+
onTargetScopeChange: s,
|
|
1205
|
+
elementState: u,
|
|
1206
|
+
onElementStateChange: c,
|
|
1207
1207
|
instanceCount: l,
|
|
1208
1208
|
scopeHint: p,
|
|
1209
1209
|
stateHint: m
|
|
1210
1210
|
}) {
|
|
1211
|
-
var
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
return R && !
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */
|
|
1211
|
+
var T, C;
|
|
1212
|
+
const v = e["font-weight"] ?? "", g = e["font-style"] ?? "normal", f = e["text-decoration"] ?? "none", b = Fn(e["text-align"] ?? "left"), E = ((T = e.display) == null ? void 0 : T.trim()) ?? "", k = !!E, w = Bn.has(E), x = [...lt];
|
|
1213
|
+
E && !lt.includes(E) && x.push(E);
|
|
1214
|
+
const L = ((C = e.gap) == null ? void 0 : C.trim()) ?? "", P = L === "normal" || L === "" ? "0px" : L, R = e["border-style"] ?? "none", N = [...st];
|
|
1215
|
+
return R && !st.includes(R) && N.push(R), /* @__PURE__ */ d("div", { className: "pa-edit-sections", children: [
|
|
1216
|
+
/* @__PURE__ */ d(re, { title: "Targeting", defaultOpen: !0, children: [
|
|
1217
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-field-grid pa-edit-field-grid--2", children: [
|
|
1218
|
+
/* @__PURE__ */ d("label", { className: "pa-edit-mini-field", children: [
|
|
1219
1219
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Scope" }),
|
|
1220
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ d(
|
|
1221
1221
|
"select",
|
|
1222
1222
|
{
|
|
1223
1223
|
className: "pa-select",
|
|
1224
|
-
value:
|
|
1225
|
-
onChange: (h) =>
|
|
1224
|
+
value: o,
|
|
1225
|
+
onChange: (h) => s(h.target.value),
|
|
1226
1226
|
children: [
|
|
1227
1227
|
/* @__PURE__ */ n("option", { value: "this-instance", children: "This instance" }),
|
|
1228
|
-
/* @__PURE__ */
|
|
1228
|
+
/* @__PURE__ */ d("option", { value: "all-instances", disabled: l <= 1, children: [
|
|
1229
1229
|
"All (",
|
|
1230
1230
|
l,
|
|
1231
1231
|
")"
|
|
@@ -1234,14 +1234,14 @@ function $n({
|
|
|
1234
1234
|
}
|
|
1235
1235
|
)
|
|
1236
1236
|
] }),
|
|
1237
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ d("label", { className: "pa-edit-mini-field", children: [
|
|
1238
1238
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "State" }),
|
|
1239
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ d(
|
|
1240
1240
|
"select",
|
|
1241
1241
|
{
|
|
1242
1242
|
className: "pa-select",
|
|
1243
|
-
value:
|
|
1244
|
-
onChange: (h) =>
|
|
1243
|
+
value: u,
|
|
1244
|
+
onChange: (h) => c(h.target.value),
|
|
1245
1245
|
children: [
|
|
1246
1246
|
/* @__PURE__ */ n("option", { value: "normal", children: "Normal" }),
|
|
1247
1247
|
/* @__PURE__ */ n("option", { value: "hover", children: "Hover" }),
|
|
@@ -1256,7 +1256,7 @@ function $n({
|
|
|
1256
1256
|
p ? /* @__PURE__ */ n("p", { className: "pa-edit-inline-hint", children: p }) : null,
|
|
1257
1257
|
m ? /* @__PURE__ */ n("p", { className: "pa-edit-inline-hint", children: m }) : null
|
|
1258
1258
|
] }),
|
|
1259
|
-
i !== "none" && /* @__PURE__ */ n(
|
|
1259
|
+
i !== "none" && /* @__PURE__ */ n(re, { title: "Content", defaultOpen: !0, children: /* @__PURE__ */ d("label", { className: "pa-edit-stack-field", children: [
|
|
1260
1260
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Text" }),
|
|
1261
1261
|
/* @__PURE__ */ n(
|
|
1262
1262
|
"textarea",
|
|
@@ -1269,94 +1269,94 @@ function $n({
|
|
|
1269
1269
|
}
|
|
1270
1270
|
)
|
|
1271
1271
|
] }) }),
|
|
1272
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ d(re, { title: "Typography", defaultOpen: !0, children: [
|
|
1273
1273
|
/* @__PURE__ */ n(
|
|
1274
|
-
|
|
1274
|
+
vn,
|
|
1275
1275
|
{
|
|
1276
1276
|
value: e["font-family"] ?? "",
|
|
1277
1277
|
onChange: (h) => t("font-family", h)
|
|
1278
1278
|
}
|
|
1279
1279
|
),
|
|
1280
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-field-block", children: [
|
|
1281
1281
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Style" }),
|
|
1282
1282
|
/* @__PURE__ */ n(
|
|
1283
|
-
|
|
1283
|
+
En,
|
|
1284
1284
|
{
|
|
1285
1285
|
ariaLabel: "Text style",
|
|
1286
1286
|
options: [
|
|
1287
1287
|
{
|
|
1288
1288
|
id: "bold",
|
|
1289
1289
|
title: "Bold",
|
|
1290
|
-
pressed:
|
|
1290
|
+
pressed: Et(v),
|
|
1291
1291
|
content: /* @__PURE__ */ n("span", { className: "pa-segmented-type pa-segmented-type--bold", children: "B" })
|
|
1292
1292
|
},
|
|
1293
1293
|
{
|
|
1294
1294
|
id: "italic",
|
|
1295
1295
|
title: "Italic",
|
|
1296
|
-
pressed:
|
|
1296
|
+
pressed: It(g),
|
|
1297
1297
|
content: /* @__PURE__ */ n("span", { className: "pa-segmented-type pa-segmented-type--italic", children: "I" })
|
|
1298
1298
|
},
|
|
1299
1299
|
{
|
|
1300
1300
|
id: "underline",
|
|
1301
1301
|
title: "Underline",
|
|
1302
|
-
pressed:
|
|
1302
|
+
pressed: at(f, "underline"),
|
|
1303
1303
|
content: /* @__PURE__ */ n("span", { className: "pa-segmented-type pa-segmented-type--underline", children: "U" })
|
|
1304
1304
|
},
|
|
1305
1305
|
{
|
|
1306
1306
|
id: "strikethrough",
|
|
1307
1307
|
title: "Strikethrough",
|
|
1308
|
-
pressed:
|
|
1309
|
-
content: /* @__PURE__ */ n(
|
|
1308
|
+
pressed: at(f, "line-through"),
|
|
1309
|
+
content: /* @__PURE__ */ n(Dn, { className: "pa-segmented-icon" })
|
|
1310
1310
|
}
|
|
1311
1311
|
],
|
|
1312
1312
|
onToggle: (h) => {
|
|
1313
|
-
h === "bold" ? t("font-weight",
|
|
1313
|
+
h === "bold" ? t("font-weight", On(v)) : h === "italic" ? t("font-style", $n(g)) : h === "underline" ? t(
|
|
1314
1314
|
"text-decoration",
|
|
1315
|
-
|
|
1315
|
+
ot(f, "underline")
|
|
1316
1316
|
) : h === "strikethrough" && t(
|
|
1317
1317
|
"text-decoration",
|
|
1318
|
-
|
|
1318
|
+
ot(f, "line-through")
|
|
1319
1319
|
);
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
)
|
|
1323
1323
|
] }),
|
|
1324
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-field-block", children: [
|
|
1325
1325
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Align" }),
|
|
1326
1326
|
/* @__PURE__ */ n(
|
|
1327
|
-
|
|
1327
|
+
Ln,
|
|
1328
1328
|
{
|
|
1329
1329
|
ariaLabel: "Text align",
|
|
1330
|
-
value:
|
|
1330
|
+
value: b,
|
|
1331
1331
|
onChange: (h) => t("text-align", h),
|
|
1332
1332
|
options: [
|
|
1333
1333
|
{
|
|
1334
1334
|
value: "left",
|
|
1335
1335
|
title: "Align left",
|
|
1336
|
-
content: /* @__PURE__ */ n(
|
|
1336
|
+
content: /* @__PURE__ */ n(In, { className: "pa-segmented-icon" })
|
|
1337
1337
|
},
|
|
1338
1338
|
{
|
|
1339
1339
|
value: "center",
|
|
1340
1340
|
title: "Align center",
|
|
1341
|
-
content: /* @__PURE__ */ n(
|
|
1341
|
+
content: /* @__PURE__ */ n(Tn, { className: "pa-segmented-icon" })
|
|
1342
1342
|
},
|
|
1343
1343
|
{
|
|
1344
1344
|
value: "right",
|
|
1345
1345
|
title: "Align right",
|
|
1346
|
-
content: /* @__PURE__ */ n(
|
|
1346
|
+
content: /* @__PURE__ */ n(Pn, { className: "pa-segmented-icon" })
|
|
1347
1347
|
},
|
|
1348
1348
|
{
|
|
1349
1349
|
value: "justify",
|
|
1350
1350
|
title: "Justify",
|
|
1351
|
-
content: /* @__PURE__ */ n(
|
|
1351
|
+
content: /* @__PURE__ */ n(Rn, { className: "pa-segmented-icon" })
|
|
1352
1352
|
}
|
|
1353
1353
|
]
|
|
1354
1354
|
}
|
|
1355
1355
|
)
|
|
1356
1356
|
] }),
|
|
1357
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-field-grid pa-edit-field-grid--2 pa-edit-size-row", children: [
|
|
1358
1358
|
/* @__PURE__ */ n(
|
|
1359
|
-
|
|
1359
|
+
Z,
|
|
1360
1360
|
{
|
|
1361
1361
|
compact: !0,
|
|
1362
1362
|
property: "font-size",
|
|
@@ -1366,7 +1366,7 @@ function $n({
|
|
|
1366
1366
|
}
|
|
1367
1367
|
),
|
|
1368
1368
|
/* @__PURE__ */ n(
|
|
1369
|
-
|
|
1369
|
+
Z,
|
|
1370
1370
|
{
|
|
1371
1371
|
compact: !0,
|
|
1372
1372
|
property: "line-height",
|
|
@@ -1377,7 +1377,7 @@ function $n({
|
|
|
1377
1377
|
)
|
|
1378
1378
|
] }),
|
|
1379
1379
|
/* @__PURE__ */ n(
|
|
1380
|
-
|
|
1380
|
+
Te,
|
|
1381
1381
|
{
|
|
1382
1382
|
label: "Color",
|
|
1383
1383
|
value: e.color ?? "",
|
|
@@ -1385,10 +1385,10 @@ function $n({
|
|
|
1385
1385
|
}
|
|
1386
1386
|
)
|
|
1387
1387
|
] }),
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ d(re, { title: "Layout", defaultOpen: !0, children: [
|
|
1389
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-split-fields", children: [
|
|
1390
1390
|
/* @__PURE__ */ n(
|
|
1391
|
-
|
|
1391
|
+
Z,
|
|
1392
1392
|
{
|
|
1393
1393
|
compact: !0,
|
|
1394
1394
|
property: "width",
|
|
@@ -1398,7 +1398,7 @@ function $n({
|
|
|
1398
1398
|
}
|
|
1399
1399
|
),
|
|
1400
1400
|
/* @__PURE__ */ n(
|
|
1401
|
-
|
|
1401
|
+
Z,
|
|
1402
1402
|
{
|
|
1403
1403
|
compact: !0,
|
|
1404
1404
|
property: "height",
|
|
@@ -1409,7 +1409,7 @@ function $n({
|
|
|
1409
1409
|
)
|
|
1410
1410
|
] }),
|
|
1411
1411
|
/* @__PURE__ */ n(
|
|
1412
|
-
|
|
1412
|
+
it,
|
|
1413
1413
|
{
|
|
1414
1414
|
property: "padding",
|
|
1415
1415
|
label: "Padding",
|
|
@@ -1418,7 +1418,7 @@ function $n({
|
|
|
1418
1418
|
}
|
|
1419
1419
|
),
|
|
1420
1420
|
/* @__PURE__ */ n(
|
|
1421
|
-
|
|
1421
|
+
it,
|
|
1422
1422
|
{
|
|
1423
1423
|
property: "margin",
|
|
1424
1424
|
label: "Margin",
|
|
@@ -1426,32 +1426,32 @@ function $n({
|
|
|
1426
1426
|
onChange: (h) => t("margin", h)
|
|
1427
1427
|
}
|
|
1428
1428
|
),
|
|
1429
|
-
|
|
1429
|
+
k && /* @__PURE__ */ d("label", { className: "pa-prop-row pa-prop-row--compact", children: [
|
|
1430
1430
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Display" }),
|
|
1431
1431
|
/* @__PURE__ */ n(
|
|
1432
1432
|
"select",
|
|
1433
1433
|
{
|
|
1434
1434
|
className: "pa-select",
|
|
1435
|
-
value:
|
|
1435
|
+
value: E,
|
|
1436
1436
|
onChange: (h) => t("display", h.target.value),
|
|
1437
|
-
children:
|
|
1437
|
+
children: x.map((h) => /* @__PURE__ */ n("option", { value: h, children: h }, h))
|
|
1438
1438
|
}
|
|
1439
1439
|
)
|
|
1440
1440
|
] }),
|
|
1441
|
-
|
|
1442
|
-
|
|
1441
|
+
w && /* @__PURE__ */ n(
|
|
1442
|
+
Z,
|
|
1443
1443
|
{
|
|
1444
1444
|
compact: !0,
|
|
1445
1445
|
property: "gap",
|
|
1446
1446
|
label: "Gap",
|
|
1447
|
-
value:
|
|
1447
|
+
value: P,
|
|
1448
1448
|
onChange: (h) => t("gap", h)
|
|
1449
1449
|
}
|
|
1450
1450
|
)
|
|
1451
1451
|
] }),
|
|
1452
|
-
/* @__PURE__ */
|
|
1452
|
+
/* @__PURE__ */ d(re, { title: "Fill", children: [
|
|
1453
1453
|
/* @__PURE__ */ n(
|
|
1454
|
-
|
|
1454
|
+
Te,
|
|
1455
1455
|
{
|
|
1456
1456
|
label: "Background",
|
|
1457
1457
|
value: e["background-color"] ?? "",
|
|
@@ -1459,7 +1459,7 @@ function $n({
|
|
|
1459
1459
|
}
|
|
1460
1460
|
),
|
|
1461
1461
|
/* @__PURE__ */ n(
|
|
1462
|
-
|
|
1462
|
+
Z,
|
|
1463
1463
|
{
|
|
1464
1464
|
compact: !0,
|
|
1465
1465
|
property: "opacity",
|
|
@@ -1469,16 +1469,16 @@ function $n({
|
|
|
1469
1469
|
}
|
|
1470
1470
|
)
|
|
1471
1471
|
] }),
|
|
1472
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ d(re, { title: "Border", defaultOpen: !0, children: [
|
|
1473
1473
|
/* @__PURE__ */ n(
|
|
1474
|
-
|
|
1474
|
+
Te,
|
|
1475
1475
|
{
|
|
1476
1476
|
label: "Border color",
|
|
1477
1477
|
value: e["border-color"] ?? "",
|
|
1478
1478
|
onChange: (h) => t("border-color", h)
|
|
1479
1479
|
}
|
|
1480
1480
|
),
|
|
1481
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ d("label", { className: "pa-edit-stack-field", children: [
|
|
1482
1482
|
/* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Style" }),
|
|
1483
1483
|
/* @__PURE__ */ n(
|
|
1484
1484
|
"select",
|
|
@@ -1486,12 +1486,12 @@ function $n({
|
|
|
1486
1486
|
className: "pa-select",
|
|
1487
1487
|
value: R,
|
|
1488
1488
|
onChange: (h) => t("border-style", h.target.value),
|
|
1489
|
-
children:
|
|
1489
|
+
children: N.map((h) => /* @__PURE__ */ n("option", { value: h, children: h }, h))
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
1492
1492
|
] }),
|
|
1493
1493
|
/* @__PURE__ */ n(
|
|
1494
|
-
|
|
1494
|
+
Z,
|
|
1495
1495
|
{
|
|
1496
1496
|
compact: !0,
|
|
1497
1497
|
property: "border-width",
|
|
@@ -1501,7 +1501,7 @@ function $n({
|
|
|
1501
1501
|
}
|
|
1502
1502
|
),
|
|
1503
1503
|
/* @__PURE__ */ n(
|
|
1504
|
-
|
|
1504
|
+
Z,
|
|
1505
1505
|
{
|
|
1506
1506
|
compact: !0,
|
|
1507
1507
|
property: "border-radius",
|
|
@@ -1513,7 +1513,7 @@ function $n({
|
|
|
1513
1513
|
] })
|
|
1514
1514
|
] });
|
|
1515
1515
|
}
|
|
1516
|
-
const
|
|
1516
|
+
const Hn = 50, ct = [
|
|
1517
1517
|
"font-family",
|
|
1518
1518
|
"font-size",
|
|
1519
1519
|
"font-weight",
|
|
@@ -1535,180 +1535,180 @@ const Pn = 50, ot = [
|
|
|
1535
1535
|
"border-radius",
|
|
1536
1536
|
"opacity"
|
|
1537
1537
|
];
|
|
1538
|
-
function
|
|
1539
|
-
const r = V([]), a = V(/* @__PURE__ */ new Set()),
|
|
1538
|
+
function _n(e, t, i) {
|
|
1539
|
+
const r = V([]), a = V(/* @__PURE__ */ new Set()), o = V([]), s = V(null), u = V([]), [c, l] = A({}), [p, m] = A({}), [v, g] = A("none"), [f, b] = A(""), [E, k] = A(""), [w, x] = A([]), [L, P] = A(!1), R = I(() => {
|
|
1540
1540
|
const M = Array.from(a.current);
|
|
1541
1541
|
return {
|
|
1542
|
-
inline:
|
|
1543
|
-
text: e &&
|
|
1542
|
+
inline: je(M, [...ct]),
|
|
1543
|
+
text: e && v !== "none" ? Ke(e, v) : null
|
|
1544
1544
|
};
|
|
1545
|
-
}, [e,
|
|
1546
|
-
|
|
1547
|
-
}, [R]),
|
|
1545
|
+
}, [e, v]), N = I(() => {
|
|
1546
|
+
u.current.push(R()), u.current.length > Hn && u.current.shift(), P(u.current.length > 0);
|
|
1547
|
+
}, [R]), T = I(
|
|
1548
1548
|
(M) => {
|
|
1549
1549
|
if (!e) return;
|
|
1550
|
-
const
|
|
1551
|
-
|
|
1552
|
-
const
|
|
1553
|
-
if (r.current =
|
|
1554
|
-
for (const
|
|
1555
|
-
if (
|
|
1556
|
-
for (const W of
|
|
1557
|
-
|
|
1550
|
+
const D = Array.from(a.current);
|
|
1551
|
+
he(o.current.filter((F) => D.includes(F.element))), s.current && me(s.current);
|
|
1552
|
+
const $ = xe(e, t);
|
|
1553
|
+
if (r.current = $, a.current = new Set($), fe(D), Ie($, i), M && w.length > 0)
|
|
1554
|
+
for (const F of w)
|
|
1555
|
+
if (F.property === "textContent" || F.property === "value")
|
|
1556
|
+
for (const W of $)
|
|
1557
|
+
qe(W, F.property, F.newValue);
|
|
1558
1558
|
else
|
|
1559
|
-
for (const W of
|
|
1560
|
-
W.style.setProperty(
|
|
1559
|
+
for (const W of $)
|
|
1560
|
+
W.style.setProperty(F.property, F.newValue);
|
|
1561
1561
|
},
|
|
1562
|
-
[e, t, i,
|
|
1562
|
+
[e, t, i, w]
|
|
1563
1563
|
);
|
|
1564
|
-
|
|
1564
|
+
B(() => {
|
|
1565
1565
|
if (!e) {
|
|
1566
|
-
r.current = [], a.current = /* @__PURE__ */ new Set(),
|
|
1566
|
+
r.current = [], a.current = /* @__PURE__ */ new Set(), o.current = [], s.current = null, u.current = [], l({}), m({}), g("none"), b(""), k(""), x([]), P(!1);
|
|
1567
1567
|
return;
|
|
1568
1568
|
}
|
|
1569
|
-
const M =
|
|
1570
|
-
r.current = M, a.current = new Set(M),
|
|
1571
|
-
const
|
|
1572
|
-
l(
|
|
1573
|
-
const
|
|
1574
|
-
return
|
|
1575
|
-
}, [e]),
|
|
1576
|
-
e &&
|
|
1577
|
-
}, [t]),
|
|
1569
|
+
const M = xe(e, t);
|
|
1570
|
+
r.current = M, a.current = new Set(M), o.current = je(M, [...ct]), u.current = [], P(!1);
|
|
1571
|
+
const D = ge(e);
|
|
1572
|
+
l(D), m(D);
|
|
1573
|
+
const $ = oe(e);
|
|
1574
|
+
return g($.kind), b($.value), k($.value), s.current = $.kind !== "none" ? Ke(e, $.kind) : null, x([]), Ie(M, i), () => fe(M);
|
|
1575
|
+
}, [e]), B(() => {
|
|
1576
|
+
e && T(!0);
|
|
1577
|
+
}, [t]), B(() => {
|
|
1578
1578
|
if (!e) return;
|
|
1579
|
-
const M =
|
|
1580
|
-
r.current = M,
|
|
1579
|
+
const M = xe(e, t);
|
|
1580
|
+
r.current = M, fe(Array.from(a.current)), Ie(M, i), a.current = new Set(M);
|
|
1581
1581
|
}, [i, e, t]);
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
const W =
|
|
1585
|
-
return
|
|
1582
|
+
const C = I((M, D, $) => {
|
|
1583
|
+
x((F) => {
|
|
1584
|
+
const W = F.filter((_) => _.property !== M);
|
|
1585
|
+
return $ === D ? W : [...W, { property: M, oldValue: D, newValue: $ }];
|
|
1586
1586
|
});
|
|
1587
|
-
}, []), h =
|
|
1588
|
-
(M,
|
|
1587
|
+
}, []), h = I(
|
|
1588
|
+
(M, D) => {
|
|
1589
1589
|
if (!e) return;
|
|
1590
|
-
const
|
|
1591
|
-
M === "border-width" && (
|
|
1592
|
-
for (const [
|
|
1593
|
-
const _ = p[
|
|
1594
|
-
for (const
|
|
1595
|
-
|
|
1596
|
-
|
|
1590
|
+
const $ = { [M]: D };
|
|
1591
|
+
M === "border-width" && (c["border-style"] ?? "none") === "none" && yn(D) && ($["border-style"] = "solid"), N(), l((F) => ({ ...F, ...$ }));
|
|
1592
|
+
for (const [F, W] of Object.entries($)) {
|
|
1593
|
+
const _ = p[F] ?? "";
|
|
1594
|
+
for (const ee of r.current)
|
|
1595
|
+
ee.style.setProperty(F, W), a.current.add(ee);
|
|
1596
|
+
C(F, _, W);
|
|
1597
1597
|
}
|
|
1598
1598
|
},
|
|
1599
|
-
[e, p,
|
|
1600
|
-
),
|
|
1599
|
+
[e, p, c, N, C]
|
|
1600
|
+
), O = I(
|
|
1601
1601
|
(M) => {
|
|
1602
|
-
if (!(!e ||
|
|
1603
|
-
|
|
1604
|
-
for (const
|
|
1605
|
-
|
|
1606
|
-
|
|
1602
|
+
if (!(!e || v === "none")) {
|
|
1603
|
+
N(), b(M);
|
|
1604
|
+
for (const D of r.current)
|
|
1605
|
+
qe(D, v, M), a.current.add(D);
|
|
1606
|
+
C(v, E, M);
|
|
1607
1607
|
}
|
|
1608
1608
|
},
|
|
1609
|
-
[e,
|
|
1610
|
-
), U =
|
|
1611
|
-
const M =
|
|
1612
|
-
if (M && (
|
|
1613
|
-
l(
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1609
|
+
[e, v, E, N, C]
|
|
1610
|
+
), U = I(() => {
|
|
1611
|
+
const M = u.current.pop();
|
|
1612
|
+
if (M && (he(M.inline), M.text && me(M.text), P(u.current.length > 0), e)) {
|
|
1613
|
+
l(ge(e));
|
|
1614
|
+
const D = oe(e);
|
|
1615
|
+
D.kind !== "none" && b(D.value);
|
|
1616
1616
|
}
|
|
1617
|
-
}, [e]),
|
|
1618
|
-
if (
|
|
1619
|
-
l(
|
|
1620
|
-
const M =
|
|
1621
|
-
|
|
1617
|
+
}, [e]), j = I(() => {
|
|
1618
|
+
if (he(o.current), s.current && me(s.current), u.current = [], P(!1), x([]), e) {
|
|
1619
|
+
l(ge(e));
|
|
1620
|
+
const M = oe(e);
|
|
1621
|
+
b(M.value);
|
|
1622
1622
|
}
|
|
1623
|
-
}, [e]),
|
|
1624
|
-
|
|
1625
|
-
}, []),
|
|
1626
|
-
if (
|
|
1627
|
-
l(
|
|
1628
|
-
const M =
|
|
1629
|
-
M.kind !== "none" &&
|
|
1623
|
+
}, [e]), z = I(() => {
|
|
1624
|
+
he(o.current), s.current && me(s.current);
|
|
1625
|
+
}, []), K = I(() => {
|
|
1626
|
+
if (z(), fe(Array.from(a.current)), u.current = [], P(!1), x([]), e) {
|
|
1627
|
+
l(ge(e));
|
|
1628
|
+
const M = oe(e);
|
|
1629
|
+
M.kind !== "none" && b(M.value);
|
|
1630
1630
|
}
|
|
1631
|
-
}, [
|
|
1631
|
+
}, [z, e]);
|
|
1632
1632
|
return {
|
|
1633
|
-
values:
|
|
1634
|
-
textKind:
|
|
1635
|
-
textValue:
|
|
1636
|
-
pendingChanges:
|
|
1637
|
-
canUndo:
|
|
1633
|
+
values: c,
|
|
1634
|
+
textKind: v,
|
|
1635
|
+
textValue: f,
|
|
1636
|
+
pendingChanges: w,
|
|
1637
|
+
canUndo: L,
|
|
1638
1638
|
updateProperty: h,
|
|
1639
|
-
updateText:
|
|
1639
|
+
updateText: O,
|
|
1640
1640
|
undo: U,
|
|
1641
|
-
reset:
|
|
1642
|
-
clearPreviews:
|
|
1643
|
-
revertPreviews:
|
|
1641
|
+
reset: j,
|
|
1642
|
+
clearPreviews: K,
|
|
1643
|
+
revertPreviews: z
|
|
1644
1644
|
};
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1646
|
+
function Vn({
|
|
1647
1647
|
selectedElement: e,
|
|
1648
1648
|
hoveredElement: t,
|
|
1649
1649
|
onSelectElement: i,
|
|
1650
1650
|
onHoverElement: r,
|
|
1651
1651
|
targetScope: a,
|
|
1652
|
-
onTargetScopeChange:
|
|
1653
|
-
elementState:
|
|
1654
|
-
onElementStateChange:
|
|
1655
|
-
onApply:
|
|
1652
|
+
onTargetScopeChange: o,
|
|
1653
|
+
elementState: s,
|
|
1654
|
+
onElementStateChange: u,
|
|
1655
|
+
onApply: c,
|
|
1656
1656
|
applyStatus: l,
|
|
1657
1657
|
isToolbarTarget: p,
|
|
1658
1658
|
onPreviewApi: m
|
|
1659
1659
|
}) {
|
|
1660
1660
|
const {
|
|
1661
|
-
values:
|
|
1662
|
-
textKind:
|
|
1663
|
-
textValue:
|
|
1664
|
-
pendingChanges:
|
|
1665
|
-
canUndo:
|
|
1666
|
-
updateProperty:
|
|
1667
|
-
updateText:
|
|
1668
|
-
undo:
|
|
1669
|
-
reset:
|
|
1670
|
-
clearPreviews:
|
|
1661
|
+
values: v,
|
|
1662
|
+
textKind: g,
|
|
1663
|
+
textValue: f,
|
|
1664
|
+
pendingChanges: b,
|
|
1665
|
+
canUndo: E,
|
|
1666
|
+
updateProperty: k,
|
|
1667
|
+
updateText: w,
|
|
1668
|
+
undo: x,
|
|
1669
|
+
reset: L,
|
|
1670
|
+
clearPreviews: P,
|
|
1671
1671
|
revertPreviews: R
|
|
1672
|
-
} =
|
|
1672
|
+
} = _n(e, a, s), { elementRef: N, isDragging: T, style: C, dragHandleProps: h } = Ct({
|
|
1673
1673
|
computeDefaultPosition: (_) => ({
|
|
1674
1674
|
x: window.innerWidth - _.width - 16,
|
|
1675
1675
|
y: 16
|
|
1676
1676
|
})
|
|
1677
1677
|
});
|
|
1678
|
-
|
|
1679
|
-
const
|
|
1678
|
+
B(() => (m == null || m({ clearPreviews: P, revertPreviews: R }), () => m == null ? void 0 : m(null)), [m, P, R]);
|
|
1679
|
+
const O = I(
|
|
1680
1680
|
(_) => {
|
|
1681
1681
|
if (p(_.target)) return;
|
|
1682
|
-
const
|
|
1682
|
+
const le = document.elementsFromPoint(_.clientX, _.clientY).find(
|
|
1683
1683
|
(q) => q instanceof Element && !q.closest(
|
|
1684
1684
|
"[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]"
|
|
1685
1685
|
)
|
|
1686
1686
|
);
|
|
1687
|
-
r(
|
|
1687
|
+
r(le ?? null);
|
|
1688
1688
|
},
|
|
1689
1689
|
[p, r]
|
|
1690
|
-
), U =
|
|
1690
|
+
), U = I(
|
|
1691
1691
|
(_) => {
|
|
1692
1692
|
if (p(_.target)) return;
|
|
1693
1693
|
_.preventDefault(), _.stopPropagation();
|
|
1694
|
-
const
|
|
1694
|
+
const le = document.elementsFromPoint(_.clientX, _.clientY).find(
|
|
1695
1695
|
(q) => q instanceof Element && !q.closest(
|
|
1696
1696
|
"[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]"
|
|
1697
1697
|
)
|
|
1698
1698
|
);
|
|
1699
|
-
i(
|
|
1699
|
+
i(le ?? null);
|
|
1700
1700
|
},
|
|
1701
1701
|
[p, i]
|
|
1702
1702
|
);
|
|
1703
|
-
|
|
1704
|
-
document.removeEventListener("mousemove",
|
|
1705
|
-
}), [
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1708
|
-
},
|
|
1709
|
-
return /* @__PURE__ */
|
|
1703
|
+
B(() => (document.addEventListener("mousemove", O, !0), document.addEventListener("click", U, !0), () => {
|
|
1704
|
+
document.removeEventListener("mousemove", O, !0), document.removeEventListener("click", U, !0);
|
|
1705
|
+
}), [O, U]);
|
|
1706
|
+
const j = () => {
|
|
1707
|
+
b.length !== 0 && c(b);
|
|
1708
|
+
}, z = e ? Fe(e) : null, K = e ? mt(e) : null, M = e ? ft(e) : 0, D = e ? gt(e, "all-instances") : "", $ = s !== "normal" && K === "tailwind" ? "Tailwind variant preview: matching hover:/focus:/… classes are applied without the prefix." : s !== "normal" ? "State preview uses focus/disabled simulation where possible." : null, F = M > 1 ? a === "all-instances" ? `Preview & Apply on ${M} elements (${D}).` : `This instance only — ${M - 1} other on page.` : a === "all-instances" ? "Only one match — scope has no effect." : null, W = ue(() => !e || a !== "all-instances" ? [] : xe(e, "all-instances"), [e, a]);
|
|
1709
|
+
return /* @__PURE__ */ d(Y, { children: [
|
|
1710
1710
|
/* @__PURE__ */ n(
|
|
1711
|
-
|
|
1711
|
+
xt,
|
|
1712
1712
|
{
|
|
1713
1713
|
element: a === "all-instances" ? null : t,
|
|
1714
1714
|
selected: e,
|
|
@@ -1719,11 +1719,11 @@ function Fn({
|
|
|
1719
1719
|
/* @__PURE__ */ n(
|
|
1720
1720
|
"div",
|
|
1721
1721
|
{
|
|
1722
|
-
ref:
|
|
1723
|
-
className: `pa-edit-panel-float ${
|
|
1724
|
-
style:
|
|
1725
|
-
children: /* @__PURE__ */ n(
|
|
1726
|
-
/* @__PURE__ */
|
|
1722
|
+
ref: N,
|
|
1723
|
+
className: `pa-edit-panel-float ${T ? "pa-edit-panel-float--dragging" : ""}`,
|
|
1724
|
+
style: C,
|
|
1725
|
+
children: /* @__PURE__ */ n(ke, { variant: "sheet", side: "right", className: "pa-edit-panel-glass", children: /* @__PURE__ */ d("div", { className: "pa-edit-panel-inner", children: [
|
|
1726
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-panel-header", children: [
|
|
1727
1727
|
/* @__PURE__ */ n(
|
|
1728
1728
|
"button",
|
|
1729
1729
|
{
|
|
@@ -1732,7 +1732,7 @@ function Fn({
|
|
|
1732
1732
|
"aria-label": "Drag edit panel",
|
|
1733
1733
|
title: "Drag to move",
|
|
1734
1734
|
...h,
|
|
1735
|
-
children: /* @__PURE__ */
|
|
1735
|
+
children: /* @__PURE__ */ d("span", { className: "pa-edit-panel-grip", "aria-hidden": "true", children: [
|
|
1736
1736
|
/* @__PURE__ */ n("span", {}),
|
|
1737
1737
|
/* @__PURE__ */ n("span", {}),
|
|
1738
1738
|
/* @__PURE__ */ n("span", {}),
|
|
@@ -1744,77 +1744,77 @@ function Fn({
|
|
|
1744
1744
|
),
|
|
1745
1745
|
/* @__PURE__ */ n("h3", { className: "pa-edit-title", children: "Edit" })
|
|
1746
1746
|
] }),
|
|
1747
|
-
e ? /* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
1747
|
+
e ? /* @__PURE__ */ d(Y, { children: [
|
|
1748
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-meta", children: [
|
|
1749
1749
|
/* @__PURE__ */ n(
|
|
1750
1750
|
"code",
|
|
1751
1751
|
{
|
|
1752
1752
|
className: "pa-edit-meta-label",
|
|
1753
|
-
title: `This instance: ${
|
|
1754
|
-
All instances: ${
|
|
1755
|
-
children:
|
|
1753
|
+
title: `This instance: ${vt(e)}
|
|
1754
|
+
All instances: ${D}`,
|
|
1755
|
+
children: $e(e)
|
|
1756
1756
|
}
|
|
1757
1757
|
),
|
|
1758
|
-
((
|
|
1759
|
-
(
|
|
1760
|
-
|
|
1761
|
-
|
|
1758
|
+
((z == null ? void 0 : z.sourceFile) || K) && /* @__PURE__ */ d("span", { className: "pa-edit-source", children: [
|
|
1759
|
+
(z == null ? void 0 : z.sourceFile) && /* @__PURE__ */ d(Y, { children: [
|
|
1760
|
+
z.sourceFile,
|
|
1761
|
+
z.lineNumber ? `:${z.lineNumber}` : ""
|
|
1762
1762
|
] }),
|
|
1763
|
-
|
|
1764
|
-
|
|
1763
|
+
z != null && z.sourceFile && K ? " · " : "",
|
|
1764
|
+
K ?? ""
|
|
1765
1765
|
] })
|
|
1766
1766
|
] }),
|
|
1767
1767
|
/* @__PURE__ */ n("div", { className: "pa-edit-panel-scroll", children: /* @__PURE__ */ n(
|
|
1768
|
-
|
|
1768
|
+
zn,
|
|
1769
1769
|
{
|
|
1770
|
-
values:
|
|
1771
|
-
onPropertyChange:
|
|
1772
|
-
textKind:
|
|
1773
|
-
textValue:
|
|
1774
|
-
onTextChange:
|
|
1770
|
+
values: v,
|
|
1771
|
+
onPropertyChange: k,
|
|
1772
|
+
textKind: g,
|
|
1773
|
+
textValue: f,
|
|
1774
|
+
onTextChange: w,
|
|
1775
1775
|
targetScope: a,
|
|
1776
|
-
onTargetScopeChange:
|
|
1777
|
-
elementState:
|
|
1778
|
-
onElementStateChange:
|
|
1776
|
+
onTargetScopeChange: o,
|
|
1777
|
+
elementState: s,
|
|
1778
|
+
onElementStateChange: u,
|
|
1779
1779
|
instanceCount: M,
|
|
1780
|
-
scopeHint:
|
|
1781
|
-
stateHint:
|
|
1780
|
+
scopeHint: F,
|
|
1781
|
+
stateHint: $
|
|
1782
1782
|
}
|
|
1783
1783
|
) }),
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */ n(
|
|
1787
|
-
/* @__PURE__ */ n(
|
|
1784
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-panel-sticky", children: [
|
|
1785
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-actions", children: [
|
|
1786
|
+
/* @__PURE__ */ n(H, { variant: "regular", onClick: x, disabled: !E, children: /* @__PURE__ */ d("span", { className: "pa-glass-btn-inner", children: [
|
|
1787
|
+
/* @__PURE__ */ n(sn, { className: "pa-glass-btn-icon" }),
|
|
1788
1788
|
/* @__PURE__ */ n("span", { children: "Undo" })
|
|
1789
1789
|
] }) }),
|
|
1790
1790
|
/* @__PURE__ */ n(
|
|
1791
|
-
|
|
1791
|
+
H,
|
|
1792
1792
|
{
|
|
1793
1793
|
variant: "regular",
|
|
1794
|
-
onClick:
|
|
1795
|
-
disabled:
|
|
1796
|
-
children: /* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */ n(
|
|
1794
|
+
onClick: L,
|
|
1795
|
+
disabled: b.length === 0,
|
|
1796
|
+
children: /* @__PURE__ */ d("span", { className: "pa-glass-btn-inner", children: [
|
|
1797
|
+
/* @__PURE__ */ n(ln, { className: "pa-glass-btn-icon" }),
|
|
1798
1798
|
/* @__PURE__ */ n("span", { children: "Reset" })
|
|
1799
1799
|
] })
|
|
1800
1800
|
}
|
|
1801
1801
|
)
|
|
1802
1802
|
] }),
|
|
1803
|
-
/* @__PURE__ */
|
|
1803
|
+
/* @__PURE__ */ d("div", { className: "pa-edit-footer", children: [
|
|
1804
1804
|
/* @__PURE__ */ n(
|
|
1805
1805
|
"span",
|
|
1806
1806
|
{
|
|
1807
1807
|
className: l ? /fail/i.test(l) ? "pa-change-count pa-change-count--error" : "pa-change-count pa-change-count--success" : "pa-change-count",
|
|
1808
|
-
children: l ?? `${
|
|
1808
|
+
children: l ?? `${b.length} pending change${b.length !== 1 ? "s" : ""}`
|
|
1809
1809
|
}
|
|
1810
1810
|
),
|
|
1811
1811
|
/* @__PURE__ */ n(
|
|
1812
|
-
|
|
1812
|
+
H,
|
|
1813
1813
|
{
|
|
1814
1814
|
variant: "glass-primary",
|
|
1815
|
-
onClick:
|
|
1816
|
-
disabled:
|
|
1817
|
-
title:
|
|
1815
|
+
onClick: j,
|
|
1816
|
+
disabled: b.length === 0,
|
|
1817
|
+
title: z != null && z.sourceFile ? void 0 : "No source file — Apply copies selector + changes to clipboard",
|
|
1818
1818
|
children: "Apply"
|
|
1819
1819
|
}
|
|
1820
1820
|
)
|
|
@@ -1826,9 +1826,35 @@ All instances: ${$}`,
|
|
|
1826
1826
|
)
|
|
1827
1827
|
] });
|
|
1828
1828
|
}
|
|
1829
|
-
function
|
|
1829
|
+
async function Un(e, t = {}) {
|
|
1830
|
+
if (t.onApply)
|
|
1831
|
+
try {
|
|
1832
|
+
const r = await t.onApply(e);
|
|
1833
|
+
if (r) return { mode: "mcp", result: r };
|
|
1834
|
+
} catch (r) {
|
|
1835
|
+
return { mode: "error", message: r instanceof Error ? r.message : String(r) };
|
|
1836
|
+
}
|
|
1837
|
+
const i = t.applyEndpoint;
|
|
1838
|
+
if (i)
|
|
1839
|
+
try {
|
|
1840
|
+
const r = await fetch(i, {
|
|
1841
|
+
method: "POST",
|
|
1842
|
+
headers: { "Content-Type": "application/json" },
|
|
1843
|
+
body: JSON.stringify({ payload: e })
|
|
1844
|
+
}), a = await r.json();
|
|
1845
|
+
return r.ok ? { mode: "mcp", result: a } : { mode: "error", message: a.error ?? r.statusText };
|
|
1846
|
+
} catch (r) {
|
|
1847
|
+
return { mode: "error", message: r instanceof Error ? r.message : String(r) };
|
|
1848
|
+
}
|
|
1849
|
+
return await bt(JSON.stringify(e, null, 2)), { mode: "clipboard" };
|
|
1850
|
+
}
|
|
1851
|
+
function Wn(e) {
|
|
1852
|
+
var t;
|
|
1853
|
+
return e.mode === "mcp" && e.result.success && e.result.linesChanged.length > 0 ? ((t = e.result.warnings) != null && t.length && console.warn("[pixelagent] Apply succeeded with warnings:", e.result.warnings), "Change applied") : (e.mode === "error" ? console.error("[pixelagent] Apply failed:", e.message) : e.mode === "mcp" ? console.warn("[pixelagent] Apply reported no changes:", e.result) : console.warn("[pixelagent] Apply fell back to clipboard — no source patched"), "Apply failed");
|
|
1854
|
+
}
|
|
1855
|
+
function Yn(e) {
|
|
1830
1856
|
const [t, i] = A(null);
|
|
1831
|
-
return
|
|
1857
|
+
return B(() => {
|
|
1832
1858
|
if (!e) {
|
|
1833
1859
|
i(null);
|
|
1834
1860
|
return;
|
|
@@ -1841,8 +1867,8 @@ function Bn(e) {
|
|
|
1841
1867
|
};
|
|
1842
1868
|
}, [e]), t;
|
|
1843
1869
|
}
|
|
1844
|
-
const
|
|
1845
|
-
function
|
|
1870
|
+
const Q = 8, G = 8, Xn = 12, Gn = 300, Kn = 280;
|
|
1871
|
+
function Pe(e, t, i, r) {
|
|
1846
1872
|
return {
|
|
1847
1873
|
top: e,
|
|
1848
1874
|
left: t,
|
|
@@ -1852,10 +1878,10 @@ function Te(e, t, i, r) {
|
|
|
1852
1878
|
height: r
|
|
1853
1879
|
};
|
|
1854
1880
|
}
|
|
1855
|
-
function
|
|
1881
|
+
function Oe(e, t) {
|
|
1856
1882
|
return e.left < t.right && e.right > t.left && e.top < t.bottom && e.bottom > t.top;
|
|
1857
1883
|
}
|
|
1858
|
-
function
|
|
1884
|
+
function jn(e, t) {
|
|
1859
1885
|
return {
|
|
1860
1886
|
top: e.top - t,
|
|
1861
1887
|
left: e.left - t,
|
|
@@ -1865,33 +1891,33 @@ function Vn(e, t) {
|
|
|
1865
1891
|
height: e.height + t * 2
|
|
1866
1892
|
};
|
|
1867
1893
|
}
|
|
1868
|
-
function
|
|
1894
|
+
function qn() {
|
|
1869
1895
|
if (typeof document > "u") return null;
|
|
1870
1896
|
const e = document.querySelector(
|
|
1871
1897
|
"[data-pixelagent-toolbar-portal] .pa-toolbar-float"
|
|
1872
1898
|
);
|
|
1873
|
-
return e ?
|
|
1899
|
+
return e ? jn(e.getBoundingClientRect(), Xn) : null;
|
|
1874
1900
|
}
|
|
1875
1901
|
function Re(e, t) {
|
|
1876
1902
|
return Math.min(
|
|
1877
|
-
Math.max(
|
|
1878
|
-
window.innerWidth - t -
|
|
1903
|
+
Math.max(Q, e),
|
|
1904
|
+
window.innerWidth - t - Q
|
|
1879
1905
|
);
|
|
1880
1906
|
}
|
|
1881
|
-
function
|
|
1907
|
+
function ye(e, t) {
|
|
1882
1908
|
return Math.min(
|
|
1883
|
-
Math.max(
|
|
1884
|
-
window.innerHeight - t -
|
|
1909
|
+
Math.max(Q, e),
|
|
1910
|
+
window.innerHeight - t - Q
|
|
1885
1911
|
);
|
|
1886
1912
|
}
|
|
1887
|
-
function
|
|
1888
|
-
return e.top >=
|
|
1913
|
+
function Jn(e) {
|
|
1914
|
+
return e.top >= Q && e.left >= Q && e.right <= window.innerWidth - Q && e.bottom <= window.innerHeight - Q;
|
|
1889
1915
|
}
|
|
1890
|
-
function
|
|
1891
|
-
return t &&
|
|
1916
|
+
function Zn(e, t) {
|
|
1917
|
+
return t && Oe(e, t) ? !1 : Jn(e);
|
|
1892
1918
|
}
|
|
1893
|
-
function
|
|
1894
|
-
const r =
|
|
1919
|
+
function Qn(e, t = Gn, i = Kn) {
|
|
1920
|
+
const r = qn(), o = e.top > window.innerHeight * 0.45 ? [
|
|
1895
1921
|
{ placement: "above", top: e.top - i - G, left: e.left },
|
|
1896
1922
|
{ placement: "below", top: e.bottom + G, left: e.left },
|
|
1897
1923
|
{ placement: "right", top: e.top, left: e.right + G },
|
|
@@ -1902,104 +1928,104 @@ function Xn(e, t = Hn, i = _n) {
|
|
|
1902
1928
|
{ placement: "right", top: e.top, left: e.right + G },
|
|
1903
1929
|
{ placement: "left", top: e.top, left: e.left - t - G }
|
|
1904
1930
|
];
|
|
1905
|
-
for (const { top:
|
|
1906
|
-
const p =
|
|
1907
|
-
|
|
1931
|
+
for (const { top: c, left: l } of o) {
|
|
1932
|
+
const p = Pe(
|
|
1933
|
+
ye(c, i),
|
|
1908
1934
|
Re(l, t),
|
|
1909
1935
|
t,
|
|
1910
1936
|
i
|
|
1911
1937
|
);
|
|
1912
|
-
if (
|
|
1938
|
+
if (Zn(p, r))
|
|
1913
1939
|
return { top: p.top, left: p.left };
|
|
1914
1940
|
}
|
|
1915
|
-
let
|
|
1941
|
+
let s = ye(e.top - i - G, i), u = Re(e.left, t);
|
|
1916
1942
|
if (r) {
|
|
1917
|
-
let
|
|
1918
|
-
|
|
1943
|
+
let c = Pe(s, u, t, i);
|
|
1944
|
+
Oe(c, r) && (s = ye(r.top - i - G, i), c = Pe(s, u, t, i)), Oe(c, r) && (s = ye(e.bottom + G, i), u = Re(
|
|
1919
1945
|
Math.min(e.left, r.left - t - G),
|
|
1920
1946
|
t
|
|
1921
1947
|
));
|
|
1922
1948
|
}
|
|
1923
|
-
return { top:
|
|
1949
|
+
return { top: s, left: u };
|
|
1924
1950
|
}
|
|
1925
|
-
function
|
|
1951
|
+
function er({
|
|
1926
1952
|
elements: e,
|
|
1927
1953
|
areaBbox: t,
|
|
1928
1954
|
onSubmit: i,
|
|
1929
1955
|
onCancel: r
|
|
1930
1956
|
}) {
|
|
1931
|
-
const [a,
|
|
1932
|
-
if (
|
|
1933
|
-
var
|
|
1934
|
-
(
|
|
1935
|
-
}, [e]),
|
|
1936
|
-
const
|
|
1937
|
-
|
|
1957
|
+
const [a, o] = A(""), s = V(null), u = V(null), c = e[0] ?? null, l = t ? new DOMRect(t.x, t.y, t.width, t.height) : null, p = Yn(c), m = l ?? p, v = yt(), g = c ? oe(c) : { kind: "none", value: "" }, f = g.kind !== "none" ? g.value : void 0;
|
|
1958
|
+
if (B(() => {
|
|
1959
|
+
var w;
|
|
1960
|
+
(w = s.current) == null || w.focus();
|
|
1961
|
+
}, [e]), B(() => {
|
|
1962
|
+
const w = (x) => {
|
|
1963
|
+
x.key === "Escape" && r();
|
|
1938
1964
|
};
|
|
1939
|
-
return document.addEventListener("keydown",
|
|
1965
|
+
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
1940
1966
|
}, [r]), !m) return null;
|
|
1941
|
-
const
|
|
1942
|
-
a.trim() && i(a,
|
|
1967
|
+
const b = Qn(m), E = e.length > 1 ? `${e.length} selected` : c ? $e(c) : "Area selection", k = (w) => {
|
|
1968
|
+
a.trim() && i(a, w);
|
|
1943
1969
|
};
|
|
1944
1970
|
return /* @__PURE__ */ n(
|
|
1945
|
-
|
|
1971
|
+
ke,
|
|
1946
1972
|
{
|
|
1947
1973
|
variant: "popover",
|
|
1948
|
-
style: { top:
|
|
1949
|
-
children: /* @__PURE__ */
|
|
1974
|
+
style: { top: b.top, left: b.left },
|
|
1975
|
+
children: /* @__PURE__ */ d(
|
|
1950
1976
|
"div",
|
|
1951
1977
|
{
|
|
1952
|
-
ref:
|
|
1978
|
+
ref: u,
|
|
1953
1979
|
role: "dialog",
|
|
1954
1980
|
"aria-modal": "true",
|
|
1955
1981
|
"aria-label": "Add annotation",
|
|
1956
1982
|
className: "pa-popover-body",
|
|
1957
1983
|
children: [
|
|
1958
|
-
/* @__PURE__ */ n("div", { className: "pa-popover-header", children: /* @__PURE__ */ n("span", { className: "pa-popover-selector", children:
|
|
1959
|
-
(
|
|
1960
|
-
|
|
1984
|
+
/* @__PURE__ */ n("div", { className: "pa-popover-header", children: /* @__PURE__ */ n("span", { className: "pa-popover-selector", children: E }) }),
|
|
1985
|
+
(v || f) && /* @__PURE__ */ d("div", { className: "pa-popover-context", children: [
|
|
1986
|
+
v && /* @__PURE__ */ d("p", { className: "pa-popover-context-line", children: [
|
|
1961
1987
|
/* @__PURE__ */ n("span", { className: "pa-popover-context-label", children: "Selected" }),
|
|
1962
|
-
|
|
1988
|
+
v
|
|
1963
1989
|
] }),
|
|
1964
|
-
|
|
1990
|
+
f && f !== v && /* @__PURE__ */ d("p", { className: "pa-popover-context-line", children: [
|
|
1965
1991
|
/* @__PURE__ */ n("span", { className: "pa-popover-context-label", children: "Element" }),
|
|
1966
|
-
|
|
1992
|
+
f
|
|
1967
1993
|
] })
|
|
1968
1994
|
] }),
|
|
1969
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ d("label", { className: "pa-label", children: [
|
|
1970
1996
|
"Note",
|
|
1971
1997
|
/* @__PURE__ */ n(
|
|
1972
1998
|
"textarea",
|
|
1973
1999
|
{
|
|
1974
|
-
ref:
|
|
2000
|
+
ref: s,
|
|
1975
2001
|
className: "pa-textarea",
|
|
1976
2002
|
value: a,
|
|
1977
|
-
onChange: (
|
|
2003
|
+
onChange: (w) => o(w.target.value),
|
|
1978
2004
|
placeholder: "Describe the change...",
|
|
1979
2005
|
rows: 3,
|
|
1980
|
-
onKeyDown: (
|
|
1981
|
-
|
|
2006
|
+
onKeyDown: (w) => {
|
|
2007
|
+
w.key === "Enter" && (w.metaKey || w.ctrlKey) && (w.preventDefault(), k(w.shiftKey)), w.key === "Escape" && r();
|
|
1982
2008
|
}
|
|
1983
2009
|
}
|
|
1984
2010
|
)
|
|
1985
2011
|
] }),
|
|
1986
2012
|
/* @__PURE__ */ n("p", { className: "pa-popover-hint", children: "⌘↵ Add · ⇧⌘↵ Add & next · Esc Cancel" }),
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */ n(
|
|
2013
|
+
/* @__PURE__ */ d("div", { className: "pa-popover-actions", children: [
|
|
2014
|
+
/* @__PURE__ */ n(H, { variant: "ghost", onClick: r, children: "Cancel" }),
|
|
1989
2015
|
/* @__PURE__ */ n(
|
|
1990
|
-
|
|
2016
|
+
H,
|
|
1991
2017
|
{
|
|
1992
2018
|
variant: "ghost",
|
|
1993
|
-
onClick: () =>
|
|
2019
|
+
onClick: () => k(!0),
|
|
1994
2020
|
disabled: !a.trim(),
|
|
1995
2021
|
children: "Add & next"
|
|
1996
2022
|
}
|
|
1997
2023
|
),
|
|
1998
2024
|
/* @__PURE__ */ n(
|
|
1999
|
-
|
|
2025
|
+
H,
|
|
2000
2026
|
{
|
|
2001
2027
|
variant: "glass-primary",
|
|
2002
|
-
onClick: () =>
|
|
2028
|
+
onClick: () => k(!1),
|
|
2003
2029
|
disabled: !a.trim(),
|
|
2004
2030
|
children: "Add"
|
|
2005
2031
|
}
|
|
@@ -2011,7 +2037,7 @@ function Gn({
|
|
|
2011
2037
|
}
|
|
2012
2038
|
);
|
|
2013
2039
|
}
|
|
2014
|
-
function
|
|
2040
|
+
function tr({ area: e, isDragging: t }) {
|
|
2015
2041
|
return !e || e.width < 2 || e.height < 2 ? null : /* @__PURE__ */ n(
|
|
2016
2042
|
"div",
|
|
2017
2043
|
{
|
|
@@ -2026,7 +2052,7 @@ function Kn({ area: e, isDragging: t }) {
|
|
|
2026
2052
|
}
|
|
2027
2053
|
);
|
|
2028
2054
|
}
|
|
2029
|
-
function
|
|
2055
|
+
function nr(e) {
|
|
2030
2056
|
const { elements: t, note: i, areaBbox: r } = e, a = t[0];
|
|
2031
2057
|
if (!a && r)
|
|
2032
2058
|
return {
|
|
@@ -2045,39 +2071,39 @@ function jn(e) {
|
|
|
2045
2071
|
};
|
|
2046
2072
|
if (!a)
|
|
2047
2073
|
throw new Error("buildAnnotationEntry requires at least one element or areaBbox");
|
|
2048
|
-
const
|
|
2074
|
+
const o = a.getBoundingClientRect(), s = Fe(a), u = yt(), c = oe(a), l = c.kind !== "none" ? c.value : void 0, p = t.map((m) => vt(m));
|
|
2049
2075
|
return {
|
|
2050
2076
|
id: crypto.randomUUID(),
|
|
2051
2077
|
selector: p[0],
|
|
2052
2078
|
selectors: p.length > 1 ? p : void 0,
|
|
2053
2079
|
note: i.trim(),
|
|
2054
|
-
position: { x: Math.round(
|
|
2080
|
+
position: { x: Math.round(o.x), y: Math.round(o.y) },
|
|
2055
2081
|
bbox: {
|
|
2056
|
-
x: Math.round(
|
|
2057
|
-
y: Math.round(
|
|
2058
|
-
width: Math.round(
|
|
2059
|
-
height: Math.round(
|
|
2082
|
+
x: Math.round(o.x),
|
|
2083
|
+
y: Math.round(o.y),
|
|
2084
|
+
width: Math.round(o.width),
|
|
2085
|
+
height: Math.round(o.height)
|
|
2060
2086
|
},
|
|
2061
2087
|
areaBbox: r,
|
|
2062
|
-
domPath:
|
|
2063
|
-
selectedText:
|
|
2088
|
+
domPath: Ut(a),
|
|
2089
|
+
selectedText: u,
|
|
2064
2090
|
elementText: l,
|
|
2065
|
-
sourceFile:
|
|
2066
|
-
lineNumber:
|
|
2067
|
-
componentName:
|
|
2091
|
+
sourceFile: s.sourceFile,
|
|
2092
|
+
lineNumber: s.lineNumber,
|
|
2093
|
+
componentName: Vt(a) ?? s.componentName,
|
|
2068
2094
|
createdAt: Date.now()
|
|
2069
2095
|
};
|
|
2070
2096
|
}
|
|
2071
|
-
function
|
|
2072
|
-
const t =
|
|
2097
|
+
function rr(e) {
|
|
2098
|
+
const t = wt(e);
|
|
2073
2099
|
if (t) return t.getBoundingClientRect();
|
|
2074
2100
|
if (e.bbox) {
|
|
2075
|
-
const { x: i, y: r, width: a, height:
|
|
2076
|
-
return new DOMRect(i, r, a,
|
|
2101
|
+
const { x: i, y: r, width: a, height: o } = e.bbox;
|
|
2102
|
+
return new DOMRect(i, r, a, o);
|
|
2077
2103
|
}
|
|
2078
2104
|
if (e.areaBbox) {
|
|
2079
|
-
const { x: i, y: r, width: a, height:
|
|
2080
|
-
return new DOMRect(i, r, a,
|
|
2105
|
+
const { x: i, y: r, width: a, height: o } = e.areaBbox;
|
|
2106
|
+
return new DOMRect(i, r, a, o);
|
|
2081
2107
|
}
|
|
2082
2108
|
if (e.position) {
|
|
2083
2109
|
const { x: i, y: r } = e.position;
|
|
@@ -2085,43 +2111,43 @@ function qn(e) {
|
|
|
2085
2111
|
}
|
|
2086
2112
|
return null;
|
|
2087
2113
|
}
|
|
2088
|
-
function
|
|
2114
|
+
function ir(e) {
|
|
2089
2115
|
return `${Math.round(e.top)}:${Math.round(e.left)}:${Math.round(e.width)}:${Math.round(e.height)}`;
|
|
2090
2116
|
}
|
|
2091
|
-
const
|
|
2092
|
-
function
|
|
2117
|
+
const ar = 20;
|
|
2118
|
+
function or({ annotations: e }) {
|
|
2093
2119
|
const [t, i] = A([]);
|
|
2094
|
-
return
|
|
2120
|
+
return B(() => {
|
|
2095
2121
|
if (e.length === 0) {
|
|
2096
2122
|
i([]);
|
|
2097
2123
|
return;
|
|
2098
2124
|
}
|
|
2099
2125
|
const r = /* @__PURE__ */ new Map(), a = () => {
|
|
2100
|
-
const
|
|
2101
|
-
e.forEach((
|
|
2102
|
-
const p =
|
|
2126
|
+
const u = [];
|
|
2127
|
+
e.forEach((c, l) => {
|
|
2128
|
+
const p = rr(c);
|
|
2103
2129
|
if (!p) return;
|
|
2104
|
-
const m =
|
|
2105
|
-
r.set(m,
|
|
2106
|
-
id:
|
|
2130
|
+
const m = ir(p), v = r.get(m) ?? 0;
|
|
2131
|
+
r.set(m, v + 1), u.push({
|
|
2132
|
+
id: c.id,
|
|
2107
2133
|
index: l + 1,
|
|
2108
|
-
top: p.top - 6 -
|
|
2134
|
+
top: p.top - 6 - v * ar,
|
|
2109
2135
|
left: p.right - 6
|
|
2110
2136
|
});
|
|
2111
|
-
}), i(
|
|
2137
|
+
}), i(u);
|
|
2112
2138
|
};
|
|
2113
2139
|
a();
|
|
2114
|
-
const
|
|
2115
|
-
for (const
|
|
2116
|
-
const
|
|
2117
|
-
|
|
2140
|
+
const o = /* @__PURE__ */ new Set();
|
|
2141
|
+
for (const u of e) {
|
|
2142
|
+
const c = wt(u);
|
|
2143
|
+
c && o.add(c);
|
|
2118
2144
|
}
|
|
2119
|
-
const
|
|
2120
|
-
const
|
|
2121
|
-
return
|
|
2145
|
+
const s = Array.from(o).map((u) => {
|
|
2146
|
+
const c = new ResizeObserver(a);
|
|
2147
|
+
return c.observe(u), c;
|
|
2122
2148
|
});
|
|
2123
2149
|
return window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
2124
|
-
for (const
|
|
2150
|
+
for (const u of s) u.disconnect();
|
|
2125
2151
|
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
2126
2152
|
};
|
|
2127
2153
|
}, [e]), t.length === 0 ? null : /* @__PURE__ */ n(Y, { children: t.map((r) => /* @__PURE__ */ n(
|
|
@@ -2135,24 +2161,24 @@ function Qn({ annotations: e }) {
|
|
|
2135
2161
|
r.id
|
|
2136
2162
|
)) });
|
|
2137
2163
|
}
|
|
2138
|
-
const
|
|
2139
|
-
function
|
|
2140
|
-
return e instanceof Element ? !!e.closest(
|
|
2164
|
+
const Ve = "[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]";
|
|
2165
|
+
function we(e) {
|
|
2166
|
+
return e instanceof Element ? !!e.closest(Ve) : !1;
|
|
2141
2167
|
}
|
|
2142
|
-
function
|
|
2168
|
+
function dt(e, t) {
|
|
2143
2169
|
return document.elementsFromPoint(e, t).find(
|
|
2144
|
-
(r) => r instanceof Element && !r.closest(
|
|
2170
|
+
(r) => r instanceof Element && !r.closest(Ve)
|
|
2145
2171
|
) ?? null;
|
|
2146
2172
|
}
|
|
2147
|
-
function
|
|
2173
|
+
function Tt(e) {
|
|
2148
2174
|
return e ? e === "Copied all!" || e.startsWith("Copy failed") : !1;
|
|
2149
2175
|
}
|
|
2150
|
-
function
|
|
2176
|
+
function Pt({
|
|
2151
2177
|
feedback: e,
|
|
2152
2178
|
slotClassName: t,
|
|
2153
2179
|
children: i
|
|
2154
2180
|
}) {
|
|
2155
|
-
return e &&
|
|
2181
|
+
return e && Tt(e) ? /* @__PURE__ */ n(
|
|
2156
2182
|
"span",
|
|
2157
2183
|
{
|
|
2158
2184
|
className: `pa-status pa-copy-feedback-slot ${t}`,
|
|
@@ -2162,42 +2188,42 @@ function St({
|
|
|
2162
2188
|
}
|
|
2163
2189
|
) : /* @__PURE__ */ n(Y, { children: i });
|
|
2164
2190
|
}
|
|
2165
|
-
function
|
|
2191
|
+
function sr({
|
|
2166
2192
|
annotations: e,
|
|
2167
2193
|
collapsed: t,
|
|
2168
2194
|
onToggleCollapsed: i,
|
|
2169
2195
|
onClose: r,
|
|
2170
2196
|
onCopyAll: a,
|
|
2171
|
-
onCopyOne:
|
|
2172
|
-
onRemove:
|
|
2173
|
-
onUpdate:
|
|
2174
|
-
copyStatus:
|
|
2197
|
+
onCopyOne: o,
|
|
2198
|
+
onRemove: s,
|
|
2199
|
+
onUpdate: u,
|
|
2200
|
+
copyStatus: c,
|
|
2175
2201
|
copiedEntryId: l,
|
|
2176
2202
|
copyAllFrom: p
|
|
2177
2203
|
}) {
|
|
2178
|
-
const [m,
|
|
2179
|
-
|
|
2180
|
-
const
|
|
2181
|
-
|
|
2204
|
+
const [m, v] = A(null), [g, f] = A("");
|
|
2205
|
+
B(() => {
|
|
2206
|
+
const k = (w) => {
|
|
2207
|
+
w.key === "Escape" && (t ? r() : i());
|
|
2182
2208
|
};
|
|
2183
|
-
return document.addEventListener("keydown",
|
|
2209
|
+
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
2184
2210
|
}, [t, r, i]);
|
|
2185
|
-
const
|
|
2186
|
-
|
|
2187
|
-
},
|
|
2188
|
-
|
|
2211
|
+
const b = (k) => {
|
|
2212
|
+
v(k.id), f(k.note);
|
|
2213
|
+
}, E = (k) => {
|
|
2214
|
+
g.trim() && (u(k, { note: g.trim() }), v(null));
|
|
2189
2215
|
};
|
|
2190
|
-
return /* @__PURE__ */
|
|
2191
|
-
|
|
2216
|
+
return /* @__PURE__ */ d(
|
|
2217
|
+
ke,
|
|
2192
2218
|
{
|
|
2193
2219
|
variant: "sheet",
|
|
2194
2220
|
side: "right",
|
|
2195
2221
|
className: t ? "pa-session-panel--collapsed" : void 0,
|
|
2196
2222
|
children: [
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2223
|
+
/* @__PURE__ */ d("div", { className: "pa-session-header", children: [
|
|
2224
|
+
/* @__PURE__ */ d("div", { className: "pa-session-header-main", children: [
|
|
2199
2225
|
/* @__PURE__ */ n(
|
|
2200
|
-
|
|
2226
|
+
H,
|
|
2201
2227
|
{
|
|
2202
2228
|
variant: "ghost",
|
|
2203
2229
|
className: "pa-glass-btn--sm pa-session-collapse-btn",
|
|
@@ -2207,21 +2233,21 @@ function er({
|
|
|
2207
2233
|
children: /* @__PURE__ */ n("span", { className: "pa-session-chevron", "aria-hidden": "true", children: t ? "▶" : "▼" })
|
|
2208
2234
|
}
|
|
2209
2235
|
),
|
|
2210
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ d("h3", { className: "pa-session-title", children: [
|
|
2211
2237
|
"Session (",
|
|
2212
2238
|
e.length,
|
|
2213
2239
|
")"
|
|
2214
2240
|
] })
|
|
2215
2241
|
] }),
|
|
2216
2242
|
!t && /* @__PURE__ */ n("p", { className: "pa-session-subtitle", children: "Persists until tab close" }),
|
|
2217
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ d("div", { className: "pa-session-actions", children: [
|
|
2218
2244
|
/* @__PURE__ */ n(
|
|
2219
|
-
|
|
2245
|
+
Pt,
|
|
2220
2246
|
{
|
|
2221
|
-
feedback: p === "session" ?
|
|
2247
|
+
feedback: p === "session" ? c : null,
|
|
2222
2248
|
slotClassName: "pa-copy-feedback-slot--session",
|
|
2223
2249
|
children: /* @__PURE__ */ n(
|
|
2224
|
-
|
|
2250
|
+
H,
|
|
2225
2251
|
{
|
|
2226
2252
|
variant: "glass-primary",
|
|
2227
2253
|
className: "pa-glass-btn--sm",
|
|
@@ -2232,46 +2258,46 @@ function er({
|
|
|
2232
2258
|
)
|
|
2233
2259
|
}
|
|
2234
2260
|
),
|
|
2235
|
-
/* @__PURE__ */ n(
|
|
2261
|
+
/* @__PURE__ */ n(H, { variant: "ghost", onClick: r, "aria-label": "Close session panel", children: "✕" })
|
|
2236
2262
|
] })
|
|
2237
2263
|
] }),
|
|
2238
|
-
!t && /* @__PURE__ */
|
|
2264
|
+
!t && /* @__PURE__ */ d("ul", { className: "pa-session-list", children: [
|
|
2239
2265
|
e.length === 0 && /* @__PURE__ */ n("li", { className: "pa-session-empty", children: "No annotations yet. Click an element, drag an area, or Shift+click for multi-select." }),
|
|
2240
|
-
e.map((
|
|
2241
|
-
const
|
|
2242
|
-
return /* @__PURE__ */ n("li", { className: "pa-session-item", children: m ===
|
|
2243
|
-
/* @__PURE__ */
|
|
2266
|
+
e.map((k) => {
|
|
2267
|
+
const w = Wt(k);
|
|
2268
|
+
return /* @__PURE__ */ n("li", { className: "pa-session-item", children: m === k.id ? /* @__PURE__ */ d("div", { className: "pa-session-edit", children: [
|
|
2269
|
+
/* @__PURE__ */ d("label", { className: "pa-label", children: [
|
|
2244
2270
|
"Note",
|
|
2245
2271
|
/* @__PURE__ */ n(
|
|
2246
2272
|
"textarea",
|
|
2247
2273
|
{
|
|
2248
2274
|
className: "pa-textarea",
|
|
2249
|
-
value:
|
|
2250
|
-
onChange: (
|
|
2275
|
+
value: g,
|
|
2276
|
+
onChange: (x) => f(x.target.value),
|
|
2251
2277
|
rows: 3
|
|
2252
2278
|
}
|
|
2253
2279
|
)
|
|
2254
2280
|
] }),
|
|
2255
|
-
/* @__PURE__ */
|
|
2256
|
-
/* @__PURE__ */ n(
|
|
2281
|
+
/* @__PURE__ */ d("div", { className: "pa-session-item-actions", children: [
|
|
2282
|
+
/* @__PURE__ */ n(H, { variant: "ghost", onClick: () => v(null), children: "Cancel" }),
|
|
2257
2283
|
/* @__PURE__ */ n(
|
|
2258
|
-
|
|
2284
|
+
H,
|
|
2259
2285
|
{
|
|
2260
2286
|
variant: "glass-primary",
|
|
2261
|
-
onClick: () =>
|
|
2262
|
-
disabled: !
|
|
2287
|
+
onClick: () => E(k.id),
|
|
2288
|
+
disabled: !g.trim(),
|
|
2263
2289
|
children: "Save"
|
|
2264
2290
|
}
|
|
2265
2291
|
)
|
|
2266
2292
|
] })
|
|
2267
|
-
] }) : /* @__PURE__ */
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */ n("span", { className: "pa-session-target", children:
|
|
2270
|
-
/* @__PURE__ */ n("p", { className: "pa-session-note", children:
|
|
2271
|
-
|
|
2293
|
+
] }) : /* @__PURE__ */ d(Y, { children: [
|
|
2294
|
+
/* @__PURE__ */ d("div", { className: "pa-session-content", children: [
|
|
2295
|
+
/* @__PURE__ */ n("span", { className: "pa-session-target", children: w.target }),
|
|
2296
|
+
/* @__PURE__ */ n("p", { className: "pa-session-note", children: w.note }),
|
|
2297
|
+
w.meta && /* @__PURE__ */ n("p", { className: "pa-session-meta-line", children: w.meta })
|
|
2272
2298
|
] }),
|
|
2273
|
-
/* @__PURE__ */
|
|
2274
|
-
|
|
2299
|
+
/* @__PURE__ */ d("div", { className: "pa-session-item-actions", children: [
|
|
2300
|
+
c === "Copied!" && l === k.id ? /* @__PURE__ */ n(
|
|
2275
2301
|
"span",
|
|
2276
2302
|
{
|
|
2277
2303
|
className: "pa-status pa-copy-feedback-slot pa-copy-feedback-slot--item",
|
|
@@ -2280,45 +2306,45 @@ function er({
|
|
|
2280
2306
|
children: "Copied!"
|
|
2281
2307
|
}
|
|
2282
2308
|
) : /* @__PURE__ */ n(
|
|
2283
|
-
|
|
2309
|
+
H,
|
|
2284
2310
|
{
|
|
2285
2311
|
variant: "glass-primary",
|
|
2286
2312
|
className: "pa-glass-btn--sm",
|
|
2287
|
-
onClick: () =>
|
|
2313
|
+
onClick: () => o(k.id),
|
|
2288
2314
|
"aria-label": "Copy annotation",
|
|
2289
2315
|
children: "Copy"
|
|
2290
2316
|
}
|
|
2291
2317
|
),
|
|
2292
2318
|
/* @__PURE__ */ n(
|
|
2293
|
-
|
|
2319
|
+
H,
|
|
2294
2320
|
{
|
|
2295
2321
|
variant: "ghost",
|
|
2296
2322
|
className: "pa-glass-btn--sm",
|
|
2297
|
-
onClick: () =>
|
|
2323
|
+
onClick: () => b(k),
|
|
2298
2324
|
"aria-label": "Edit annotation note",
|
|
2299
2325
|
children: "✎"
|
|
2300
2326
|
}
|
|
2301
2327
|
),
|
|
2302
2328
|
/* @__PURE__ */ n(
|
|
2303
|
-
|
|
2329
|
+
H,
|
|
2304
2330
|
{
|
|
2305
2331
|
variant: "ghost",
|
|
2306
2332
|
className: "pa-glass-btn--sm",
|
|
2307
|
-
onClick: () =>
|
|
2333
|
+
onClick: () => s(k.id),
|
|
2308
2334
|
"aria-label": "Remove annotation",
|
|
2309
2335
|
children: "✕"
|
|
2310
2336
|
}
|
|
2311
2337
|
)
|
|
2312
2338
|
] })
|
|
2313
|
-
] }) },
|
|
2339
|
+
] }) }, k.id);
|
|
2314
2340
|
})
|
|
2315
2341
|
] })
|
|
2316
2342
|
]
|
|
2317
2343
|
}
|
|
2318
2344
|
);
|
|
2319
2345
|
}
|
|
2320
|
-
function
|
|
2321
|
-
return /* @__PURE__ */
|
|
2346
|
+
function lr() {
|
|
2347
|
+
return /* @__PURE__ */ d("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
2322
2348
|
/* @__PURE__ */ n(
|
|
2323
2349
|
"path",
|
|
2324
2350
|
{
|
|
@@ -2338,8 +2364,8 @@ function tr() {
|
|
|
2338
2364
|
)
|
|
2339
2365
|
] });
|
|
2340
2366
|
}
|
|
2341
|
-
function
|
|
2342
|
-
return /* @__PURE__ */
|
|
2367
|
+
function cr() {
|
|
2368
|
+
return /* @__PURE__ */ d("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
2343
2369
|
/* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "2.75", stroke: "currentColor", strokeWidth: "1.25" }),
|
|
2344
2370
|
/* @__PURE__ */ n(
|
|
2345
2371
|
"path",
|
|
@@ -2352,7 +2378,7 @@ function nr() {
|
|
|
2352
2378
|
)
|
|
2353
2379
|
] });
|
|
2354
2380
|
}
|
|
2355
|
-
function
|
|
2381
|
+
function dr() {
|
|
2356
2382
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
2357
2383
|
"path",
|
|
2358
2384
|
{
|
|
@@ -2363,50 +2389,50 @@ function rr() {
|
|
|
2363
2389
|
}
|
|
2364
2390
|
) });
|
|
2365
2391
|
}
|
|
2366
|
-
function
|
|
2392
|
+
function ur({
|
|
2367
2393
|
open: e,
|
|
2368
2394
|
onClose: t,
|
|
2369
2395
|
hostTheme: i,
|
|
2370
2396
|
chrome: r,
|
|
2371
2397
|
onToggleHostTheme: a
|
|
2372
2398
|
}) {
|
|
2373
|
-
const
|
|
2374
|
-
return
|
|
2399
|
+
const o = V(null);
|
|
2400
|
+
return B(() => {
|
|
2375
2401
|
if (!e) return;
|
|
2376
|
-
const
|
|
2377
|
-
|
|
2378
|
-
},
|
|
2402
|
+
const s = (c) => {
|
|
2403
|
+
c.key === "Escape" && t();
|
|
2404
|
+
}, u = (c) => {
|
|
2379
2405
|
var p, m;
|
|
2380
|
-
const l =
|
|
2381
|
-
(p =
|
|
2406
|
+
const l = c.target;
|
|
2407
|
+
(p = o.current) != null && p.contains(l) || (m = l.closest) != null && m.call(l, "[data-pa-settings-trigger]") || t();
|
|
2382
2408
|
};
|
|
2383
|
-
return window.addEventListener("keydown",
|
|
2384
|
-
window.removeEventListener("keydown",
|
|
2409
|
+
return window.addEventListener("keydown", s), window.addEventListener("mousedown", u), () => {
|
|
2410
|
+
window.removeEventListener("keydown", s), window.removeEventListener("mousedown", u);
|
|
2385
2411
|
};
|
|
2386
|
-
}, [e, t]), e ? /* @__PURE__ */ n("div", { ref:
|
|
2387
|
-
/* @__PURE__ */
|
|
2412
|
+
}, [e, t]), e ? /* @__PURE__ */ n("div", { ref: o, className: "pa-settings-menu", role: "dialog", "aria-label": "PixelAgent settings", children: /* @__PURE__ */ n(ke, { variant: "popover", className: "pa-settings-menu-panel", children: /* @__PURE__ */ d("div", { className: "pa-settings-menu-inner", children: [
|
|
2413
|
+
/* @__PURE__ */ d("header", { className: "pa-settings-menu-header", children: [
|
|
2388
2414
|
/* @__PURE__ */ n("h4", { className: "pa-settings-menu-title", children: "Settings" }),
|
|
2389
2415
|
/* @__PURE__ */ n("p", { className: "pa-settings-menu-subtitle", children: "Appearance and chrome" })
|
|
2390
2416
|
] }),
|
|
2391
|
-
/* @__PURE__ */
|
|
2417
|
+
/* @__PURE__ */ d("section", { className: "pa-settings-section", children: [
|
|
2392
2418
|
/* @__PURE__ */ n("span", { className: "pa-settings-section-label", children: "Host theme" }),
|
|
2393
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ d("div", { className: "pa-settings-row", children: [
|
|
2394
2420
|
/* @__PURE__ */ n("span", { className: "pa-settings-row-value", children: i === "dark" ? "Dark canvas" : "Light canvas" }),
|
|
2395
2421
|
/* @__PURE__ */ n(
|
|
2396
|
-
|
|
2422
|
+
H,
|
|
2397
2423
|
{
|
|
2398
2424
|
variant: "icon",
|
|
2399
2425
|
onClick: a,
|
|
2400
2426
|
"aria-label": i === "dark" ? "Switch host to light theme" : "Switch host to dark theme",
|
|
2401
2427
|
title: i === "dark" ? "Light theme" : "Dark theme",
|
|
2402
|
-
children: i === "dark" ? /* @__PURE__ */ n(
|
|
2428
|
+
children: i === "dark" ? /* @__PURE__ */ n(cr, {}) : /* @__PURE__ */ n(dr, {})
|
|
2403
2429
|
}
|
|
2404
2430
|
)
|
|
2405
2431
|
] })
|
|
2406
2432
|
] }),
|
|
2407
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ d("section", { className: "pa-settings-section", children: [
|
|
2408
2434
|
/* @__PURE__ */ n("span", { className: "pa-settings-section-label", children: "Glass chrome" }),
|
|
2409
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ d("p", { className: "pa-settings-hint", children: [
|
|
2410
2436
|
r === "dim" ? "Dim gray glass for readability on bright pages." : "Frosted glass for dark pages.",
|
|
2411
2437
|
" ",
|
|
2412
2438
|
"(auto)"
|
|
@@ -2414,29 +2440,29 @@ function ir({
|
|
|
2414
2440
|
] })
|
|
2415
2441
|
] }) }) }) : null;
|
|
2416
2442
|
}
|
|
2417
|
-
const
|
|
2418
|
-
function
|
|
2419
|
-
return /* @__PURE__ */
|
|
2443
|
+
const ut = "0 0 24 24";
|
|
2444
|
+
function pr() {
|
|
2445
|
+
return /* @__PURE__ */ d(Y, { children: [
|
|
2420
2446
|
/* @__PURE__ */ n("rect", { x: "3", y: "14", width: "4", height: "4", fill: "currentColor" }),
|
|
2421
2447
|
/* @__PURE__ */ n("path", { fill: "currentColor", d: "M7 5h12v12L7 5z" })
|
|
2422
2448
|
] });
|
|
2423
2449
|
}
|
|
2424
|
-
const
|
|
2425
|
-
function
|
|
2450
|
+
const hr = "M4.5 2.5L4.5 17.25L9.1 12.9L11.35 19.15L13.55 17.95L11.05 11.85L16.85 11.85L4.5 2.5Z";
|
|
2451
|
+
function mr({ size: e = 22, variant: t = "cursor" }) {
|
|
2426
2452
|
return t === "pointer" ? /* @__PURE__ */ n(
|
|
2427
2453
|
"svg",
|
|
2428
2454
|
{
|
|
2429
2455
|
className: "pa-brand-cursor pa-brand-cursor--pointer",
|
|
2430
2456
|
width: e,
|
|
2431
2457
|
height: e,
|
|
2432
|
-
viewBox:
|
|
2458
|
+
viewBox: ut,
|
|
2433
2459
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2434
2460
|
"aria-hidden": "true",
|
|
2435
2461
|
children: /* @__PURE__ */ n(
|
|
2436
2462
|
"path",
|
|
2437
2463
|
{
|
|
2438
2464
|
fill: "currentColor",
|
|
2439
|
-
d:
|
|
2465
|
+
d: hr
|
|
2440
2466
|
}
|
|
2441
2467
|
)
|
|
2442
2468
|
}
|
|
@@ -2446,60 +2472,60 @@ function sr({ size: e = 22, variant: t = "cursor" }) {
|
|
|
2446
2472
|
className: "pa-brand-cursor pa-brand-cursor--minimal",
|
|
2447
2473
|
width: e,
|
|
2448
2474
|
height: e,
|
|
2449
|
-
viewBox:
|
|
2475
|
+
viewBox: ut,
|
|
2450
2476
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2451
2477
|
"aria-hidden": "true",
|
|
2452
|
-
children: /* @__PURE__ */ n(
|
|
2478
|
+
children: /* @__PURE__ */ n(pr, {})
|
|
2453
2479
|
}
|
|
2454
2480
|
);
|
|
2455
2481
|
}
|
|
2456
|
-
const
|
|
2482
|
+
const fr = ["element", "area", "multi"], gr = {
|
|
2457
2483
|
element: "Click",
|
|
2458
2484
|
area: "Area",
|
|
2459
2485
|
multi: "Multi"
|
|
2460
2486
|
};
|
|
2461
|
-
function
|
|
2487
|
+
function vr({
|
|
2462
2488
|
rootAttributes: e,
|
|
2463
2489
|
hostTheme: t,
|
|
2464
2490
|
chrome: i,
|
|
2465
2491
|
settingsOpen: r,
|
|
2466
2492
|
onToggleSettings: a,
|
|
2467
|
-
onCloseSettings:
|
|
2468
|
-
onToggleHostTheme:
|
|
2469
|
-
active:
|
|
2470
|
-
mode:
|
|
2493
|
+
onCloseSettings: o,
|
|
2494
|
+
onToggleHostTheme: s,
|
|
2495
|
+
active: u,
|
|
2496
|
+
mode: c,
|
|
2471
2497
|
captureMode: l,
|
|
2472
2498
|
annotationCount: p,
|
|
2473
2499
|
multiSelectCount: m,
|
|
2474
|
-
copyStatus:
|
|
2475
|
-
copyAllFrom:
|
|
2476
|
-
onActivateAnnotate:
|
|
2477
|
-
onActivateEdit:
|
|
2478
|
-
onDeactivate:
|
|
2479
|
-
onCopyAll:
|
|
2480
|
-
onCaptureModeChange:
|
|
2481
|
-
onConfirmMultiSelect:
|
|
2500
|
+
copyStatus: v,
|
|
2501
|
+
copyAllFrom: g,
|
|
2502
|
+
onActivateAnnotate: f,
|
|
2503
|
+
onActivateEdit: b,
|
|
2504
|
+
onDeactivate: E,
|
|
2505
|
+
onCopyAll: k,
|
|
2506
|
+
onCaptureModeChange: w,
|
|
2507
|
+
onConfirmMultiSelect: x
|
|
2482
2508
|
}) {
|
|
2483
|
-
const { elementRef:
|
|
2509
|
+
const { elementRef: L, isDragging: P, style: R, dragHandleProps: N } = Ct(), T = /* @__PURE__ */ d(
|
|
2484
2510
|
"div",
|
|
2485
2511
|
{
|
|
2486
|
-
ref:
|
|
2487
|
-
className: `pa-toolbar-float ${
|
|
2512
|
+
ref: L,
|
|
2513
|
+
className: `pa-toolbar-float ${P ? "pa-toolbar-float--dragging" : ""}`,
|
|
2488
2514
|
style: R,
|
|
2489
2515
|
role: "toolbar",
|
|
2490
2516
|
"aria-label": "PixelAgent",
|
|
2491
2517
|
children: [
|
|
2492
|
-
!
|
|
2493
|
-
|
|
2518
|
+
!u && /* @__PURE__ */ n(
|
|
2519
|
+
ur,
|
|
2494
2520
|
{
|
|
2495
2521
|
open: r,
|
|
2496
|
-
onClose:
|
|
2522
|
+
onClose: o,
|
|
2497
2523
|
hostTheme: t,
|
|
2498
2524
|
chrome: i,
|
|
2499
|
-
onToggleHostTheme:
|
|
2525
|
+
onToggleHostTheme: s
|
|
2500
2526
|
}
|
|
2501
2527
|
),
|
|
2502
|
-
/* @__PURE__ */ n(
|
|
2528
|
+
/* @__PURE__ */ n(kt, { shape: "capsule", className: "pa-toolbar-glass", intensity: "enhanced", children: /* @__PURE__ */ d("div", { className: "pa-toolbar-inner", children: [
|
|
2503
2529
|
/* @__PURE__ */ n(
|
|
2504
2530
|
"button",
|
|
2505
2531
|
{
|
|
@@ -2507,44 +2533,44 @@ function dr({
|
|
|
2507
2533
|
className: "pa-toolbar-drag",
|
|
2508
2534
|
"aria-label": "Drag PixelAgent toolbar",
|
|
2509
2535
|
title: "Drag to move",
|
|
2510
|
-
...
|
|
2511
|
-
children: /* @__PURE__ */ n(
|
|
2536
|
+
...N,
|
|
2537
|
+
children: /* @__PURE__ */ n(mr, { size: 22 })
|
|
2512
2538
|
}
|
|
2513
2539
|
),
|
|
2514
2540
|
/* @__PURE__ */ n("span", { className: "pa-toolbar-divider", "aria-hidden": "true" }),
|
|
2515
|
-
|
|
2516
|
-
/* @__PURE__ */
|
|
2517
|
-
/* @__PURE__ */ n("span", { className: "pa-mode-badge", children:
|
|
2518
|
-
|
|
2541
|
+
u ? /* @__PURE__ */ d(Y, { children: [
|
|
2542
|
+
/* @__PURE__ */ d("div", { className: "pa-toolbar-segment", children: [
|
|
2543
|
+
/* @__PURE__ */ n("span", { className: "pa-mode-badge", children: c }),
|
|
2544
|
+
c === "annotate" && /* @__PURE__ */ d(Y, { children: [
|
|
2519
2545
|
/* @__PURE__ */ n(
|
|
2520
2546
|
"select",
|
|
2521
2547
|
{
|
|
2522
2548
|
className: "pa-select pa-toolbar-capture-select",
|
|
2523
2549
|
value: l,
|
|
2524
|
-
onChange: (
|
|
2550
|
+
onChange: (C) => w(C.target.value),
|
|
2525
2551
|
"aria-label": "Capture mode",
|
|
2526
|
-
children:
|
|
2552
|
+
children: fr.map((C) => /* @__PURE__ */ n("option", { value: C, children: gr[C] }, C))
|
|
2527
2553
|
}
|
|
2528
2554
|
),
|
|
2529
2555
|
m > 0 && /* @__PURE__ */ n(
|
|
2530
|
-
|
|
2556
|
+
H,
|
|
2531
2557
|
{
|
|
2532
2558
|
variant: "glass-primary",
|
|
2533
|
-
onClick:
|
|
2559
|
+
onClick: x,
|
|
2534
2560
|
"aria-label": "Annotate selected elements",
|
|
2535
2561
|
children: m
|
|
2536
2562
|
}
|
|
2537
2563
|
),
|
|
2538
2564
|
/* @__PURE__ */ n(
|
|
2539
|
-
|
|
2565
|
+
Pt,
|
|
2540
2566
|
{
|
|
2541
|
-
feedback:
|
|
2567
|
+
feedback: g === "toolbar" ? v : null,
|
|
2542
2568
|
slotClassName: "pa-copy-feedback-slot--toolbar",
|
|
2543
2569
|
children: /* @__PURE__ */ n(
|
|
2544
|
-
|
|
2570
|
+
H,
|
|
2545
2571
|
{
|
|
2546
2572
|
variant: "glass-primary",
|
|
2547
|
-
onClick:
|
|
2573
|
+
onClick: k,
|
|
2548
2574
|
disabled: p === 0,
|
|
2549
2575
|
"aria-label": p > 0 ? `Copy all annotations (${p})` : "Copy all annotations",
|
|
2550
2576
|
children: p > 0 ? `Copy (${p})` : "Copy"
|
|
@@ -2555,11 +2581,11 @@ function dr({
|
|
|
2555
2581
|
] })
|
|
2556
2582
|
] }),
|
|
2557
2583
|
/* @__PURE__ */ n(
|
|
2558
|
-
|
|
2584
|
+
H,
|
|
2559
2585
|
{
|
|
2560
2586
|
variant: "icon",
|
|
2561
2587
|
className: "pa-toolbar-close",
|
|
2562
|
-
onClick:
|
|
2588
|
+
onClick: E,
|
|
2563
2589
|
"aria-label": "Close",
|
|
2564
2590
|
children: /* @__PURE__ */ n(
|
|
2565
2591
|
"svg",
|
|
@@ -2582,14 +2608,14 @@ function dr({
|
|
|
2582
2608
|
)
|
|
2583
2609
|
}
|
|
2584
2610
|
)
|
|
2585
|
-
] }) : /* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */ n(
|
|
2587
|
-
/* @__PURE__ */ n(
|
|
2611
|
+
] }) : /* @__PURE__ */ d("div", { className: "pa-toolbar-segment", children: [
|
|
2612
|
+
/* @__PURE__ */ n(H, { onClick: f, children: "Annotate" }),
|
|
2613
|
+
/* @__PURE__ */ n(H, { onClick: b, children: "Edit" })
|
|
2588
2614
|
] }),
|
|
2589
|
-
!
|
|
2615
|
+
!u && /* @__PURE__ */ d(Y, { children: [
|
|
2590
2616
|
/* @__PURE__ */ n("span", { className: "pa-toolbar-divider", "aria-hidden": "true" }),
|
|
2591
2617
|
/* @__PURE__ */ n(
|
|
2592
|
-
|
|
2618
|
+
H,
|
|
2593
2619
|
{
|
|
2594
2620
|
variant: "icon",
|
|
2595
2621
|
className: "pa-toolbar-settings",
|
|
@@ -2598,44 +2624,44 @@ function dr({
|
|
|
2598
2624
|
"aria-label": "PixelAgent settings",
|
|
2599
2625
|
"aria-expanded": r,
|
|
2600
2626
|
title: "Settings",
|
|
2601
|
-
children: /* @__PURE__ */ n(
|
|
2627
|
+
children: /* @__PURE__ */ n(lr, {})
|
|
2602
2628
|
}
|
|
2603
2629
|
)
|
|
2604
2630
|
] }),
|
|
2605
|
-
|
|
2631
|
+
v && !Tt(v) && v !== "Copied!" && /* @__PURE__ */ n("span", { className: "pa-status pa-toolbar-status", role: "status", children: v })
|
|
2606
2632
|
] }) })
|
|
2607
2633
|
]
|
|
2608
2634
|
}
|
|
2609
2635
|
);
|
|
2610
|
-
return typeof document > "u" ?
|
|
2636
|
+
return typeof document > "u" ? T : Be(
|
|
2611
2637
|
/* @__PURE__ */ n(
|
|
2612
2638
|
"div",
|
|
2613
2639
|
{
|
|
2614
2640
|
className: "pa-root pa-root--toolbar-portal",
|
|
2615
2641
|
"data-pixelagent-toolbar-portal": !0,
|
|
2616
2642
|
...e,
|
|
2617
|
-
children:
|
|
2643
|
+
children: T
|
|
2618
2644
|
}
|
|
2619
2645
|
),
|
|
2620
2646
|
document.body
|
|
2621
2647
|
);
|
|
2622
2648
|
}
|
|
2623
|
-
function
|
|
2624
|
-
const e = V(
|
|
2649
|
+
function br() {
|
|
2650
|
+
const e = V(Yt()), [t, i] = A(
|
|
2625
2651
|
() => {
|
|
2626
|
-
var
|
|
2627
|
-
return ((
|
|
2652
|
+
var o;
|
|
2653
|
+
return ((o = e.current) == null ? void 0 : o.annotations) ?? [];
|
|
2628
2654
|
}
|
|
2629
2655
|
);
|
|
2630
|
-
|
|
2631
|
-
|
|
2656
|
+
B(() => {
|
|
2657
|
+
Xt({ annotations: t });
|
|
2632
2658
|
}, [t]);
|
|
2633
|
-
const r =
|
|
2659
|
+
const r = I((o, s) => {
|
|
2634
2660
|
i(
|
|
2635
|
-
(
|
|
2661
|
+
(u) => u.map((c) => c.id === o ? { ...c, ...s } : c)
|
|
2636
2662
|
);
|
|
2637
|
-
}, []), a =
|
|
2638
|
-
i((
|
|
2663
|
+
}, []), a = I((o) => {
|
|
2664
|
+
i((s) => s.filter((u) => u.id !== o));
|
|
2639
2665
|
}, []);
|
|
2640
2666
|
return {
|
|
2641
2667
|
annotations: t,
|
|
@@ -2644,289 +2670,318 @@ function ur() {
|
|
|
2644
2670
|
removeAnnotation: a
|
|
2645
2671
|
};
|
|
2646
2672
|
}
|
|
2647
|
-
function
|
|
2673
|
+
function yr({
|
|
2648
2674
|
ui: e,
|
|
2649
2675
|
hostTheme: t,
|
|
2650
2676
|
onHostThemeChange: i
|
|
2651
2677
|
}) {
|
|
2652
2678
|
const r = ue(
|
|
2653
|
-
() => ({ ...
|
|
2679
|
+
() => ({ ...Gt, ...e }),
|
|
2654
2680
|
[e]
|
|
2655
|
-
), [a,
|
|
2656
|
-
() => t ??
|
|
2657
|
-
), [
|
|
2658
|
-
|
|
2681
|
+
), [a, o] = A(
|
|
2682
|
+
() => t ?? Je(r) ?? "dark"
|
|
2683
|
+
), [s, u] = A(!1), c = t ?? a;
|
|
2684
|
+
B(() => {
|
|
2659
2685
|
if (t !== void 0) return;
|
|
2660
|
-
const
|
|
2661
|
-
const
|
|
2662
|
-
|
|
2686
|
+
const v = () => {
|
|
2687
|
+
const b = Je(r);
|
|
2688
|
+
b && o(b);
|
|
2663
2689
|
};
|
|
2664
|
-
|
|
2665
|
-
const
|
|
2666
|
-
return
|
|
2690
|
+
v();
|
|
2691
|
+
const g = r.hostThemeAttribute, f = new MutationObserver(v);
|
|
2692
|
+
return f.observe(document.documentElement, {
|
|
2667
2693
|
attributes: !0,
|
|
2668
|
-
attributeFilter: [
|
|
2669
|
-
}), () =>
|
|
2694
|
+
attributeFilter: [g]
|
|
2695
|
+
}), () => f.disconnect();
|
|
2670
2696
|
}, [t, r]);
|
|
2671
2697
|
const l = ue(
|
|
2672
|
-
() =>
|
|
2673
|
-
[r,
|
|
2674
|
-
), p =
|
|
2675
|
-
const
|
|
2698
|
+
() => Kt(r, c),
|
|
2699
|
+
[r, c]
|
|
2700
|
+
), p = I(() => {
|
|
2701
|
+
const v = c === "dark" ? "light" : "dark";
|
|
2676
2702
|
if (i) {
|
|
2677
|
-
i(
|
|
2703
|
+
i(v);
|
|
2678
2704
|
return;
|
|
2679
2705
|
}
|
|
2680
|
-
|
|
2681
|
-
}, [
|
|
2682
|
-
|
|
2706
|
+
o(v), jt(v, r);
|
|
2707
|
+
}, [c, i, r]), m = I(() => {
|
|
2708
|
+
u((v) => !v);
|
|
2683
2709
|
}, []);
|
|
2684
2710
|
return {
|
|
2685
2711
|
chrome: l,
|
|
2686
|
-
rootAttributes:
|
|
2687
|
-
hostTheme:
|
|
2712
|
+
rootAttributes: qt(l),
|
|
2713
|
+
hostTheme: c,
|
|
2688
2714
|
toggleHostTheme: p,
|
|
2689
|
-
settingsOpen:
|
|
2690
|
-
setSettingsOpen:
|
|
2715
|
+
settingsOpen: s,
|
|
2716
|
+
setSettingsOpen: u,
|
|
2691
2717
|
toggleSettings: m,
|
|
2692
2718
|
uiSettings: r
|
|
2693
2719
|
};
|
|
2694
2720
|
}
|
|
2695
|
-
|
|
2721
|
+
const pt = "/__pixelagent/apply";
|
|
2722
|
+
function ht(e) {
|
|
2696
2723
|
const t = Math.min(e.startX, e.currentX), i = Math.min(e.startY, e.currentY), r = Math.abs(e.currentX - e.startX), a = Math.abs(e.currentY - e.startY);
|
|
2697
2724
|
return { x: t, y: i, width: r, height: a };
|
|
2698
2725
|
}
|
|
2699
|
-
function
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2726
|
+
function wr({
|
|
2727
|
+
ui: e,
|
|
2728
|
+
hostTheme: t,
|
|
2729
|
+
onHostThemeChange: i,
|
|
2730
|
+
applyEndpoint: r,
|
|
2731
|
+
onApply: a
|
|
2732
|
+
} = {}) {
|
|
2733
|
+
const o = yr({ ui: e, hostTheme: t, onHostThemeChange: i }), [s, u] = A(null);
|
|
2734
|
+
B(() => {
|
|
2735
|
+
if (r || a) return;
|
|
2736
|
+
let y = !1;
|
|
2737
|
+
return fetch(pt, { method: "GET" }).then((S) => {
|
|
2738
|
+
!y && S.status === 405 && u(pt);
|
|
2739
|
+
}).catch(() => {
|
|
2740
|
+
}), () => {
|
|
2741
|
+
y = !0;
|
|
2742
|
+
};
|
|
2743
|
+
}, [r, a]);
|
|
2744
|
+
const [c, l] = A(!1), [p, m] = A("idle"), [v, g] = A("element"), {
|
|
2745
|
+
annotations: f,
|
|
2746
|
+
setAnnotations: b,
|
|
2747
|
+
updateAnnotation: E,
|
|
2748
|
+
removeAnnotation: k
|
|
2749
|
+
} = br(), [w, x] = A(null), [L, P] = A(null), [R, N] = A([]), [T, C] = A(null), [h, O] = A(null), [U, j] = A(!1), [z, K] = A(!1), M = c && p === "annotate" && f.length > 0 && !U, [D, $] = A("this-instance"), [F, W] = A("normal"), [_, ee] = A(null), [le, q] = A(null), [Ue, We] = A(null), Rt = V(null), Ce = V(null), ce = I(
|
|
2750
|
+
(y, S) => {
|
|
2751
|
+
Ce.current && clearTimeout(Ce.current), ee(y), q((S == null ? void 0 : S.entryId) ?? null), We((S == null ? void 0 : S.copyAllFrom) ?? null), Ce.current = setTimeout(() => {
|
|
2752
|
+
ee(null), q(null), We(null);
|
|
2709
2753
|
}, 2500);
|
|
2710
2754
|
},
|
|
2711
2755
|
[]
|
|
2712
|
-
),
|
|
2713
|
-
async (
|
|
2714
|
-
if (
|
|
2756
|
+
), pe = I(
|
|
2757
|
+
async (y, S, X) => {
|
|
2758
|
+
if (y)
|
|
2715
2759
|
try {
|
|
2716
|
-
await
|
|
2760
|
+
await bt(y), ce(S, X);
|
|
2717
2761
|
} catch {
|
|
2718
|
-
|
|
2762
|
+
ce("Copy failed — check clipboard permissions", X);
|
|
2719
2763
|
}
|
|
2720
2764
|
},
|
|
2721
|
-
[
|
|
2722
|
-
), de =
|
|
2723
|
-
(
|
|
2724
|
-
|
|
2765
|
+
[ce]
|
|
2766
|
+
), de = I(
|
|
2767
|
+
(y, S) => {
|
|
2768
|
+
y.length === 0 && !S || (C({ elements: y, areaBbox: S }), P(y[0] ?? null));
|
|
2725
2769
|
},
|
|
2726
2770
|
[]
|
|
2727
|
-
),
|
|
2728
|
-
(
|
|
2729
|
-
if (!(!
|
|
2730
|
-
if (
|
|
2731
|
-
|
|
2732
|
-
(
|
|
2771
|
+
), Ae = I(
|
|
2772
|
+
(y) => {
|
|
2773
|
+
if (!(!c || p !== "annotate" || we(y.target))) {
|
|
2774
|
+
if (h) {
|
|
2775
|
+
O(
|
|
2776
|
+
(S) => S && { ...S, currentX: y.clientX, currentY: y.clientY }
|
|
2733
2777
|
);
|
|
2734
2778
|
return;
|
|
2735
2779
|
}
|
|
2736
|
-
|
|
2780
|
+
v !== "area" && x(dt(y.clientX, y.clientY));
|
|
2737
2781
|
}
|
|
2738
2782
|
},
|
|
2739
|
-
[
|
|
2740
|
-
), Me =
|
|
2741
|
-
(
|
|
2742
|
-
!
|
|
2743
|
-
startX:
|
|
2744
|
-
startY:
|
|
2745
|
-
currentX:
|
|
2746
|
-
currentY:
|
|
2747
|
-
}),
|
|
2783
|
+
[c, p, h, v]
|
|
2784
|
+
), Me = I(
|
|
2785
|
+
(y) => {
|
|
2786
|
+
!c || p !== "annotate" || we(y.target) || v !== "area" || y.button !== 0 || (y.preventDefault(), y.stopPropagation(), O({
|
|
2787
|
+
startX: y.clientX,
|
|
2788
|
+
startY: y.clientY,
|
|
2789
|
+
currentX: y.clientX,
|
|
2790
|
+
currentY: y.clientY
|
|
2791
|
+
}), C(null));
|
|
2748
2792
|
},
|
|
2749
|
-
[
|
|
2750
|
-
),
|
|
2751
|
-
if (!
|
|
2752
|
-
const
|
|
2753
|
-
if (
|
|
2754
|
-
const
|
|
2755
|
-
de(
|
|
2756
|
-
}, [
|
|
2757
|
-
(
|
|
2758
|
-
if (!
|
|
2759
|
-
|
|
2760
|
-
const
|
|
2761
|
-
if (!
|
|
2762
|
-
if (
|
|
2763
|
-
N((
|
|
2793
|
+
[c, p, v]
|
|
2794
|
+
), Se = I(() => {
|
|
2795
|
+
if (!h) return;
|
|
2796
|
+
const y = ht(h);
|
|
2797
|
+
if (O(null), y.width < 8 || y.height < 8) return;
|
|
2798
|
+
const S = Jt(y, Ve);
|
|
2799
|
+
de(S, y);
|
|
2800
|
+
}, [h, de]), Le = I(
|
|
2801
|
+
(y) => {
|
|
2802
|
+
if (!c || p !== "annotate" || we(y.target) || v === "area") return;
|
|
2803
|
+
y.preventDefault(), y.stopPropagation();
|
|
2804
|
+
const S = dt(y.clientX, y.clientY);
|
|
2805
|
+
if (!S) return;
|
|
2806
|
+
if (y.shiftKey || v === "multi") {
|
|
2807
|
+
N((J) => J.includes(S) ? J.filter((Ee) => Ee !== S) : [...J, S]), P(S);
|
|
2764
2808
|
return;
|
|
2765
2809
|
}
|
|
2766
|
-
const X =
|
|
2767
|
-
de(X.includes(
|
|
2810
|
+
const X = R.length > 0 ? R : [S];
|
|
2811
|
+
de(X.includes(S) ? X : [S]);
|
|
2768
2812
|
},
|
|
2769
|
-
[
|
|
2813
|
+
[c, p, v, R, de]
|
|
2770
2814
|
);
|
|
2771
|
-
|
|
2772
|
-
!
|
|
2773
|
-
}, [
|
|
2774
|
-
if (
|
|
2775
|
-
return document.addEventListener("mousemove",
|
|
2776
|
-
document.removeEventListener("mousemove",
|
|
2815
|
+
B(() => {
|
|
2816
|
+
!L || D !== "all-instances" || ft(L) <= 1 && $("this-instance");
|
|
2817
|
+
}, [L, D]), B(() => {
|
|
2818
|
+
if (c)
|
|
2819
|
+
return document.addEventListener("mousemove", Ae, !0), document.addEventListener("mousedown", Me, !0), document.addEventListener("mouseup", Se, !0), document.addEventListener("click", Le, !0), () => {
|
|
2820
|
+
document.removeEventListener("mousemove", Ae, !0), document.removeEventListener("mousedown", Me, !0), document.removeEventListener("mouseup", Se, !0), document.removeEventListener("click", Le, !0);
|
|
2777
2821
|
};
|
|
2778
|
-
}, [
|
|
2779
|
-
const
|
|
2780
|
-
(
|
|
2781
|
-
if (!
|
|
2782
|
-
const { elements: X, areaBbox:
|
|
2783
|
-
if (X.length === 0 && !
|
|
2784
|
-
const
|
|
2822
|
+
}, [c, Ae, Me, Se, Le]);
|
|
2823
|
+
const Dt = I(
|
|
2824
|
+
(y, S) => {
|
|
2825
|
+
if (!T || !y.trim()) return;
|
|
2826
|
+
const { elements: X, areaBbox: J } = T;
|
|
2827
|
+
if (X.length === 0 && !J) return;
|
|
2828
|
+
const Ge = nr({
|
|
2785
2829
|
elements: X,
|
|
2786
|
-
note:
|
|
2787
|
-
areaBbox:
|
|
2830
|
+
note: y,
|
|
2831
|
+
areaBbox: J
|
|
2788
2832
|
});
|
|
2789
|
-
|
|
2833
|
+
b((Ee) => [...Ee, Ge]), j(!1), K(!1), S ? (C(null), P(null)) : (C(null), P(null), N([]));
|
|
2790
2834
|
},
|
|
2791
|
-
[
|
|
2792
|
-
),
|
|
2793
|
-
|
|
2794
|
-
}, []),
|
|
2795
|
-
async (
|
|
2796
|
-
const
|
|
2797
|
-
await
|
|
2835
|
+
[T, b]
|
|
2836
|
+
), Ot = I(() => {
|
|
2837
|
+
C(null), P(null);
|
|
2838
|
+
}, []), Ye = I(
|
|
2839
|
+
async (y) => {
|
|
2840
|
+
const S = Zt(f);
|
|
2841
|
+
await pe(S, "Copied all!", { copyAllFrom: y });
|
|
2798
2842
|
},
|
|
2799
|
-
[
|
|
2800
|
-
),
|
|
2801
|
-
async (
|
|
2802
|
-
const
|
|
2803
|
-
|
|
2843
|
+
[f, pe]
|
|
2844
|
+
), $t = I(
|
|
2845
|
+
async (y) => {
|
|
2846
|
+
const S = f.find((X) => X.id === y);
|
|
2847
|
+
S && await pe(Qt(S), "Copied!", { entryId: y });
|
|
2804
2848
|
},
|
|
2805
|
-
[
|
|
2806
|
-
),
|
|
2807
|
-
async (
|
|
2808
|
-
if (!
|
|
2809
|
-
const
|
|
2849
|
+
[f, pe]
|
|
2850
|
+
), Ft = I(
|
|
2851
|
+
async (y) => {
|
|
2852
|
+
if (!L) return;
|
|
2853
|
+
const S = Fe(L), X = {
|
|
2810
2854
|
schemaVersion: 1,
|
|
2811
|
-
elementSelector:
|
|
2812
|
-
sourceFile:
|
|
2813
|
-
lineNumber:
|
|
2814
|
-
targetScope:
|
|
2815
|
-
state:
|
|
2816
|
-
stylingSystem:
|
|
2817
|
-
changes:
|
|
2818
|
-
}
|
|
2819
|
-
|
|
2855
|
+
elementSelector: gt(L, D),
|
|
2856
|
+
sourceFile: S.sourceFile,
|
|
2857
|
+
lineNumber: S.lineNumber,
|
|
2858
|
+
targetScope: D,
|
|
2859
|
+
state: F,
|
|
2860
|
+
stylingSystem: mt(L),
|
|
2861
|
+
changes: y
|
|
2862
|
+
}, J = await Un(X, {
|
|
2863
|
+
applyEndpoint: r ?? s ?? void 0,
|
|
2864
|
+
onApply: a
|
|
2865
|
+
});
|
|
2866
|
+
ce(Wn(J));
|
|
2820
2867
|
},
|
|
2821
|
-
[
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2868
|
+
[
|
|
2869
|
+
L,
|
|
2870
|
+
D,
|
|
2871
|
+
F,
|
|
2872
|
+
r,
|
|
2873
|
+
s,
|
|
2874
|
+
a,
|
|
2875
|
+
ce
|
|
2876
|
+
]
|
|
2877
|
+
), Xe = (y) => {
|
|
2878
|
+
o.setSettingsOpen(!1), l(!0), m(y), P(null), x(null), C(null), N([]), O(null), y === "annotate" && j(!1);
|
|
2879
|
+
}, Bt = () => {
|
|
2880
|
+
l(!1), m("idle"), P(null), x(null), C(null), N([]), O(null), j(!1), K(!1);
|
|
2881
|
+
}, zt = h ? ht(h) : null;
|
|
2882
|
+
return /* @__PURE__ */ d(
|
|
2828
2883
|
"div",
|
|
2829
2884
|
{
|
|
2830
|
-
ref:
|
|
2885
|
+
ref: Rt,
|
|
2831
2886
|
className: "pa-root",
|
|
2832
2887
|
"data-pixelagent-root": !0,
|
|
2833
|
-
...
|
|
2888
|
+
...o.rootAttributes,
|
|
2834
2889
|
children: [
|
|
2835
2890
|
/* @__PURE__ */ n(
|
|
2836
|
-
|
|
2891
|
+
vr,
|
|
2837
2892
|
{
|
|
2838
|
-
rootAttributes:
|
|
2839
|
-
hostTheme:
|
|
2840
|
-
chrome:
|
|
2841
|
-
settingsOpen:
|
|
2842
|
-
onToggleSettings:
|
|
2843
|
-
onCloseSettings: () =>
|
|
2844
|
-
onToggleHostTheme:
|
|
2845
|
-
active:
|
|
2846
|
-
mode:
|
|
2847
|
-
captureMode:
|
|
2848
|
-
annotationCount:
|
|
2849
|
-
multiSelectCount:
|
|
2850
|
-
copyStatus:
|
|
2851
|
-
copyAllFrom:
|
|
2852
|
-
onActivateAnnotate: () =>
|
|
2853
|
-
onActivateEdit: () =>
|
|
2854
|
-
onDeactivate:
|
|
2855
|
-
onCopyAll: () =>
|
|
2856
|
-
onCaptureModeChange:
|
|
2893
|
+
rootAttributes: o.rootAttributes,
|
|
2894
|
+
hostTheme: o.hostTheme,
|
|
2895
|
+
chrome: o.chrome,
|
|
2896
|
+
settingsOpen: o.settingsOpen,
|
|
2897
|
+
onToggleSettings: o.toggleSettings,
|
|
2898
|
+
onCloseSettings: () => o.setSettingsOpen(!1),
|
|
2899
|
+
onToggleHostTheme: o.toggleHostTheme,
|
|
2900
|
+
active: c,
|
|
2901
|
+
mode: p,
|
|
2902
|
+
captureMode: v,
|
|
2903
|
+
annotationCount: f.length,
|
|
2904
|
+
multiSelectCount: R.length,
|
|
2905
|
+
copyStatus: _,
|
|
2906
|
+
copyAllFrom: Ue,
|
|
2907
|
+
onActivateAnnotate: () => Xe("annotate"),
|
|
2908
|
+
onActivateEdit: () => Xe("edit"),
|
|
2909
|
+
onDeactivate: Bt,
|
|
2910
|
+
onCopyAll: () => Ye("toolbar"),
|
|
2911
|
+
onCaptureModeChange: g,
|
|
2857
2912
|
onConfirmMultiSelect: () => {
|
|
2858
|
-
|
|
2913
|
+
R.length > 0 && de(R);
|
|
2859
2914
|
}
|
|
2860
2915
|
}
|
|
2861
2916
|
),
|
|
2862
|
-
|
|
2917
|
+
c && p === "annotate" && /* @__PURE__ */ d(Y, { children: [
|
|
2863
2918
|
/* @__PURE__ */ n(
|
|
2864
|
-
|
|
2919
|
+
xt,
|
|
2865
2920
|
{
|
|
2866
|
-
element:
|
|
2867
|
-
selected:
|
|
2868
|
-
multiSelected:
|
|
2921
|
+
element: w,
|
|
2922
|
+
selected: L,
|
|
2923
|
+
multiSelected: R
|
|
2869
2924
|
}
|
|
2870
2925
|
),
|
|
2871
|
-
/* @__PURE__ */ n(
|
|
2872
|
-
/* @__PURE__ */ n(
|
|
2926
|
+
/* @__PURE__ */ n(or, { annotations: f }),
|
|
2927
|
+
/* @__PURE__ */ n(tr, { area: zt, isDragging: !!h })
|
|
2873
2928
|
] }),
|
|
2874
|
-
|
|
2875
|
-
|
|
2929
|
+
c && p === "annotate" && T && /* @__PURE__ */ n(
|
|
2930
|
+
er,
|
|
2876
2931
|
{
|
|
2877
|
-
elements:
|
|
2878
|
-
areaBbox:
|
|
2879
|
-
onSubmit:
|
|
2880
|
-
onCancel:
|
|
2932
|
+
elements: T.elements,
|
|
2933
|
+
areaBbox: T.areaBbox,
|
|
2934
|
+
onSubmit: Dt,
|
|
2935
|
+
onCancel: Ot
|
|
2881
2936
|
}
|
|
2882
2937
|
),
|
|
2883
|
-
|
|
2884
|
-
|
|
2938
|
+
c && p === "edit" && /* @__PURE__ */ n(
|
|
2939
|
+
Vn,
|
|
2885
2940
|
{
|
|
2886
|
-
selectedElement:
|
|
2887
|
-
hoveredElement:
|
|
2888
|
-
onSelectElement:
|
|
2889
|
-
onHoverElement:
|
|
2890
|
-
targetScope:
|
|
2891
|
-
onTargetScopeChange:
|
|
2892
|
-
elementState:
|
|
2893
|
-
onElementStateChange:
|
|
2894
|
-
onApply:
|
|
2895
|
-
applyStatus:
|
|
2896
|
-
isToolbarTarget:
|
|
2941
|
+
selectedElement: L,
|
|
2942
|
+
hoveredElement: w,
|
|
2943
|
+
onSelectElement: P,
|
|
2944
|
+
onHoverElement: x,
|
|
2945
|
+
targetScope: D,
|
|
2946
|
+
onTargetScopeChange: $,
|
|
2947
|
+
elementState: F,
|
|
2948
|
+
onElementStateChange: W,
|
|
2949
|
+
onApply: Ft,
|
|
2950
|
+
applyStatus: p === "edit" ? _ : null,
|
|
2951
|
+
isToolbarTarget: we
|
|
2897
2952
|
}
|
|
2898
2953
|
),
|
|
2899
|
-
|
|
2900
|
-
|
|
2954
|
+
M && /* @__PURE__ */ n(
|
|
2955
|
+
sr,
|
|
2901
2956
|
{
|
|
2902
|
-
annotations:
|
|
2903
|
-
collapsed:
|
|
2904
|
-
onToggleCollapsed: () =>
|
|
2957
|
+
annotations: f,
|
|
2958
|
+
collapsed: z,
|
|
2959
|
+
onToggleCollapsed: () => K((y) => !y),
|
|
2905
2960
|
onClose: () => {
|
|
2906
|
-
|
|
2961
|
+
j(!0), K(!1);
|
|
2907
2962
|
},
|
|
2908
|
-
onCopyAll: () =>
|
|
2909
|
-
onCopyOne:
|
|
2910
|
-
onRemove:
|
|
2911
|
-
onUpdate:
|
|
2912
|
-
copyStatus:
|
|
2913
|
-
copiedEntryId:
|
|
2914
|
-
copyAllFrom:
|
|
2963
|
+
onCopyAll: () => Ye("session"),
|
|
2964
|
+
onCopyOne: $t,
|
|
2965
|
+
onRemove: k,
|
|
2966
|
+
onUpdate: E,
|
|
2967
|
+
copyStatus: _,
|
|
2968
|
+
copiedEntryId: le,
|
|
2969
|
+
copyAllFrom: Ue
|
|
2915
2970
|
}
|
|
2916
2971
|
)
|
|
2917
2972
|
]
|
|
2918
2973
|
}
|
|
2919
2974
|
);
|
|
2920
2975
|
}
|
|
2921
|
-
function
|
|
2976
|
+
function xr() {
|
|
2922
2977
|
return typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
2923
2978
|
}
|
|
2924
|
-
function
|
|
2925
|
-
return
|
|
2979
|
+
function Mr() {
|
|
2980
|
+
return xr() ? /* @__PURE__ */ n(wr, {}) : null;
|
|
2926
2981
|
}
|
|
2927
2982
|
export {
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2983
|
+
wr as PixelAgent,
|
|
2984
|
+
Mr as PixelAgentDev,
|
|
2985
|
+
xr as isDevEnvironment
|
|
2931
2986
|
};
|
|
2932
2987
|
//# sourceMappingURL=pixelagent.js.map
|