@visulima/dev-toolbar 1.0.0-alpha.3 → 1.0.0-alpha.30

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 (172) hide show
  1. package/CHANGELOG.md +266 -0
  2. package/LICENSE.md +137 -5
  3. package/README.md +11 -1
  4. package/bin/mcp.js +29 -0
  5. package/dist/apps/a11y/index.d.ts +3 -2
  6. package/dist/apps/a11y/index.js +3 -3
  7. package/dist/apps/annotations/index.d.ts +4 -0
  8. package/dist/apps/annotations/index.js +18 -0
  9. package/dist/apps/assets/index.d.ts +4 -0
  10. package/dist/apps/assets/index.js +16 -0
  11. package/dist/apps/inspector/index.d.ts +3 -2
  12. package/dist/apps/inspector/index.js +15 -2
  13. package/dist/apps/module-graph/index.d.ts +3 -2
  14. package/dist/apps/module-graph/index.js +2 -2
  15. package/dist/apps/performance/index.d.ts +3 -2
  16. package/dist/apps/performance/index.js +2 -2
  17. package/dist/apps/seo/index.d.ts +3 -2
  18. package/dist/apps/seo/index.js +2 -2
  19. package/dist/apps/settings/index.d.ts +3 -2
  20. package/dist/apps/settings/index.js +2 -2
  21. package/dist/apps/tailwind/index.d.ts +3 -2
  22. package/dist/apps/tailwind/index.js +6 -6
  23. package/dist/apps/timeline/index.d.ts +3 -2
  24. package/dist/apps/timeline/index.js +2 -2
  25. package/dist/apps/vite-config/index.d.ts +3 -2
  26. package/dist/apps/vite-config/index.js +2 -2
  27. package/dist/client/overlay.d.ts +1 -1
  28. package/dist/client/overlay.js +1 -1
  29. package/dist/index.d.ts +143 -7
  30. package/dist/index.js +1 -1
  31. package/dist/mcp/server.d.ts +2 -0
  32. package/dist/mcp/server.js +1 -0
  33. package/dist/packem_chunks/inject-source.js +9 -1
  34. package/dist/packem_shared/Alert-D2CvX4fw.js +1 -0
  35. package/dist/packem_shared/Badge-BEgU04nl.js +1 -0
  36. package/dist/packem_shared/Button-Bkx66Co7.js +1 -0
  37. package/dist/packem_shared/Card-CJa4vHVc.js +1 -0
  38. package/dist/packem_shared/Icon-B6UHkC0o.js +1 -0
  39. package/dist/packem_shared/Input-Cs6aduTi.js +1 -0
  40. package/dist/packem_shared/Label-DyCng4Cp.js +1 -0
  41. package/dist/packem_shared/Popover-BtFVaZYg.js +1 -0
  42. package/dist/packem_shared/Progress-DN6zn-0l.js +1 -0
  43. package/dist/packem_shared/Select-DgQ4ss-s.js +1 -0
  44. package/dist/packem_shared/Separator-D38mKeZv.js +1 -0
  45. package/dist/packem_shared/Skeleton-Dv-tcA1P.js +1 -0
  46. package/dist/packem_shared/Switch-C3NTpeoR.js +1 -0
  47. package/dist/packem_shared/Tabs-DKWMiawt.js +1 -0
  48. package/dist/packem_shared/Textarea-Yfg3dLZi.js +1 -0
  49. package/dist/packem_shared/Tooltip-CioncSXj.js +1 -0
  50. package/dist/packem_shared/annotation-settings-Bv0TH4WI.js +1 -0
  51. package/dist/packem_shared/annotation-store-bLQRYMaI.js +1 -0
  52. package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
  53. package/dist/packem_shared/clsx-wGlvpUfw.js +1 -0
  54. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
  55. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
  56. package/dist/packem_shared/createServerRPCContext-D-yZrEjs.js +1 -0
  57. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
  58. package/dist/packem_shared/global-api.d-BLfn-OUA.d.ts +547 -0
  59. package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
  60. package/dist/packem_shared/sharedToolbarStylesheet-pA-B0Jt2.js +2 -0
  61. package/dist/packem_shared/store-DaUtLjf3.js +1 -0
  62. package/dist/packem_shared/use-frame-state-CxrlPUM5.js +1 -0
  63. package/dist/packem_shared/use-theme-zpm4zmqP.js +1 -0
  64. package/dist/toolbar/index.d.ts +152 -55
  65. package/dist/toolbar/index.js +3 -3
  66. package/dist/ui/index.d.ts +382 -17
  67. package/dist/ui/index.js +1 -1
  68. package/dist/vite-plugin.d.ts +155 -141
  69. package/dist/vite-plugin.js +5 -2
  70. package/package.json +39 -19
  71. package/dist/apps/a11y/a11y-app.d.ts +0 -5
  72. package/dist/apps/a11y/a11y-store.d.ts +0 -46
  73. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
  74. package/dist/apps/inspector/inspector-app.d.ts +0 -12
  75. package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
  76. package/dist/apps/more/index.d.ts +0 -3
  77. package/dist/apps/more/index.js +0 -19
  78. package/dist/apps/more/more-app.d.ts +0 -5
  79. package/dist/apps/performance/performance-app.d.ts +0 -5
  80. package/dist/apps/performance/performance-tooltip.d.ts +0 -5
  81. package/dist/apps/seo/seo-app.d.ts +0 -5
  82. package/dist/apps/settings/settings-app.d.ts +0 -4
  83. package/dist/apps/tailwind/tailwind-app.d.ts +0 -5
  84. package/dist/apps/timeline/timeline-app.d.ts +0 -5
  85. package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
  86. package/dist/hooks/create-hook.d.ts +0 -10
  87. package/dist/hooks/events.d.ts +0 -5
  88. package/dist/hooks/global-hook.d.ts +0 -15
  89. package/dist/hooks/index.d.ts +0 -6
  90. package/dist/packem_shared/Alert-H-x1JuZ0.js +0 -1
  91. package/dist/packem_shared/Badge-C30mDKKG.js +0 -1
  92. package/dist/packem_shared/Button-DODNCTPZ.js +0 -1
  93. package/dist/packem_shared/Card-DdI7Wn3t.js +0 -1
  94. package/dist/packem_shared/Icon-DWFLZkwW.js +0 -1
  95. package/dist/packem_shared/Input-GfbOwAkK.js +0 -1
  96. package/dist/packem_shared/Label-Bzi47aUf.js +0 -1
  97. package/dist/packem_shared/Popover-o3Vkvndp.js +0 -1
  98. package/dist/packem_shared/Progress-vGfFpxRn.js +0 -1
  99. package/dist/packem_shared/Separator-DQGeJPQg.js +0 -1
  100. package/dist/packem_shared/Skeleton-BYXau6jM.js +0 -1
  101. package/dist/packem_shared/Switch-BeC78S_T.js +0 -1
  102. package/dist/packem_shared/Tabs-BBc4S-2T.js +0 -1
  103. package/dist/packem_shared/Textarea-DvbSX13V.js +0 -1
  104. package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
  105. package/dist/packem_shared/Tooltip-BwK-2I9P.js +0 -1
  106. package/dist/packem_shared/cn-DWLJYh3h.js +0 -1
  107. package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
  108. package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
  109. package/dist/packem_shared/createServerRPCContext-CRd6VAWp.js +0 -1
  110. package/dist/packem_shared/sharedToolbarStylesheet-DHHoFz2-.js +0 -2
  111. package/dist/packem_shared/store-BxE0w51s.js +0 -1
  112. package/dist/packem_shared/use-theme-CX1gG6Sv.js +0 -1
  113. package/dist/performance/monitor.d.ts +0 -115
  114. package/dist/rpc/client.d.ts +0 -7
  115. package/dist/rpc/functions/module-graph.d.ts +0 -17
  116. package/dist/rpc/functions/open-in-editor.d.ts +0 -14
  117. package/dist/rpc/functions/tailwind-config.d.ts +0 -12
  118. package/dist/rpc/functions/vite-config.d.ts +0 -7
  119. package/dist/rpc/server.d.ts +0 -12
  120. package/dist/timeline/capture.d.ts +0 -6
  121. package/dist/timeline/index.d.ts +0 -7
  122. package/dist/timeline/store.d.ts +0 -52
  123. package/dist/toolbar/app-manager.d.ts +0 -102
  124. package/dist/toolbar/components/app-button.d.ts +0 -19
  125. package/dist/toolbar/components/app-canvas.d.ts +0 -12
  126. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
  127. package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
  128. package/dist/toolbar/components/index.d.ts +0 -4
  129. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
  130. package/dist/toolbar/components/toolbar-bar.d.ts +0 -14
  131. package/dist/toolbar/components/toolbar-container.d.ts +0 -55
  132. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
  133. package/dist/toolbar/context/index.d.ts +0 -2
  134. package/dist/toolbar/context/toolbar-context.d.ts +0 -106
  135. package/dist/toolbar/global-api.d.ts +0 -24
  136. package/dist/toolbar/helpers.d.ts +0 -6
  137. package/dist/toolbar/hooks/index.d.ts +0 -10
  138. package/dist/toolbar/hooks/use-apps.d.ts +0 -13
  139. package/dist/toolbar/hooks/use-frame-state.d.ts +0 -94
  140. package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -21
  141. package/dist/toolbar/hooks/use-position.d.ts +0 -22
  142. package/dist/toolbar/hooks/use-theme.d.ts +0 -13
  143. package/dist/toolbar/hooks/use-toolbar.d.ts +0 -14
  144. package/dist/toolbar/settings.d.ts +0 -17
  145. package/dist/toolbar/stylesheet.d.ts +0 -1
  146. package/dist/toolbar/utils/index.d.ts +0 -12
  147. package/dist/types/app.d.ts +0 -175
  148. package/dist/types/global-api.d.ts +0 -102
  149. package/dist/types/hooks.d.ts +0 -88
  150. package/dist/types/index.d.ts +0 -12
  151. package/dist/types/messaging.d.ts +0 -43
  152. package/dist/types/rpc.d.ts +0 -100
  153. package/dist/types/timeline.d.ts +0 -62
  154. package/dist/types/toolbar.d.ts +0 -56
  155. package/dist/ui/components/alert.d.ts +0 -20
  156. package/dist/ui/components/badge.d.ts +0 -10
  157. package/dist/ui/components/button.d.ts +0 -12
  158. package/dist/ui/components/card.d.ts +0 -17
  159. package/dist/ui/components/icon.d.ts +0 -21
  160. package/dist/ui/components/input.d.ts +0 -8
  161. package/dist/ui/components/label.d.ts +0 -8
  162. package/dist/ui/components/popover.d.ts +0 -27
  163. package/dist/ui/components/progress.d.ts +0 -8
  164. package/dist/ui/components/separator.d.ts +0 -9
  165. package/dist/ui/components/skeleton.d.ts +0 -7
  166. package/dist/ui/components/switch.d.ts +0 -12
  167. package/dist/ui/components/tabs.d.ts +0 -29
  168. package/dist/ui/components/textarea.d.ts +0 -8
  169. package/dist/ui/components/tooltip.d.ts +0 -19
  170. package/dist/utils/cn.d.ts +0 -8
  171. package/dist/vite/inject-source.d.ts +0 -25
  172. package/dist/vite/matcher.d.ts +0 -5
@@ -1,102 +0,0 @@
1
- import type { DevToolbarApp, DevToolbarAppState } from "../types/app.d.ts";
2
- /**
3
- * App manager for handling app lifecycle
4
- */
5
- export declare class AppManager {
6
- private apps;
7
- private activeAppId;
8
- private initializedApps;
9
- private appCanvases;
10
- /**
11
- * Register an app
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
- * Unregister an app
18
- * @param appId App ID
19
- */
20
- unregisterApp(appId: string): Promise<void>;
21
- /**
22
- * Get an app by ID
23
- * @param appId App ID
24
- * @returns App state or undefined
25
- */
26
- getApp(appId: string): DevToolbarAppState | undefined;
27
- /**
28
- * Get all apps
29
- * @returns Array of app states
30
- */
31
- getAllApps(): DevToolbarAppState[];
32
- /**
33
- * Get active app
34
- * @returns Active app state or undefined
35
- */
36
- getActiveApp(): DevToolbarAppState | undefined;
37
- /**
38
- * Toggle app active state
39
- * @param appId App ID
40
- * @returns Whether toggle was successful
41
- */
42
- toggleApp(appId: string): Promise<boolean>;
43
- /**
44
- * Directly set active state for an action button without invoking callbacks.
45
- * Use this to deactivate a button from outside the toolbar (e.g. after async work).
46
- * @param appId App ID
47
- * @param active New active state
48
- */
49
- setAppActive(appId: string, active: boolean): void;
50
- /**
51
- * Check if an app has been initialized
52
- * @returns True when the app's init() has already been called
53
- */
54
- isAppInitialized(appId: string): boolean;
55
- /**
56
- * Mark an app as initialized
57
- * @returns void
58
- */
59
- markAppInitialized(appId: string): void;
60
- /**
61
- * Open an app
62
- * @param appId App ID
63
- * @returns Whether open was successful
64
- */
65
- openApp(appId: string): Promise<boolean>;
66
- /**
67
- * Close an app
68
- * @param appId App ID
69
- * @returns Whether close was successful
70
- */
71
- closeApp(appId: string): Promise<boolean>;
72
- /**
73
- * Set app notification
74
- * @param appId App ID
75
- * @param state Notification state
76
- * @param level Notification level
77
- */
78
- setNotification(appId: string, state: boolean, level?: "info" | "warning" | "error"): void;
79
- /**
80
- * Clear app notification
81
- * @param appId App ID
82
- */
83
- clearNotification(appId: string): void;
84
- /**
85
- * Get app canvas element
86
- * @param appId App ID
87
- * @returns Canvas element with shadow root or null
88
- */
89
- getAppCanvas(appId: string): {
90
- element: HTMLElement;
91
- shadowRoot: ShadowRoot;
92
- } | null;
93
- /**
94
- * Set app canvas element (called by toolbar component)
95
- * @param appId App ID
96
- * @param canvas Canvas with shadow root
97
- */
98
- setAppCanvas(appId: string, canvas: {
99
- element: HTMLElement;
100
- shadowRoot: ShadowRoot;
101
- }): void;
102
- }
@@ -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 | null;
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 | null;
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,106 +0,0 @@
1
- import { createContext } from "preact";
2
- import type { DevToolbarAppState, ToolbarPlacement } from "../../types/index.d.ts";
3
- /**
4
- * A tooltip that has been pinned by the user — stays visible until unpinned.
5
- */
6
- export interface PinnedTooltip {
7
- /** The app whose tooltip is shown */
8
- app: DevToolbarAppState;
9
- /** Unique instance identifier (appId + timestamp) */
10
- id: string;
11
- /** Initial left position (viewport px) */
12
- initialX: number;
13
- /** Initial top position (viewport px) */
14
- initialY: number;
15
- }
16
- /**
17
- * Toolbar context state
18
- */
19
- export interface ToolbarContextState {
20
- /**
21
- * Currently active app ID
22
- */
23
- activeAppId: string | null;
24
- /**
25
- * All registered apps
26
- */
27
- apps: DevToolbarAppState[];
28
- /**
29
- * Clear app notification
30
- */
31
- clearNotification: (appId: string) => void;
32
- /**
33
- * Currently hovered app (has a tooltip component)
34
- */
35
- hoveredApp: DevToolbarAppState | null;
36
- /**
37
- * Viewport rect of the hovered app button (for tooltip positioning)
38
- */
39
- hoveredAppRect: DOMRect | null;
40
- /**
41
- * Whether toolbar is being dragged
42
- */
43
- isDragging: boolean;
44
- /**
45
- * Whether toolbar is visible
46
- */
47
- isVisible: boolean;
48
- /**
49
- * Currently pinned tooltip cards
50
- */
51
- pinnedTooltips: PinnedTooltip[];
52
- /**
53
- * Pin a tooltip at the given viewport position.
54
- * Multiple pins from the same app are allowed (each gets a unique id).
55
- */
56
- pinTooltip: (app: DevToolbarAppState, x: number, y: number) => void;
57
- /**
58
- * Toolbar placement on screen
59
- */
60
- placement: ToolbarPlacement;
61
- /**
62
- * Register an app
63
- */
64
- registerApp: (app: DevToolbarAppState) => void;
65
- /**
66
- * Set dragging state
67
- */
68
- setDragging: (dragging: boolean) => void;
69
- /**
70
- * Set/clear the hovered app. Pass null to start the leave debounce.
71
- */
72
- setHoveredApp: (app: DevToolbarAppState | null, rect?: DOMRect | null) => void;
73
- /**
74
- * Set app notification
75
- */
76
- setNotification: (appId: string, state: boolean, level?: "info" | "warning" | "error") => void;
77
- /**
78
- * Set toolbar placement
79
- */
80
- setPlacement: (placement: ToolbarPlacement) => void;
81
- /**
82
- * Set toolbar visibility
83
- */
84
- setVisible: (visible: boolean) => void;
85
- /**
86
- * Toggle an app
87
- */
88
- toggleApp: (appId: string) => Promise<void>;
89
- /**
90
- * Remove a pinned tooltip by its instance id.
91
- */
92
- unpinTooltip: (id: string) => void;
93
- /**
94
- * Unregister an app
95
- */
96
- unregisterApp: (appId: string) => void;
97
- }
98
- /**
99
- * Toolbar context
100
- */
101
- export declare const ToolbarContext: ReturnType<typeof createContext<ToolbarContextState | null>>;
102
- /**
103
- * Hook to access toolbar context
104
- * @throws Error if used outside ToolbarContext provider
105
- */
106
- 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
- * 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
- * Setup global API on window object
22
- * @param api API instance
23
- */
24
- export declare const setupGlobalAPI: (api: VisulimaDevTools) => void;
@@ -1,6 +0,0 @@
1
- import type { ServerHelpers } from "../types/app.d.ts";
2
- /**
3
- * Create server helpers for apps
4
- * @returns Server helpers instance
5
- */
6
- export declare const createServerHelpers: () => ServerHelpers;
@@ -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,13 +0,0 @@
1
- import type { DevToolbarAppState } from "../../types/index.d.ts";
2
- /**
3
- * Hook for app management - exposes context app methods directly
4
- */
5
- export declare const useApps: () => {
6
- activeAppId: string | null;
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
- };
@@ -1,94 +0,0 @@
1
- /**
2
- * Keyboard shortcut bindings
3
- */
4
- export interface KeyBindings {
5
- /** Close active app / panel */
6
- close: string;
7
- /** Toggle toolbar panel open/closed */
8
- toggle: string;
9
- }
10
- export declare const DEFAULT_KEYBINDINGS: KeyBindings;
11
- /**
12
- * Frame state interface
13
- */
14
- export 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
- * Return type for useFrameState hook
78
- */
79
- export interface UseFrameStateReturn {
80
- /**
81
- * Current frame state
82
- */
83
- state: DevToolsFrameState;
84
- /**
85
- * Update state with partial values
86
- */
87
- updateState: (value: Partial<DevToolsFrameState>) => void;
88
- }
89
- /**
90
- * Hook for frame state management.
91
- * All callers share the same module-level state so position, open, and other
92
- * fields stay in sync regardless of how many times the hook is called.
93
- */
94
- export declare const useFrameState: () => UseFrameStateReturn;
@@ -1,21 +0,0 @@
1
- /**
2
- * Return type for usePanelVisible hook
3
- */
4
- export interface UsePanelVisibleReturn {
5
- /**
6
- * Close panel
7
- */
8
- closePanel: () => void;
9
- /**
10
- * Whether panel is visible
11
- */
12
- panelVisible: boolean;
13
- /**
14
- * Toggle panel visibility
15
- */
16
- togglePanelVisible: (_?: unknown, newState?: boolean) => void;
17
- }
18
- /**
19
- * Hook for panel visibility management - converted from Vue DevTools usePanelVisible
20
- */
21
- export declare const usePanelVisible: () => UsePanelVisibleReturn;
@@ -1,22 +0,0 @@
1
- import type { RefObject } from "preact";
2
- /**
3
- * Return type for usePosition hook
4
- */
5
- export 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: (e: PointerEvent) => void;
16
- panelStyle: Record<string, string>;
17
- }
18
- /**
19
- * Hook for position management - converted from Vue DevTools usePosition
20
- * @see https://github.com/vuejs/devtools/blob/main/packages/overlay/src/composables/position.ts
21
- */
22
- export declare const usePosition: (panelElement: RefObject<HTMLElement>) => UsePositionReturn;
@@ -1,13 +0,0 @@
1
- export type Theme = "light" | "dark" | "system";
2
- export interface UseThemeReturn {
3
- resolvedTheme: "light" | "dark";
4
- setTheme: (newTheme: Theme) => void;
5
- theme: Theme;
6
- toggleTheme: () => void;
7
- }
8
- /**
9
- * Hook for managing theme (light/dark mode).
10
- * All callers share the same module-level state so theme changes propagate
11
- * to every component (ToolbarContainer, SettingsApp, etc.) immediately.
12
- */
13
- export declare const useTheme: () => UseThemeReturn;
@@ -1,14 +0,0 @@
1
- import type { ToolbarPlacement } from "../../types/index.d.ts";
2
- /**
3
- * Hook for toolbar visibility and placement - exposes context methods directly
4
- */
5
- export 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
- };
@@ -1,17 +0,0 @@
1
- import type { ToolbarSettings } from "../types/toolbar.d.ts";
2
- /**
3
- * Load settings from localStorage
4
- * @returns Toolbar settings
5
- */
6
- export declare const loadSettings: () => ToolbarSettings;
7
- /**
8
- * Save settings to localStorage
9
- * @param settings Toolbar settings to save
10
- */
11
- export declare const saveSettings: (settings: ToolbarSettings) => void;
12
- /**
13
- * Update settings (merge with existing)
14
- * @param updates Partial settings to update
15
- * @returns Updated settings
16
- */
17
- export declare const updateSettings: (updates: Partial<ToolbarSettings>) => ToolbarSettings;
@@ -1 +0,0 @@
1
- export declare const sharedToolbarStylesheet: CSSStyleSheet | undefined;
@@ -1,12 +0,0 @@
1
- /**
2
- * Clamp a value between min and max
3
- */
4
- export declare const clamp: (value: number, min: number, max: number) => number;
5
- /**
6
- * Check if browser is Safari
7
- */
8
- export declare const checkIsSafari: () => boolean;
9
- /**
10
- * Convert pixel value to number (handles "10px" -> 10)
11
- */
12
- export declare const pixelToNumber: (value: string | number) => number;