uidex 0.6.0 → 0.8.0
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 +3 -3
- package/dist/cli/cli.cjs +2502 -2253
- package/dist/cli/cli.cjs.map +1 -1
- package/dist/headless/index.cjs +86 -703
- package/dist/headless/index.cjs.map +1 -1
- package/dist/headless/index.d.cts +46 -22
- package/dist/headless/index.d.ts +46 -22
- package/dist/headless/index.js +86 -707
- package/dist/headless/index.js.map +1 -1
- package/dist/index.cjs +712 -4149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -366
- package/dist/index.d.ts +82 -366
- package/dist/index.js +708 -4156
- package/dist/index.js.map +1 -1
- package/dist/playwright/index.cjs +175 -0
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.cts +2 -0
- package/dist/playwright/index.d.ts +2 -0
- package/dist/playwright/index.js +167 -0
- package/dist/playwright/index.js.map +1 -1
- package/dist/playwright/states-reporter.cjs +123 -0
- package/dist/playwright/states-reporter.cjs.map +1 -0
- package/dist/playwright/states-reporter.d.cts +46 -0
- package/dist/playwright/states-reporter.d.ts +46 -0
- package/dist/playwright/states-reporter.js +88 -0
- package/dist/playwright/states-reporter.js.map +1 -0
- package/dist/playwright/states.cjs +118 -0
- package/dist/playwright/states.cjs.map +1 -0
- package/dist/playwright/states.d.cts +120 -0
- package/dist/playwright/states.d.ts +120 -0
- package/dist/playwright/states.js +88 -0
- package/dist/playwright/states.js.map +1 -0
- package/dist/react/index.cjs +750 -4113
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +78 -278
- package/dist/react/index.d.ts +78 -278
- package/dist/react/index.js +748 -4135
- package/dist/react/index.js.map +1 -1
- package/dist/scan/index.cjs +2694 -1541
- package/dist/scan/index.cjs.map +1 -1
- package/dist/scan/index.d.cts +482 -19
- package/dist/scan/index.d.ts +482 -19
- package/dist/scan/index.js +2682 -1540
- package/dist/scan/index.js.map +1 -1
- package/package.json +14 -17
- package/templates/claude/SKILL.md +71 -0
- package/templates/claude/references/audit.md +43 -0
- package/templates/claude/{rules.md → references/conventions.md} +25 -28
- package/dist/cloud/index.cjs +0 -472
- package/dist/cloud/index.cjs.map +0 -1
- package/dist/cloud/index.d.cts +0 -82
- package/dist/cloud/index.d.ts +0 -82
- package/dist/cloud/index.js +0 -445
- package/dist/cloud/index.js.map +0 -1
- package/templates/claude/audit.md +0 -43
- /package/templates/claude/{api.md → references/api.md} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StoreApi } from 'zustand/vanilla';
|
|
2
|
-
import { ReportPayload, ReportResult, IngestConfig, ReportListResponse, PinRecord, ArchiveReason } from '@uidex/api-client';
|
|
3
|
-
export { ArchiveReason, IngestConfig, PinRecord, ReportListRecord, ReportListResponse, ReportPayload, ReportResult } from '@uidex/api-client';
|
|
4
2
|
import { TemplateResult } from 'lit-html';
|
|
5
3
|
import { IconNode } from 'lucide';
|
|
6
4
|
|
|
@@ -16,6 +14,32 @@ interface EntityRef {
|
|
|
16
14
|
kind: EntityKind;
|
|
17
15
|
id: string;
|
|
18
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The four kinds every captured route is expected to render — the state-matrix
|
|
19
|
+
* axis. A capture that only shoots the happy path leaves most of the value on
|
|
20
|
+
* the table, so a missing core kind must be captured, waived (the page CANNOT
|
|
21
|
+
* render it), or acknowledged in the MISSING_KINDS baseline.
|
|
22
|
+
*/
|
|
23
|
+
declare const CORE_STATE_KINDS: readonly ["loading", "empty", "populated", "error"];
|
|
24
|
+
type CoreStateKind = (typeof CORE_STATE_KINDS)[number];
|
|
25
|
+
/** `variant` is any state outside the matrix (a dialog, wizard step, multi-currency…). */
|
|
26
|
+
type StateKind = CoreStateKind | "variant";
|
|
27
|
+
/**
|
|
28
|
+
* A declared render state of an entity — the "story"-like unit: a named
|
|
29
|
+
* condition the page/feature/widget can render in (loading / empty / error /
|
|
30
|
+
* multi-currency / …). Enumerated on the entity (not derived from syntax), it
|
|
31
|
+
* is the contract the visual-states capture must satisfy and the anchor for
|
|
32
|
+
* per-state acceptance criteria. Fixtures + capture mechanics stay in the spec;
|
|
33
|
+
* the registry holds only the name (+ optional kind / per-state acceptance).
|
|
34
|
+
*/
|
|
35
|
+
interface StateDecl {
|
|
36
|
+
name: string;
|
|
37
|
+
/** Canonical kind for the state-matrix axis (defaults to `variant`). */
|
|
38
|
+
kind?: StateKind;
|
|
39
|
+
/** Acceptance criteria that only this state can evidence. */
|
|
40
|
+
acceptance?: string[];
|
|
41
|
+
description?: string;
|
|
42
|
+
}
|
|
19
43
|
interface Metadata {
|
|
20
44
|
name?: string;
|
|
21
45
|
description?: string;
|
|
@@ -25,6 +49,21 @@ interface Metadata {
|
|
|
25
49
|
flows?: readonly string[];
|
|
26
50
|
features?: string[];
|
|
27
51
|
widgets?: string[];
|
|
52
|
+
/** Declared render states (see StateDecl); the capture-completeness gate. */
|
|
53
|
+
states?: StateDecl[];
|
|
54
|
+
/**
|
|
55
|
+
* `false` opts this page/feature/widget out of visual-states capture forever
|
|
56
|
+
* (a redirect, a static notice, an internal target). The page-coverage gate
|
|
57
|
+
* treats an opted-out route as accounted-for. Reason belongs in `description`.
|
|
58
|
+
*/
|
|
59
|
+
capture?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Per-core-kind waivers: a core kind this page's route legitimately CANNOT
|
|
62
|
+
* render (a create form has no `empty`), mapped to a substantive reason. The
|
|
63
|
+
* state-matrix gate treats a waived kind as accounted-for. A waiver is a
|
|
64
|
+
* permanent design statement — unlike MISSING_KINDS backlog, which is debt.
|
|
65
|
+
*/
|
|
66
|
+
waivers?: Partial<Record<CoreStateKind, string>>;
|
|
28
67
|
}
|
|
29
68
|
interface EntityWithMetaBase {
|
|
30
69
|
id: string;
|
|
@@ -110,7 +149,7 @@ interface Registry {
|
|
|
110
149
|
setReports(kind: EntityKind, id: string, reports: readonly ReportRecord[]): void;
|
|
111
150
|
getReports(kind: EntityKind, id: string): readonly ReportRecord[];
|
|
112
151
|
listReportKeys(): readonly string[];
|
|
113
|
-
|
|
152
|
+
closeReport?: (reportId: string, status?: string) => void | Promise<void>;
|
|
114
153
|
onReportsChange(cb: () => void): () => void;
|
|
115
154
|
}
|
|
116
155
|
declare function createRegistry(): Registry;
|
|
@@ -127,12 +166,6 @@ declare const KIND_STYLE: Record<EntityKind, KindStyleEntry>;
|
|
|
127
166
|
declare function prettify(id: string): string;
|
|
128
167
|
declare function displayName(entity: Entity, node?: Element | null): string;
|
|
129
168
|
|
|
130
|
-
interface UserIdentity {
|
|
131
|
-
id: string;
|
|
132
|
-
name?: string;
|
|
133
|
-
avatar?: string;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
169
|
type ThemePreference = "light" | "dark" | "auto";
|
|
137
170
|
type ResolvedTheme = "light" | "dark";
|
|
138
171
|
interface ViewStackEntry {
|
|
@@ -140,20 +173,13 @@ interface ViewStackEntry {
|
|
|
140
173
|
ref: EntityRef | null;
|
|
141
174
|
}
|
|
142
175
|
interface SessionSnapshot {
|
|
143
|
-
hover: EntityRef | null;
|
|
144
|
-
selection: EntityRef | null;
|
|
145
176
|
stack: ViewStackEntry[];
|
|
146
177
|
/** Sticky overlay highlight. Set by "Highlight Element" actions; cleared on Esc. */
|
|
147
178
|
pinnedHighlight: EntityRef | null;
|
|
148
|
-
|
|
179
|
+
/** Mirrored from the mode store; the surface mode the session is currently in. */
|
|
180
|
+
mode: SurfaceMode;
|
|
149
181
|
theme: ThemePreference;
|
|
150
182
|
resolvedTheme: ResolvedTheme;
|
|
151
|
-
ingestActive: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Identity for the local user. Set once at session creation; gates realtime
|
|
154
|
-
* features (cursor labels, presence) and auto-populates report attribution.
|
|
155
|
-
*/
|
|
156
|
-
user: UserIdentity | null;
|
|
157
183
|
}
|
|
158
184
|
type SessionState = SessionSnapshot;
|
|
159
185
|
|
|
@@ -163,7 +189,6 @@ interface NavigationState {
|
|
|
163
189
|
interface NavigationActions {
|
|
164
190
|
push(entry: ViewStackEntry): void;
|
|
165
191
|
pop(): void;
|
|
166
|
-
replace(entry: ViewStackEntry): void;
|
|
167
192
|
clear(): void;
|
|
168
193
|
reset(stack: ViewStackEntry[]): void;
|
|
169
194
|
}
|
|
@@ -175,7 +200,6 @@ declare function createNavigationStore(): NavigationStore;
|
|
|
175
200
|
type SurfaceMode = "idle" | "inspecting" | "palette" | "viewing";
|
|
176
201
|
interface ModeSnapshot {
|
|
177
202
|
mode: SurfaceMode;
|
|
178
|
-
inspectorActive: boolean;
|
|
179
203
|
}
|
|
180
204
|
interface ModeBindings {
|
|
181
205
|
mountInspector?: () => void;
|
|
@@ -216,9 +240,7 @@ type SessionStore = StoreApi<SessionState> & {
|
|
|
216
240
|
readonly nav: NavigationStore;
|
|
217
241
|
readonly mode: ModeStore;
|
|
218
242
|
readonly highlight: HighlightActions;
|
|
219
|
-
select(ref: EntityRef | null): void;
|
|
220
243
|
setTheme(theme: ThemePreference, resolved?: ResolvedTheme): void;
|
|
221
|
-
setIngest(active: boolean): void;
|
|
222
244
|
};
|
|
223
245
|
interface CreateSessionOptions extends Partial<SessionSnapshot> {
|
|
224
246
|
detectTheme?: () => ResolvedTheme;
|
|
@@ -227,120 +249,12 @@ interface CreateSessionOptions extends Partial<SessionSnapshot> {
|
|
|
227
249
|
onShowOverlay?: (context: HighlightContext) => void;
|
|
228
250
|
onHideOverlay?: () => void;
|
|
229
251
|
onUpdateOverlay?: (context: HighlightContext) => void;
|
|
252
|
+
/** When true, start the session in inspector mode. */
|
|
253
|
+
inspectorActive?: boolean;
|
|
230
254
|
}
|
|
231
255
|
declare function resolveTheme(preference: ThemePreference, detect?: () => ResolvedTheme): ResolvedTheme;
|
|
232
256
|
declare function createSession(options?: CreateSessionOptions): SessionStore;
|
|
233
257
|
|
|
234
|
-
type ConsoleLevel = "warn" | "error";
|
|
235
|
-
interface ConsoleEntry {
|
|
236
|
-
level: ConsoleLevel;
|
|
237
|
-
message: string;
|
|
238
|
-
timestamp: string;
|
|
239
|
-
}
|
|
240
|
-
interface ConsoleCaptureOptions {
|
|
241
|
-
limit?: number;
|
|
242
|
-
target?: Console;
|
|
243
|
-
now?: () => Date;
|
|
244
|
-
}
|
|
245
|
-
interface ConsoleCapture {
|
|
246
|
-
start(): void;
|
|
247
|
-
stop(): void;
|
|
248
|
-
readonly isActive: boolean;
|
|
249
|
-
entries(): readonly ConsoleEntry[];
|
|
250
|
-
clear(): void;
|
|
251
|
-
}
|
|
252
|
-
declare function createConsoleCapture(options?: ConsoleCaptureOptions): ConsoleCapture;
|
|
253
|
-
|
|
254
|
-
interface NetworkEntry {
|
|
255
|
-
method: string;
|
|
256
|
-
url: string;
|
|
257
|
-
status: number;
|
|
258
|
-
timestamp: string;
|
|
259
|
-
error?: string;
|
|
260
|
-
}
|
|
261
|
-
interface NetworkCaptureOptions {
|
|
262
|
-
limit?: number;
|
|
263
|
-
target?: {
|
|
264
|
-
fetch?: typeof fetch;
|
|
265
|
-
};
|
|
266
|
-
now?: () => Date;
|
|
267
|
-
}
|
|
268
|
-
interface NetworkCapture {
|
|
269
|
-
start(): void;
|
|
270
|
-
stop(): void;
|
|
271
|
-
readonly isActive: boolean;
|
|
272
|
-
entries(): readonly NetworkEntry[];
|
|
273
|
-
clear(): void;
|
|
274
|
-
}
|
|
275
|
-
declare function createNetworkCapture(options?: NetworkCaptureOptions): NetworkCapture;
|
|
276
|
-
|
|
277
|
-
declare const nativeFetch: typeof fetch | undefined;
|
|
278
|
-
declare function getNativeFetch(): typeof fetch | undefined;
|
|
279
|
-
|
|
280
|
-
type RealtimePresenceUser = {
|
|
281
|
-
userId: string;
|
|
282
|
-
name: string;
|
|
283
|
-
avatar: string | null;
|
|
284
|
-
};
|
|
285
|
-
type RealtimeChannelState = "connecting" | "connected" | "disconnected";
|
|
286
|
-
interface RealtimeConnectOpts {
|
|
287
|
-
user: UserIdentity;
|
|
288
|
-
route: string;
|
|
289
|
-
}
|
|
290
|
-
interface RealtimeChannel {
|
|
291
|
-
readonly state: RealtimeChannelState;
|
|
292
|
-
connect(): void;
|
|
293
|
-
disconnect(): void;
|
|
294
|
-
joinRoute(route: string): void;
|
|
295
|
-
onPresence(cb: (users: RealtimePresenceUser[]) => void): () => void;
|
|
296
|
-
onPin(cb: (pin: PinRecord) => void): () => void;
|
|
297
|
-
}
|
|
298
|
-
interface CloudAdapter<TPayload = ReportPayload, TResult = ReportResult, TIntegrations = {
|
|
299
|
-
getConfig(): Promise<IngestConfig>;
|
|
300
|
-
getCachedConfig(): IngestConfig | null;
|
|
301
|
-
}> {
|
|
302
|
-
readonly reports: {
|
|
303
|
-
submit(payload: TPayload): Promise<TResult>;
|
|
304
|
-
list?(opts?: {
|
|
305
|
-
page?: number;
|
|
306
|
-
limit?: number;
|
|
307
|
-
}): Promise<ReportListResponse>;
|
|
308
|
-
};
|
|
309
|
-
readonly integrations: TIntegrations;
|
|
310
|
-
readonly realtime: {
|
|
311
|
-
connect(opts: RealtimeConnectOpts): RealtimeChannel;
|
|
312
|
-
};
|
|
313
|
-
readonly pins: {
|
|
314
|
-
list(params: {
|
|
315
|
-
route?: string;
|
|
316
|
-
entities?: string;
|
|
317
|
-
}): Promise<PinRecord[]>;
|
|
318
|
-
archive(reportId: string, reason?: ArchiveReason): Promise<void>;
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
interface IngestOptions {
|
|
323
|
-
captureConsole?: boolean;
|
|
324
|
-
captureNetwork?: boolean;
|
|
325
|
-
consoleLimit?: number;
|
|
326
|
-
networkLimit?: number;
|
|
327
|
-
consoleTarget?: ConsoleCaptureOptions["target"];
|
|
328
|
-
networkTarget?: NetworkCaptureOptions["target"];
|
|
329
|
-
now?: () => Date;
|
|
330
|
-
}
|
|
331
|
-
interface Ingest {
|
|
332
|
-
start(): void;
|
|
333
|
-
stop(): void;
|
|
334
|
-
readonly isActive: boolean;
|
|
335
|
-
readonly console: ConsoleCapture | null;
|
|
336
|
-
readonly network: NetworkCapture | null;
|
|
337
|
-
}
|
|
338
|
-
interface CreateIngestOptions extends IngestOptions {
|
|
339
|
-
session?: SessionStore;
|
|
340
|
-
}
|
|
341
|
-
declare function createIngest(options?: CreateIngestOptions): Ingest;
|
|
342
|
-
declare function resolveIngestOptions(explicit: IngestOptions | null | undefined, hasCloud: boolean): IngestOptions | null;
|
|
343
|
-
|
|
344
258
|
interface SurfaceHost {
|
|
345
259
|
readonly hostEl: HTMLElement;
|
|
346
260
|
readonly shadowRoot: ShadowRoot;
|
|
@@ -382,31 +296,9 @@ interface CursorTooltip {
|
|
|
382
296
|
}
|
|
383
297
|
interface CursorTooltipDeps {
|
|
384
298
|
container: Element;
|
|
385
|
-
session: SessionStore;
|
|
386
299
|
}
|
|
387
300
|
declare function createCursorTooltip(deps: CursorTooltipDeps): CursorTooltip;
|
|
388
301
|
|
|
389
|
-
interface OverlayShowOptions {
|
|
390
|
-
label?: string;
|
|
391
|
-
color?: string;
|
|
392
|
-
padding?: number;
|
|
393
|
-
borderStyle?: string;
|
|
394
|
-
borderWidth?: number;
|
|
395
|
-
fillOpacity?: number;
|
|
396
|
-
backdrop?: boolean;
|
|
397
|
-
}
|
|
398
|
-
interface Overlay {
|
|
399
|
-
show(target: Element, options?: OverlayShowOptions): void;
|
|
400
|
-
hide(): void;
|
|
401
|
-
destroy(): void;
|
|
402
|
-
onDismiss: (() => void) | null;
|
|
403
|
-
readonly isVisible: boolean;
|
|
404
|
-
}
|
|
405
|
-
interface OverlayDeps {
|
|
406
|
-
container: Element | ShadowRoot;
|
|
407
|
-
}
|
|
408
|
-
declare function createOverlay(deps: OverlayDeps): Overlay;
|
|
409
|
-
|
|
410
302
|
interface InspectorMatch {
|
|
411
303
|
element: HTMLElement;
|
|
412
304
|
ref: EntityRef;
|
|
@@ -445,81 +337,46 @@ interface Inspector {
|
|
|
445
337
|
mount(): void;
|
|
446
338
|
destroy(): void;
|
|
447
339
|
}
|
|
448
|
-
declare function defaultResolveMatch(target: Element, registry?: Registry): InspectorMatch | null;
|
|
449
340
|
declare function resolveEntityElement(ref: EntityRef): HTMLElement | null;
|
|
450
|
-
interface HighlightControllerLike {
|
|
451
|
-
show(ref: EntityRef, opts?: OverlayShowOptions): void;
|
|
452
|
-
hide(): void;
|
|
453
|
-
}
|
|
454
|
-
declare function createHighlightController(overlay: Overlay): HighlightControllerLike;
|
|
455
341
|
declare function createInspector(options: InspectorOptions): Inspector;
|
|
456
342
|
|
|
457
|
-
type PinMatchMode = "route" | "pathname" | "component";
|
|
458
|
-
interface PinFilter {
|
|
459
|
-
branch: string | null;
|
|
460
|
-
commit: string | null;
|
|
461
|
-
}
|
|
462
|
-
interface PinFilterState extends PinFilter {
|
|
463
|
-
readonly commits: readonly string[];
|
|
464
|
-
readonly commitIndex: number;
|
|
465
|
-
}
|
|
466
|
-
interface PinLayer {
|
|
467
|
-
setPins(pins: readonly PinRecord[]): void;
|
|
468
|
-
addPin(pin: PinRecord): void;
|
|
469
|
-
removePin(reportId: string): void;
|
|
470
|
-
clear(): void;
|
|
471
|
-
getPinsForElement(componentId: string): readonly PinRecord[];
|
|
472
|
-
getAllPinsForElement(componentId: string): readonly PinRecord[];
|
|
473
|
-
getAllPins(): readonly PinRecord[];
|
|
474
|
-
attachChannel(channel: RealtimeChannel): () => void;
|
|
475
|
-
attachCloud(opts: AttachCloudOpts): () => void;
|
|
476
|
-
refresh(): Promise<void>;
|
|
477
|
-
readonly filterState: PinFilterState;
|
|
478
|
-
setFilter(filter: Partial<PinFilter>): void;
|
|
479
|
-
nextCommit(): void;
|
|
480
|
-
prevCommit(): void;
|
|
481
|
-
onFilterChange(cb: () => void): () => void;
|
|
482
|
-
readonly visible: boolean;
|
|
483
|
-
setVisible(visible: boolean): void;
|
|
484
|
-
destroy(): void;
|
|
485
|
-
}
|
|
486
|
-
interface AttachCloudOpts {
|
|
487
|
-
cloud: Pick<CloudAdapter, "pins">;
|
|
488
|
-
channel?: RealtimeChannel | null;
|
|
489
|
-
getRoute: () => string;
|
|
490
|
-
getPathname: () => string;
|
|
491
|
-
getVisibleEntities: () => string[];
|
|
492
|
-
getMatchMode: () => PinMatchMode;
|
|
493
|
-
onError?: (err: unknown) => void;
|
|
494
|
-
}
|
|
495
|
-
interface PinLayerOptions {
|
|
496
|
-
container: Element | ShadowRoot;
|
|
497
|
-
onOpenPinDetail?: (componentId: string, reportId: string) => void;
|
|
498
|
-
onHoverPin?: (anchor: HTMLElement | null, componentId: string | null) => void;
|
|
499
|
-
onPinsChanged?: () => void;
|
|
500
|
-
currentBranch?: string | null;
|
|
501
|
-
}
|
|
502
|
-
declare function createPinLayer(options: PinLayerOptions): PinLayer;
|
|
503
|
-
|
|
504
343
|
type Corner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
505
344
|
interface MenuBarOptions {
|
|
506
345
|
container: Element;
|
|
507
346
|
session: SessionStore;
|
|
508
347
|
initialCorner?: Corner;
|
|
509
348
|
appTitle?: string;
|
|
510
|
-
channel?: RealtimeChannel | null;
|
|
511
|
-
pinLayer?: PinLayer | null;
|
|
512
349
|
}
|
|
513
350
|
interface MenuBar {
|
|
514
351
|
destroy(): void;
|
|
515
352
|
snapTo(corner: Corner): void;
|
|
516
353
|
snapToNearest(x: number, y: number): void;
|
|
517
|
-
setPinLayer(layer: PinLayer): void;
|
|
518
354
|
readonly corner: Corner;
|
|
519
355
|
readonly root: HTMLElement;
|
|
520
356
|
}
|
|
521
357
|
declare function createMenuBar(options: MenuBarOptions): MenuBar;
|
|
522
358
|
|
|
359
|
+
interface OverlayShowOptions {
|
|
360
|
+
label?: string;
|
|
361
|
+
color?: string;
|
|
362
|
+
padding?: number;
|
|
363
|
+
borderStyle?: string;
|
|
364
|
+
borderWidth?: number;
|
|
365
|
+
fillOpacity?: number;
|
|
366
|
+
backdrop?: boolean;
|
|
367
|
+
}
|
|
368
|
+
interface Overlay {
|
|
369
|
+
show(target: Element, options?: OverlayShowOptions): void;
|
|
370
|
+
hide(): void;
|
|
371
|
+
destroy(): void;
|
|
372
|
+
onDismiss: (() => void) | null;
|
|
373
|
+
readonly isVisible: boolean;
|
|
374
|
+
}
|
|
375
|
+
interface OverlayDeps {
|
|
376
|
+
container: Element | ShadowRoot;
|
|
377
|
+
}
|
|
378
|
+
declare function createOverlay(deps: OverlayDeps): Overlay;
|
|
379
|
+
|
|
523
380
|
interface ThemeDetector {
|
|
524
381
|
destroy(): void;
|
|
525
382
|
/** Resolve the current theme preference against the environment. */
|
|
@@ -538,8 +395,6 @@ interface CreateSurfaceShellOptions {
|
|
|
538
395
|
stylesheets?: string[];
|
|
539
396
|
initialCorner?: Corner;
|
|
540
397
|
appTitle?: string;
|
|
541
|
-
channel?: RealtimeChannel | null;
|
|
542
|
-
pinLayer?: PinLayer | null;
|
|
543
398
|
/**
|
|
544
399
|
* Additional inspector wiring. Hover is pre-wired to overlay + tooltip; pass
|
|
545
400
|
* `onSelect` (and `onAfterHover`) to extend behaviour without rebuilding the
|
|
@@ -592,7 +447,7 @@ interface CreateRouterOptions {
|
|
|
592
447
|
}
|
|
593
448
|
declare function createRouter(options: CreateRouterOptions): Router;
|
|
594
449
|
|
|
595
|
-
type ViewSurface = ListSurface | DetailSurface
|
|
450
|
+
type ViewSurface = ListSurface | DetailSurface;
|
|
596
451
|
interface ListSurface {
|
|
597
452
|
kind: "list";
|
|
598
453
|
id: string;
|
|
@@ -719,9 +574,16 @@ type DetailSection = {
|
|
|
719
574
|
id: "routes";
|
|
720
575
|
paths: readonly string[];
|
|
721
576
|
filterable?: boolean;
|
|
722
|
-
}
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* `url` renders immediately; `load` fetches lazily (cloud pins travel
|
|
580
|
+
* without their screenshot) and the section stays hidden until — and
|
|
581
|
+
* unless — the promise resolves with a data URL.
|
|
582
|
+
*/
|
|
583
|
+
| {
|
|
723
584
|
id: "screenshot";
|
|
724
|
-
url
|
|
585
|
+
url?: string;
|
|
586
|
+
load?: () => Promise<string | null>;
|
|
725
587
|
} | {
|
|
726
588
|
id: "metadata";
|
|
727
589
|
entries: readonly MetadataEntry[];
|
|
@@ -730,102 +592,6 @@ interface MetadataEntry {
|
|
|
730
592
|
label: string;
|
|
731
593
|
value: string;
|
|
732
594
|
}
|
|
733
|
-
interface FormSurface {
|
|
734
|
-
kind: "form";
|
|
735
|
-
id: string;
|
|
736
|
-
fields: readonly FormField[];
|
|
737
|
-
submit: FormSubmit;
|
|
738
|
-
initial?: Record<string, FormValue>;
|
|
739
|
-
/**
|
|
740
|
-
* Optional Standard Schema (Zod v4, Valibot, ArkType, etc.) run against the
|
|
741
|
-
* collected form values before `submit.onSubmit`. On failure, issues are
|
|
742
|
-
* routed to the matching `<FieldError>` and submission is skipped.
|
|
743
|
-
*/
|
|
744
|
-
schema?: StandardSchemaV1<Record<string, unknown>>;
|
|
745
|
-
/**
|
|
746
|
-
* Promise resolving to a base64 screenshot data URL. When provided, the
|
|
747
|
-
* form renderer shows a thumbnail preview above the fields.
|
|
748
|
-
*/
|
|
749
|
-
screenshotPreview?: Promise<string | null>;
|
|
750
|
-
}
|
|
751
|
-
/**
|
|
752
|
-
* Minimal StandardSchemaV1 surface — kept inline so the SDK doesn't need a
|
|
753
|
-
* type-level dep on any specific validator package.
|
|
754
|
-
*/
|
|
755
|
-
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
756
|
-
readonly "~standard": {
|
|
757
|
-
readonly version: 1;
|
|
758
|
-
readonly vendor: string;
|
|
759
|
-
readonly validate: (value: unknown) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
|
|
760
|
-
readonly types?: {
|
|
761
|
-
readonly input: Input;
|
|
762
|
-
readonly output: Output;
|
|
763
|
-
};
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
type StandardSchemaResult<Output> = {
|
|
767
|
-
readonly value: Output;
|
|
768
|
-
readonly issues?: undefined;
|
|
769
|
-
} | {
|
|
770
|
-
readonly issues: ReadonlyArray<StandardSchemaIssue>;
|
|
771
|
-
};
|
|
772
|
-
interface StandardSchemaIssue {
|
|
773
|
-
readonly message: string;
|
|
774
|
-
readonly path?: ReadonlyArray<PropertyKey | {
|
|
775
|
-
readonly key: PropertyKey;
|
|
776
|
-
}>;
|
|
777
|
-
}
|
|
778
|
-
interface FormSubmit {
|
|
779
|
-
label: string;
|
|
780
|
-
onSubmit: (values: Record<string, FormValue>) => FormSubmitResult | void | Promise<FormSubmitResult | void>;
|
|
781
|
-
}
|
|
782
|
-
type FormSubmitResult = {
|
|
783
|
-
status: "success";
|
|
784
|
-
message?: string;
|
|
785
|
-
link?: {
|
|
786
|
-
url: string;
|
|
787
|
-
label?: string;
|
|
788
|
-
};
|
|
789
|
-
resetFields?: readonly string[];
|
|
790
|
-
} | {
|
|
791
|
-
status: "error";
|
|
792
|
-
message: string;
|
|
793
|
-
/** Per-field error messages keyed by field `name`. */
|
|
794
|
-
fieldErrors?: Record<string, string>;
|
|
795
|
-
};
|
|
796
|
-
type FormValue = string | boolean;
|
|
797
|
-
interface FormFieldBase {
|
|
798
|
-
name: string;
|
|
799
|
-
label: string;
|
|
800
|
-
}
|
|
801
|
-
type FormField = (FormFieldBase & {
|
|
802
|
-
kind: "select";
|
|
803
|
-
options: readonly {
|
|
804
|
-
value: string;
|
|
805
|
-
label: string;
|
|
806
|
-
}[];
|
|
807
|
-
required?: boolean;
|
|
808
|
-
value?: string;
|
|
809
|
-
}) | (FormFieldBase & {
|
|
810
|
-
kind: "text";
|
|
811
|
-
placeholder?: string;
|
|
812
|
-
required?: boolean;
|
|
813
|
-
value?: string;
|
|
814
|
-
}) | (FormFieldBase & {
|
|
815
|
-
kind: "email";
|
|
816
|
-
placeholder?: string;
|
|
817
|
-
required?: boolean;
|
|
818
|
-
value?: string;
|
|
819
|
-
}) | (FormFieldBase & {
|
|
820
|
-
kind: "textarea";
|
|
821
|
-
placeholder?: string;
|
|
822
|
-
required?: boolean;
|
|
823
|
-
rows?: number;
|
|
824
|
-
value?: string;
|
|
825
|
-
}) | (FormFieldBase & {
|
|
826
|
-
kind: "checkbox";
|
|
827
|
-
value?: boolean;
|
|
828
|
-
});
|
|
829
595
|
|
|
830
596
|
interface ViewPalette {
|
|
831
597
|
label: string;
|
|
@@ -849,13 +615,6 @@ interface HighlightController {
|
|
|
849
615
|
interface ViewContext {
|
|
850
616
|
ref: EntityRef | null;
|
|
851
617
|
registry: Registry;
|
|
852
|
-
cloud: CloudAdapter<unknown, unknown, unknown> | null;
|
|
853
|
-
/**
|
|
854
|
-
* Local user identity from `createUidex`'s `user` option, or `null` when
|
|
855
|
-
* unconfigured. Views that auto-populate attribution (e.g. report
|
|
856
|
-
* `reporterName`) read this here instead of touching the session store.
|
|
857
|
-
*/
|
|
858
|
-
user: UserIdentity | null;
|
|
859
618
|
views: Router;
|
|
860
619
|
/** Push a view onto the stack. Unregistered ids are a no-op. */
|
|
861
620
|
push: (target: ViewPushTarget) => void;
|
|
@@ -871,11 +630,6 @@ interface ViewContext {
|
|
|
871
630
|
highlight: HighlightController;
|
|
872
631
|
/** Snapshot of the current view stack (top-most last). */
|
|
873
632
|
getStack: () => readonly ViewStackEntry[];
|
|
874
|
-
pushEscapeLayer(handler: EscapeHandler): Cleanup;
|
|
875
|
-
/** Called after a report submission succeeds, to refresh pins etc. */
|
|
876
|
-
onAfterSubmit?: () => void;
|
|
877
|
-
/** Return the current route pattern. Falls back to `location.pathname`. */
|
|
878
|
-
getRoute?: () => string;
|
|
879
633
|
}
|
|
880
634
|
interface ShellHint {
|
|
881
635
|
key: string;
|
|
@@ -920,8 +674,9 @@ interface View {
|
|
|
920
674
|
* when the declared target has been removed from the host.
|
|
921
675
|
*/
|
|
922
676
|
focusTarget?: (root: HTMLElement, ctx: ViewContext) => HTMLElement | null;
|
|
923
|
-
|
|
924
|
-
|
|
677
|
+
/** Required unless `render` is provided. */
|
|
678
|
+
surface?: (ctx: ViewContext) => ViewSurface;
|
|
679
|
+
/** Direct render for integration adapters (React, etc.). Takes precedence over `surface` when both are present. */
|
|
925
680
|
render?: (ctx: ViewContext, root: HTMLElement) => Cleanup | void;
|
|
926
681
|
parent?: (ref: EntityRef | null) => ViewStackEntry | null;
|
|
927
682
|
}
|
|
@@ -948,29 +703,21 @@ interface PaletteShortcut {
|
|
|
948
703
|
shift?: boolean;
|
|
949
704
|
}
|
|
950
705
|
declare function formatShortcutLabel(shortcut: PaletteShortcut): string;
|
|
951
|
-
type EscapeHandler = () => boolean;
|
|
952
706
|
|
|
953
707
|
declare const SURFACE_HOST_CLASS = "uidex-surface-host";
|
|
954
|
-
declare const SURFACE_CONTAINER_CLASS = "uidex-container";
|
|
955
708
|
declare const Z_BASE = 2147483630;
|
|
956
709
|
declare const Z_OVERLAY = 2147483635;
|
|
957
|
-
declare const Z_PIN_LAYER = 2147483640;
|
|
958
710
|
declare const Z_CHROME = 2147483645;
|
|
959
|
-
declare const SURFACE_IGNORE_SELECTOR = ".uidex-surface-host
|
|
711
|
+
declare const SURFACE_IGNORE_SELECTOR = ".uidex-surface-host";
|
|
960
712
|
|
|
961
713
|
interface ViewStackOptions {
|
|
962
714
|
container: HTMLElement;
|
|
963
715
|
views: Router;
|
|
964
716
|
session: SessionStore;
|
|
965
717
|
registry: Registry;
|
|
966
|
-
cloud?: CloudAdapter | null;
|
|
967
718
|
highlight: HighlightController;
|
|
968
|
-
globalActions?: (ctx: ViewContext) => ShellAction[];
|
|
969
719
|
shortcut?: PaletteShortcut;
|
|
970
720
|
dev?: boolean;
|
|
971
|
-
pushEscapeLayer?: ViewContext["pushEscapeLayer"];
|
|
972
|
-
onAfterSubmit?: () => void;
|
|
973
|
-
getRoute?: () => string;
|
|
974
721
|
}
|
|
975
722
|
interface ViewStack {
|
|
976
723
|
/**
|
|
@@ -992,12 +739,8 @@ declare const widgetDetailView: View;
|
|
|
992
739
|
declare const primitiveDetailView: View;
|
|
993
740
|
declare const pageDetailView: View;
|
|
994
741
|
|
|
995
|
-
declare const reportView: View;
|
|
996
|
-
|
|
997
742
|
declare const flowDetailView: View;
|
|
998
743
|
|
|
999
|
-
declare const pinSettingsView: View;
|
|
1000
|
-
|
|
1001
744
|
declare function buildDefaultViews(shortcut?: PaletteShortcut): View[];
|
|
1002
745
|
|
|
1003
746
|
interface CreateUidexOptions {
|
|
@@ -1007,38 +750,13 @@ interface CreateUidexOptions {
|
|
|
1007
750
|
initialCorner?: Corner;
|
|
1008
751
|
/** Shown as a label at the start of the menu bar. */
|
|
1009
752
|
appTitle?: string;
|
|
1010
|
-
cloud?: CloudAdapter | null;
|
|
1011
753
|
dev?: boolean;
|
|
1012
754
|
/** Register bundled default views. Defaults to `true`. */
|
|
1013
755
|
defaultViews?: boolean;
|
|
1014
756
|
/** Additional views to register (after defaults). */
|
|
1015
757
|
views?: readonly View[];
|
|
1016
|
-
/**
|
|
1017
|
-
* Override ingest behaviour. When `cloud` is non-null, ingest auto-enables
|
|
1018
|
-
* (both console and network capture). Pass `null` to disable entirely, or
|
|
1019
|
-
* an options object to override either channel.
|
|
1020
|
-
*/
|
|
1021
|
-
ingest?: IngestOptions | null;
|
|
1022
758
|
/** Keyboard shortcut for the command palette. Defaults to Cmd+K / Ctrl+K. */
|
|
1023
759
|
shortcut?: PaletteShortcut;
|
|
1024
|
-
/**
|
|
1025
|
-
* Identity for the local user. Required to opt into realtime collaborative
|
|
1026
|
-
* features (peer cursors, presence). When omitted, realtime stays
|
|
1027
|
-
* disconnected and report attribution falls back to whatever the user
|
|
1028
|
-
* types in the report form.
|
|
1029
|
-
*/
|
|
1030
|
-
user?: UserIdentity;
|
|
1031
|
-
/** Git context for pin filtering. Typically mirrors `cloud({ git })`. */
|
|
1032
|
-
git?: {
|
|
1033
|
-
branch?: string;
|
|
1034
|
-
commit?: string;
|
|
1035
|
-
};
|
|
1036
|
-
/**
|
|
1037
|
-
* Return the current route pattern (e.g. `/users/:id`). Used for
|
|
1038
|
-
* route-based pin matching and report attribution. When omitted, the SDK
|
|
1039
|
-
* falls back to `location.pathname`.
|
|
1040
|
-
*/
|
|
1041
|
-
getRoute?: () => string;
|
|
1042
760
|
}
|
|
1043
761
|
interface Uidex {
|
|
1044
762
|
mount(target?: Element): void;
|
|
@@ -1046,10 +764,8 @@ interface Uidex {
|
|
|
1046
764
|
readonly registry: Registry;
|
|
1047
765
|
readonly session: SessionStore;
|
|
1048
766
|
readonly views: Router;
|
|
1049
|
-
readonly cloud: CloudAdapter | null;
|
|
1050
|
-
readonly ingest: Ingest | null;
|
|
1051
767
|
readonly shadowRoot: ShadowRoot | null;
|
|
1052
768
|
}
|
|
1053
769
|
declare function createUidex(options?: CreateUidexOptions): Uidex;
|
|
1054
770
|
|
|
1055
|
-
export { type
|
|
771
|
+
export { type Cleanup, type Corner, type CreateRouterOptions, type CreateSessionOptions, type CreateSurfaceShellOptions, type CreateUidexOptions, type CursorTooltip, type CursorTooltipDeps, type DetailAction, type DetailActionIcon, type DetailActionRunContext, type DetailSection, type DetailSubtitle, type DetailSurface, ENTITY_KINDS, type Element$1 as Element, type Entity, type EntityByKind, type EntityKind, type EntityRef, type Feature, type Flow, type HighlightActions, type HighlightController, type Inspector, type InspectorMatch, type InspectorMatchStack, type InspectorOptions, KIND_STYLE, type KindStyleEntry, type ListItem, type ListSurface, type Location, type MenuBar, type MenuBarOptions, type MetaEntityKind, type Metadata, type ModeBindings, type ModeSnapshot, type ModeStore, type ModeTransitions, type NavigationActions, type NavigationState, type NavigationStore, type Overlay, type OverlayShowOptions, type Page, type PaletteShortcut, type Primitive, type Region, type Registry, type ReportRecord, type ResolvedTheme, type Route, type RouteMatch, type Router, SURFACE_HOST_CLASS, SURFACE_IGNORE_SELECTOR, type Scope, type SessionSnapshot, type SessionState, type SessionStore, type ShellAction, type ShellHint, type SurfaceHost, type SurfaceHostOptions, type SurfaceMode, type SurfaceShell, type ThemeDetector, type ThemeDetectorDeps, type ThemePreference, type Uidex, UnknownEntityKindError, type View, type ViewContext, type ViewPalette, type ViewPushTarget, type ViewStack, type ViewStackEntry, type ViewStackOptions, type ViewSurface, ViewValidationError, type Widget, Z_BASE, Z_CHROME, Z_OVERLAY, assertEntityKind, buildDefaultViews, componentDetailView, createCommandPaletteView, createCursorTooltip, createInspector, createMenuBar, createModeStore, createNavigationStore, createOverlay, createRegistry, createRouter, createSession, createSurfaceHost, createSurfaceShell, createThemeDetector, createUidex, createViewStack, displayName, entityKey, featureDetailView, flowDetailView, formatShortcutLabel, isMetaKind, pageDetailView, prettify, primitiveDetailView, regionDetailView, resolveEntityElement, resolveTheme, widgetDetailView };
|