@visulima/dev-toolbar 1.0.0-alpha.1 → 1.0.0-alpha.11
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.
- package/CHANGELOG.md +224 -0
- package/LICENSE.md +116 -5
- package/README.md +70 -43
- package/bin/mcp.js +29 -0
- package/dist/apps/a11y/a11y-app.d.ts +0 -1
- package/dist/apps/a11y/a11y-store.d.ts +12 -16
- package/dist/apps/a11y/a11y-tooltip.d.ts +1 -2
- package/dist/apps/a11y/index.js +3 -3
- package/dist/apps/annotations/annotations-app.d.ts +4 -0
- package/dist/apps/annotations/index.d.ts +3 -0
- package/dist/apps/annotations/index.js +18 -0
- package/dist/apps/assets/assets-app.d.ts +4 -0
- package/dist/apps/assets/index.d.ts +3 -0
- package/dist/apps/assets/index.js +16 -0
- package/dist/apps/inspector/a11y-capture.d.ts +12 -0
- package/dist/apps/inspector/annotation-overlay.d.ts +55 -0
- package/dist/apps/inspector/annotation-settings.d.ts +33 -0
- package/dist/apps/inspector/element-utils.d.ts +115 -0
- package/dist/apps/inspector/freeze-animations.d.ts +22 -0
- package/dist/apps/inspector/index.d.ts +3 -0
- package/dist/apps/inspector/index.js +30 -0
- package/dist/apps/inspector/inspector-app.d.ts +14 -0
- package/dist/apps/inspector/rulers.d.ts +14 -0
- package/dist/apps/inspector/theme-palette.d.ts +34 -0
- package/dist/apps/module-graph/index.js +2 -2
- package/dist/apps/module-graph/module-graph-app.d.ts +0 -1
- package/dist/apps/performance/index.js +2 -2
- package/dist/apps/performance/performance-app.d.ts +0 -1
- package/dist/apps/performance/performance-tooltip.d.ts +0 -1
- package/dist/apps/seo/index.js +2 -2
- package/dist/apps/seo/seo-app.d.ts +0 -1
- package/dist/apps/settings/index.js +2 -2
- package/dist/apps/settings/settings-app.d.ts +0 -1
- package/dist/apps/tailwind/index.d.ts +3 -0
- package/dist/apps/tailwind/index.js +7 -0
- package/dist/apps/tailwind/tailwind-app.d.ts +4 -0
- package/dist/apps/timeline/index.js +2 -2
- package/dist/apps/timeline/timeline-app.d.ts +0 -1
- package/dist/apps/vite-config/index.js +2 -2
- package/dist/apps/vite-config/vite-config-app.d.ts +0 -1
- package/dist/client/overlay.js +1 -1
- package/dist/hooks/create-hook.d.ts +7 -5
- package/dist/hooks/events.d.ts +4 -2
- package/dist/hooks/global-hook.d.ts +6 -6
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/mcp/server.d.ts +12 -0
- package/dist/mcp/server.js +1 -0
- package/dist/packem_chunks/inject-source.js +9 -0
- package/dist/packem_shared/Alert-D2CvX4fw.js +1 -0
- package/dist/packem_shared/Badge-BEgU04nl.js +1 -0
- package/dist/packem_shared/Button-Bkx66Co7.js +1 -0
- package/dist/packem_shared/Card-CJa4vHVc.js +1 -0
- package/dist/packem_shared/Icon-B6UHkC0o.js +1 -0
- package/dist/packem_shared/Input-Cs6aduTi.js +1 -0
- package/dist/packem_shared/Label-DyCng4Cp.js +1 -0
- package/dist/packem_shared/Popover-BtFVaZYg.js +1 -0
- package/dist/packem_shared/Progress-DN6zn-0l.js +1 -0
- package/dist/packem_shared/Select-DgQ4ss-s.js +1 -0
- package/dist/packem_shared/Separator-D38mKeZv.js +1 -0
- package/dist/packem_shared/Skeleton-Dv-tcA1P.js +1 -0
- package/dist/packem_shared/Switch-C3NTpeoR.js +1 -0
- package/dist/packem_shared/Tabs-DKWMiawt.js +1 -0
- package/dist/packem_shared/Textarea-Yfg3dLZi.js +1 -0
- package/dist/packem_shared/Tooltip-CioncSXj.js +1 -0
- package/dist/packem_shared/annotation-settings-Bv0TH4WI.js +1 -0
- package/dist/packem_shared/annotation-store-bLQRYMaI.js +1 -0
- package/dist/packem_shared/clsx-wGlvpUfw.js +1 -0
- package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
- package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
- package/dist/packem_shared/createServerRPCContext-D-yZrEjs.js +1 -0
- package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
- package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
- package/dist/packem_shared/sharedToolbarStylesheet-CaTdYhVe.js +2 -0
- package/dist/packem_shared/store-DaUtLjf3.js +1 -0
- package/dist/packem_shared/use-frame-state-CxrlPUM5.js +1 -0
- package/dist/packem_shared/use-theme-zpm4zmqP.js +1 -0
- package/dist/performance/monitor.d.ts +27 -26
- package/dist/rpc/client.d.ts +6 -4
- package/dist/rpc/functions/annotations.d.ts +28 -0
- package/dist/rpc/functions/assets.d.ts +16 -0
- package/dist/rpc/functions/module-graph.d.ts +2 -2
- package/dist/rpc/functions/open-in-editor.d.ts +13 -6
- package/dist/rpc/functions/tailwind-config.d.ts +15 -0
- package/dist/rpc/functions/vite-config.d.ts +80 -4
- package/dist/rpc/server.d.ts +11 -5
- package/dist/store/annotation-store.d.ts +41 -0
- package/dist/timeline/capture.d.ts +8 -0
- package/dist/timeline/index.d.ts +3 -1
- package/dist/timeline/store.d.ts +12 -22
- package/dist/toolbar/app-manager.d.ts +49 -40
- package/dist/toolbar/components/app-button.d.ts +2 -3
- package/dist/toolbar/components/app-canvas.d.ts +1 -2
- package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -1
- package/dist/toolbar/components/first-visit-hint.d.ts +3 -4
- package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -1
- package/dist/toolbar/components/toolbar-bar.d.ts +1 -7
- package/dist/toolbar/components/toolbar-container.d.ts +2 -8
- package/dist/toolbar/components/vite-overlay-button.d.ts +2 -3
- package/dist/toolbar/context/index.d.ts +1 -1
- package/dist/toolbar/context/toolbar-context.d.ts +43 -42
- package/dist/toolbar/global-api.d.ts +4 -3
- package/dist/toolbar/helpers.d.ts +5 -3
- package/dist/toolbar/hooks/index.d.ts +4 -4
- package/dist/toolbar/hooks/use-apps.d.ts +5 -3
- package/dist/toolbar/hooks/use-frame-state.d.ts +32 -16
- package/dist/toolbar/hooks/use-panel-visible.d.ts +9 -7
- package/dist/toolbar/hooks/use-position.d.ts +7 -5
- package/dist/toolbar/hooks/use-theme.d.ts +6 -4
- package/dist/toolbar/hooks/use-toolbar.d.ts +4 -2
- package/dist/toolbar/index.d.ts +9 -17
- package/dist/toolbar/index.js +3 -4
- package/dist/toolbar/settings.d.ts +7 -7
- package/dist/toolbar/stylesheet.d.ts +3 -1
- package/dist/toolbar/utils/index.d.ts +3 -3
- package/dist/types/annotations.d.ts +156 -0
- package/dist/types/app.d.ts +26 -14
- package/dist/types/global-api.d.ts +27 -31
- package/dist/types/hooks.d.ts +32 -34
- package/dist/types/index.d.ts +1 -0
- package/dist/types/messaging.d.ts +2 -2
- package/dist/types/rpc.d.ts +49 -7
- package/dist/types/timeline.d.ts +3 -3
- package/dist/types/toolbar.d.ts +1 -1
- package/dist/ui/components/alert.d.ts +19 -0
- package/dist/ui/components/badge.d.ts +9 -0
- package/dist/ui/components/button.d.ts +11 -0
- package/dist/ui/components/card.d.ts +16 -0
- package/dist/ui/components/icon.d.ts +5 -7
- package/dist/ui/components/input.d.ts +7 -0
- package/dist/ui/components/label.d.ts +7 -0
- package/dist/ui/components/popover.d.ts +27 -0
- package/dist/ui/components/progress.d.ts +7 -0
- package/dist/ui/components/select.d.ts +54 -0
- package/dist/ui/components/separator.d.ts +8 -0
- package/dist/ui/components/skeleton.d.ts +6 -0
- package/dist/ui/components/switch.d.ts +11 -0
- package/dist/ui/components/tabs.d.ts +28 -0
- package/dist/ui/components/textarea.d.ts +7 -0
- package/dist/ui/components/tooltip.d.ts +19 -0
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.js +1 -0
- package/dist/vite/inject-source.d.ts +24 -0
- package/dist/vite/matcher.d.ts +6 -0
- package/dist/vite-plugin.d.ts +49 -6
- package/dist/vite-plugin.js +5 -2
- package/package.json +51 -12
- package/dist/apps/more/index.d.ts +0 -3
- package/dist/apps/more/index.js +0 -19
- package/dist/apps/more/more-app.d.ts +0 -5
- package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
- package/dist/packem_shared/cn-BEsR6GkP.js +0 -1
- package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
- package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
- package/dist/packem_shared/createServerRPCContext-BVSesPXu.js +0 -1
- package/dist/packem_shared/icon-BUQ92HaT.js +0 -1
- package/dist/packem_shared/store-BxE0w51s.js +0 -1
- package/dist/rpc/index.d.ts +0 -8
- package/dist/utils/cn.d.ts +0 -8
|
@@ -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
|
-
*
|
|
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
|
-
*
|
|
30
|
+
* Clears the notification badge for an app.
|
|
26
31
|
*/
|
|
27
|
-
|
|
32
|
+
clearNotification: (appId: string) => void;
|
|
28
33
|
/**
|
|
29
|
-
*
|
|
34
|
+
* Currently hovered app (has a tooltip component)
|
|
30
35
|
*/
|
|
31
|
-
|
|
36
|
+
hoveredApp: DevToolbarAppState | undefined;
|
|
32
37
|
/**
|
|
33
|
-
*
|
|
38
|
+
* Viewport rect of the hovered app button (for tooltip positioning)
|
|
34
39
|
*/
|
|
35
|
-
|
|
40
|
+
hoveredAppRect: DOMRect | undefined;
|
|
36
41
|
/**
|
|
37
42
|
* Whether toolbar is being dragged
|
|
38
43
|
*/
|
|
39
44
|
isDragging: boolean;
|
|
40
45
|
/**
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
setVisible: (visible: boolean) => void;
|
|
44
|
-
/**
|
|
45
|
-
* Set toolbar placement
|
|
46
|
+
* Whether toolbar is visible
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
+
isVisible: boolean;
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
+
* Currently pinned tooltip cards
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
+
pinnedTooltips: PinnedTooltip[];
|
|
52
53
|
/**
|
|
53
|
-
*
|
|
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
|
-
|
|
57
|
+
pinTooltip: (app: DevToolbarAppState, x: number, y: number) => void;
|
|
56
58
|
/**
|
|
57
|
-
*
|
|
59
|
+
* Toolbar placement on screen
|
|
58
60
|
*/
|
|
59
|
-
|
|
61
|
+
placement: ToolbarPlacement;
|
|
60
62
|
/**
|
|
61
|
-
*
|
|
63
|
+
* Registers an app with the toolbar.
|
|
62
64
|
*/
|
|
63
|
-
|
|
65
|
+
registerApp: (app: DevToolbarAppState) => void;
|
|
64
66
|
/**
|
|
65
|
-
*
|
|
67
|
+
* Sets the dragging state.
|
|
66
68
|
*/
|
|
67
|
-
|
|
69
|
+
setDragging: (dragging: boolean) => void;
|
|
68
70
|
/**
|
|
69
|
-
*
|
|
71
|
+
* Sets or clears the hovered app. Pass undefined to start the leave debounce.
|
|
70
72
|
*/
|
|
71
|
-
|
|
73
|
+
setHoveredApp: (app: DevToolbarAppState | undefined, rect?: DOMRect) => void;
|
|
72
74
|
/**
|
|
73
|
-
*
|
|
75
|
+
* Sets a notification for an app.
|
|
74
76
|
*/
|
|
75
|
-
|
|
77
|
+
setNotification: (appId: string, state: boolean, level?: "info" | "warning" | "error") => void;
|
|
76
78
|
/**
|
|
77
|
-
*
|
|
79
|
+
* Sets the toolbar placement.
|
|
78
80
|
*/
|
|
79
|
-
|
|
81
|
+
setPlacement: (placement: ToolbarPlacement) => void;
|
|
80
82
|
/**
|
|
81
|
-
*
|
|
83
|
+
* Sets toolbar visibility.
|
|
82
84
|
*/
|
|
83
|
-
|
|
85
|
+
setVisible: (visible: boolean) => void;
|
|
84
86
|
/**
|
|
85
|
-
*
|
|
87
|
+
* Toggles an app's active state.
|
|
86
88
|
*/
|
|
87
|
-
|
|
89
|
+
toggleApp: (appId: string) => Promise<void>;
|
|
88
90
|
/**
|
|
89
|
-
*
|
|
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
|
-
|
|
93
|
+
unpinTooltip: (id: string) => void;
|
|
93
94
|
/**
|
|
94
|
-
*
|
|
95
|
+
* Unregisters an app.
|
|
95
96
|
*/
|
|
96
|
-
|
|
97
|
+
unregisterApp: (appId: string) => void;
|
|
97
98
|
}
|
|
98
99
|
/**
|
|
99
|
-
*
|
|
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 |
|
|
102
|
+
export declare const ToolbarContext: ReturnType<typeof createContext<ToolbarContextState | undefined>>;
|
|
102
103
|
/**
|
|
103
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
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 {
|
|
3
|
+
export { useFrameState } from "./use-frame-state.d.ts";
|
|
5
4
|
export type { UsePanelVisibleReturn } from "./use-panel-visible.d.ts";
|
|
6
|
-
export {
|
|
5
|
+
export { usePanelVisible } from "./use-panel-visible.d.ts";
|
|
7
6
|
export type { UsePositionReturn } from "./use-position.d.ts";
|
|
8
|
-
export {
|
|
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
|
-
*
|
|
3
|
+
* Exposes app management methods from the toolbar context.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
activeAppId: string |
|
|
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,33 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Keyboard shortcut bindings
|
|
3
3
|
*/
|
|
4
|
-
|
|
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
|
-
|
|
10
|
+
declare const DEFAULT_KEYBINDINGS: KeyBindings;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Persistent state for the devtools panel frame.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
interface DevToolsFrameState {
|
|
15
15
|
/**
|
|
16
16
|
* Close panel on outside click
|
|
17
17
|
*/
|
|
18
18
|
closeOnOutsideClick: boolean;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Preferred editor for "Open in editor" (empty string = auto-detect)
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
editor: string;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Panel height as viewport height percentage
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
height: number;
|
|
27
27
|
/**
|
|
28
28
|
* Whether this is the first visit (used to show onboarding hint)
|
|
29
29
|
*/
|
|
30
30
|
isFirstVisit: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether DevTools panel is open in a Picture-in-Picture window
|
|
33
|
+
*/
|
|
34
|
+
isPip: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* Keyboard shortcut bindings
|
|
33
37
|
*/
|
|
@@ -74,21 +78,33 @@ export interface DevToolsFrameState {
|
|
|
74
78
|
width: number;
|
|
75
79
|
}
|
|
76
80
|
/**
|
|
77
|
-
*
|
|
81
|
+
* Default frame state - matches Vue DevTools exactly
|
|
78
82
|
*/
|
|
79
|
-
|
|
83
|
+
declare const DEFAULT_STATE: DevToolsFrameState;
|
|
84
|
+
/**
|
|
85
|
+
* Return type for the useFrameState hook.
|
|
86
|
+
*/
|
|
87
|
+
interface UseFrameStateReturn {
|
|
80
88
|
/**
|
|
81
|
-
* Current frame state
|
|
89
|
+
* Current frame state.
|
|
82
90
|
*/
|
|
83
91
|
state: DevToolsFrameState;
|
|
84
92
|
/**
|
|
85
|
-
*
|
|
93
|
+
* Updates state with partial values.
|
|
86
94
|
*/
|
|
87
95
|
updateState: (value: Partial<DevToolsFrameState>) => void;
|
|
88
96
|
}
|
|
89
97
|
/**
|
|
90
|
-
*
|
|
98
|
+
* Manages the shared devtools frame state.
|
|
91
99
|
* All callers share the same module-level state so position, open, and other
|
|
92
100
|
* fields stay in sync regardless of how many times the hook is called.
|
|
93
101
|
*/
|
|
94
|
-
|
|
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,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Return type for usePanelVisible hook
|
|
2
|
+
* Return type for the usePanelVisible hook.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
interface UsePanelVisibleReturn {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
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
|
-
*
|
|
14
|
+
* Toggles panel visibility, optionally forcing a specific state.
|
|
15
15
|
*/
|
|
16
16
|
togglePanelVisible: (_?: unknown, newState?: boolean) => void;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Manages panel visibility with keyboard shortcut support.
|
|
20
20
|
*/
|
|
21
|
-
|
|
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
|
-
|
|
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: (
|
|
15
|
+
onPointerDown: (event: PointerEvent) => void;
|
|
16
16
|
panelStyle: Record<string, string>;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
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
|
-
|
|
22
|
+
declare const usePosition: (panelElement: RefObject<HTMLElement>) => UsePositionReturn;
|
|
23
|
+
export type { UsePositionReturn };
|
|
24
|
+
export { usePosition };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
3
|
+
* Exposes toolbar visibility and placement controls from the toolbar context.
|
|
4
4
|
*/
|
|
5
|
-
|
|
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;
|
package/dist/toolbar/index.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import type { DevToolbarApp } from "../types/index.d.ts";
|
|
2
2
|
import { AppManager } from "./app-manager.d.ts";
|
|
3
|
-
import { sharedToolbarStylesheet } from "./stylesheet.d.ts";
|
|
4
3
|
/**
|
|
5
|
-
* Dev Toolbar Web Component
|
|
4
|
+
* Dev Toolbar Web Component.
|
|
6
5
|
*/
|
|
7
6
|
export declare class DevToolbar extends HTMLElement {
|
|
8
7
|
private appManager;
|
|
9
8
|
private hasBeenInitialized;
|
|
10
|
-
private customAppsToShow;
|
|
11
9
|
private renderRoot;
|
|
12
10
|
constructor();
|
|
13
11
|
/**
|
|
14
|
-
* Called when element is inserted into the DOM
|
|
15
|
-
* According to Preact docs, rendering should happen here or after connection
|
|
12
|
+
* Called when element is inserted into the DOM.
|
|
13
|
+
* According to Preact docs, rendering should happen here or after connection.
|
|
16
14
|
*/
|
|
17
15
|
connectedCallback(): void;
|
|
18
16
|
/**
|
|
19
|
-
* Called when element is removed from the DOM
|
|
20
|
-
*
|
|
17
|
+
* Called when element is removed from the DOM.
|
|
18
|
+
* Cleans up the Preact component to prevent memory leaks.
|
|
21
19
|
*/
|
|
22
20
|
disconnectedCallback(): void;
|
|
23
21
|
/**
|
|
@@ -33,7 +31,7 @@ export declare class DevToolbar extends HTMLElement {
|
|
|
33
31
|
*/
|
|
34
32
|
setToolbarVisible(visible: boolean): void;
|
|
35
33
|
/**
|
|
36
|
-
*
|
|
34
|
+
* Adds an app to the toolbar and triggers a re-render.
|
|
37
35
|
*/
|
|
38
36
|
registerApp(app: DevToolbarApp, builtIn?: boolean): void;
|
|
39
37
|
/**
|
|
@@ -41,18 +39,12 @@ export declare class DevToolbar extends HTMLElement {
|
|
|
41
39
|
*/
|
|
42
40
|
getAppManager(): AppManager;
|
|
43
41
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @font-face declared in the document is part of the global font registry and
|
|
46
|
-
* is accessible from within shadow DOM roots — no duplication needed.
|
|
47
|
-
*/
|
|
48
|
-
private static injectFont;
|
|
49
|
-
/**
|
|
50
|
-
* Render the toolbar UI using Preact
|
|
42
|
+
* Renders the toolbar UI using Preact.
|
|
51
43
|
*/
|
|
52
44
|
private render;
|
|
53
45
|
/**
|
|
54
|
-
*
|
|
46
|
+
* Attaches global keyboard shortcuts and other DOM event listeners.
|
|
55
47
|
*/
|
|
56
48
|
private setupEventListeners;
|
|
57
49
|
}
|
|
58
|
-
export { sharedToolbarStylesheet };
|
|
50
|
+
export { sharedToolbarStylesheet } from "./stylesheet.d.ts";
|