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

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 (123) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +59 -42
  3. package/dist/apps/a11y/a11y-store.d.ts +12 -16
  4. package/dist/apps/a11y/a11y-tooltip.d.ts +1 -1
  5. package/dist/apps/a11y/index.js +2 -21
  6. package/dist/apps/inspector/index.d.ts +3 -0
  7. package/dist/apps/inspector/index.js +1 -0
  8. package/dist/apps/inspector/inspector-app.d.ts +12 -0
  9. package/dist/apps/module-graph/index.js +1 -20
  10. package/dist/apps/more/index.js +2 -19
  11. package/dist/apps/performance/index.js +1 -17
  12. package/dist/apps/seo/index.js +1 -17
  13. package/dist/apps/settings/index.js +1 -17
  14. package/dist/apps/settings/settings-app.d.ts +0 -1
  15. package/dist/apps/tailwind/index.d.ts +3 -0
  16. package/dist/apps/tailwind/index.js +7 -0
  17. package/dist/apps/tailwind/tailwind-app.d.ts +5 -0
  18. package/dist/apps/timeline/index.js +1 -18
  19. package/dist/apps/vite-config/index.js +1 -16
  20. package/dist/client/overlay.js +1 -1
  21. package/dist/hooks/create-hook.d.ts +7 -5
  22. package/dist/hooks/events.d.ts +4 -2
  23. package/dist/hooks/global-hook.d.ts +6 -6
  24. package/dist/index.d.ts +4 -2
  25. package/dist/index.js +1 -1
  26. package/dist/packem_chunks/inject-source.js +1 -0
  27. package/dist/packem_shared/Alert-H-x1JuZ0.js +1 -0
  28. package/dist/packem_shared/Badge-C30mDKKG.js +1 -0
  29. package/dist/packem_shared/Button-DODNCTPZ.js +1 -0
  30. package/dist/packem_shared/Card-DdI7Wn3t.js +1 -0
  31. package/dist/packem_shared/Icon-DWFLZkwW.js +1 -0
  32. package/dist/packem_shared/Input-GfbOwAkK.js +1 -0
  33. package/dist/packem_shared/Label-Bzi47aUf.js +1 -0
  34. package/dist/packem_shared/Popover-CLt7YhUF.js +1 -0
  35. package/dist/packem_shared/Progress-vGfFpxRn.js +1 -0
  36. package/dist/packem_shared/Separator-DQGeJPQg.js +1 -0
  37. package/dist/packem_shared/Skeleton-BYXau6jM.js +1 -0
  38. package/dist/packem_shared/Switch-BeC78S_T.js +1 -0
  39. package/dist/packem_shared/Tabs-CXERaeAp.js +1 -0
  40. package/dist/packem_shared/Textarea-DvbSX13V.js +1 -0
  41. package/dist/packem_shared/Tooltip-tlBN-NdK.js +1 -0
  42. package/dist/packem_shared/cn-DWLJYh3h.js +1 -0
  43. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
  44. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
  45. package/dist/packem_shared/createServerRPCContext-CEm1Ymkn.js +1 -0
  46. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
  47. package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
  48. package/dist/packem_shared/sharedToolbarStylesheet-DOV-Jwcm.js +2 -0
  49. package/dist/packem_shared/store-DaUtLjf3.js +1 -0
  50. package/dist/packem_shared/use-theme-BOw3dPpY.js +1 -0
  51. package/dist/performance/monitor.d.ts +27 -26
  52. package/dist/rpc/client.d.ts +6 -4
  53. package/dist/rpc/functions/module-graph.d.ts +2 -2
  54. package/dist/rpc/functions/open-in-editor.d.ts +13 -6
  55. package/dist/rpc/functions/tailwind-config.d.ts +15 -0
  56. package/dist/rpc/functions/vite-config.d.ts +6 -4
  57. package/dist/rpc/server.d.ts +11 -5
  58. package/dist/timeline/capture.d.ts +8 -0
  59. package/dist/timeline/index.d.ts +3 -1
  60. package/dist/timeline/store.d.ts +12 -22
  61. package/dist/toolbar/app-manager.d.ts +49 -40
  62. package/dist/toolbar/components/app-button.d.ts +2 -2
  63. package/dist/toolbar/components/app-canvas.d.ts +1 -2
  64. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -1
  65. package/dist/toolbar/components/first-visit-hint.d.ts +3 -3
  66. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -1
  67. package/dist/toolbar/components/toolbar-bar.d.ts +0 -1
  68. package/dist/toolbar/components/toolbar-container.d.ts +1 -1
  69. package/dist/toolbar/components/vite-overlay-button.d.ts +2 -3
  70. package/dist/toolbar/context/index.d.ts +1 -1
  71. package/dist/toolbar/context/toolbar-context.d.ts +43 -42
  72. package/dist/toolbar/global-api.d.ts +4 -3
  73. package/dist/toolbar/helpers.d.ts +5 -3
  74. package/dist/toolbar/hooks/index.d.ts +4 -4
  75. package/dist/toolbar/hooks/use-apps.d.ts +5 -3
  76. package/dist/toolbar/hooks/use-frame-state.d.ts +22 -16
  77. package/dist/toolbar/hooks/use-panel-visible.d.ts +9 -7
  78. package/dist/toolbar/hooks/use-position.d.ts +7 -5
  79. package/dist/toolbar/hooks/use-theme.d.ts +6 -4
  80. package/dist/toolbar/hooks/use-toolbar.d.ts +4 -2
  81. package/dist/toolbar/index.d.ts +9 -16
  82. package/dist/toolbar/index.js +3 -4
  83. package/dist/toolbar/settings.d.ts +7 -7
  84. package/dist/toolbar/stylesheet.d.ts +3 -1
  85. package/dist/toolbar/utils/index.d.ts +3 -3
  86. package/dist/types/app.d.ts +26 -14
  87. package/dist/types/global-api.d.ts +27 -31
  88. package/dist/types/hooks.d.ts +32 -34
  89. package/dist/types/messaging.d.ts +2 -2
  90. package/dist/types/rpc.d.ts +8 -6
  91. package/dist/types/timeline.d.ts +3 -3
  92. package/dist/types/toolbar.d.ts +1 -1
  93. package/dist/ui/components/alert.d.ts +20 -0
  94. package/dist/ui/components/badge.d.ts +10 -0
  95. package/dist/ui/components/button.d.ts +12 -0
  96. package/dist/ui/components/card.d.ts +17 -0
  97. package/dist/ui/components/icon.d.ts +5 -6
  98. package/dist/ui/components/input.d.ts +8 -0
  99. package/dist/ui/components/label.d.ts +8 -0
  100. package/dist/ui/components/popover.d.ts +27 -0
  101. package/dist/ui/components/progress.d.ts +8 -0
  102. package/dist/ui/components/separator.d.ts +9 -0
  103. package/dist/ui/components/skeleton.d.ts +7 -0
  104. package/dist/ui/components/switch.d.ts +12 -0
  105. package/dist/ui/components/tabs.d.ts +29 -0
  106. package/dist/ui/components/textarea.d.ts +8 -0
  107. package/dist/ui/components/tooltip.d.ts +19 -0
  108. package/dist/ui/index.d.ts +17 -0
  109. package/dist/ui/index.js +1 -0
  110. package/dist/utils/cn.d.ts +3 -3
  111. package/dist/vite/inject-source.d.ts +24 -0
  112. package/dist/vite/matcher.d.ts +6 -0
  113. package/dist/vite-plugin.d.ts +43 -5
  114. package/dist/vite-plugin.js +2 -2
  115. package/package.json +23 -5
  116. package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
  117. package/dist/packem_shared/cn-BEsR6GkP.js +0 -1
  118. package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
  119. package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
  120. package/dist/packem_shared/createServerRPCContext-BVSesPXu.js +0 -1
  121. package/dist/packem_shared/icon-BUQ92HaT.js +0 -1
  122. package/dist/packem_shared/store-BxE0w51s.js +0 -1
  123. package/dist/rpc/index.d.ts +0 -8
@@ -1,95 +1,104 @@
1
1
  import type { DevToolbarApp, DevToolbarAppState } from "../types/app.d.ts";
2
2
  /**
3
- * App manager for handling app lifecycle
3
+ * Manages the lifecycle of all registered dev-toolbar apps.
4
4
  */
5
- export declare class AppManager {
5
+ declare class AppManager {
6
6
  private apps;
7
7
  private activeAppId;
8
8
  private initializedApps;
9
9
  private appCanvases;
10
10
  /**
11
- * Register an app
12
- * @param app App definition
13
- * @param builtIn Whether this is a built-in app
11
+ * Registers an app with the toolbar.
12
+ * @param app App definition.
13
+ * @param builtIn Whether this is a built-in app.
14
14
  */
15
15
  registerApp(app: DevToolbarApp, builtIn?: boolean): void;
16
16
  /**
17
- * Unregister an app
18
- * @param appId App ID
17
+ * Unregisters an app and calls its destroy hook if initialized.
18
+ * @param appId App ID to unregister.
19
19
  */
20
20
  unregisterApp(appId: string): Promise<void>;
21
21
  /**
22
- * Get an app by ID
23
- * @param appId App ID
24
- * @returns App state or undefined
22
+ * Returns the app state for a given ID.
23
+ * @param appId App ID to look up.
24
+ * @returns App state or undefined.
25
25
  */
26
26
  getApp(appId: string): DevToolbarAppState | undefined;
27
27
  /**
28
- * Get all apps
29
- * @returns Array of app states
28
+ * Returns all registered app states.
30
29
  */
31
30
  getAllApps(): DevToolbarAppState[];
32
31
  /**
33
- * Get active app
34
- * @returns Active app state or undefined
32
+ * Returns the currently active app state, or undefined if none is active.
35
33
  */
36
34
  getActiveApp(): DevToolbarAppState | undefined;
37
35
  /**
38
- * Toggle app active state
39
- * @param appId App ID
40
- * @returns Whether toggle was successful
36
+ * Toggles the active state of an app.
37
+ * @param appId App ID to toggle.
38
+ * @returns Whether the toggle was successful.
41
39
  */
42
40
  toggleApp(appId: string): Promise<boolean>;
43
41
  /**
44
- * Check if an app has been initialized
45
- * @returns True when the app's init() has already been called
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.
46
51
  */
47
52
  isAppInitialized(appId: string): boolean;
48
53
  /**
49
- * Mark an app as initialized
50
- * @returns void
54
+ * Marks an app as having been initialized.
55
+ * @param appId App ID to mark.
51
56
  */
52
57
  markAppInitialized(appId: string): void;
53
58
  /**
54
- * Open an app
55
- * @param appId App ID
56
- * @returns Whether open was successful
59
+ * Opens an app and initializes it if necessary.
60
+ * @param appId App ID to open.
61
+ * @returns Whether the open was successful.
57
62
  */
58
63
  openApp(appId: string): Promise<boolean>;
59
64
  /**
60
- * Close an app
61
- * @param appId App ID
62
- * @returns Whether close was successful
65
+ * Closes an active app.
66
+ * @param appId App ID to close.
67
+ * @returns Whether the close was successful.
63
68
  */
64
69
  closeApp(appId: string): Promise<boolean>;
65
70
  /**
66
- * Set app notification
67
- * @param appId App ID
68
- * @param state Notification state
69
- * @param level Notification level
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.
70
75
  */
71
76
  setNotification(appId: string, state: boolean, level?: "info" | "warning" | "error"): void;
72
77
  /**
73
- * Clear app notification
74
- * @param appId App ID
78
+ * Clears the notification for an app.
79
+ * @param appId The unique identifier of the app whose notification to clear.
75
80
  */
76
81
  clearNotification(appId: string): void;
77
82
  /**
78
- * Get app canvas element
79
- * @param appId App ID
80
- * @returns Canvas element with shadow root or null
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.
81
86
  */
82
87
  getAppCanvas(appId: string): {
83
88
  element: HTMLElement;
84
89
  shadowRoot: ShadowRoot;
85
- } | null;
90
+ } | undefined;
86
91
  /**
87
- * Set app canvas element (called by toolbar component)
88
- * @param appId App ID
89
- * @param canvas Canvas with shadow root
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.
90
97
  */
91
98
  setAppCanvas(appId: string, canvas: {
92
99
  element: HTMLElement;
93
100
  shadowRoot: ShadowRoot;
94
101
  }): void;
95
102
  }
103
+ export { AppManager };
104
+ export default AppManager;
@@ -11,8 +11,8 @@ interface AppButtonProps {
11
11
  * App button component — shown in the toolbar pill.
12
12
  * When an app declares a `tooltip` component, hovering the button shows a live
13
13
  * mini-canvas via AppTooltipOverlay (rendered outside overflow:hidden pill).
14
- * @param props - Component props
15
- * @param props.app - App state
14
+ * @param props Component props
15
+ * @param props.app App state
16
16
  * @returns Rendered button component
17
17
  */
18
18
  declare const AppButton: ({ app }: AppButtonProps) => ComponentChildren;
@@ -1,8 +1,7 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  import type { DevToolbarAppState } from "../../types/index.d.ts";
4
3
  interface DevPanelProps {
5
- activeAppId: string | null;
4
+ activeAppId: string | undefined;
6
5
  apps: DevToolbarAppState[];
7
6
  onClose: () => void;
8
7
  onToggleApp: (appId: string) => Promise<void>;
@@ -1,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  interface AppTooltipOverlayProps {
4
3
  position: "bottom" | "left" | "right" | "top";
@@ -7,9 +7,9 @@ interface FirstVisitHintProps {
7
7
  /**
8
8
  * First-visit hint overlay showing keyboard and interaction tips.
9
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)
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
13
  * @returns Rendered hint component
14
14
  */
15
15
  declare const FirstVisitHint: ({ onDismiss, position }: FirstVisitHintProps) => ComponentChildren;
@@ -1,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  import type { PinnedTooltip } from "../context/index.d.ts";
4
3
  interface PinnedTooltipCardProps {
@@ -1,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  interface ToolbarBarProps {
4
3
  /**
@@ -5,7 +5,7 @@ interface ToolbarContainerProps {
5
5
  /**
6
6
  * Active app ID
7
7
  */
8
- activeAppId: string | null;
8
+ activeAppId: string | undefined;
9
9
  /**
10
10
  * Initial apps
11
11
  */
@@ -1,11 +1,10 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  /**
4
- * Shows a red error button in the toolbar when @visulima/vite-overlay errors exist.
3
+ * Shows a red error button in the toolbar when `@visulima/vite-overlay` errors exist.
5
4
  * Clicking toggles the vite-overlay panel visibility.
6
5
  *
7
6
  * Only rendered when:
8
- * - @visulima/vite-overlay is installed and active (window.ErrorOverlay is defined)
7
+ * - `@visulima/vite-overlay` is installed and active (window.ErrorOverlay is defined)
9
8
  * - At least one error is present in the history
10
9
  *
11
10
  * Renders with its own left separator so it stays visually grouped on the
@@ -1,2 +1,2 @@
1
- export { ToolbarContext, useToolbarContext } from "./toolbar-context.d.ts";
2
1
  export type { PinnedTooltip, ToolbarContextState } from "./toolbar-context.d.ts";
2
+ export { ToolbarContext, useToolbarContext } from "./toolbar-context.d.ts";
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource preact */
1
2
  import { createContext } from "preact";
2
3
  import type { DevToolbarAppState, ToolbarPlacement } from "../../types/index.d.ts";
3
4
  /**
@@ -14,93 +15,93 @@ export interface PinnedTooltip {
14
15
  initialY: number;
15
16
  }
16
17
  /**
17
- * Toolbar context state
18
+ * Shared state and actions exposed by the ToolbarContext.
18
19
  */
19
20
  export interface ToolbarContextState {
21
+ /**
22
+ * Currently active app ID
23
+ */
24
+ activeAppId: string | undefined;
20
25
  /**
21
26
  * All registered apps
22
27
  */
23
28
  apps: DevToolbarAppState[];
24
29
  /**
25
- * Currently active app ID
30
+ * Clears the notification badge for an app.
26
31
  */
27
- activeAppId: string | null;
32
+ clearNotification: (appId: string) => void;
28
33
  /**
29
- * Whether toolbar is visible
34
+ * Currently hovered app (has a tooltip component)
30
35
  */
31
- isVisible: boolean;
36
+ hoveredApp: DevToolbarAppState | undefined;
32
37
  /**
33
- * Toolbar placement on screen
38
+ * Viewport rect of the hovered app button (for tooltip positioning)
34
39
  */
35
- placement: ToolbarPlacement;
40
+ hoveredAppRect: DOMRect | undefined;
36
41
  /**
37
42
  * Whether toolbar is being dragged
38
43
  */
39
44
  isDragging: boolean;
40
45
  /**
41
- * Set toolbar visibility
42
- */
43
- setVisible: (visible: boolean) => void;
44
- /**
45
- * Set toolbar placement
46
+ * Whether toolbar is visible
46
47
  */
47
- setPlacement: (placement: ToolbarPlacement) => void;
48
+ isVisible: boolean;
48
49
  /**
49
- * Set dragging state
50
+ * Currently pinned tooltip cards
50
51
  */
51
- setDragging: (dragging: boolean) => void;
52
+ pinnedTooltips: PinnedTooltip[];
52
53
  /**
53
- * Register an app
54
+ * Pin a tooltip at the given viewport position.
55
+ * Multiple pins from the same app are allowed (each gets a unique id).
54
56
  */
55
- registerApp: (app: DevToolbarAppState) => void;
57
+ pinTooltip: (app: DevToolbarAppState, x: number, y: number) => void;
56
58
  /**
57
- * Unregister an app
59
+ * Toolbar placement on screen
58
60
  */
59
- unregisterApp: (appId: string) => void;
61
+ placement: ToolbarPlacement;
60
62
  /**
61
- * Toggle an app
63
+ * Registers an app with the toolbar.
62
64
  */
63
- toggleApp: (appId: string) => Promise<void>;
65
+ registerApp: (app: DevToolbarAppState) => void;
64
66
  /**
65
- * Set app notification
67
+ * Sets the dragging state.
66
68
  */
67
- setNotification: (appId: string, state: boolean, level?: "info" | "warning" | "error") => void;
69
+ setDragging: (dragging: boolean) => void;
68
70
  /**
69
- * Clear app notification
71
+ * Sets or clears the hovered app. Pass undefined to start the leave debounce.
70
72
  */
71
- clearNotification: (appId: string) => void;
73
+ setHoveredApp: (app: DevToolbarAppState | undefined, rect?: DOMRect | undefined) => void;
72
74
  /**
73
- * Currently hovered app (has a tooltip component)
75
+ * Sets a notification for an app.
74
76
  */
75
- hoveredApp: DevToolbarAppState | null;
77
+ setNotification: (appId: string, state: boolean, level?: "info" | "warning" | "error") => void;
76
78
  /**
77
- * Viewport rect of the hovered app button (for tooltip positioning)
79
+ * Sets the toolbar placement.
78
80
  */
79
- hoveredAppRect: DOMRect | null;
81
+ setPlacement: (placement: ToolbarPlacement) => void;
80
82
  /**
81
- * Set/clear the hovered app. Pass null to start the leave debounce.
83
+ * Sets toolbar visibility.
82
84
  */
83
- setHoveredApp: (app: DevToolbarAppState | null, rect?: DOMRect | null) => void;
85
+ setVisible: (visible: boolean) => void;
84
86
  /**
85
- * Currently pinned tooltip cards
87
+ * Toggles an app's active state.
86
88
  */
87
- pinnedTooltips: PinnedTooltip[];
89
+ toggleApp: (appId: string) => Promise<void>;
88
90
  /**
89
- * Pin a tooltip at the given viewport position.
90
- * Multiple pins from the same app are allowed (each gets a unique id).
91
+ * Removes a pinned tooltip by its instance id.
91
92
  */
92
- pinTooltip: (app: DevToolbarAppState, x: number, y: number) => void;
93
+ unpinTooltip: (id: string) => void;
93
94
  /**
94
- * Remove a pinned tooltip by its instance id.
95
+ * Unregisters an app.
95
96
  */
96
- unpinTooltip: (id: string) => void;
97
+ unregisterApp: (appId: string) => void;
97
98
  }
98
99
  /**
99
- * Toolbar context
100
+ * Preact context object that exposes the toolbar's shared state to all child components.
100
101
  */
101
- export declare const ToolbarContext: ReturnType<typeof createContext<ToolbarContextState | null>>;
102
+ export declare const ToolbarContext: ReturnType<typeof createContext<ToolbarContextState | undefined>>;
102
103
  /**
103
- * Hook to access toolbar context
104
- * @throws Error if used outside ToolbarContext provider
104
+ * Accesses the toolbar context, throwing if used outside a provider.
105
+ * @throws Error if used outside ToolbarContext provider.
105
106
  */
106
107
  export declare const useToolbarContext: () => ToolbarContextState;
@@ -1,13 +1,14 @@
1
1
  import type { VisulimaDevTools } from "../types/global-api.d.ts";
2
2
  import type { DevToolbarApp } from "../types/index.d.ts";
3
3
  /**
4
- * Global DevTools API implementation.
4
+ * Creates the global DevTools API implementation.
5
5
  */
6
6
  export declare const createGlobalAPI: (appManager: {
7
7
  clearNotification: (id: string) => void;
8
8
  getActiveApp: () => DevToolbarApp | undefined;
9
9
  getApps: () => DevToolbarApp[];
10
10
  registerApp: (app: DevToolbarApp) => void;
11
+ setAppActive: (id: string, active: boolean) => void;
11
12
  setNotification: (id: string, state: boolean, level?: "info" | "warning" | "error") => void;
12
13
  toggleApp: (id: string) => Promise<boolean>;
13
14
  unregisterApp: (id: string) => void;
@@ -17,7 +18,7 @@ export declare const createGlobalAPI: (appManager: {
17
18
  toggle: () => void;
18
19
  }) => VisulimaDevTools;
19
20
  /**
20
- * Setup global API on window object
21
- * @param api API instance
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.
22
23
  */
23
24
  export declare const setupGlobalAPI: (api: VisulimaDevTools) => void;
@@ -1,6 +1,8 @@
1
1
  import type { ServerHelpers } from "../types/app.d.ts";
2
2
  /**
3
- * Create server helpers for apps
4
- * @returns Server helpers instance
3
+ * Creates server helpers that proxy RPC calls for use within app init().
4
+ * @returns Server helpers instance.
5
5
  */
6
- export declare const createServerHelpers: () => ServerHelpers;
6
+ declare const createServerHelpers: () => ServerHelpers;
7
+ export { createServerHelpers };
8
+ export default createServerHelpers;
@@ -1,10 +1,10 @@
1
1
  export { useApps } from "./use-apps.d.ts";
2
- export { useFrameState } from "./use-frame-state.d.ts";
3
2
  export type { DevToolsFrameState, UseFrameStateReturn } from "./use-frame-state.d.ts";
4
- export { usePanelVisible } from "./use-panel-visible.d.ts";
3
+ export { useFrameState } from "./use-frame-state.d.ts";
5
4
  export type { UsePanelVisibleReturn } from "./use-panel-visible.d.ts";
6
- export { usePosition } from "./use-position.d.ts";
5
+ export { usePanelVisible } from "./use-panel-visible.d.ts";
7
6
  export type { UsePositionReturn } from "./use-position.d.ts";
8
- export { useTheme } from "./use-theme.d.ts";
7
+ export { usePosition } from "./use-position.d.ts";
9
8
  export type { Theme, UseThemeReturn } from "./use-theme.d.ts";
9
+ export { useTheme } from "./use-theme.d.ts";
10
10
  export { useToolbar } from "./use-toolbar.d.ts";
@@ -1,9 +1,9 @@
1
1
  import type { DevToolbarAppState } from "../../types/index.d.ts";
2
2
  /**
3
- * Hook for app management - exposes context app methods directly
3
+ * Exposes app management methods from the toolbar context.
4
4
  */
5
- export declare const useApps: () => {
6
- activeAppId: string | null;
5
+ declare const useApps: () => {
6
+ activeAppId: string | undefined;
7
7
  apps: DevToolbarAppState[];
8
8
  clearNotification: (appId: string) => void;
9
9
  registerApp: (app: DevToolbarAppState) => void;
@@ -11,3 +11,5 @@ export declare const useApps: () => {
11
11
  toggleApp: (appId: string) => Promise<void>;
12
12
  unregisterApp: (appId: string) => void;
13
13
  };
14
+ export { useApps };
15
+ export default useApps;
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * Keyboard shortcut bindings
3
3
  */
4
- export interface KeyBindings {
5
- /** Toggle toolbar panel open/closed */
6
- toggle: string;
4
+ interface KeyBindings {
7
5
  /** Close active app / panel */
8
6
  close: string;
7
+ /** Toggle toolbar panel open/closed */
8
+ toggle: string;
9
9
  }
10
- export declare const DEFAULT_KEYBINDINGS: KeyBindings;
10
+ declare const DEFAULT_KEYBINDINGS: KeyBindings;
11
11
  /**
12
- * Frame state interface
12
+ * Persistent state for the devtools panel frame.
13
13
  */
14
- export interface DevToolsFrameState {
14
+ interface DevToolsFrameState {
15
15
  /**
16
16
  * Close panel on outside click
17
17
  */
@@ -20,14 +20,14 @@ export interface DevToolsFrameState {
20
20
  * Panel height as viewport height percentage
21
21
  */
22
22
  height: number;
23
- /**
24
- * Whether DevTools panel is open in a Picture-in-Picture window
25
- */
26
- isPip: boolean;
27
23
  /**
28
24
  * Whether this is the first visit (used to show onboarding hint)
29
25
  */
30
26
  isFirstVisit: boolean;
27
+ /**
28
+ * Whether DevTools panel is open in a Picture-in-Picture window
29
+ */
30
+ isPip: boolean;
31
31
  /**
32
32
  * Keyboard shortcut bindings
33
33
  */
@@ -74,21 +74,27 @@ export interface DevToolsFrameState {
74
74
  width: number;
75
75
  }
76
76
  /**
77
- * Return type for useFrameState hook
77
+ * Default frame state - matches Vue DevTools exactly
78
+ */
79
+ declare const DEFAULT_STATE: DevToolsFrameState;
80
+ /**
81
+ * Return type for the useFrameState hook.
78
82
  */
79
- export interface UseFrameStateReturn {
83
+ interface UseFrameStateReturn {
80
84
  /**
81
- * Current frame state
85
+ * Current frame state.
82
86
  */
83
87
  state: DevToolsFrameState;
84
88
  /**
85
- * Update state with partial values
89
+ * Updates state with partial values.
86
90
  */
87
91
  updateState: (value: Partial<DevToolsFrameState>) => void;
88
92
  }
89
93
  /**
90
- * Hook for frame state management.
94
+ * Manages the shared devtools frame state.
91
95
  * All callers share the same module-level state so position, open, and other
92
96
  * fields stay in sync regardless of how many times the hook is called.
93
97
  */
94
- export declare const useFrameState: () => UseFrameStateReturn;
98
+ declare const useFrameState: () => UseFrameStateReturn;
99
+ export type { DevToolsFrameState, KeyBindings, UseFrameStateReturn };
100
+ export { DEFAULT_KEYBINDINGS, DEFAULT_STATE, useFrameState };
@@ -1,21 +1,23 @@
1
1
  /**
2
- * Return type for usePanelVisible hook
2
+ * Return type for the usePanelVisible hook.
3
3
  */
4
- export interface UsePanelVisibleReturn {
4
+ interface UsePanelVisibleReturn {
5
5
  /**
6
- * Close panel
6
+ * Closes the panel.
7
7
  */
8
8
  closePanel: () => void;
9
9
  /**
10
- * Whether panel is visible
10
+ * Whether the panel is currently visible.
11
11
  */
12
12
  panelVisible: boolean;
13
13
  /**
14
- * Toggle panel visibility
14
+ * Toggles panel visibility, optionally forcing a specific state.
15
15
  */
16
16
  togglePanelVisible: (_?: unknown, newState?: boolean) => void;
17
17
  }
18
18
  /**
19
- * Hook for panel visibility management - converted from Vue DevTools usePanelVisible
19
+ * Manages panel visibility with keyboard shortcut support.
20
20
  */
21
- export declare const usePanelVisible: () => UsePanelVisibleReturn;
21
+ declare const usePanelVisible: () => UsePanelVisibleReturn;
22
+ export type { UsePanelVisibleReturn };
23
+ export { usePanelVisible };
@@ -1,8 +1,8 @@
1
1
  import type { RefObject } from "preact";
2
2
  /**
3
- * Return type for usePosition hook
3
+ * Return type for usePosition hook.
4
4
  */
5
- export interface UsePositionReturn {
5
+ interface UsePositionReturn {
6
6
  anchorStyle: {
7
7
  left: string;
8
8
  top: string;
@@ -12,11 +12,13 @@ export interface UsePositionReturn {
12
12
  isDragging: boolean;
13
13
  isHidden: boolean;
14
14
  isVertical: boolean;
15
- onPointerDown: (e: PointerEvent) => void;
15
+ onPointerDown: (event: PointerEvent) => void;
16
16
  panelStyle: Record<string, string>;
17
17
  }
18
18
  /**
19
- * Hook for position management - converted from Vue DevTools usePosition
19
+ * Manages the draggable toolbar position, converted from Vue DevTools usePosition.
20
20
  * @see https://github.com/vuejs/devtools/blob/main/packages/overlay/src/composables/position.ts
21
21
  */
22
- export declare const usePosition: (panelEl: RefObject<HTMLElement>) => UsePositionReturn;
22
+ declare const usePosition: (panelElement: RefObject<HTMLElement>) => UsePositionReturn;
23
+ export type { UsePositionReturn };
24
+ export { usePosition };
@@ -1,13 +1,15 @@
1
- export type Theme = "light" | "dark" | "system";
2
- export interface UseThemeReturn {
1
+ type Theme = "light" | "dark" | "system";
2
+ interface UseThemeReturn {
3
3
  resolvedTheme: "light" | "dark";
4
4
  setTheme: (newTheme: Theme) => void;
5
5
  theme: Theme;
6
6
  toggleTheme: () => void;
7
7
  }
8
8
  /**
9
- * Hook for managing theme (light/dark mode).
9
+ * Manages the shared light/dark/system theme preference.
10
10
  * All callers share the same module-level state so theme changes propagate
11
11
  * to every component (ToolbarContainer, SettingsApp, etc.) immediately.
12
12
  */
13
- export declare const useTheme: () => UseThemeReturn;
13
+ declare const useTheme: () => UseThemeReturn;
14
+ export type { Theme, UseThemeReturn };
15
+ export { useTheme };
@@ -1,8 +1,8 @@
1
1
  import type { ToolbarPlacement } from "../../types/index.d.ts";
2
2
  /**
3
- * Hook for toolbar visibility and placement - exposes context methods directly
3
+ * Exposes toolbar visibility and placement controls from the toolbar context.
4
4
  */
5
- export declare const useToolbar: () => {
5
+ declare const useToolbar: () => {
6
6
  hide: () => void;
7
7
  isDragging: boolean;
8
8
  isVisible: boolean;
@@ -12,3 +12,5 @@ export declare const useToolbar: () => {
12
12
  show: () => void;
13
13
  toggle: () => void;
14
14
  };
15
+ export { useToolbar };
16
+ export default useToolbar;