uilint-react 0.1.16 → 0.1.18
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/index.d.ts +43 -3
- package/dist/index.js +763 -266
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { DOMSnapshot, ExtractedStyles, AnalysisResult } from 'uilint-core';
|
|
4
|
-
export { AnalysisResult, DOMSnapshot, ExtractedStyles, SerializedStyles, StyleGuide, UILintIssue, createEmptyStyleGuide, createStyleSummary, extractStylesFromDOM, generateStyleGuideFromStyles as generateStyleGuide, mergeStyleGuides, parseStyleGuide, serializeStyles } from 'uilint-core';
|
|
3
|
+
import { Violation, GroupedSnapshot, DOMSnapshot, ExtractedStyles, AnalysisResult } from 'uilint-core';
|
|
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
6
|
interface UILintProps {
|
|
7
7
|
children: React.ReactNode;
|
|
@@ -10,8 +10,48 @@ interface UILintProps {
|
|
|
10
10
|
autoScan?: boolean;
|
|
11
11
|
apiEndpoint?: string;
|
|
12
12
|
}
|
|
13
|
+
interface UILintContextValue {
|
|
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;
|
|
13
25
|
declare function UILint({ children, enabled, position, autoScan, apiEndpoint, }: UILintProps): react_jsx_runtime.JSX.Element;
|
|
14
26
|
|
|
27
|
+
/**
|
|
28
|
+
* DOM snapshotting for consistency analysis
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Cleans up data-elements attributes from previous scans
|
|
33
|
+
*/
|
|
34
|
+
declare function cleanupDataElements(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a grouped snapshot of DOM elements for consistency analysis
|
|
37
|
+
*/
|
|
38
|
+
declare function createSnapshot(root?: Element): GroupedSnapshot;
|
|
39
|
+
/**
|
|
40
|
+
* Gets an element by its data-elements ID
|
|
41
|
+
*/
|
|
42
|
+
declare function getElementBySnapshotId(id: string): Element | null;
|
|
43
|
+
|
|
44
|
+
interface ConsistencyHighlighterProps {
|
|
45
|
+
violations: Violation[];
|
|
46
|
+
selectedViolation: Violation | null;
|
|
47
|
+
lockedViolation: Violation | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Main consistency highlighter component
|
|
51
|
+
* Renders highlights via Portal to document.body
|
|
52
|
+
*/
|
|
53
|
+
declare function ConsistencyHighlighter({ violations, selectedViolation, lockedViolation, }: ConsistencyHighlighterProps): React.ReactPortal | null;
|
|
54
|
+
|
|
15
55
|
/**
|
|
16
56
|
* DOM scanner for browser environment
|
|
17
57
|
* Re-exports and wraps uilint-core functions for browser use
|
|
@@ -64,4 +104,4 @@ declare class LLMClient {
|
|
|
64
104
|
generateStyleGuide(styles: ExtractedStyles): Promise<string | null>;
|
|
65
105
|
}
|
|
66
106
|
|
|
67
|
-
export { LLMClient, UILint, type UILintProps, isBrowser, isJSDOM, isNode, scanDOM };
|
|
107
|
+
export { ConsistencyHighlighter, LLMClient, UILint, type UILintProps, cleanupDataElements, createSnapshot, getElementBySnapshotId, isBrowser, isJSDOM, isNode, scanDOM, useUILint };
|