pixelagent 0.1.14 → 0.1.16
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/pixelagent.js +1070 -1011
- 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 H, useRef as Y, useMemo as xe, useLayoutEffect as Kt, useCallback as E, 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,
|
|
12
|
+
const [a, s] = S([]), o = r ?? t;
|
|
13
13
|
if (H(() => {
|
|
14
|
-
const l = /* @__PURE__ */ new Map(),
|
|
15
|
-
e && !t && !
|
|
16
|
-
for (const
|
|
17
|
-
l.set(
|
|
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
|
|
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 L = new Float32Array(s * o * 2);
|
|
85
|
+
let N = 0;
|
|
86
|
+
for (let k = 0; k < o; k++)
|
|
87
|
+
for (let $ = 0; $ < s; $++) {
|
|
88
|
+
const P = $ / s - 0.5, R = k / o - 0.5, x = un(P, R, v, m, g), I = at(0.8, 0, x - 0.15), C = at(0, 1, I), h = (P * C + 0.5) * s - $, O = (R * C + 0.5) * o - k;
|
|
89
|
+
Math.abs(h) > b && (b = Math.abs(h)), Math.abs(O) > b && (b = Math.abs(O)), L[N++] = h, L[N++] = O;
|
|
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 $ = L[w++] / b + 0.5, P = L[w++] / b + 0.5;
|
|
96
|
+
f[k] = $ * 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
|
|
145
|
-
const
|
|
146
|
-
cancelAnimationFrame(
|
|
147
|
-
const w =
|
|
148
|
-
if (
|
|
149
|
-
const P = e === "capsule" ?
|
|
150
|
-
|
|
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
|
+
const L = () => {
|
|
146
|
+
cancelAnimationFrame(b), b = requestAnimationFrame(() => {
|
|
147
|
+
const w = g.getBoundingClientRect(), k = Math.round(w.width), $ = Math.round(w.height);
|
|
148
|
+
if (k < 8 || $ < 8) return;
|
|
149
|
+
const P = e === "capsule" ? $ / 2 : Math.min(c, k / 2, $ / 2), R = dn(k, $, P, u);
|
|
150
|
+
R && v(R);
|
|
151
151
|
});
|
|
152
152
|
};
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
cancelAnimationFrame(
|
|
153
|
+
L();
|
|
154
|
+
const N = new ResizeObserver(L);
|
|
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,25 +211,25 @@ 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
|
)
|
|
@@ -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 = E(() => {
|
|
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
288
|
H(() => {
|
|
289
|
-
|
|
290
|
-
}, [
|
|
291
|
-
const
|
|
292
|
-
r((
|
|
293
|
-
if (!
|
|
294
|
-
const
|
|
289
|
+
u();
|
|
290
|
+
}, [u]), H(() => {
|
|
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
|
|
311
|
-
|
|
303
|
+
const l = E(
|
|
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 L = g.getBoundingClientRect();
|
|
311
|
+
b = { x: L.left, y: L.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 = E((m) => {
|
|
323
|
+
if (!o.current || o.current.pointerId !== m.pointerId) return;
|
|
324
|
+
const g = c.current, b = (g == null ? void 0 : g.offsetWidth) ?? 320, L = (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)), $ = Math.max(8, Math.min(window.innerHeight - L - 8, o.current.originY + w));
|
|
325
|
+
r({ x: k, y: $ });
|
|
326
|
+
}, []), p = E((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,161 +417,161 @@ 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] =
|
|
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), L = e.toLowerCase().includes("color") ? e : `${e} color`;
|
|
486
486
|
H(() => {
|
|
487
|
-
|
|
487
|
+
o(ot(t));
|
|
488
488
|
}, [t]);
|
|
489
|
-
const
|
|
490
|
-
(
|
|
491
|
-
|
|
489
|
+
const N = E(
|
|
490
|
+
(x) => {
|
|
491
|
+
o(x), i(wn(x));
|
|
492
492
|
},
|
|
493
493
|
[i]
|
|
494
|
-
), w =
|
|
495
|
-
(
|
|
496
|
-
|
|
494
|
+
), w = E(
|
|
495
|
+
(x) => {
|
|
496
|
+
N(Dt(x));
|
|
497
497
|
},
|
|
498
|
-
[
|
|
499
|
-
),
|
|
500
|
-
const
|
|
501
|
-
if (!
|
|
502
|
-
const I =
|
|
498
|
+
[N]
|
|
499
|
+
), k = E(() => {
|
|
500
|
+
const x = c.current;
|
|
501
|
+
if (!x) return;
|
|
502
|
+
const I = x.getBoundingClientRect(), C = 260;
|
|
503
503
|
let h = I.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 O = I.bottom + 8;
|
|
506
|
+
const U = 320;
|
|
507
|
+
O + U > window.innerHeight - 12 && (O = Math.max(12, I.top - U - 8)), v({ top: O, left: h, width: C });
|
|
508
508
|
}, []);
|
|
509
509
|
H(() => {
|
|
510
510
|
if (!r) return;
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
var
|
|
511
|
+
k();
|
|
512
|
+
const x = (C) => {
|
|
513
|
+
var O, U;
|
|
514
514
|
const h = C.target;
|
|
515
|
-
(
|
|
515
|
+
(O = c.current) != null && O.contains(h) || (U = u.current) != null && U.contains(h) || a(!1);
|
|
516
516
|
}, I = (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", I), window.addEventListener("resize", k), window.addEventListener("scroll", k, !0), () => {
|
|
520
|
+
window.removeEventListener("mousedown", x, !0), window.removeEventListener("keydown", I), 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 $ = (x, I) => {
|
|
524
|
+
var U;
|
|
525
|
+
const C = (U = l.current) == null ? void 0 : U.getBoundingClientRect();
|
|
526
526
|
if (!C) return;
|
|
527
|
-
const { x: h, y:
|
|
528
|
-
|
|
529
|
-
}, P = (
|
|
530
|
-
|
|
531
|
-
const I = (h) =>
|
|
527
|
+
const { x: h, y: O } = xn(x, I, C);
|
|
528
|
+
N({ ...s, s: h, v: 100 - O });
|
|
529
|
+
}, P = (x) => {
|
|
530
|
+
x.preventDefault(), $(x.clientX, x.clientY);
|
|
531
|
+
const I = (h) => $(h.clientX, h.clientY), C = () => {
|
|
532
532
|
window.removeEventListener("mousemove", I), window.removeEventListener("mouseup", C);
|
|
533
533
|
};
|
|
534
534
|
window.addEventListener("mousemove", I), window.addEventListener("mouseup", C);
|
|
535
|
-
},
|
|
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
|
-
"aria-label":
|
|
548
|
+
"aria-label": L,
|
|
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
|
),
|
|
561
|
-
/* @__PURE__ */ n("span", { className: "pa-color-picker-header-label", children:
|
|
561
|
+
/* @__PURE__ */ n("span", { className: "pa-color-picker-header-label", children: L })
|
|
562
562
|
] }),
|
|
563
563
|
/* @__PURE__ */ n(
|
|
564
564
|
"div",
|
|
565
565
|
{
|
|
566
566
|
ref: l,
|
|
567
567
|
className: "pa-color-picker-sb",
|
|
568
|
-
style: { "--pa-picker-h": String(Math.round(
|
|
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:
|
|
624
|
+
value: m[x],
|
|
625
625
|
onChange: (I) => {
|
|
626
|
-
const C =
|
|
627
|
-
w({ ...
|
|
626
|
+
const C = kn(parseInt(I.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 [
|
|
951
|
+
function he({ icon: e, display: t, ariaLabel: i, mixed: r, onCommit: a }) {
|
|
952
|
+
const [s, o] = S(t);
|
|
953
953
|
return H(() => {
|
|
954
|
-
|
|
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
1211
|
var I, C;
|
|
1212
|
-
const v = e["font-weight"] ?? "",
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
return
|
|
1216
|
-
/* @__PURE__ */ d(
|
|
1212
|
+
const v = e["font-weight"] ?? "", m = e["font-style"] ?? "normal", g = e["text-decoration"] ?? "none", b = Yn(e["text-align"] ?? "left"), L = ((I = e.display) == null ? void 0 : I.trim()) ?? "", N = !!L, w = Xn.has(L), k = [...mt];
|
|
1213
|
+
L && !mt.includes(L) && k.push(L);
|
|
1214
|
+
const $ = ((C = e.gap) == null ? void 0 : C.trim()) ?? "", P = $ === "normal" || $ === "" ? "0px" : $, 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,20 +1426,20 @@ 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",
|
|
1433
1433
|
{
|
|
1434
1434
|
className: "pa-select",
|
|
1435
|
-
value:
|
|
1435
|
+
value: L,
|
|
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,214 @@ 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(""), [L, N] = S(""), [w, k] = S(() => /* @__PURE__ */ new Map()), [$, P] = S(!1), R = E(() => {
|
|
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 = E(() => {
|
|
1547
|
+
c.current.push(R()), c.current.length > Kn && c.current.shift(), P(c.current.length > 0);
|
|
1548
|
+
}, [R]), I = E(
|
|
1549
1549
|
(M) => {
|
|
1550
|
-
var
|
|
1550
|
+
var T;
|
|
1551
1551
|
if (!e) return;
|
|
1552
|
-
const
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1555
|
-
r.current =
|
|
1556
|
-
const
|
|
1557
|
-
if (M &&
|
|
1558
|
-
for (const
|
|
1559
|
-
if (
|
|
1560
|
-
for (const X of
|
|
1561
|
-
|
|
1552
|
+
const F = Array.from(a.current);
|
|
1553
|
+
we(s.current.filter((_) => F.includes(_.element))), o.current && ke(o.current);
|
|
1554
|
+
const D = $e(e, t);
|
|
1555
|
+
r.current = D, a.current = new Set(D), Ce(F), ze(D, i);
|
|
1556
|
+
const z = e ? ((T = w.get(e)) == null ? void 0 : T.get(i)) ?? [] : [];
|
|
1557
|
+
if (M && z.length > 0)
|
|
1558
|
+
for (const _ of z)
|
|
1559
|
+
if (_.property === "textContent" || _.property === "value")
|
|
1560
|
+
for (const X of D)
|
|
1561
|
+
rt(X, _.property, _.newValue);
|
|
1562
1562
|
else
|
|
1563
|
-
for (const X of
|
|
1564
|
-
X.style.setProperty(
|
|
1563
|
+
for (const X of D)
|
|
1564
|
+
X.style.setProperty(_.property, _.newValue);
|
|
1565
1565
|
},
|
|
1566
1566
|
[e, t, i, w]
|
|
1567
1567
|
);
|
|
1568
1568
|
H(() => {
|
|
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
|
|
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 F = Me(e);
|
|
1576
|
+
l(F), p(F);
|
|
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
1579
|
}, [e]), H(() => {
|
|
1580
1580
|
e && I(!0);
|
|
1581
1581
|
}, [t]), H(() => {
|
|
1582
|
-
var
|
|
1582
|
+
var D;
|
|
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((z) => M.includes(z.element))
|
|
1587
1587
|
);
|
|
1588
|
-
const
|
|
1589
|
-
for (const
|
|
1590
|
-
if (!(
|
|
1591
|
-
for (const
|
|
1592
|
-
|
|
1593
|
-
|
|
1588
|
+
const F = ((D = w.get(e)) == null ? void 0 : D.get(i)) ?? [];
|
|
1589
|
+
for (const z of F)
|
|
1590
|
+
if (!(z.property === "textContent" || z.property === "value"))
|
|
1591
|
+
for (const T of M)
|
|
1592
|
+
T.style.setProperty(z.property, z.newValue);
|
|
1593
|
+
Ce(Array.from(a.current)), ze(M, i), a.current = new Set(M);
|
|
1594
1594
|
}, [i, e, t]);
|
|
1595
|
-
const C =
|
|
1596
|
-
(M,
|
|
1597
|
-
e &&
|
|
1598
|
-
const
|
|
1599
|
-
return
|
|
1595
|
+
const C = E(
|
|
1596
|
+
(M, F, D) => {
|
|
1597
|
+
e && k((z) => {
|
|
1598
|
+
const T = new Map(z), _ = new Map(T.get(e) ?? /* @__PURE__ */ new Map()), q = (_.get(i) ?? []).filter((Re) => Re.property !== M);
|
|
1599
|
+
return D === F ? q.length === 0 ? _.delete(i) : _.set(i, q) : _.set(i, [...q, { property: M, oldValue: F, newValue: D }]), _.size === 0 ? T.delete(e) : T.set(e, _), T;
|
|
1600
1600
|
});
|
|
1601
1601
|
},
|
|
1602
1602
|
[e, i]
|
|
1603
|
-
), h =
|
|
1604
|
-
(M,
|
|
1603
|
+
), h = E(
|
|
1604
|
+
(M, F) => {
|
|
1605
1605
|
if (!e) return;
|
|
1606
|
-
const
|
|
1607
|
-
M === "border-width" && (
|
|
1608
|
-
for (const [
|
|
1609
|
-
const
|
|
1606
|
+
const D = { [M]: F };
|
|
1607
|
+
M === "border-width" && (u["border-style"] ?? "none") === "none" && Sn(F) && (D["border-style"] = "solid"), x(), l((z) => ({ ...z, ...D }));
|
|
1608
|
+
for (const [z, T] of Object.entries(D)) {
|
|
1609
|
+
const _ = f[z] ?? "";
|
|
1610
1610
|
for (const X of r.current)
|
|
1611
|
-
X.style.setProperty(
|
|
1612
|
-
C(
|
|
1611
|
+
X.style.setProperty(z, T), a.current.add(X);
|
|
1612
|
+
C(z, _, T);
|
|
1613
1613
|
}
|
|
1614
1614
|
},
|
|
1615
|
-
[e,
|
|
1616
|
-
),
|
|
1615
|
+
[e, f, u, x, C]
|
|
1616
|
+
), O = E(
|
|
1617
1617
|
(M) => {
|
|
1618
1618
|
if (!(!e || v === "none")) {
|
|
1619
|
-
|
|
1620
|
-
for (const
|
|
1621
|
-
|
|
1622
|
-
C(v,
|
|
1619
|
+
x(), b(M);
|
|
1620
|
+
for (const F of r.current)
|
|
1621
|
+
rt(F, v, M), a.current.add(F);
|
|
1622
|
+
C(v, L, M);
|
|
1623
1623
|
}
|
|
1624
1624
|
},
|
|
1625
|
-
[e, v,
|
|
1626
|
-
),
|
|
1627
|
-
const M =
|
|
1628
|
-
if (M && (
|
|
1629
|
-
l(
|
|
1630
|
-
const
|
|
1631
|
-
|
|
1625
|
+
[e, v, L, x, C]
|
|
1626
|
+
), U = E(() => {
|
|
1627
|
+
const M = c.current.pop();
|
|
1628
|
+
if (M && (we(M.inline), M.text && ke(M.text), P(c.current.length > 0), e)) {
|
|
1629
|
+
l(Me(e));
|
|
1630
|
+
const F = fe(e);
|
|
1631
|
+
F.kind !== "none" && b(F.value);
|
|
1632
1632
|
}
|
|
1633
|
-
}, [e]),
|
|
1634
|
-
if (
|
|
1635
|
-
l(
|
|
1636
|
-
const M =
|
|
1637
|
-
|
|
1633
|
+
}, [e]), ge = E(() => {
|
|
1634
|
+
if (we(s.current), o.current && ke(o.current), c.current = [], P(!1), k(/* @__PURE__ */ new Map()), e) {
|
|
1635
|
+
l(Me(e));
|
|
1636
|
+
const M = fe(e);
|
|
1637
|
+
b(M.value);
|
|
1638
1638
|
}
|
|
1639
|
-
}, [e]),
|
|
1640
|
-
|
|
1641
|
-
}, []),
|
|
1642
|
-
if (
|
|
1643
|
-
l(
|
|
1644
|
-
const M =
|
|
1645
|
-
M.kind !== "none" &&
|
|
1639
|
+
}, [e]), j = E(() => {
|
|
1640
|
+
we(s.current), o.current && ke(o.current);
|
|
1641
|
+
}, []), oe = E(() => {
|
|
1642
|
+
if (j(), Ce(Array.from(a.current)), c.current = [], P(!1), k(/* @__PURE__ */ new Map()), e) {
|
|
1643
|
+
l(Me(e));
|
|
1644
|
+
const M = fe(e);
|
|
1645
|
+
M.kind !== "none" && b(M.value);
|
|
1646
1646
|
}
|
|
1647
|
-
}, [
|
|
1648
|
-
let
|
|
1647
|
+
}, [j, e]), re = e ? ((ee = w.get(e)) == null ? void 0 : ee.get(i)) ?? [] : [];
|
|
1648
|
+
let W = 0;
|
|
1649
1649
|
for (const M of w.values())
|
|
1650
|
-
for (const
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1650
|
+
for (const F of M.values()) W += F.length;
|
|
1651
|
+
const G = E(() => {
|
|
1652
|
+
k(/* @__PURE__ */ new Map());
|
|
1653
1653
|
}, []);
|
|
1654
1654
|
return {
|
|
1655
|
-
values:
|
|
1655
|
+
values: u,
|
|
1656
1656
|
textKind: v,
|
|
1657
|
-
textValue:
|
|
1658
|
-
pendingChanges:
|
|
1657
|
+
textValue: g,
|
|
1658
|
+
pendingChanges: re,
|
|
1659
1659
|
pendingByElement: w,
|
|
1660
|
-
totalPendingCount:
|
|
1661
|
-
clearAllPending:
|
|
1662
|
-
canUndo:
|
|
1660
|
+
totalPendingCount: W,
|
|
1661
|
+
clearAllPending: G,
|
|
1662
|
+
canUndo: $,
|
|
1663
1663
|
updateProperty: h,
|
|
1664
|
-
updateText:
|
|
1665
|
-
undo:
|
|
1666
|
-
reset:
|
|
1667
|
-
clearPreviews:
|
|
1668
|
-
revertPreviews:
|
|
1664
|
+
updateText: O,
|
|
1665
|
+
undo: U,
|
|
1666
|
+
reset: ge,
|
|
1667
|
+
clearPreviews: oe,
|
|
1668
|
+
revertPreviews: j
|
|
1669
1669
|
};
|
|
1670
1670
|
}
|
|
1671
|
-
function
|
|
1671
|
+
function qn({
|
|
1672
1672
|
selectedElement: e,
|
|
1673
1673
|
hoveredElement: t,
|
|
1674
1674
|
onSelectElement: i,
|
|
1675
1675
|
onHoverElement: r,
|
|
1676
1676
|
targetScope: a,
|
|
1677
|
-
onTargetScopeChange:
|
|
1678
|
-
elementState:
|
|
1679
|
-
onElementStateChange:
|
|
1680
|
-
onApply:
|
|
1677
|
+
onTargetScopeChange: s,
|
|
1678
|
+
elementState: o,
|
|
1679
|
+
onElementStateChange: c,
|
|
1680
|
+
onApply: u,
|
|
1681
1681
|
applyStatus: l,
|
|
1682
|
-
isToolbarTarget:
|
|
1683
|
-
onPreviewApi:
|
|
1682
|
+
isToolbarTarget: f,
|
|
1683
|
+
onPreviewApi: p
|
|
1684
1684
|
}) {
|
|
1685
1685
|
const {
|
|
1686
1686
|
values: v,
|
|
1687
|
-
textKind:
|
|
1688
|
-
textValue:
|
|
1689
|
-
pendingChanges:
|
|
1690
|
-
pendingByElement:
|
|
1691
|
-
totalPendingCount:
|
|
1687
|
+
textKind: m,
|
|
1688
|
+
textValue: g,
|
|
1689
|
+
pendingChanges: b,
|
|
1690
|
+
pendingByElement: L,
|
|
1691
|
+
totalPendingCount: N,
|
|
1692
1692
|
clearAllPending: w,
|
|
1693
|
-
canUndo:
|
|
1694
|
-
updateProperty:
|
|
1693
|
+
canUndo: k,
|
|
1694
|
+
updateProperty: $,
|
|
1695
1695
|
updateText: P,
|
|
1696
|
-
undo:
|
|
1697
|
-
reset:
|
|
1696
|
+
undo: R,
|
|
1697
|
+
reset: x,
|
|
1698
1698
|
clearPreviews: I,
|
|
1699
1699
|
revertPreviews: C
|
|
1700
|
-
} =
|
|
1701
|
-
computeDefaultPosition: (
|
|
1702
|
-
x: window.innerWidth -
|
|
1700
|
+
} = jn(e, a, o), { elementRef: h, isDragging: O, style: U, dragHandleProps: ge } = Rt({
|
|
1701
|
+
computeDefaultPosition: (T) => ({
|
|
1702
|
+
x: window.innerWidth - T.width - 16,
|
|
1703
1703
|
y: 16
|
|
1704
1704
|
})
|
|
1705
1705
|
});
|
|
1706
|
-
H(() => (
|
|
1707
|
-
const
|
|
1708
|
-
(
|
|
1709
|
-
if (
|
|
1710
|
-
const X = document.elementsFromPoint(
|
|
1706
|
+
H(() => (p == null || p({ clearPreviews: I, revertPreviews: C }), () => p == null ? void 0 : p(null)), [p, I, C]);
|
|
1707
|
+
const j = E(
|
|
1708
|
+
(T) => {
|
|
1709
|
+
if (f(T.target)) return;
|
|
1710
|
+
const X = document.elementsFromPoint(T.clientX, T.clientY).find(
|
|
1711
1711
|
(q) => q instanceof Element && !q.closest(
|
|
1712
1712
|
"[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]"
|
|
1713
1713
|
)
|
|
1714
1714
|
);
|
|
1715
1715
|
r(X ?? null);
|
|
1716
1716
|
},
|
|
1717
|
-
[
|
|
1718
|
-
),
|
|
1719
|
-
(
|
|
1720
|
-
if (
|
|
1721
|
-
|
|
1722
|
-
const X = document.elementsFromPoint(
|
|
1717
|
+
[f, r]
|
|
1718
|
+
), oe = E(
|
|
1719
|
+
(T) => {
|
|
1720
|
+
if (f(T.target)) return;
|
|
1721
|
+
T.preventDefault(), T.stopPropagation();
|
|
1722
|
+
const X = document.elementsFromPoint(T.clientX, T.clientY).find(
|
|
1723
1723
|
(q) => q instanceof Element && !q.closest(
|
|
1724
1724
|
"[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]"
|
|
1725
1725
|
)
|
|
1726
1726
|
);
|
|
1727
1727
|
i(X ?? null);
|
|
1728
1728
|
},
|
|
1729
|
-
[
|
|
1729
|
+
[f, i]
|
|
1730
1730
|
);
|
|
1731
|
-
H(() => (document.addEventListener("mousemove",
|
|
1732
|
-
document.removeEventListener("mousemove",
|
|
1733
|
-
}), [
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1731
|
+
H(() => (document.addEventListener("mousemove", j, !0), document.addEventListener("click", oe, !0), () => {
|
|
1732
|
+
document.removeEventListener("mousemove", j, !0), document.removeEventListener("click", oe, !0);
|
|
1733
|
+
}), [j, oe]);
|
|
1734
|
+
const re = async () => {
|
|
1735
|
+
if (N === 0) return;
|
|
1736
|
+
const T = await u(L);
|
|
1737
|
+
T.applied && (w(), T.skipRevert || C());
|
|
1738
|
+
}, W = e ? Ge(e) : null, G = e ? kt(e) : null, ee = e ? Ct(e) : 0, M = e ? Mt(e, "all-instances") : "", F = 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, z = xe(() => !e || a !== "all-instances" ? [] : $e(e, "all-instances"), [e, a]);
|
|
1739
|
+
return /* @__PURE__ */ d(K, { children: [
|
|
1738
1740
|
/* @__PURE__ */ n(
|
|
1739
|
-
|
|
1741
|
+
$t,
|
|
1740
1742
|
{
|
|
1741
1743
|
element: a === "all-instances" ? null : t,
|
|
1742
1744
|
selected: e,
|
|
1743
|
-
multiSelected:
|
|
1745
|
+
multiSelected: z,
|
|
1744
1746
|
primarySelected: e
|
|
1745
1747
|
}
|
|
1746
1748
|
),
|
|
@@ -1748,8 +1750,8 @@ function Xn({
|
|
|
1748
1750
|
"div",
|
|
1749
1751
|
{
|
|
1750
1752
|
ref: h,
|
|
1751
|
-
className: `pa-edit-panel-float ${
|
|
1752
|
-
style:
|
|
1753
|
+
className: `pa-edit-panel-float ${O ? "pa-edit-panel-float--dragging" : ""}`,
|
|
1754
|
+
style: U,
|
|
1753
1755
|
children: /* @__PURE__ */ n(Te, { variant: "sheet", side: "right", className: "pa-edit-panel-glass", children: /* @__PURE__ */ d("div", { className: "pa-edit-panel-inner", children: [
|
|
1754
1756
|
/* @__PURE__ */ d("div", { className: "pa-edit-panel-header", children: [
|
|
1755
1757
|
/* @__PURE__ */ n(
|
|
@@ -1759,7 +1761,7 @@ function Xn({
|
|
|
1759
1761
|
className: "pa-edit-panel-drag",
|
|
1760
1762
|
"aria-label": "Drag edit panel",
|
|
1761
1763
|
title: "Drag to move",
|
|
1762
|
-
...
|
|
1764
|
+
...ge,
|
|
1763
1765
|
children: /* @__PURE__ */ d("span", { className: "pa-edit-panel-grip", "aria-hidden": "true", children: [
|
|
1764
1766
|
/* @__PURE__ */ n("span", {}),
|
|
1765
1767
|
/* @__PURE__ */ n("span", {}),
|
|
@@ -1772,57 +1774,57 @@ function Xn({
|
|
|
1772
1774
|
),
|
|
1773
1775
|
/* @__PURE__ */ n("h3", { className: "pa-edit-title", children: "Edit" })
|
|
1774
1776
|
] }),
|
|
1775
|
-
e ? /* @__PURE__ */ d(
|
|
1777
|
+
e ? /* @__PURE__ */ d(K, { children: [
|
|
1776
1778
|
/* @__PURE__ */ d("div", { className: "pa-edit-meta", children: [
|
|
1777
1779
|
/* @__PURE__ */ n(
|
|
1778
1780
|
"code",
|
|
1779
1781
|
{
|
|
1780
1782
|
className: "pa-edit-meta-label",
|
|
1781
|
-
title: `This instance: ${
|
|
1783
|
+
title: `This instance: ${At(e)}
|
|
1782
1784
|
All instances: ${M}`,
|
|
1783
|
-
children:
|
|
1785
|
+
children: Xe(e)
|
|
1784
1786
|
}
|
|
1785
1787
|
),
|
|
1786
|
-
((
|
|
1787
|
-
(
|
|
1788
|
-
|
|
1789
|
-
|
|
1788
|
+
((W == null ? void 0 : W.sourceFile) || G) && /* @__PURE__ */ d("span", { className: "pa-edit-source", children: [
|
|
1789
|
+
(W == null ? void 0 : W.sourceFile) && /* @__PURE__ */ d(K, { children: [
|
|
1790
|
+
W.sourceFile,
|
|
1791
|
+
W.lineNumber ? `:${W.lineNumber}` : ""
|
|
1790
1792
|
] }),
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
+
W != null && W.sourceFile && G ? " · " : "",
|
|
1794
|
+
G ?? ""
|
|
1793
1795
|
] })
|
|
1794
1796
|
] }),
|
|
1795
1797
|
/* @__PURE__ */ n("div", { className: "pa-edit-panel-scroll", children: /* @__PURE__ */ n(
|
|
1796
|
-
|
|
1798
|
+
Gn,
|
|
1797
1799
|
{
|
|
1798
1800
|
values: v,
|
|
1799
|
-
onPropertyChange:
|
|
1800
|
-
textKind:
|
|
1801
|
-
textValue:
|
|
1801
|
+
onPropertyChange: $,
|
|
1802
|
+
textKind: m,
|
|
1803
|
+
textValue: g,
|
|
1802
1804
|
onTextChange: P,
|
|
1803
1805
|
targetScope: a,
|
|
1804
|
-
onTargetScopeChange:
|
|
1805
|
-
elementState:
|
|
1806
|
-
onElementStateChange:
|
|
1807
|
-
instanceCount:
|
|
1808
|
-
scopeHint:
|
|
1809
|
-
stateHint:
|
|
1806
|
+
onTargetScopeChange: s,
|
|
1807
|
+
elementState: o,
|
|
1808
|
+
onElementStateChange: c,
|
|
1809
|
+
instanceCount: ee,
|
|
1810
|
+
scopeHint: D,
|
|
1811
|
+
stateHint: F
|
|
1810
1812
|
}
|
|
1811
1813
|
) }),
|
|
1812
1814
|
/* @__PURE__ */ d("div", { className: "pa-edit-panel-sticky", children: [
|
|
1813
1815
|
/* @__PURE__ */ d("div", { className: "pa-edit-actions", children: [
|
|
1814
|
-
/* @__PURE__ */ n(V, { variant: "regular", onClick:
|
|
1815
|
-
/* @__PURE__ */ n(
|
|
1816
|
+
/* @__PURE__ */ n(V, { variant: "regular", onClick: R, disabled: !k, children: /* @__PURE__ */ d("span", { className: "pa-glass-btn-inner", children: [
|
|
1817
|
+
/* @__PURE__ */ n(mn, { className: "pa-glass-btn-icon" }),
|
|
1816
1818
|
/* @__PURE__ */ n("span", { children: "Undo" })
|
|
1817
1819
|
] }) }),
|
|
1818
1820
|
/* @__PURE__ */ n(
|
|
1819
1821
|
V,
|
|
1820
1822
|
{
|
|
1821
1823
|
variant: "regular",
|
|
1822
|
-
onClick:
|
|
1823
|
-
disabled:
|
|
1824
|
+
onClick: x,
|
|
1825
|
+
disabled: b.length === 0,
|
|
1824
1826
|
children: /* @__PURE__ */ d("span", { className: "pa-glass-btn-inner", children: [
|
|
1825
|
-
/* @__PURE__ */ n(
|
|
1827
|
+
/* @__PURE__ */ n(gn, { className: "pa-glass-btn-icon" }),
|
|
1826
1828
|
/* @__PURE__ */ n("span", { children: "Reset" })
|
|
1827
1829
|
] })
|
|
1828
1830
|
}
|
|
@@ -1833,16 +1835,16 @@ All instances: ${M}`,
|
|
|
1833
1835
|
"span",
|
|
1834
1836
|
{
|
|
1835
1837
|
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 ?? `${
|
|
1838
|
+
children: l ?? `${N} pending change${N !== 1 ? "s" : ""}`
|
|
1837
1839
|
}
|
|
1838
1840
|
),
|
|
1839
1841
|
/* @__PURE__ */ n(
|
|
1840
1842
|
V,
|
|
1841
1843
|
{
|
|
1842
1844
|
variant: "glass-primary",
|
|
1843
|
-
onClick:
|
|
1844
|
-
disabled:
|
|
1845
|
-
title:
|
|
1845
|
+
onClick: re,
|
|
1846
|
+
disabled: N === 0,
|
|
1847
|
+
title: W != null && W.sourceFile ? void 0 : "No source file — Apply copies selector + changes to clipboard",
|
|
1846
1848
|
children: "Apply"
|
|
1847
1849
|
}
|
|
1848
1850
|
)
|
|
@@ -1854,7 +1856,7 @@ All instances: ${M}`,
|
|
|
1854
1856
|
)
|
|
1855
1857
|
] });
|
|
1856
1858
|
}
|
|
1857
|
-
async function
|
|
1859
|
+
async function Jn(e, t = {}) {
|
|
1858
1860
|
if (t.onApply)
|
|
1859
1861
|
try {
|
|
1860
1862
|
const r = await t.onApply(e);
|
|
@@ -1874,10 +1876,10 @@ async function Gn(e, t = {}) {
|
|
|
1874
1876
|
} catch (r) {
|
|
1875
1877
|
return { mode: "error", message: r instanceof Error ? r.message : String(r) };
|
|
1876
1878
|
}
|
|
1877
|
-
return await
|
|
1879
|
+
return await St(JSON.stringify(e, null, 2)), { mode: "clipboard" };
|
|
1878
1880
|
}
|
|
1879
|
-
function
|
|
1880
|
-
const [t, i] =
|
|
1881
|
+
function Zn(e) {
|
|
1882
|
+
const [t, i] = S(null);
|
|
1881
1883
|
return H(() => {
|
|
1882
1884
|
if (!e) {
|
|
1883
1885
|
i(null);
|
|
@@ -1891,8 +1893,8 @@ function Kn(e) {
|
|
|
1891
1893
|
};
|
|
1892
1894
|
}, [e]), t;
|
|
1893
1895
|
}
|
|
1894
|
-
const
|
|
1895
|
-
function
|
|
1896
|
+
const ae = 8, Q = 8, Qn = 12, er = 300, tr = 280;
|
|
1897
|
+
function He(e, t, i, r) {
|
|
1896
1898
|
return {
|
|
1897
1899
|
top: e,
|
|
1898
1900
|
left: t,
|
|
@@ -1902,10 +1904,10 @@ function ze(e, t, i, r) {
|
|
|
1902
1904
|
height: r
|
|
1903
1905
|
};
|
|
1904
1906
|
}
|
|
1905
|
-
function
|
|
1907
|
+
function Ye(e, t) {
|
|
1906
1908
|
return e.left < t.right && e.right > t.left && e.top < t.bottom && e.bottom > t.top;
|
|
1907
1909
|
}
|
|
1908
|
-
function
|
|
1910
|
+
function nr(e, t) {
|
|
1909
1911
|
return {
|
|
1910
1912
|
top: e.top - t,
|
|
1911
1913
|
left: e.left - t,
|
|
@@ -1915,105 +1917,105 @@ function Zn(e, t) {
|
|
|
1915
1917
|
height: e.height + t * 2
|
|
1916
1918
|
};
|
|
1917
1919
|
}
|
|
1918
|
-
function
|
|
1920
|
+
function rr() {
|
|
1919
1921
|
if (typeof document > "u") return null;
|
|
1920
1922
|
const e = document.querySelector(
|
|
1921
1923
|
"[data-pixelagent-toolbar-portal] .pa-toolbar-float"
|
|
1922
1924
|
);
|
|
1923
|
-
return e ?
|
|
1925
|
+
return e ? nr(e.getBoundingClientRect(), Qn) : null;
|
|
1924
1926
|
}
|
|
1925
|
-
function
|
|
1927
|
+
function Ve(e, t) {
|
|
1926
1928
|
return Math.min(
|
|
1927
|
-
Math.max(
|
|
1928
|
-
window.innerWidth - t -
|
|
1929
|
+
Math.max(ae, e),
|
|
1930
|
+
window.innerWidth - t - ae
|
|
1929
1931
|
);
|
|
1930
1932
|
}
|
|
1931
|
-
function
|
|
1933
|
+
function Le(e, t) {
|
|
1932
1934
|
return Math.min(
|
|
1933
|
-
Math.max(
|
|
1934
|
-
window.innerHeight - t -
|
|
1935
|
+
Math.max(ae, e),
|
|
1936
|
+
window.innerHeight - t - ae
|
|
1935
1937
|
);
|
|
1936
1938
|
}
|
|
1937
|
-
function
|
|
1938
|
-
return e.top >=
|
|
1939
|
+
function ir(e) {
|
|
1940
|
+
return e.top >= ae && e.left >= ae && e.right <= window.innerWidth - ae && e.bottom <= window.innerHeight - ae;
|
|
1939
1941
|
}
|
|
1940
|
-
function
|
|
1941
|
-
return t &&
|
|
1942
|
+
function ar(e, t) {
|
|
1943
|
+
return t && Ye(e, t) ? !1 : ir(e);
|
|
1942
1944
|
}
|
|
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 -
|
|
1945
|
+
function or(e, t = er, i = tr) {
|
|
1946
|
+
const r = rr(), s = e.top > window.innerHeight * 0.45 ? [
|
|
1947
|
+
{ placement: "above", top: e.top - i - Q, left: e.left },
|
|
1948
|
+
{ placement: "below", top: e.bottom + Q, left: e.left },
|
|
1949
|
+
{ placement: "right", top: e.top, left: e.right + Q },
|
|
1950
|
+
{ placement: "left", top: e.top, left: e.left - t - Q }
|
|
1949
1951
|
] : [
|
|
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 -
|
|
1952
|
+
{ placement: "below", top: e.bottom + Q, left: e.left },
|
|
1953
|
+
{ placement: "above", top: e.top - i - Q, left: e.left },
|
|
1954
|
+
{ placement: "right", top: e.top, left: e.right + Q },
|
|
1955
|
+
{ placement: "left", top: e.top, left: e.left - t - Q }
|
|
1954
1956
|
];
|
|
1955
|
-
for (const { top:
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
-
|
|
1957
|
+
for (const { top: u, left: l } of s) {
|
|
1958
|
+
const f = He(
|
|
1959
|
+
Le(u, i),
|
|
1960
|
+
Ve(l, t),
|
|
1959
1961
|
t,
|
|
1960
1962
|
i
|
|
1961
1963
|
);
|
|
1962
|
-
if (
|
|
1963
|
-
return { top:
|
|
1964
|
+
if (ar(f, r))
|
|
1965
|
+
return { top: f.top, left: f.left };
|
|
1964
1966
|
}
|
|
1965
|
-
let
|
|
1967
|
+
let o = Le(e.top - i - Q, i), c = Ve(e.left, t);
|
|
1966
1968
|
if (r) {
|
|
1967
|
-
let
|
|
1968
|
-
|
|
1969
|
-
Math.min(e.left, r.left - t -
|
|
1969
|
+
let u = He(o, c, t, i);
|
|
1970
|
+
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(
|
|
1971
|
+
Math.min(e.left, r.left - t - Q),
|
|
1970
1972
|
t
|
|
1971
1973
|
));
|
|
1972
1974
|
}
|
|
1973
|
-
return { top:
|
|
1975
|
+
return { top: o, left: c };
|
|
1974
1976
|
}
|
|
1975
|
-
function
|
|
1977
|
+
function sr({
|
|
1976
1978
|
elements: e,
|
|
1977
1979
|
areaBbox: t,
|
|
1978
1980
|
onSubmit: i,
|
|
1979
1981
|
onCancel: r
|
|
1980
1982
|
}) {
|
|
1981
|
-
const [a,
|
|
1983
|
+
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;
|
|
1982
1984
|
if (H(() => {
|
|
1983
1985
|
var w;
|
|
1984
|
-
(w =
|
|
1986
|
+
(w = o.current) == null || w.focus();
|
|
1985
1987
|
}, [e]), H(() => {
|
|
1986
|
-
const w = (
|
|
1987
|
-
|
|
1988
|
+
const w = (k) => {
|
|
1989
|
+
k.key === "Escape" && r();
|
|
1988
1990
|
};
|
|
1989
1991
|
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
1990
|
-
}, [r]), !
|
|
1991
|
-
const
|
|
1992
|
+
}, [r]), !p) return null;
|
|
1993
|
+
const b = or(p), L = e.length > 1 ? `${e.length} selected` : u ? Xe(u) : "Area selection", N = (w) => {
|
|
1992
1994
|
a.trim() && i(a, w);
|
|
1993
1995
|
};
|
|
1994
1996
|
return /* @__PURE__ */ n(
|
|
1995
1997
|
Te,
|
|
1996
1998
|
{
|
|
1997
1999
|
variant: "popover",
|
|
1998
|
-
style: { top:
|
|
2000
|
+
style: { top: b.top, left: b.left },
|
|
1999
2001
|
children: /* @__PURE__ */ d(
|
|
2000
2002
|
"div",
|
|
2001
2003
|
{
|
|
2002
|
-
ref:
|
|
2004
|
+
ref: c,
|
|
2003
2005
|
role: "dialog",
|
|
2004
2006
|
"aria-modal": "true",
|
|
2005
2007
|
"aria-label": "Add annotation",
|
|
2006
2008
|
className: "pa-popover-body",
|
|
2007
2009
|
children: [
|
|
2008
|
-
/* @__PURE__ */ n("div", { className: "pa-popover-header", children: /* @__PURE__ */ n("span", { className: "pa-popover-selector", children:
|
|
2009
|
-
(v ||
|
|
2010
|
+
/* @__PURE__ */ n("div", { className: "pa-popover-header", children: /* @__PURE__ */ n("span", { className: "pa-popover-selector", children: L }) }),
|
|
2011
|
+
(v || g) && /* @__PURE__ */ d("div", { className: "pa-popover-context", children: [
|
|
2010
2012
|
v && /* @__PURE__ */ d("p", { className: "pa-popover-context-line", children: [
|
|
2011
2013
|
/* @__PURE__ */ n("span", { className: "pa-popover-context-label", children: "Selected" }),
|
|
2012
2014
|
v
|
|
2013
2015
|
] }),
|
|
2014
|
-
|
|
2016
|
+
g && g !== v && /* @__PURE__ */ d("p", { className: "pa-popover-context-line", children: [
|
|
2015
2017
|
/* @__PURE__ */ n("span", { className: "pa-popover-context-label", children: "Element" }),
|
|
2016
|
-
|
|
2018
|
+
g
|
|
2017
2019
|
] })
|
|
2018
2020
|
] }),
|
|
2019
2021
|
/* @__PURE__ */ d("label", { className: "pa-label", children: [
|
|
@@ -2021,14 +2023,14 @@ function rr({
|
|
|
2021
2023
|
/* @__PURE__ */ n(
|
|
2022
2024
|
"textarea",
|
|
2023
2025
|
{
|
|
2024
|
-
ref:
|
|
2026
|
+
ref: o,
|
|
2025
2027
|
className: "pa-textarea",
|
|
2026
2028
|
value: a,
|
|
2027
|
-
onChange: (w) =>
|
|
2029
|
+
onChange: (w) => s(w.target.value),
|
|
2028
2030
|
placeholder: "Describe the change...",
|
|
2029
2031
|
rows: 3,
|
|
2030
2032
|
onKeyDown: (w) => {
|
|
2031
|
-
w.key === "Enter" && (w.metaKey || w.ctrlKey) && (w.preventDefault(),
|
|
2033
|
+
w.key === "Enter" && (w.metaKey || w.ctrlKey) && (w.preventDefault(), N(w.shiftKey)), w.key === "Escape" && r();
|
|
2032
2034
|
}
|
|
2033
2035
|
}
|
|
2034
2036
|
)
|
|
@@ -2040,7 +2042,7 @@ function rr({
|
|
|
2040
2042
|
V,
|
|
2041
2043
|
{
|
|
2042
2044
|
variant: "ghost",
|
|
2043
|
-
onClick: () =>
|
|
2045
|
+
onClick: () => N(!0),
|
|
2044
2046
|
disabled: !a.trim(),
|
|
2045
2047
|
children: "Add & next"
|
|
2046
2048
|
}
|
|
@@ -2049,7 +2051,7 @@ function rr({
|
|
|
2049
2051
|
V,
|
|
2050
2052
|
{
|
|
2051
2053
|
variant: "glass-primary",
|
|
2052
|
-
onClick: () =>
|
|
2054
|
+
onClick: () => N(!1),
|
|
2053
2055
|
disabled: !a.trim(),
|
|
2054
2056
|
children: "Add"
|
|
2055
2057
|
}
|
|
@@ -2061,7 +2063,7 @@ function rr({
|
|
|
2061
2063
|
}
|
|
2062
2064
|
);
|
|
2063
2065
|
}
|
|
2064
|
-
function
|
|
2066
|
+
function lr({ area: e, isDragging: t }) {
|
|
2065
2067
|
return !e || e.width < 2 || e.height < 2 ? null : /* @__PURE__ */ n(
|
|
2066
2068
|
"div",
|
|
2067
2069
|
{
|
|
@@ -2076,7 +2078,7 @@ function ir({ area: e, isDragging: t }) {
|
|
|
2076
2078
|
}
|
|
2077
2079
|
);
|
|
2078
2080
|
}
|
|
2079
|
-
function
|
|
2081
|
+
function cr(e) {
|
|
2080
2082
|
const { elements: t, note: i, areaBbox: r } = e, a = t[0];
|
|
2081
2083
|
if (!a && r)
|
|
2082
2084
|
return {
|
|
@@ -2095,39 +2097,39 @@ function ar(e) {
|
|
|
2095
2097
|
};
|
|
2096
2098
|
if (!a)
|
|
2097
2099
|
throw new Error("buildAnnotationEntry requires at least one element or areaBbox");
|
|
2098
|
-
const
|
|
2100
|
+
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
2101
|
return {
|
|
2100
2102
|
id: crypto.randomUUID(),
|
|
2101
|
-
selector:
|
|
2102
|
-
selectors:
|
|
2103
|
+
selector: f[0],
|
|
2104
|
+
selectors: f.length > 1 ? f : void 0,
|
|
2103
2105
|
note: i.trim(),
|
|
2104
|
-
position: { x: Math.round(
|
|
2106
|
+
position: { x: Math.round(s.x), y: Math.round(s.y) },
|
|
2105
2107
|
bbox: {
|
|
2106
|
-
x: Math.round(
|
|
2107
|
-
y: Math.round(
|
|
2108
|
-
width: Math.round(
|
|
2109
|
-
height: Math.round(
|
|
2108
|
+
x: Math.round(s.x),
|
|
2109
|
+
y: Math.round(s.y),
|
|
2110
|
+
width: Math.round(s.width),
|
|
2111
|
+
height: Math.round(s.height)
|
|
2110
2112
|
},
|
|
2111
2113
|
areaBbox: r,
|
|
2112
|
-
domPath:
|
|
2113
|
-
selectedText:
|
|
2114
|
+
domPath: Jt(a),
|
|
2115
|
+
selectedText: c,
|
|
2114
2116
|
elementText: l,
|
|
2115
|
-
sourceFile:
|
|
2116
|
-
lineNumber:
|
|
2117
|
-
componentName:
|
|
2117
|
+
sourceFile: o.sourceFile,
|
|
2118
|
+
lineNumber: o.lineNumber,
|
|
2119
|
+
componentName: qt(a) ?? o.componentName,
|
|
2118
2120
|
createdAt: Date.now()
|
|
2119
2121
|
};
|
|
2120
2122
|
}
|
|
2121
|
-
function
|
|
2122
|
-
const t =
|
|
2123
|
+
function dr(e) {
|
|
2124
|
+
const t = Et(e);
|
|
2123
2125
|
if (t) return t.getBoundingClientRect();
|
|
2124
2126
|
if (e.bbox) {
|
|
2125
|
-
const { x: i, y: r, width: a, height:
|
|
2126
|
-
return new DOMRect(i, r, a,
|
|
2127
|
+
const { x: i, y: r, width: a, height: s } = e.bbox;
|
|
2128
|
+
return new DOMRect(i, r, a, s);
|
|
2127
2129
|
}
|
|
2128
2130
|
if (e.areaBbox) {
|
|
2129
|
-
const { x: i, y: r, width: a, height:
|
|
2130
|
-
return new DOMRect(i, r, a,
|
|
2131
|
+
const { x: i, y: r, width: a, height: s } = e.areaBbox;
|
|
2132
|
+
return new DOMRect(i, r, a, s);
|
|
2131
2133
|
}
|
|
2132
2134
|
if (e.position) {
|
|
2133
2135
|
const { x: i, y: r } = e.position;
|
|
@@ -2135,46 +2137,46 @@ function or(e) {
|
|
|
2135
2137
|
}
|
|
2136
2138
|
return null;
|
|
2137
2139
|
}
|
|
2138
|
-
function
|
|
2140
|
+
function ur(e) {
|
|
2139
2141
|
return `${Math.round(e.top)}:${Math.round(e.left)}:${Math.round(e.width)}:${Math.round(e.height)}`;
|
|
2140
2142
|
}
|
|
2141
|
-
const
|
|
2142
|
-
function
|
|
2143
|
-
const [t, i] =
|
|
2143
|
+
const pr = 20;
|
|
2144
|
+
function hr({ annotations: e }) {
|
|
2145
|
+
const [t, i] = S([]);
|
|
2144
2146
|
return H(() => {
|
|
2145
2147
|
if (e.length === 0) {
|
|
2146
2148
|
i([]);
|
|
2147
2149
|
return;
|
|
2148
2150
|
}
|
|
2149
2151
|
const r = /* @__PURE__ */ new Map(), a = () => {
|
|
2150
|
-
const
|
|
2151
|
-
e.forEach((
|
|
2152
|
-
const
|
|
2153
|
-
if (!
|
|
2154
|
-
const
|
|
2155
|
-
r.set(
|
|
2156
|
-
id:
|
|
2152
|
+
const c = [];
|
|
2153
|
+
e.forEach((u, l) => {
|
|
2154
|
+
const f = dr(u);
|
|
2155
|
+
if (!f) return;
|
|
2156
|
+
const p = ur(f), v = r.get(p) ?? 0;
|
|
2157
|
+
r.set(p, v + 1), c.push({
|
|
2158
|
+
id: u.id,
|
|
2157
2159
|
index: l + 1,
|
|
2158
|
-
top:
|
|
2159
|
-
left:
|
|
2160
|
+
top: f.top - 6 - v * pr,
|
|
2161
|
+
left: f.right - 6
|
|
2160
2162
|
});
|
|
2161
|
-
}), i(
|
|
2163
|
+
}), i(c);
|
|
2162
2164
|
};
|
|
2163
2165
|
a();
|
|
2164
|
-
const
|
|
2165
|
-
for (const
|
|
2166
|
-
const
|
|
2167
|
-
|
|
2166
|
+
const s = /* @__PURE__ */ new Set();
|
|
2167
|
+
for (const c of e) {
|
|
2168
|
+
const u = Et(c);
|
|
2169
|
+
u && s.add(u);
|
|
2168
2170
|
}
|
|
2169
|
-
const
|
|
2170
|
-
const
|
|
2171
|
-
return
|
|
2171
|
+
const o = Array.from(s).map((c) => {
|
|
2172
|
+
const u = new ResizeObserver(a);
|
|
2173
|
+
return u.observe(c), u;
|
|
2172
2174
|
});
|
|
2173
2175
|
return window.addEventListener("scroll", a, !0), window.addEventListener("resize", a), () => {
|
|
2174
|
-
for (const
|
|
2176
|
+
for (const c of o) c.disconnect();
|
|
2175
2177
|
window.removeEventListener("scroll", a, !0), window.removeEventListener("resize", a);
|
|
2176
2178
|
};
|
|
2177
|
-
}, [e]), t.length === 0 ? null : /* @__PURE__ */ n(
|
|
2179
|
+
}, [e]), t.length === 0 ? null : /* @__PURE__ */ n(K, { children: t.map((r) => /* @__PURE__ */ n(
|
|
2178
2180
|
"span",
|
|
2179
2181
|
{
|
|
2180
2182
|
className: "pa-annotation-badge",
|
|
@@ -2185,24 +2187,24 @@ function cr({ annotations: e }) {
|
|
|
2185
2187
|
r.id
|
|
2186
2188
|
)) });
|
|
2187
2189
|
}
|
|
2188
|
-
const
|
|
2189
|
-
function
|
|
2190
|
-
return e instanceof Element ? !!e.closest(
|
|
2190
|
+
const Ze = "[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]";
|
|
2191
|
+
function Ee(e) {
|
|
2192
|
+
return e instanceof Element ? !!e.closest(Ze) : !1;
|
|
2191
2193
|
}
|
|
2192
|
-
function
|
|
2194
|
+
function vt(e, t) {
|
|
2193
2195
|
return document.elementsFromPoint(e, t).find(
|
|
2194
|
-
(r) => r instanceof Element && !r.closest(
|
|
2196
|
+
(r) => r instanceof Element && !r.closest(Ze)
|
|
2195
2197
|
) ?? null;
|
|
2196
2198
|
}
|
|
2197
|
-
function
|
|
2199
|
+
function _t(e) {
|
|
2198
2200
|
return e ? e === "Copied all!" || e.startsWith("Copy failed") : !1;
|
|
2199
2201
|
}
|
|
2200
|
-
function
|
|
2202
|
+
function Ht({
|
|
2201
2203
|
feedback: e,
|
|
2202
2204
|
slotClassName: t,
|
|
2203
2205
|
children: i
|
|
2204
2206
|
}) {
|
|
2205
|
-
return e &&
|
|
2207
|
+
return e && _t(e) ? /* @__PURE__ */ n(
|
|
2206
2208
|
"span",
|
|
2207
2209
|
{
|
|
2208
2210
|
className: `pa-status pa-copy-feedback-slot ${t}`,
|
|
@@ -2210,32 +2212,32 @@ function Ot({
|
|
|
2210
2212
|
"aria-live": "polite",
|
|
2211
2213
|
children: e
|
|
2212
2214
|
}
|
|
2213
|
-
) : /* @__PURE__ */ n(
|
|
2215
|
+
) : /* @__PURE__ */ n(K, { children: i });
|
|
2214
2216
|
}
|
|
2215
|
-
function
|
|
2217
|
+
function fr({
|
|
2216
2218
|
annotations: e,
|
|
2217
2219
|
collapsed: t,
|
|
2218
2220
|
onToggleCollapsed: i,
|
|
2219
2221
|
onClose: r,
|
|
2220
2222
|
onCopyAll: a,
|
|
2221
|
-
onCopyOne:
|
|
2222
|
-
onRemove:
|
|
2223
|
-
onUpdate:
|
|
2224
|
-
copyStatus:
|
|
2223
|
+
onCopyOne: s,
|
|
2224
|
+
onRemove: o,
|
|
2225
|
+
onUpdate: c,
|
|
2226
|
+
copyStatus: u,
|
|
2225
2227
|
copiedEntryId: l,
|
|
2226
|
-
copyAllFrom:
|
|
2228
|
+
copyAllFrom: f
|
|
2227
2229
|
}) {
|
|
2228
|
-
const [
|
|
2230
|
+
const [p, v] = S(null), [m, g] = S("");
|
|
2229
2231
|
H(() => {
|
|
2230
|
-
const
|
|
2232
|
+
const N = (w) => {
|
|
2231
2233
|
w.key === "Escape" && (t ? r() : i());
|
|
2232
2234
|
};
|
|
2233
|
-
return document.addEventListener("keydown",
|
|
2235
|
+
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
2234
2236
|
}, [t, r, i]);
|
|
2235
|
-
const
|
|
2236
|
-
v(
|
|
2237
|
-
},
|
|
2238
|
-
|
|
2237
|
+
const b = (N) => {
|
|
2238
|
+
v(N.id), g(N.note);
|
|
2239
|
+
}, L = (N) => {
|
|
2240
|
+
m.trim() && (c(N, { note: m.trim() }), v(null));
|
|
2239
2241
|
};
|
|
2240
2242
|
return /* @__PURE__ */ d(
|
|
2241
2243
|
Te,
|
|
@@ -2266,9 +2268,9 @@ function dr({
|
|
|
2266
2268
|
!t && /* @__PURE__ */ n("p", { className: "pa-session-subtitle", children: "Persists until tab close" }),
|
|
2267
2269
|
/* @__PURE__ */ d("div", { className: "pa-session-actions", children: [
|
|
2268
2270
|
/* @__PURE__ */ n(
|
|
2269
|
-
|
|
2271
|
+
Ht,
|
|
2270
2272
|
{
|
|
2271
|
-
feedback:
|
|
2273
|
+
feedback: f === "session" ? u : null,
|
|
2272
2274
|
slotClassName: "pa-copy-feedback-slot--session",
|
|
2273
2275
|
children: /* @__PURE__ */ n(
|
|
2274
2276
|
V,
|
|
@@ -2287,17 +2289,17 @@ function dr({
|
|
|
2287
2289
|
] }),
|
|
2288
2290
|
!t && /* @__PURE__ */ d("ul", { className: "pa-session-list", children: [
|
|
2289
2291
|
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:
|
|
2292
|
+
e.map((N) => {
|
|
2293
|
+
const w = Zt(N);
|
|
2294
|
+
return /* @__PURE__ */ n("li", { className: "pa-session-item", children: p === N.id ? /* @__PURE__ */ d("div", { className: "pa-session-edit", children: [
|
|
2293
2295
|
/* @__PURE__ */ d("label", { className: "pa-label", children: [
|
|
2294
2296
|
"Note",
|
|
2295
2297
|
/* @__PURE__ */ n(
|
|
2296
2298
|
"textarea",
|
|
2297
2299
|
{
|
|
2298
2300
|
className: "pa-textarea",
|
|
2299
|
-
value:
|
|
2300
|
-
onChange: (
|
|
2301
|
+
value: m,
|
|
2302
|
+
onChange: (k) => g(k.target.value),
|
|
2301
2303
|
rows: 3
|
|
2302
2304
|
}
|
|
2303
2305
|
)
|
|
@@ -2308,20 +2310,20 @@ function dr({
|
|
|
2308
2310
|
V,
|
|
2309
2311
|
{
|
|
2310
2312
|
variant: "glass-primary",
|
|
2311
|
-
onClick: () =>
|
|
2312
|
-
disabled: !
|
|
2313
|
+
onClick: () => L(N.id),
|
|
2314
|
+
disabled: !m.trim(),
|
|
2313
2315
|
children: "Save"
|
|
2314
2316
|
}
|
|
2315
2317
|
)
|
|
2316
2318
|
] })
|
|
2317
|
-
] }) : /* @__PURE__ */ d(
|
|
2319
|
+
] }) : /* @__PURE__ */ d(K, { children: [
|
|
2318
2320
|
/* @__PURE__ */ d("div", { className: "pa-session-content", children: [
|
|
2319
2321
|
/* @__PURE__ */ n("span", { className: "pa-session-target", children: w.target }),
|
|
2320
2322
|
/* @__PURE__ */ n("p", { className: "pa-session-note", children: w.note }),
|
|
2321
2323
|
w.meta && /* @__PURE__ */ n("p", { className: "pa-session-meta-line", children: w.meta })
|
|
2322
2324
|
] }),
|
|
2323
2325
|
/* @__PURE__ */ d("div", { className: "pa-session-item-actions", children: [
|
|
2324
|
-
|
|
2326
|
+
u === "Copied!" && l === N.id ? /* @__PURE__ */ n(
|
|
2325
2327
|
"span",
|
|
2326
2328
|
{
|
|
2327
2329
|
className: "pa-status pa-copy-feedback-slot pa-copy-feedback-slot--item",
|
|
@@ -2334,7 +2336,7 @@ function dr({
|
|
|
2334
2336
|
{
|
|
2335
2337
|
variant: "glass-primary",
|
|
2336
2338
|
className: "pa-glass-btn--sm",
|
|
2337
|
-
onClick: () =>
|
|
2339
|
+
onClick: () => s(N.id),
|
|
2338
2340
|
"aria-label": "Copy annotation",
|
|
2339
2341
|
children: "Copy"
|
|
2340
2342
|
}
|
|
@@ -2344,7 +2346,7 @@ function dr({
|
|
|
2344
2346
|
{
|
|
2345
2347
|
variant: "ghost",
|
|
2346
2348
|
className: "pa-glass-btn--sm",
|
|
2347
|
-
onClick: () =>
|
|
2349
|
+
onClick: () => b(N),
|
|
2348
2350
|
"aria-label": "Edit annotation note",
|
|
2349
2351
|
children: "✎"
|
|
2350
2352
|
}
|
|
@@ -2354,20 +2356,20 @@ function dr({
|
|
|
2354
2356
|
{
|
|
2355
2357
|
variant: "ghost",
|
|
2356
2358
|
className: "pa-glass-btn--sm",
|
|
2357
|
-
onClick: () =>
|
|
2359
|
+
onClick: () => o(N.id),
|
|
2358
2360
|
"aria-label": "Remove annotation",
|
|
2359
2361
|
children: "✕"
|
|
2360
2362
|
}
|
|
2361
2363
|
)
|
|
2362
2364
|
] })
|
|
2363
|
-
] }) },
|
|
2365
|
+
] }) }, N.id);
|
|
2364
2366
|
})
|
|
2365
2367
|
] })
|
|
2366
2368
|
]
|
|
2367
2369
|
}
|
|
2368
2370
|
);
|
|
2369
2371
|
}
|
|
2370
|
-
function
|
|
2372
|
+
function mr() {
|
|
2371
2373
|
return /* @__PURE__ */ d("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
2372
2374
|
/* @__PURE__ */ n(
|
|
2373
2375
|
"path",
|
|
@@ -2388,7 +2390,7 @@ function ur() {
|
|
|
2388
2390
|
)
|
|
2389
2391
|
] });
|
|
2390
2392
|
}
|
|
2391
|
-
function
|
|
2393
|
+
function gr() {
|
|
2392
2394
|
return /* @__PURE__ */ d("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
|
|
2393
2395
|
/* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "2.75", stroke: "currentColor", strokeWidth: "1.25" }),
|
|
2394
2396
|
/* @__PURE__ */ n(
|
|
@@ -2402,7 +2404,7 @@ function pr() {
|
|
|
2402
2404
|
)
|
|
2403
2405
|
] });
|
|
2404
2406
|
}
|
|
2405
|
-
function
|
|
2407
|
+
function vr() {
|
|
2406
2408
|
return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
2407
2409
|
"path",
|
|
2408
2410
|
{
|
|
@@ -2413,27 +2415,27 @@ function hr() {
|
|
|
2413
2415
|
}
|
|
2414
2416
|
) });
|
|
2415
2417
|
}
|
|
2416
|
-
function
|
|
2418
|
+
function br({
|
|
2417
2419
|
open: e,
|
|
2418
2420
|
onClose: t,
|
|
2419
2421
|
hostTheme: i,
|
|
2420
2422
|
chrome: r,
|
|
2421
2423
|
onToggleHostTheme: a
|
|
2422
2424
|
}) {
|
|
2423
|
-
const
|
|
2425
|
+
const s = Y(null);
|
|
2424
2426
|
return H(() => {
|
|
2425
2427
|
if (!e) return;
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
},
|
|
2429
|
-
var
|
|
2430
|
-
const l =
|
|
2431
|
-
(
|
|
2428
|
+
const o = (u) => {
|
|
2429
|
+
u.key === "Escape" && t();
|
|
2430
|
+
}, c = (u) => {
|
|
2431
|
+
var f, p;
|
|
2432
|
+
const l = u.target;
|
|
2433
|
+
(f = s.current) != null && f.contains(l) || (p = l.closest) != null && p.call(l, "[data-pa-settings-trigger]") || t();
|
|
2432
2434
|
};
|
|
2433
|
-
return window.addEventListener("keydown",
|
|
2434
|
-
window.removeEventListener("keydown",
|
|
2435
|
+
return window.addEventListener("keydown", o), window.addEventListener("mousedown", c), () => {
|
|
2436
|
+
window.removeEventListener("keydown", o), window.removeEventListener("mousedown", c);
|
|
2435
2437
|
};
|
|
2436
|
-
}, [e, t]), e ? /* @__PURE__ */ n("div", { ref:
|
|
2438
|
+
}, [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
2439
|
/* @__PURE__ */ d("header", { className: "pa-settings-menu-header", children: [
|
|
2438
2440
|
/* @__PURE__ */ n("h4", { className: "pa-settings-menu-title", children: "Settings" }),
|
|
2439
2441
|
/* @__PURE__ */ n("p", { className: "pa-settings-menu-subtitle", children: "Appearance and chrome" })
|
|
@@ -2449,7 +2451,7 @@ function fr({
|
|
|
2449
2451
|
onClick: a,
|
|
2450
2452
|
"aria-label": i === "dark" ? "Switch host to light theme" : "Switch host to dark theme",
|
|
2451
2453
|
title: i === "dark" ? "Light theme" : "Dark theme",
|
|
2452
|
-
children: i === "dark" ? /* @__PURE__ */ n(
|
|
2454
|
+
children: i === "dark" ? /* @__PURE__ */ n(gr, {}) : /* @__PURE__ */ n(vr, {})
|
|
2453
2455
|
}
|
|
2454
2456
|
)
|
|
2455
2457
|
] })
|
|
@@ -2464,29 +2466,29 @@ function fr({
|
|
|
2464
2466
|
] })
|
|
2465
2467
|
] }) }) }) : null;
|
|
2466
2468
|
}
|
|
2467
|
-
const
|
|
2468
|
-
function
|
|
2469
|
-
return /* @__PURE__ */ d(
|
|
2469
|
+
const bt = "0 0 24 24";
|
|
2470
|
+
function yr() {
|
|
2471
|
+
return /* @__PURE__ */ d(K, { children: [
|
|
2470
2472
|
/* @__PURE__ */ n("rect", { x: "3", y: "14", width: "4", height: "4", fill: "currentColor" }),
|
|
2471
2473
|
/* @__PURE__ */ n("path", { fill: "currentColor", d: "M7 5h12v12L7 5z" })
|
|
2472
2474
|
] });
|
|
2473
2475
|
}
|
|
2474
|
-
const
|
|
2475
|
-
function
|
|
2476
|
+
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";
|
|
2477
|
+
function xr({ size: e = 22, variant: t = "cursor" }) {
|
|
2476
2478
|
return t === "pointer" ? /* @__PURE__ */ n(
|
|
2477
2479
|
"svg",
|
|
2478
2480
|
{
|
|
2479
2481
|
className: "pa-brand-cursor pa-brand-cursor--pointer",
|
|
2480
2482
|
width: e,
|
|
2481
2483
|
height: e,
|
|
2482
|
-
viewBox:
|
|
2484
|
+
viewBox: bt,
|
|
2483
2485
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2484
2486
|
"aria-hidden": "true",
|
|
2485
2487
|
children: /* @__PURE__ */ n(
|
|
2486
2488
|
"path",
|
|
2487
2489
|
{
|
|
2488
2490
|
fill: "currentColor",
|
|
2489
|
-
d:
|
|
2491
|
+
d: wr
|
|
2490
2492
|
}
|
|
2491
2493
|
)
|
|
2492
2494
|
}
|
|
@@ -2496,60 +2498,60 @@ function vr({ size: e = 22, variant: t = "cursor" }) {
|
|
|
2496
2498
|
className: "pa-brand-cursor pa-brand-cursor--minimal",
|
|
2497
2499
|
width: e,
|
|
2498
2500
|
height: e,
|
|
2499
|
-
viewBox:
|
|
2501
|
+
viewBox: bt,
|
|
2500
2502
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2501
2503
|
"aria-hidden": "true",
|
|
2502
|
-
children: /* @__PURE__ */ n(
|
|
2504
|
+
children: /* @__PURE__ */ n(yr, {})
|
|
2503
2505
|
}
|
|
2504
2506
|
);
|
|
2505
2507
|
}
|
|
2506
|
-
const
|
|
2508
|
+
const Nr = ["element", "area", "multi"], kr = {
|
|
2507
2509
|
element: "Click",
|
|
2508
2510
|
area: "Area",
|
|
2509
2511
|
multi: "Multi"
|
|
2510
2512
|
};
|
|
2511
|
-
function
|
|
2513
|
+
function Cr({
|
|
2512
2514
|
rootAttributes: e,
|
|
2513
2515
|
hostTheme: t,
|
|
2514
2516
|
chrome: i,
|
|
2515
2517
|
settingsOpen: r,
|
|
2516
2518
|
onToggleSettings: a,
|
|
2517
|
-
onCloseSettings:
|
|
2518
|
-
onToggleHostTheme:
|
|
2519
|
-
active:
|
|
2520
|
-
mode:
|
|
2519
|
+
onCloseSettings: s,
|
|
2520
|
+
onToggleHostTheme: o,
|
|
2521
|
+
active: c,
|
|
2522
|
+
mode: u,
|
|
2521
2523
|
captureMode: l,
|
|
2522
|
-
annotationCount:
|
|
2523
|
-
multiSelectCount:
|
|
2524
|
+
annotationCount: f,
|
|
2525
|
+
multiSelectCount: p,
|
|
2524
2526
|
copyStatus: v,
|
|
2525
|
-
copyAllFrom:
|
|
2526
|
-
onActivateAnnotate:
|
|
2527
|
-
onActivateEdit:
|
|
2528
|
-
onDeactivate:
|
|
2529
|
-
onCopyAll:
|
|
2527
|
+
copyAllFrom: m,
|
|
2528
|
+
onActivateAnnotate: g,
|
|
2529
|
+
onActivateEdit: b,
|
|
2530
|
+
onDeactivate: L,
|
|
2531
|
+
onCopyAll: N,
|
|
2530
2532
|
onCaptureModeChange: w,
|
|
2531
|
-
onConfirmMultiSelect:
|
|
2533
|
+
onConfirmMultiSelect: k
|
|
2532
2534
|
}) {
|
|
2533
|
-
const { elementRef:
|
|
2535
|
+
const { elementRef: $, isDragging: P, style: R, dragHandleProps: x } = Rt(), I = /* @__PURE__ */ d(
|
|
2534
2536
|
"div",
|
|
2535
2537
|
{
|
|
2536
|
-
ref:
|
|
2538
|
+
ref: $,
|
|
2537
2539
|
className: `pa-toolbar-float ${P ? "pa-toolbar-float--dragging" : ""}`,
|
|
2538
|
-
style:
|
|
2540
|
+
style: R,
|
|
2539
2541
|
role: "toolbar",
|
|
2540
2542
|
"aria-label": "PixelAgent",
|
|
2541
2543
|
children: [
|
|
2542
|
-
!
|
|
2543
|
-
|
|
2544
|
+
!c && /* @__PURE__ */ n(
|
|
2545
|
+
br,
|
|
2544
2546
|
{
|
|
2545
2547
|
open: r,
|
|
2546
|
-
onClose:
|
|
2548
|
+
onClose: s,
|
|
2547
2549
|
hostTheme: t,
|
|
2548
2550
|
chrome: i,
|
|
2549
|
-
onToggleHostTheme:
|
|
2551
|
+
onToggleHostTheme: o
|
|
2550
2552
|
}
|
|
2551
2553
|
),
|
|
2552
|
-
/* @__PURE__ */ n(
|
|
2554
|
+
/* @__PURE__ */ n(Tt, { shape: "capsule", className: "pa-toolbar-glass", intensity: "enhanced", children: /* @__PURE__ */ d("div", { className: "pa-toolbar-inner", children: [
|
|
2553
2555
|
/* @__PURE__ */ n(
|
|
2554
2556
|
"button",
|
|
2555
2557
|
{
|
|
@@ -2557,15 +2559,15 @@ function wr({
|
|
|
2557
2559
|
className: "pa-toolbar-drag",
|
|
2558
2560
|
"aria-label": "Drag PixelAgent toolbar",
|
|
2559
2561
|
title: "Drag to move",
|
|
2560
|
-
...
|
|
2561
|
-
children: /* @__PURE__ */ n(
|
|
2562
|
+
...x,
|
|
2563
|
+
children: /* @__PURE__ */ n(xr, { size: 22 })
|
|
2562
2564
|
}
|
|
2563
2565
|
),
|
|
2564
2566
|
/* @__PURE__ */ n("span", { className: "pa-toolbar-divider", "aria-hidden": "true" }),
|
|
2565
|
-
|
|
2567
|
+
c ? /* @__PURE__ */ d(K, { children: [
|
|
2566
2568
|
/* @__PURE__ */ d("div", { className: "pa-toolbar-segment", children: [
|
|
2567
|
-
/* @__PURE__ */ n("span", { className: "pa-mode-badge", children:
|
|
2568
|
-
|
|
2569
|
+
/* @__PURE__ */ n("span", { className: "pa-mode-badge", children: u }),
|
|
2570
|
+
u === "annotate" && /* @__PURE__ */ d(K, { children: [
|
|
2569
2571
|
/* @__PURE__ */ n(
|
|
2570
2572
|
"select",
|
|
2571
2573
|
{
|
|
@@ -2573,31 +2575,31 @@ function wr({
|
|
|
2573
2575
|
value: l,
|
|
2574
2576
|
onChange: (C) => w(C.target.value),
|
|
2575
2577
|
"aria-label": "Capture mode",
|
|
2576
|
-
children:
|
|
2578
|
+
children: Nr.map((C) => /* @__PURE__ */ n("option", { value: C, children: kr[C] }, C))
|
|
2577
2579
|
}
|
|
2578
2580
|
),
|
|
2579
|
-
|
|
2581
|
+
p > 0 && /* @__PURE__ */ n(
|
|
2580
2582
|
V,
|
|
2581
2583
|
{
|
|
2582
2584
|
variant: "glass-primary",
|
|
2583
|
-
onClick:
|
|
2585
|
+
onClick: k,
|
|
2584
2586
|
"aria-label": "Annotate selected elements",
|
|
2585
|
-
children:
|
|
2587
|
+
children: p
|
|
2586
2588
|
}
|
|
2587
2589
|
),
|
|
2588
2590
|
/* @__PURE__ */ n(
|
|
2589
|
-
|
|
2591
|
+
Ht,
|
|
2590
2592
|
{
|
|
2591
|
-
feedback:
|
|
2593
|
+
feedback: m === "toolbar" ? v : null,
|
|
2592
2594
|
slotClassName: "pa-copy-feedback-slot--toolbar",
|
|
2593
2595
|
children: /* @__PURE__ */ n(
|
|
2594
2596
|
V,
|
|
2595
2597
|
{
|
|
2596
2598
|
variant: "glass-primary",
|
|
2597
|
-
onClick:
|
|
2598
|
-
disabled:
|
|
2599
|
-
"aria-label":
|
|
2600
|
-
children:
|
|
2599
|
+
onClick: N,
|
|
2600
|
+
disabled: f === 0,
|
|
2601
|
+
"aria-label": f > 0 ? `Copy all annotations (${f})` : "Copy all annotations",
|
|
2602
|
+
children: f > 0 ? `Copy (${f})` : "Copy"
|
|
2601
2603
|
}
|
|
2602
2604
|
)
|
|
2603
2605
|
}
|
|
@@ -2609,7 +2611,7 @@ function wr({
|
|
|
2609
2611
|
{
|
|
2610
2612
|
variant: "icon",
|
|
2611
2613
|
className: "pa-toolbar-close",
|
|
2612
|
-
onClick:
|
|
2614
|
+
onClick: L,
|
|
2613
2615
|
"aria-label": "Close",
|
|
2614
2616
|
children: /* @__PURE__ */ n(
|
|
2615
2617
|
"svg",
|
|
@@ -2633,10 +2635,10 @@ function wr({
|
|
|
2633
2635
|
}
|
|
2634
2636
|
)
|
|
2635
2637
|
] }) : /* @__PURE__ */ d("div", { className: "pa-toolbar-segment", children: [
|
|
2636
|
-
/* @__PURE__ */ n(V, { onClick:
|
|
2637
|
-
/* @__PURE__ */ n(V, { onClick:
|
|
2638
|
+
/* @__PURE__ */ n(V, { onClick: g, children: "Annotate" }),
|
|
2639
|
+
/* @__PURE__ */ n(V, { onClick: b, children: "Edit" })
|
|
2638
2640
|
] }),
|
|
2639
|
-
!
|
|
2641
|
+
!c && /* @__PURE__ */ d(K, { children: [
|
|
2640
2642
|
/* @__PURE__ */ n("span", { className: "pa-toolbar-divider", "aria-hidden": "true" }),
|
|
2641
2643
|
/* @__PURE__ */ n(
|
|
2642
2644
|
V,
|
|
@@ -2648,16 +2650,16 @@ function wr({
|
|
|
2648
2650
|
"aria-label": "PixelAgent settings",
|
|
2649
2651
|
"aria-expanded": r,
|
|
2650
2652
|
title: "Settings",
|
|
2651
|
-
children: /* @__PURE__ */ n(
|
|
2653
|
+
children: /* @__PURE__ */ n(mr, {})
|
|
2652
2654
|
}
|
|
2653
2655
|
)
|
|
2654
2656
|
] }),
|
|
2655
|
-
v && !
|
|
2657
|
+
v && !_t(v) && v !== "Copied!" && /* @__PURE__ */ n("span", { className: "pa-status pa-toolbar-status", role: "status", children: v })
|
|
2656
2658
|
] }) })
|
|
2657
2659
|
]
|
|
2658
2660
|
}
|
|
2659
2661
|
);
|
|
2660
|
-
return typeof document > "u" ? I :
|
|
2662
|
+
return typeof document > "u" ? I : Ke(
|
|
2661
2663
|
/* @__PURE__ */ n(
|
|
2662
2664
|
"div",
|
|
2663
2665
|
{
|
|
@@ -2670,22 +2672,22 @@ function wr({
|
|
|
2670
2672
|
document.body
|
|
2671
2673
|
);
|
|
2672
2674
|
}
|
|
2673
|
-
function
|
|
2674
|
-
const e =
|
|
2675
|
+
function Mr() {
|
|
2676
|
+
const e = Y(Qt()), [t, i] = S(
|
|
2675
2677
|
() => {
|
|
2676
|
-
var
|
|
2677
|
-
return ((
|
|
2678
|
+
var s;
|
|
2679
|
+
return ((s = e.current) == null ? void 0 : s.annotations) ?? [];
|
|
2678
2680
|
}
|
|
2679
2681
|
);
|
|
2680
2682
|
H(() => {
|
|
2681
|
-
|
|
2683
|
+
en({ annotations: t });
|
|
2682
2684
|
}, [t]);
|
|
2683
|
-
const r =
|
|
2685
|
+
const r = E((s, o) => {
|
|
2684
2686
|
i(
|
|
2685
|
-
(
|
|
2687
|
+
(c) => c.map((u) => u.id === s ? { ...u, ...o } : u)
|
|
2686
2688
|
);
|
|
2687
|
-
}, []), a =
|
|
2688
|
-
i((
|
|
2689
|
+
}, []), a = E((s) => {
|
|
2690
|
+
i((o) => o.filter((c) => c.id !== s));
|
|
2689
2691
|
}, []);
|
|
2690
2692
|
return {
|
|
2691
2693
|
annotations: t,
|
|
@@ -2694,227 +2696,284 @@ function xr() {
|
|
|
2694
2696
|
removeAnnotation: a
|
|
2695
2697
|
};
|
|
2696
2698
|
}
|
|
2697
|
-
function
|
|
2699
|
+
function Ar({
|
|
2698
2700
|
ui: e,
|
|
2699
2701
|
hostTheme: t,
|
|
2700
2702
|
onHostThemeChange: i
|
|
2701
2703
|
}) {
|
|
2702
|
-
const r =
|
|
2703
|
-
() => ({ ...
|
|
2704
|
+
const r = xe(
|
|
2705
|
+
() => ({ ...tn, ...e }),
|
|
2704
2706
|
[e]
|
|
2705
|
-
), [a,
|
|
2706
|
-
() => t ??
|
|
2707
|
-
), [
|
|
2707
|
+
), [a, s] = S(
|
|
2708
|
+
() => t ?? it(r) ?? "dark"
|
|
2709
|
+
), [o, c] = S(!1), u = t ?? a;
|
|
2708
2710
|
H(() => {
|
|
2709
2711
|
if (t !== void 0) return;
|
|
2710
2712
|
const v = () => {
|
|
2711
|
-
const
|
|
2712
|
-
|
|
2713
|
+
const b = it(r);
|
|
2714
|
+
b && s(b);
|
|
2713
2715
|
};
|
|
2714
2716
|
v();
|
|
2715
|
-
const
|
|
2716
|
-
return
|
|
2717
|
+
const m = r.hostThemeAttribute, g = new MutationObserver(v);
|
|
2718
|
+
return g.observe(document.documentElement, {
|
|
2717
2719
|
attributes: !0,
|
|
2718
|
-
attributeFilter: [
|
|
2719
|
-
}), () =>
|
|
2720
|
+
attributeFilter: [m]
|
|
2721
|
+
}), () => g.disconnect();
|
|
2720
2722
|
}, [t, r]);
|
|
2721
|
-
const l =
|
|
2722
|
-
() =>
|
|
2723
|
-
[r,
|
|
2724
|
-
),
|
|
2725
|
-
const v =
|
|
2723
|
+
const l = xe(
|
|
2724
|
+
() => nn(r, u),
|
|
2725
|
+
[r, u]
|
|
2726
|
+
), f = E(() => {
|
|
2727
|
+
const v = u === "dark" ? "light" : "dark";
|
|
2726
2728
|
if (i) {
|
|
2727
2729
|
i(v);
|
|
2728
2730
|
return;
|
|
2729
2731
|
}
|
|
2730
|
-
|
|
2731
|
-
}, [
|
|
2732
|
-
|
|
2732
|
+
s(v), rn(v, r);
|
|
2733
|
+
}, [u, i, r]), p = E(() => {
|
|
2734
|
+
c((v) => !v);
|
|
2733
2735
|
}, []);
|
|
2734
2736
|
return {
|
|
2735
2737
|
chrome: l,
|
|
2736
|
-
rootAttributes:
|
|
2737
|
-
hostTheme:
|
|
2738
|
-
toggleHostTheme:
|
|
2739
|
-
settingsOpen:
|
|
2740
|
-
setSettingsOpen:
|
|
2741
|
-
toggleSettings:
|
|
2738
|
+
rootAttributes: an(l),
|
|
2739
|
+
hostTheme: u,
|
|
2740
|
+
toggleHostTheme: f,
|
|
2741
|
+
settingsOpen: o,
|
|
2742
|
+
setSettingsOpen: c,
|
|
2743
|
+
toggleSettings: p,
|
|
2742
2744
|
uiSettings: r
|
|
2743
2745
|
};
|
|
2744
2746
|
}
|
|
2745
|
-
const
|
|
2746
|
-
|
|
2747
|
+
const yt = "/__pixelagent/apply", wt = "pixelagent-runtime-styles";
|
|
2748
|
+
let xt = 0;
|
|
2749
|
+
const We = /* @__PURE__ */ new WeakMap();
|
|
2750
|
+
function Sr(e) {
|
|
2751
|
+
let t = We.get(e);
|
|
2752
|
+
if (t) return t;
|
|
2753
|
+
for (const i of Array.from(e.classList))
|
|
2754
|
+
if (i.startsWith("pa-runtime-"))
|
|
2755
|
+
return We.set(e, i), i;
|
|
2756
|
+
return xt += 1, t = `pa-runtime-${xt}`, We.set(e, t), e.classList.add(t), t;
|
|
2757
|
+
}
|
|
2758
|
+
function Lr() {
|
|
2759
|
+
let e = document.getElementById(wt);
|
|
2760
|
+
return e || (e = document.createElement("style"), e.id = wt, document.head.appendChild(e)), e;
|
|
2761
|
+
}
|
|
2762
|
+
function Er(e, t, i, r) {
|
|
2763
|
+
const a = Lr(), s = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(
|
|
2764
|
+
`(\\.${s}:${t}\\s*\\{)([\\s\\S]*?)(\\})`,
|
|
2765
|
+
"m"
|
|
2766
|
+
), c = `${i}: ${r} !important`;
|
|
2767
|
+
let u = a.textContent ?? "";
|
|
2768
|
+
const l = u.match(o);
|
|
2769
|
+
if (l) {
|
|
2770
|
+
const f = l[2], p = new RegExp(`(\\s*${i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*:\\s*)[^;]+;?`);
|
|
2771
|
+
let v;
|
|
2772
|
+
if (p.test(f))
|
|
2773
|
+
v = f.replace(p, `$1${r} !important;`);
|
|
2774
|
+
else {
|
|
2775
|
+
const m = f.replace(/\s+$/, ""), g = m.endsWith(";") || m === "" ? "" : ";";
|
|
2776
|
+
v = `${m}${g}
|
|
2777
|
+
${c};
|
|
2778
|
+
`;
|
|
2779
|
+
}
|
|
2780
|
+
u = u.replace(o, `$1${v}$3`);
|
|
2781
|
+
} else
|
|
2782
|
+
u && !u.endsWith(`
|
|
2783
|
+
`) && (u += `
|
|
2784
|
+
`), u += `
|
|
2785
|
+
.${e}:${t} {
|
|
2786
|
+
${c};
|
|
2787
|
+
}
|
|
2788
|
+
`;
|
|
2789
|
+
a.textContent = u;
|
|
2790
|
+
}
|
|
2791
|
+
function Nt(e) {
|
|
2747
2792
|
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
2793
|
return { x: t, y: i, width: r, height: a };
|
|
2749
2794
|
}
|
|
2750
|
-
function
|
|
2795
|
+
function $r({
|
|
2751
2796
|
ui: e,
|
|
2752
2797
|
hostTheme: t,
|
|
2753
2798
|
onHostThemeChange: i,
|
|
2754
2799
|
applyEndpoint: r,
|
|
2755
|
-
onApply: a
|
|
2800
|
+
onApply: a,
|
|
2801
|
+
runtimeStateStyles: s
|
|
2756
2802
|
} = {}) {
|
|
2757
|
-
const o =
|
|
2803
|
+
const o = Ar({ ui: e, hostTheme: t, onHostThemeChange: i }), [c, u] = S(null);
|
|
2758
2804
|
H(() => {
|
|
2759
2805
|
if (r || a) return;
|
|
2760
|
-
let
|
|
2761
|
-
return fetch(
|
|
2762
|
-
!
|
|
2806
|
+
let y = !1;
|
|
2807
|
+
return fetch(yt, { method: "GET" }).then((A) => {
|
|
2808
|
+
!y && A.status === 405 && u(yt);
|
|
2763
2809
|
}).catch(() => {
|
|
2764
2810
|
}), () => {
|
|
2765
|
-
|
|
2811
|
+
y = !0;
|
|
2766
2812
|
};
|
|
2767
2813
|
}, [r, a]);
|
|
2768
|
-
const [
|
|
2769
|
-
annotations:
|
|
2770
|
-
setAnnotations:
|
|
2771
|
-
updateAnnotation:
|
|
2772
|
-
removeAnnotation:
|
|
2773
|
-
} =
|
|
2774
|
-
(
|
|
2775
|
-
|
|
2776
|
-
|
|
2814
|
+
const [l, f] = S(!1), [p, v] = S("idle"), [m, g] = S("element"), {
|
|
2815
|
+
annotations: b,
|
|
2816
|
+
setAnnotations: L,
|
|
2817
|
+
updateAnnotation: N,
|
|
2818
|
+
removeAnnotation: w
|
|
2819
|
+
} = Mr(), [k, $] = S(null), [P, R] = S(null), [x, I] = S([]), [C, h] = S(null), [O, U] = S(null), [ge, j] = S(!1), [oe, re] = S(!1), W = l && p === "annotate" && b.length > 0 && !ge, [G, ee] = S("this-instance"), [M, F] = S("normal"), [D, z] = S(null), [T, _] = S(null), [X, q] = S(null), Re = Y(null), Pe = Y(null), de = E(
|
|
2820
|
+
(y, A) => {
|
|
2821
|
+
Pe.current && clearTimeout(Pe.current), z(y), _((A == null ? void 0 : A.entryId) ?? null), q((A == null ? void 0 : A.copyAllFrom) ?? null), Pe.current = setTimeout(() => {
|
|
2822
|
+
z(null), _(null), q(null);
|
|
2777
2823
|
}, 2500);
|
|
2778
2824
|
},
|
|
2779
2825
|
[]
|
|
2780
|
-
),
|
|
2781
|
-
async (
|
|
2782
|
-
if (
|
|
2826
|
+
), Ne = E(
|
|
2827
|
+
async (y, A, J) => {
|
|
2828
|
+
if (y)
|
|
2783
2829
|
try {
|
|
2784
|
-
await
|
|
2830
|
+
await St(y), de(A, J);
|
|
2785
2831
|
} catch {
|
|
2786
|
-
|
|
2832
|
+
de("Copy failed — check clipboard permissions", J);
|
|
2787
2833
|
}
|
|
2788
2834
|
},
|
|
2789
|
-
[
|
|
2790
|
-
),
|
|
2791
|
-
(
|
|
2792
|
-
|
|
2835
|
+
[de]
|
|
2836
|
+
), ve = E(
|
|
2837
|
+
(y, A) => {
|
|
2838
|
+
y.length === 0 && !A || (h({ elements: y, areaBbox: A }), R(y[0] ?? null));
|
|
2793
2839
|
},
|
|
2794
2840
|
[]
|
|
2795
|
-
),
|
|
2796
|
-
(
|
|
2797
|
-
if (!(!
|
|
2798
|
-
if (
|
|
2799
|
-
|
|
2800
|
-
(
|
|
2841
|
+
), De = E(
|
|
2842
|
+
(y) => {
|
|
2843
|
+
if (!(!l || p !== "annotate" || Ee(y.target))) {
|
|
2844
|
+
if (O) {
|
|
2845
|
+
U(
|
|
2846
|
+
(A) => A && { ...A, currentX: y.clientX, currentY: y.clientY }
|
|
2801
2847
|
);
|
|
2802
2848
|
return;
|
|
2803
2849
|
}
|
|
2804
|
-
|
|
2850
|
+
m !== "area" && $(vt(y.clientX, y.clientY));
|
|
2805
2851
|
}
|
|
2806
2852
|
},
|
|
2807
|
-
[
|
|
2808
|
-
),
|
|
2809
|
-
(
|
|
2810
|
-
!
|
|
2811
|
-
startX:
|
|
2812
|
-
startY:
|
|
2813
|
-
currentX:
|
|
2814
|
-
currentY:
|
|
2815
|
-
}),
|
|
2853
|
+
[l, p, O, m]
|
|
2854
|
+
), Oe = E(
|
|
2855
|
+
(y) => {
|
|
2856
|
+
!l || p !== "annotate" || Ee(y.target) || m !== "area" || y.button !== 0 || (y.preventDefault(), y.stopPropagation(), U({
|
|
2857
|
+
startX: y.clientX,
|
|
2858
|
+
startY: y.clientY,
|
|
2859
|
+
currentX: y.clientX,
|
|
2860
|
+
currentY: y.clientY
|
|
2861
|
+
}), h(null));
|
|
2816
2862
|
},
|
|
2817
|
-
[
|
|
2818
|
-
),
|
|
2819
|
-
if (!
|
|
2820
|
-
const
|
|
2821
|
-
if (
|
|
2822
|
-
const
|
|
2823
|
-
|
|
2824
|
-
}, [
|
|
2825
|
-
(
|
|
2826
|
-
if (!
|
|
2827
|
-
|
|
2828
|
-
const
|
|
2829
|
-
if (!
|
|
2830
|
-
if (
|
|
2831
|
-
|
|
2863
|
+
[l, p, m]
|
|
2864
|
+
), Fe = E(() => {
|
|
2865
|
+
if (!O) return;
|
|
2866
|
+
const y = Nt(O);
|
|
2867
|
+
if (U(null), y.width < 8 || y.height < 8) return;
|
|
2868
|
+
const A = on(y, Ze);
|
|
2869
|
+
ve(A, y);
|
|
2870
|
+
}, [O, ve]), Be = E(
|
|
2871
|
+
(y) => {
|
|
2872
|
+
if (!l || p !== "annotate" || Ee(y.target) || m === "area") return;
|
|
2873
|
+
y.preventDefault(), y.stopPropagation();
|
|
2874
|
+
const A = vt(y.clientX, y.clientY);
|
|
2875
|
+
if (!A) return;
|
|
2876
|
+
if (y.shiftKey || m === "multi") {
|
|
2877
|
+
I((te) => te.includes(A) ? te.filter((B) => B !== A) : [...te, A]), R(A);
|
|
2832
2878
|
return;
|
|
2833
2879
|
}
|
|
2834
|
-
const
|
|
2835
|
-
|
|
2880
|
+
const J = x.length > 0 ? x : [A];
|
|
2881
|
+
ve(J.includes(A) ? J : [A]);
|
|
2836
2882
|
},
|
|
2837
|
-
[
|
|
2883
|
+
[l, p, m, x, ve]
|
|
2838
2884
|
);
|
|
2839
2885
|
H(() => {
|
|
2840
|
-
!
|
|
2841
|
-
}, [
|
|
2842
|
-
if (
|
|
2843
|
-
return document.addEventListener("mousemove",
|
|
2844
|
-
document.removeEventListener("mousemove",
|
|
2886
|
+
!P || G !== "all-instances" || Ct(P) <= 1 && ee("this-instance");
|
|
2887
|
+
}, [P, G]), H(() => {
|
|
2888
|
+
if (l)
|
|
2889
|
+
return document.addEventListener("mousemove", De, !0), document.addEventListener("mousedown", Oe, !0), document.addEventListener("mouseup", Fe, !0), document.addEventListener("click", Be, !0), () => {
|
|
2890
|
+
document.removeEventListener("mousemove", De, !0), document.removeEventListener("mousedown", Oe, !0), document.removeEventListener("mouseup", Fe, !0), document.removeEventListener("click", Be, !0);
|
|
2845
2891
|
};
|
|
2846
|
-
}, [
|
|
2847
|
-
const
|
|
2848
|
-
(
|
|
2849
|
-
if (!
|
|
2850
|
-
const { elements:
|
|
2851
|
-
if (
|
|
2852
|
-
const
|
|
2853
|
-
elements:
|
|
2854
|
-
note:
|
|
2855
|
-
areaBbox:
|
|
2892
|
+
}, [l, De, Oe, Fe, Be]);
|
|
2893
|
+
const Vt = E(
|
|
2894
|
+
(y, A) => {
|
|
2895
|
+
if (!C || !y.trim()) return;
|
|
2896
|
+
const { elements: J, areaBbox: te } = C;
|
|
2897
|
+
if (J.length === 0 && !te) return;
|
|
2898
|
+
const be = cr({
|
|
2899
|
+
elements: J,
|
|
2900
|
+
note: y,
|
|
2901
|
+
areaBbox: te
|
|
2856
2902
|
});
|
|
2857
|
-
|
|
2903
|
+
L((B) => [...B, be]), j(!1), re(!1), A ? (h(null), R(null)) : (h(null), R(null), I([]));
|
|
2858
2904
|
},
|
|
2859
|
-
[
|
|
2860
|
-
),
|
|
2861
|
-
|
|
2862
|
-
}, []),
|
|
2863
|
-
async (
|
|
2864
|
-
const
|
|
2865
|
-
await
|
|
2905
|
+
[C, L]
|
|
2906
|
+
), Wt = E(() => {
|
|
2907
|
+
h(null), R(null);
|
|
2908
|
+
}, []), Qe = E(
|
|
2909
|
+
async (y) => {
|
|
2910
|
+
const A = sn(b);
|
|
2911
|
+
await Ne(A, "Copied all!", { copyAllFrom: y });
|
|
2866
2912
|
},
|
|
2867
|
-
[
|
|
2868
|
-
),
|
|
2869
|
-
async (
|
|
2870
|
-
const
|
|
2871
|
-
|
|
2913
|
+
[b, Ne]
|
|
2914
|
+
), Ut = E(
|
|
2915
|
+
async (y) => {
|
|
2916
|
+
const A = b.find((J) => J.id === y);
|
|
2917
|
+
A && await Ne(ln(A), "Copied!", { entryId: y });
|
|
2872
2918
|
},
|
|
2873
|
-
[
|
|
2874
|
-
),
|
|
2875
|
-
async (
|
|
2876
|
-
const
|
|
2877
|
-
for (const [
|
|
2878
|
-
for (const [
|
|
2879
|
-
|
|
2880
|
-
if (
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2919
|
+
[b, Ne]
|
|
2920
|
+
), Yt = E(
|
|
2921
|
+
async (y) => {
|
|
2922
|
+
const A = [];
|
|
2923
|
+
for (const [B, Z] of y)
|
|
2924
|
+
for (const [se, ne] of Z)
|
|
2925
|
+
ne.length > 0 && A.push([B, se, ne]);
|
|
2926
|
+
if (A.length === 0) return { applied: !1 };
|
|
2927
|
+
if (s) {
|
|
2928
|
+
for (const [B, Z, se] of A) {
|
|
2929
|
+
if (Z === "normal") continue;
|
|
2930
|
+
const ne = Sr(B);
|
|
2931
|
+
for (const ye of se)
|
|
2932
|
+
B.style.removeProperty(ye.property), Er(ne, Z, ye.property, ye.newValue);
|
|
2933
|
+
}
|
|
2934
|
+
for (const [B, Z, se] of A)
|
|
2935
|
+
if (Z === "normal")
|
|
2936
|
+
for (const ne of se)
|
|
2937
|
+
B.style.setProperty(ne.property, ne.newValue);
|
|
2938
|
+
return de("Change applied"), { applied: !0, skipRevert: !0 };
|
|
2939
|
+
}
|
|
2940
|
+
const J = r ?? c ?? void 0, te = [];
|
|
2941
|
+
for (const [B, Z, se] of A) {
|
|
2942
|
+
const ne = Ge(B), ye = {
|
|
2884
2943
|
schemaVersion: 1,
|
|
2885
|
-
elementSelector:
|
|
2886
|
-
sourceFile:
|
|
2887
|
-
lineNumber:
|
|
2888
|
-
targetScope:
|
|
2889
|
-
state:
|
|
2890
|
-
stylingSystem:
|
|
2891
|
-
changes:
|
|
2944
|
+
elementSelector: Mt(B, G),
|
|
2945
|
+
sourceFile: ne.sourceFile,
|
|
2946
|
+
lineNumber: ne.lineNumber,
|
|
2947
|
+
targetScope: G,
|
|
2948
|
+
state: Z,
|
|
2949
|
+
stylingSystem: kt(B),
|
|
2950
|
+
changes: se
|
|
2892
2951
|
};
|
|
2893
|
-
|
|
2952
|
+
te.push(await Jn(ye, { applyEndpoint: J, onApply: a }));
|
|
2894
2953
|
}
|
|
2895
|
-
const
|
|
2896
|
-
(
|
|
2954
|
+
const be = te.every(
|
|
2955
|
+
(B) => B.mode === "mcp" && B.result.success && B.result.linesChanged.length > 0
|
|
2897
2956
|
);
|
|
2898
|
-
return
|
|
2899
|
-
|
|
2900
|
-
}),
|
|
2957
|
+
return de(be ? "Change applied" : "Apply failed"), te.forEach((B, Z) => {
|
|
2958
|
+
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);
|
|
2959
|
+
}), { applied: be };
|
|
2901
2960
|
},
|
|
2902
|
-
[
|
|
2903
|
-
),
|
|
2904
|
-
o.setSettingsOpen(!1),
|
|
2905
|
-
},
|
|
2906
|
-
|
|
2907
|
-
},
|
|
2961
|
+
[G, r, c, a, s, de]
|
|
2962
|
+
), et = (y) => {
|
|
2963
|
+
o.setSettingsOpen(!1), f(!0), v(y), R(null), $(null), h(null), I([]), U(null), y === "annotate" && j(!1);
|
|
2964
|
+
}, Xt = () => {
|
|
2965
|
+
f(!1), v("idle"), R(null), $(null), h(null), I([]), U(null), j(!1), re(!1);
|
|
2966
|
+
}, Gt = O ? Nt(O) : null;
|
|
2908
2967
|
return /* @__PURE__ */ d(
|
|
2909
2968
|
"div",
|
|
2910
2969
|
{
|
|
2911
|
-
ref:
|
|
2970
|
+
ref: Re,
|
|
2912
2971
|
className: "pa-root",
|
|
2913
2972
|
"data-pixelagent-root": !0,
|
|
2914
2973
|
...o.rootAttributes,
|
|
2915
2974
|
children: [
|
|
2916
2975
|
/* @__PURE__ */ n(
|
|
2917
|
-
|
|
2976
|
+
Cr,
|
|
2918
2977
|
{
|
|
2919
2978
|
rootAttributes: o.rootAttributes,
|
|
2920
2979
|
hostTheme: o.hostTheme,
|
|
@@ -2923,91 +2982,91 @@ function kr({
|
|
|
2923
2982
|
onToggleSettings: o.toggleSettings,
|
|
2924
2983
|
onCloseSettings: () => o.setSettingsOpen(!1),
|
|
2925
2984
|
onToggleHostTheme: o.toggleHostTheme,
|
|
2926
|
-
active:
|
|
2985
|
+
active: l,
|
|
2927
2986
|
mode: p,
|
|
2928
|
-
captureMode:
|
|
2929
|
-
annotationCount:
|
|
2930
|
-
multiSelectCount:
|
|
2987
|
+
captureMode: m,
|
|
2988
|
+
annotationCount: b.length,
|
|
2989
|
+
multiSelectCount: x.length,
|
|
2931
2990
|
copyStatus: D,
|
|
2932
|
-
copyAllFrom:
|
|
2933
|
-
onActivateAnnotate: () =>
|
|
2934
|
-
onActivateEdit: () =>
|
|
2935
|
-
onDeactivate:
|
|
2936
|
-
onCopyAll: () =>
|
|
2991
|
+
copyAllFrom: X,
|
|
2992
|
+
onActivateAnnotate: () => et("annotate"),
|
|
2993
|
+
onActivateEdit: () => et("edit"),
|
|
2994
|
+
onDeactivate: Xt,
|
|
2995
|
+
onCopyAll: () => Qe("toolbar"),
|
|
2937
2996
|
onCaptureModeChange: g,
|
|
2938
2997
|
onConfirmMultiSelect: () => {
|
|
2939
|
-
|
|
2998
|
+
x.length > 0 && ve(x);
|
|
2940
2999
|
}
|
|
2941
3000
|
}
|
|
2942
3001
|
),
|
|
2943
|
-
|
|
3002
|
+
l && p === "annotate" && /* @__PURE__ */ d(K, { children: [
|
|
2944
3003
|
/* @__PURE__ */ n(
|
|
2945
|
-
|
|
3004
|
+
$t,
|
|
2946
3005
|
{
|
|
2947
|
-
element:
|
|
2948
|
-
selected:
|
|
2949
|
-
multiSelected:
|
|
3006
|
+
element: k,
|
|
3007
|
+
selected: P,
|
|
3008
|
+
multiSelected: x
|
|
2950
3009
|
}
|
|
2951
3010
|
),
|
|
2952
|
-
/* @__PURE__ */ n(
|
|
2953
|
-
/* @__PURE__ */ n(
|
|
3011
|
+
/* @__PURE__ */ n(hr, { annotations: b }),
|
|
3012
|
+
/* @__PURE__ */ n(lr, { area: Gt, isDragging: !!O })
|
|
2954
3013
|
] }),
|
|
2955
|
-
|
|
2956
|
-
|
|
3014
|
+
l && p === "annotate" && C && /* @__PURE__ */ n(
|
|
3015
|
+
sr,
|
|
2957
3016
|
{
|
|
2958
|
-
elements:
|
|
2959
|
-
areaBbox:
|
|
2960
|
-
onSubmit:
|
|
2961
|
-
onCancel:
|
|
3017
|
+
elements: C.elements,
|
|
3018
|
+
areaBbox: C.areaBbox,
|
|
3019
|
+
onSubmit: Vt,
|
|
3020
|
+
onCancel: Wt
|
|
2962
3021
|
}
|
|
2963
3022
|
),
|
|
2964
|
-
|
|
2965
|
-
|
|
3023
|
+
l && p === "edit" && /* @__PURE__ */ n(
|
|
3024
|
+
qn,
|
|
2966
3025
|
{
|
|
2967
|
-
selectedElement:
|
|
2968
|
-
hoveredElement:
|
|
2969
|
-
onSelectElement:
|
|
2970
|
-
onHoverElement:
|
|
2971
|
-
targetScope:
|
|
3026
|
+
selectedElement: P,
|
|
3027
|
+
hoveredElement: k,
|
|
3028
|
+
onSelectElement: R,
|
|
3029
|
+
onHoverElement: $,
|
|
3030
|
+
targetScope: G,
|
|
2972
3031
|
onTargetScopeChange: ee,
|
|
2973
|
-
elementState:
|
|
2974
|
-
onElementStateChange:
|
|
2975
|
-
onApply:
|
|
3032
|
+
elementState: M,
|
|
3033
|
+
onElementStateChange: F,
|
|
3034
|
+
onApply: Yt,
|
|
2976
3035
|
applyStatus: p === "edit" ? D : null,
|
|
2977
|
-
isToolbarTarget:
|
|
3036
|
+
isToolbarTarget: Ee
|
|
2978
3037
|
}
|
|
2979
3038
|
),
|
|
2980
|
-
|
|
2981
|
-
|
|
3039
|
+
W && /* @__PURE__ */ n(
|
|
3040
|
+
fr,
|
|
2982
3041
|
{
|
|
2983
|
-
annotations:
|
|
2984
|
-
collapsed:
|
|
2985
|
-
onToggleCollapsed: () =>
|
|
3042
|
+
annotations: b,
|
|
3043
|
+
collapsed: oe,
|
|
3044
|
+
onToggleCollapsed: () => re((y) => !y),
|
|
2986
3045
|
onClose: () => {
|
|
2987
|
-
|
|
3046
|
+
j(!0), re(!1);
|
|
2988
3047
|
},
|
|
2989
|
-
onCopyAll: () =>
|
|
2990
|
-
onCopyOne:
|
|
2991
|
-
onRemove:
|
|
2992
|
-
onUpdate:
|
|
3048
|
+
onCopyAll: () => Qe("session"),
|
|
3049
|
+
onCopyOne: Ut,
|
|
3050
|
+
onRemove: w,
|
|
3051
|
+
onUpdate: N,
|
|
2993
3052
|
copyStatus: D,
|
|
2994
|
-
copiedEntryId:
|
|
2995
|
-
copyAllFrom:
|
|
3053
|
+
copiedEntryId: T,
|
|
3054
|
+
copyAllFrom: X
|
|
2996
3055
|
}
|
|
2997
3056
|
)
|
|
2998
3057
|
]
|
|
2999
3058
|
}
|
|
3000
3059
|
);
|
|
3001
3060
|
}
|
|
3002
|
-
function
|
|
3061
|
+
function Ir() {
|
|
3003
3062
|
return typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
3004
3063
|
}
|
|
3005
|
-
function
|
|
3006
|
-
return
|
|
3064
|
+
function Or() {
|
|
3065
|
+
return Ir() ? /* @__PURE__ */ n($r, {}) : null;
|
|
3007
3066
|
}
|
|
3008
3067
|
export {
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3068
|
+
$r as PixelAgent,
|
|
3069
|
+
Or as PixelAgentDev,
|
|
3070
|
+
Ir as isDevEnvironment
|
|
3012
3071
|
};
|
|
3013
3072
|
//# sourceMappingURL=pixelagent.js.map
|