uidex 0.2.4 → 0.3.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 +253 -353
- package/dist/cli/cli.cjs +3243 -0
- package/dist/cli/cli.cjs.map +1 -0
- package/dist/cloud/index.cjs +149 -0
- package/dist/cloud/index.cjs.map +1 -0
- package/dist/cloud/index.d.cts +108 -0
- package/dist/cloud/index.d.ts +108 -0
- package/dist/cloud/index.js +120 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/headless/index.cjs +3580 -0
- package/dist/headless/index.cjs.map +1 -0
- package/dist/headless/index.d.cts +214 -0
- package/dist/headless/index.d.ts +214 -0
- package/dist/headless/index.js +3562 -0
- package/dist/headless/index.js.map +1 -0
- package/dist/index.cjs +6902 -9801
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +901 -146
- package/dist/index.d.ts +901 -146
- package/dist/index.js +6896 -9805
- package/dist/index.js.map +1 -1
- package/dist/playwright/index.cjs +164 -24
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.cts +30 -53
- package/dist/playwright/index.d.ts +30 -53
- package/dist/playwright/index.js +148 -21
- package/dist/playwright/index.js.map +1 -1
- package/dist/playwright/reporter.cjs +62 -28
- package/dist/playwright/reporter.cjs.map +1 -1
- package/dist/playwright/reporter.d.cts +24 -12
- package/dist/playwright/reporter.d.ts +24 -12
- package/dist/playwright/reporter.js +62 -28
- package/dist/playwright/reporter.js.map +1 -1
- package/dist/react/index.cjs +6936 -9808
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +673 -146
- package/dist/react/index.d.ts +673 -146
- package/dist/react/index.js +6980 -9811
- package/dist/react/index.js.map +1 -1
- package/dist/scan/index.cjs +3281 -0
- package/dist/scan/index.cjs.map +1 -0
- package/dist/scan/index.d.cts +373 -0
- package/dist/scan/index.d.ts +373 -0
- package/dist/scan/index.js +3224 -0
- package/dist/scan/index.js.map +1 -0
- package/package.json +71 -65
- package/templates/claude/audit.md +37 -0
- package/templates/claude/rules.md +212 -0
- package/claude/audit-command.md +0 -46
- package/claude/rules.md +0 -167
- package/dist/api/index.cjs +0 -254
- package/dist/api/index.cjs.map +0 -1
- package/dist/api/index.d.cts +0 -236
- package/dist/api/index.d.ts +0 -236
- package/dist/api/index.js +0 -226
- package/dist/api/index.js.map +0 -1
- package/dist/core/index.cjs +0 -11045
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -424
- package/dist/core/index.d.ts +0 -424
- package/dist/core/index.global.js +0 -66516
- package/dist/core/index.global.js.map +0 -1
- package/dist/core/index.js +0 -10995
- package/dist/core/index.js.map +0 -1
- package/dist/core/style.css +0 -1529
- package/dist/scripts/cli.cjs +0 -3904
- package/uidex.schema.json +0 -93
package/dist/react/index.d.ts
CHANGED
|
@@ -1,78 +1,222 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
3
|
+
import { StoreApi } from 'zustand/vanilla';
|
|
4
|
+
|
|
5
|
+
declare const ENTITY_KINDS: readonly ["route", "page", "feature", "widget", "region", "element", "primitive", "flow"];
|
|
6
|
+
type EntityKind = (typeof ENTITY_KINDS)[number];
|
|
7
|
+
type Scope = string;
|
|
8
|
+
interface Location {
|
|
9
|
+
file: string;
|
|
10
|
+
line?: number;
|
|
11
|
+
column?: number;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
line: number;
|
|
17
|
-
kind: UidexKind;
|
|
18
|
-
doc?: string;
|
|
19
|
-
scopes?: string[];
|
|
13
|
+
interface EntityRef {
|
|
14
|
+
kind: EntityKind;
|
|
15
|
+
id: string;
|
|
20
16
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
name: string;
|
|
24
|
-
filePath: string;
|
|
25
|
-
scope: string;
|
|
26
|
-
composes: string[];
|
|
27
|
-
usedBy: string[];
|
|
28
|
-
kind: 'primitive';
|
|
29
|
-
}
|
|
30
|
-
interface UidexPage {
|
|
31
|
-
dir: string;
|
|
32
|
-
content: string;
|
|
17
|
+
interface Metadata {
|
|
18
|
+
name?: string;
|
|
33
19
|
description?: string;
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
acceptance?: string[];
|
|
21
|
+
notes?: string;
|
|
22
|
+
composes?: EntityRef[];
|
|
23
|
+
flows?: readonly string[];
|
|
24
|
+
features?: string[];
|
|
25
|
+
widgets?: string[];
|
|
36
26
|
}
|
|
37
|
-
interface
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
interface EntityWithMetaBase {
|
|
28
|
+
id: string;
|
|
29
|
+
loc?: Location;
|
|
30
|
+
scopes?: Scope[];
|
|
31
|
+
meta?: Metadata;
|
|
42
32
|
}
|
|
43
|
-
interface
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
altKey?: boolean;
|
|
48
|
-
metaKey?: boolean;
|
|
33
|
+
interface Route {
|
|
34
|
+
kind: "route";
|
|
35
|
+
path: string;
|
|
36
|
+
page: string;
|
|
49
37
|
}
|
|
50
|
-
interface
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
reporter?: {
|
|
56
|
-
email?: string;
|
|
57
|
-
name?: string;
|
|
58
|
-
};
|
|
59
|
-
metadata?: Record<string, string>;
|
|
60
|
-
captureConsole?: boolean;
|
|
61
|
-
captureNetwork?: boolean;
|
|
38
|
+
interface Flow {
|
|
39
|
+
kind: "flow";
|
|
40
|
+
id: string;
|
|
41
|
+
loc: Location;
|
|
42
|
+
touches: string[];
|
|
62
43
|
}
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
interface Page extends EntityWithMetaBase {
|
|
45
|
+
kind: "page";
|
|
46
|
+
}
|
|
47
|
+
interface Feature extends EntityWithMetaBase {
|
|
48
|
+
kind: "feature";
|
|
49
|
+
}
|
|
50
|
+
interface Widget extends EntityWithMetaBase {
|
|
51
|
+
kind: "widget";
|
|
52
|
+
}
|
|
53
|
+
interface Region extends EntityWithMetaBase {
|
|
54
|
+
kind: "region";
|
|
55
|
+
}
|
|
56
|
+
interface Element$1 extends EntityWithMetaBase {
|
|
57
|
+
kind: "element";
|
|
58
|
+
}
|
|
59
|
+
interface Primitive extends EntityWithMetaBase {
|
|
60
|
+
kind: "primitive";
|
|
61
|
+
}
|
|
62
|
+
type Entity = Route | Page | Feature | Widget | Region | Element$1 | Primitive | Flow;
|
|
63
|
+
type EntityByKind<K extends EntityKind> = Extract<Entity, {
|
|
64
|
+
kind: K;
|
|
65
|
+
}>;
|
|
66
|
+
|
|
67
|
+
interface Registry {
|
|
68
|
+
add(entity: Entity): void;
|
|
69
|
+
get<K extends EntityKind>(kind: K, id: string): EntityByKind<K> | undefined;
|
|
70
|
+
list<K extends EntityKind>(kind: K): ReadonlyArray<EntityByKind<K>>;
|
|
71
|
+
query(predicate: (entity: Entity) => boolean): Entity[];
|
|
72
|
+
byScope(scope: Scope): Entity[];
|
|
73
|
+
touchedBy(flowId: string): Entity[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
type ThemePreference = "light" | "dark" | "auto";
|
|
77
|
+
type ResolvedTheme = "light" | "dark";
|
|
78
|
+
interface ViewStackEntry {
|
|
65
79
|
id: string;
|
|
66
|
-
|
|
80
|
+
ref: EntityRef | null;
|
|
81
|
+
}
|
|
82
|
+
interface SessionSnapshot {
|
|
83
|
+
hover: EntityRef | null;
|
|
84
|
+
selection: EntityRef | null;
|
|
85
|
+
stack: ViewStackEntry[];
|
|
86
|
+
/** Sticky overlay highlight. Set by "Highlight Element" actions; cleared on Esc. */
|
|
87
|
+
pinnedHighlight: EntityRef | null;
|
|
88
|
+
inspectorActive: boolean;
|
|
89
|
+
theme: ThemePreference;
|
|
90
|
+
resolvedTheme: ResolvedTheme;
|
|
91
|
+
ingestActive: boolean;
|
|
92
|
+
}
|
|
93
|
+
interface SessionActions {
|
|
94
|
+
hover(ref: EntityRef | null): void;
|
|
95
|
+
select(ref: EntityRef | null): void;
|
|
96
|
+
/**
|
|
97
|
+
* Append a view onto the view stack. Pure: never resolves defaults.
|
|
98
|
+
*/
|
|
99
|
+
pushStack(entry: ViewStackEntry): void;
|
|
100
|
+
/**
|
|
101
|
+
* Remove the top entry from the view stack. No-op when the stack is empty.
|
|
102
|
+
*/
|
|
103
|
+
popStack(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Empty the view stack.
|
|
106
|
+
*/
|
|
107
|
+
clearStack(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Open a view by id. If `ref` is omitted, the current `selection` is captured;
|
|
110
|
+
* pass `null` explicitly to open the view with no ref context. Thin wrapper
|
|
111
|
+
* around `pushStack`.
|
|
112
|
+
*/
|
|
113
|
+
openView(id: string, ref?: EntityRef | null): void;
|
|
114
|
+
/**
|
|
115
|
+
* Clear the entire view stack. Thin wrapper around `clearStack`.
|
|
116
|
+
*/
|
|
117
|
+
closeView(): void;
|
|
118
|
+
setInspectorActive(active: boolean): void;
|
|
119
|
+
toggleInspector(): void;
|
|
120
|
+
/** Pin the overlay to `ref` until `clearPinnedHighlight` is called. */
|
|
121
|
+
pinHighlight(ref: EntityRef): void;
|
|
122
|
+
clearPinnedHighlight(): void;
|
|
123
|
+
setTheme(theme: ThemePreference, resolved?: ResolvedTheme): void;
|
|
124
|
+
setIngest(active: boolean): void;
|
|
125
|
+
}
|
|
126
|
+
interface SessionState extends SessionSnapshot {
|
|
127
|
+
actions: SessionActions;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
type SurfaceEvent = {
|
|
131
|
+
type: "TOGGLE_INSPECTOR";
|
|
132
|
+
} | {
|
|
133
|
+
type: "OPEN_PALETTE";
|
|
134
|
+
} | {
|
|
135
|
+
type: "PUSH_VIEW";
|
|
136
|
+
entry: ViewStackEntry;
|
|
137
|
+
} | {
|
|
138
|
+
type: "POP_VIEW";
|
|
139
|
+
} | {
|
|
140
|
+
type: "CLOSE";
|
|
141
|
+
} | {
|
|
142
|
+
type: "ESC";
|
|
143
|
+
} | {
|
|
144
|
+
type: "CMD_K";
|
|
67
145
|
} | {
|
|
68
|
-
|
|
69
|
-
|
|
146
|
+
type: "SELECT";
|
|
147
|
+
ref: EntityRef | null;
|
|
148
|
+
entry: ViewStackEntry;
|
|
149
|
+
} | {
|
|
150
|
+
type: "SET_SELECTION";
|
|
151
|
+
ref: EntityRef | null;
|
|
152
|
+
} | {
|
|
153
|
+
type: "HOVER";
|
|
154
|
+
ref: EntityRef;
|
|
155
|
+
element: HTMLElement | null;
|
|
156
|
+
color?: string | null;
|
|
157
|
+
} | {
|
|
158
|
+
type: "UNHOVER";
|
|
159
|
+
} | {
|
|
160
|
+
type: "PIN";
|
|
161
|
+
ref?: EntityRef;
|
|
162
|
+
} | {
|
|
163
|
+
type: "UNPIN";
|
|
164
|
+
} | {
|
|
165
|
+
type: "SET_THEME";
|
|
166
|
+
theme: ThemePreference;
|
|
167
|
+
resolvedTheme: ResolvedTheme;
|
|
168
|
+
} | {
|
|
169
|
+
type: "SET_INGEST";
|
|
170
|
+
active: boolean;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
type SessionStore = StoreApi<SessionState> & {
|
|
174
|
+
send(event: SurfaceEvent): void;
|
|
70
175
|
};
|
|
71
|
-
|
|
72
|
-
type
|
|
73
|
-
|
|
176
|
+
|
|
177
|
+
type ConsoleLevel = "warn" | "error";
|
|
178
|
+
interface ConsoleEntry {
|
|
179
|
+
level: ConsoleLevel;
|
|
180
|
+
message: string;
|
|
181
|
+
timestamp: string;
|
|
182
|
+
}
|
|
183
|
+
interface ConsoleCaptureOptions {
|
|
184
|
+
limit?: number;
|
|
185
|
+
target?: Console;
|
|
186
|
+
now?: () => Date;
|
|
187
|
+
}
|
|
188
|
+
interface ConsoleCapture {
|
|
189
|
+
start(): void;
|
|
190
|
+
stop(): void;
|
|
191
|
+
readonly isActive: boolean;
|
|
192
|
+
entries(): readonly ConsoleEntry[];
|
|
193
|
+
clear(): void;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface NetworkEntry {
|
|
197
|
+
method: string;
|
|
198
|
+
url: string;
|
|
199
|
+
status: number;
|
|
200
|
+
timestamp: string;
|
|
201
|
+
error?: string;
|
|
202
|
+
}
|
|
203
|
+
interface NetworkCaptureOptions {
|
|
204
|
+
limit?: number;
|
|
205
|
+
target?: {
|
|
206
|
+
fetch?: typeof fetch;
|
|
207
|
+
};
|
|
208
|
+
now?: () => Date;
|
|
209
|
+
}
|
|
210
|
+
interface NetworkCapture {
|
|
211
|
+
start(): void;
|
|
212
|
+
stop(): void;
|
|
213
|
+
readonly isActive: boolean;
|
|
214
|
+
entries(): readonly NetworkEntry[];
|
|
215
|
+
clear(): void;
|
|
216
|
+
}
|
|
217
|
+
|
|
74
218
|
interface ConsoleLogEntry {
|
|
75
|
-
level:
|
|
219
|
+
level: "log" | "warn" | "error" | "info";
|
|
76
220
|
message: string;
|
|
77
221
|
timestamp: string;
|
|
78
222
|
}
|
|
@@ -80,105 +224,488 @@ interface NetworkErrorEntry {
|
|
|
80
224
|
url: string;
|
|
81
225
|
method: string;
|
|
82
226
|
status: number | null;
|
|
83
|
-
statusText: string;
|
|
227
|
+
statusText: string | null;
|
|
84
228
|
timestamp: string;
|
|
85
229
|
}
|
|
86
|
-
interface
|
|
87
|
-
|
|
88
|
-
|
|
230
|
+
interface Viewport {
|
|
231
|
+
width: number;
|
|
232
|
+
height: number;
|
|
233
|
+
}
|
|
234
|
+
interface SourceRef {
|
|
235
|
+
filePath: string;
|
|
236
|
+
line: number;
|
|
237
|
+
}
|
|
238
|
+
interface FeedbackSuggestedTarget {
|
|
239
|
+
integrationId: string;
|
|
240
|
+
targetConfig: Record<string, unknown>;
|
|
241
|
+
}
|
|
242
|
+
interface FeedbackPayload {
|
|
243
|
+
type: "bug" | "feature" | "improvement" | "question";
|
|
244
|
+
severity: "low" | "medium" | "high" | "critical";
|
|
89
245
|
title?: string;
|
|
90
246
|
description: string;
|
|
91
247
|
componentId: string;
|
|
92
|
-
element
|
|
93
|
-
sources
|
|
94
|
-
filePath: string;
|
|
95
|
-
line: number;
|
|
96
|
-
}[];
|
|
248
|
+
element?: string | null;
|
|
249
|
+
sources?: SourceRef[];
|
|
97
250
|
url: string;
|
|
98
251
|
path: string;
|
|
99
|
-
route
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
pageDescription?: string;
|
|
103
|
-
locale: string;
|
|
104
|
-
sessionId: string;
|
|
105
|
-
viewport: {
|
|
106
|
-
width: number;
|
|
107
|
-
height: number;
|
|
108
|
-
};
|
|
109
|
-
screen: {
|
|
110
|
-
width: number;
|
|
111
|
-
height: number;
|
|
112
|
-
};
|
|
113
|
-
userAgent: string;
|
|
114
|
-
screenshot?: string;
|
|
252
|
+
route?: string | null;
|
|
253
|
+
pageTitle?: string;
|
|
254
|
+
sessionId?: string;
|
|
115
255
|
reporterEmail?: string;
|
|
116
256
|
reporterName?: string;
|
|
257
|
+
timestamp: string;
|
|
258
|
+
viewport: Viewport;
|
|
259
|
+
screen: Viewport;
|
|
260
|
+
userAgent: string;
|
|
261
|
+
locale?: string;
|
|
117
262
|
environment?: string;
|
|
118
263
|
appVersion?: string;
|
|
119
|
-
metadata?: Record<string, string>;
|
|
120
264
|
consoleLogs?: ConsoleLogEntry[];
|
|
121
265
|
networkErrors?: NetworkErrorEntry[];
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
interface
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
266
|
+
metadata?: Record<string, string>;
|
|
267
|
+
screenshot?: string;
|
|
268
|
+
suggestedTarget?: FeedbackSuggestedTarget;
|
|
269
|
+
}
|
|
270
|
+
interface FeedbackExternalLink {
|
|
271
|
+
ok: boolean;
|
|
272
|
+
url?: string;
|
|
273
|
+
key?: string;
|
|
274
|
+
error?: string;
|
|
275
|
+
}
|
|
276
|
+
interface FeedbackResult {
|
|
277
|
+
id: string;
|
|
278
|
+
sequenceNumber: number;
|
|
279
|
+
externalLink?: FeedbackExternalLink;
|
|
280
|
+
}
|
|
281
|
+
interface IngestConfigEpic {
|
|
282
|
+
key: string;
|
|
283
|
+
summary: string;
|
|
284
|
+
status: string;
|
|
285
|
+
}
|
|
286
|
+
interface IngestConfig {
|
|
287
|
+
hasJira: boolean;
|
|
288
|
+
integrationId?: string;
|
|
289
|
+
epics?: IngestConfigEpic[];
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Generic so third-party adapters (e.g. `uidex-cloud`) can plug in their own
|
|
293
|
+
* payload/result/integration shapes. SDK-bundled `cloud()` returns the
|
|
294
|
+
* defaulted form. `ViewContext.cloud` uses the fully-open variant; consumers
|
|
295
|
+
* that need the SDK shape narrow with `as CloudAdapter`.
|
|
296
|
+
*/
|
|
297
|
+
interface CloudAdapter<TPayload = FeedbackPayload, TResult = FeedbackResult, TIntegrations = {
|
|
298
|
+
getConfig(): Promise<IngestConfig>;
|
|
299
|
+
}> {
|
|
300
|
+
readonly feedback: {
|
|
301
|
+
submit(payload: TPayload): Promise<TResult>;
|
|
302
|
+
};
|
|
303
|
+
readonly integrations: TIntegrations;
|
|
304
|
+
}
|
|
161
305
|
|
|
162
|
-
interface
|
|
163
|
-
|
|
306
|
+
interface IngestOptions {
|
|
307
|
+
captureConsole?: boolean;
|
|
308
|
+
captureNetwork?: boolean;
|
|
309
|
+
consoleLimit?: number;
|
|
310
|
+
networkLimit?: number;
|
|
311
|
+
consoleTarget?: ConsoleCaptureOptions["target"];
|
|
312
|
+
networkTarget?: NetworkCaptureOptions["target"];
|
|
313
|
+
now?: () => Date;
|
|
314
|
+
}
|
|
315
|
+
interface Ingest {
|
|
316
|
+
start(): void;
|
|
317
|
+
stop(): void;
|
|
318
|
+
readonly isActive: boolean;
|
|
319
|
+
readonly console: ConsoleCapture | null;
|
|
320
|
+
readonly network: NetworkCapture | null;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface OverlayShowOptions {
|
|
324
|
+
label?: string;
|
|
164
325
|
color?: string;
|
|
165
|
-
|
|
326
|
+
padding?: number;
|
|
327
|
+
borderStyle?: string;
|
|
166
328
|
borderWidth?: number;
|
|
167
|
-
|
|
329
|
+
fillOpacity?: number;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
type Corner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
333
|
+
|
|
334
|
+
type ViewSurface = ListSurface | DetailSurface | FormSurface | CustomSurface;
|
|
335
|
+
interface ListSurface {
|
|
336
|
+
kind: "list";
|
|
337
|
+
id: string;
|
|
338
|
+
items: readonly ListItem[];
|
|
339
|
+
onSelect?(item: ListItem): void;
|
|
340
|
+
emptyLabel?: string;
|
|
341
|
+
defaultHighlight?: string;
|
|
342
|
+
filter?(item: ListItem, query: string): boolean;
|
|
343
|
+
}
|
|
344
|
+
interface ListItem {
|
|
345
|
+
value: string;
|
|
346
|
+
label: string;
|
|
347
|
+
subtitle?: string;
|
|
348
|
+
group?: string;
|
|
349
|
+
shortcut?: string;
|
|
350
|
+
/**
|
|
351
|
+
* When highlighted, the shell calls `ctx.highlight.show(preview)`.
|
|
352
|
+
* Cleared on unhighlight or view unmount.
|
|
353
|
+
*/
|
|
354
|
+
preview?: EntityRef;
|
|
355
|
+
/** Renders a kind chip on the left. `entity.kind` drives icon + color. */
|
|
356
|
+
entityChip?: {
|
|
357
|
+
entity: Entity;
|
|
358
|
+
node?: Element | null;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Optional leading-icon factory used for non-entity rows (e.g. a palette
|
|
362
|
+
* "Feedback" command). Called per-render so the returned Node is fresh.
|
|
363
|
+
* The shell wraps whatever is returned in a rounded-square tile.
|
|
364
|
+
*/
|
|
365
|
+
leading?: () => Node;
|
|
366
|
+
/** Raw data attribute tag appended to the row (for test/e2e hooks). */
|
|
367
|
+
tag?: string;
|
|
368
|
+
}
|
|
369
|
+
interface DetailSurface {
|
|
370
|
+
kind: "detail";
|
|
371
|
+
entityKind: EntityKind;
|
|
372
|
+
/** Registry lookup failed — renders the "not found" placeholder. */
|
|
373
|
+
notFound?: EntityRef;
|
|
374
|
+
/** Entity display name, rendered as the heading. */
|
|
375
|
+
title?: string;
|
|
376
|
+
subtitle?: DetailSubtitle;
|
|
377
|
+
actions?: readonly DetailAction[];
|
|
378
|
+
sections?: readonly DetailSection[];
|
|
379
|
+
}
|
|
380
|
+
interface DetailSubtitle {
|
|
381
|
+
rawId: string;
|
|
382
|
+
extra?: string;
|
|
383
|
+
}
|
|
384
|
+
interface DetailActionBase {
|
|
385
|
+
id: string;
|
|
386
|
+
label: string;
|
|
387
|
+
icon?: DetailActionIcon;
|
|
388
|
+
ariaLabel?: string;
|
|
389
|
+
hint?: string;
|
|
390
|
+
intent?: ShellActionIntent;
|
|
391
|
+
}
|
|
392
|
+
type DetailAction = (DetailActionBase & {
|
|
393
|
+
copy: string;
|
|
394
|
+
}) | (DetailActionBase & {
|
|
395
|
+
scrollTo: string;
|
|
396
|
+
}) | (DetailActionBase & {
|
|
397
|
+
push: {
|
|
398
|
+
id: string;
|
|
399
|
+
ref?: EntityRef | null;
|
|
400
|
+
};
|
|
401
|
+
}) | (DetailActionBase & {
|
|
402
|
+
navigate: EntityRef;
|
|
403
|
+
}) | (DetailActionBase & {
|
|
404
|
+
highlight: EntityRef;
|
|
405
|
+
}) | (DetailActionBase & {
|
|
406
|
+
run: (ctx: DetailActionRunContext) => void | Promise<void>;
|
|
407
|
+
});
|
|
408
|
+
type DetailActionIcon = "copy" | "message-circle" | "chevron-down" | "target";
|
|
409
|
+
interface DetailActionRunContext {
|
|
410
|
+
setLabel(next: string, durationMs?: number): void;
|
|
411
|
+
}
|
|
412
|
+
type DetailSection = {
|
|
413
|
+
id: "description";
|
|
414
|
+
text: string;
|
|
415
|
+
} | {
|
|
416
|
+
id: "acceptance";
|
|
417
|
+
items: readonly string[];
|
|
418
|
+
} | {
|
|
419
|
+
id: "scopes";
|
|
420
|
+
scopes: readonly string[];
|
|
421
|
+
} | {
|
|
422
|
+
id: "composes";
|
|
423
|
+
label: string;
|
|
424
|
+
entities: readonly Entity[];
|
|
425
|
+
filterable?: boolean;
|
|
426
|
+
} | {
|
|
427
|
+
id: "used-by";
|
|
428
|
+
label: string;
|
|
429
|
+
entities: readonly Entity[];
|
|
430
|
+
filterable?: boolean;
|
|
431
|
+
} | {
|
|
432
|
+
id: "flows";
|
|
433
|
+
flows: readonly Flow[];
|
|
434
|
+
filterable?: boolean;
|
|
435
|
+
} | {
|
|
436
|
+
id: "touches";
|
|
437
|
+
entities: readonly Entity[];
|
|
438
|
+
unresolved: readonly string[];
|
|
439
|
+
filterable?: boolean;
|
|
440
|
+
} | {
|
|
441
|
+
id: "routes";
|
|
442
|
+
paths: readonly string[];
|
|
443
|
+
filterable?: boolean;
|
|
444
|
+
};
|
|
445
|
+
interface FormSurface {
|
|
446
|
+
kind: "form";
|
|
447
|
+
id: string;
|
|
448
|
+
fields: readonly FormField[];
|
|
449
|
+
submit: FormSubmit;
|
|
450
|
+
initial?: Record<string, FormValue>;
|
|
451
|
+
/**
|
|
452
|
+
* Optional Standard Schema (Zod v4, Valibot, ArkType, etc.) run against the
|
|
453
|
+
* collected form values before `submit.onSubmit`. On failure, issues are
|
|
454
|
+
* routed to the matching `<FieldError>` and submission is skipped.
|
|
455
|
+
*/
|
|
456
|
+
schema?: StandardSchemaV1<Record<string, unknown>>;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Minimal StandardSchemaV1 surface — kept inline so the SDK doesn't need a
|
|
460
|
+
* type-level dep on any specific validator package.
|
|
461
|
+
*/
|
|
462
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
463
|
+
readonly "~standard": {
|
|
464
|
+
readonly version: 1;
|
|
465
|
+
readonly vendor: string;
|
|
466
|
+
readonly validate: (value: unknown) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
|
|
467
|
+
readonly types?: {
|
|
468
|
+
readonly input: Input;
|
|
469
|
+
readonly output: Output;
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
type StandardSchemaResult<Output> = {
|
|
474
|
+
readonly value: Output;
|
|
475
|
+
readonly issues?: undefined;
|
|
476
|
+
} | {
|
|
477
|
+
readonly issues: ReadonlyArray<StandardSchemaIssue>;
|
|
478
|
+
};
|
|
479
|
+
interface StandardSchemaIssue {
|
|
480
|
+
readonly message: string;
|
|
481
|
+
readonly path?: ReadonlyArray<PropertyKey | {
|
|
482
|
+
readonly key: PropertyKey;
|
|
483
|
+
}>;
|
|
484
|
+
}
|
|
485
|
+
interface FormSubmit {
|
|
486
|
+
label: string;
|
|
487
|
+
onSubmit: (values: Record<string, FormValue>) => FormSubmitResult | void | Promise<FormSubmitResult | void>;
|
|
488
|
+
}
|
|
489
|
+
type FormSubmitResult = {
|
|
490
|
+
status: "success";
|
|
491
|
+
message?: string;
|
|
492
|
+
link?: {
|
|
493
|
+
url: string;
|
|
494
|
+
label?: string;
|
|
495
|
+
};
|
|
496
|
+
resetFields?: readonly string[];
|
|
497
|
+
} | {
|
|
498
|
+
status: "error";
|
|
499
|
+
message: string;
|
|
500
|
+
/** Per-field error messages keyed by field `name`. */
|
|
501
|
+
fieldErrors?: Record<string, string>;
|
|
502
|
+
};
|
|
503
|
+
type FormValue = string | boolean;
|
|
504
|
+
interface FormFieldBase {
|
|
505
|
+
name: string;
|
|
506
|
+
label: string;
|
|
507
|
+
}
|
|
508
|
+
type FormField = (FormFieldBase & {
|
|
509
|
+
kind: "select";
|
|
510
|
+
options: readonly {
|
|
511
|
+
value: string;
|
|
512
|
+
label: string;
|
|
513
|
+
}[];
|
|
514
|
+
required?: boolean;
|
|
515
|
+
value?: string;
|
|
516
|
+
}) | (FormFieldBase & {
|
|
517
|
+
kind: "text";
|
|
518
|
+
placeholder?: string;
|
|
519
|
+
required?: boolean;
|
|
520
|
+
value?: string;
|
|
521
|
+
}) | (FormFieldBase & {
|
|
522
|
+
kind: "email";
|
|
523
|
+
placeholder?: string;
|
|
524
|
+
required?: boolean;
|
|
525
|
+
value?: string;
|
|
526
|
+
}) | (FormFieldBase & {
|
|
527
|
+
kind: "textarea";
|
|
528
|
+
placeholder?: string;
|
|
529
|
+
required?: boolean;
|
|
530
|
+
rows?: number;
|
|
531
|
+
value?: string;
|
|
532
|
+
}) | (FormFieldBase & {
|
|
533
|
+
kind: "checkbox";
|
|
534
|
+
value?: boolean;
|
|
535
|
+
});
|
|
536
|
+
interface CustomSurface {
|
|
537
|
+
kind: "custom";
|
|
538
|
+
render: (ctx: ViewContext, root: HTMLElement) => Cleanup | void;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
interface ViewPalette {
|
|
542
|
+
label: string;
|
|
543
|
+
group?: string;
|
|
544
|
+
/**
|
|
545
|
+
* Leading-icon factory rendered as a rounded-square tile on the palette
|
|
546
|
+
* row. Called fresh per render (so a returned SVG isn't reparented).
|
|
547
|
+
*/
|
|
548
|
+
icon?: () => Node;
|
|
549
|
+
shortcut?: string;
|
|
550
|
+
}
|
|
551
|
+
interface ViewDirectory {
|
|
552
|
+
list(): readonly View[];
|
|
553
|
+
}
|
|
554
|
+
interface ViewPushTarget {
|
|
555
|
+
id: string;
|
|
556
|
+
ref?: EntityRef | null;
|
|
557
|
+
}
|
|
558
|
+
interface HighlightController {
|
|
559
|
+
show(ref: EntityRef, opts?: OverlayShowOptions): void;
|
|
560
|
+
hide(): void;
|
|
561
|
+
}
|
|
562
|
+
interface ViewContext {
|
|
563
|
+
ref: EntityRef | null;
|
|
564
|
+
registry: Registry;
|
|
565
|
+
cloud: CloudAdapter<unknown, unknown, unknown> | null;
|
|
566
|
+
sdkCloud: CloudAdapter;
|
|
567
|
+
views: ViewDirectory;
|
|
568
|
+
/** Push a view onto the stack. Unregistered ids are a no-op. */
|
|
569
|
+
push: (target: ViewPushTarget) => void;
|
|
570
|
+
/** Pop the top view off the stack. No-op when the stack is empty. */
|
|
571
|
+
pop: () => void;
|
|
572
|
+
/** Clear the entire view stack. */
|
|
573
|
+
close: () => void;
|
|
574
|
+
/** Resolve the first view matching `ref` and push it onto the stack. */
|
|
575
|
+
navigate: (ref: EntityRef) => void;
|
|
576
|
+
/** Pin the overlay to `ref` until the user presses Esc. */
|
|
577
|
+
pinHighlight: (ref: EntityRef) => void;
|
|
578
|
+
/** Shell-owned search input. The shell dispatches its value into the active surface. */
|
|
579
|
+
searchInput: HTMLInputElement;
|
|
580
|
+
/** Drives the Surface's singleton overlay from inside a custom surface. */
|
|
581
|
+
highlight: HighlightController;
|
|
582
|
+
/** Snapshot of the current view stack (top-most last). */
|
|
583
|
+
getStack: () => readonly ViewStackEntry[];
|
|
584
|
+
}
|
|
585
|
+
interface ShellHint {
|
|
586
|
+
key: string;
|
|
587
|
+
label: string;
|
|
588
|
+
}
|
|
589
|
+
type ShellActionIntent = {
|
|
590
|
+
kind: "push";
|
|
591
|
+
viewId: string;
|
|
592
|
+
refKind?: EntityKind;
|
|
593
|
+
} | {
|
|
594
|
+
kind: "pop";
|
|
595
|
+
} | {
|
|
596
|
+
kind: "close";
|
|
597
|
+
} | {
|
|
598
|
+
kind: "navigate";
|
|
599
|
+
refKind?: EntityKind;
|
|
600
|
+
} | {
|
|
601
|
+
kind: "external";
|
|
602
|
+
describe: string;
|
|
603
|
+
};
|
|
604
|
+
interface ShellAction {
|
|
605
|
+
id: string;
|
|
606
|
+
label: string;
|
|
607
|
+
shortcut?: string;
|
|
608
|
+
perform: () => void | Promise<void>;
|
|
609
|
+
intent?: ShellActionIntent;
|
|
610
|
+
}
|
|
611
|
+
type Cleanup = () => void;
|
|
612
|
+
interface View {
|
|
613
|
+
id: string;
|
|
614
|
+
matches?: (ref: EntityRef) => boolean;
|
|
615
|
+
palette?: ViewPalette;
|
|
616
|
+
title?: string | ((ctx: ViewContext) => string);
|
|
617
|
+
/** Show the shell search input when this view is on top. Default: true. */
|
|
618
|
+
searchable?: boolean;
|
|
619
|
+
hints?: ShellHint[] | ((ctx: ViewContext) => ShellHint[]);
|
|
620
|
+
actions?: (ctx: ViewContext) => ShellAction[];
|
|
621
|
+
/**
|
|
622
|
+
* Element focused when this view becomes the top of the stack. The shell
|
|
623
|
+
* falls back to the first focusable element in the host when omitted, or
|
|
624
|
+
* when the declared target has been removed from the host.
|
|
625
|
+
*/
|
|
626
|
+
focusTarget?: (root: HTMLElement, ctx: ViewContext) => HTMLElement | null;
|
|
627
|
+
surface: (ctx: ViewContext) => ViewSurface;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
interface ViewRegistrar {
|
|
631
|
+
register(view: View): void;
|
|
632
|
+
unregister(id: string): void;
|
|
633
|
+
list(): readonly View[];
|
|
634
|
+
get(id: string): View | undefined;
|
|
635
|
+
findMatch(ref: EntityRef): View | null;
|
|
636
|
+
navigate(ref: EntityRef): void;
|
|
168
637
|
}
|
|
169
|
-
declare function UidexOverlay({ target, color, borderStyle, borderWidth, colors, }: UidexOverlayProps): null;
|
|
170
638
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
639
|
+
interface CreateUidexOptions {
|
|
640
|
+
theme?: ThemePreference;
|
|
641
|
+
resolvedTheme?: ResolvedTheme;
|
|
642
|
+
stylesheets?: string[];
|
|
643
|
+
initialCorner?: Corner;
|
|
644
|
+
/** Shown as a label at the start of the menu bar. */
|
|
645
|
+
appTitle?: string;
|
|
646
|
+
cloud?: CloudAdapter | null;
|
|
647
|
+
dev?: boolean;
|
|
648
|
+
/** Register bundled default views. Defaults to `true`. */
|
|
649
|
+
defaultViews?: boolean;
|
|
650
|
+
/** Additional views to register (after defaults). */
|
|
651
|
+
views?: readonly View[];
|
|
652
|
+
/**
|
|
653
|
+
* Override ingest behaviour. When `cloud` is non-null, ingest auto-enables
|
|
654
|
+
* (both console and network capture). Pass `null` to disable entirely, or
|
|
655
|
+
* an options object to override either channel.
|
|
656
|
+
*/
|
|
657
|
+
ingest?: IngestOptions | null;
|
|
658
|
+
}
|
|
659
|
+
interface Uidex {
|
|
660
|
+
mount(target?: Element): void;
|
|
661
|
+
unmount(): void;
|
|
662
|
+
readonly registry: Registry;
|
|
663
|
+
readonly session: SessionStore;
|
|
664
|
+
readonly views: ViewRegistrar;
|
|
665
|
+
readonly cloud: CloudAdapter | null;
|
|
666
|
+
readonly ingest: Ingest | null;
|
|
667
|
+
readonly shadowRoot: ShadowRoot | null;
|
|
668
|
+
}
|
|
178
669
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
670
|
+
interface UidexProviderProps {
|
|
671
|
+
/**
|
|
672
|
+
* Pre-built uidex instance (e.g. the `uidex` export from `uidex.gen.ts`).
|
|
673
|
+
* When provided, `projectKey`, `cloud`, and `config` are ignored.
|
|
674
|
+
*/
|
|
675
|
+
instance?: Uidex;
|
|
676
|
+
projectKey?: string;
|
|
677
|
+
cloud?: CloudAdapter | null;
|
|
678
|
+
config?: Omit<CreateUidexOptions, "cloud">;
|
|
679
|
+
children?: ReactNode;
|
|
680
|
+
}
|
|
681
|
+
declare function UidexProvider({ instance: externalInstance, projectKey, cloud, config, children, }: UidexProviderProps): react_jsx_runtime.JSX.Element;
|
|
682
|
+
|
|
683
|
+
declare class UidexContextError extends Error {
|
|
684
|
+
constructor(hookName: string);
|
|
685
|
+
}
|
|
686
|
+
declare function useUidex(): Uidex;
|
|
687
|
+
|
|
688
|
+
interface UidexMountProps {
|
|
689
|
+
className?: string;
|
|
690
|
+
}
|
|
691
|
+
declare function UidexMount({ className }: UidexMountProps): react_jsx_runtime.JSX.Element;
|
|
692
|
+
|
|
693
|
+
interface ReactViewDef {
|
|
694
|
+
id: string;
|
|
695
|
+
matches?: (ref: EntityRef) => boolean;
|
|
696
|
+
palette?: ViewPalette;
|
|
697
|
+
component: ComponentType<{
|
|
698
|
+
ctx: ViewContext;
|
|
699
|
+
}>;
|
|
700
|
+
}
|
|
701
|
+
declare function createReactView(def: ReactViewDef): View;
|
|
702
|
+
|
|
703
|
+
interface KindChipProps {
|
|
704
|
+
kind: EntityKind;
|
|
705
|
+
label?: string;
|
|
706
|
+
withKindName?: boolean;
|
|
707
|
+
className?: string;
|
|
708
|
+
}
|
|
709
|
+
declare function KindChip({ kind, label, withKindName, className, }: KindChipProps): ReactElement;
|
|
183
710
|
|
|
184
|
-
export {
|
|
711
|
+
export { KindChip, type KindChipProps, type ReactViewDef, UidexContextError, UidexMount, type UidexMountProps, UidexProvider, type UidexProviderProps, createReactView, useUidex };
|