uilint-react 0.1.20 → 0.1.22
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 +2 -2
- package/dist/{InspectionPanel-3ML64TAP.js → InspectionPanel-ZBDXQ2LU.js} +2 -2
- package/dist/{LocatorOverlay-GTTWBRKH.js → LocatorOverlay-3H446RPO.js} +2 -2
- package/dist/{UILintToolbar-GAOYF7GY.js → UILintToolbar-C6HOAJA4.js} +2 -2
- package/dist/{chunk-VYCIUDU7.js → chunk-3DNDKMZ4.js} +1 -1
- package/dist/{chunk-NOISZ3XP.js → chunk-CWCKS753.js} +4 -4
- package/dist/{chunk-DAFFOBEU.js → chunk-EBU7YY73.js} +3 -3
- package/dist/{chunk-PBC3J267.js → chunk-GUF36FGA.js} +1 -1
- package/dist/index.js +5 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -61,10 +61,10 @@ export default function RootLayout({ children }) {
|
|
|
61
61
|
The CLI installs these routes automatically, or you can add them manually:
|
|
62
62
|
|
|
63
63
|
```ts
|
|
64
|
-
// app/api
|
|
64
|
+
// app/api/.uilint/analyze/route.ts
|
|
65
65
|
// Handles LLM analysis of source code
|
|
66
66
|
|
|
67
|
-
// app/api/
|
|
67
|
+
// app/api/.uilint/source/route.ts
|
|
68
68
|
// Dev-only route for fetching source files
|
|
69
69
|
```
|
|
70
70
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
buildEditorUrl,
|
|
4
4
|
useUILintContext
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EBU7YY73.js";
|
|
6
6
|
|
|
7
7
|
// src/components/ui-lint/InspectionPanel.tsx
|
|
8
8
|
import { useState, useEffect, useCallback } from "react";
|
|
@@ -11,7 +11,7 @@ import { createPortal } from "react-dom";
|
|
|
11
11
|
// src/components/ui-lint/source-fetcher.ts
|
|
12
12
|
var sourceCache = /* @__PURE__ */ new Map();
|
|
13
13
|
var CACHE_TTL = 5 * 60 * 1e3;
|
|
14
|
-
var API_ENDPOINT = "/api
|
|
14
|
+
var API_ENDPOINT = "/api/.uilint/source";
|
|
15
15
|
async function fetchSource(filePath) {
|
|
16
16
|
const cached = sourceCache.get(filePath);
|
|
17
17
|
if (cached && Date.now() - cached.fetchedAt < CACHE_TTL) {
|
|
@@ -574,7 +574,7 @@ function ScanTab({ element }) {
|
|
|
574
574
|
setFixPrompt(null);
|
|
575
575
|
try {
|
|
576
576
|
const sourceResponse = await fetch(
|
|
577
|
-
`/api
|
|
577
|
+
`/api/.uilint/source?path=${encodeURIComponent(element.source.fileName)}`
|
|
578
578
|
);
|
|
579
579
|
if (!sourceResponse.ok) {
|
|
580
580
|
throw new Error("Failed to fetch source code");
|
|
@@ -582,7 +582,7 @@ function ScanTab({ element }) {
|
|
|
582
582
|
const sourceData = await sourceResponse.json();
|
|
583
583
|
const sourceCode = sourceData.content;
|
|
584
584
|
const relativePath = sourceData.relativePath || element.source.fileName;
|
|
585
|
-
const analyzeResponse = await fetch("/api
|
|
585
|
+
const analyzeResponse = await fetch("/api/.uilint/analyze", {
|
|
586
586
|
method: "POST",
|
|
587
587
|
headers: { "Content-Type": "application/json" },
|
|
588
588
|
body: JSON.stringify({
|
|
@@ -476,9 +476,9 @@ function UILintUI() {
|
|
|
476
476
|
const [components, setComponents] = useState(null);
|
|
477
477
|
useEffect(() => {
|
|
478
478
|
Promise.all([
|
|
479
|
-
import("./UILintToolbar-
|
|
480
|
-
import("./InspectionPanel-
|
|
481
|
-
import("./LocatorOverlay-
|
|
479
|
+
import("./UILintToolbar-C6HOAJA4.js"),
|
|
480
|
+
import("./InspectionPanel-ZBDXQ2LU.js"),
|
|
481
|
+
import("./LocatorOverlay-3H446RPO.js")
|
|
482
482
|
]).then(([toolbar, panel, locator]) => {
|
|
483
483
|
setComponents({
|
|
484
484
|
Toolbar: toolbar.UILintToolbar,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
UILintToolbar
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GUF36FGA.js";
|
|
5
5
|
import {
|
|
6
6
|
InspectionPanel,
|
|
7
7
|
clearSourceCache,
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
fetchSourceWithContext,
|
|
10
10
|
getCachedSource,
|
|
11
11
|
prefetchSources
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CWCKS753.js";
|
|
13
13
|
import {
|
|
14
14
|
LocatorOverlay
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3DNDKMZ4.js";
|
|
16
16
|
import {
|
|
17
17
|
DATA_UILINT_ID,
|
|
18
18
|
DEFAULT_SETTINGS,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
scanDOMForSources,
|
|
32
32
|
updateElementRects,
|
|
33
33
|
useUILintContext
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EBU7YY73.js";
|
|
35
35
|
|
|
36
36
|
// src/consistency/snapshot.ts
|
|
37
37
|
var DATA_ELEMENTS_ATTR = "data-elements";
|
|
@@ -449,7 +449,7 @@ import {
|
|
|
449
449
|
buildStyleGuidePrompt,
|
|
450
450
|
UILINT_DEFAULT_OLLAMA_MODEL
|
|
451
451
|
} from "uilint-core";
|
|
452
|
-
var DEFAULT_API_ENDPOINT = "/api
|
|
452
|
+
var DEFAULT_API_ENDPOINT = "/api/.uilint/analyze";
|
|
453
453
|
var LLMClient = class {
|
|
454
454
|
apiEndpoint;
|
|
455
455
|
model;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uilint-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "React component for AI-powered UI consistency checking",
|
|
5
5
|
"author": "Peter Suggate",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"node": ">=20.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"uilint-core": "^0.1.
|
|
37
|
+
"uilint-core": "^0.1.22"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "^19.0.0",
|