uilint-react 0.1.19 → 0.1.21
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 +50 -93
- package/dist/{InspectionPanel-6DBGEWWD.js → InspectionPanel-ZBDXQ2LU.js} +2 -2
- package/dist/LocatorOverlay-3H446RPO.js +11 -0
- package/dist/{UILintToolbar-7ZYCQC4M.js → UILintToolbar-C6HOAJA4.js} +2 -2
- package/dist/{chunk-KUFV22FO.js → chunk-3DNDKMZ4.js} +72 -2
- package/dist/{chunk-3TA6OKS6.js → chunk-CWCKS753.js} +417 -90
- package/dist/{chunk-7WYVWDRU.js → chunk-EBU7YY73.js} +53 -218
- package/dist/chunk-GUF36FGA.js +276 -0
- package/dist/index.d.ts +26 -65
- package/dist/index.js +33 -1097
- package/package.json +2 -2
- package/dist/LocatorOverlay-FQEYAMT6.js +0 -9
- package/dist/SourceOverlays-2SEINA2B.js +0 -9
- package/dist/chunk-MEP7WO7U.js +0 -210
- package/dist/chunk-OWX36QE3.js +0 -595
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React$1 from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { GroupedSnapshot, Violation, DOMSnapshot, ExtractedStyles, AnalysisResult } from 'uilint-core';
|
|
4
4
|
export { AnalysisResult, ConsistencyResult, DOMSnapshot, ElementRole, ElementSnapshot, ExtractedStyles, GroupedSnapshot, SerializedStyles, StyleGuide, StyleSnapshot, UILintIssue, Violation, ViolationCategory, ViolationSeverity, createEmptyStyleGuide, createStyleSummary, extractStylesFromDOM, generateStyleGuideFromStyles as generateStyleGuide, mergeStyleGuides, parseStyleGuide, serializeStyles } from 'uilint-core';
|
|
5
5
|
|
|
6
|
-
interface UILintProps {
|
|
7
|
-
children: React$1.ReactNode;
|
|
8
|
-
enabled?: boolean;
|
|
9
|
-
position?: "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
|
10
|
-
autoScan?: boolean;
|
|
11
|
-
apiEndpoint?: string;
|
|
12
|
-
}
|
|
13
|
-
interface UILintContextValue$1 {
|
|
14
|
-
violations: Violation[];
|
|
15
|
-
isScanning: boolean;
|
|
16
|
-
elementCount: number;
|
|
17
|
-
scan: () => Promise<void>;
|
|
18
|
-
clearViolations: () => void;
|
|
19
|
-
selectedViolation: Violation | null;
|
|
20
|
-
setSelectedViolation: (violation: Violation | null) => void;
|
|
21
|
-
lockedViolation: Violation | null;
|
|
22
|
-
setLockedViolation: (violation: Violation | null) => void;
|
|
23
|
-
}
|
|
24
|
-
declare function useUILint(): UILintContextValue$1;
|
|
25
|
-
declare function UILint({ children, enabled, position, autoScan, apiEndpoint, }: UILintProps): react_jsx_runtime.JSX.Element;
|
|
26
|
-
|
|
27
6
|
/**
|
|
28
7
|
* Types for UILint Source Visualization
|
|
29
8
|
*/
|
|
@@ -67,15 +46,8 @@ interface SourceFile {
|
|
|
67
46
|
* User-configurable settings for the overlay
|
|
68
47
|
*/
|
|
69
48
|
interface UILintSettings {
|
|
70
|
-
showLabels: boolean;
|
|
71
49
|
hideNodeModules: boolean;
|
|
72
|
-
overlayOpacity: number;
|
|
73
|
-
labelPosition: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
74
50
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Operating modes for the UILint overlay
|
|
77
|
-
*/
|
|
78
|
-
type UILintMode = "off" | "sources" | "inspect";
|
|
79
51
|
/**
|
|
80
52
|
* Element detected under the cursor during Alt-key locator mode
|
|
81
53
|
*/
|
|
@@ -87,22 +59,21 @@ interface LocatorTarget {
|
|
|
87
59
|
/** Index in the component stack (0 = current element, higher = parent) */
|
|
88
60
|
stackIndex: number;
|
|
89
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Element being inspected in the sidebar
|
|
64
|
+
*/
|
|
65
|
+
interface InspectedElement {
|
|
66
|
+
element: Element;
|
|
67
|
+
source: SourceLocation | null;
|
|
68
|
+
componentStack: ComponentInfo[];
|
|
69
|
+
rect: DOMRect;
|
|
70
|
+
}
|
|
90
71
|
/**
|
|
91
72
|
* Context value provided by UILintProvider
|
|
92
73
|
*/
|
|
93
74
|
interface UILintContextValue {
|
|
94
|
-
mode: UILintMode;
|
|
95
|
-
setMode: (mode: UILintMode) => void;
|
|
96
|
-
scannedElements: ScannedElement[];
|
|
97
|
-
sourceFiles: SourceFile[];
|
|
98
|
-
selectedElement: ScannedElement | null;
|
|
99
|
-
setSelectedElement: (element: ScannedElement | null) => void;
|
|
100
|
-
hoveredElement: ScannedElement | null;
|
|
101
|
-
setHoveredElement: (element: ScannedElement | null) => void;
|
|
102
75
|
settings: UILintSettings;
|
|
103
76
|
updateSettings: (settings: Partial<UILintSettings>) => void;
|
|
104
|
-
rescan: () => void;
|
|
105
|
-
isScanning: boolean;
|
|
106
77
|
/** True when Alt/Option key is held down */
|
|
107
78
|
altKeyHeld: boolean;
|
|
108
79
|
/** Current element under cursor when Alt is held */
|
|
@@ -111,6 +82,10 @@ interface UILintContextValue {
|
|
|
111
82
|
locatorGoUp: () => void;
|
|
112
83
|
/** Navigate to child component in locator mode */
|
|
113
84
|
locatorGoDown: () => void;
|
|
85
|
+
/** Element currently being inspected in sidebar */
|
|
86
|
+
inspectedElement: InspectedElement | null;
|
|
87
|
+
/** Set the element to inspect (opens sidebar) */
|
|
88
|
+
setInspectedElement: (element: InspectedElement | null) => void;
|
|
114
89
|
}
|
|
115
90
|
/**
|
|
116
91
|
* Props for the UILintProvider component
|
|
@@ -118,7 +93,6 @@ interface UILintContextValue {
|
|
|
118
93
|
interface UILintProviderProps {
|
|
119
94
|
children: React.ReactNode;
|
|
120
95
|
enabled?: boolean;
|
|
121
|
-
defaultMode?: UILintMode;
|
|
122
96
|
}
|
|
123
97
|
/**
|
|
124
98
|
* Response from the source API
|
|
@@ -155,34 +129,36 @@ declare function useUILintContext(): UILintContextValue;
|
|
|
155
129
|
/**
|
|
156
130
|
* UILint Provider Component
|
|
157
131
|
*/
|
|
158
|
-
declare function UILintProvider({ children, enabled,
|
|
132
|
+
declare function UILintProvider({ children, enabled, }: UILintProviderProps): react_jsx_runtime.JSX.Element;
|
|
159
133
|
|
|
160
134
|
/**
|
|
161
|
-
* UILint Toolbar -
|
|
135
|
+
* UILint Toolbar - Simple floating button with settings popover
|
|
162
136
|
*/
|
|
163
137
|
|
|
164
138
|
/**
|
|
165
|
-
* Main Toolbar Component
|
|
139
|
+
* Main Toolbar Component - Simple floating button with settings popover
|
|
166
140
|
*/
|
|
167
141
|
declare function UILintToolbar(): React$1.ReactPortal | null;
|
|
168
142
|
|
|
169
143
|
/**
|
|
170
|
-
*
|
|
144
|
+
* Inspection Panel - Slide-out sidebar showing element details, source preview,
|
|
145
|
+
* and LLM analysis with clipboard-ready fix prompts
|
|
171
146
|
*/
|
|
172
147
|
|
|
173
148
|
/**
|
|
174
|
-
* Main
|
|
149
|
+
* Main Inspection Panel Component
|
|
175
150
|
*/
|
|
176
|
-
declare function
|
|
151
|
+
declare function InspectionPanel(): React$1.ReactPortal | null;
|
|
177
152
|
|
|
178
153
|
/**
|
|
179
|
-
*
|
|
154
|
+
* Locator Overlay - Shows element info when Alt/Option key is held
|
|
155
|
+
* Inspired by LocatorJS for a quick "hover to find source" experience
|
|
180
156
|
*/
|
|
181
157
|
|
|
182
158
|
/**
|
|
183
|
-
* Main
|
|
159
|
+
* Main Locator Overlay Component
|
|
184
160
|
*/
|
|
185
|
-
declare function
|
|
161
|
+
declare function LocatorOverlay(): React$1.ReactPortal | null;
|
|
186
162
|
|
|
187
163
|
/**
|
|
188
164
|
* React Fiber inspection utilities for source file visualization
|
|
@@ -287,21 +263,6 @@ declare function getCachedSource(filePath: string): SourceApiResponse | null;
|
|
|
287
263
|
*/
|
|
288
264
|
declare function prefetchSources(filePaths: string[]): Promise<void>;
|
|
289
265
|
|
|
290
|
-
interface UseElementScanOptions {
|
|
291
|
-
enabled: boolean;
|
|
292
|
-
settings: UILintSettings;
|
|
293
|
-
}
|
|
294
|
-
interface UseElementScanResult {
|
|
295
|
-
elements: ScannedElement[];
|
|
296
|
-
sourceFiles: SourceFile[];
|
|
297
|
-
isScanning: boolean;
|
|
298
|
-
rescan: () => void;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Hook for managing element scanning
|
|
302
|
-
*/
|
|
303
|
-
declare function useElementScan({ enabled, settings, }: UseElementScanOptions): UseElementScanResult;
|
|
304
|
-
|
|
305
266
|
/**
|
|
306
267
|
* DOM snapshotting for consistency analysis
|
|
307
268
|
*/
|
|
@@ -382,4 +343,4 @@ declare class LLMClient {
|
|
|
382
343
|
generateStyleGuide(styles: ExtractedStyles): Promise<string | null>;
|
|
383
344
|
}
|
|
384
345
|
|
|
385
|
-
export { type CachedSource, type ComponentInfo, ConsistencyHighlighter, DATA_UILINT_ID, DEFAULT_SETTINGS, FILE_COLORS, InspectionPanel, LLMClient,
|
|
346
|
+
export { type CachedSource, type ComponentInfo, ConsistencyHighlighter, DATA_UILINT_ID, DEFAULT_SETTINGS, FILE_COLORS, type InspectedElement, InspectionPanel, LLMClient, LocatorOverlay, type LocatorTarget, type ScannedElement, type SourceApiResponse, type SourceFile, type SourceLocation, type UILintContextValue, UILintProvider, type UILintProviderProps, type UILintSettings, UILintToolbar, buildEditorUrl, cleanupDataAttributes, cleanupDataElements, clearSourceCache, createSnapshot, fetchSource, fetchSourceWithContext, getCachedSource, getComponentStack, getDebugOwner, getDebugSource, getDisplayName, getElementById, getElementBySnapshotId, getFiberFromElement, groupBySourceFile, isBrowser, isJSDOM, isNode, isNodeModulesPath, prefetchSources, scanDOM, scanDOMForSources, updateElementRects, useUILintContext };
|