uilint-react 0.2.0 → 0.2.3
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/DevTool.d.ts +11 -0
- package/dist/DevTool.d.ts.map +1 -0
- package/dist/ElementBadges-BNRIjtRW.js +672 -0
- package/dist/ElementBadges-BNRIjtRW.js.map +1 -0
- package/dist/VisionIssueBadge-C6vfwtec.js +154 -0
- package/dist/VisionIssueBadge-C6vfwtec.js.map +1 -0
- package/dist/components/Highlighter.d.ts +6 -0
- package/dist/components/Highlighter.d.ts.map +1 -0
- package/dist/components/ui-lint/ElementBadges.d.ts +6 -0
- package/dist/components/ui-lint/ElementBadges.d.ts.map +1 -0
- package/dist/components/ui-lint/InspectionPanel.d.ts +6 -0
- package/dist/components/ui-lint/InspectionPanel.d.ts.map +1 -0
- package/dist/components/ui-lint/LocatorOverlay.d.ts +14 -0
- package/dist/components/ui-lint/LocatorOverlay.d.ts.map +1 -0
- package/dist/components/ui-lint/RegionSelector.d.ts +18 -0
- package/dist/components/ui-lint/RegionSelector.d.ts.map +1 -0
- package/dist/components/ui-lint/ScanResultsPopover.d.ts +6 -0
- package/dist/components/ui-lint/ScanResultsPopover.d.ts.map +1 -0
- package/dist/components/ui-lint/ScreenshotViewer.d.ts +11 -0
- package/dist/components/ui-lint/ScreenshotViewer.d.ts.map +1 -0
- package/dist/components/ui-lint/UILintProvider.d.ts +11 -0
- package/dist/components/ui-lint/UILintProvider.d.ts.map +1 -0
- package/dist/components/ui-lint/VisionIssueBadge.d.ts +6 -0
- package/dist/components/ui-lint/VisionIssueBadge.d.ts.map +1 -0
- package/dist/components/ui-lint/VisionIssuesPanel.d.ts +12 -0
- package/dist/components/ui-lint/VisionIssuesPanel.d.ts.map +1 -0
- package/dist/components/ui-lint/badge-layout.d.ts +91 -0
- package/dist/components/ui-lint/badge-layout.d.ts.map +1 -0
- package/dist/components/ui-lint/code-formatting.d.ts +14 -0
- package/dist/components/ui-lint/code-formatting.d.ts.map +1 -0
- package/dist/components/ui-lint/dom-utils.d.ts +43 -0
- package/dist/components/ui-lint/dom-utils.d.ts.map +1 -0
- package/dist/components/ui-lint/index.d.ts +22 -0
- package/dist/components/ui-lint/index.d.ts.map +1 -0
- package/dist/components/ui-lint/inspection-panel-positioning.d.ts +41 -0
- package/dist/components/ui-lint/inspection-panel-positioning.d.ts.map +1 -0
- package/dist/components/ui-lint/portal-host.d.ts +3 -0
- package/dist/components/ui-lint/portal-host.d.ts.map +1 -0
- package/dist/components/ui-lint/scan-results/FileTree.d.ts +25 -0
- package/dist/components/ui-lint/scan-results/FileTree.d.ts.map +1 -0
- package/dist/components/ui-lint/scan-results/IssueRow.d.ts +16 -0
- package/dist/components/ui-lint/scan-results/IssueRow.d.ts.map +1 -0
- package/dist/components/ui-lint/scan-results/SearchFilter.d.ts +8 -0
- package/dist/components/ui-lint/scan-results/SearchFilter.d.ts.map +1 -0
- package/dist/components/ui-lint/source-fetcher.d.ts +40 -0
- package/dist/components/ui-lint/source-fetcher.d.ts.map +1 -0
- package/dist/components/ui-lint/store.d.ts +194 -0
- package/dist/components/ui-lint/store.d.ts.map +1 -0
- package/dist/components/ui-lint/toolbar/TabbedToolbar.d.ts +2 -0
- package/dist/components/ui-lint/toolbar/TabbedToolbar.d.ts.map +1 -0
- package/dist/components/ui-lint/toolbar/icons.d.ts +29 -0
- package/dist/components/ui-lint/toolbar/icons.d.ts.map +1 -0
- package/dist/components/ui-lint/toolbar/index.d.ts +3 -0
- package/dist/components/ui-lint/toolbar/index.d.ts.map +1 -0
- package/dist/components/ui-lint/toolbar/tabs/ConfigureTab.d.ts +2 -0
- package/dist/components/ui-lint/toolbar/tabs/ConfigureTab.d.ts.map +1 -0
- package/dist/components/ui-lint/toolbar/tabs/ESLintTab.d.ts +2 -0
- package/dist/components/ui-lint/toolbar/tabs/ESLintTab.d.ts.map +1 -0
- package/dist/components/ui-lint/toolbar/tabs/VisionTab.d.ts +2 -0
- package/dist/components/ui-lint/toolbar/tabs/VisionTab.d.ts.map +1 -0
- package/dist/components/ui-lint/toolbar/tokens.d.ts +45 -0
- package/dist/components/ui-lint/toolbar/tokens.d.ts.map +1 -0
- package/dist/components/ui-lint/types.d.ts +170 -0
- package/dist/components/ui-lint/types.d.ts.map +1 -0
- package/dist/components/ui-lint/useDOMObserver.d.ts +11 -0
- package/dist/components/ui-lint/useDOMObserver.d.ts.map +1 -0
- package/dist/components/ui-lint/visibility-utils.d.ts +41 -0
- package/dist/components/ui-lint/visibility-utils.d.ts.map +1 -0
- package/dist/consistency/highlights.d.ts +14 -0
- package/dist/consistency/highlights.d.ts.map +1 -0
- package/dist/consistency/index.d.ts +7 -0
- package/dist/consistency/index.d.ts.map +1 -0
- package/dist/consistency/snapshot.d.ts +14 -0
- package/dist/consistency/snapshot.d.ts.map +1 -0
- package/dist/consistency/types.d.ts +5 -0
- package/dist/consistency/types.d.ts.map +1 -0
- package/dist/devtools.d.ts +8 -0
- package/dist/devtools.d.ts.map +1 -0
- package/dist/devtools.js +259 -0
- package/dist/devtools.js.map +1 -0
- package/dist/environment-DVxa60C6.js +26 -0
- package/dist/environment-DVxa60C6.js.map +1 -0
- package/dist/index-BGzkrD0y.js +12304 -0
- package/dist/index-BGzkrD0y.js.map +1 -0
- package/dist/index-L3Zm-CoX.js +513 -0
- package/dist/index-L3Zm-CoX.js.map +1 -0
- package/dist/index.d.ts +13 -339
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -482
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +11 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/node.d.ts +7 -38
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +32 -79
- package/dist/node.js.map +1 -0
- package/dist/scanner/dom-scanner.d.ts +7 -0
- package/dist/scanner/dom-scanner.d.ts.map +1 -0
- package/dist/scanner/environment.d.ts +16 -0
- package/dist/scanner/environment.d.ts.map +1 -0
- package/dist/scanner/jsdom-adapter.d.ts +30 -0
- package/dist/scanner/jsdom-adapter.d.ts.map +1 -0
- package/dist/scanner/vision-capture.d.ts +131 -0
- package/dist/scanner/vision-capture.d.ts.map +1 -0
- package/dist/styles/inject-styles.d.ts +2 -0
- package/dist/styles/inject-styles.d.ts.map +1 -0
- package/dist/vision-capture-EIrYA_XF.js +216 -0
- package/dist/vision-capture-EIrYA_XF.js.map +1 -0
- package/dist/web-component.d.ts +2 -0
- package/dist/web-component.d.ts.map +1 -0
- package/package.json +36 -7
- package/dist/ElementBadges-2CTPMJ6L.js +0 -825
- package/dist/InspectionPanel-NXSE7CMH.js +0 -10
- package/dist/LocatorOverlay-3TKK74BD.js +0 -11
- package/dist/UILintToolbar-CLVXQHCZ.js +0 -10
- package/dist/chunk-552GIJIQ.js +0 -1109
- package/dist/chunk-K46BWHFU.js +0 -271
- package/dist/chunk-KKNPFLL2.js +0 -1853
- package/dist/chunk-S4IWHBOQ.js +0 -178
- package/dist/chunk-Z4AAGFIN.js +0 -933
package/dist/chunk-K46BWHFU.js
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useUILintContext
|
|
4
|
-
} from "./chunk-552GIJIQ.js";
|
|
5
|
-
|
|
6
|
-
// src/components/ui-lint/LocatorOverlay.tsx
|
|
7
|
-
import { useState, useEffect, useMemo } from "react";
|
|
8
|
-
import { createPortal } from "react-dom";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
var STYLES = {
|
|
11
|
-
bg: "rgba(17, 24, 39, 0.95)",
|
|
12
|
-
border: "rgba(59, 130, 246, 0.8)",
|
|
13
|
-
borderHighlight: "#3B82F6",
|
|
14
|
-
text: "#F9FAFB",
|
|
15
|
-
textMuted: "#9CA3AF",
|
|
16
|
-
accent: "#3B82F6",
|
|
17
|
-
font: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
18
|
-
fontMono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace',
|
|
19
|
-
shadow: "0 4px 20px rgba(0, 0, 0, 0.5)",
|
|
20
|
-
blur: "blur(12px)"
|
|
21
|
-
};
|
|
22
|
-
function getFileName(path) {
|
|
23
|
-
const parts = path.split("/");
|
|
24
|
-
return parts[parts.length - 1] || path;
|
|
25
|
-
}
|
|
26
|
-
function LocatorOverlay() {
|
|
27
|
-
const { locatorTarget } = useUILintContext();
|
|
28
|
-
const [mounted, setMounted] = useState(false);
|
|
29
|
-
const handleUILintInteraction = (e) => {
|
|
30
|
-
e.stopPropagation();
|
|
31
|
-
};
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setMounted(true);
|
|
34
|
-
}, []);
|
|
35
|
-
const currentSource = useMemo(() => {
|
|
36
|
-
if (!locatorTarget) return null;
|
|
37
|
-
return locatorTarget.source;
|
|
38
|
-
}, [locatorTarget]);
|
|
39
|
-
const currentName = useMemo(() => {
|
|
40
|
-
if (!locatorTarget) return "";
|
|
41
|
-
return locatorTarget.element.tagName.toLowerCase();
|
|
42
|
-
}, [locatorTarget]);
|
|
43
|
-
if (!mounted || !locatorTarget) return null;
|
|
44
|
-
const { rect } = locatorTarget;
|
|
45
|
-
const content = /* @__PURE__ */ jsxs(
|
|
46
|
-
"div",
|
|
47
|
-
{
|
|
48
|
-
"data-ui-lint": true,
|
|
49
|
-
onMouseDown: handleUILintInteraction,
|
|
50
|
-
onPointerDown: handleUILintInteraction,
|
|
51
|
-
onClick: handleUILintInteraction,
|
|
52
|
-
onKeyDown: handleUILintInteraction,
|
|
53
|
-
style: { pointerEvents: "none" },
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
56
|
-
@keyframes uilint-locator-fade-in {
|
|
57
|
-
from { opacity: 0; }
|
|
58
|
-
to { opacity: 1; }
|
|
59
|
-
}
|
|
60
|
-
@keyframes uilint-locator-pulse {
|
|
61
|
-
0%, 100% { opacity: 0.8; }
|
|
62
|
-
50% { opacity: 1; }
|
|
63
|
-
}
|
|
64
|
-
` }),
|
|
65
|
-
/* @__PURE__ */ jsx(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
style: {
|
|
69
|
-
position: "fixed",
|
|
70
|
-
top: rect.top - 2,
|
|
71
|
-
left: rect.left - 2,
|
|
72
|
-
width: rect.width + 4,
|
|
73
|
-
height: rect.height + 4,
|
|
74
|
-
border: `2px solid ${STYLES.borderHighlight}`,
|
|
75
|
-
borderRadius: "4px",
|
|
76
|
-
boxShadow: `0 0 0 1px rgba(59, 130, 246, 0.3), inset 0 0 0 1px rgba(59, 130, 246, 0.1)`,
|
|
77
|
-
animation: "uilint-locator-fade-in 0.1s ease-out",
|
|
78
|
-
zIndex: 99997
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
/* @__PURE__ */ jsx(
|
|
83
|
-
InfoTooltip,
|
|
84
|
-
{
|
|
85
|
-
rect,
|
|
86
|
-
source: currentSource,
|
|
87
|
-
componentName: currentName
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
return createPortal(content, document.body);
|
|
94
|
-
}
|
|
95
|
-
function InfoTooltip({ rect, source, componentName }) {
|
|
96
|
-
const viewportHeight = window.innerHeight;
|
|
97
|
-
const spaceAbove = rect.top;
|
|
98
|
-
const spaceBelow = viewportHeight - rect.bottom;
|
|
99
|
-
const positionAbove = spaceAbove > 100 || spaceBelow < 100;
|
|
100
|
-
const tooltipStyle = {
|
|
101
|
-
position: "fixed",
|
|
102
|
-
left: Math.max(8, Math.min(rect.left, window.innerWidth - 320)),
|
|
103
|
-
zIndex: 99999,
|
|
104
|
-
animation: "uilint-locator-fade-in 0.15s ease-out"
|
|
105
|
-
};
|
|
106
|
-
if (positionAbove) {
|
|
107
|
-
tooltipStyle.bottom = viewportHeight - rect.top + 8;
|
|
108
|
-
} else {
|
|
109
|
-
tooltipStyle.top = rect.bottom + 8;
|
|
110
|
-
}
|
|
111
|
-
return /* @__PURE__ */ jsxs(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
style: {
|
|
115
|
-
...tooltipStyle,
|
|
116
|
-
display: "flex",
|
|
117
|
-
flexDirection: "column",
|
|
118
|
-
gap: "6px",
|
|
119
|
-
padding: "10px 12px",
|
|
120
|
-
borderRadius: "8px",
|
|
121
|
-
backgroundColor: STYLES.bg,
|
|
122
|
-
backdropFilter: STYLES.blur,
|
|
123
|
-
WebkitBackdropFilter: STYLES.blur,
|
|
124
|
-
border: `1px solid ${STYLES.border}`,
|
|
125
|
-
boxShadow: STYLES.shadow,
|
|
126
|
-
fontFamily: STYLES.font,
|
|
127
|
-
maxWidth: "320px",
|
|
128
|
-
pointerEvents: "auto"
|
|
129
|
-
},
|
|
130
|
-
children: [
|
|
131
|
-
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ jsxs(
|
|
132
|
-
"span",
|
|
133
|
-
{
|
|
134
|
-
style: {
|
|
135
|
-
fontSize: "13px",
|
|
136
|
-
fontWeight: 600,
|
|
137
|
-
color: STYLES.accent
|
|
138
|
-
},
|
|
139
|
-
children: [
|
|
140
|
-
"<",
|
|
141
|
-
componentName,
|
|
142
|
-
" />"
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
) }),
|
|
146
|
-
source && /* @__PURE__ */ jsxs(
|
|
147
|
-
"div",
|
|
148
|
-
{
|
|
149
|
-
style: {
|
|
150
|
-
display: "flex",
|
|
151
|
-
alignItems: "center",
|
|
152
|
-
gap: "6px",
|
|
153
|
-
fontSize: "11px",
|
|
154
|
-
fontFamily: STYLES.fontMono,
|
|
155
|
-
color: STYLES.text
|
|
156
|
-
},
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ jsx("span", { style: { opacity: 0.9 }, children: getFileName(source.fileName) }),
|
|
159
|
-
/* @__PURE__ */ jsx("span", { style: { color: STYLES.textMuted }, children: ":" }),
|
|
160
|
-
/* @__PURE__ */ jsx("span", { style: { color: STYLES.accent }, children: source.lineNumber })
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
),
|
|
164
|
-
/* @__PURE__ */ jsx(
|
|
165
|
-
"div",
|
|
166
|
-
{
|
|
167
|
-
style: {
|
|
168
|
-
display: "flex",
|
|
169
|
-
alignItems: "center",
|
|
170
|
-
gap: "12px",
|
|
171
|
-
fontSize: "10px",
|
|
172
|
-
color: STYLES.textMuted,
|
|
173
|
-
borderTop: `1px solid rgba(75, 85, 99, 0.3)`,
|
|
174
|
-
paddingTop: "8px",
|
|
175
|
-
marginTop: "2px"
|
|
176
|
-
},
|
|
177
|
-
children: /* @__PURE__ */ jsx("span", { children: "Click to inspect" })
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
function InspectedElementHighlight() {
|
|
185
|
-
const { inspectedElement } = useUILintContext();
|
|
186
|
-
const [mounted, setMounted] = useState(false);
|
|
187
|
-
const [rect, setRect] = useState(null);
|
|
188
|
-
const handleUILintInteraction = (e) => {
|
|
189
|
-
e.stopPropagation();
|
|
190
|
-
};
|
|
191
|
-
useEffect(() => {
|
|
192
|
-
setMounted(true);
|
|
193
|
-
}, []);
|
|
194
|
-
useEffect(() => {
|
|
195
|
-
if (!inspectedElement?.element) return;
|
|
196
|
-
const updateRect = () => {
|
|
197
|
-
if (inspectedElement.element) {
|
|
198
|
-
setRect(inspectedElement.element.getBoundingClientRect());
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
updateRect();
|
|
202
|
-
window.addEventListener("scroll", updateRect, true);
|
|
203
|
-
window.addEventListener("resize", updateRect);
|
|
204
|
-
return () => {
|
|
205
|
-
window.removeEventListener("scroll", updateRect, true);
|
|
206
|
-
window.removeEventListener("resize", updateRect);
|
|
207
|
-
};
|
|
208
|
-
}, [inspectedElement?.element]);
|
|
209
|
-
if (!mounted || !inspectedElement || !rect) return null;
|
|
210
|
-
const content = /* @__PURE__ */ jsxs(
|
|
211
|
-
"div",
|
|
212
|
-
{
|
|
213
|
-
"data-ui-lint": true,
|
|
214
|
-
onMouseDown: handleUILintInteraction,
|
|
215
|
-
onPointerDown: handleUILintInteraction,
|
|
216
|
-
onClick: handleUILintInteraction,
|
|
217
|
-
onKeyDown: handleUILintInteraction,
|
|
218
|
-
style: { pointerEvents: "none" },
|
|
219
|
-
children: [
|
|
220
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
221
|
-
@keyframes uilint-inspected-pulse {
|
|
222
|
-
0%, 100% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.6), 0 0 8px rgba(16, 185, 129, 0.3); }
|
|
223
|
-
50% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.8), 0 0 16px rgba(16, 185, 129, 0.5); }
|
|
224
|
-
}
|
|
225
|
-
` }),
|
|
226
|
-
/* @__PURE__ */ jsx(
|
|
227
|
-
"div",
|
|
228
|
-
{
|
|
229
|
-
style: {
|
|
230
|
-
position: "fixed",
|
|
231
|
-
top: rect.top - 3,
|
|
232
|
-
left: rect.left - 3,
|
|
233
|
-
width: rect.width + 6,
|
|
234
|
-
height: rect.height + 6,
|
|
235
|
-
border: "2px solid #10B981",
|
|
236
|
-
borderRadius: "6px",
|
|
237
|
-
backgroundColor: "rgba(16, 185, 129, 0.08)",
|
|
238
|
-
animation: "uilint-inspected-pulse 2s ease-in-out infinite",
|
|
239
|
-
zIndex: 99996
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
),
|
|
243
|
-
/* @__PURE__ */ jsx(
|
|
244
|
-
"div",
|
|
245
|
-
{
|
|
246
|
-
style: {
|
|
247
|
-
position: "fixed",
|
|
248
|
-
top: rect.top - 24,
|
|
249
|
-
left: rect.left - 3,
|
|
250
|
-
padding: "2px 8px",
|
|
251
|
-
backgroundColor: "#10B981",
|
|
252
|
-
color: "#FFFFFF",
|
|
253
|
-
fontSize: "10px",
|
|
254
|
-
fontWeight: 600,
|
|
255
|
-
fontFamily: STYLES.font,
|
|
256
|
-
borderRadius: "4px 4px 0 0",
|
|
257
|
-
zIndex: 99996
|
|
258
|
-
},
|
|
259
|
-
children: "Inspecting"
|
|
260
|
-
}
|
|
261
|
-
)
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
);
|
|
265
|
-
return createPortal(content, document.body);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export {
|
|
269
|
-
LocatorOverlay,
|
|
270
|
-
InspectedElementHighlight
|
|
271
|
-
};
|