@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,42 +0,0 @@
1
- import type { TimelineEvent, TimelineGroup } from "../types/timeline.d.ts";
2
- /**
3
- * Timeline store for managing timeline events.
4
- */
5
- declare class TimelineStore {
6
- private groups;
7
- private maxEvents;
8
- constructor(maxEvents?: number);
9
- /**
10
- * Adds an event to a group.
11
- */
12
- addEvent(groupId: string, event: TimelineEvent): void;
13
- /**
14
- * Gets all timeline groups.
15
- */
16
- getGroups(): TimelineGroup[];
17
- /**
18
- * Gets events for a specific group.
19
- */
20
- getGroupEvents(groupId: string): TimelineEvent[];
21
- /**
22
- * Gets all events across all groups.
23
- */
24
- getAllEvents(): TimelineEvent[];
25
- /**
26
- * Clears events for a specific group.
27
- */
28
- clearGroup(groupId: string): void;
29
- /**
30
- * Clears all events from all groups.
31
- */
32
- clearAll(): void;
33
- /**
34
- * Gets events within a time range.
35
- */
36
- getEventsInRange(startTime: number, endTime: number): TimelineEvent[];
37
- }
38
- /**
39
- * Gets or creates the timeline store singleton instance.
40
- */
41
- declare const getTimelineStore: () => TimelineStore;
42
- export { getTimelineStore, TimelineStore };
@@ -1,104 +0,0 @@
1
- import type { DevToolbarApp, DevToolbarAppState } from "../types/app.d.ts";
2
- /**
3
- * Manages the lifecycle of all registered dev-toolbar apps.
4
- */
5
- declare class AppManager {
6
- private apps;
7
- private activeAppId;
8
- private initializedApps;
9
- private appCanvases;
10
- /**
11
- * Registers an app with the toolbar.
12
- * @param app App definition.
13
- * @param builtIn Whether this is a built-in app.
14
- */
15
- registerApp(app: DevToolbarApp, builtIn?: boolean): void;
16
- /**
17
- * Unregisters an app and calls its destroy hook if initialized.
18
- * @param appId App ID to unregister.
19
- */
20
- unregisterApp(appId: string): Promise<void>;
21
- /**
22
- * Returns the app state for a given ID.
23
- * @param appId App ID to look up.
24
- * @returns App state or undefined.
25
- */
26
- getApp(appId: string): DevToolbarAppState | undefined;
27
- /**
28
- * Returns all registered app states.
29
- */
30
- getAllApps(): DevToolbarAppState[];
31
- /**
32
- * Returns the currently active app state, or undefined if none is active.
33
- */
34
- getActiveApp(): DevToolbarAppState | undefined;
35
- /**
36
- * Toggles the active state of an app.
37
- * @param appId App ID to toggle.
38
- * @returns Whether the toggle was successful.
39
- */
40
- toggleApp(appId: string): Promise<boolean>;
41
- /**
42
- * Directly sets the active state of an action button without invoking callbacks.
43
- * Use this to deactivate a button from outside the toolbar (e.g. after async work).
44
- * @param appId The unique identifier of the app whose active state to change.
45
- * @param active New active state.
46
- */
47
- setAppActive(appId: string, active: boolean): void;
48
- /**
49
- * Returns whether an app has already had its init() called.
50
- * @param appId App ID to check.
51
- */
52
- isAppInitialized(appId: string): boolean;
53
- /**
54
- * Marks an app as having been initialized.
55
- * @param appId App ID to mark.
56
- */
57
- markAppInitialized(appId: string): void;
58
- /**
59
- * Opens an app and initializes it if necessary.
60
- * @param appId App ID to open.
61
- * @returns Whether the open was successful.
62
- */
63
- openApp(appId: string): Promise<boolean>;
64
- /**
65
- * Closes an active app.
66
- * @param appId App ID to close.
67
- * @returns Whether the close was successful.
68
- */
69
- closeApp(appId: string): Promise<boolean>;
70
- /**
71
- * Sets a notification for an app.
72
- * @param appId The unique identifier of the app to notify.
73
- * @param state Whether the notification is currently visible.
74
- * @param level The severity level of the notification badge.
75
- */
76
- setNotification(appId: string, state: boolean, level?: "info" | "warning" | "error"): void;
77
- /**
78
- * Clears the notification for an app.
79
- * @param appId The unique identifier of the app whose notification to clear.
80
- */
81
- clearNotification(appId: string): void;
82
- /**
83
- * Returns the canvas element and shadow root for an app.
84
- * @param appId The unique identifier of the app whose canvas to retrieve.
85
- * @returns Canvas element with shadow root or undefined.
86
- */
87
- getAppCanvas(appId: string): {
88
- element: HTMLElement;
89
- shadowRoot: ShadowRoot;
90
- } | undefined;
91
- /**
92
- * Stores the canvas element and shadow root for an app.
93
- * @param appId The unique identifier of the app whose canvas to store.
94
- * @param canvas The canvas object containing the host element and its shadow root.
95
- * @param canvas.element The host HTMLElement that wraps the app's shadow DOM.
96
- * @param canvas.shadowRoot The ShadowRoot attached to the canvas element.
97
- */
98
- setAppCanvas(appId: string, canvas: {
99
- element: HTMLElement;
100
- shadowRoot: ShadowRoot;
101
- }): void;
102
- }
103
- export { AppManager };
104
- export default AppManager;
@@ -1,19 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import type { ComponentChildren } from "preact";
3
- import type { DevToolbarAppState } from "../../types/index.d.ts";
4
- interface AppButtonProps {
5
- /**
6
- * App state
7
- */
8
- app: DevToolbarAppState;
9
- }
10
- /**
11
- * App button component — shown in the toolbar pill.
12
- * When an app declares a `tooltip` component, hovering the button shows a live
13
- * mini-canvas via AppTooltipOverlay (rendered outside overflow:hidden pill).
14
- * @param props Component props
15
- * @param props.app App state
16
- * @returns Rendered button component
17
- */
18
- declare const AppButton: ({ app }: AppButtonProps) => ComponentChildren;
19
- export default AppButton;
@@ -1,12 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- import type { DevToolbarAppState } from "../../types/index.d.ts";
3
- interface DevPanelProps {
4
- activeAppId: string | undefined;
5
- apps: DevToolbarAppState[];
6
- onClose: () => void;
7
- onToggleApp: (appId: string) => Promise<void>;
8
- panelVisible: boolean;
9
- position: "bottom" | "left" | "right" | "top";
10
- }
11
- declare const DevPanel: ({ activeAppId, apps, onClose, onToggleApp, panelVisible, position }: DevPanelProps) => ComponentChildren;
12
- export default DevPanel;
@@ -1,12 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- interface AppTooltipOverlayProps {
3
- position: "bottom" | "left" | "right" | "top";
4
- }
5
- /**
6
- * Floating mini-canvas that appears when hovering a toolbar app button that
7
- * provides a `tooltip` component. Rendered as `position:fixed` so it escapes
8
- * the pill's `overflow:hidden`. The leave-debounce (handled in ToolbarContainer)
9
- * keeps it visible while the mouse moves from button to tooltip.
10
- */
11
- declare const AppTooltipOverlay: ({ position }: AppTooltipOverlayProps) => ComponentChildren;
12
- export default AppTooltipOverlay;
@@ -1,16 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import type { ComponentChildren } from "preact";
3
- interface FirstVisitHintProps {
4
- onDismiss: () => void;
5
- position: "bottom" | "left" | "right" | "top";
6
- }
7
- /**
8
- * First-visit hint overlay showing keyboard and interaction tips.
9
- * Appears ~600 ms after mount to let the toolbar pill animate in first.
10
- * @param props Component props
11
- * @param props.onDismiss Called after the dismiss animation completes
12
- * @param props.position Current toolbar position (controls hint placement)
13
- * @returns Rendered hint component
14
- */
15
- declare const FirstVisitHint: ({ onDismiss, position }: FirstVisitHintProps) => ComponentChildren;
16
- export default FirstVisitHint;
@@ -1,4 +0,0 @@
1
- export { default as AppButton } from "./app-button.d.ts";
2
- export { default as AppCanvas } from "./app-canvas.d.ts";
3
- export { default as ToolbarBar } from "./toolbar-bar.d.ts";
4
- export { default as ToolbarContainer } from "./toolbar-container.d.ts";
@@ -1,22 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- import type { PinnedTooltip } from "../context/index.d.ts";
3
- interface PinnedTooltipCardProps {
4
- /** Called once when a drag ends so the parent can persist the new position. */
5
- onMove: (id: string, x: number, y: number) => void;
6
- onUnpin: (id: string) => void;
7
- pinned: PinnedTooltip;
8
- }
9
- /**
10
- * A pinned tooltip card — persists on screen until the user unpins it.
11
- *
12
- * Position is updated via direct DOM style mutations during drag so that
13
- * Preact never re-renders the component on mousemove — drag is silky smooth
14
- * regardless of how expensive the tooltip content component is.
15
- * @param props Component props
16
- * @param props.onMove Called with the pin ID and final (x, y) coordinates when a drag ends
17
- * @param props.onUnpin Called with the pin ID when the user clicks the unpin button
18
- * @param props.pinned Pinned tooltip descriptor — contains the app reference and initial position
19
- * @returns Rendered draggable pinned card, or null if the app has no tooltip component
20
- */
21
- declare const PinnedTooltipCard: ({ onMove, onUnpin, pinned }: PinnedTooltipCardProps) => ComponentChildren;
22
- export default PinnedTooltipCard;
@@ -1,14 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- interface ToolbarBarProps {
3
- /**
4
- * Number of custom apps to show before "more" button
5
- */
6
- customAppsToShow?: number;
7
- }
8
- /**
9
- * Toolbar bar — row of app buttons inside the pill.
10
- * Left/right placement rotates the whole pill 90deg via CSS,
11
- * so this always stays flex-row internally.
12
- */
13
- declare const ToolbarBar: ({ customAppsToShow }: ToolbarBarProps) => ComponentChildren;
14
- export default ToolbarBar;
@@ -1,55 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import type { ComponentChildren } from "preact";
3
- import type { DevToolbarAppState } from "../../types/index.d.ts";
4
- interface ToolbarContainerProps {
5
- /**
6
- * Active app ID
7
- */
8
- activeAppId: string | undefined;
9
- /**
10
- * Initial apps
11
- */
12
- apps: DevToolbarAppState[];
13
- /**
14
- * Number of custom apps to show
15
- */
16
- customAppsToShow?: number;
17
- /**
18
- * Callback when notification should be cleared
19
- */
20
- onClearNotification: (appId: string) => void;
21
- /**
22
- * Callback when app should be registered
23
- */
24
- onRegisterApp: (app: DevToolbarAppState) => void;
25
- /**
26
- * Callback when notification should be set
27
- */
28
- onSetNotification: (appId: string, state: boolean, level?: "error" | "info" | "warning") => void;
29
- /**
30
- * Callback when app should be toggled
31
- */
32
- onToggleApp: (appId: string) => Promise<void>;
33
- /**
34
- * Callback when app should be unregistered
35
- */
36
- onUnregisterApp: (appId: string) => void;
37
- }
38
- /**
39
- * Root toolbar container component — orchestrates the toolbar pill, app panel,
40
- * tooltip overlays, pinned cards, and first-visit hint.
41
- * Manages active app state, hover tooltips, pinned tooltip persistence (localStorage),
42
- * and delegates app lifecycle events to the parent via callbacks.
43
- * @param props Component props
44
- * @param props.activeAppId ID of the currently open app, or null if no app is open
45
- * @param props.apps Initial array of registered app states
46
- * @param props.customAppsToShow Maximum number of custom apps to show in the pill (default: 3)
47
- * @param props.onClearNotification Called when an app's notification badge should be cleared
48
- * @param props.onRegisterApp Called when a new app is dynamically registered
49
- * @param props.onSetNotification Called when an app requests a notification badge update
50
- * @param props.onToggleApp Called when the user clicks an app button to open/close it
51
- * @param props.onUnregisterApp Called when an app is dynamically unregistered
52
- * @returns Rendered toolbar component tree
53
- */
54
- declare const ToolbarContainer: ({ activeAppId, apps, customAppsToShow, onClearNotification, onRegisterApp, onSetNotification, onToggleApp, onUnregisterApp, }: ToolbarContainerProps) => ComponentChildren;
55
- export default ToolbarContainer;
@@ -1,14 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- /**
3
- * Shows a red error button in the toolbar when `@visulima/vite-overlay` errors exist.
4
- * Clicking toggles the vite-overlay panel visibility.
5
- *
6
- * Only rendered when:
7
- * - `@visulima/vite-overlay` is installed and active (window.ErrorOverlay is defined)
8
- * - At least one error is present in the history
9
- *
10
- * Renders with its own left separator so it stays visually grouped on the
11
- * right side of the toolbar, distinct from the regular app buttons.
12
- */
13
- declare const ViteOverlayButton: () => ComponentChildren;
14
- export default ViteOverlayButton;
@@ -1,2 +0,0 @@
1
- export type { PinnedTooltip, ToolbarContextState } from "./toolbar-context.d.ts";
2
- export { ToolbarContext, useToolbarContext } from "./toolbar-context.d.ts";
@@ -1,107 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import { createContext } from "preact";
3
- import type { DevToolbarAppState, ToolbarPlacement } from "../../types/index.d.ts";
4
- /**
5
- * A tooltip that has been pinned by the user — stays visible until unpinned.
6
- */
7
- export interface PinnedTooltip {
8
- /** The app whose tooltip is shown */
9
- app: DevToolbarAppState;
10
- /** Unique instance identifier (appId + timestamp) */
11
- id: string;
12
- /** Initial left position (viewport px) */
13
- initialX: number;
14
- /** Initial top position (viewport px) */
15
- initialY: number;
16
- }
17
- /**
18
- * Shared state and actions exposed by the ToolbarContext.
19
- */
20
- export interface ToolbarContextState {
21
- /**
22
- * Currently active app ID
23
- */
24
- activeAppId: string | undefined;
25
- /**
26
- * All registered apps
27
- */
28
- apps: DevToolbarAppState[];
29
- /**
30
- * Clears the notification badge for an app.
31
- */
32
- clearNotification: (appId: string) => void;
33
- /**
34
- * Currently hovered app (has a tooltip component)
35
- */
36
- hoveredApp: DevToolbarAppState | undefined;
37
- /**
38
- * Viewport rect of the hovered app button (for tooltip positioning)
39
- */
40
- hoveredAppRect: DOMRect | undefined;
41
- /**
42
- * Whether toolbar is being dragged
43
- */
44
- isDragging: boolean;
45
- /**
46
- * Whether toolbar is visible
47
- */
48
- isVisible: boolean;
49
- /**
50
- * Currently pinned tooltip cards
51
- */
52
- pinnedTooltips: PinnedTooltip[];
53
- /**
54
- * Pin a tooltip at the given viewport position.
55
- * Multiple pins from the same app are allowed (each gets a unique id).
56
- */
57
- pinTooltip: (app: DevToolbarAppState, x: number, y: number) => void;
58
- /**
59
- * Toolbar placement on screen
60
- */
61
- placement: ToolbarPlacement;
62
- /**
63
- * Registers an app with the toolbar.
64
- */
65
- registerApp: (app: DevToolbarAppState) => void;
66
- /**
67
- * Sets the dragging state.
68
- */
69
- setDragging: (dragging: boolean) => void;
70
- /**
71
- * Sets or clears the hovered app. Pass undefined to start the leave debounce.
72
- */
73
- setHoveredApp: (app: DevToolbarAppState | undefined, rect?: DOMRect | undefined) => void;
74
- /**
75
- * Sets a notification for an app.
76
- */
77
- setNotification: (appId: string, state: boolean, level?: "info" | "warning" | "error") => void;
78
- /**
79
- * Sets the toolbar placement.
80
- */
81
- setPlacement: (placement: ToolbarPlacement) => void;
82
- /**
83
- * Sets toolbar visibility.
84
- */
85
- setVisible: (visible: boolean) => void;
86
- /**
87
- * Toggles an app's active state.
88
- */
89
- toggleApp: (appId: string) => Promise<void>;
90
- /**
91
- * Removes a pinned tooltip by its instance id.
92
- */
93
- unpinTooltip: (id: string) => void;
94
- /**
95
- * Unregisters an app.
96
- */
97
- unregisterApp: (appId: string) => void;
98
- }
99
- /**
100
- * Preact context object that exposes the toolbar's shared state to all child components.
101
- */
102
- export declare const ToolbarContext: ReturnType<typeof createContext<ToolbarContextState | undefined>>;
103
- /**
104
- * Accesses the toolbar context, throwing if used outside a provider.
105
- * @throws Error if used outside ToolbarContext provider.
106
- */
107
- export declare const useToolbarContext: () => ToolbarContextState;
@@ -1,24 +0,0 @@
1
- import type { VisulimaDevTools } from "../types/global-api.d.ts";
2
- import type { DevToolbarApp } from "../types/index.d.ts";
3
- /**
4
- * Creates the global DevTools API implementation.
5
- */
6
- export declare const createGlobalAPI: (appManager: {
7
- clearNotification: (id: string) => void;
8
- getActiveApp: () => DevToolbarApp | undefined;
9
- getApps: () => DevToolbarApp[];
10
- registerApp: (app: DevToolbarApp) => void;
11
- setAppActive: (id: string, active: boolean) => void;
12
- setNotification: (id: string, state: boolean, level?: "info" | "warning" | "error") => void;
13
- toggleApp: (id: string) => Promise<boolean>;
14
- unregisterApp: (id: string) => void;
15
- }, toolbar: {
16
- hide: () => void;
17
- show: () => void;
18
- toggle: () => void;
19
- }) => VisulimaDevTools;
20
- /**
21
- * Mounts the global API on the window object so it can be accessed from outside the toolbar.
22
- * @param api API instance to expose globally.
23
- */
24
- export declare const setupGlobalAPI: (api: VisulimaDevTools) => void;
@@ -1,8 +0,0 @@
1
- import type { ServerHelpers } from "../types/app.d.ts";
2
- /**
3
- * Creates server helpers that proxy RPC calls for use within app init().
4
- * @returns Server helpers instance.
5
- */
6
- declare const createServerHelpers: () => ServerHelpers;
7
- export { createServerHelpers };
8
- export default createServerHelpers;
@@ -1,10 +0,0 @@
1
- export { useApps } from "./use-apps.d.ts";
2
- export type { DevToolsFrameState, UseFrameStateReturn } from "./use-frame-state.d.ts";
3
- export { useFrameState } from "./use-frame-state.d.ts";
4
- export type { UsePanelVisibleReturn } from "./use-panel-visible.d.ts";
5
- export { usePanelVisible } from "./use-panel-visible.d.ts";
6
- export type { UsePositionReturn } from "./use-position.d.ts";
7
- export { usePosition } from "./use-position.d.ts";
8
- export type { Theme, UseThemeReturn } from "./use-theme.d.ts";
9
- export { useTheme } from "./use-theme.d.ts";
10
- export { useToolbar } from "./use-toolbar.d.ts";
@@ -1,15 +0,0 @@
1
- import type { DevToolbarAppState } from "../../types/index.d.ts";
2
- /**
3
- * Exposes app management methods from the toolbar context.
4
- */
5
- declare const useApps: () => {
6
- activeAppId: string | undefined;
7
- apps: DevToolbarAppState[];
8
- clearNotification: (appId: string) => void;
9
- registerApp: (app: DevToolbarAppState) => void;
10
- setNotification: (appId: string, state: boolean, level?: "info" | "warning" | "error") => void;
11
- toggleApp: (appId: string) => Promise<void>;
12
- unregisterApp: (appId: string) => void;
13
- };
14
- export { useApps };
15
- export default useApps;
@@ -1,100 +0,0 @@
1
- /**
2
- * Keyboard shortcut bindings
3
- */
4
- interface KeyBindings {
5
- /** Close active app / panel */
6
- close: string;
7
- /** Toggle toolbar panel open/closed */
8
- toggle: string;
9
- }
10
- declare const DEFAULT_KEYBINDINGS: KeyBindings;
11
- /**
12
- * Persistent state for the devtools panel frame.
13
- */
14
- interface DevToolsFrameState {
15
- /**
16
- * Close panel on outside click
17
- */
18
- closeOnOutsideClick: boolean;
19
- /**
20
- * Panel height as viewport height percentage
21
- */
22
- height: number;
23
- /**
24
- * Whether this is the first visit (used to show onboarding hint)
25
- */
26
- isFirstVisit: boolean;
27
- /**
28
- * Whether DevTools panel is open in a Picture-in-Picture window
29
- */
30
- isPip: boolean;
31
- /**
32
- * Keyboard shortcut bindings
33
- */
34
- keybindings: KeyBindings;
35
- /**
36
- * Horizontal position as percentage (0-100)
37
- */
38
- left: number;
39
- /**
40
- * Auto-hide timeout in milliseconds (-1 = never hide, 0 = always hide when inactive)
41
- */
42
- minimizePanelInactive: number;
43
- /**
44
- * Whether panel is open
45
- */
46
- open: boolean;
47
- /**
48
- * Position anchor
49
- */
50
- position: "top" | "bottom" | "left" | "right";
51
- /**
52
- * Prefer showing floating panel
53
- */
54
- preferShowFloatingPanel: boolean;
55
- /**
56
- * Reduce motion for accessibility
57
- */
58
- reduceMotion: boolean;
59
- /**
60
- * Current route
61
- */
62
- route: string;
63
- /**
64
- * Vertical position as percentage (0-100)
65
- */
66
- top: number;
67
- /**
68
- * Panel view mode
69
- */
70
- viewMode: "default" | "fullscreen" | "wide";
71
- /**
72
- * Panel width as viewport width percentage
73
- */
74
- width: number;
75
- }
76
- /**
77
- * Default frame state - matches Vue DevTools exactly
78
- */
79
- declare const DEFAULT_STATE: DevToolsFrameState;
80
- /**
81
- * Return type for the useFrameState hook.
82
- */
83
- interface UseFrameStateReturn {
84
- /**
85
- * Current frame state.
86
- */
87
- state: DevToolsFrameState;
88
- /**
89
- * Updates state with partial values.
90
- */
91
- updateState: (value: Partial<DevToolsFrameState>) => void;
92
- }
93
- /**
94
- * Manages the shared devtools frame state.
95
- * All callers share the same module-level state so position, open, and other
96
- * fields stay in sync regardless of how many times the hook is called.
97
- */
98
- declare const useFrameState: () => UseFrameStateReturn;
99
- export type { DevToolsFrameState, KeyBindings, UseFrameStateReturn };
100
- export { DEFAULT_KEYBINDINGS, DEFAULT_STATE, useFrameState };
@@ -1,23 +0,0 @@
1
- /**
2
- * Return type for the usePanelVisible hook.
3
- */
4
- interface UsePanelVisibleReturn {
5
- /**
6
- * Closes the panel.
7
- */
8
- closePanel: () => void;
9
- /**
10
- * Whether the panel is currently visible.
11
- */
12
- panelVisible: boolean;
13
- /**
14
- * Toggles panel visibility, optionally forcing a specific state.
15
- */
16
- togglePanelVisible: (_?: unknown, newState?: boolean) => void;
17
- }
18
- /**
19
- * Manages panel visibility with keyboard shortcut support.
20
- */
21
- declare const usePanelVisible: () => UsePanelVisibleReturn;
22
- export type { UsePanelVisibleReturn };
23
- export { usePanelVisible };
@@ -1,24 +0,0 @@
1
- import type { RefObject } from "preact";
2
- /**
3
- * Return type for usePosition hook.
4
- */
5
- interface UsePositionReturn {
6
- anchorStyle: {
7
- left: string;
8
- top: string;
9
- };
10
- bringUp: () => void;
11
- iframeStyle: Record<string, string>;
12
- isDragging: boolean;
13
- isHidden: boolean;
14
- isVertical: boolean;
15
- onPointerDown: (event: PointerEvent) => void;
16
- panelStyle: Record<string, string>;
17
- }
18
- /**
19
- * Manages the draggable toolbar position, converted from Vue DevTools usePosition.
20
- * @see https://github.com/vuejs/devtools/blob/main/packages/overlay/src/composables/position.ts
21
- */
22
- declare const usePosition: (panelElement: RefObject<HTMLElement>) => UsePositionReturn;
23
- export type { UsePositionReturn };
24
- export { usePosition };
@@ -1,15 +0,0 @@
1
- type Theme = "light" | "dark" | "system";
2
- interface UseThemeReturn {
3
- resolvedTheme: "light" | "dark";
4
- setTheme: (newTheme: Theme) => void;
5
- theme: Theme;
6
- toggleTheme: () => void;
7
- }
8
- /**
9
- * Manages the shared light/dark/system theme preference.
10
- * All callers share the same module-level state so theme changes propagate
11
- * to every component (ToolbarContainer, SettingsApp, etc.) immediately.
12
- */
13
- declare const useTheme: () => UseThemeReturn;
14
- export type { Theme, UseThemeReturn };
15
- export { useTheme };