mesurer-solid 0.2.5 → 0.2.6

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.
@@ -1,6 +1,6 @@
1
1
  # Mesurer agent integration
2
2
 
3
- Mesurer's agent integration is the rendered page itself. This guide matches `mesurer-solid@0.2.5` stable. The coding agent reads `window.__MESURER__` through the browser control it already has, consumes human visual intent, edits normal application source, and verifies the real Live result.
3
+ Mesurer's agent integration is the rendered page itself. This guide matches `mesurer-solid@0.2.6` stable. The coding agent reads `window.__MESURER__` through the browser control it already has, consumes human visual intent, edits normal application source, and verifies the real Live result.
4
4
 
5
5
  The normal agent workflow requires no Mesurer MCP server, Send-to-agent callback, or special browser transport. The optional `codex()` plugin is a separate human convenience path for sending Context feedback into local Codex threads; it does not replace the browser-state contract described here. In Electron it can use the native preload bridge. In an ordinary browser it can use the local Mesurer Codex Bridge companion on loopback. Neither path is the Mesurer Solid ChatGPT/Codex agent plugin.
6
6
 
@@ -26,9 +26,9 @@ The installer writes a self-contained skill and injection artifact:
26
26
 
27
27
  ## Know the available capabilities
28
28
 
29
- The base inspector includes Select, X-ray, Color Picker, Rulers, Typography, Guides, Distance, and Settings. Color Picker uses application-local host capture when available and otherwise uses a working browser `EyeDropper`.
29
+ The base inspector includes Select, X-ray, Color Picker, Rulers, Typography, Guides, Distance, and Settings. Color Picker uses application-local host capture when available and otherwise uses a working browser `EyeDropper`, which needs Chromium on Windows or macOS and is hidden where unavailable. Mount-time toolbar placement (`toolbar: { position, dock, draggable }`) is a human-UI option documented in the [package README](./README.md), not an agent control.
30
30
 
31
- First-party plugins add Context, Edit, Layout Guides, Screenshot, Recording, and optional Codex delivery. Recording is a human video-capture workflow with a typed `recording:v1` service; it is not the normal coding-agent evidence channel. Edit movement preserves the existing Arrange agent method names for compatibility. The complete public map, including the low-level inspection methods and plugin host, is in [Capabilities](../../docs/CAPABILITIES.md).
31
+ First-party plugins add Context, Edit, Layout Guides, Screenshot, Recording, and optional Codex delivery. Recording is a human video-capture workflow with a typed `recording:v1` service; it is not the normal coding-agent evidence channel. Its `export` accepts an optional `speed` of exactly 0.5, 1, 1.5, or 2; any other value is rejected (see [Recording](../../docs/RECORDING.md)). Edit movement preserves the existing Arrange agent method names for compatibility. The complete public map, including the low-level inspection methods and plugin host, is in [Capabilities](../../docs/CAPABILITIES.md).
32
32
 
33
33
  Rulers, ordinary Guides, and Layout Guides remain available while the human is in Edit; X-ray, Color Picker, Typography, Screenshot, and Recording remain Select-lane tools. For normal coding-agent work, use `window.__MESURER__`. Use `window.__MESURER_INSTANCE__` only when the task requires mounted-instance or plugin-host operations.
34
34
 
package/README.md CHANGED
@@ -4,7 +4,7 @@ Framework-agnostic UI inspection, measurement, visual intent, and agent-readable
4
4
 
5
5
  Mesurer Solid ships its own isolated Solid 2 renderer. Host applications can use Solid 1 or 2, React, Vue, Svelte, vanilla DOM, or an Electron renderer without providing Solid.
6
6
 
7
- **Current stable:** `mesurer-solid@0.2.5` on the `latest` dist-tag.
7
+ **Current stable:** `mesurer-solid@0.2.6` on the `latest` dist-tag.
8
8
 
9
9
  <p align="center">
10
10
  <img src="https://raw.githubusercontent.com/jhomra21/mesurer-solid/main/docs/assets/readme/hero-multi-spacing.png" alt="Mesurer Solid measuring spacing between selected elements" width="100%">
@@ -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