@visulima/dev-toolbar 1.0.0-alpha.1 → 1.0.0-alpha.10
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 +218 -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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ViteDevServer } from "vite";
|
|
2
|
+
interface TailwindConfigResult {
|
|
3
|
+
/** CSS files that \@import tailwindcss */
|
|
4
|
+
cssFiles: string[];
|
|
5
|
+
/** User-defined \@theme overrides/extensions */
|
|
6
|
+
customTheme: Record<string, string>;
|
|
7
|
+
/** Full default Tailwind theme tokens */
|
|
8
|
+
defaultTheme: Record<string, string>;
|
|
9
|
+
/** Detected Tailwind version */
|
|
10
|
+
version: "v3" | "v4" | "unknown";
|
|
11
|
+
}
|
|
12
|
+
declare const getTailwindConfig: (server: ViteDevServer) => Promise<TailwindConfigResult>;
|
|
13
|
+
export type { TailwindConfigResult };
|
|
14
|
+
export { getTailwindConfig };
|
|
15
|
+
export default getTailwindConfig;
|
|
@@ -1,7 +1,83 @@
|
|
|
1
1
|
import type { ViteDevServer } from "vite";
|
|
2
|
+
type PluginInfo = {
|
|
3
|
+
enforce?: "post" | "pre";
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
/** Alias entry with find always normalized to string (RegExp serialized as "/pattern/flags") */
|
|
7
|
+
type AliasEntry = {
|
|
8
|
+
find: string;
|
|
9
|
+
replacement: string;
|
|
10
|
+
};
|
|
11
|
+
type ViteConfigSnapshot = {
|
|
12
|
+
base: string;
|
|
13
|
+
build: {
|
|
14
|
+
assetsDir?: string;
|
|
15
|
+
assetsInlineLimit?: number;
|
|
16
|
+
chunkSizeWarningLimit?: number;
|
|
17
|
+
cssCodeSplit?: boolean;
|
|
18
|
+
emptyOutDir?: boolean | null;
|
|
19
|
+
minify?: "esbuild" | "oxc" | "terser" | boolean;
|
|
20
|
+
outDir?: string;
|
|
21
|
+
reportCompressedSize?: boolean;
|
|
22
|
+
sourcemap?: "hidden" | "inline" | boolean;
|
|
23
|
+
target?: false | string | string[];
|
|
24
|
+
};
|
|
25
|
+
cacheDir: string;
|
|
26
|
+
css: {
|
|
27
|
+
devSourcemap?: boolean;
|
|
28
|
+
preprocessors: string[];
|
|
29
|
+
};
|
|
30
|
+
define?: Record<string, unknown>;
|
|
31
|
+
env?: Record<string, string>;
|
|
32
|
+
envDir?: string;
|
|
33
|
+
envPrefix?: string | string[];
|
|
34
|
+
esbuild?: {
|
|
35
|
+
jsx?: string;
|
|
36
|
+
jsxFactory?: string;
|
|
37
|
+
jsxFragment?: string;
|
|
38
|
+
jsxImportSource?: string;
|
|
39
|
+
target?: string | string[];
|
|
40
|
+
};
|
|
41
|
+
mode: string;
|
|
42
|
+
optimizeDeps: {
|
|
43
|
+
exclude?: string[];
|
|
44
|
+
include?: string[];
|
|
45
|
+
};
|
|
46
|
+
plugins: PluginInfo[];
|
|
47
|
+
publicDir: string;
|
|
48
|
+
resolve: {
|
|
49
|
+
alias?: AliasEntry[] | Record<string, string>;
|
|
50
|
+
conditions?: string[];
|
|
51
|
+
dedupe?: string[];
|
|
52
|
+
extensions?: string[];
|
|
53
|
+
mainFields?: string[];
|
|
54
|
+
preserveSymlinks?: boolean;
|
|
55
|
+
};
|
|
56
|
+
root: string;
|
|
57
|
+
server: {
|
|
58
|
+
cors?: boolean;
|
|
59
|
+
hmrEnabled?: boolean;
|
|
60
|
+
hmrPort?: number;
|
|
61
|
+
host?: boolean | string;
|
|
62
|
+
https?: boolean;
|
|
63
|
+
middlewareMode?: boolean | string;
|
|
64
|
+
open?: boolean | string;
|
|
65
|
+
origin?: string;
|
|
66
|
+
port?: number;
|
|
67
|
+
proxy?: string[];
|
|
68
|
+
strictPort?: boolean;
|
|
69
|
+
};
|
|
70
|
+
ssr?: {
|
|
71
|
+
external?: string[];
|
|
72
|
+
noExternal?: boolean | string[];
|
|
73
|
+
target?: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
2
76
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @param server Vite dev server instance
|
|
5
|
-
* @returns Vite config
|
|
77
|
+
* Gets Vite configuration from the dev server.
|
|
78
|
+
* @param server Vite dev server instance.
|
|
79
|
+
* @returns Vite config snapshot with the most useful fields.
|
|
6
80
|
*/
|
|
7
|
-
|
|
81
|
+
declare const getViteConfig: (server: ViteDevServer) => Promise<ViteConfigSnapshot>;
|
|
82
|
+
export { getViteConfig };
|
|
83
|
+
export default getViteConfig;
|
package/dist/rpc/server.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { ViteDevServer } from "vite";
|
|
2
2
|
import type { ServerFunctions, ServerRPCContext } from "../types/rpc.d.ts";
|
|
3
3
|
/**
|
|
4
|
-
* Creates server-side RPC context
|
|
5
|
-
* @param server Vite dev server instance
|
|
6
|
-
* @param customFunctions Custom server functions to register
|
|
7
|
-
* @
|
|
4
|
+
* Creates server-side RPC context.
|
|
5
|
+
* @param server Vite dev server instance.
|
|
6
|
+
* @param customFunctions Custom server functions to register.
|
|
7
|
+
* @param options Additional options (e.g. which editor to launch).
|
|
8
|
+
* @param options.editor Editor to use for "open in editor" functionality.
|
|
9
|
+
* @returns Server RPC context.
|
|
8
10
|
*/
|
|
9
|
-
|
|
11
|
+
declare const createServerRPCContext: (server: ViteDevServer, customFunctions?: Partial<ServerFunctions>, options?: {
|
|
12
|
+
editor?: string;
|
|
13
|
+
}) => ServerRPCContext;
|
|
14
|
+
export { createServerRPCContext };
|
|
15
|
+
export default createServerRPCContext;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Annotation } from "../types/annotations.d.ts";
|
|
2
|
+
/** Base directory for annotation storage (relative to project root) */
|
|
3
|
+
export declare const STORE_DIR = ".devtoolbar";
|
|
4
|
+
export declare const ANNOTATIONS_FILE = "annotations.json";
|
|
5
|
+
export declare const SCREENSHOTS_DIR = "screenshots";
|
|
6
|
+
/**
|
|
7
|
+
* Resolves absolute paths for the annotation store.
|
|
8
|
+
*/
|
|
9
|
+
export declare const resolvePaths: (root: string) => {
|
|
10
|
+
annotationsFile: string;
|
|
11
|
+
base: string;
|
|
12
|
+
screenshotsDir: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Validates that a resolved file path stays inside the store base directory.
|
|
16
|
+
* Prevents directory traversal attacks.
|
|
17
|
+
*/
|
|
18
|
+
export declare const isPathInsideBase: (filepath: string, baseDir: string) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Sanitizes an ID for use as a filename — strips path separators and
|
|
21
|
+
* non-alphanumeric characters (except hyphens) to prevent traversal.
|
|
22
|
+
*/
|
|
23
|
+
export declare const sanitizeId: (id: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Ensures the store directories exist.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ensureStoreDir: (root: string) => Promise<void>;
|
|
28
|
+
export declare const withLock: <T>(function_: () => Promise<T>) => Promise<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Reads all annotations from disk.
|
|
31
|
+
*/
|
|
32
|
+
export declare const readAnnotations: (root: string) => Promise<Annotation[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Writes annotations to disk.
|
|
35
|
+
*/
|
|
36
|
+
export declare const writeAnnotations: (root: string, annotations: Annotation[]) => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Deletes a screenshot file from disk.
|
|
39
|
+
* Validates the path stays inside the store directory to prevent traversal.
|
|
40
|
+
*/
|
|
41
|
+
export declare const deleteScreenshotFile: (root: string, screenshotPath: string) => Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timeline event capture
|
|
3
|
+
* Intercepts HMR events, fetch requests, and JS errors and feeds them
|
|
4
|
+
* into the timeline store so the Timeline app can display them.
|
|
5
|
+
*/
|
|
6
|
+
declare const startTimelineCapture: () => void;
|
|
7
|
+
export { startTimelineCapture };
|
|
8
|
+
export default startTimelineCapture;
|
package/dist/timeline/index.d.ts
CHANGED
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export type { TimelineEvent, TimelineEventLevel, TimelineGroup } from "../types/timeline.d.ts";
|
|
5
5
|
export { DEFAULT_TIMELINE_GROUPS } from "../types/timeline.d.ts";
|
|
6
|
-
export {
|
|
6
|
+
export { startTimelineCapture } from "./capture.d.ts";
|
|
7
|
+
export type { TimelineStore } from "./store.d.ts";
|
|
8
|
+
export { getTimelineStore } from "./store.d.ts";
|
package/dist/timeline/store.d.ts
CHANGED
|
@@ -1,52 +1,42 @@
|
|
|
1
1
|
import type { TimelineEvent, TimelineGroup } from "../types/timeline.d.ts";
|
|
2
2
|
/**
|
|
3
|
-
* Timeline store for managing events
|
|
3
|
+
* Timeline store for managing timeline events.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
declare class TimelineStore {
|
|
6
6
|
private groups;
|
|
7
7
|
private maxEvents;
|
|
8
8
|
constructor(maxEvents?: number);
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param groupId Group ID
|
|
12
|
-
* @param event Timeline event
|
|
10
|
+
* Adds an event to a group.
|
|
13
11
|
*/
|
|
14
12
|
addEvent(groupId: string, event: TimelineEvent): void;
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @returns Array of timeline groups
|
|
14
|
+
* Gets all timeline groups.
|
|
18
15
|
*/
|
|
19
16
|
getGroups(): TimelineGroup[];
|
|
20
17
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param groupId Group ID
|
|
23
|
-
* @returns Array of events or empty array
|
|
18
|
+
* Gets events for a specific group.
|
|
24
19
|
*/
|
|
25
20
|
getGroupEvents(groupId: string): TimelineEvent[];
|
|
26
21
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @returns Array of all events
|
|
22
|
+
* Gets all events across all groups.
|
|
29
23
|
*/
|
|
30
24
|
getAllEvents(): TimelineEvent[];
|
|
31
25
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @param groupId Group ID
|
|
26
|
+
* Clears events for a specific group.
|
|
34
27
|
*/
|
|
35
28
|
clearGroup(groupId: string): void;
|
|
36
29
|
/**
|
|
37
|
-
*
|
|
30
|
+
* Clears all events from all groups.
|
|
38
31
|
*/
|
|
39
32
|
clearAll(): void;
|
|
40
33
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @param startTime Start timestamp
|
|
43
|
-
* @param endTime End timestamp
|
|
44
|
-
* @returns Array of events in range
|
|
34
|
+
* Gets events within a time range.
|
|
45
35
|
*/
|
|
46
36
|
getEventsInRange(startTime: number, endTime: number): TimelineEvent[];
|
|
47
37
|
}
|
|
48
38
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @returns Timeline store instance
|
|
39
|
+
* Gets or creates the timeline store singleton instance.
|
|
51
40
|
*/
|
|
52
|
-
|
|
41
|
+
declare const getTimelineStore: () => TimelineStore;
|
|
42
|
+
export { getTimelineStore, TimelineStore };
|
|
@@ -1,95 +1,104 @@
|
|
|
1
1
|
import type { DevToolbarApp, DevToolbarAppState } from "../types/app.d.ts";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Manages the lifecycle of all registered dev-toolbar apps.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
declare class AppManager {
|
|
6
6
|
private apps;
|
|
7
7
|
private activeAppId;
|
|
8
8
|
private initializedApps;
|
|
9
9
|
private appCanvases;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @param app App definition
|
|
13
|
-
* @param builtIn Whether this is a built-in app
|
|
11
|
+
* Registers an app with the toolbar.
|
|
12
|
+
* @param app App definition.
|
|
13
|
+
* @param builtIn Whether this is a built-in app.
|
|
14
14
|
*/
|
|
15
15
|
registerApp(app: DevToolbarApp, builtIn?: boolean): void;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param appId App ID
|
|
17
|
+
* Unregisters an app and calls its destroy hook if initialized.
|
|
18
|
+
* @param appId App ID to unregister.
|
|
19
19
|
*/
|
|
20
20
|
unregisterApp(appId: string): Promise<void>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param appId App ID
|
|
24
|
-
* @returns App state or undefined
|
|
22
|
+
* Returns the app state for a given ID.
|
|
23
|
+
* @param appId App ID to look up.
|
|
24
|
+
* @returns App state or undefined.
|
|
25
25
|
*/
|
|
26
26
|
getApp(appId: string): DevToolbarAppState | undefined;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* @returns Array of app states
|
|
28
|
+
* Returns all registered app states.
|
|
30
29
|
*/
|
|
31
30
|
getAllApps(): DevToolbarAppState[];
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @returns Active app state or undefined
|
|
32
|
+
* Returns the currently active app state, or undefined if none is active.
|
|
35
33
|
*/
|
|
36
34
|
getActiveApp(): DevToolbarAppState | undefined;
|
|
37
35
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @param appId App ID
|
|
40
|
-
* @returns Whether toggle was successful
|
|
36
|
+
* Toggles the active state of an app.
|
|
37
|
+
* @param appId App ID to toggle.
|
|
38
|
+
* @returns Whether the toggle was successful.
|
|
41
39
|
*/
|
|
42
40
|
toggleApp(appId: string): Promise<boolean>;
|
|
43
41
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* Directly sets the active state of an action button without invoking callbacks.
|
|
43
|
+
* Use this to deactivate a button from outside the toolbar (e.g. after async work).
|
|
44
|
+
* @param appId The unique identifier of the app whose active state to change.
|
|
45
|
+
* @param active New active state.
|
|
46
|
+
*/
|
|
47
|
+
setAppActive(appId: string, active: boolean): void;
|
|
48
|
+
/**
|
|
49
|
+
* Returns whether an app has already had its init() called.
|
|
50
|
+
* @param appId App ID to check.
|
|
46
51
|
*/
|
|
47
52
|
isAppInitialized(appId: string): boolean;
|
|
48
53
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @
|
|
54
|
+
* Marks an app as having been initialized.
|
|
55
|
+
* @param appId App ID to mark.
|
|
51
56
|
*/
|
|
52
57
|
markAppInitialized(appId: string): void;
|
|
53
58
|
/**
|
|
54
|
-
*
|
|
55
|
-
* @param appId App ID
|
|
56
|
-
* @returns Whether open was successful
|
|
59
|
+
* Opens an app and initializes it if necessary.
|
|
60
|
+
* @param appId App ID to open.
|
|
61
|
+
* @returns Whether the open was successful.
|
|
57
62
|
*/
|
|
58
63
|
openApp(appId: string): Promise<boolean>;
|
|
59
64
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @param appId App ID
|
|
62
|
-
* @returns Whether close was successful
|
|
65
|
+
* Closes an active app.
|
|
66
|
+
* @param appId App ID to close.
|
|
67
|
+
* @returns Whether the close was successful.
|
|
63
68
|
*/
|
|
64
69
|
closeApp(appId: string): Promise<boolean>;
|
|
65
70
|
/**
|
|
66
|
-
*
|
|
67
|
-
* @param appId
|
|
68
|
-
* @param state
|
|
69
|
-
* @param level
|
|
71
|
+
* Sets a notification for an app.
|
|
72
|
+
* @param appId The unique identifier of the app to notify.
|
|
73
|
+
* @param state Whether the notification is currently visible.
|
|
74
|
+
* @param level The severity level of the notification badge.
|
|
70
75
|
*/
|
|
71
76
|
setNotification(appId: string, state: boolean, level?: "info" | "warning" | "error"): void;
|
|
72
77
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @param appId
|
|
78
|
+
* Clears the notification for an app.
|
|
79
|
+
* @param appId The unique identifier of the app whose notification to clear.
|
|
75
80
|
*/
|
|
76
81
|
clearNotification(appId: string): void;
|
|
77
82
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param appId
|
|
80
|
-
* @returns Canvas element with shadow root or
|
|
83
|
+
* Returns the canvas element and shadow root for an app.
|
|
84
|
+
* @param appId The unique identifier of the app whose canvas to retrieve.
|
|
85
|
+
* @returns Canvas element with shadow root or undefined.
|
|
81
86
|
*/
|
|
82
87
|
getAppCanvas(appId: string): {
|
|
83
88
|
element: HTMLElement;
|
|
84
89
|
shadowRoot: ShadowRoot;
|
|
85
|
-
} |
|
|
90
|
+
} | undefined;
|
|
86
91
|
/**
|
|
87
|
-
*
|
|
88
|
-
* @param appId
|
|
89
|
-
* @param canvas
|
|
92
|
+
* Stores the canvas element and shadow root for an app.
|
|
93
|
+
* @param appId The unique identifier of the app whose canvas to store.
|
|
94
|
+
* @param canvas The canvas object containing the host element and its shadow root.
|
|
95
|
+
* @param canvas.element The host HTMLElement that wraps the app's shadow DOM.
|
|
96
|
+
* @param canvas.shadowRoot The ShadowRoot attached to the canvas element.
|
|
90
97
|
*/
|
|
91
98
|
setAppCanvas(appId: string, canvas: {
|
|
92
99
|
element: HTMLElement;
|
|
93
100
|
shadowRoot: ShadowRoot;
|
|
94
101
|
}): void;
|
|
95
102
|
}
|
|
103
|
+
export { AppManager };
|
|
104
|
+
export default AppManager;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** @jsxImportSource preact */
|
|
2
1
|
import type { ComponentChildren } from "preact";
|
|
3
2
|
import type { DevToolbarAppState } from "../../types/index.d.ts";
|
|
4
3
|
interface AppButtonProps {
|
|
@@ -11,8 +10,8 @@ interface AppButtonProps {
|
|
|
11
10
|
* App button component — shown in the toolbar pill.
|
|
12
11
|
* When an app declares a `tooltip` component, hovering the button shows a live
|
|
13
12
|
* mini-canvas via AppTooltipOverlay (rendered outside overflow:hidden pill).
|
|
14
|
-
* @param props
|
|
15
|
-
* @param props.app
|
|
13
|
+
* @param props Component props
|
|
14
|
+
* @param props.app App state
|
|
16
15
|
* @returns Rendered button component
|
|
17
16
|
*/
|
|
18
17
|
declare const AppButton: ({ app }: AppButtonProps) => ComponentChildren;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/** @jsxImportSource preact */
|
|
2
1
|
import type { ComponentChildren } from "preact";
|
|
3
2
|
import type { DevToolbarAppState } from "../../types/index.d.ts";
|
|
4
3
|
interface DevPanelProps {
|
|
5
|
-
activeAppId: string |
|
|
4
|
+
activeAppId: string | undefined;
|
|
6
5
|
apps: DevToolbarAppState[];
|
|
7
6
|
onClose: () => void;
|
|
8
7
|
onToggleApp: (appId: string) => Promise<void>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** @jsxImportSource preact */
|
|
2
1
|
import type { ComponentChildren } from "preact";
|
|
3
2
|
interface FirstVisitHintProps {
|
|
4
3
|
onDismiss: () => void;
|
|
@@ -7,9 +6,9 @@ interface FirstVisitHintProps {
|
|
|
7
6
|
/**
|
|
8
7
|
* First-visit hint overlay showing keyboard and interaction tips.
|
|
9
8
|
* Appears ~600 ms after mount to let the toolbar pill animate in first.
|
|
10
|
-
* @param props
|
|
11
|
-
* @param props.onDismiss
|
|
12
|
-
* @param props.position
|
|
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)
|
|
13
12
|
* @returns Rendered hint component
|
|
14
13
|
*/
|
|
15
14
|
declare const FirstVisitHint: ({ onDismiss, position }: FirstVisitHintProps) => ComponentChildren;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
/** @jsxImportSource preact */
|
|
2
2
|
import type { ComponentChildren } from "preact";
|
|
3
|
-
interface ToolbarBarProps {
|
|
4
|
-
/**
|
|
5
|
-
* Number of custom apps to show before "more" button
|
|
6
|
-
*/
|
|
7
|
-
customAppsToShow?: number;
|
|
8
|
-
}
|
|
9
3
|
/**
|
|
10
4
|
* Toolbar bar — row of app buttons inside the pill.
|
|
11
5
|
* Left/right placement rotates the whole pill 90deg via CSS,
|
|
12
6
|
* so this always stays flex-row internally.
|
|
13
7
|
*/
|
|
14
|
-
declare const ToolbarBar: (
|
|
8
|
+
declare const ToolbarBar: () => ComponentChildren;
|
|
15
9
|
export default ToolbarBar;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
/** @jsxImportSource preact */
|
|
2
1
|
import type { ComponentChildren } from "preact";
|
|
3
2
|
import type { DevToolbarAppState } from "../../types/index.d.ts";
|
|
4
3
|
interface ToolbarContainerProps {
|
|
5
4
|
/**
|
|
6
5
|
* Active app ID
|
|
7
6
|
*/
|
|
8
|
-
activeAppId: string |
|
|
7
|
+
activeAppId: string | undefined;
|
|
9
8
|
/**
|
|
10
9
|
* Initial apps
|
|
11
10
|
*/
|
|
12
11
|
apps: DevToolbarAppState[];
|
|
13
|
-
/**
|
|
14
|
-
* Number of custom apps to show
|
|
15
|
-
*/
|
|
16
|
-
customAppsToShow?: number;
|
|
17
12
|
/**
|
|
18
13
|
* Callback when notification should be cleared
|
|
19
14
|
*/
|
|
@@ -43,7 +38,6 @@ interface ToolbarContainerProps {
|
|
|
43
38
|
* @param props Component props
|
|
44
39
|
* @param props.activeAppId ID of the currently open app, or null if no app is open
|
|
45
40
|
* @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
41
|
* @param props.onClearNotification Called when an app's notification badge should be cleared
|
|
48
42
|
* @param props.onRegisterApp Called when a new app is dynamically registered
|
|
49
43
|
* @param props.onSetNotification Called when an app requests a notification badge update
|
|
@@ -51,5 +45,5 @@ interface ToolbarContainerProps {
|
|
|
51
45
|
* @param props.onUnregisterApp Called when an app is dynamically unregistered
|
|
52
46
|
* @returns Rendered toolbar component tree
|
|
53
47
|
*/
|
|
54
|
-
declare const ToolbarContainer: ({ activeAppId, apps,
|
|
48
|
+
declare const ToolbarContainer: ({ activeAppId, apps, onClearNotification, onRegisterApp, onSetNotification, onToggleApp, onUnregisterApp, }: ToolbarContainerProps) => ComponentChildren;
|
|
55
49
|
export default ToolbarContainer;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/** @jsxImportSource preact */
|
|
2
1
|
import type { ComponentChildren } from "preact";
|
|
3
2
|
/**
|
|
4
|
-
* Shows a red error button in the toolbar when
|
|
3
|
+
* Shows a red error button in the toolbar when `@visulima/vite-overlay` errors exist.
|
|
5
4
|
* Clicking toggles the vite-overlay panel visibility.
|
|
6
5
|
*
|
|
7
6
|
* Only rendered when:
|
|
8
|
-
* -
|
|
7
|
+
* - `@visulima/vite-overlay` is installed and active (window.ErrorOverlay is defined)
|
|
9
8
|
* - At least one error is present in the history
|
|
10
9
|
*
|
|
11
10
|
* Renders with its own left separator so it stays visually grouped on the
|