@visulima/dev-toolbar 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (175) hide show
  1. package/CHANGELOG.md +321 -0
  2. package/LICENSE.md +137 -5
  3. package/README.md +75 -18
  4. package/bin/mcp.js +29 -0
  5. package/dist/apps/a11y/index.d.ts +3 -2
  6. package/dist/apps/a11y/index.js +21 -2
  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 +3 -2
  12. package/dist/apps/inspector/index.js +30 -1
  13. package/dist/apps/module-graph/index.d.ts +3 -2
  14. package/dist/apps/module-graph/index.js +20 -1
  15. package/dist/apps/performance/index.d.ts +3 -2
  16. package/dist/apps/performance/index.js +17 -1
  17. package/dist/apps/seo/index.d.ts +3 -2
  18. package/dist/apps/seo/index.js +17 -1
  19. package/dist/apps/settings/index.d.ts +3 -2
  20. package/dist/apps/settings/index.js +17 -1
  21. package/dist/apps/tailwind/index.d.ts +3 -2
  22. package/dist/apps/tailwind/index.js +5 -5
  23. package/dist/apps/timeline/index.d.ts +3 -2
  24. package/dist/apps/timeline/index.js +18 -1
  25. package/dist/apps/vite-config/index.d.ts +3 -2
  26. package/dist/apps/vite-config/index.js +16 -1
  27. package/dist/client/overlay.d.ts +1 -1
  28. package/dist/client/overlay.js +1 -1
  29. package/dist/index.d.ts +133 -8
  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 +7 -1
  34. package/dist/packem_shared/Alert-CZq7C43v.js +1 -0
  35. package/dist/packem_shared/Badge-PpblpNWg.js +1 -0
  36. package/dist/packem_shared/Button-CAKvtfij.js +1 -0
  37. package/dist/packem_shared/Card-BSy2oRiS.js +1 -0
  38. package/dist/packem_shared/Icon-0XYV-4AL.js +1 -0
  39. package/dist/packem_shared/Input-Dc1WiT01.js +1 -0
  40. package/dist/packem_shared/Label-BZh8XxUb.js +1 -0
  41. package/dist/packem_shared/Popover-DuiU8EPg.js +1 -0
  42. package/dist/packem_shared/Progress-C90LC--2.js +1 -0
  43. package/dist/packem_shared/Select-CwD-d0pi.js +1 -0
  44. package/dist/packem_shared/Separator-PSjfhX_W.js +1 -0
  45. package/dist/packem_shared/Skeleton-BAFrGUR1.js +1 -0
  46. package/dist/packem_shared/Switch-Wpsp5M3p.js +1 -0
  47. package/dist/packem_shared/Tabs-BdNFQd3c.js +1 -0
  48. package/dist/packem_shared/Textarea-DP9gpte-.js +1 -0
  49. package/dist/packem_shared/Tooltip-DVeuszoY.js +1 -0
  50. package/dist/packem_shared/annotation-settings-DlLZO5Zp.js +1 -0
  51. package/dist/packem_shared/annotation-store-CXMIg0dM.js +1 -0
  52. package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
  53. package/dist/packem_shared/clsx-CtZWcPHt.js +1 -0
  54. package/dist/packem_shared/createClientRPCContext-80V9c3Qu.js +1 -0
  55. package/dist/packem_shared/createDevToolbarHook-CzejbqD2.js +1 -0
  56. package/dist/packem_shared/createServerRPCContext-C30tqEfQ.js +1 -0
  57. package/dist/packem_shared/getGlobalHook-GRSqUNJ3.js +1 -0
  58. package/dist/packem_shared/getTimelineStore-BT5sImVb.js +1 -0
  59. package/dist/packem_shared/global-api.d-DeaCvII9.d.ts +546 -0
  60. package/dist/packem_shared/loadSettings-C0pUyx9j.js +1 -0
  61. package/dist/packem_shared/server.d-ZkcY0pge.d.ts +39 -0
  62. package/dist/packem_shared/sharedToolbarStylesheet-DNABzHAf.js +2 -0
  63. package/dist/packem_shared/store-Dqy0FbGw.js +1 -0
  64. package/dist/packem_shared/use-theme-DIqZkPAe.js +1 -0
  65. package/dist/toolbar/index.d.ts +152 -49
  66. package/dist/toolbar/index.js +3 -3
  67. package/dist/ui/index.d.ts +382 -17
  68. package/dist/ui/index.js +1 -1
  69. package/dist/vite-plugin.d.ts +183 -141
  70. package/dist/vite-plugin.js +5 -2
  71. package/package.json +41 -22
  72. package/dist/apps/a11y/a11y-app.d.ts +0 -5
  73. package/dist/apps/a11y/a11y-store.d.ts +0 -42
  74. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
  75. package/dist/apps/inspector/inspector-app.d.ts +0 -12
  76. package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
  77. package/dist/apps/more/index.d.ts +0 -3
  78. package/dist/apps/more/index.js +0 -2
  79. package/dist/apps/more/more-app.d.ts +0 -5
  80. package/dist/apps/performance/performance-app.d.ts +0 -5
  81. package/dist/apps/performance/performance-tooltip.d.ts +0 -5
  82. package/dist/apps/seo/seo-app.d.ts +0 -5
  83. package/dist/apps/settings/settings-app.d.ts +0 -4
  84. package/dist/apps/tailwind/tailwind-app.d.ts +0 -5
  85. package/dist/apps/timeline/timeline-app.d.ts +0 -5
  86. package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
  87. package/dist/hooks/create-hook.d.ts +0 -12
  88. package/dist/hooks/events.d.ts +0 -7
  89. package/dist/hooks/global-hook.d.ts +0 -15
  90. package/dist/hooks/index.d.ts +0 -6
  91. package/dist/packem_shared/Alert-H-x1JuZ0.js +0 -1
  92. package/dist/packem_shared/Badge-C30mDKKG.js +0 -1
  93. package/dist/packem_shared/Button-DODNCTPZ.js +0 -1
  94. package/dist/packem_shared/Card-DdI7Wn3t.js +0 -1
  95. package/dist/packem_shared/Icon-DWFLZkwW.js +0 -1
  96. package/dist/packem_shared/Input-GfbOwAkK.js +0 -1
  97. package/dist/packem_shared/Label-Bzi47aUf.js +0 -1
  98. package/dist/packem_shared/Popover-CLt7YhUF.js +0 -1
  99. package/dist/packem_shared/Progress-vGfFpxRn.js +0 -1
  100. package/dist/packem_shared/Separator-DQGeJPQg.js +0 -1
  101. package/dist/packem_shared/Skeleton-BYXau6jM.js +0 -1
  102. package/dist/packem_shared/Switch-BeC78S_T.js +0 -1
  103. package/dist/packem_shared/Tabs-CXERaeAp.js +0 -1
  104. package/dist/packem_shared/Textarea-DvbSX13V.js +0 -1
  105. package/dist/packem_shared/Tooltip-tlBN-NdK.js +0 -1
  106. package/dist/packem_shared/cn-DWLJYh3h.js +0 -1
  107. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +0 -1
  108. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +0 -1
  109. package/dist/packem_shared/createServerRPCContext-CEm1Ymkn.js +0 -1
  110. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +0 -1
  111. package/dist/packem_shared/loadSettings-hvjR4fcS.js +0 -1
  112. package/dist/packem_shared/setupGlobalHook-CCf9Logv.js +0 -1
  113. package/dist/packem_shared/sharedToolbarStylesheet-DOV-Jwcm.js +0 -2
  114. package/dist/packem_shared/store-DaUtLjf3.js +0 -1
  115. package/dist/packem_shared/use-theme-BOw3dPpY.js +0 -1
  116. package/dist/performance/monitor.d.ts +0 -116
  117. package/dist/rpc/client.d.ts +0 -9
  118. package/dist/rpc/functions/module-graph.d.ts +0 -17
  119. package/dist/rpc/functions/open-in-editor.d.ts +0 -16
  120. package/dist/rpc/functions/tailwind-config.d.ts +0 -15
  121. package/dist/rpc/functions/vite-config.d.ts +0 -9
  122. package/dist/rpc/server.d.ts +0 -15
  123. package/dist/timeline/capture.d.ts +0 -8
  124. package/dist/timeline/index.d.ts +0 -8
  125. package/dist/timeline/store.d.ts +0 -42
  126. package/dist/toolbar/app-manager.d.ts +0 -104
  127. package/dist/toolbar/components/app-button.d.ts +0 -19
  128. package/dist/toolbar/components/app-canvas.d.ts +0 -12
  129. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
  130. package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
  131. package/dist/toolbar/components/index.d.ts +0 -4
  132. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
  133. package/dist/toolbar/components/toolbar-bar.d.ts +0 -14
  134. package/dist/toolbar/components/toolbar-container.d.ts +0 -55
  135. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
  136. package/dist/toolbar/context/index.d.ts +0 -2
  137. package/dist/toolbar/context/toolbar-context.d.ts +0 -107
  138. package/dist/toolbar/global-api.d.ts +0 -24
  139. package/dist/toolbar/helpers.d.ts +0 -8
  140. package/dist/toolbar/hooks/index.d.ts +0 -10
  141. package/dist/toolbar/hooks/use-apps.d.ts +0 -15
  142. package/dist/toolbar/hooks/use-frame-state.d.ts +0 -100
  143. package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -23
  144. package/dist/toolbar/hooks/use-position.d.ts +0 -24
  145. package/dist/toolbar/hooks/use-theme.d.ts +0 -15
  146. package/dist/toolbar/hooks/use-toolbar.d.ts +0 -16
  147. package/dist/toolbar/settings.d.ts +0 -17
  148. package/dist/toolbar/stylesheet.d.ts +0 -3
  149. package/dist/toolbar/utils/index.d.ts +0 -12
  150. package/dist/types/app.d.ts +0 -175
  151. package/dist/types/global-api.d.ts +0 -91
  152. package/dist/types/hooks.d.ts +0 -86
  153. package/dist/types/index.d.ts +0 -12
  154. package/dist/types/messaging.d.ts +0 -43
  155. package/dist/types/rpc.d.ts +0 -97
  156. package/dist/types/timeline.d.ts +0 -62
  157. package/dist/types/toolbar.d.ts +0 -56
  158. package/dist/ui/components/alert.d.ts +0 -20
  159. package/dist/ui/components/badge.d.ts +0 -10
  160. package/dist/ui/components/button.d.ts +0 -12
  161. package/dist/ui/components/card.d.ts +0 -17
  162. package/dist/ui/components/icon.d.ts +0 -20
  163. package/dist/ui/components/input.d.ts +0 -8
  164. package/dist/ui/components/label.d.ts +0 -8
  165. package/dist/ui/components/popover.d.ts +0 -27
  166. package/dist/ui/components/progress.d.ts +0 -8
  167. package/dist/ui/components/separator.d.ts +0 -9
  168. package/dist/ui/components/skeleton.d.ts +0 -7
  169. package/dist/ui/components/switch.d.ts +0 -12
  170. package/dist/ui/components/tabs.d.ts +0 -29
  171. package/dist/ui/components/textarea.d.ts +0 -8
  172. package/dist/ui/components/tooltip.d.ts +0 -19
  173. package/dist/utils/cn.d.ts +0 -8
  174. package/dist/vite/inject-source.d.ts +0 -24
  175. package/dist/vite/matcher.d.ts +0 -6
@@ -1,16 +0,0 @@
1
- import type { ToolbarPlacement } from "../../types/index.d.ts";
2
- /**
3
- * Exposes toolbar visibility and placement controls from the toolbar context.
4
- */
5
- declare const useToolbar: () => {
6
- hide: () => void;
7
- isDragging: boolean;
8
- isVisible: boolean;
9
- placement: ToolbarPlacement;
10
- setDragging: (dragging: boolean) => void;
11
- setPlacement: (placement: ToolbarPlacement) => void;
12
- show: () => void;
13
- toggle: () => void;
14
- };
15
- export { useToolbar };
16
- export default useToolbar;
@@ -1,17 +0,0 @@
1
- import type { ToolbarSettings } from "../types/toolbar.d.ts";
2
- /**
3
- * Loads settings from localStorage, merging with defaults.
4
- * @returns Toolbar settings.
5
- */
6
- export declare const loadSettings: () => ToolbarSettings;
7
- /**
8
- * Saves settings to localStorage.
9
- * @param settings Toolbar settings to save.
10
- */
11
- export declare const saveSettings: (settings: ToolbarSettings) => void;
12
- /**
13
- * Merges partial updates into the current settings and persists them.
14
- * @param updates Partial settings to update.
15
- * @returns Updated settings.
16
- */
17
- export declare const updateSettings: (updates: Partial<ToolbarSettings>) => ToolbarSettings;
@@ -1,3 +0,0 @@
1
- declare const sharedToolbarStylesheet: CSSStyleSheet | undefined;
2
- export { sharedToolbarStylesheet };
3
- export default sharedToolbarStylesheet;
@@ -1,12 +0,0 @@
1
- /**
2
- * Clamps a value between min and max.
3
- */
4
- export declare const clamp: (value: number, min: number, max: number) => number;
5
- /**
6
- * Returns true when the current browser is Safari.
7
- */
8
- export declare const checkIsSafari: () => boolean;
9
- /**
10
- * Converts a pixel string value to a number (e.g. "10px" becomes 10).
11
- */
12
- export declare const pixelToNumber: (value: string | number) => number;
@@ -1,175 +0,0 @@
1
- import type { ComponentType } from "preact";
2
- import type { NotificationLevel } from "./toolbar.d.ts";
3
- /**
4
- * Server helpers available to apps
5
- */
6
- export interface ServerHelpers {
7
- /**
8
- * RPC client for calling server functions
9
- */
10
- rpc: {
11
- [K in keyof ServerFunctions]: ServerFunctions[K];
12
- };
13
- }
14
- /**
15
- * Props passed to app tooltip (hover mini-canvas) components.
16
- * Keep compact — tooltip components should be lightweight.
17
- */
18
- export interface AppTooltipProps {
19
- /**
20
- * Server helpers (RPC, etc.)
21
- */
22
- helpers: ServerHelpers;
23
- }
24
- /**
25
- * Event target for app communication
26
- */
27
- export interface ToolbarAppEventTarget extends EventTarget {
28
- /**
29
- * Dispatch a custom event
30
- */
31
- dispatchEvent: (event: Event) => boolean;
32
- }
33
- /**
34
- * App view configuration
35
- */
36
- export type AppView = {
37
- /**
38
- * Render app inline in shadow DOM (default)
39
- */
40
- type: "inline";
41
- } | {
42
- /**
43
- * URL to load in iframe
44
- */
45
- src: string;
46
- /**
47
- * Render app in iframe for isolation
48
- */
49
- type: "iframe";
50
- };
51
- /**
52
- * Props passed to Preact component apps
53
- */
54
- export interface AppComponentProps {
55
- /**
56
- * Event target for app communication
57
- */
58
- eventTarget: ToolbarAppEventTarget;
59
- /**
60
- * Server helpers (RPC, etc.)
61
- */
62
- helpers: ServerHelpers;
63
- }
64
- /**
65
- * Dev toolbar app definition
66
- */
67
- export interface DevToolbarApp {
68
- /**
69
- * Called before app is toggled off
70
- * Return false to prevent closing
71
- * @param canvas Shadow root of the app
72
- * @returns Whether to allow closing
73
- */
74
- beforeTogglingOff?: (canvas: ShadowRoot) => boolean | Promise<boolean>;
75
- /**
76
- * Preact component for rendering (alternative to init)
77
- * If provided, this will be used instead of init
78
- */
79
- component?: ComponentType<AppComponentProps>;
80
- /**
81
- * When true, this app is automatically activated when the toolbar opens for
82
- * the first time (or when no other app has been activated yet).
83
- * Only the first registered app with defaultOpen: true is used.
84
- * @default false
85
- */
86
- defaultOpen?: boolean;
87
- /**
88
- * Called when the app is unregistered / removed from the toolbar.
89
- * Use this for final cleanup (event listeners, timers, subscriptions).
90
- * @param canvas Shadow root of the app
91
- */
92
- destroy?: (canvas: ShadowRoot) => Promise<void> | void;
93
- /**
94
- * Icon HTML string (SVG)
95
- */
96
- icon: string;
97
- /**
98
- * Unique identifier for the app
99
- */
100
- id: string;
101
- /**
102
- * Initialize the app when opened (vanilla JS/CSS/HTML)
103
- * @param canvas Shadow root to render into
104
- * @param eventTarget Event target for app communication
105
- * @param helpers Server helpers (RPC, etc.)
106
- */
107
- init?: (canvas: ShadowRoot, eventTarget: ToolbarAppEventTarget, helpers: ServerHelpers) => void | Promise<void>;
108
- /**
109
- * Display name of the app
110
- */
111
- name: string;
112
- /**
113
- * Action button callback — called when the button is activated (active: false → true).
114
- * When present, clicking the toolbar button will NOT open a panel.
115
- * Instead the button toggles its active state and calls onClick (activate)
116
- * or onDeactivate (deactivate).
117
- */
118
- onClick?: () => Promise<void> | void;
119
- /**
120
- * Called when the action button is deactivated (active: true → false).
121
- * Only meaningful when onClick is also provided.
122
- */
123
- onDeactivate?: () => Promise<void> | void;
124
- /**
125
- * Optional hover tooltip component — renders a compact live preview when the
126
- * user hovers over this app's button in the toolbar pill.
127
- * The component should be small (≤280px wide) and self-contained.
128
- * If omitted, hovering shows the native title tooltip only.
129
- */
130
- tooltip?: ComponentType<AppTooltipProps>;
131
- /**
132
- * App rendering mode
133
- */
134
- view?: AppView;
135
- }
136
- /**
137
- * Internal app state (extends DevToolbarApp)
138
- */
139
- export interface DevToolbarAppState extends DevToolbarApp {
140
- /**
141
- * Whether the app is currently active/open
142
- */
143
- active: boolean;
144
- /**
145
- * Whether this is a built-in app
146
- */
147
- builtIn: boolean;
148
- /**
149
- * Event target for this app
150
- */
151
- eventTarget: ToolbarAppEventTarget;
152
- /**
153
- * Notification state
154
- */
155
- notification: {
156
- /**
157
- * Notification level
158
- */
159
- level?: NotificationLevel;
160
- /**
161
- * Whether notification is active
162
- */
163
- state: boolean;
164
- };
165
- /**
166
- * App initialization status
167
- */
168
- status: "ready" | "loading" | "pending" | "error";
169
- }
170
- /**
171
- * Placeholder for ServerFunctions (defined in rpc.ts)
172
- */
173
- export interface ServerFunctions {
174
- [key: string]: (...args: any[]) => Promise<any>;
175
- }
@@ -1,91 +0,0 @@
1
- import type { DevToolbarApp } from "./app.d.ts";
2
- import type { DevToolbarHook } from "./hooks.d.ts";
3
- import type { ServerFunctions } from "./rpc.d.ts";
4
- import type { ToolbarSettings } from "./toolbar.d.ts";
5
- /**
6
- * Global DevTools API interface.
7
- * Exposed as window.__VISULIMA_DEVTOOLS__
8
- */
9
- interface VisulimaDevTools {
10
- /**
11
- * Clears notification for an app.
12
- */
13
- clearNotification: (appId: string) => void;
14
- /**
15
- * Closes the currently active app.
16
- */
17
- closeApp: () => Promise<void>;
18
- /**
19
- * Gets the currently active app ID.
20
- */
21
- getActiveApp: () => string | undefined;
22
- /**
23
- * Gets all registered apps.
24
- */
25
- getApps: () => DevToolbarApp[];
26
- /**
27
- * Gets current toolbar settings.
28
- */
29
- getSettings: () => ToolbarSettings;
30
- /**
31
- * Hides the toolbar.
32
- */
33
- hide: () => void;
34
- /**
35
- * Hook instance for event subscriptions.
36
- */
37
- hook: DevToolbarHook;
38
- /**
39
- * Shows a notification for an app.
40
- */
41
- notify: (appId: string, level: "info" | "warning" | "error") => void;
42
- /**
43
- * Opens an app by ID.
44
- */
45
- openApp: (appId: string) => Promise<void>;
46
- /**
47
- * Registers a custom app.
48
- */
49
- registerApp: (app: DevToolbarApp) => void;
50
- /**
51
- * RPC client for calling server functions.
52
- */
53
- rpc: ServerFunctions;
54
- /**
55
- * Directly sets the active state of an action button without invoking callbacks.
56
- * Useful for deactivating a button from async work running outside the toolbar.
57
- */
58
- setAppActive: (appId: string, active: boolean) => void;
59
- /**
60
- * Shows the toolbar.
61
- */
62
- show: () => void;
63
- /**
64
- * Toggles toolbar visibility.
65
- */
66
- toggle: () => void;
67
- /**
68
- * Unregisters an app by ID.
69
- */
70
- unregisterApp: (appId: string) => void;
71
- /**
72
- * Updates toolbar settings.
73
- */
74
- updateSettings: (settings: Partial<ToolbarSettings>) => void;
75
- /**
76
- * Package version.
77
- */
78
- version: string;
79
- }
80
- /**
81
- * Global API declaration
82
- */
83
- declare global {
84
- interface Window {
85
- /**
86
- * Visulima DevTools global API.
87
- */
88
- __VISULIMA_DEVTOOLS__?: VisulimaDevTools;
89
- }
90
- }
91
- export type { VisulimaDevTools };
@@ -1,86 +0,0 @@
1
- import type { DevToolbarApp } from "./app.d.ts";
2
- import type { TimelineEvent } from "./timeline.d.ts";
3
- /**
4
- * Hook event definitions
5
- */
6
- interface HookEvents {
7
- [key: string]: (...args: any[]) => void;
8
- /**
9
- * App error occurred.
10
- * @param error Error object.
11
- * @param appId Optional app ID where error occurred.
12
- */
13
- "app:error": (error: Error, appId?: string) => void;
14
- /**
15
- * DevTools closed.
16
- */
17
- "devtools:close": () => void;
18
- /**
19
- * DevTools initialized.
20
- */
21
- "devtools:init": () => void;
22
- /**
23
- * DevTools opened.
24
- * @param appId ID of the opened app.
25
- */
26
- "devtools:open": (appId: string) => void;
27
- /**
28
- * Timeline event added.
29
- * @param event Timeline event.
30
- */
31
- "timeline:event": (event: TimelineEvent) => void;
32
- }
33
- /**
34
- * Dev toolbar hook interface.
35
- * Exposed as window.__DEV_TOOLBAR_HOOK__
36
- */
37
- interface DevToolbarHook {
38
- /**
39
- * Adds a timeline event.
40
- * @param groupId Timeline group ID.
41
- * @param event Timeline event.
42
- */
43
- addTimelineEvent: (groupId: string, event: TimelineEvent) => void;
44
- /**
45
- * Emits an event.
46
- * @param event Event name.
47
- * @param args Event arguments.
48
- */
49
- emit: <T extends keyof HookEvents>(event: T, ...args: Parameters<HookEvents[T]>) => void;
50
- /**
51
- * Unsubscribes from an event.
52
- * @param event Event name.
53
- * @param handler Optional specific handler to remove.
54
- */
55
- off: <T extends keyof HookEvents>(event: T, handler?: HookEvents[T]) => void;
56
- /**
57
- * Subscribes to an event.
58
- * @param event Event name.
59
- * @param handler Event handler.
60
- * @returns Unsubscribe function.
61
- */
62
- on: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => () => void;
63
- /**
64
- * Subscribes to an event once.
65
- * @param event Event name.
66
- * @param handler Event handler.
67
- */
68
- once: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => void;
69
- /**
70
- * Registers a custom app.
71
- * @param app App definition.
72
- */
73
- registerApp: (app: DevToolbarApp) => void;
74
- }
75
- /**
76
- * Global hook declaration
77
- */
78
- declare global {
79
- interface Window {
80
- /**
81
- * Dev toolbar hook for library integrations.
82
- */
83
- __DEV_TOOLBAR_HOOK__?: DevToolbarHook;
84
- }
85
- }
86
- export type { DevToolbarHook, HookEvents };
@@ -1,12 +0,0 @@
1
- /**
2
- * Public type exports
3
- */
4
- export type { AppView, DevToolbarApp, DevToolbarAppState, ServerFunctions, ServerHelpers, ToolbarAppEventTarget } from "./app.d.ts";
5
- export type { VisulimaDevTools } from "./global-api.d.ts";
6
- export type { DevToolbarHook, HookEvents } from "./hooks.d.ts";
7
- export type { ChannelFactory, MessageChannel, MessageChannelContext } from "./messaging.d.ts";
8
- export type { ClientRPCContext, ClientFunctions as RPCClientFunctions, ServerFunctions as RPCServerFunctions, ServerRPCContext } from "./rpc.d.ts";
9
- export type { TimelineEvent, TimelineEventLevel, TimelineGroup } from "./timeline.d.ts";
10
- export { DEFAULT_TIMELINE_GROUPS } from "./timeline.d.ts";
11
- export type { FrameState, NotificationLevel, PositionAnchor, ToolbarPlacement, ToolbarSettings } from "./toolbar.d.ts";
12
- export { DEFAULT_TOOLBAR_SETTINGS } from "./toolbar.d.ts";
@@ -1,43 +0,0 @@
1
- /**
2
- * Message channel interface for bidirectional communication
3
- */
4
- export interface MessageChannel<TEvents extends Record<string, (...args: any[]) => void>> {
5
- /**
6
- * Unsubscribe from an event
7
- * @param event Event name
8
- * @param handler Optional specific handler to remove
9
- */
10
- off: <K extends keyof TEvents>(event: K, handler?: TEvents[K]) => void;
11
- /**
12
- * Subscribe to an event
13
- * @param event Event name
14
- * @param handler Event handler
15
- * @returns Unsubscribe function
16
- */
17
- on: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => () => void;
18
- /**
19
- * Subscribe to an event once
20
- * @param event Event name
21
- * @param handler Event handler
22
- */
23
- once: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => void;
24
- /**
25
- * Send a message/event
26
- * @param event Event name
27
- * @param data Event data
28
- */
29
- send: <K extends keyof TEvents>(event: K, ...args: Parameters<TEvents[K]>) => void;
30
- }
31
- /**
32
- * Channel factory function
33
- */
34
- export type ChannelFactory<TEvents extends Record<string, (...args: any[]) => void>> = () => MessageChannel<TEvents>;
35
- /**
36
- * Factory result providing a method to instantiate named message channels.
37
- */
38
- export interface MessageChannelContext<TEvents extends Record<string, (...args: any[]) => void>> {
39
- /**
40
- * Creates and returns a new channel instance.
41
- */
42
- createChannel: () => MessageChannel<TEvents>;
43
- }
@@ -1,97 +0,0 @@
1
- import type { ViteDevServer } from "vite";
2
- import type { SerializableModuleNode } from "../rpc/functions/module-graph.d.ts";
3
- import type { TailwindConfigResult } from "../rpc/functions/tailwind-config.d.ts";
4
- /**
5
- * Server-side RPC functions
6
- * These can be called from the client
7
- */
8
- export interface ServerFunctions {
9
- /**
10
- * Extension point for custom server functions
11
- */
12
- [key: string]: (...args: any[]) => Promise<any>;
13
- /**
14
- * Get module dependency graph
15
- */
16
- getModuleGraph: () => Promise<SerializableModuleNode[]>;
17
- /**
18
- * Get full Tailwind CSS theme (default + user overrides)
19
- */
20
- getTailwindConfig: () => Promise<TailwindConfigResult>;
21
- /**
22
- * Get Vite configuration
23
- */
24
- getViteConfig: () => Promise<Record<string, any>>;
25
- /**
26
- * Open file in editor
27
- * @param file File path
28
- * @param line Line number (1-based)
29
- * @param column Column number (1-based)
30
- */
31
- openInEditor: (file: string, line?: number, column?: number) => Promise<void>;
32
- /**
33
- * Read file contents
34
- * @param path File path
35
- */
36
- readFile: (path: string) => Promise<string>;
37
- }
38
- /**
39
- * Client-side RPC functions
40
- * These can be called from the server
41
- */
42
- export interface ClientFunctions {
43
- [key: string]: (...args: any[]) => void;
44
- /**
45
- * Notify client of config change
46
- * @param config New Vite config
47
- */
48
- onConfigChange: (config: Record<string, unknown>) => void;
49
- /**
50
- * Notify client of HMR update
51
- * @param payload HMR payload
52
- */
53
- onHMRUpdate: (payload: unknown) => void;
54
- /**
55
- * Notify client of module update
56
- * @param module Updated module node
57
- */
58
- onModuleUpdate: (module: SerializableModuleNode) => void;
59
- }
60
- /**
61
- * RPC context for server-side
62
- */
63
- export interface ServerRPCContext {
64
- /**
65
- * Call a client function
66
- * @param name Function name
67
- * @param args Function arguments
68
- */
69
- callClient: <K extends keyof ClientFunctions>(name: K, ...args: Parameters<ClientFunctions[K]>) => void;
70
- /**
71
- * Register a server function
72
- * @param name Function name
73
- * @param fn Function implementation
74
- */
75
- registerFunction: <K extends keyof ServerFunctions>(name: K, function_: ServerFunctions[K]) => void;
76
- /**
77
- * Vite dev server instance
78
- */
79
- server: ViteDevServer;
80
- }
81
- /**
82
- * RPC context for client-side
83
- */
84
- export interface ClientRPCContext {
85
- /**
86
- * Call a server function
87
- * @param name Function name
88
- * @param args Function arguments
89
- */
90
- callServer: <K extends keyof ServerFunctions>(name: K, ...args: Parameters<ServerFunctions[K]>) => Promise<ReturnType<ServerFunctions[K]>>;
91
- /**
92
- * Register a client function
93
- * @param name Function name
94
- * @param function_ Function implementation
95
- */
96
- registerFunction: <K extends keyof ClientFunctions>(name: K, function_: ClientFunctions[K]) => void;
97
- }
@@ -1,62 +0,0 @@
1
- /**
2
- * Severity levels for timeline events.
3
- */
4
- export type TimelineEventLevel = "info" | "warning" | "error";
5
- /**
6
- * A single captured event displayed in the timeline panel.
7
- */
8
- export interface TimelineEvent {
9
- /**
10
- * Optional event data
11
- */
12
- data?: Record<string, any>;
13
- /**
14
- * Optional duration (milliseconds)
15
- */
16
- duration?: number;
17
- /**
18
- * Unique event ID
19
- */
20
- id: string;
21
- /**
22
- * Event level
23
- */
24
- level?: TimelineEventLevel;
25
- /**
26
- * Optional subtitle
27
- */
28
- subtitle?: string;
29
- /**
30
- * Timestamp (milliseconds since epoch)
31
- */
32
- time: number;
33
- /**
34
- * Event title
35
- */
36
- title: string;
37
- }
38
- /**
39
- * A named group that holds related timeline events.
40
- */
41
- export interface TimelineGroup {
42
- /**
43
- * Group color (hex or CSS color)
44
- */
45
- color?: string;
46
- /**
47
- * Events in this group
48
- */
49
- events: TimelineEvent[];
50
- /**
51
- * Group ID
52
- */
53
- id: string;
54
- /**
55
- * Group label
56
- */
57
- label: string;
58
- }
59
- /**
60
- * Default timeline groups
61
- */
62
- export declare const DEFAULT_TIMELINE_GROUPS: ReadonlyArray<TimelineGroup>;
@@ -1,56 +0,0 @@
1
- /**
2
- * Toolbar placement options (for backward compatibility)
3
- */
4
- export type ToolbarPlacement = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
5
- /**
6
- * Notification levels
7
- */
8
- export type NotificationLevel = "info" | "warning" | "error";
9
- /**
10
- * Position anchor (which edge the toolbar is attached to)
11
- * Matches Vue DevTools positioning
12
- */
13
- export type PositionAnchor = "top" | "bottom" | "left" | "right";
14
- /**
15
- * Frame state - matches Vue DevTools DevToolsFrameState
16
- * @see https://github.com/vuejs/devtools/blob/main/packages/overlay/src/composables/state.ts
17
- */
18
- export interface FrameState {
19
- /**
20
- * Horizontal position as percentage (0-100)
21
- */
22
- left: number;
23
- /**
24
- * Whether panel is open
25
- */
26
- open: boolean;
27
- /**
28
- * Which edge the toolbar is anchored to
29
- */
30
- position: PositionAnchor;
31
- /**
32
- * Vertical position as percentage (0-100)
33
- */
34
- top: number;
35
- }
36
- /**
37
- * Configuration options controlling the toolbar's initial appearance.
38
- */
39
- export interface ToolbarSettings {
40
- /**
41
- * Whether toolbar is visible by default
42
- */
43
- defaultVisible: boolean;
44
- /**
45
- * Toolbar placement on screen
46
- */
47
- placement: ToolbarPlacement;
48
- /**
49
- * Whether to show notifications
50
- */
51
- showNotifications: boolean;
52
- }
53
- /**
54
- * Default toolbar settings
55
- */
56
- export declare const DEFAULT_TOOLBAR_SETTINGS: ToolbarSettings;