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