@visulima/dev-toolbar 1.0.0-alpha.12 → 1.0.0-alpha.14

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 +14 -0
  2. package/LICENSE.md +21 -0
  3. package/dist/apps/a11y/index.d.ts +3 -2
  4. package/dist/apps/a11y/index.js +1 -1
  5. package/dist/apps/annotations/index.d.ts +3 -2
  6. package/dist/apps/annotations/index.js +1 -1
  7. package/dist/apps/assets/index.d.ts +3 -2
  8. package/dist/apps/assets/index.js +1 -1
  9. package/dist/apps/inspector/index.d.ts +3 -2
  10. package/dist/apps/inspector/index.js +1 -1
  11. package/dist/apps/module-graph/index.d.ts +3 -2
  12. package/dist/apps/module-graph/index.js +1 -1
  13. package/dist/apps/performance/index.d.ts +3 -2
  14. package/dist/apps/performance/index.js +1 -1
  15. package/dist/apps/seo/index.d.ts +3 -2
  16. package/dist/apps/seo/index.js +1 -1
  17. package/dist/apps/settings/index.d.ts +3 -2
  18. package/dist/apps/settings/index.js +1 -1
  19. package/dist/apps/tailwind/index.d.ts +3 -2
  20. package/dist/apps/timeline/index.d.ts +3 -2
  21. package/dist/apps/timeline/index.js +1 -1
  22. package/dist/apps/vite-config/index.d.ts +3 -2
  23. package/dist/apps/vite-config/index.js +1 -1
  24. package/dist/client/overlay.d.ts +1 -1
  25. package/dist/index.d.ts +143 -8
  26. package/dist/mcp/server.d.ts +2 -12
  27. package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
  28. package/dist/packem_shared/global-api.d-BLfn-OUA.d.ts +547 -0
  29. package/dist/packem_shared/{sharedToolbarStylesheet-CaTdYhVe.js → sharedToolbarStylesheet-Bx1muJAh.js} +1 -1
  30. package/dist/toolbar/index.d.ts +152 -48
  31. package/dist/toolbar/index.js +1 -1
  32. package/dist/ui/index.d.ts +382 -18
  33. package/dist/vite-plugin.d.ts +155 -146
  34. package/package.json +4 -4
  35. package/dist/apps/a11y/a11y-app.d.ts +0 -4
  36. package/dist/apps/a11y/a11y-store.d.ts +0 -42
  37. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -10
  38. package/dist/apps/annotations/annotations-app.d.ts +0 -4
  39. package/dist/apps/assets/assets-app.d.ts +0 -4
  40. package/dist/apps/inspector/a11y-capture.d.ts +0 -12
  41. package/dist/apps/inspector/annotation-overlay.d.ts +0 -55
  42. package/dist/apps/inspector/annotation-settings.d.ts +0 -33
  43. package/dist/apps/inspector/element-utils.d.ts +0 -115
  44. package/dist/apps/inspector/freeze-animations.d.ts +0 -22
  45. package/dist/apps/inspector/inspector-app.d.ts +0 -14
  46. package/dist/apps/inspector/rulers.d.ts +0 -14
  47. package/dist/apps/inspector/theme-palette.d.ts +0 -34
  48. package/dist/apps/module-graph/module-graph-app.d.ts +0 -4
  49. package/dist/apps/performance/performance-app.d.ts +0 -4
  50. package/dist/apps/performance/performance-tooltip.d.ts +0 -4
  51. package/dist/apps/seo/seo-app.d.ts +0 -4
  52. package/dist/apps/settings/settings-app.d.ts +0 -4
  53. package/dist/apps/tailwind/tailwind-app.d.ts +0 -4
  54. package/dist/apps/timeline/timeline-app.d.ts +0 -4
  55. package/dist/apps/vite-config/vite-config-app.d.ts +0 -4
  56. package/dist/hooks/create-hook.d.ts +0 -12
  57. package/dist/hooks/events.d.ts +0 -7
  58. package/dist/hooks/global-hook.d.ts +0 -15
  59. package/dist/hooks/index.d.ts +0 -6
  60. package/dist/performance/monitor.d.ts +0 -116
  61. package/dist/rpc/client.d.ts +0 -9
  62. package/dist/rpc/functions/annotations.d.ts +0 -28
  63. package/dist/rpc/functions/assets.d.ts +0 -16
  64. package/dist/rpc/functions/module-graph.d.ts +0 -17
  65. package/dist/rpc/functions/open-in-editor.d.ts +0 -16
  66. package/dist/rpc/functions/tailwind-config.d.ts +0 -15
  67. package/dist/rpc/functions/vite-config.d.ts +0 -83
  68. package/dist/rpc/server.d.ts +0 -15
  69. package/dist/store/annotation-store.d.ts +0 -41
  70. package/dist/timeline/capture.d.ts +0 -8
  71. package/dist/timeline/index.d.ts +0 -8
  72. package/dist/timeline/store.d.ts +0 -42
  73. package/dist/toolbar/app-manager.d.ts +0 -104
  74. package/dist/toolbar/components/app-button.d.ts +0 -18
  75. package/dist/toolbar/components/app-canvas.d.ts +0 -12
  76. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
  77. package/dist/toolbar/components/first-visit-hint.d.ts +0 -15
  78. package/dist/toolbar/components/index.d.ts +0 -4
  79. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
  80. package/dist/toolbar/components/toolbar-bar.d.ts +0 -9
  81. package/dist/toolbar/components/toolbar-container.d.ts +0 -49
  82. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
  83. package/dist/toolbar/context/index.d.ts +0 -2
  84. package/dist/toolbar/context/toolbar-context.d.ts +0 -107
  85. package/dist/toolbar/global-api.d.ts +0 -24
  86. package/dist/toolbar/helpers.d.ts +0 -8
  87. package/dist/toolbar/hooks/index.d.ts +0 -10
  88. package/dist/toolbar/hooks/use-apps.d.ts +0 -15
  89. package/dist/toolbar/hooks/use-frame-state.d.ts +0 -110
  90. package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -23
  91. package/dist/toolbar/hooks/use-position.d.ts +0 -24
  92. package/dist/toolbar/hooks/use-theme.d.ts +0 -15
  93. package/dist/toolbar/hooks/use-toolbar.d.ts +0 -16
  94. package/dist/toolbar/settings.d.ts +0 -17
  95. package/dist/toolbar/stylesheet.d.ts +0 -3
  96. package/dist/toolbar/utils/index.d.ts +0 -12
  97. package/dist/types/annotations.d.ts +0 -156
  98. package/dist/types/app.d.ts +0 -175
  99. package/dist/types/global-api.d.ts +0 -91
  100. package/dist/types/hooks.d.ts +0 -86
  101. package/dist/types/index.d.ts +0 -13
  102. package/dist/types/messaging.d.ts +0 -43
  103. package/dist/types/rpc.d.ts +0 -137
  104. package/dist/types/timeline.d.ts +0 -62
  105. package/dist/types/toolbar.d.ts +0 -56
  106. package/dist/ui/components/alert.d.ts +0 -19
  107. package/dist/ui/components/badge.d.ts +0 -9
  108. package/dist/ui/components/button.d.ts +0 -11
  109. package/dist/ui/components/card.d.ts +0 -16
  110. package/dist/ui/components/icon.d.ts +0 -19
  111. package/dist/ui/components/input.d.ts +0 -7
  112. package/dist/ui/components/label.d.ts +0 -7
  113. package/dist/ui/components/popover.d.ts +0 -27
  114. package/dist/ui/components/progress.d.ts +0 -7
  115. package/dist/ui/components/select.d.ts +0 -54
  116. package/dist/ui/components/separator.d.ts +0 -8
  117. package/dist/ui/components/skeleton.d.ts +0 -6
  118. package/dist/ui/components/switch.d.ts +0 -11
  119. package/dist/ui/components/tabs.d.ts +0 -28
  120. package/dist/ui/components/textarea.d.ts +0 -7
  121. package/dist/ui/components/tooltip.d.ts +0 -19
  122. package/dist/vite/inject-source.d.ts +0 -24
  123. package/dist/vite/matcher.d.ts +0 -6
@@ -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,18 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- import type { DevToolbarAppState } from "../../types/index.d.ts";
3
- interface AppButtonProps {
4
- /**
5
- * App state
6
- */
7
- app: DevToolbarAppState;
8
- }
9
- /**
10
- * App button component — shown in the toolbar pill.
11
- * When an app declares a `tooltip` component, hovering the button shows a live
12
- * mini-canvas via AppTooltipOverlay (rendered outside overflow:hidden pill).
13
- * @param props Component props
14
- * @param props.app App state
15
- * @returns Rendered button component
16
- */
17
- declare const AppButton: ({ app }: AppButtonProps) => ComponentChildren;
18
- 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,15 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- interface FirstVisitHintProps {
3
- onDismiss: () => void;
4
- position: "bottom" | "left" | "right" | "top";
5
- }
6
- /**
7
- * First-visit hint overlay showing keyboard and interaction tips.
8
- * Appears ~600 ms after mount to let the toolbar pill animate in first.
9
- * @param props Component props
10
- * @param props.onDismiss Called after the dismiss animation completes
11
- * @param props.position Current toolbar position (controls hint placement)
12
- * @returns Rendered hint component
13
- */
14
- declare const FirstVisitHint: ({ onDismiss, position }: FirstVisitHintProps) => ComponentChildren;
15
- 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,9 +0,0 @@
1
- /** @jsxImportSource preact */
2
- import type { ComponentChildren } from "preact";
3
- /**
4
- * Toolbar bar — row of app buttons inside the pill.
5
- * Left/right placement rotates the whole pill 90deg via CSS,
6
- * so this always stays flex-row internally.
7
- */
8
- declare const ToolbarBar: () => ComponentChildren;
9
- export default ToolbarBar;
@@ -1,49 +0,0 @@
1
- import type { ComponentChildren } from "preact";
2
- import type { DevToolbarAppState } from "../../types/index.d.ts";
3
- interface ToolbarContainerProps {
4
- /**
5
- * Active app ID
6
- */
7
- activeAppId: string | undefined;
8
- /**
9
- * Initial apps
10
- */
11
- apps: DevToolbarAppState[];
12
- /**
13
- * Callback when notification should be cleared
14
- */
15
- onClearNotification: (appId: string) => void;
16
- /**
17
- * Callback when app should be registered
18
- */
19
- onRegisterApp: (app: DevToolbarAppState) => void;
20
- /**
21
- * Callback when notification should be set
22
- */
23
- onSetNotification: (appId: string, state: boolean, level?: "error" | "info" | "warning") => void;
24
- /**
25
- * Callback when app should be toggled
26
- */
27
- onToggleApp: (appId: string) => Promise<void>;
28
- /**
29
- * Callback when app should be unregistered
30
- */
31
- onUnregisterApp: (appId: string) => void;
32
- }
33
- /**
34
- * Root toolbar container component — orchestrates the toolbar pill, app panel,
35
- * tooltip overlays, pinned cards, and first-visit hint.
36
- * Manages active app state, hover tooltips, pinned tooltip persistence (localStorage),
37
- * and delegates app lifecycle events to the parent via callbacks.
38
- * @param props Component props
39
- * @param props.activeAppId ID of the currently open app, or null if no app is open
40
- * @param props.apps Initial array of registered app states
41
- * @param props.onClearNotification Called when an app's notification badge should be cleared
42
- * @param props.onRegisterApp Called when a new app is dynamically registered
43
- * @param props.onSetNotification Called when an app requests a notification badge update
44
- * @param props.onToggleApp Called when the user clicks an app button to open/close it
45
- * @param props.onUnregisterApp Called when an app is dynamically unregistered
46
- * @returns Rendered toolbar component tree
47
- */
48
- declare const ToolbarContainer: ({ activeAppId, apps, onClearNotification, onRegisterApp, onSetNotification, onToggleApp, onUnregisterApp, }: ToolbarContainerProps) => ComponentChildren;
49
- 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) => 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,110 +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
- * Preferred editor for "Open in editor" (empty string = auto-detect)
21
- */
22
- editor: string;
23
- /**
24
- * Panel height as viewport height percentage
25
- */
26
- height: number;
27
- /**
28
- * Whether this is the first visit (used to show onboarding hint)
29
- */
30
- isFirstVisit: boolean;
31
- /**
32
- * Whether DevTools panel is open in a Picture-in-Picture window
33
- */
34
- isPip: boolean;
35
- /**
36
- * Keyboard shortcut bindings
37
- */
38
- keybindings: KeyBindings;
39
- /**
40
- * Horizontal position as percentage (0-100)
41
- */
42
- left: number;
43
- /**
44
- * Auto-hide timeout in milliseconds (-1 = never hide, 0 = always hide when inactive)
45
- */
46
- minimizePanelInactive: number;
47
- /**
48
- * Whether panel is open
49
- */
50
- open: boolean;
51
- /**
52
- * Position anchor
53
- */
54
- position: "top" | "bottom" | "left" | "right";
55
- /**
56
- * Prefer showing floating panel
57
- */
58
- preferShowFloatingPanel: boolean;
59
- /**
60
- * Reduce motion for accessibility
61
- */
62
- reduceMotion: boolean;
63
- /**
64
- * Current route
65
- */
66
- route: string;
67
- /**
68
- * Vertical position as percentage (0-100)
69
- */
70
- top: number;
71
- /**
72
- * Panel view mode
73
- */
74
- viewMode: "default" | "fullscreen" | "wide";
75
- /**
76
- * Panel width as viewport width percentage
77
- */
78
- width: number;
79
- }
80
- /**
81
- * Default frame state - matches Vue DevTools exactly
82
- */
83
- declare const DEFAULT_STATE: DevToolsFrameState;
84
- /**
85
- * Return type for the useFrameState hook.
86
- */
87
- interface UseFrameStateReturn {
88
- /**
89
- * Current frame state.
90
- */
91
- state: DevToolsFrameState;
92
- /**
93
- * Updates state with partial values.
94
- */
95
- updateState: (value: Partial<DevToolsFrameState>) => void;
96
- }
97
- /**
98
- * Manages the shared devtools frame state.
99
- * All callers share the same module-level state so position, open, and other
100
- * fields stay in sync regardless of how many times the hook is called.
101
- */
102
- declare const useFrameState: () => UseFrameStateReturn;
103
- /**
104
- * Returns the currently selected editor preference (empty string = auto-detect).
105
- * Reads from the singleton shared state, so always reflects the latest value
106
- * without re-reading localStorage.
107
- */
108
- declare const getEditorPreference: () => string | undefined;
109
- export type { DevToolsFrameState, KeyBindings, UseFrameStateReturn };
110
- export { DEFAULT_KEYBINDINGS, DEFAULT_STATE, getEditorPreference, 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 };
@@ -1,16 +0,0 @@
1
- import type { ToolbarPlacement } from "../../types/index.d.ts";
2
- /**
3
- * Exposes toolbar visibility and placement controls from the toolbar context.
4
- */
5
- declare const useToolbar: () => {
6
- hide: () => void;
7
- isDragging: boolean;
8
- isVisible: boolean;
9
- placement: ToolbarPlacement;
10
- setDragging: (dragging: boolean) => void;
11
- setPlacement: (placement: ToolbarPlacement) => void;
12
- show: () => void;
13
- toggle: () => void;
14
- };
15
- export { useToolbar };
16
- export default useToolbar;
@@ -1,17 +0,0 @@
1
- import type { ToolbarSettings } from "../types/toolbar.d.ts";
2
- /**
3
- * Loads settings from localStorage, merging with defaults.
4
- * @returns Toolbar settings.
5
- */
6
- export declare const loadSettings: () => ToolbarSettings;
7
- /**
8
- * Saves settings to localStorage.
9
- * @param settings Toolbar settings to save.
10
- */
11
- export declare const saveSettings: (settings: ToolbarSettings) => void;
12
- /**
13
- * Merges partial updates into the current settings and persists them.
14
- * @param updates Partial settings to update.
15
- * @returns Updated settings.
16
- */
17
- export declare const updateSettings: (updates: Partial<ToolbarSettings>) => ToolbarSettings;
@@ -1,3 +0,0 @@
1
- declare const sharedToolbarStylesheet: CSSStyleSheet | undefined;
2
- export { sharedToolbarStylesheet };
3
- export default sharedToolbarStylesheet;