uilint-react 0.2.9 → 0.2.11
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/README.md +35 -31
- package/dist/DevTool.d.ts +3 -3
- package/dist/DevTool.d.ts.map +1 -1
- package/dist/components/ui-lint/ElementBadges.d.ts.map +1 -1
- package/dist/components/ui-lint/InspectionPanel.d.ts.map +1 -1
- package/dist/components/ui-lint/LocatorOverlay.d.ts.map +1 -1
- package/dist/components/ui-lint/ScanResultsPopover.d.ts.map +1 -1
- package/dist/components/ui-lint/UILintUI.d.ts +5 -0
- package/dist/components/ui-lint/UILintUI.d.ts.map +1 -0
- package/dist/components/ui-lint/hooks/index.d.ts +4 -0
- package/dist/components/ui-lint/hooks/index.d.ts.map +1 -0
- package/dist/components/ui-lint/hooks/useAutoScans.d.ts +5 -0
- package/dist/components/ui-lint/hooks/useAutoScans.d.ts.map +1 -0
- package/dist/components/ui-lint/hooks/useDevToolEventHandlers.d.ts +5 -0
- package/dist/components/ui-lint/hooks/useDevToolEventHandlers.d.ts.map +1 -0
- package/dist/components/ui-lint/hooks/useNavigationDetection.d.ts +6 -0
- package/dist/components/ui-lint/hooks/useNavigationDetection.d.ts.map +1 -0
- package/dist/components/ui-lint/index.d.ts +1 -2
- package/dist/components/ui-lint/index.d.ts.map +1 -1
- package/dist/components/ui-lint/store.d.ts +18 -6
- package/dist/components/ui-lint/store.d.ts.map +1 -1
- package/dist/components/ui-lint/toolbar/icons.d.ts +4 -0
- package/dist/components/ui-lint/toolbar/icons.d.ts.map +1 -1
- package/dist/components/ui-lint/toolbar/index.d.ts.map +1 -1
- package/dist/components/ui-lint/toolbar/tabs/ConfigureTab.d.ts.map +1 -1
- package/dist/components/ui-lint/toolbar/tabs/ESLintTab.d.ts.map +1 -1
- package/dist/components/ui-lint/toolbar/tabs/VisionTab.d.ts.map +1 -1
- package/dist/components/ui-lint/types.d.ts +80 -35
- package/dist/components/ui-lint/types.d.ts.map +1 -1
- package/dist/devtools-types.d.ts +31 -0
- package/dist/devtools.js +93 -93
- package/dist/devtools.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12953 -42
- package/dist/index.js.map +1 -1
- package/dist/scanner/vision-capture.d.ts +1 -1
- package/dist/scanner/vision-capture.d.ts.map +1 -1
- package/dist/{vision-capture-EIrYA_XF.js → vision-capture-l4ZJB8M8.js} +89 -76
- package/dist/vision-capture-l4ZJB8M8.js.map +1 -0
- package/package.json +5 -4
- package/dist/ElementBadges-H5_y7fLt.js +0 -672
- package/dist/ElementBadges-H5_y7fLt.js.map +0 -1
- package/dist/VisionIssueBadge-Bw_1zmLh.js +0 -154
- package/dist/VisionIssueBadge-Bw_1zmLh.js.map +0 -1
- package/dist/components/ui-lint/UILintProvider.d.ts +0 -11
- package/dist/components/ui-lint/UILintProvider.d.ts.map +0 -1
- package/dist/index-Cu1-cGo1.js +0 -12839
- package/dist/index-Cu1-cGo1.js.map +0 -1
- package/dist/vision-capture-EIrYA_XF.js.map +0 -1
|
@@ -1,672 +0,0 @@
|
|
|
1
|
-
import { u as Q, a as z, j as s, g as ee } from "./index-Cu1-cGo1.js";
|
|
2
|
-
import te, { useState as k, useEffect as B, useCallback as S, useMemo as I } from "react";
|
|
3
|
-
import { createPortal as ne } from "react-dom";
|
|
4
|
-
const ie = {
|
|
5
|
-
repulsionForce: 50,
|
|
6
|
-
anchorStrength: 0.3,
|
|
7
|
-
minDistance: 24,
|
|
8
|
-
iterations: 50,
|
|
9
|
-
damping: 0.9
|
|
10
|
-
};
|
|
11
|
-
function oe(e, t) {
|
|
12
|
-
if (e.length === 0) return [];
|
|
13
|
-
if (e.length === 1)
|
|
14
|
-
return [
|
|
15
|
-
{ ...e[0], nudgedX: e[0].x, nudgedY: e[0].y }
|
|
16
|
-
];
|
|
17
|
-
const n = e.map((o) => ({
|
|
18
|
-
position: o,
|
|
19
|
-
nudgedX: o.x,
|
|
20
|
-
nudgedY: o.y,
|
|
21
|
-
velocityX: 0,
|
|
22
|
-
velocityY: 0
|
|
23
|
-
}));
|
|
24
|
-
for (let o = 0; o < t.iterations; o++)
|
|
25
|
-
for (let i = 0; i < n.length; i++) {
|
|
26
|
-
let d = 0, p = 0;
|
|
27
|
-
for (let m = 0; m < n.length; m++) {
|
|
28
|
-
if (i === m) continue;
|
|
29
|
-
const b = n[i].nudgedX - n[m].nudgedX, u = n[i].nudgedY - n[m].nudgedY, v = Math.max(Math.hypot(b, u), 1);
|
|
30
|
-
if (v < t.minDistance) {
|
|
31
|
-
const j = t.repulsionForce / (v * v);
|
|
32
|
-
d += b / v * j, p += u / v * j;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
const c = e[i].x - n[i].nudgedX, w = e[i].y - n[i].nudgedY;
|
|
36
|
-
d += c * t.anchorStrength, p += w * t.anchorStrength, n[i].velocityX = (n[i].velocityX + d) * t.damping, n[i].velocityY = (n[i].velocityY + p) * t.damping, n[i].nudgedX += n[i].velocityX, n[i].nudgedY += n[i].velocityY;
|
|
37
|
-
}
|
|
38
|
-
return n.map((o) => ({
|
|
39
|
-
...o.position,
|
|
40
|
-
nudgedX: o.nudgedX,
|
|
41
|
-
nudgedY: o.nudgedY
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
class W {
|
|
45
|
-
config;
|
|
46
|
-
positions;
|
|
47
|
-
constructor(t) {
|
|
48
|
-
this.positions = t, this.config = { ...ie };
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Create a new layout builder with badge positions
|
|
52
|
-
*/
|
|
53
|
-
static create(t) {
|
|
54
|
-
return new W(t);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Set the repulsion force (how strongly badges push apart)
|
|
58
|
-
* Higher values = badges spread more aggressively
|
|
59
|
-
*/
|
|
60
|
-
repulsion(t) {
|
|
61
|
-
return this.config.repulsionForce = t, this;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Set the anchor strength (how strongly badges stay near origin)
|
|
65
|
-
* Higher values = badges stay closer to their original positions
|
|
66
|
-
*/
|
|
67
|
-
anchorStrength(t) {
|
|
68
|
-
return this.config.anchorStrength = t, this;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Set the minimum distance between badge centers
|
|
72
|
-
* Badges closer than this will be pushed apart
|
|
73
|
-
*/
|
|
74
|
-
minDistance(t) {
|
|
75
|
-
return this.config.minDistance = t, this;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Set the number of simulation iterations
|
|
79
|
-
* More iterations = more stable but slower
|
|
80
|
-
*/
|
|
81
|
-
iterations(t) {
|
|
82
|
-
return this.config.iterations = t, this;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Set the damping factor (velocity decay per step)
|
|
86
|
-
* Lower values = system settles faster but may be less stable
|
|
87
|
-
*/
|
|
88
|
-
damping(t) {
|
|
89
|
-
return this.config.damping = t, this;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Run the simulation and return nudged positions
|
|
93
|
-
*/
|
|
94
|
-
compute() {
|
|
95
|
-
return oe(this.positions, this.config);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function se(e, t, n, o) {
|
|
99
|
-
return e.filter((i) => Math.hypot(i.nudgedX - t, i.nudgedY - n) <= o);
|
|
100
|
-
}
|
|
101
|
-
function D(e, t, n, o) {
|
|
102
|
-
const i = Math.max(0, n - e), d = Math.max(0, o - t);
|
|
103
|
-
return { left: e, top: t, right: n, bottom: o, width: i, height: d };
|
|
104
|
-
}
|
|
105
|
-
function N(e, t) {
|
|
106
|
-
const n = Math.max(e.left, t.left), o = Math.max(e.top, t.top), i = Math.min(e.right, t.right), d = Math.min(e.bottom, t.bottom);
|
|
107
|
-
return i <= n || d <= o ? null : D(n, o, i, d);
|
|
108
|
-
}
|
|
109
|
-
function re(e) {
|
|
110
|
-
return [e.overflow, e.overflowX, e.overflowY].some((n) => n && n !== "visible");
|
|
111
|
-
}
|
|
112
|
-
function de(e) {
|
|
113
|
-
const t = e, n = t.getBoundingClientRect();
|
|
114
|
-
let o = D(
|
|
115
|
-
n.left,
|
|
116
|
-
n.top,
|
|
117
|
-
n.right,
|
|
118
|
-
n.bottom
|
|
119
|
-
);
|
|
120
|
-
const i = D(0, 0, window.innerWidth, window.innerHeight);
|
|
121
|
-
if (o = N(o, i), !o) return null;
|
|
122
|
-
let d = t.parentElement;
|
|
123
|
-
for (; d; ) {
|
|
124
|
-
const p = window.getComputedStyle(d);
|
|
125
|
-
if (re(p)) {
|
|
126
|
-
const c = d.getBoundingClientRect(), w = D(c.left, c.top, c.right, c.bottom);
|
|
127
|
-
if (o = N(o, w), !o) return null;
|
|
128
|
-
}
|
|
129
|
-
d = d.parentElement;
|
|
130
|
-
}
|
|
131
|
-
return o;
|
|
132
|
-
}
|
|
133
|
-
function le(e, t, n) {
|
|
134
|
-
const o = document.elementsFromPoint(t, n);
|
|
135
|
-
for (const i of o) {
|
|
136
|
-
if (i.hasAttribute("data-ui-lint")) continue;
|
|
137
|
-
if (i === e || e.contains(i) || i.contains(e))
|
|
138
|
-
return !1;
|
|
139
|
-
const d = window.getComputedStyle(i), p = d.position, c = parseInt(d.zIndex, 10);
|
|
140
|
-
if ((p === "fixed" || p === "absolute") && (c > 0 || d.zIndex === "auto" || d.zIndex === "inherit"))
|
|
141
|
-
return !0;
|
|
142
|
-
}
|
|
143
|
-
return !1;
|
|
144
|
-
}
|
|
145
|
-
const a = {
|
|
146
|
-
bg: "var(--uilint-backdrop)",
|
|
147
|
-
success: "var(--uilint-success)",
|
|
148
|
-
warning: "var(--uilint-warning)",
|
|
149
|
-
error: "var(--uilint-error)",
|
|
150
|
-
text: "var(--uilint-text-primary)",
|
|
151
|
-
border: "var(--uilint-border)",
|
|
152
|
-
highlight: "var(--uilint-accent)",
|
|
153
|
-
font: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
154
|
-
shadow: "var(--uilint-shadow)"
|
|
155
|
-
}, A = 0, H = 150, O = 0.5, P = 1;
|
|
156
|
-
function ae(e) {
|
|
157
|
-
if (e <= A) return P;
|
|
158
|
-
if (e >= H) return O;
|
|
159
|
-
const t = (e - A) / (H - A);
|
|
160
|
-
return P - t * (P - O);
|
|
161
|
-
}
|
|
162
|
-
function U(e) {
|
|
163
|
-
return e === 0 ? a.success : a.warning;
|
|
164
|
-
}
|
|
165
|
-
function ce(e) {
|
|
166
|
-
const t = e.tagName.toLowerCase(), n = e.source;
|
|
167
|
-
if (n) {
|
|
168
|
-
const o = n.fileName.split("/").pop() || "Unknown";
|
|
169
|
-
return `${t} > ${o}`;
|
|
170
|
-
}
|
|
171
|
-
return t;
|
|
172
|
-
}
|
|
173
|
-
const ue = 30, Y = 20, _ = 18;
|
|
174
|
-
function he(e, t) {
|
|
175
|
-
const n = Y, o = window.innerWidth - _ - Y, i = Y, d = window.innerHeight - _ - Y;
|
|
176
|
-
return {
|
|
177
|
-
x: Math.max(n, Math.min(o, e)),
|
|
178
|
-
y: Math.max(i, Math.min(d, t))
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function pe(e, t) {
|
|
182
|
-
return e.status === "complete" && e.issues.length === 0 ? !1 : e.status === "error" || e.status === "complete" && e.issues.length > 0 ? !0 : e.status === "scanning" || e.status === "pending" ? t : !1;
|
|
183
|
-
}
|
|
184
|
-
function ge() {
|
|
185
|
-
return /* @__PURE__ */ s.jsx("style", { children: `
|
|
186
|
-
@keyframes uilint-badge-spin {
|
|
187
|
-
from { transform: rotate(0deg); }
|
|
188
|
-
to { transform: rotate(360deg); }
|
|
189
|
-
}
|
|
190
|
-
` });
|
|
191
|
-
}
|
|
192
|
-
function Ce() {
|
|
193
|
-
const { autoScanState: e, elementIssuesCache: t, setInspectedElement: n } = Q(), [o, i] = k(!1), [d, p] = k({ x: 0, y: 0 }), [c, w] = k([]), [m, b] = k(!1), u = z((r) => r.hoveredFilePath), v = z(
|
|
194
|
-
(r) => r.selectedFilePath
|
|
195
|
-
);
|
|
196
|
-
B(() => {
|
|
197
|
-
i(!0);
|
|
198
|
-
}, []), B(() => {
|
|
199
|
-
const r = (f) => {
|
|
200
|
-
f.altKey && b(!0);
|
|
201
|
-
}, l = (f) => {
|
|
202
|
-
f.altKey || b(!1);
|
|
203
|
-
}, h = () => {
|
|
204
|
-
b(!1);
|
|
205
|
-
};
|
|
206
|
-
return window.addEventListener("keydown", r), window.addEventListener("keyup", l), window.addEventListener("blur", h), () => {
|
|
207
|
-
window.removeEventListener("keydown", r), window.removeEventListener("keyup", l), window.removeEventListener("blur", h);
|
|
208
|
-
};
|
|
209
|
-
}, []), B(() => {
|
|
210
|
-
const r = (l) => {
|
|
211
|
-
p({ x: l.clientX, y: l.clientY });
|
|
212
|
-
};
|
|
213
|
-
return window.addEventListener("mousemove", r), () => window.removeEventListener("mousemove", r);
|
|
214
|
-
}, []), B(() => {
|
|
215
|
-
if (e.status === "idle") {
|
|
216
|
-
w([]);
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
const r = () => {
|
|
220
|
-
const L = [];
|
|
221
|
-
for (const g of e.elements) {
|
|
222
|
-
const E = t.get(g.id);
|
|
223
|
-
if (!E || !g.element || !document.contains(g.element)) continue;
|
|
224
|
-
const T = g.element.getBoundingClientRect(), y = de(g.element);
|
|
225
|
-
if (!y) continue;
|
|
226
|
-
const K = T.right - 8, $ = T.top - 8, G = Math.min(K, y.right - 8), V = Math.max(y.top + 2, $), q = y.left + Math.min(8, y.width / 2), Z = y.top + Math.min(8, y.height / 2);
|
|
227
|
-
if (le(g.element, q, Z))
|
|
228
|
-
continue;
|
|
229
|
-
const J = DOMRect.fromRect({
|
|
230
|
-
x: y.left,
|
|
231
|
-
y: y.top,
|
|
232
|
-
width: y.width,
|
|
233
|
-
height: y.height
|
|
234
|
-
});
|
|
235
|
-
L.push({ element: g, issue: E, x: G, y: V, rect: J });
|
|
236
|
-
}
|
|
237
|
-
w(L);
|
|
238
|
-
};
|
|
239
|
-
let l = null;
|
|
240
|
-
const h = () => {
|
|
241
|
-
l === null && (l = requestAnimationFrame(() => {
|
|
242
|
-
l = null, r();
|
|
243
|
-
}));
|
|
244
|
-
};
|
|
245
|
-
h();
|
|
246
|
-
const f = () => h(), C = () => h(), F = () => {
|
|
247
|
-
document.visibilityState === "visible" && h();
|
|
248
|
-
};
|
|
249
|
-
return window.addEventListener("scroll", f, !0), window.addEventListener("resize", C), document.addEventListener("visibilitychange", F), () => {
|
|
250
|
-
l !== null && cancelAnimationFrame(l), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", C), document.removeEventListener("visibilitychange", F);
|
|
251
|
-
};
|
|
252
|
-
}, [e.status, e.elements, t]);
|
|
253
|
-
const j = S(
|
|
254
|
-
(r, l) => {
|
|
255
|
-
const h = {
|
|
256
|
-
element: r.element,
|
|
257
|
-
source: r.source,
|
|
258
|
-
rect: r.element.getBoundingClientRect(),
|
|
259
|
-
scannedElementId: r.id
|
|
260
|
-
};
|
|
261
|
-
n(h);
|
|
262
|
-
},
|
|
263
|
-
[n]
|
|
264
|
-
), M = I(
|
|
265
|
-
() => W.create(c).minDistance(24).repulsion(50).anchorStrength(0.3).iterations(50).compute(),
|
|
266
|
-
[c]
|
|
267
|
-
), R = I(() => {
|
|
268
|
-
let r = M.filter(
|
|
269
|
-
(h) => pe(h.issue, m)
|
|
270
|
-
);
|
|
271
|
-
const l = v || u;
|
|
272
|
-
return l && (r = r.filter(
|
|
273
|
-
(h) => h.element.source.fileName === l
|
|
274
|
-
)), r;
|
|
275
|
-
}, [M, m, v, u]), x = S(
|
|
276
|
-
(r) => {
|
|
277
|
-
r.stopPropagation();
|
|
278
|
-
},
|
|
279
|
-
[]
|
|
280
|
-
);
|
|
281
|
-
if (!o || e.status === "idle") return null;
|
|
282
|
-
const X = /* @__PURE__ */ s.jsxs(
|
|
283
|
-
"div",
|
|
284
|
-
{
|
|
285
|
-
"data-ui-lint": !0,
|
|
286
|
-
onMouseDown: x,
|
|
287
|
-
onPointerDown: x,
|
|
288
|
-
onClick: x,
|
|
289
|
-
onKeyDown: x,
|
|
290
|
-
style: { pointerEvents: "none" },
|
|
291
|
-
children: [
|
|
292
|
-
/* @__PURE__ */ s.jsx(ge, {}),
|
|
293
|
-
R.filter((r, l, h) => {
|
|
294
|
-
const f = r.element.id;
|
|
295
|
-
return h.findIndex((C) => C.element.id === f) === l;
|
|
296
|
-
}).map((r) => {
|
|
297
|
-
const l = Math.hypot(
|
|
298
|
-
r.nudgedX - d.x,
|
|
299
|
-
r.nudgedY - d.y
|
|
300
|
-
), h = se(
|
|
301
|
-
R,
|
|
302
|
-
r.nudgedX,
|
|
303
|
-
r.nudgedY,
|
|
304
|
-
ue
|
|
305
|
-
);
|
|
306
|
-
return /* @__PURE__ */ s.jsx(
|
|
307
|
-
fe,
|
|
308
|
-
{
|
|
309
|
-
position: r,
|
|
310
|
-
distance: l,
|
|
311
|
-
nearbyBadges: h,
|
|
312
|
-
cursorPos: d,
|
|
313
|
-
onSelect: j
|
|
314
|
-
},
|
|
315
|
-
r.element.id
|
|
316
|
-
);
|
|
317
|
-
})
|
|
318
|
-
]
|
|
319
|
-
}
|
|
320
|
-
);
|
|
321
|
-
return ne(X, ee());
|
|
322
|
-
}
|
|
323
|
-
function fe({
|
|
324
|
-
position: e,
|
|
325
|
-
distance: t,
|
|
326
|
-
nearbyBadges: n,
|
|
327
|
-
cursorPos: o,
|
|
328
|
-
onSelect: i
|
|
329
|
-
}) {
|
|
330
|
-
const [d, p] = k(!1), [c, w] = k(null), m = te.useRef(null), { element: b, issue: u, rect: v, nudgedX: j, nudgedY: M } = e, R = n.length > 1, x = I(
|
|
331
|
-
() => he(j, M),
|
|
332
|
-
[j, M]
|
|
333
|
-
), X = I(() => u.status === "error" ? a.error : u.status === "scanning" ? a.highlight : u.status === "pending" ? "rgba(156, 163, 175, 0.7)" : u.status === "complete" ? U(u.issues.length) : a.success, [u]), r = S(() => {
|
|
334
|
-
m.current && (clearTimeout(m.current), m.current = null), p(!0);
|
|
335
|
-
}, []), l = S(() => {
|
|
336
|
-
m.current = setTimeout(() => {
|
|
337
|
-
p(!1), w(null);
|
|
338
|
-
}, 150);
|
|
339
|
-
}, []), h = S(
|
|
340
|
-
(g) => {
|
|
341
|
-
g.preventDefault(), g.stopPropagation(), i(b, u);
|
|
342
|
-
},
|
|
343
|
-
[b, u, i]
|
|
344
|
-
), f = I(() => c === null ? null : n[c] ?? null, [c, n]), C = I(() => {
|
|
345
|
-
const g = x.x < window.innerWidth - 220, E = x.y < window.innerHeight - 200;
|
|
346
|
-
return {
|
|
347
|
-
position: "fixed",
|
|
348
|
-
top: E ? x.y + 12 : void 0,
|
|
349
|
-
bottom: E ? void 0 : window.innerHeight - x.y + 12,
|
|
350
|
-
left: g ? x.x - 8 : void 0,
|
|
351
|
-
right: g ? void 0 : window.innerWidth - x.x - 8,
|
|
352
|
-
zIndex: 1e5,
|
|
353
|
-
backgroundColor: a.bg,
|
|
354
|
-
borderRadius: "8px",
|
|
355
|
-
border: `1px solid ${a.border}`,
|
|
356
|
-
boxShadow: "0 4px 20px rgba(0, 0, 0, 0.4)",
|
|
357
|
-
padding: "4px 0",
|
|
358
|
-
minWidth: "200px",
|
|
359
|
-
fontFamily: a.font,
|
|
360
|
-
pointerEvents: "auto"
|
|
361
|
-
// Re-enable pointer events for interactive dropdown
|
|
362
|
-
};
|
|
363
|
-
}, [x]), F = d ? 1.1 : ae(t), L = u.status === "complete" ? u.issues.length : 0;
|
|
364
|
-
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
365
|
-
d && !f && /* @__PURE__ */ s.jsx(
|
|
366
|
-
"div",
|
|
367
|
-
{
|
|
368
|
-
style: {
|
|
369
|
-
position: "fixed",
|
|
370
|
-
top: v.top - 2,
|
|
371
|
-
left: v.left - 2,
|
|
372
|
-
width: v.width + 4,
|
|
373
|
-
height: v.height + 4,
|
|
374
|
-
border: `2px solid ${a.highlight}`,
|
|
375
|
-
borderRadius: "4px",
|
|
376
|
-
pointerEvents: "none",
|
|
377
|
-
zIndex: 99994,
|
|
378
|
-
boxShadow: "0 0 0 1px rgba(59, 130, 246, 0.3)"
|
|
379
|
-
},
|
|
380
|
-
"data-ui-lint": !0
|
|
381
|
-
}
|
|
382
|
-
),
|
|
383
|
-
f && /* @__PURE__ */ s.jsx(
|
|
384
|
-
"div",
|
|
385
|
-
{
|
|
386
|
-
style: {
|
|
387
|
-
position: "fixed",
|
|
388
|
-
top: f.rect.top - 2,
|
|
389
|
-
left: f.rect.left - 2,
|
|
390
|
-
width: f.rect.width + 4,
|
|
391
|
-
height: f.rect.height + 4,
|
|
392
|
-
border: `2px solid ${a.highlight}`,
|
|
393
|
-
borderRadius: "4px",
|
|
394
|
-
pointerEvents: "none",
|
|
395
|
-
zIndex: 99994,
|
|
396
|
-
boxShadow: "0 0 0 1px rgba(59, 130, 246, 0.3)"
|
|
397
|
-
},
|
|
398
|
-
"data-ui-lint": !0
|
|
399
|
-
}
|
|
400
|
-
),
|
|
401
|
-
/* @__PURE__ */ s.jsx(
|
|
402
|
-
"div",
|
|
403
|
-
{
|
|
404
|
-
style: {
|
|
405
|
-
position: "fixed",
|
|
406
|
-
top: x.y - 0,
|
|
407
|
-
left: x.x - 0,
|
|
408
|
-
zIndex: d ? 99999 : 99995,
|
|
409
|
-
cursor: "pointer",
|
|
410
|
-
transition: "transform 0.1s ease-out",
|
|
411
|
-
transform: `scale(${F})`,
|
|
412
|
-
transformOrigin: "center center",
|
|
413
|
-
pointerEvents: "auto"
|
|
414
|
-
// Re-enable pointer events for interactive badge
|
|
415
|
-
},
|
|
416
|
-
"data-ui-lint": !0,
|
|
417
|
-
onMouseEnter: r,
|
|
418
|
-
onMouseLeave: l,
|
|
419
|
-
onClick: h,
|
|
420
|
-
children: /* @__PURE__ */ s.jsx(
|
|
421
|
-
"div",
|
|
422
|
-
{
|
|
423
|
-
style: {
|
|
424
|
-
display: "flex",
|
|
425
|
-
alignItems: "center",
|
|
426
|
-
justifyContent: "center",
|
|
427
|
-
width: "18px",
|
|
428
|
-
height: "18px",
|
|
429
|
-
borderRadius: "50%",
|
|
430
|
-
backgroundColor: X,
|
|
431
|
-
boxShadow: a.shadow,
|
|
432
|
-
border: `1px solid ${a.border}`
|
|
433
|
-
},
|
|
434
|
-
children: u.status === "scanning" ? /* @__PURE__ */ s.jsx(
|
|
435
|
-
"div",
|
|
436
|
-
{
|
|
437
|
-
style: {
|
|
438
|
-
width: "10px",
|
|
439
|
-
height: "10px",
|
|
440
|
-
border: "2px solid rgba(255, 255, 255, 0.3)",
|
|
441
|
-
borderTopColor: "#FFFFFF",
|
|
442
|
-
borderRadius: "50%",
|
|
443
|
-
animation: "uilint-badge-spin 0.8s linear infinite"
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
) : u.status === "error" ? /* @__PURE__ */ s.jsx(we, {}) : u.status === "pending" ? /* @__PURE__ */ s.jsx(
|
|
447
|
-
"div",
|
|
448
|
-
{
|
|
449
|
-
style: {
|
|
450
|
-
width: "6px",
|
|
451
|
-
height: "6px",
|
|
452
|
-
borderRadius: "50%",
|
|
453
|
-
backgroundColor: "rgba(255, 255, 255, 0.4)"
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
) : L === 0 ? /* @__PURE__ */ s.jsx(ve, {}) : /* @__PURE__ */ s.jsx(
|
|
457
|
-
"span",
|
|
458
|
-
{
|
|
459
|
-
style: {
|
|
460
|
-
color: a.text,
|
|
461
|
-
fontSize: "10px",
|
|
462
|
-
fontWeight: 700,
|
|
463
|
-
fontFamily: a.font
|
|
464
|
-
},
|
|
465
|
-
children: L > 9 ? "9+" : L
|
|
466
|
-
}
|
|
467
|
-
)
|
|
468
|
-
}
|
|
469
|
-
)
|
|
470
|
-
}
|
|
471
|
-
),
|
|
472
|
-
d && R && /* @__PURE__ */ s.jsx(
|
|
473
|
-
"div",
|
|
474
|
-
{
|
|
475
|
-
style: C,
|
|
476
|
-
"data-ui-lint": !0,
|
|
477
|
-
onMouseEnter: r,
|
|
478
|
-
onMouseLeave: l,
|
|
479
|
-
children: n.map((g, E) => /* @__PURE__ */ s.jsx(
|
|
480
|
-
xe,
|
|
481
|
-
{
|
|
482
|
-
badge: g,
|
|
483
|
-
isHovered: c === E,
|
|
484
|
-
onMouseEnter: () => w(E),
|
|
485
|
-
onMouseLeave: () => w(null),
|
|
486
|
-
onClick: () => i(g.element, g.issue)
|
|
487
|
-
},
|
|
488
|
-
g.element.id
|
|
489
|
-
))
|
|
490
|
-
}
|
|
491
|
-
)
|
|
492
|
-
] });
|
|
493
|
-
}
|
|
494
|
-
function xe({
|
|
495
|
-
badge: e,
|
|
496
|
-
isHovered: t,
|
|
497
|
-
onMouseEnter: n,
|
|
498
|
-
onMouseLeave: o,
|
|
499
|
-
onClick: i
|
|
500
|
-
}) {
|
|
501
|
-
const d = ce(e.element), p = e.issue.status === "complete" ? e.issue.issues.length : 0, c = U(p);
|
|
502
|
-
return /* @__PURE__ */ s.jsxs(
|
|
503
|
-
"div",
|
|
504
|
-
{
|
|
505
|
-
style: {
|
|
506
|
-
display: "flex",
|
|
507
|
-
alignItems: "center",
|
|
508
|
-
justifyContent: "space-between",
|
|
509
|
-
padding: "8px 12px",
|
|
510
|
-
cursor: "pointer",
|
|
511
|
-
backgroundColor: t ? "rgba(59, 130, 246, 0.15)" : "transparent",
|
|
512
|
-
transition: "background-color 0.1s"
|
|
513
|
-
},
|
|
514
|
-
onMouseEnter: n,
|
|
515
|
-
onMouseLeave: o,
|
|
516
|
-
onClick: i,
|
|
517
|
-
children: [
|
|
518
|
-
/* @__PURE__ */ s.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
519
|
-
/* @__PURE__ */ s.jsx(
|
|
520
|
-
"div",
|
|
521
|
-
{
|
|
522
|
-
style: {
|
|
523
|
-
width: "6px",
|
|
524
|
-
height: "6px",
|
|
525
|
-
borderRadius: "50%",
|
|
526
|
-
backgroundColor: c
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
),
|
|
530
|
-
/* @__PURE__ */ s.jsx(
|
|
531
|
-
"span",
|
|
532
|
-
{
|
|
533
|
-
style: {
|
|
534
|
-
fontSize: "12px",
|
|
535
|
-
color: a.text,
|
|
536
|
-
maxWidth: "160px",
|
|
537
|
-
overflow: "hidden",
|
|
538
|
-
textOverflow: "ellipsis",
|
|
539
|
-
whiteSpace: "nowrap"
|
|
540
|
-
},
|
|
541
|
-
children: d
|
|
542
|
-
}
|
|
543
|
-
)
|
|
544
|
-
] }),
|
|
545
|
-
e.issue.status === "complete" && (p === 0 ? /* @__PURE__ */ s.jsx(
|
|
546
|
-
"div",
|
|
547
|
-
{
|
|
548
|
-
style: {
|
|
549
|
-
width: "14px",
|
|
550
|
-
height: "14px",
|
|
551
|
-
borderRadius: "50%",
|
|
552
|
-
backgroundColor: c,
|
|
553
|
-
display: "flex",
|
|
554
|
-
alignItems: "center",
|
|
555
|
-
justifyContent: "center"
|
|
556
|
-
},
|
|
557
|
-
children: /* @__PURE__ */ s.jsx(me, {})
|
|
558
|
-
}
|
|
559
|
-
) : /* @__PURE__ */ s.jsx(
|
|
560
|
-
"div",
|
|
561
|
-
{
|
|
562
|
-
style: {
|
|
563
|
-
minWidth: "16px",
|
|
564
|
-
height: "16px",
|
|
565
|
-
padding: "0 4px",
|
|
566
|
-
borderRadius: "8px",
|
|
567
|
-
backgroundColor: c,
|
|
568
|
-
color: a.text,
|
|
569
|
-
fontSize: "10px",
|
|
570
|
-
fontWeight: 700,
|
|
571
|
-
display: "flex",
|
|
572
|
-
alignItems: "center",
|
|
573
|
-
justifyContent: "center"
|
|
574
|
-
},
|
|
575
|
-
children: p > 9 ? "9+" : p
|
|
576
|
-
}
|
|
577
|
-
)),
|
|
578
|
-
e.issue.status === "scanning" && /* @__PURE__ */ s.jsx(
|
|
579
|
-
"div",
|
|
580
|
-
{
|
|
581
|
-
style: {
|
|
582
|
-
width: "12px",
|
|
583
|
-
height: "12px",
|
|
584
|
-
border: "2px solid rgba(59, 130, 246, 0.3)",
|
|
585
|
-
borderTopColor: a.highlight,
|
|
586
|
-
borderRadius: "50%",
|
|
587
|
-
animation: "uilint-badge-spin 0.8s linear infinite"
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
),
|
|
591
|
-
e.issue.status === "error" && /* @__PURE__ */ s.jsx(
|
|
592
|
-
"div",
|
|
593
|
-
{
|
|
594
|
-
style: {
|
|
595
|
-
width: "14px",
|
|
596
|
-
height: "14px",
|
|
597
|
-
borderRadius: "50%",
|
|
598
|
-
backgroundColor: a.error,
|
|
599
|
-
display: "flex",
|
|
600
|
-
alignItems: "center",
|
|
601
|
-
justifyContent: "center"
|
|
602
|
-
},
|
|
603
|
-
children: /* @__PURE__ */ s.jsx(ye, {})
|
|
604
|
-
}
|
|
605
|
-
),
|
|
606
|
-
e.issue.status === "pending" && /* @__PURE__ */ s.jsx(
|
|
607
|
-
"div",
|
|
608
|
-
{
|
|
609
|
-
style: {
|
|
610
|
-
width: "8px",
|
|
611
|
-
height: "8px",
|
|
612
|
-
borderRadius: "50%",
|
|
613
|
-
backgroundColor: "rgba(156, 163, 175, 0.5)"
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
)
|
|
617
|
-
]
|
|
618
|
-
}
|
|
619
|
-
);
|
|
620
|
-
}
|
|
621
|
-
function me() {
|
|
622
|
-
return /* @__PURE__ */ s.jsx("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ s.jsx(
|
|
623
|
-
"path",
|
|
624
|
-
{
|
|
625
|
-
d: "M20 6L9 17l-5-5",
|
|
626
|
-
stroke: a.text,
|
|
627
|
-
strokeWidth: "3",
|
|
628
|
-
strokeLinecap: "round",
|
|
629
|
-
strokeLinejoin: "round"
|
|
630
|
-
}
|
|
631
|
-
) });
|
|
632
|
-
}
|
|
633
|
-
function ve() {
|
|
634
|
-
return /* @__PURE__ */ s.jsx("svg", { width: "8", height: "8", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ s.jsx(
|
|
635
|
-
"path",
|
|
636
|
-
{
|
|
637
|
-
d: "M20 6L9 17l-5-5",
|
|
638
|
-
stroke: a.text,
|
|
639
|
-
strokeWidth: "4",
|
|
640
|
-
strokeLinecap: "round",
|
|
641
|
-
strokeLinejoin: "round"
|
|
642
|
-
}
|
|
643
|
-
) });
|
|
644
|
-
}
|
|
645
|
-
function we() {
|
|
646
|
-
return /* @__PURE__ */ s.jsx("svg", { width: "8", height: "8", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ s.jsx(
|
|
647
|
-
"path",
|
|
648
|
-
{
|
|
649
|
-
d: "M12 8v4M12 16h.01",
|
|
650
|
-
stroke: a.text,
|
|
651
|
-
strokeWidth: "4",
|
|
652
|
-
strokeLinecap: "round",
|
|
653
|
-
strokeLinejoin: "round"
|
|
654
|
-
}
|
|
655
|
-
) });
|
|
656
|
-
}
|
|
657
|
-
function ye() {
|
|
658
|
-
return /* @__PURE__ */ s.jsx("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ s.jsx(
|
|
659
|
-
"path",
|
|
660
|
-
{
|
|
661
|
-
d: "M12 8v4M12 16h.01",
|
|
662
|
-
stroke: a.text,
|
|
663
|
-
strokeWidth: "3",
|
|
664
|
-
strokeLinecap: "round",
|
|
665
|
-
strokeLinejoin: "round"
|
|
666
|
-
}
|
|
667
|
-
) });
|
|
668
|
-
}
|
|
669
|
-
export {
|
|
670
|
-
Ce as ElementBadges
|
|
671
|
-
};
|
|
672
|
-
//# sourceMappingURL=ElementBadges-H5_y7fLt.js.map
|