uilint-react 0.1.31 → 0.1.33

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.
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  useUILintContext
5
- } from "./chunk-M3H56XIZ.js";
5
+ } from "./chunk-MO4NS6EG.js";
6
6
 
7
7
  // src/components/ui-lint/ElementBadges.tsx
8
8
  import React, { useState, useEffect, useCallback, useMemo } from "react";
@@ -2,8 +2,8 @@
2
2
  "use client";
3
3
  import {
4
4
  InspectionPanel
5
- } from "./chunk-XAAIRXB4.js";
6
- import "./chunk-M3H56XIZ.js";
5
+ } from "./chunk-JBBUE3Y5.js";
6
+ import "./chunk-MO4NS6EG.js";
7
7
  export {
8
8
  InspectionPanel
9
9
  };
@@ -3,8 +3,8 @@
3
3
  import {
4
4
  InspectedElementHighlight,
5
5
  LocatorOverlay
6
- } from "./chunk-OV5BPTNA.js";
7
- import "./chunk-M3H56XIZ.js";
6
+ } from "./chunk-Z6PWYQGW.js";
7
+ import "./chunk-MO4NS6EG.js";
8
8
  export {
9
9
  InspectedElementHighlight,
10
10
  LocatorOverlay
@@ -2,8 +2,8 @@
2
2
  "use client";
3
3
  import {
4
4
  UILintToolbar
5
- } from "./chunk-GLJBGFZK.js";
6
- import "./chunk-M3H56XIZ.js";
5
+ } from "./chunk-HTNIKCEM.js";
6
+ import "./chunk-MO4NS6EG.js";
7
7
  export {
8
8
  UILintToolbar
9
9
  };
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import {
3
- useUILintContext
4
- } from "./chunk-M3H56XIZ.js";
3
+ useUILintContext,
4
+ useUILintStore
5
+ } from "./chunk-MO4NS6EG.js";
5
6
 
6
7
  // src/components/ui-lint/UILintToolbar.tsx
7
8
  import { useState, useRef, useEffect } from "react";
@@ -141,6 +142,16 @@ function SettingsPopover({
141
142
  resumeAutoScan,
142
143
  stopAutoScan
143
144
  } = useUILintContext();
145
+ const wsConnected = useUILintStore((s) => s.wsConnected);
146
+ const wsUrl = useUILintStore((s) => s.wsUrl);
147
+ const wsLastActivity = useUILintStore((s) => s.wsLastActivity);
148
+ const wsRecentResults = useUILintStore((s) => s.wsRecentResults);
149
+ const connectWebSocket = useUILintStore(
150
+ (s) => s.connectWebSocket
151
+ );
152
+ const disconnectWebSocket = useUILintStore(
153
+ (s) => s.disconnectWebSocket
154
+ );
144
155
  const isScanning = autoScanState.status === "scanning";
145
156
  const isPaused = autoScanState.status === "paused";
146
157
  const isComplete = autoScanState.status === "complete";
@@ -176,6 +187,212 @@ function SettingsPopover({
176
187
  children: "UILint Settings"
177
188
  }
178
189
  ),
190
+ /* @__PURE__ */ jsxs(
191
+ "div",
192
+ {
193
+ style: {
194
+ padding: "10px 12px",
195
+ borderRadius: "10px",
196
+ border: `1px solid ${STYLES.border}`,
197
+ backgroundColor: "rgba(31, 41, 55, 0.65)",
198
+ marginBottom: "12px"
199
+ },
200
+ children: [
201
+ /* @__PURE__ */ jsxs(
202
+ "div",
203
+ {
204
+ style: {
205
+ display: "flex",
206
+ alignItems: "center",
207
+ justifyContent: "space-between",
208
+ gap: "10px"
209
+ },
210
+ children: [
211
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
212
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: STYLES.textMuted }, children: "Server" }),
213
+ /* @__PURE__ */ jsx(
214
+ "div",
215
+ {
216
+ style: {
217
+ fontSize: "12px",
218
+ fontWeight: 600,
219
+ color: wsConnected ? "#10B981" : "#EF4444"
220
+ },
221
+ children: wsConnected ? "Connected" : "Disconnected"
222
+ }
223
+ )
224
+ ] }),
225
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
226
+ /* @__PURE__ */ jsx(
227
+ "button",
228
+ {
229
+ onClick: () => connectWebSocket(wsUrl),
230
+ style: {
231
+ padding: "6px 10px",
232
+ borderRadius: "8px",
233
+ border: `1px solid ${STYLES.border}`,
234
+ backgroundColor: "transparent",
235
+ color: STYLES.text,
236
+ fontSize: "11px",
237
+ fontWeight: 600,
238
+ cursor: "pointer"
239
+ },
240
+ title: "Reconnect to WebSocket server",
241
+ children: "Reconnect"
242
+ }
243
+ ),
244
+ /* @__PURE__ */ jsx(
245
+ "button",
246
+ {
247
+ onClick: () => disconnectWebSocket(),
248
+ style: {
249
+ padding: "6px 10px",
250
+ borderRadius: "8px",
251
+ border: `1px solid ${STYLES.border}`,
252
+ backgroundColor: "transparent",
253
+ color: STYLES.textMuted,
254
+ fontSize: "11px",
255
+ fontWeight: 600,
256
+ cursor: "pointer"
257
+ },
258
+ title: "Disconnect from WebSocket server",
259
+ children: "Disconnect"
260
+ }
261
+ )
262
+ ] })
263
+ ]
264
+ }
265
+ ),
266
+ /* @__PURE__ */ jsx(
267
+ "div",
268
+ {
269
+ style: {
270
+ marginTop: "8px",
271
+ fontSize: "10px",
272
+ color: STYLES.textMuted,
273
+ fontFamily: STYLES.fontMono,
274
+ wordBreak: "break-all"
275
+ },
276
+ children: wsUrl
277
+ }
278
+ )
279
+ ]
280
+ }
281
+ ),
282
+ /* @__PURE__ */ jsxs(
283
+ "div",
284
+ {
285
+ style: {
286
+ marginTop: "10px",
287
+ padding: "10px 12px",
288
+ borderRadius: "10px",
289
+ border: `1px solid ${STYLES.border}`,
290
+ backgroundColor: "rgba(31, 41, 55, 0.45)",
291
+ marginBottom: "12px"
292
+ },
293
+ children: [
294
+ /* @__PURE__ */ jsxs(
295
+ "div",
296
+ {
297
+ style: {
298
+ display: "flex",
299
+ alignItems: "center",
300
+ justifyContent: "space-between",
301
+ marginBottom: "8px"
302
+ },
303
+ children: [
304
+ /* @__PURE__ */ jsx(
305
+ "div",
306
+ {
307
+ style: { fontSize: "11px", fontWeight: 700, color: STYLES.text },
308
+ children: "Live lint"
309
+ }
310
+ ),
311
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "10px", color: STYLES.textMuted }, children: wsConnected ? "Streaming" : "Offline" })
312
+ ]
313
+ }
314
+ ),
315
+ wsLastActivity ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
316
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: STYLES.textMuted }, children: wsLastActivity.phase }),
317
+ /* @__PURE__ */ jsx(
318
+ "div",
319
+ {
320
+ style: {
321
+ fontSize: "11px",
322
+ fontFamily: STYLES.fontMono,
323
+ color: STYLES.text,
324
+ whiteSpace: "nowrap",
325
+ overflow: "hidden",
326
+ textOverflow: "ellipsis"
327
+ },
328
+ title: wsLastActivity.filePath,
329
+ children: (wsLastActivity.filePath.split("/").pop() || wsLastActivity.filePath) ?? ""
330
+ }
331
+ )
332
+ ] }) : /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: STYLES.textMuted }, children: "No activity yet" }),
333
+ wsRecentResults.length > 0 && /* @__PURE__ */ jsxs(
334
+ "div",
335
+ {
336
+ style: {
337
+ marginTop: "10px",
338
+ display: "flex",
339
+ flexDirection: "column",
340
+ gap: "6px"
341
+ },
342
+ children: [
343
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "10px", color: STYLES.textMuted }, children: "Recent results" }),
344
+ wsRecentResults.slice(0, 5).map((r) => {
345
+ const file = r.filePath.split("/").pop() || r.filePath;
346
+ const color = r.issueCount === 0 ? "#10B981" : r.issueCount <= 2 ? "#F59E0B" : "#EF4444";
347
+ return /* @__PURE__ */ jsxs(
348
+ "div",
349
+ {
350
+ style: {
351
+ display: "flex",
352
+ alignItems: "center",
353
+ justifyContent: "space-between",
354
+ gap: "10px",
355
+ fontSize: "10px",
356
+ fontFamily: STYLES.fontMono,
357
+ color: STYLES.textMuted
358
+ },
359
+ title: r.filePath,
360
+ children: [
361
+ /* @__PURE__ */ jsx(
362
+ "span",
363
+ {
364
+ style: {
365
+ overflow: "hidden",
366
+ textOverflow: "ellipsis",
367
+ whiteSpace: "nowrap",
368
+ flex: 1
369
+ },
370
+ children: file
371
+ }
372
+ ),
373
+ /* @__PURE__ */ jsx(
374
+ "span",
375
+ {
376
+ style: {
377
+ minWidth: "34px",
378
+ textAlign: "right",
379
+ fontWeight: 700,
380
+ color
381
+ },
382
+ children: r.issueCount
383
+ }
384
+ )
385
+ ]
386
+ },
387
+ r.filePath
388
+ );
389
+ })
390
+ ]
391
+ }
392
+ )
393
+ ]
394
+ }
395
+ ),
179
396
  /* @__PURE__ */ jsxs(
180
397
  "div",
181
398
  {