@visulima/dev-toolbar 1.0.0-alpha.2 → 1.0.0-alpha.21
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 +251 -0
- package/LICENSE.md +137 -5
- package/README.md +70 -43
- package/bin/mcp.js +29 -0
- package/dist/apps/a11y/index.d.ts +3 -2
- package/dist/apps/a11y/index.js +3 -3
- package/dist/apps/annotations/index.d.ts +4 -0
- package/dist/apps/annotations/index.js +18 -0
- package/dist/apps/assets/index.d.ts +4 -0
- package/dist/apps/assets/index.js +16 -0
- package/dist/apps/inspector/index.d.ts +4 -0
- package/dist/apps/inspector/index.js +30 -0
- package/dist/apps/module-graph/index.d.ts +3 -2
- package/dist/apps/module-graph/index.js +2 -2
- package/dist/apps/performance/index.d.ts +3 -2
- package/dist/apps/performance/index.js +2 -2
- package/dist/apps/seo/index.d.ts +3 -2
- package/dist/apps/seo/index.js +2 -2
- package/dist/apps/settings/index.d.ts +3 -2
- package/dist/apps/settings/index.js +2 -2
- package/dist/apps/tailwind/index.d.ts +4 -0
- package/dist/apps/tailwind/index.js +7 -0
- package/dist/apps/timeline/index.d.ts +3 -2
- package/dist/apps/timeline/index.js +2 -2
- package/dist/apps/vite-config/index.d.ts +3 -2
- package/dist/apps/vite-config/index.js +2 -2
- package/dist/client/overlay.d.ts +1 -1
- package/dist/client/overlay.js +1 -1
- package/dist/index.d.ts +143 -6
- package/dist/index.js +1 -1
- package/dist/mcp/server.d.ts +2 -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/app.d-SmKEDxsI.d.ts +229 -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/global-api.d-BLfn-OUA.d.ts +547 -0
- package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
- package/dist/packem_shared/sharedToolbarStylesheet-Bx1muJAh.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/toolbar/index.d.ts +152 -56
- package/dist/toolbar/index.js +3 -4
- package/dist/ui/index.d.ts +382 -0
- package/dist/ui/index.js +1 -0
- package/dist/vite-plugin.d.ts +155 -103
- package/dist/vite-plugin.js +5 -2
- package/package.json +53 -14
- package/dist/apps/a11y/a11y-app.d.ts +0 -5
- package/dist/apps/a11y/a11y-store.d.ts +0 -46
- package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
- package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
- 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/apps/performance/performance-app.d.ts +0 -5
- package/dist/apps/performance/performance-tooltip.d.ts +0 -5
- package/dist/apps/seo/seo-app.d.ts +0 -5
- package/dist/apps/settings/settings-app.d.ts +0 -5
- package/dist/apps/timeline/timeline-app.d.ts +0 -5
- package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
- package/dist/hooks/create-hook.d.ts +0 -10
- package/dist/hooks/events.d.ts +0 -5
- package/dist/hooks/global-hook.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -6
- 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/performance/monitor.d.ts +0 -115
- package/dist/rpc/client.d.ts +0 -7
- package/dist/rpc/functions/module-graph.d.ts +0 -17
- package/dist/rpc/functions/open-in-editor.d.ts +0 -9
- package/dist/rpc/functions/vite-config.d.ts +0 -7
- package/dist/rpc/index.d.ts +0 -8
- package/dist/rpc/server.d.ts +0 -9
- package/dist/timeline/index.d.ts +0 -6
- package/dist/timeline/store.d.ts +0 -52
- package/dist/toolbar/app-manager.d.ts +0 -95
- package/dist/toolbar/components/app-button.d.ts +0 -19
- package/dist/toolbar/components/app-canvas.d.ts +0 -13
- package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -13
- package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
- package/dist/toolbar/components/index.d.ts +0 -4
- package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -23
- package/dist/toolbar/components/toolbar-bar.d.ts +0 -15
- package/dist/toolbar/components/toolbar-container.d.ts +0 -55
- package/dist/toolbar/components/vite-overlay-button.d.ts +0 -15
- package/dist/toolbar/context/index.d.ts +0 -2
- package/dist/toolbar/context/toolbar-context.d.ts +0 -106
- package/dist/toolbar/global-api.d.ts +0 -23
- package/dist/toolbar/helpers.d.ts +0 -6
- package/dist/toolbar/hooks/index.d.ts +0 -10
- package/dist/toolbar/hooks/use-apps.d.ts +0 -13
- package/dist/toolbar/hooks/use-frame-state.d.ts +0 -94
- package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -21
- package/dist/toolbar/hooks/use-position.d.ts +0 -22
- package/dist/toolbar/hooks/use-theme.d.ts +0 -13
- package/dist/toolbar/hooks/use-toolbar.d.ts +0 -14
- package/dist/toolbar/settings.d.ts +0 -17
- package/dist/toolbar/stylesheet.d.ts +0 -1
- package/dist/toolbar/utils/index.d.ts +0 -12
- package/dist/types/app.d.ts +0 -163
- package/dist/types/global-api.d.ts +0 -95
- package/dist/types/hooks.d.ts +0 -88
- package/dist/types/index.d.ts +0 -12
- package/dist/types/messaging.d.ts +0 -43
- package/dist/types/rpc.d.ts +0 -95
- package/dist/types/timeline.d.ts +0 -62
- package/dist/types/toolbar.d.ts +0 -56
- package/dist/ui/components/icon.d.ts +0 -21
- package/dist/utils/cn.d.ts +0 -8
package/dist/types/app.d.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from "preact";
|
|
2
|
-
import type { NotificationLevel } from "./toolbar.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Server helpers available to apps
|
|
5
|
-
*/
|
|
6
|
-
export interface ServerHelpers {
|
|
7
|
-
/**
|
|
8
|
-
* RPC client for calling server functions
|
|
9
|
-
*/
|
|
10
|
-
rpc: {
|
|
11
|
-
[K in keyof ServerFunctions]: ServerFunctions[K];
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Props passed to app tooltip (hover mini-canvas) components.
|
|
16
|
-
* Keep compact — tooltip components should be lightweight.
|
|
17
|
-
*/
|
|
18
|
-
export interface AppTooltipProps {
|
|
19
|
-
/**
|
|
20
|
-
* Server helpers (RPC, etc.)
|
|
21
|
-
*/
|
|
22
|
-
helpers: ServerHelpers;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Event target for app communication
|
|
26
|
-
*/
|
|
27
|
-
export interface ToolbarAppEventTarget extends EventTarget {
|
|
28
|
-
/**
|
|
29
|
-
* Dispatch a custom event
|
|
30
|
-
*/
|
|
31
|
-
dispatchEvent: (event: Event) => boolean;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* App view configuration
|
|
35
|
-
*/
|
|
36
|
-
export type AppView = {
|
|
37
|
-
/**
|
|
38
|
-
* Render app inline in shadow DOM (default)
|
|
39
|
-
*/
|
|
40
|
-
type: "inline";
|
|
41
|
-
} | {
|
|
42
|
-
/**
|
|
43
|
-
* URL to load in iframe
|
|
44
|
-
*/
|
|
45
|
-
src: string;
|
|
46
|
-
/**
|
|
47
|
-
* Render app in iframe for isolation
|
|
48
|
-
*/
|
|
49
|
-
type: "iframe";
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Props passed to Preact component apps
|
|
53
|
-
*/
|
|
54
|
-
export interface AppComponentProps {
|
|
55
|
-
/**
|
|
56
|
-
* Event target for app communication
|
|
57
|
-
*/
|
|
58
|
-
eventTarget: ToolbarAppEventTarget;
|
|
59
|
-
/**
|
|
60
|
-
* Server helpers (RPC, etc.)
|
|
61
|
-
*/
|
|
62
|
-
helpers: ServerHelpers;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Dev toolbar app definition
|
|
66
|
-
*/
|
|
67
|
-
export interface DevToolbarApp {
|
|
68
|
-
/**
|
|
69
|
-
* Called before app is toggled off
|
|
70
|
-
* Return false to prevent closing
|
|
71
|
-
* @param canvas Shadow root of the app
|
|
72
|
-
* @returns Whether to allow closing
|
|
73
|
-
*/
|
|
74
|
-
beforeTogglingOff?: (canvas: ShadowRoot) => boolean | Promise<boolean>;
|
|
75
|
-
/**
|
|
76
|
-
* Called when the app is unregistered / removed from the toolbar.
|
|
77
|
-
* Use this for final cleanup (event listeners, timers, subscriptions).
|
|
78
|
-
* @param canvas Shadow root of the app
|
|
79
|
-
*/
|
|
80
|
-
destroy?: (canvas: ShadowRoot) => Promise<void> | void;
|
|
81
|
-
/**
|
|
82
|
-
* When true, this app is automatically activated when the toolbar opens for
|
|
83
|
-
* the first time (or when no other app has been activated yet).
|
|
84
|
-
* Only the first registered app with defaultOpen: true is used.
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
defaultOpen?: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Preact component for rendering (alternative to init)
|
|
90
|
-
* If provided, this will be used instead of init
|
|
91
|
-
*/
|
|
92
|
-
component?: ComponentType<AppComponentProps>;
|
|
93
|
-
/**
|
|
94
|
-
* Optional hover tooltip component — renders a compact live preview when the
|
|
95
|
-
* user hovers over this app's button in the toolbar pill.
|
|
96
|
-
* The component should be small (≤280px wide) and self-contained.
|
|
97
|
-
* If omitted, hovering shows the native title tooltip only.
|
|
98
|
-
*/
|
|
99
|
-
tooltip?: ComponentType<AppTooltipProps>;
|
|
100
|
-
/**
|
|
101
|
-
* Icon HTML string (SVG)
|
|
102
|
-
*/
|
|
103
|
-
icon: string;
|
|
104
|
-
/**
|
|
105
|
-
* Unique identifier for the app
|
|
106
|
-
*/
|
|
107
|
-
id: string;
|
|
108
|
-
/**
|
|
109
|
-
* Initialize the app when opened (vanilla JS/CSS/HTML)
|
|
110
|
-
* @param canvas Shadow root to render into
|
|
111
|
-
* @param eventTarget Event target for app communication
|
|
112
|
-
* @param helpers Server helpers (RPC, etc.)
|
|
113
|
-
*/
|
|
114
|
-
init?: (canvas: ShadowRoot, eventTarget: ToolbarAppEventTarget, helpers: ServerHelpers) => void | Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Display name of the app
|
|
117
|
-
*/
|
|
118
|
-
name: string;
|
|
119
|
-
/**
|
|
120
|
-
* App rendering mode
|
|
121
|
-
*/
|
|
122
|
-
view?: AppView;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Internal app state (extends DevToolbarApp)
|
|
126
|
-
*/
|
|
127
|
-
export interface DevToolbarAppState extends DevToolbarApp {
|
|
128
|
-
/**
|
|
129
|
-
* Whether the app is currently active/open
|
|
130
|
-
*/
|
|
131
|
-
active: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Whether this is a built-in app
|
|
134
|
-
*/
|
|
135
|
-
builtIn: boolean;
|
|
136
|
-
/**
|
|
137
|
-
* Event target for this app
|
|
138
|
-
*/
|
|
139
|
-
eventTarget: ToolbarAppEventTarget;
|
|
140
|
-
/**
|
|
141
|
-
* Notification state
|
|
142
|
-
*/
|
|
143
|
-
notification: {
|
|
144
|
-
/**
|
|
145
|
-
* Notification level
|
|
146
|
-
*/
|
|
147
|
-
level?: NotificationLevel;
|
|
148
|
-
/**
|
|
149
|
-
* Whether notification is active
|
|
150
|
-
*/
|
|
151
|
-
state: boolean;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* App initialization status
|
|
155
|
-
*/
|
|
156
|
-
status: "ready" | "loading" | "pending" | "error";
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Placeholder for ServerFunctions (defined in rpc.ts)
|
|
160
|
-
*/
|
|
161
|
-
export interface ServerFunctions {
|
|
162
|
-
[key: string]: (...args: any[]) => Promise<any>;
|
|
163
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { DevToolbarApp } from "./app.d.ts";
|
|
2
|
-
import type { ToolbarSettings } from "./toolbar.d.ts";
|
|
3
|
-
import type { DevToolbarHook } from "./hooks.d.ts";
|
|
4
|
-
import type { ServerFunctions } from "./rpc.d.ts";
|
|
5
|
-
/**
|
|
6
|
-
* Global DevTools API interface
|
|
7
|
-
* Exposed as window.__VISULIMA_DEVTOOLS__
|
|
8
|
-
*/
|
|
9
|
-
export interface VisulimaDevTools {
|
|
10
|
-
/**
|
|
11
|
-
* Clear notification for an app
|
|
12
|
-
* @param appId App ID
|
|
13
|
-
*/
|
|
14
|
-
clearNotification: (appId: string) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Close the currently active app
|
|
17
|
-
*/
|
|
18
|
-
closeApp: () => Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Get the currently active app ID
|
|
21
|
-
* @returns Active app ID or null
|
|
22
|
-
*/
|
|
23
|
-
getActiveApp: () => string | null;
|
|
24
|
-
/**
|
|
25
|
-
* Get all registered apps
|
|
26
|
-
* @returns Array of app definitions
|
|
27
|
-
*/
|
|
28
|
-
getApps: () => DevToolbarApp[];
|
|
29
|
-
/**
|
|
30
|
-
* Get current toolbar settings
|
|
31
|
-
* @returns Toolbar settings
|
|
32
|
-
*/
|
|
33
|
-
getSettings: () => ToolbarSettings;
|
|
34
|
-
/**
|
|
35
|
-
* Hide the toolbar
|
|
36
|
-
*/
|
|
37
|
-
hide: () => void;
|
|
38
|
-
/**
|
|
39
|
-
* Hook instance for event subscriptions
|
|
40
|
-
*/
|
|
41
|
-
hook: DevToolbarHook;
|
|
42
|
-
/**
|
|
43
|
-
* Show a notification for an app
|
|
44
|
-
* @param appId App ID
|
|
45
|
-
* @param level Notification level
|
|
46
|
-
*/
|
|
47
|
-
notify: (appId: string, level: "info" | "warning" | "error") => void;
|
|
48
|
-
/**
|
|
49
|
-
* Open an app
|
|
50
|
-
* @param appId App ID to open
|
|
51
|
-
*/
|
|
52
|
-
openApp: (appId: string) => Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Register a custom app
|
|
55
|
-
* @param app App definition
|
|
56
|
-
*/
|
|
57
|
-
registerApp: (app: DevToolbarApp) => void;
|
|
58
|
-
/**
|
|
59
|
-
* RPC client for calling server functions
|
|
60
|
-
*/
|
|
61
|
-
rpc: ServerFunctions;
|
|
62
|
-
/**
|
|
63
|
-
* Show the toolbar
|
|
64
|
-
*/
|
|
65
|
-
show: () => void;
|
|
66
|
-
/**
|
|
67
|
-
* Toggle toolbar visibility
|
|
68
|
-
*/
|
|
69
|
-
toggle: () => void;
|
|
70
|
-
/**
|
|
71
|
-
* Unregister an app
|
|
72
|
-
* @param appId App ID to unregister
|
|
73
|
-
*/
|
|
74
|
-
unregisterApp: (appId: string) => void;
|
|
75
|
-
/**
|
|
76
|
-
* Update toolbar settings
|
|
77
|
-
* @param settings Partial settings to update
|
|
78
|
-
*/
|
|
79
|
-
updateSettings: (settings: Partial<ToolbarSettings>) => void;
|
|
80
|
-
/**
|
|
81
|
-
* Package version
|
|
82
|
-
*/
|
|
83
|
-
version: string;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Global API declaration
|
|
87
|
-
*/
|
|
88
|
-
declare global {
|
|
89
|
-
interface Window {
|
|
90
|
-
/**
|
|
91
|
-
* Visulima DevTools global API
|
|
92
|
-
*/
|
|
93
|
-
__VISULIMA_DEVTOOLS__?: VisulimaDevTools;
|
|
94
|
-
}
|
|
95
|
-
}
|
package/dist/types/hooks.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { DevToolbarApp } from "./app.d.ts";
|
|
2
|
-
import type { TimelineEvent } from "./timeline.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Hook event definitions
|
|
5
|
-
*/
|
|
6
|
-
export interface HookEvents {
|
|
7
|
-
/**
|
|
8
|
-
* Extension point for custom events
|
|
9
|
-
*/
|
|
10
|
-
[key: string]: (...args: any[]) => void;
|
|
11
|
-
/**
|
|
12
|
-
* App error occurred
|
|
13
|
-
* @param error Error object
|
|
14
|
-
* @param appId Optional app ID where error occurred
|
|
15
|
-
*/
|
|
16
|
-
"app:error": (error: Error, appId?: string) => void;
|
|
17
|
-
/**
|
|
18
|
-
* DevTools closed
|
|
19
|
-
*/
|
|
20
|
-
"devtools:close": () => void;
|
|
21
|
-
/**
|
|
22
|
-
* DevTools initialized
|
|
23
|
-
*/
|
|
24
|
-
"devtools:init": () => void;
|
|
25
|
-
/**
|
|
26
|
-
* DevTools opened
|
|
27
|
-
* @param appId ID of the opened app
|
|
28
|
-
*/
|
|
29
|
-
"devtools:open": (appId: string) => void;
|
|
30
|
-
/**
|
|
31
|
-
* Timeline event added
|
|
32
|
-
* @param event Timeline event
|
|
33
|
-
*/
|
|
34
|
-
"timeline:event": (event: TimelineEvent) => void;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Dev toolbar hook interface
|
|
38
|
-
* Exposed as window.__DEV_TOOLBAR_HOOK__
|
|
39
|
-
*/
|
|
40
|
-
export interface DevToolbarHook {
|
|
41
|
-
/**
|
|
42
|
-
* Add a timeline event
|
|
43
|
-
* @param groupId Timeline group ID
|
|
44
|
-
* @param event Timeline event
|
|
45
|
-
*/
|
|
46
|
-
addTimelineEvent: (groupId: string, event: TimelineEvent) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Emit an event
|
|
49
|
-
* @param event Event name
|
|
50
|
-
* @param args Event arguments
|
|
51
|
-
*/
|
|
52
|
-
emit: <T extends keyof HookEvents>(event: T, ...args: Parameters<HookEvents[T]>) => void;
|
|
53
|
-
/**
|
|
54
|
-
* Unsubscribe from an event
|
|
55
|
-
* @param event Event name
|
|
56
|
-
* @param handler Optional specific handler to remove
|
|
57
|
-
*/
|
|
58
|
-
off: <T extends keyof HookEvents>(event: T, handler?: HookEvents[T]) => void;
|
|
59
|
-
/**
|
|
60
|
-
* Subscribe to an event
|
|
61
|
-
* @param event Event name
|
|
62
|
-
* @param handler Event handler
|
|
63
|
-
* @returns Unsubscribe function
|
|
64
|
-
*/
|
|
65
|
-
on: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => () => void;
|
|
66
|
-
/**
|
|
67
|
-
* Subscribe to an event once
|
|
68
|
-
* @param event Event name
|
|
69
|
-
* @param handler Event handler
|
|
70
|
-
*/
|
|
71
|
-
once: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => void;
|
|
72
|
-
/**
|
|
73
|
-
* Register a custom app
|
|
74
|
-
* @param app App definition
|
|
75
|
-
*/
|
|
76
|
-
registerApp: (app: DevToolbarApp) => void;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Global hook declaration
|
|
80
|
-
*/
|
|
81
|
-
declare global {
|
|
82
|
-
interface Window {
|
|
83
|
-
/**
|
|
84
|
-
* Dev toolbar hook for library integrations
|
|
85
|
-
*/
|
|
86
|
-
__DEV_TOOLBAR_HOOK__?: DevToolbarHook;
|
|
87
|
-
}
|
|
88
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public type exports
|
|
3
|
-
*/
|
|
4
|
-
export type { AppView, DevToolbarApp, DevToolbarAppState, ServerFunctions, ServerHelpers, ToolbarAppEventTarget } from "./app.d.ts";
|
|
5
|
-
export type { VisulimaDevTools } from "./global-api.d.ts";
|
|
6
|
-
export type { DevToolbarHook, HookEvents } from "./hooks.d.ts";
|
|
7
|
-
export type { ChannelFactory, MessageChannel, MessageChannelContext } from "./messaging.d.ts";
|
|
8
|
-
export type { ClientRPCContext, ClientFunctions as RPCClientFunctions, ServerFunctions as RPCServerFunctions, ServerRPCContext } from "./rpc.d.ts";
|
|
9
|
-
export type { TimelineEvent, TimelineEventLevel, TimelineGroup } from "./timeline.d.ts";
|
|
10
|
-
export { DEFAULT_TIMELINE_GROUPS } from "./timeline.d.ts";
|
|
11
|
-
export type { FrameState, NotificationLevel, PositionAnchor, ToolbarPlacement, ToolbarSettings } from "./toolbar.d.ts";
|
|
12
|
-
export { DEFAULT_TOOLBAR_SETTINGS } from "./toolbar.d.ts";
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Message channel interface for bidirectional communication
|
|
3
|
-
*/
|
|
4
|
-
export interface MessageChannel<TEvents extends Record<string, (...args: any[]) => void>> {
|
|
5
|
-
/**
|
|
6
|
-
* Unsubscribe from an event
|
|
7
|
-
* @param event Event name
|
|
8
|
-
* @param handler Optional specific handler to remove
|
|
9
|
-
*/
|
|
10
|
-
off: <K extends keyof TEvents>(event: K, handler?: TEvents[K]) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Subscribe to an event
|
|
13
|
-
* @param event Event name
|
|
14
|
-
* @param handler Event handler
|
|
15
|
-
* @returns Unsubscribe function
|
|
16
|
-
*/
|
|
17
|
-
on: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => () => void;
|
|
18
|
-
/**
|
|
19
|
-
* Subscribe to an event once
|
|
20
|
-
* @param event Event name
|
|
21
|
-
* @param handler Event handler
|
|
22
|
-
*/
|
|
23
|
-
once: <K extends keyof TEvents>(event: K, handler: TEvents[K]) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Send a message/event
|
|
26
|
-
* @param event Event name
|
|
27
|
-
* @param data Event data
|
|
28
|
-
*/
|
|
29
|
-
send: <K extends keyof TEvents>(event: K, ...args: Parameters<TEvents[K]>) => void;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Channel factory function
|
|
33
|
-
*/
|
|
34
|
-
export type ChannelFactory<TEvents extends Record<string, (...args: any[]) => void>> = () => MessageChannel<TEvents>;
|
|
35
|
-
/**
|
|
36
|
-
* Message channel context
|
|
37
|
-
*/
|
|
38
|
-
export interface MessageChannelContext<TEvents extends Record<string, (...args: any[]) => void>> {
|
|
39
|
-
/**
|
|
40
|
-
* Create a new channel instance
|
|
41
|
-
*/
|
|
42
|
-
createChannel: () => MessageChannel<TEvents>;
|
|
43
|
-
}
|
package/dist/types/rpc.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { ViteDevServer } from "vite";
|
|
2
|
-
import type { SerializableModuleNode } from "../rpc/functions/module-graph.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Server-side RPC functions
|
|
5
|
-
* These can be called from the client
|
|
6
|
-
*/
|
|
7
|
-
export interface ServerFunctions {
|
|
8
|
-
/**
|
|
9
|
-
* Extension point for custom server functions
|
|
10
|
-
*/
|
|
11
|
-
[key: string]: (...args: any[]) => Promise<any>;
|
|
12
|
-
/**
|
|
13
|
-
* Get module dependency graph
|
|
14
|
-
*/
|
|
15
|
-
getModuleGraph: () => Promise<SerializableModuleNode[]>;
|
|
16
|
-
/**
|
|
17
|
-
* Get Vite configuration
|
|
18
|
-
*/
|
|
19
|
-
getViteConfig: () => Promise<Record<string, any>>;
|
|
20
|
-
/**
|
|
21
|
-
* Open file in editor
|
|
22
|
-
* @param file File path
|
|
23
|
-
* @param line Line number (1-based)
|
|
24
|
-
* @param column Column number (1-based)
|
|
25
|
-
*/
|
|
26
|
-
openInEditor: (file: string, line?: number, column?: number) => Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Read file contents
|
|
29
|
-
* @param path File path
|
|
30
|
-
*/
|
|
31
|
-
readFile: (path: string) => Promise<string>;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Client-side RPC functions
|
|
35
|
-
* These can be called from the server
|
|
36
|
-
*/
|
|
37
|
-
export interface ClientFunctions {
|
|
38
|
-
/**
|
|
39
|
-
* Extension point for custom client functions
|
|
40
|
-
*/
|
|
41
|
-
[key: string]: (...args: any[]) => void;
|
|
42
|
-
/**
|
|
43
|
-
* Notify client of config change
|
|
44
|
-
* @param config New Vite config
|
|
45
|
-
*/
|
|
46
|
-
onConfigChange: (config: Record<string, any>) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Notify client of HMR update
|
|
49
|
-
* @param payload HMR payload
|
|
50
|
-
*/
|
|
51
|
-
onHMRUpdate: (payload: any) => void;
|
|
52
|
-
/**
|
|
53
|
-
* Notify client of module update
|
|
54
|
-
* @param module Updated module node
|
|
55
|
-
*/
|
|
56
|
-
onModuleUpdate: (module: SerializableModuleNode) => void;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* RPC context for server-side
|
|
60
|
-
*/
|
|
61
|
-
export interface ServerRPCContext {
|
|
62
|
-
/**
|
|
63
|
-
* Call a client function
|
|
64
|
-
* @param name Function name
|
|
65
|
-
* @param args Function arguments
|
|
66
|
-
*/
|
|
67
|
-
callClient: <K extends keyof ClientFunctions>(name: K, ...args: Parameters<ClientFunctions[K]>) => void;
|
|
68
|
-
/**
|
|
69
|
-
* Register a server function
|
|
70
|
-
* @param name Function name
|
|
71
|
-
* @param fn Function implementation
|
|
72
|
-
*/
|
|
73
|
-
registerFunction: <K extends keyof ServerFunctions>(name: K, function_: ServerFunctions[K]) => void;
|
|
74
|
-
/**
|
|
75
|
-
* Vite dev server instance
|
|
76
|
-
*/
|
|
77
|
-
server: ViteDevServer;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* RPC context for client-side
|
|
81
|
-
*/
|
|
82
|
-
export interface ClientRPCContext {
|
|
83
|
-
/**
|
|
84
|
-
* Call a server function
|
|
85
|
-
* @param name Function name
|
|
86
|
-
* @param args Function arguments
|
|
87
|
-
*/
|
|
88
|
-
callServer: <K extends keyof ServerFunctions>(name: K, ...args: Parameters<ServerFunctions[K]>) => Promise<ReturnType<ServerFunctions[K]>>;
|
|
89
|
-
/**
|
|
90
|
-
* Register a client function
|
|
91
|
-
* @param name Function name
|
|
92
|
-
* @param fn Function implementation
|
|
93
|
-
*/
|
|
94
|
-
registerFunction: <K extends keyof ClientFunctions>(name: K, function_: ClientFunctions[K]) => void;
|
|
95
|
-
}
|
package/dist/types/timeline.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Timeline event level
|
|
3
|
-
*/
|
|
4
|
-
export type TimelineEventLevel = "info" | "warning" | "error";
|
|
5
|
-
/**
|
|
6
|
-
* Timeline event
|
|
7
|
-
*/
|
|
8
|
-
export interface TimelineEvent {
|
|
9
|
-
/**
|
|
10
|
-
* Optional event data
|
|
11
|
-
*/
|
|
12
|
-
data?: Record<string, any>;
|
|
13
|
-
/**
|
|
14
|
-
* Optional duration (milliseconds)
|
|
15
|
-
*/
|
|
16
|
-
duration?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Unique event ID
|
|
19
|
-
*/
|
|
20
|
-
id: string;
|
|
21
|
-
/**
|
|
22
|
-
* Event level
|
|
23
|
-
*/
|
|
24
|
-
level?: TimelineEventLevel;
|
|
25
|
-
/**
|
|
26
|
-
* Optional subtitle
|
|
27
|
-
*/
|
|
28
|
-
subtitle?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Timestamp (milliseconds since epoch)
|
|
31
|
-
*/
|
|
32
|
-
time: number;
|
|
33
|
-
/**
|
|
34
|
-
* Event title
|
|
35
|
-
*/
|
|
36
|
-
title: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Timeline group
|
|
40
|
-
*/
|
|
41
|
-
export interface TimelineGroup {
|
|
42
|
-
/**
|
|
43
|
-
* Group color (hex or CSS color)
|
|
44
|
-
*/
|
|
45
|
-
color?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Events in this group
|
|
48
|
-
*/
|
|
49
|
-
events: TimelineEvent[];
|
|
50
|
-
/**
|
|
51
|
-
* Group ID
|
|
52
|
-
*/
|
|
53
|
-
id: string;
|
|
54
|
-
/**
|
|
55
|
-
* Group label
|
|
56
|
-
*/
|
|
57
|
-
label: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Default timeline groups
|
|
61
|
-
*/
|
|
62
|
-
export declare const DEFAULT_TIMELINE_GROUPS: ReadonlyArray<TimelineGroup>;
|
package/dist/types/toolbar.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Toolbar placement options (for backward compatibility)
|
|
3
|
-
*/
|
|
4
|
-
export type ToolbarPlacement = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
5
|
-
/**
|
|
6
|
-
* Notification levels
|
|
7
|
-
*/
|
|
8
|
-
export type NotificationLevel = "info" | "warning" | "error";
|
|
9
|
-
/**
|
|
10
|
-
* Position anchor (which edge the toolbar is attached to)
|
|
11
|
-
* Matches Vue DevTools positioning
|
|
12
|
-
*/
|
|
13
|
-
export type PositionAnchor = "top" | "bottom" | "left" | "right";
|
|
14
|
-
/**
|
|
15
|
-
* Frame state - matches Vue DevTools DevToolsFrameState
|
|
16
|
-
* @see https://github.com/vuejs/devtools/blob/main/packages/overlay/src/composables/state.ts
|
|
17
|
-
*/
|
|
18
|
-
export interface FrameState {
|
|
19
|
-
/**
|
|
20
|
-
* Horizontal position as percentage (0-100)
|
|
21
|
-
*/
|
|
22
|
-
left: number;
|
|
23
|
-
/**
|
|
24
|
-
* Whether panel is open
|
|
25
|
-
*/
|
|
26
|
-
open: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Which edge the toolbar is anchored to
|
|
29
|
-
*/
|
|
30
|
-
position: PositionAnchor;
|
|
31
|
-
/**
|
|
32
|
-
* Vertical position as percentage (0-100)
|
|
33
|
-
*/
|
|
34
|
-
top: number;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Toolbar settings
|
|
38
|
-
*/
|
|
39
|
-
export interface ToolbarSettings {
|
|
40
|
-
/**
|
|
41
|
-
* Whether toolbar is visible by default
|
|
42
|
-
*/
|
|
43
|
-
defaultVisible: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Toolbar placement on screen
|
|
46
|
-
*/
|
|
47
|
-
placement: ToolbarPlacement;
|
|
48
|
-
/**
|
|
49
|
-
* Whether to show notifications
|
|
50
|
-
*/
|
|
51
|
-
showNotifications: boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Default toolbar settings
|
|
55
|
-
*/
|
|
56
|
-
export declare const DEFAULT_TOOLBAR_SETTINGS: ToolbarSettings;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource preact */
|
|
2
|
-
import type { ComponentChildren } from "preact";
|
|
3
|
-
interface IconProps {
|
|
4
|
-
class?: string;
|
|
5
|
-
size?: number;
|
|
6
|
-
/**
|
|
7
|
-
* CSS data-URI from a `?data-uri&encoding=css` lucide-static import.
|
|
8
|
-
* Uses CSS mask-image so the icon inherits currentColor from the parent.
|
|
9
|
-
*/
|
|
10
|
-
src: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Renders a lucide-static icon using CSS mask-image.
|
|
14
|
-
* Color is driven by the parent element's `color` property (currentColor).
|
|
15
|
-
*
|
|
16
|
-
* Usage:
|
|
17
|
-
* import xIcon from "lucide-static/icons/x.d.ts";
|
|
18
|
-
* <Icon src={xIcon} size={13} />
|
|
19
|
-
*/
|
|
20
|
-
declare const Icon: ({ src, size, class: className }: IconProps) => ComponentChildren;
|
|
21
|
-
export default Icon;
|
package/dist/utils/cn.d.ts
DELETED