@visulima/dev-toolbar 1.0.0-alpha.2 → 1.0.0-alpha.21

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +251 -0
  2. package/LICENSE.md +137 -5
  3. package/README.md +70 -43
  4. package/bin/mcp.js +29 -0
  5. package/dist/apps/a11y/index.d.ts +3 -2
  6. package/dist/apps/a11y/index.js +3 -3
  7. package/dist/apps/annotations/index.d.ts +4 -0
  8. package/dist/apps/annotations/index.js +18 -0
  9. package/dist/apps/assets/index.d.ts +4 -0
  10. package/dist/apps/assets/index.js +16 -0
  11. package/dist/apps/inspector/index.d.ts +4 -0
  12. package/dist/apps/inspector/index.js +30 -0
  13. package/dist/apps/module-graph/index.d.ts +3 -2
  14. package/dist/apps/module-graph/index.js +2 -2
  15. package/dist/apps/performance/index.d.ts +3 -2
  16. package/dist/apps/performance/index.js +2 -2
  17. package/dist/apps/seo/index.d.ts +3 -2
  18. package/dist/apps/seo/index.js +2 -2
  19. package/dist/apps/settings/index.d.ts +3 -2
  20. package/dist/apps/settings/index.js +2 -2
  21. package/dist/apps/tailwind/index.d.ts +4 -0
  22. package/dist/apps/tailwind/index.js +7 -0
  23. package/dist/apps/timeline/index.d.ts +3 -2
  24. package/dist/apps/timeline/index.js +2 -2
  25. package/dist/apps/vite-config/index.d.ts +3 -2
  26. package/dist/apps/vite-config/index.js +2 -2
  27. package/dist/client/overlay.d.ts +1 -1
  28. package/dist/client/overlay.js +1 -1
  29. package/dist/index.d.ts +143 -6
  30. package/dist/index.js +1 -1
  31. package/dist/mcp/server.d.ts +2 -0
  32. package/dist/mcp/server.js +1 -0
  33. package/dist/packem_chunks/inject-source.js +9 -0
  34. package/dist/packem_shared/Alert-D2CvX4fw.js +1 -0
  35. package/dist/packem_shared/Badge-BEgU04nl.js +1 -0
  36. package/dist/packem_shared/Button-Bkx66Co7.js +1 -0
  37. package/dist/packem_shared/Card-CJa4vHVc.js +1 -0
  38. package/dist/packem_shared/Icon-B6UHkC0o.js +1 -0
  39. package/dist/packem_shared/Input-Cs6aduTi.js +1 -0
  40. package/dist/packem_shared/Label-DyCng4Cp.js +1 -0
  41. package/dist/packem_shared/Popover-BtFVaZYg.js +1 -0
  42. package/dist/packem_shared/Progress-DN6zn-0l.js +1 -0
  43. package/dist/packem_shared/Select-DgQ4ss-s.js +1 -0
  44. package/dist/packem_shared/Separator-D38mKeZv.js +1 -0
  45. package/dist/packem_shared/Skeleton-Dv-tcA1P.js +1 -0
  46. package/dist/packem_shared/Switch-C3NTpeoR.js +1 -0
  47. package/dist/packem_shared/Tabs-DKWMiawt.js +1 -0
  48. package/dist/packem_shared/Textarea-Yfg3dLZi.js +1 -0
  49. package/dist/packem_shared/Tooltip-CioncSXj.js +1 -0
  50. package/dist/packem_shared/annotation-settings-Bv0TH4WI.js +1 -0
  51. package/dist/packem_shared/annotation-store-bLQRYMaI.js +1 -0
  52. package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
  53. package/dist/packem_shared/clsx-wGlvpUfw.js +1 -0
  54. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
  55. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
  56. package/dist/packem_shared/createServerRPCContext-D-yZrEjs.js +1 -0
  57. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
  58. package/dist/packem_shared/global-api.d-BLfn-OUA.d.ts +547 -0
  59. package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
  60. package/dist/packem_shared/sharedToolbarStylesheet-Bx1muJAh.js +2 -0
  61. package/dist/packem_shared/store-DaUtLjf3.js +1 -0
  62. package/dist/packem_shared/use-frame-state-CxrlPUM5.js +1 -0
  63. package/dist/packem_shared/use-theme-zpm4zmqP.js +1 -0
  64. package/dist/toolbar/index.d.ts +152 -56
  65. package/dist/toolbar/index.js +3 -4
  66. package/dist/ui/index.d.ts +382 -0
  67. package/dist/ui/index.js +1 -0
  68. package/dist/vite-plugin.d.ts +155 -103
  69. package/dist/vite-plugin.js +5 -2
  70. package/package.json +53 -14
  71. package/dist/apps/a11y/a11y-app.d.ts +0 -5
  72. package/dist/apps/a11y/a11y-store.d.ts +0 -46
  73. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
  74. package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
  75. package/dist/apps/more/index.d.ts +0 -3
  76. package/dist/apps/more/index.js +0 -19
  77. package/dist/apps/more/more-app.d.ts +0 -5
  78. package/dist/apps/performance/performance-app.d.ts +0 -5
  79. package/dist/apps/performance/performance-tooltip.d.ts +0 -5
  80. package/dist/apps/seo/seo-app.d.ts +0 -5
  81. package/dist/apps/settings/settings-app.d.ts +0 -5
  82. package/dist/apps/timeline/timeline-app.d.ts +0 -5
  83. package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
  84. package/dist/hooks/create-hook.d.ts +0 -10
  85. package/dist/hooks/events.d.ts +0 -5
  86. package/dist/hooks/global-hook.d.ts +0 -15
  87. package/dist/hooks/index.d.ts +0 -6
  88. package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
  89. package/dist/packem_shared/cn-BEsR6GkP.js +0 -1
  90. package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
  91. package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
  92. package/dist/packem_shared/createServerRPCContext-BVSesPXu.js +0 -1
  93. package/dist/packem_shared/icon-BUQ92HaT.js +0 -1
  94. package/dist/packem_shared/store-BxE0w51s.js +0 -1
  95. package/dist/performance/monitor.d.ts +0 -115
  96. package/dist/rpc/client.d.ts +0 -7
  97. package/dist/rpc/functions/module-graph.d.ts +0 -17
  98. package/dist/rpc/functions/open-in-editor.d.ts +0 -9
  99. package/dist/rpc/functions/vite-config.d.ts +0 -7
  100. package/dist/rpc/index.d.ts +0 -8
  101. package/dist/rpc/server.d.ts +0 -9
  102. package/dist/timeline/index.d.ts +0 -6
  103. package/dist/timeline/store.d.ts +0 -52
  104. package/dist/toolbar/app-manager.d.ts +0 -95
  105. package/dist/toolbar/components/app-button.d.ts +0 -19
  106. package/dist/toolbar/components/app-canvas.d.ts +0 -13
  107. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -13
  108. package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
  109. package/dist/toolbar/components/index.d.ts +0 -4
  110. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -23
  111. package/dist/toolbar/components/toolbar-bar.d.ts +0 -15
  112. package/dist/toolbar/components/toolbar-container.d.ts +0 -55
  113. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -15
  114. package/dist/toolbar/context/index.d.ts +0 -2
  115. package/dist/toolbar/context/toolbar-context.d.ts +0 -106
  116. package/dist/toolbar/global-api.d.ts +0 -23
  117. package/dist/toolbar/helpers.d.ts +0 -6
  118. package/dist/toolbar/hooks/index.d.ts +0 -10
  119. package/dist/toolbar/hooks/use-apps.d.ts +0 -13
  120. package/dist/toolbar/hooks/use-frame-state.d.ts +0 -94
  121. package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -21
  122. package/dist/toolbar/hooks/use-position.d.ts +0 -22
  123. package/dist/toolbar/hooks/use-theme.d.ts +0 -13
  124. package/dist/toolbar/hooks/use-toolbar.d.ts +0 -14
  125. package/dist/toolbar/settings.d.ts +0 -17
  126. package/dist/toolbar/stylesheet.d.ts +0 -1
  127. package/dist/toolbar/utils/index.d.ts +0 -12
  128. package/dist/types/app.d.ts +0 -163
  129. package/dist/types/global-api.d.ts +0 -95
  130. package/dist/types/hooks.d.ts +0 -88
  131. package/dist/types/index.d.ts +0 -12
  132. package/dist/types/messaging.d.ts +0 -43
  133. package/dist/types/rpc.d.ts +0 -95
  134. package/dist/types/timeline.d.ts +0 -62
  135. package/dist/types/toolbar.d.ts +0 -56
  136. package/dist/ui/components/icon.d.ts +0 -21
  137. package/dist/utils/cn.d.ts +0 -8
@@ -0,0 +1,547 @@
1
+ import { D as DevToolbarApp, T as ToolbarSettings } from "./app.d-SmKEDxsI.js";
2
+ import { ViteDevServer } from 'vite';
3
+ /**
4
+ * Annotation intent — describes what the user wants to communicate.
5
+ */
6
+ type AnnotationIntent = "approve" | "change" | "fix" | "question";
7
+ /**
8
+ * Annotation severity — how urgent or important the annotation is.
9
+ */
10
+ type AnnotationSeverity = "blocking" | "important" | "suggestion";
11
+ /**
12
+ * Annotation status — lifecycle state.
13
+ */
14
+ type AnnotationStatus = "acknowledged" | "dismissed" | "pending" | "resolved";
15
+ /**
16
+ * A single message in a conversation thread attached to an annotation.
17
+ */
18
+ interface ThreadMessage {
19
+ /** Message text */
20
+ content: string;
21
+ /** Unique message identifier */
22
+ id?: string;
23
+ /** Who wrote it — e.g. "human", "agent", or a specific agent name */
24
+ role: string;
25
+ /** ISO 8601 timestamp */
26
+ timestamp: string;
27
+ }
28
+ /**
29
+ * Bounding box of the annotated element relative to the viewport.
30
+ */
31
+ interface BoundingBox {
32
+ height: number;
33
+ width: number;
34
+ x: number;
35
+ y: number;
36
+ }
37
+ /**
38
+ * Detected framework component information.
39
+ */
40
+ interface FrameworkContext {
41
+ /** Component name */
42
+ componentName?: string;
43
+ /** Full component stack (e.g. ["App", "Layout", "Header", "Button"]) */
44
+ componentStack?: string[];
45
+ /** Additional framework-specific data (e.g. props) */
46
+ data?: Record<string, unknown>;
47
+ /** Framework identifier (react, vue, svelte, etc.) */
48
+ framework: string;
49
+ /** Source file path */
50
+ sourceFile?: string;
51
+ /** Source line number */
52
+ sourceLine?: number;
53
+ }
54
+ /**
55
+ * Captured accessibility attributes for an element.
56
+ */
57
+ interface AccessibilityInfo {
58
+ /** aria-describedby content */
59
+ ariaDescribedBy?: string;
60
+ /** aria-label value */
61
+ ariaLabel?: string;
62
+ /** Whether the element is focusable */
63
+ focusable: boolean;
64
+ /** ARIA role (explicit or implicit) */
65
+ role?: string;
66
+ /** tabindex value */
67
+ tabindex?: number;
68
+ }
69
+ /**
70
+ * A visual annotation placed on a page element during development.
71
+ * Stored in `.devtoolbar/annotations.json`.
72
+ */
73
+ interface Annotation {
74
+ /** Captured accessibility attributes */
75
+ accessibility?: AccessibilityInfo;
76
+ /** Element bounding box at annotation time */
77
+ boundingBox?: BoundingBox;
78
+ /** User feedback / description */
79
+ comment: string;
80
+ /** Key computed CSS properties for forensic context */
81
+ computedStyles?: string;
82
+ /** ISO 8601 creation timestamp */
83
+ createdAt: string;
84
+ /** CSS classes on the annotated element (module hashes cleaned) */
85
+ cssClasses?: string;
86
+ /** Bounding boxes for multi-select annotations */
87
+ elementBoundingBoxes?: BoundingBox[];
88
+ /** Human-readable element label (e.g. 'button "Submit"') */
89
+ elementLabel?: string;
90
+ /** CSS selector path to the element */
91
+ elementPath?: string;
92
+ /** HTML tag name of the annotated element */
93
+ elementTag: string;
94
+ /** Detected framework component context */
95
+ frameworkContext?: FrameworkContext;
96
+ /** Full DOM ancestry path (e.g. "body > main > article > p") */
97
+ fullPath?: string;
98
+ /** Unique identifier (crypto.randomUUID) */
99
+ id: string;
100
+ /** What the user wants — fix, change, question, or approve */
101
+ intent: AnnotationIntent;
102
+ /** Whether the element has fixed/sticky positioning */
103
+ isFixed?: boolean;
104
+ /** Whether this is a multi-select (drag) annotation */
105
+ isMultiSelect?: boolean;
106
+ /** Sibling elements for spatial context */
107
+ nearbyElements?: string;
108
+ /** Text near the annotated element for additional context */
109
+ nearbyText?: string;
110
+ /** ISO 8601 resolution timestamp */
111
+ resolvedAt?: string;
112
+ /** Who resolved it — "human" or "agent" (or a specific agent name) */
113
+ resolvedBy?: string;
114
+ /** Path to screenshot file relative to .devtoolbar/ (e.g. "screenshots/&lt;id>.png") */
115
+ screenshot?: string;
116
+ /** Text the user had selected when annotating */
117
+ selectedText?: string;
118
+ /** Severity level */
119
+ severity: AnnotationSeverity;
120
+ /** Source file location from data-vdt-source (file:line:col) */
121
+ source?: string;
122
+ /** Lifecycle status */
123
+ status: AnnotationStatus;
124
+ /** Conversation thread (human ↔ AI agent) */
125
+ thread?: ThreadMessage[];
126
+ /** ISO 8601 last-updated timestamp */
127
+ updatedAt: string;
128
+ /** Page URL where the annotation was created */
129
+ url: string;
130
+ /** Click X as percentage of viewport width (0-100) — survives resize */
131
+ x: number;
132
+ /**
133
+ * Click Y as absolute page position (pixels from document top) — survives scroll.
134
+ * For fixed/sticky elements, Y is viewport-relative instead.
135
+ */
136
+ y: number;
137
+ }
138
+ /**
139
+ * Data required to create a new annotation (server-generated fields omitted).
140
+ */
141
+ type CreateAnnotationData = Omit<Annotation, "createdAt" | "id" | "resolvedAt" | "resolvedBy" | "status" | "thread" | "updatedAt">;
142
+ /**
143
+ * Fields that can be updated on an existing annotation.
144
+ */
145
+ interface UpdateAnnotationData {
146
+ /** Updated comment text */
147
+ comment?: string;
148
+ /** Updated intent */
149
+ intent?: AnnotationIntent;
150
+ /** Who resolved the annotation */
151
+ resolvedBy?: string;
152
+ /** Updated severity */
153
+ severity?: AnnotationSeverity;
154
+ /** New status */
155
+ status?: AnnotationStatus;
156
+ /** Append a thread message */
157
+ threadMessage?: ThreadMessage;
158
+ }
159
+ /**
160
+ * Severity levels for timeline events.
161
+ */
162
+ type TimelineEventLevel = "info" | "warning" | "error";
163
+ /**
164
+ * A single captured event displayed in the timeline panel.
165
+ */
166
+ interface TimelineEvent {
167
+ /**
168
+ * Optional event data
169
+ */
170
+ data?: Record<string, any>;
171
+ /**
172
+ * Optional duration (milliseconds)
173
+ */
174
+ duration?: number;
175
+ /**
176
+ * Unique event ID
177
+ */
178
+ id: string;
179
+ /**
180
+ * Event level
181
+ */
182
+ level?: TimelineEventLevel;
183
+ /**
184
+ * Optional subtitle
185
+ */
186
+ subtitle?: string;
187
+ /**
188
+ * Timestamp (milliseconds since epoch)
189
+ */
190
+ time: number;
191
+ /**
192
+ * Event title
193
+ */
194
+ title: string;
195
+ }
196
+ /**
197
+ * A named group that holds related timeline events.
198
+ */
199
+ interface TimelineGroup {
200
+ /**
201
+ * Group color (hex or CSS color)
202
+ */
203
+ color?: string;
204
+ /**
205
+ * Events in this group
206
+ */
207
+ events: TimelineEvent[];
208
+ /**
209
+ * Group ID
210
+ */
211
+ id: string;
212
+ /**
213
+ * Group label
214
+ */
215
+ label: string;
216
+ }
217
+ /**
218
+ * Default timeline groups
219
+ */
220
+ declare const DEFAULT_TIMELINE_GROUPS: ReadonlyArray<TimelineGroup>;
221
+ /**
222
+ * Hook event definitions
223
+ */
224
+ interface HookEvents {
225
+ [key: string]: (...args: any[]) => void;
226
+ /**
227
+ * App error occurred.
228
+ * @param error Error object.
229
+ * @param appId Optional app ID where error occurred.
230
+ */
231
+ "app:error": (error: Error, appId?: string) => void;
232
+ /**
233
+ * DevTools closed.
234
+ */
235
+ "devtools:close": () => void;
236
+ /**
237
+ * DevTools initialized.
238
+ */
239
+ "devtools:init": () => void;
240
+ /**
241
+ * DevTools opened.
242
+ * @param appId ID of the opened app.
243
+ */
244
+ "devtools:open": (appId: string) => void;
245
+ /**
246
+ * Timeline event added.
247
+ * @param event Timeline event.
248
+ */
249
+ "timeline:event": (event: TimelineEvent) => void;
250
+ }
251
+ /**
252
+ * Dev toolbar hook interface.
253
+ * Exposed as window.__DEV_TOOLBAR_HOOK__
254
+ */
255
+ interface DevToolbarHook {
256
+ /**
257
+ * Adds a timeline event.
258
+ * @param groupId Timeline group ID.
259
+ * @param event Timeline event.
260
+ */
261
+ addTimelineEvent: (groupId: string, event: TimelineEvent) => void;
262
+ /**
263
+ * Emits an event.
264
+ * @param event Event name.
265
+ * @param args Event arguments.
266
+ */
267
+ emit: <T extends keyof HookEvents>(event: T, ...args: Parameters<HookEvents[T]>) => void;
268
+ /**
269
+ * Unsubscribes from an event.
270
+ * @param event Event name.
271
+ * @param handler Optional specific handler to remove.
272
+ */
273
+ off: <T extends keyof HookEvents>(event: T, handler?: HookEvents[T]) => void;
274
+ /**
275
+ * Subscribes to an event.
276
+ * @param event Event name.
277
+ * @param handler Event handler.
278
+ * @returns Unsubscribe function.
279
+ */
280
+ on: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => () => void;
281
+ /**
282
+ * Subscribes to an event once.
283
+ * @param event Event name.
284
+ * @param handler Event handler.
285
+ */
286
+ once: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => void;
287
+ /**
288
+ * Registers a custom app.
289
+ * @param app App definition.
290
+ */
291
+ registerApp: (app: DevToolbarApp) => void;
292
+ }
293
+ /**
294
+ * Global hook declaration
295
+ */
296
+ declare global {
297
+ interface Window {
298
+ /**
299
+ * Dev toolbar hook for library integrations.
300
+ */
301
+ __DEV_TOOLBAR_HOOK__?: DevToolbarHook;
302
+ }
303
+ }
304
+ interface StaticAsset {
305
+ /** Last-modified timestamp (ms since epoch) */
306
+ mtime: number;
307
+ /** Public URL path (e.g. "/images/logo.png") */
308
+ publicPath: string;
309
+ /** File size in bytes */
310
+ size: number;
311
+ /** Asset type category */
312
+ type: "audio" | "font" | "image" | "other" | "text" | "video";
313
+ }
314
+ interface SerializableModuleNode {
315
+ id: string;
316
+ importerCount: number;
317
+ importerUrls: string[];
318
+ url: string;
319
+ }
320
+ interface TailwindConfigResult {
321
+ /** CSS files that \@import tailwindcss */
322
+ cssFiles: string[];
323
+ /** User-defined \@theme overrides/extensions */
324
+ customTheme: Record<string, string>;
325
+ /** Full default Tailwind theme tokens */
326
+ defaultTheme: Record<string, string>;
327
+ /** Detected Tailwind version */
328
+ version: "v3" | "v4" | "unknown";
329
+ }
330
+ /**
331
+ * Server-side RPC functions
332
+ * These can be called from the client
333
+ */
334
+ interface ServerFunctions {
335
+ /**
336
+ * Extension point for custom server functions
337
+ */
338
+ [key: string]: (...args: any[]) => Promise<any>;
339
+ /**
340
+ * Create a new annotation
341
+ * @param data Annotation data (id, timestamps, status are generated server-side)
342
+ */
343
+ createAnnotation: (data: CreateAnnotationData) => Promise<Annotation>;
344
+ /**
345
+ * Delete an annotation and its screenshot
346
+ * @param id Annotation ID
347
+ */
348
+ deleteAnnotation: (id: string) => Promise<boolean>;
349
+ /**
350
+ * Get all annotations
351
+ */
352
+ getAnnotations: () => Promise<Annotation[]>;
353
+ /**
354
+ * Get module dependency graph
355
+ */
356
+ getModuleGraph: () => Promise<SerializableModuleNode[]>;
357
+ /**
358
+ * Get a screenshot as a base64 data URL
359
+ * @param annotationId Annotation ID
360
+ */
361
+ getScreenshot: (annotationId: string) => Promise<string | null>;
362
+ /**
363
+ * Get all static assets from the public directory
364
+ */
365
+ getStaticAssets: () => Promise<StaticAsset[]>;
366
+ /**
367
+ * Get full Tailwind CSS theme (default + user overrides)
368
+ */
369
+ getTailwindConfig: () => Promise<TailwindConfigResult>;
370
+ /**
371
+ * Get Vite configuration
372
+ */
373
+ getViteConfig: () => Promise<Record<string, any>>;
374
+ /**
375
+ * Open file in editor
376
+ * @param file File path
377
+ * @param line Line number (1-based)
378
+ * @param column Column number (1-based)
379
+ * @param editor Editor override (e.g. "code", "webstorm") — empty string means auto-detect
380
+ */
381
+ openInEditor: (file: string, line?: number, column?: number, editor?: string) => Promise<void>;
382
+ /**
383
+ * Read file contents
384
+ * @param path File path
385
+ */
386
+ readFile: (path: string) => Promise<string>;
387
+ /**
388
+ * Save a screenshot for an annotation
389
+ * @param annotationId Annotation ID
390
+ * @param dataUrl Base64 data URL (PNG, JPEG, WebP, or SVG)
391
+ * @returns Relative path within .devtoolbar/
392
+ */
393
+ saveScreenshot: (annotationId: string, dataUrl: string) => Promise<string>;
394
+ /**
395
+ * Update an existing annotation
396
+ * @param id Annotation ID
397
+ * @param data Fields to update
398
+ */
399
+ updateAnnotation: (id: string, data: UpdateAnnotationData) => Promise<Annotation | null>;
400
+ }
401
+ /**
402
+ * Client-side RPC functions
403
+ * These can be called from the server
404
+ */
405
+ interface ClientFunctions {
406
+ [key: string]: (...args: any[]) => void;
407
+ /**
408
+ * Notify client of config change
409
+ * @param config New Vite config
410
+ */
411
+ onConfigChange: (config: Record<string, unknown>) => void;
412
+ /**
413
+ * Notify client of HMR update
414
+ * @param payload HMR payload
415
+ */
416
+ onHMRUpdate: (payload: unknown) => void;
417
+ /**
418
+ * Notify client of module update
419
+ * @param module Updated module node
420
+ */
421
+ onModuleUpdate: (module: SerializableModuleNode) => void;
422
+ }
423
+ /**
424
+ * RPC context for server-side
425
+ */
426
+ interface ServerRPCContext {
427
+ /**
428
+ * Call a client function
429
+ * @param name Function name
430
+ * @param args Function arguments
431
+ */
432
+ callClient: <K extends keyof ClientFunctions>(name: K, ...args: Parameters<ClientFunctions[K]>) => void;
433
+ /**
434
+ * Register a server function
435
+ * @param name Function name
436
+ * @param fn Function implementation
437
+ */
438
+ registerFunction: <K extends keyof ServerFunctions>(name: K, function_: ServerFunctions[K]) => void;
439
+ /**
440
+ * Vite dev server instance
441
+ */
442
+ server: ViteDevServer;
443
+ }
444
+ /**
445
+ * RPC context for client-side
446
+ */
447
+ interface ClientRPCContext {
448
+ /**
449
+ * Call a server function
450
+ * @param name Function name
451
+ * @param args Function arguments
452
+ */
453
+ callServer: <K extends keyof ServerFunctions>(name: K, ...args: Parameters<ServerFunctions[K]>) => Promise<ReturnType<ServerFunctions[K]>>;
454
+ /**
455
+ * Register a client function
456
+ * @param name Function name
457
+ * @param function_ Function implementation
458
+ */
459
+ registerFunction: <K extends keyof ClientFunctions>(name: K, function_: ClientFunctions[K]) => void;
460
+ }
461
+ /**
462
+ * Global DevTools API interface.
463
+ * Exposed as window.__VISULIMA_DEVTOOLS__
464
+ */
465
+ interface VisulimaDevTools {
466
+ /**
467
+ * Clears notification for an app.
468
+ */
469
+ clearNotification: (appId: string) => void;
470
+ /**
471
+ * Closes the currently active app.
472
+ */
473
+ closeApp: () => Promise<void>;
474
+ /**
475
+ * Gets the currently active app ID.
476
+ */
477
+ getActiveApp: () => string | undefined;
478
+ /**
479
+ * Gets all registered apps.
480
+ */
481
+ getApps: () => DevToolbarApp[];
482
+ /**
483
+ * Gets current toolbar settings.
484
+ */
485
+ getSettings: () => ToolbarSettings;
486
+ /**
487
+ * Hides the toolbar.
488
+ */
489
+ hide: () => void;
490
+ /**
491
+ * Hook instance for event subscriptions.
492
+ */
493
+ hook: DevToolbarHook;
494
+ /**
495
+ * Shows a notification for an app.
496
+ */
497
+ notify: (appId: string, level: "info" | "warning" | "error") => void;
498
+ /**
499
+ * Opens an app by ID.
500
+ */
501
+ openApp: (appId: string) => Promise<void>;
502
+ /**
503
+ * Registers a custom app.
504
+ */
505
+ registerApp: (app: DevToolbarApp) => void;
506
+ /**
507
+ * RPC client for calling server functions.
508
+ */
509
+ rpc: ServerFunctions;
510
+ /**
511
+ * Directly sets the active state of an action button without invoking callbacks.
512
+ * Useful for deactivating a button from async work running outside the toolbar.
513
+ */
514
+ setAppActive: (appId: string, active: boolean) => void;
515
+ /**
516
+ * Shows the toolbar.
517
+ */
518
+ show: () => void;
519
+ /**
520
+ * Toggles toolbar visibility.
521
+ */
522
+ toggle: () => void;
523
+ /**
524
+ * Unregisters an app by ID.
525
+ */
526
+ unregisterApp: (appId: string) => void;
527
+ /**
528
+ * Updates toolbar settings.
529
+ */
530
+ updateSettings: (settings: Partial<ToolbarSettings>) => void;
531
+ /**
532
+ * Package version.
533
+ */
534
+ version: string;
535
+ }
536
+ /**
537
+ * Global API declaration
538
+ */
539
+ declare global {
540
+ interface Window {
541
+ /**
542
+ * Visulima DevTools global API.
543
+ */
544
+ __VISULIMA_DEVTOOLS__?: VisulimaDevTools;
545
+ }
546
+ }
547
+ export { AccessibilityInfo as A, BoundingBox as B, ClientFunctions as C, DevToolbarHook as D, FrameworkContext as F, HookEvents as H, ServerFunctions as S, TimelineEvent as T, UpdateAnnotationData as U, VisulimaDevTools as V, ClientRPCContext as a, ServerRPCContext as b, TimelineGroup as c, Annotation as d, AnnotationIntent as e, AnnotationSeverity as f, AnnotationStatus as g, CreateAnnotationData as h, DEFAULT_TIMELINE_GROUPS as i, ThreadMessage as j, TimelineEventLevel as k };
@@ -1 +1 @@
1
- var r=Object.defineProperty;var _=(o,l)=>r(o,"name",{value:l,configurable:!0});import{createDevToolbarHook as t}from"./createDevToolbarHook-DGNxqk8N.js";var O=Object.defineProperty,a=_((o,l)=>O(o,"name",{value:l,configurable:!0}),"n");let e;const n=a((o,l)=>e||(e=t(o,l),globalThis.window!==void 0&&(globalThis.__DEV_TOOLBAR_HOOK__=e),e),"setupGlobalHook"),s=a(()=>{const o=globalThis;return globalThis.window!==void 0&&o.__DEV_TOOLBAR_HOOK__?o.__DEV_TOOLBAR_HOOK__:e},"getGlobalHook");export{s as getGlobalHook,n as setupGlobalHook};
1
+ var r=Object.defineProperty;var _=(o,l)=>r(o,"name",{value:l,configurable:!0});import{createDevToolbarHook as t}from"./createDevToolbarHook-4bZZiHPI.js";var O=Object.defineProperty,a=_((o,l)=>O(o,"name",{value:l,configurable:!0}),"n");let e;const n=a((o,l)=>e||(e=t(o,l),globalThis.window!==void 0&&(globalThis.__DEV_TOOLBAR_HOOK__=e),e),"setupGlobalHook"),s=a(()=>{const o=globalThis;return globalThis.window!==void 0&&o.__DEV_TOOLBAR_HOOK__?o.__DEV_TOOLBAR_HOOK__:e},"getGlobalHook");export{s as getGlobalHook,n as setupGlobalHook};