uilint-react 0.2.112 → 0.2.114

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.
@@ -0,0 +1,20 @@
1
+ import { Issue } from '../../types';
2
+ export interface CodeRegionProps {
3
+ /** Source code lines to display */
4
+ lines: string[];
5
+ /** Starting line number (1-indexed) */
6
+ startLine: number;
7
+ /** All issues in this region */
8
+ issues: Issue[];
9
+ /** Currently selected issue ID */
10
+ selectedIssueId: string | null;
11
+ /** Called when an issue is selected */
12
+ onIssueSelect: (issueId: string) => void;
13
+ /** Width of the line number gutter */
14
+ gutterWidth?: number;
15
+ /** Additional class name */
16
+ className?: string;
17
+ }
18
+ export declare function CodeRegion({ lines, startLine, issues, selectedIssueId, onIssueSelect, gutterWidth, className, }: CodeRegionProps): import("react/jsx-runtime").JSX.Element;
19
+ export default CodeRegion;
20
+ //# sourceMappingURL=CodeRegion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeRegion.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/CodeRegion.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,kCAAkC;IAClC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,uCAAuC;IACvC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAoDD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,MAAM,EACN,eAAe,EACf,aAAa,EACb,WAAgB,EAChB,SAAS,GACV,EAAE,eAAe,2CAqEjB;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,17 @@
1
+ export interface CollapsedLinesProps {
2
+ /** Start line number of the collapsed section (1-indexed) */
3
+ startLine: number;
4
+ /** End line number of the collapsed section (1-indexed) */
5
+ endLine: number;
6
+ /** Number of hidden lines */
7
+ lineCount: number;
8
+ /** Called when the user clicks to expand */
9
+ onExpand: () => void;
10
+ /** Width of the line number gutter */
11
+ gutterWidth?: number;
12
+ /** Additional class name */
13
+ className?: string;
14
+ }
15
+ export declare function CollapsedLines({ startLine, endLine, lineCount, onExpand, gutterWidth, className, }: CollapsedLinesProps): import("react/jsx-runtime").JSX.Element;
16
+ export default CollapsedLines;
17
+ //# sourceMappingURL=CollapsedLines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsedLines.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/CollapsedLines.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAgB,EAChB,SAAS,GACV,EAAE,mBAAmB,2CAyCrB;AAED,eAAe,cAAc,CAAC"}
@@ -12,11 +12,11 @@ export interface FileSectionProps {
12
12
  onIssueSelect: (issueId: string) => void;
13
13
  /** Currently selected issue ID */
14
14
  selectedIssueId: string | null;
15
- /** Maximum number of issues to show before "show more" */
16
- maxVisibleIssues?: number;
15
+ /** Number of context lines around each issue in source view */
16
+ contextLines?: number;
17
17
  /** Additional class name */
18
18
  className?: string;
19
19
  }
20
- export declare function FileSection({ file, isExpanded, onToggle, onRuleClick, onIssueSelect, selectedIssueId, maxVisibleIssues, className, }: FileSectionProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function FileSection({ file, isExpanded, onToggle, onRuleClick, onIssueSelect, selectedIssueId, contextLines, className, }: FileSectionProps): import("react/jsx-runtime").JSX.Element;
21
21
  export default FileSection;
22
22
  //# sourceMappingURL=FileSection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileSection.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/FileSection.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAM1E,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,0CAA0C;IAC1C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,uCAAuC;IACvC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,kCAAkC;IAClC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuDD,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAoB,EACpB,SAAS,GACV,EAAE,gBAAgB,2CAsIlB;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"FileSection.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/FileSection.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAM1E,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,0CAA0C;IAC1C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,uCAAuC;IACvC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,kCAAkC;IAClC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuDD,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,YAAgB,EAChB,SAAS,GACV,EAAE,gBAAgB,2CAiFlB;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Issue } from '../../types';
2
+ export interface FileSourceViewProps {
3
+ /** Full file path */
4
+ filePath: string;
5
+ /** Issues in this file */
6
+ issues: Issue[];
7
+ /** Number of context lines above/below each issue */
8
+ contextLines?: number;
9
+ /** Currently selected issue ID */
10
+ selectedIssueId: string | null;
11
+ /** Called when an issue is selected */
12
+ onIssueSelect: (issueId: string) => void;
13
+ /** Whether to fetch source (default: true) */
14
+ enabled?: boolean;
15
+ /** Additional class name */
16
+ className?: string;
17
+ }
18
+ export declare function FileSourceView({ filePath, issues, contextLines, selectedIssueId, onIssueSelect, enabled, className, }: FileSourceViewProps): import("react/jsx-runtime").JSX.Element;
19
+ export default FileSourceView;
20
+ //# sourceMappingURL=FileSourceView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSourceView.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/FileSourceView.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,uCAAuC;IACvC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAeD,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,MAAM,EACN,YAAoC,EACpC,eAAe,EACf,aAAa,EACb,OAAc,EACd,SAAS,GACV,EAAE,mBAAmB,2CA+IrB;AAED,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"InspectorSidebar.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/InspectorSidebar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAqE,MAAM,OAAO,CAAC;AAkB1F,wBAAgB,gBAAgB,sBA+V/B"}
1
+ {"version":3,"file":"InspectorSidebar.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/InspectorSidebar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAqE,MAAM,OAAO,CAAC;AAkB1F,wBAAgB,gBAAgB,sBAoW/B"}
@@ -0,0 +1,16 @@
1
+ import { Issue } from '../../types';
2
+ export interface IssueAnnotationProps {
3
+ /** The issue to display */
4
+ issue: Issue;
5
+ /** Whether this issue is selected */
6
+ isSelected: boolean;
7
+ /** Called when clicked */
8
+ onSelect: () => void;
9
+ /** Width of the line number gutter */
10
+ gutterWidth?: number;
11
+ /** Additional class name */
12
+ className?: string;
13
+ }
14
+ export declare function IssueAnnotation({ issue, isSelected, onSelect, gutterWidth, className, }: IssueAnnotationProps): import("react/jsx-runtime").JSX.Element;
15
+ export default IssueAnnotation;
16
+ //# sourceMappingURL=IssueAnnotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IssueAnnotation.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/IssueAnnotation.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC,MAAM,WAAW,oBAAoB;IACnC,2BAA2B;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,qCAAqC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgDD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,UAAU,EACV,QAAQ,EACR,WAAgB,EAChB,SAAS,GACV,EAAE,oBAAoB,2CAyDtB;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,88 @@
1
+ import { Issue } from '../../types';
2
+ /**
3
+ * A contiguous region of source code to display.
4
+ */
5
+ export interface CodeRegion {
6
+ /** Start line number (1-indexed, inclusive) */
7
+ startLine: number;
8
+ /** End line number (1-indexed, inclusive) */
9
+ endLine: number;
10
+ /** Issues within this region, sorted by line */
11
+ issues: Issue[];
12
+ }
13
+ /**
14
+ * A collapsed section between visible regions.
15
+ */
16
+ export interface CollapsedGap {
17
+ /** Unique identifier for this gap (index-based) */
18
+ id: number;
19
+ /** Start line number (1-indexed, inclusive) */
20
+ startLine: number;
21
+ /** End line number (1-indexed, inclusive) */
22
+ endLine: number;
23
+ /** Number of hidden lines */
24
+ lineCount: number;
25
+ /** Position: 'start' = before first region, 'middle' = between regions, 'end' = after last region */
26
+ position: "start" | "middle" | "end";
27
+ }
28
+ /**
29
+ * Result of region calculation.
30
+ */
31
+ export interface RegionCalculationResult {
32
+ /** Visible code regions with their issues */
33
+ regions: CodeRegion[];
34
+ /** Collapsed gaps between regions */
35
+ gaps: CollapsedGap[];
36
+ }
37
+ /**
38
+ * Calculate visible regions and collapsed gaps for a file's issues.
39
+ *
40
+ * Algorithm:
41
+ * 1. Sort issues by line number
42
+ * 2. For each issue, create a region: [line - contextAbove, line + contextBelow]
43
+ * 3. Merge overlapping or adjacent regions
44
+ * 4. Identify gaps (collapsed sections) between regions
45
+ * 5. Handle file start/end gaps
46
+ *
47
+ * @param issues - Issues in this file (will be sorted by line)
48
+ * @param totalLines - Total number of lines in the file
49
+ * @param contextLines - Number of context lines above and below each issue
50
+ * @returns Regions to display and gaps to collapse
51
+ */
52
+ export declare function calculateRegions(issues: Issue[], totalLines: number, contextLines?: number): RegionCalculationResult;
53
+ /**
54
+ * Expand a gap by merging it into adjacent regions.
55
+ *
56
+ * When a user clicks "Show N hidden lines", we need to recalculate
57
+ * the regions to include those lines.
58
+ *
59
+ * @param result - Current region calculation result
60
+ * @param gapId - ID of the gap to expand
61
+ * @param totalLines - Total lines in file (for validation)
62
+ * @returns New result with the gap expanded
63
+ */
64
+ export declare function expandGap(result: RegionCalculationResult, gapId: number, totalLines: number): RegionCalculationResult;
65
+ /**
66
+ * Get issues for a specific line number.
67
+ *
68
+ * @param issues - All issues in the file
69
+ * @param lineNumber - Line number to check
70
+ * @returns Issues on that line
71
+ */
72
+ export declare function getIssuesForLine(issues: Issue[], lineNumber: number): Issue[];
73
+ /**
74
+ * Check if a line has any issues.
75
+ *
76
+ * @param issues - All issues in the file
77
+ * @param lineNumber - Line number to check
78
+ * @returns True if the line has issues
79
+ */
80
+ export declare function lineHasIssues(issues: Issue[], lineNumber: number): boolean;
81
+ /**
82
+ * Get the highest severity for a line.
83
+ *
84
+ * @param issues - Issues on this line
85
+ * @returns Highest severity or null if no issues
86
+ */
87
+ export declare function getLineSeverity(issues: Issue[]): Issue["severity"] | null;
88
+ //# sourceMappingURL=source-regions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-regions.d.ts","sourceRoot":"","sources":["../../../../src/ui/components/Inspector/source-regions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMzC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,qGAAqG;IACrG,QAAQ,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,qCAAqC;IACrC,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,KAAK,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,MAAU,GACvB,uBAAuB,CAgGzB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAyEzB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CAE7E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,KAAK,EAAE,GACd,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAc1B"}
@@ -0,0 +1,24 @@
1
+ import { CachedSourceFile } from '../../core/services/source-cache';
2
+ interface UseFullSourceCodeOptions {
3
+ /** File path to fetch */
4
+ filePath: string;
5
+ /** Whether to fetch (default: true) */
6
+ enabled?: boolean;
7
+ }
8
+ interface UseFullSourceCodeResult {
9
+ /** Full source file content */
10
+ source: CachedSourceFile | null;
11
+ /** All lines as an array */
12
+ lines: string[];
13
+ /** Total number of lines */
14
+ totalLines: number;
15
+ /** Whether currently loading */
16
+ isLoading: boolean;
17
+ /** Error message if any */
18
+ error: string | null;
19
+ /** Manually trigger refetch */
20
+ refetch: () => void;
21
+ }
22
+ export declare function useFullSourceCode({ filePath, enabled, }: UseFullSourceCodeOptions): UseFullSourceCodeResult;
23
+ export {};
24
+ //# sourceMappingURL=useFullSourceCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFullSourceCode.d.ts","sourceRoot":"","sources":["../../../src/ui/hooks/useFullSourceCode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAM1C,UAAU,wBAAwB;IAChC,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,uBAAuB;IAC/B,+BAA+B;IAC/B,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,+BAA+B;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AA8BD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,OAAc,GACf,EAAE,wBAAwB,GAAG,uBAAuB,CA8IpD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uilint-react",
3
- "version": "0.2.112",
3
+ "version": "0.2.114",
4
4
  "description": "React component for AI-powered UI consistency checking",
5
5
  "author": "Peter Suggate",
6
6
  "repository": {
@@ -48,8 +48,8 @@
48
48
  "react-use-measure": "^2.1.7",
49
49
  "tw-animate-css": "^1.4.0",
50
50
  "zustand": "^5.0.10",
51
- "uilint-core": "0.2.112",
52
- "uilint-eslint": "0.2.112"
51
+ "uilint-core": "0.2.114",
52
+ "uilint-eslint": "0.2.114"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "react": "^19.0.0",