@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.
- package/CHANGELOG.md +14 -0
- package/LICENSE.md +21 -0
- package/dist/apps/a11y/index.d.ts +3 -2
- package/dist/apps/a11y/index.js +1 -1
- package/dist/apps/annotations/index.d.ts +3 -2
- package/dist/apps/annotations/index.js +1 -1
- package/dist/apps/assets/index.d.ts +3 -2
- package/dist/apps/assets/index.js +1 -1
- package/dist/apps/inspector/index.d.ts +3 -2
- package/dist/apps/inspector/index.js +1 -1
- package/dist/apps/module-graph/index.d.ts +3 -2
- package/dist/apps/module-graph/index.js +1 -1
- package/dist/apps/performance/index.d.ts +3 -2
- package/dist/apps/performance/index.js +1 -1
- package/dist/apps/seo/index.d.ts +3 -2
- package/dist/apps/seo/index.js +1 -1
- package/dist/apps/settings/index.d.ts +3 -2
- package/dist/apps/settings/index.js +1 -1
- package/dist/apps/tailwind/index.d.ts +3 -2
- package/dist/apps/timeline/index.d.ts +3 -2
- package/dist/apps/timeline/index.js +1 -1
- package/dist/apps/vite-config/index.d.ts +3 -2
- package/dist/apps/vite-config/index.js +1 -1
- package/dist/client/overlay.d.ts +1 -1
- package/dist/index.d.ts +143 -8
- package/dist/mcp/server.d.ts +2 -12
- package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
- package/dist/packem_shared/global-api.d-BLfn-OUA.d.ts +547 -0
- package/dist/packem_shared/{sharedToolbarStylesheet-CaTdYhVe.js → sharedToolbarStylesheet-Bx1muJAh.js} +1 -1
- package/dist/toolbar/index.d.ts +152 -48
- package/dist/toolbar/index.js +1 -1
- package/dist/ui/index.d.ts +382 -18
- package/dist/vite-plugin.d.ts +155 -146
- package/package.json +4 -4
- package/dist/apps/a11y/a11y-app.d.ts +0 -4
- package/dist/apps/a11y/a11y-store.d.ts +0 -42
- package/dist/apps/a11y/a11y-tooltip.d.ts +0 -10
- package/dist/apps/annotations/annotations-app.d.ts +0 -4
- package/dist/apps/assets/assets-app.d.ts +0 -4
- package/dist/apps/inspector/a11y-capture.d.ts +0 -12
- package/dist/apps/inspector/annotation-overlay.d.ts +0 -55
- package/dist/apps/inspector/annotation-settings.d.ts +0 -33
- package/dist/apps/inspector/element-utils.d.ts +0 -115
- package/dist/apps/inspector/freeze-animations.d.ts +0 -22
- package/dist/apps/inspector/inspector-app.d.ts +0 -14
- package/dist/apps/inspector/rulers.d.ts +0 -14
- package/dist/apps/inspector/theme-palette.d.ts +0 -34
- package/dist/apps/module-graph/module-graph-app.d.ts +0 -4
- package/dist/apps/performance/performance-app.d.ts +0 -4
- package/dist/apps/performance/performance-tooltip.d.ts +0 -4
- package/dist/apps/seo/seo-app.d.ts +0 -4
- package/dist/apps/settings/settings-app.d.ts +0 -4
- package/dist/apps/tailwind/tailwind-app.d.ts +0 -4
- package/dist/apps/timeline/timeline-app.d.ts +0 -4
- package/dist/apps/vite-config/vite-config-app.d.ts +0 -4
- package/dist/hooks/create-hook.d.ts +0 -12
- package/dist/hooks/events.d.ts +0 -7
- package/dist/hooks/global-hook.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -6
- package/dist/performance/monitor.d.ts +0 -116
- package/dist/rpc/client.d.ts +0 -9
- package/dist/rpc/functions/annotations.d.ts +0 -28
- package/dist/rpc/functions/assets.d.ts +0 -16
- package/dist/rpc/functions/module-graph.d.ts +0 -17
- package/dist/rpc/functions/open-in-editor.d.ts +0 -16
- package/dist/rpc/functions/tailwind-config.d.ts +0 -15
- package/dist/rpc/functions/vite-config.d.ts +0 -83
- package/dist/rpc/server.d.ts +0 -15
- package/dist/store/annotation-store.d.ts +0 -41
- package/dist/timeline/capture.d.ts +0 -8
- package/dist/timeline/index.d.ts +0 -8
- package/dist/timeline/store.d.ts +0 -42
- package/dist/toolbar/app-manager.d.ts +0 -104
- package/dist/toolbar/components/app-button.d.ts +0 -18
- package/dist/toolbar/components/app-canvas.d.ts +0 -12
- package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
- package/dist/toolbar/components/first-visit-hint.d.ts +0 -15
- package/dist/toolbar/components/index.d.ts +0 -4
- package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
- package/dist/toolbar/components/toolbar-bar.d.ts +0 -9
- package/dist/toolbar/components/toolbar-container.d.ts +0 -49
- package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
- package/dist/toolbar/context/index.d.ts +0 -2
- package/dist/toolbar/context/toolbar-context.d.ts +0 -107
- package/dist/toolbar/global-api.d.ts +0 -24
- package/dist/toolbar/helpers.d.ts +0 -8
- package/dist/toolbar/hooks/index.d.ts +0 -10
- package/dist/toolbar/hooks/use-apps.d.ts +0 -15
- package/dist/toolbar/hooks/use-frame-state.d.ts +0 -110
- package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -23
- package/dist/toolbar/hooks/use-position.d.ts +0 -24
- package/dist/toolbar/hooks/use-theme.d.ts +0 -15
- package/dist/toolbar/hooks/use-toolbar.d.ts +0 -16
- package/dist/toolbar/settings.d.ts +0 -17
- package/dist/toolbar/stylesheet.d.ts +0 -3
- package/dist/toolbar/utils/index.d.ts +0 -12
- package/dist/types/annotations.d.ts +0 -156
- package/dist/types/app.d.ts +0 -175
- package/dist/types/global-api.d.ts +0 -91
- package/dist/types/hooks.d.ts +0 -86
- package/dist/types/index.d.ts +0 -13
- package/dist/types/messaging.d.ts +0 -43
- package/dist/types/rpc.d.ts +0 -137
- package/dist/types/timeline.d.ts +0 -62
- package/dist/types/toolbar.d.ts +0 -56
- package/dist/ui/components/alert.d.ts +0 -19
- package/dist/ui/components/badge.d.ts +0 -9
- package/dist/ui/components/button.d.ts +0 -11
- package/dist/ui/components/card.d.ts +0 -16
- package/dist/ui/components/icon.d.ts +0 -19
- package/dist/ui/components/input.d.ts +0 -7
- package/dist/ui/components/label.d.ts +0 -7
- package/dist/ui/components/popover.d.ts +0 -27
- package/dist/ui/components/progress.d.ts +0 -7
- package/dist/ui/components/select.d.ts +0 -54
- package/dist/ui/components/separator.d.ts +0 -8
- package/dist/ui/components/skeleton.d.ts +0 -6
- package/dist/ui/components/switch.d.ts +0 -11
- package/dist/ui/components/tabs.d.ts +0 -28
- package/dist/ui/components/textarea.d.ts +0 -7
- package/dist/ui/components/tooltip.d.ts +0 -19
- package/dist/vite/inject-source.d.ts +0 -24
- package/dist/vite/matcher.d.ts +0 -6
package/dist/vite-plugin.d.ts
CHANGED
|
@@ -1,149 +1,158 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { D as DevToolbarApp, S as ServerFunctions } from "./packem_shared/app.d-SmKEDxsI.js";
|
|
3
|
+
import "./packem_shared/global-api.d-BLfn-OUA.js";
|
|
4
|
+
import '@babel/generator';
|
|
5
|
+
import 'preact';
|
|
6
|
+
interface InjectSourceIgnore {
|
|
7
|
+
/** Component names or patterns to skip. */
|
|
8
|
+
components?: (RegExp | string)[];
|
|
9
|
+
/** File paths or patterns to skip. */
|
|
10
|
+
files?: (RegExp | string)[];
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
13
|
+
* Dev toolbar plugin options
|
|
14
|
+
*/
|
|
15
|
+
interface DevToolbarOptions {
|
|
16
|
+
/**
|
|
17
|
+
* append an import to the module id ending with `appendTo` instead of adding a script into body
|
|
18
|
+
* useful for projects that do not use html file as an entry
|
|
19
|
+
*
|
|
20
|
+
* WARNING: only set this if you know exactly what it does.
|
|
21
|
+
* @default Empty string (disabled).
|
|
22
|
+
*/
|
|
23
|
+
appendTo?: string | RegExp;
|
|
24
|
+
/**
|
|
25
|
+
* Built-in apps to enable. All apps are disabled by default — only
|
|
26
|
+
* `viteConfig`, `settings`, and the "more" drawer are shown out of the box.
|
|
27
|
+
* Explicitly set an app to `true` to enable it.
|
|
28
|
+
* @example { inspector: true, seo: true }
|
|
29
|
+
*/
|
|
30
|
+
apps?: {
|
|
31
|
+
[key: string]: boolean | undefined;
|
|
32
|
+
a11y?: boolean;
|
|
33
|
+
annotations?: boolean;
|
|
34
|
+
assets?: boolean;
|
|
35
|
+
inspector?: boolean;
|
|
36
|
+
moduleGraph?: boolean;
|
|
37
|
+
performance?: boolean;
|
|
38
|
+
seo?: boolean;
|
|
39
|
+
settings?: boolean;
|
|
40
|
+
tailwind?: boolean;
|
|
41
|
+
timeline?: boolean;
|
|
42
|
+
viteConfig?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Whether clicking outside the DevTools panel closes it.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
closeOnOutsideClick?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Custom apps to register
|
|
51
|
+
*/
|
|
52
|
+
customApps?: DevToolbarApp[];
|
|
53
|
+
/**
|
|
54
|
+
* Whether toolbar is visible by default
|
|
55
|
+
*/
|
|
56
|
+
defaultVisible?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The editor to open when clicking "Open in editor" in the inspector.
|
|
59
|
+
* Accepts any value supported by `launch-editor` — an editor name/alias
|
|
60
|
+
* (e.g. `"code"`, `"webstorm"`, `"vim"`, `"atom"`) or the full path to
|
|
61
|
+
* the editor executable.
|
|
62
|
+
*
|
|
63
|
+
* If omitted, `launch-editor` auto-detects the editor from the `EDITOR`
|
|
64
|
+
* / `VISUAL` environment variables or from the currently running IDE
|
|
65
|
+
* process detected on the OS process list.
|
|
66
|
+
* @example "webstorm"
|
|
67
|
+
* @example "code"
|
|
68
|
+
*/
|
|
69
|
+
editor?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Initial panel height as a percentage of the viewport height (20–95).
|
|
72
|
+
* @default 60
|
|
73
|
+
*/
|
|
74
|
+
height?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Inject `data-vdt-source="<file>:<line>:<col>"` attributes into every JSX
|
|
77
|
+
* opening element during development. This lets the inspector jump directly
|
|
78
|
+
* to the source file when an element is clicked.
|
|
79
|
+
*
|
|
80
|
+
* Only active when `mode === 'development'`. Set `enabled: false` to opt out.
|
|
81
|
+
* Use `ignore.files` / `ignore.components` to exclude specific paths or
|
|
82
|
+
* component names (strings are treated as glob patterns).
|
|
83
|
+
* @default { enabled: true }
|
|
84
|
+
*/
|
|
85
|
+
injectSource?: {
|
|
86
|
+
enabled?: boolean;
|
|
87
|
+
ignore?: InjectSourceIgnore;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Keyboard shortcut bindings.
|
|
91
|
+
* These are project-level defaults; users can still override them via the
|
|
92
|
+
* Settings app (stored in localStorage).
|
|
93
|
+
*/
|
|
94
|
+
keybindings?: {
|
|
95
|
+
/** Close active app / panel. \@default "Escape" */
|
|
96
|
+
close?: string;
|
|
97
|
+
/** Toggle the DevTools panel open/closed. \@default "Alt+Shift+D" */
|
|
98
|
+
toggle?: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Auto-hide the toolbar pill after this many milliseconds of inactivity.
|
|
102
|
+
* Set to -1 to never auto-hide.
|
|
103
|
+
* @default 5000
|
|
104
|
+
*/
|
|
105
|
+
minimizePanelInactive?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Toolbar placement (coarse shorthand — sets the edge and rough horizontal
|
|
108
|
+
* alignment of the toolbar pill).
|
|
109
|
+
* @default "bottom-center"
|
|
110
|
+
*/
|
|
111
|
+
placement?: "bottom-left" | "bottom-center" | "bottom-right";
|
|
112
|
+
/**
|
|
113
|
+
* Which edge of the viewport the toolbar pill is anchored to.
|
|
114
|
+
* Takes precedence over the edge implied by `placement`.
|
|
115
|
+
* @default "bottom"
|
|
116
|
+
*/
|
|
117
|
+
position?: "bottom" | "left" | "right" | "top";
|
|
118
|
+
/**
|
|
119
|
+
* Reduce motion for accessibility (disables all CSS animations).
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
reduceMotion?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Strip all \@visulima/dev-toolbar imports and virtual modules when building
|
|
125
|
+
* for production (i.e. when `command !== 'serve'` or `mode === 'production'`).
|
|
126
|
+
* This guarantees the toolbar never ends up in a production bundle even if the
|
|
127
|
+
* user accidentally imports our package in application code.
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
130
|
+
removeDevtoolsOnBuild?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Only activate the toolbar when the URL contains a specific query parameter.
|
|
133
|
+
* Useful for staging/production environments where you want opt-in debugging.
|
|
134
|
+
* @example requireUrlFlag: true, urlFlagName: 'debug' → toolbar only shows when URL has ?debug=true
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
requireUrlFlag?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Custom server RPC functions
|
|
140
|
+
*/
|
|
141
|
+
serverFunctions?: Partial<ServerFunctions>;
|
|
142
|
+
/**
|
|
143
|
+
* The URL query parameter name used when requireUrlFlag is true.
|
|
144
|
+
* @default 'devtools'
|
|
145
|
+
*/
|
|
146
|
+
urlFlagName?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Initial panel width as a percentage of the viewport width (20–95).
|
|
149
|
+
* Applies when position is "left" or "right".
|
|
150
|
+
* @default 80
|
|
151
|
+
*/
|
|
152
|
+
width?: number;
|
|
145
153
|
}
|
|
146
154
|
/**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
155
|
+
* Returns the Vite plugin array for the dev toolbar.
|
|
156
|
+
*/
|
|
157
|
+
declare const devToolbar: (options?: DevToolbarOptions) => Plugin[];
|
|
158
|
+
export { DevToolbarOptions, devToolbar };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/dev-toolbar",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.14",
|
|
4
4
|
"description": "Devtools is a set of tools for building advanced devtools for your application",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"dev-toolbar",
|
|
7
|
+
"visulima"
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://visulima.com/packages/dev-toolbar",
|
|
10
10
|
"bugs": {
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
125
|
-
"axe-core": "4.11.
|
|
125
|
+
"axe-core": "4.11.4",
|
|
126
126
|
"vite": "^6 || ^7 || ^8",
|
|
127
127
|
"zod": "^3.0.0"
|
|
128
128
|
},
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
type Severity = "critical" | "minor" | "moderate" | "serious";
|
|
2
|
-
type Standard = "best-practice" | "wcag21aa" | "wcag22aa" | "wcag2a";
|
|
3
|
-
interface A11yNode {
|
|
4
|
-
html: string;
|
|
5
|
-
selector: string;
|
|
6
|
-
}
|
|
7
|
-
interface A11yIssue {
|
|
8
|
-
helpUrl: string;
|
|
9
|
-
id: string;
|
|
10
|
-
impact: Severity;
|
|
11
|
-
message: string;
|
|
12
|
-
nodes: A11yNode[];
|
|
13
|
-
wcagTags: string[];
|
|
14
|
-
}
|
|
15
|
-
interface A11yStoreState {
|
|
16
|
-
isScanning: boolean;
|
|
17
|
-
issues: A11yIssue[];
|
|
18
|
-
lastScan: string | undefined;
|
|
19
|
-
scanError: string | undefined;
|
|
20
|
-
showOverlays: boolean;
|
|
21
|
-
standard: Standard;
|
|
22
|
-
}
|
|
23
|
-
declare const SEVERITY_ORDER: Severity[];
|
|
24
|
-
type Listener = () => void;
|
|
25
|
-
declare class A11yStore {
|
|
26
|
-
private listeners;
|
|
27
|
-
private state;
|
|
28
|
-
constructor();
|
|
29
|
-
clearHighlights(): void;
|
|
30
|
-
getState(): Readonly<A11yStoreState>;
|
|
31
|
-
highlightIssue(issue: A11yIssue): void;
|
|
32
|
-
scan(disabledRules?: string[]): Promise<void>;
|
|
33
|
-
setShowOverlays(show: boolean): void;
|
|
34
|
-
setStandard(standard: Standard): void;
|
|
35
|
-
subscribe(listener: Listener): () => void;
|
|
36
|
-
private notify;
|
|
37
|
-
private persist;
|
|
38
|
-
private update;
|
|
39
|
-
}
|
|
40
|
-
declare const a11yStore: A11yStore;
|
|
41
|
-
export type { A11yIssue, A11yNode, A11yStoreState, Severity, Standard };
|
|
42
|
-
export { a11yStore, SEVERITY_ORDER };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ComponentChildren } from "preact";
|
|
2
|
-
import type { AppTooltipProps } from "../../types/app.d.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Hover tooltip for the Accessibility app button.
|
|
5
|
-
* Shows a summary of scan results and quick action buttons.
|
|
6
|
-
* @param _props Tooltip props (unused; reads from a11yStore directly)
|
|
7
|
-
* @returns Rendered tooltip component
|
|
8
|
-
*/
|
|
9
|
-
declare const A11yTooltip: (_props: AppTooltipProps) => ComponentChildren;
|
|
10
|
-
export default A11yTooltip;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface A11yInfo {
|
|
2
|
-
ariaAttributes: Record<string, string>;
|
|
3
|
-
focusable: boolean;
|
|
4
|
-
role: string | null;
|
|
5
|
-
tabindex: number | null;
|
|
6
|
-
}
|
|
7
|
-
/** Collect accessibility-relevant attributes from an element. */
|
|
8
|
-
declare const captureA11yInfo: (element: Element) => A11yInfo;
|
|
9
|
-
/** Format A11yInfo as a plain-text summary for clipboard. */
|
|
10
|
-
declare const formatA11yText: (info: A11yInfo) => string;
|
|
11
|
-
export { captureA11yInfo, formatA11yText };
|
|
12
|
-
export type { A11yInfo };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Annotation overlay — renders annotation markers on the page canvas,
|
|
3
|
-
* provides inline annotation form, detail popup, edit mode, screenshot capture,
|
|
4
|
-
* freeze mode, markdown export, and SPA navigation persistence.
|
|
5
|
-
*
|
|
6
|
-
* All DOM elements are injected into document.body (outside Shadow DOM)
|
|
7
|
-
* to match the inspector's rendering approach.
|
|
8
|
-
*/
|
|
9
|
-
import type { Annotation, BoundingBox } from "../../types/annotations.d.ts";
|
|
10
|
-
/**
|
|
11
|
-
* Returns true when the Annotations panel app is registered in the toolbar.
|
|
12
|
-
*/
|
|
13
|
-
export declare const isAnnotationsAppEnabled: () => boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Convert viewport click coords to page-absolute coords for storage.
|
|
16
|
-
* x = percentage of viewport width, y = absolute page Y (scrollY + clientY).
|
|
17
|
-
* For fixed elements, y stays as viewport-relative (no scrollY offset).
|
|
18
|
-
*/
|
|
19
|
-
export declare const toPageCoords: (clientX: number, clientY: number, fixed?: boolean) => {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
};
|
|
23
|
-
/** Load annotations from server and render markers. */
|
|
24
|
-
export declare const loadAndShowMarkers: () => Promise<void>;
|
|
25
|
-
/** Remove all annotation markers and detach listeners. */
|
|
26
|
-
export declare const removeAllMarkers: () => void;
|
|
27
|
-
/** Close all annotation popups (form, detail) and area outline, but keep markers. */
|
|
28
|
-
export declare const closeAnnotationPopups: () => void;
|
|
29
|
-
/** Whether the annotation form popup is currently open. */
|
|
30
|
-
export declare const isAnnotationFormOpen: () => boolean;
|
|
31
|
-
/** Shake the annotation form to draw attention. */
|
|
32
|
-
export declare const shakeAnnotationForm: () => void;
|
|
33
|
-
/**
|
|
34
|
-
* Show annotation form popup. Captures selectedText, nearbyText, framework context,
|
|
35
|
-
* and generates a smart CSS selector.
|
|
36
|
-
*/
|
|
37
|
-
export declare const showAnnotationForm: (element: Element, rect: DOMRect, source: string | undefined, editAnnotation?: Annotation, clickPoint?: {
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
}) => void;
|
|
41
|
-
/**
|
|
42
|
-
* Show annotation form for a multi-select (drag) region.
|
|
43
|
-
* Creates a single annotation covering multiple elements.
|
|
44
|
-
*/
|
|
45
|
-
export declare const showMultiSelectForm: (elements: Element[], selectionRect: DOMRect, boundingBoxes: BoundingBox[]) => void;
|
|
46
|
-
/**
|
|
47
|
-
* Show annotation form for an empty area selection (no elements found in drag region).
|
|
48
|
-
* Like agentation: creates an "Area selection" annotation with the region as bounding box.
|
|
49
|
-
* Shows a green dashed outline around the selected region.
|
|
50
|
-
*/
|
|
51
|
-
export declare const showAreaSelectionForm: (selectionRect: DOMRect) => void;
|
|
52
|
-
export declare const attachMarkdownShortcut: () => void;
|
|
53
|
-
export declare const detachMarkdownShortcut: () => void;
|
|
54
|
-
/** Check if a target is over an annotation overlay element. */
|
|
55
|
-
export declare const isOverAnnotationOverlay: (target: Element | undefined) => boolean;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Annotation-specific settings — output detail level, marker appearance,
|
|
3
|
-
* interaction behavior. Persisted in localStorage.
|
|
4
|
-
*/
|
|
5
|
-
export type OutputDetailLevel = "compact" | "detailed" | "forensic" | "standard";
|
|
6
|
-
export type MarkerClickBehavior = "delete" | "detail" | "edit";
|
|
7
|
-
export interface MarkerColor {
|
|
8
|
-
/** Solid background for the marker */
|
|
9
|
-
bg: string;
|
|
10
|
-
/** Slightly darker ring / shadow tint */
|
|
11
|
-
border: string;
|
|
12
|
-
/** Text color inside the marker (white or dark for contrast) */
|
|
13
|
-
fg: string;
|
|
14
|
-
/** Translucent version for hover highlight overlay on elements */
|
|
15
|
-
highlightBg: string;
|
|
16
|
-
label: string;
|
|
17
|
-
name: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const MARKER_COLORS: MarkerColor[];
|
|
20
|
-
export interface AnnotationSettings {
|
|
21
|
-
/** Block clicks on interactive elements (buttons, links, inputs) while active */
|
|
22
|
-
blockInteractions: boolean;
|
|
23
|
-
/** What happens when you click a marker */
|
|
24
|
-
markerClickBehavior: MarkerClickBehavior;
|
|
25
|
-
/** Marker color name (from MARKER_COLORS) */
|
|
26
|
-
markerColorName: string;
|
|
27
|
-
/** Output detail level for markdown export */
|
|
28
|
-
outputDetail: OutputDetailLevel;
|
|
29
|
-
}
|
|
30
|
-
export declare const DEFAULT_SETTINGS: AnnotationSettings;
|
|
31
|
-
export declare const loadSettings: () => AnnotationSettings;
|
|
32
|
-
export declare const saveSettings: (settings: AnnotationSettings) => void;
|
|
33
|
-
export declare const getMarkerColor: (settings?: AnnotationSettings) => MarkerColor;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Element utility functions for annotation — shadow DOM piercing, CSS selector
|
|
3
|
-
* generation, smart naming, text extraction, a11y capture, computed styles,
|
|
4
|
-
* framework detection, screenshot, freeze, markdown export.
|
|
5
|
-
*/
|
|
6
|
-
import type { AccessibilityInfo, BoundingBox, FrameworkContext } from "../../types/annotations.d.ts";
|
|
7
|
-
export declare const deepElementFromPoint: (x: number, y: number) => Element | null;
|
|
8
|
-
/**
|
|
9
|
-
* Get the viewport-relative bounding rect for an element, accounting for
|
|
10
|
-
* it potentially being inside nested iframes.
|
|
11
|
-
*/
|
|
12
|
-
export declare const getViewportRect: (element: Element) => DOMRect;
|
|
13
|
-
/**
|
|
14
|
-
* Pierce mode: Cmd+hover to find the actual element underneath invisible
|
|
15
|
-
* overlays, animation wrappers, and empty container divs.
|
|
16
|
-
*
|
|
17
|
-
* Two-pass approach:
|
|
18
|
-
* 1. Find elements with direct text content (skips empty wrappers)
|
|
19
|
-
* 2. If no text found, return the smallest visible element (catches
|
|
20
|
-
* visual-only elements like timeline bars, chart segments, swatches)
|
|
21
|
-
*/
|
|
22
|
-
export declare const pierceElementFromPoint: (x: number, y: number) => Element | null;
|
|
23
|
-
export declare const getParentElement: (element: Element) => Element | null;
|
|
24
|
-
/**
|
|
25
|
-
* Check if element or any ancestor has fixed or sticky positioning.
|
|
26
|
-
*/
|
|
27
|
-
export declare const isElementFixed: (element: Element) => boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Generate a human-readable element label like agentation:
|
|
30
|
-
* button "Submit", link to /page, image "alt text", input[type=email]
|
|
31
|
-
*/
|
|
32
|
-
export declare const getElementLabel: (element: Element) => string;
|
|
33
|
-
/**
|
|
34
|
-
* Generate a unique CSS selector for an element.
|
|
35
|
-
* Strategy: ID → unique class combo → nth-of-type fallback.
|
|
36
|
-
*/
|
|
37
|
-
export declare const generateSelector: (element: Element) => string;
|
|
38
|
-
/**
|
|
39
|
-
* Clean CSS classes by stripping module hash suffixes.
|
|
40
|
-
*/
|
|
41
|
-
export declare const cleanCssClasses: (classes: DOMTokenList) => string;
|
|
42
|
-
/**
|
|
43
|
-
* Build full DOM ancestry path (body > main > article > section > p).
|
|
44
|
-
* Marks shadow DOM boundary crossings with ⟨shadow⟩.
|
|
45
|
-
*/
|
|
46
|
-
export declare const getFullDomPath: (element: Element) => string;
|
|
47
|
-
/**
|
|
48
|
-
* Get sibling elements as context (up to 5 siblings).
|
|
49
|
-
*/
|
|
50
|
-
export declare const getNearbyElements: (element: Element) => string;
|
|
51
|
-
/**
|
|
52
|
-
* Extract nearby text content from an element (up to maxLength chars).
|
|
53
|
-
*/
|
|
54
|
-
export declare const getNearbyText: (element: Element, maxLength?: number) => string;
|
|
55
|
-
/**
|
|
56
|
-
* Capture currently selected text (up to maxLength chars).
|
|
57
|
-
*/
|
|
58
|
-
export declare const getSelectedText: (maxLength?: number) => string;
|
|
59
|
-
/**
|
|
60
|
-
* Capture accessibility attributes from an element.
|
|
61
|
-
*/
|
|
62
|
-
export declare const captureAccessibility: (element: Element) => AccessibilityInfo;
|
|
63
|
-
/**
|
|
64
|
-
* Capture key computed styles for forensic context.
|
|
65
|
-
*/
|
|
66
|
-
export declare const captureComputedStyles: (element: Element) => string;
|
|
67
|
-
/**
|
|
68
|
-
* Detect framework component for an element.
|
|
69
|
-
*/
|
|
70
|
-
export declare const detectFrameworkComponent: (element: Element) => FrameworkContext | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Capture a screenshot of an element's bounding area.
|
|
73
|
-
*
|
|
74
|
-
* Uses the Screen Capture API (getDisplayMedia) to capture a frame from the
|
|
75
|
-
* screen, then crops to the element's bounding rect. This is the most reliable
|
|
76
|
-
* approach — works with external CSS, images, shadow DOM, and canvas content.
|
|
77
|
-
*
|
|
78
|
-
* Falls back to null if the user denies permission or the API is unavailable.
|
|
79
|
-
*/
|
|
80
|
-
export declare const captureElementScreenshot: (element: Element) => Promise<string | null>;
|
|
81
|
-
/**
|
|
82
|
-
* Get all elements within a rectangular region.
|
|
83
|
-
* Searches across shadow DOM and same-origin iframes.
|
|
84
|
-
*/
|
|
85
|
-
export declare const getElementsInRect: (rect: DOMRect) => Element[];
|
|
86
|
-
/**
|
|
87
|
-
* Get bounding boxes from a list of elements (iframe-aware).
|
|
88
|
-
*/
|
|
89
|
-
export declare const getElementBoundingBoxes: (elements: Element[]) => BoundingBox[];
|
|
90
|
-
/**
|
|
91
|
-
* Output detail levels:
|
|
92
|
-
* - compact: "Element: comment (re: "selected text...")"
|
|
93
|
-
* - standard: Element + location + component + feedback
|
|
94
|
-
* - detailed: + classes, position, context text
|
|
95
|
-
* - forensic: + full DOM path, styles, accessibility, nearby elements
|
|
96
|
-
*/
|
|
97
|
-
export declare const annotationsToMarkdown: (annotations: {
|
|
98
|
-
accessibility?: AccessibilityInfo;
|
|
99
|
-
comment: string;
|
|
100
|
-
computedStyles?: string;
|
|
101
|
-
cssClasses?: string;
|
|
102
|
-
elementLabel?: string;
|
|
103
|
-
elementPath?: string;
|
|
104
|
-
elementTag: string;
|
|
105
|
-
frameworkContext?: FrameworkContext;
|
|
106
|
-
fullPath?: string;
|
|
107
|
-
intent: string;
|
|
108
|
-
nearbyElements?: string;
|
|
109
|
-
nearbyText?: string;
|
|
110
|
-
selectedText?: string;
|
|
111
|
-
severity: string;
|
|
112
|
-
source?: string;
|
|
113
|
-
status: string;
|
|
114
|
-
url: string;
|
|
115
|
-
}[], detail?: "compact" | "detailed" | "forensic" | "standard") => string;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Freeze Animations — comprehensive animation/timer freeze system.
|
|
3
|
-
*
|
|
4
|
-
* Monkey-patches setTimeout, setInterval, and requestAnimationFrame so that
|
|
5
|
-
* callbacks are silently queued while frozen. Also injects CSS to pause
|
|
6
|
-
* CSS animations/transitions, pauses WAAPI animations, and pauses videos.
|
|
7
|
-
*
|
|
8
|
-
* Patches are installed as a side effect of importing this module.
|
|
9
|
-
* Toolbar/popup code must import `originalSetTimeout` to bypass the patch.
|
|
10
|
-
*
|
|
11
|
-
* Based on agentation's freeze-animations.ts pattern.
|
|
12
|
-
*/
|
|
13
|
-
/** Original (unpatched) setTimeout — use for toolbar/popup animations */
|
|
14
|
-
export declare const originalSetTimeout: typeof setTimeout;
|
|
15
|
-
/** Whether animations are currently frozen */
|
|
16
|
-
export declare const isFrozen: () => boolean;
|
|
17
|
-
/** Freeze all animations, timers, and videos */
|
|
18
|
-
export declare const freezeAll: () => void;
|
|
19
|
-
/** Unfreeze — resume everything and replay queued callbacks */
|
|
20
|
-
export declare const unfreezeAll: () => void;
|
|
21
|
-
/** Toggle freeze state */
|
|
22
|
-
export declare const toggleFreeze: () => boolean;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Start element inspection mode.
|
|
3
|
-
* Attaches crosshair cursor, hover highlight overlay, and a floating badge.
|
|
4
|
-
* Inspection stays active after each click so the user can inspect multiple
|
|
5
|
-
* elements without re-activating. Only stops on explicit cancel (Escape,
|
|
6
|
-
* badge Cancel button) or via {@link stopGlobalInspection}.
|
|
7
|
-
* Survives component unmounts — state lives at module level.
|
|
8
|
-
* @param onCancel Called when the user cancels via badge button or Escape.
|
|
9
|
-
*/
|
|
10
|
-
export declare const startGlobalInspection: (onCancel: () => void) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Cancel any in-progress inspection and clean up all DOM side-effects.
|
|
13
|
-
*/
|
|
14
|
-
export declare const stopGlobalInspection: () => void;
|