mesurer-solid 0.2.5 → 0.2.6-beta.0
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/README.md +18 -2
- package/dist/index.d.ts +17 -0
- package/dist/index.js +3945 -3688
- package/dist/inject-script.js +22 -22
- package/dist/inject.js +3941 -3684
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1681 -1594
- package/dist/recording.d.ts +2 -0
- package/package.json +1 -1
- package/skills/mesurer-ui/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ const mesurer = mountMesurer({
|
|
|
72
72
|
})
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
The base inspector includes Select, X-ray, Color Picker, Rulers, Typography, Guides, Distance, Settings, plugin hosting, direct text editing, and the low-level inspection API. First-party Recording uses MediaBunny for encoded video, trim, resize, and WebM/MP4 export; its capture adapters only acquire pixels. Electron apps should import `mesurer-solid/electron` once from the main-process entrypoint before creating BrowserWindows; Mesurer then owns its narrow Recording preload/IPC automatically, so the app does not add Recording code to its own preload. The toolbar groups those controls into Select and Edit. Motion inspection is built into Select and appears for the selected element, with a live preview, playback controls, and keyframe details. Select, measurement geometry, X-ray, Motion, and Context can inspect same-origin iframes; cross-origin frame contents are inaccessible. Typography stays read-only in Select; Edit owns movement and direct text/style changes. Color Picker uses application-local capture when `window.__MESURER_HOST__.captureScreenshot` is available; other supported browser hosts use an operational `EyeDropper`. A successful sample is copied to the clipboard using `colorPickerClickFormat`.
|
|
75
|
+
The base inspector includes Select, X-ray, Color Picker, Rulers, Typography, Guides, Distance, Settings, plugin hosting, direct text editing, and the low-level inspection API. First-party Recording uses MediaBunny for encoded video, trim, resize, and WebM/MP4 export; its capture adapters only acquire pixels. Electron apps should import `mesurer-solid/electron` once from the main-process entrypoint before creating BrowserWindows; Mesurer then owns its narrow Recording preload/IPC automatically, so the app does not add Recording code to its own preload. The toolbar groups those controls into Select and Edit. Motion inspection is built into Select and appears for the selected element, with a live preview, playback controls, and keyframe details. Select, measurement geometry, X-ray, Motion, and Context can inspect same-origin iframes; cross-origin frame contents are inaccessible. Typography stays read-only in Select; Edit owns movement and direct text/style changes. Color Picker uses application-local capture when `window.__MESURER_HOST__.captureScreenshot` is available; other supported browser hosts use an operational `EyeDropper`. A successful sample is copied to the clipboard using `colorPickerClickFormat`. The browser picker needs Chromium on Windows or macOS; Linux builds may not expose `EyeDropper`, in which case the tool is hidden.
|
|
76
76
|
|
|
77
77
|
`mesurer-solid/plugins` also exports the built-in factories for lower-level composition. Normal mounts already include the built-ins. Use `excludeBuiltins` with names such as `"xray"`, `"typography"`, and `"colorPicker"` when a mount should omit one.
|
|
78
78
|
|
|
@@ -107,7 +107,7 @@ Programmatic injection reuses an existing connected instance by default. Lifecyc
|
|
|
107
107
|
- Use Edit to move selected UI and change direct text, typography, and text color without changing source.
|
|
108
108
|
- Open the built-in, default-on Responsive inspector with **B** to inspect up to six live same-origin viewports, use per-preview Guides, and annotate preview targets through Context. Disable it in **Settings > Plugins** or omit it with `excludeBuiltins: ["responsive"]`.
|
|
109
109
|
- Capture page regions through the optional Screenshot plugin. It selects native host capture, the Chromium extension adapter, or browser display capture internally, and flattens transparent native captures against the renderer backdrop before preview, copy, or save.
|
|
110
|
-
- Record adjustable selected regions through the optional Recording plugin at 60 fps by default or 120 fps when selected and supported. Browser, extension, and Electron APIs only acquire the stream; MediaBunny owns encoding, inspection, trim, 1×/2×/3× resize, and WebM/MP4 export.
|
|
110
|
+
- Record adjustable selected regions through the optional Recording plugin at 60 fps by default or 120 fps when selected and supported. Browser, extension, and Electron APIs only acquire the stream; MediaBunny owns encoding, inspection, trim, 1×/2×/3× resize, 0.5×–2× playback speed, and WebM/MP4 export.
|
|
111
111
|
- Read selection, measurements, guides, annotations, layout, styles, and saved human intent through Context and agent APIs.
|
|
112
112
|
- Keep saved annotations across same-tab reloads and conservatively rebind them to their original DOM targets; markers, cards, and ownership evidence stay attached through scrolling, repeated-note markers stay local, Add Note remains available while a note is open, and cards/composers occlude Select hover and selection chrome.
|
|
113
113
|
- Extend the runtime with tools, settings, overlays, commands, hooks, state, and services.
|
|
@@ -117,6 +117,22 @@ Programmatic injection reuses an existing connected instance by default. Lifecyc
|
|
|
117
117
|
|
|
118
118
|
Use `1` for Select and `2` for Edit. Select owns X-ray, Color Picker, Typography, Screenshot, Recording, and built-in Motion inspection, including across accessible same-origin iframes. Edit owns movement and direct text/style changes. Rulers, Guides, and Layout Guides remain usable in both modes; Context and Codex remain visible in both modes. The grouped toolbar changes modes in 150 ms. `Shift+A` still enters Edit as a compatibility shortcut.
|
|
119
119
|
|
|
120
|
+
Set where the toolbar starts from code with the `toolbar` mount option:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
mountMesurer({
|
|
124
|
+
toolbar: {
|
|
125
|
+
position: "top-right", // "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" | "left" | "right"
|
|
126
|
+
dock: "snap", // initial dock mode, "free" (default) or "snap"
|
|
127
|
+
draggable: false, // default true
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`position` is an edge and a spot on it, with the toolbar's usual 16px inset. In Free mode `left` and `right` keep the horizontal toolbar centered along that edge; in Snap mode they stand it up. It applies only when the tab has no saved placement: a placement the user dragged, and a dock mode chosen in Settings, win over the option. With `draggable: false` the toolbar ignores pointer drags and any saved placement, stays at `position` (Snap keeps it docked to that edge and spot as the window resizes), and saves nothing; buttons, menus, and Settings work as usual. `toolbar` is also accepted by `mesurer-solid/inject`.
|
|
133
|
+
|
|
134
|
+
There is no close button on the toolbar. Remove it from code with `mounted.dispose()` or by aborting the `signal` passed to mount. `M` only turns inspection off and on; the toolbar stays visible.
|
|
135
|
+
|
|
120
136
|
Toolbar dragging starts after the pointer crosses the drag threshold. Dragging from Settings, Guide, or plugin triggers closes the open menu or panel. Pointer activity inside menus, dialogs, form controls, editable regions, and sliders does not drag the toolbar.
|
|
121
137
|
|
|
122
138
|
Select and agent point inspection use the same rendered hit-test path. They can target SVG and visible `pointer-events:none` descendants instead of collapsing those descendants to an interactive ancestor. Open shadow roots are traversed; closed shadow roots remain browser-owned boundaries. Context and annotations accept the same SVG targets. Edit movement and direct text editing only mutate HTML elements.
|
package/dist/index.d.ts
CHANGED
|
@@ -122,6 +122,21 @@ export type AgentBridgeOptions = {
|
|
|
122
122
|
globalName?: string;
|
|
123
123
|
root?: Document | HTMLElement | ShadowRoot;
|
|
124
124
|
};
|
|
125
|
+
export type MesurerToolbarOptions = {
|
|
126
|
+
/**
|
|
127
|
+
* Where the toolbar rests until the user moves it. Applies when the tab has no saved placement
|
|
128
|
+
* (or always, when `draggable` is false). Free keeps a 16px inset from the named edges;
|
|
129
|
+
* Snap docks to the edge and spot, with `left` and `right` standing the toolbar up.
|
|
130
|
+
*/
|
|
131
|
+
position?: "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right" | "left" | "right";
|
|
132
|
+
/** Initial dock mode. A mode the user chose in Settings wins. Default `"free"`. */
|
|
133
|
+
dock?: "free" | "snap";
|
|
134
|
+
/**
|
|
135
|
+
* Allow dragging the toolbar. Default `true`. When `false`, pointer drags do nothing, the placement
|
|
136
|
+
* is never saved or restored, and the toolbar stays at `position` (Snap keeps it docked there).
|
|
137
|
+
*/
|
|
138
|
+
draggable?: boolean;
|
|
139
|
+
};
|
|
125
140
|
export type MesurerOptions = {
|
|
126
141
|
highlightColor?: string;
|
|
127
142
|
guideColor?: string;
|
|
@@ -141,6 +156,8 @@ export type MesurerOptions = {
|
|
|
141
156
|
guideStyle?: Partial<GuideStyle>;
|
|
142
157
|
selectionSpacingStyle?: Partial<SelectionSpacingStyle>;
|
|
143
158
|
rulerSettings?: Partial<RulerSettings>;
|
|
159
|
+
/** Initial toolbar placement, dock mode, and whether it can be dragged. */
|
|
160
|
+
toolbar?: MesurerToolbarOptions;
|
|
144
161
|
/**
|
|
145
162
|
* Initial enabled plugin set. Omit this to use the first-party catalog defaults.
|
|
146
163
|
* First-party plugins, including Codex, remain toggleable in Settings from the
|