mesurer-solid 0.1.0 → 0.1.1-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 +41 -6
- package/dist/inject-script.js +5 -5
- package/dist/inject.d.ts +4 -1
- package/dist/inject.js +1777 -1079
- package/dist/screenshot.d.ts +60 -0
- package/dist/screenshot.js +2821 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -7,12 +7,12 @@ The renderer is implemented privately in Solid 2, but consumers can use Solid 1/
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
bun add -d mesurer-solid
|
|
10
|
+
bun add -d mesurer-solid
|
|
11
11
|
# or
|
|
12
|
-
npm install -D mesurer-solid
|
|
12
|
+
npm install -D mesurer-solid
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
`mesurer-solid@0.1.0` is the stable package on the `latest` dist-tag. Prereleases through `0.1.0-beta.11` used the old scoped package name; current releases use `mesurer-solid`.
|
|
16
16
|
|
|
17
17
|
## Mount the base inspector
|
|
18
18
|
|
|
@@ -108,6 +108,14 @@ Injection installs `contextPlugin()` by default. To deliberately inject only the
|
|
|
108
108
|
window.__MESURER_CONFIG__ = { context: false }
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
+
Screenshot capture remains opt-in for normal injection:
|
|
112
|
+
|
|
113
|
+
```js
|
|
114
|
+
window.__MESURER_CONFIG__ = { screenshot: true }
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The first-party Chrome extension enables screenshot capture automatically.
|
|
118
|
+
|
|
111
119
|
## Direct context API
|
|
112
120
|
|
|
113
121
|
With the context plugin loaded:
|
|
@@ -248,9 +256,35 @@ const after = await window.__MESURER__.select([
|
|
|
248
256
|
|
|
249
257
|
For meaningful visual work, fresh Mesurer context/review is part of completion. Lint, typecheck, tests, and build are implementation checks, not rendered proof.
|
|
250
258
|
|
|
251
|
-
##
|
|
259
|
+
## Optional screenshot plugin
|
|
260
|
+
|
|
261
|
+
Screenshot capture is a removable first-party plugin instead of permanent core state:
|
|
262
|
+
|
|
263
|
+
```ts
|
|
264
|
+
import { mountMeasurer } from "mesurer-solid"
|
|
265
|
+
import { screenshotPlugin } from "mesurer-solid/screenshot"
|
|
266
|
+
|
|
267
|
+
const mesurer = mountMeasurer({
|
|
268
|
+
plugins: [
|
|
269
|
+
screenshotPlugin({
|
|
270
|
+
copy: true,
|
|
271
|
+
download: false,
|
|
272
|
+
}),
|
|
273
|
+
],
|
|
274
|
+
})
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
The camera tool lets the user drag a viewport region. Mesurer captures the visible page, crops against the real captured bitmap scale so HiDPI displays stay accurate, optionally writes PNG data to the clipboard and/or downloads a PNG, then restores the inspector UI and shows a compact preview.
|
|
278
|
+
|
|
279
|
+
Normal browser hosts use `getDisplayMedia()` and reuse a live capture stream to avoid prompting for every region. The first-party Chrome extension uses `chrome.tabs.captureVisibleTab()` through its extension bridge, so its screenshot path does not open the screen-share chooser.
|
|
280
|
+
|
|
281
|
+
Programmatic users can get the typed screenshot service from the plugin host with service id `screenshot`. `start()` opens region selection, `cancel()` closes it, `capture(rect)` captures an exact CSS-pixel viewport rectangle, and `setSettings()` updates the persistent copy/download preferences.
|
|
282
|
+
|
|
283
|
+
Screenshot does not claim the global `C` shortcut because the context workflow already uses `C` and `Shift+C`.
|
|
284
|
+
|
|
285
|
+
## Clean screenshot evidence for agents
|
|
252
286
|
|
|
253
|
-
|
|
287
|
+
The optional screenshot plugin is a human capture tool. Agent verification can continue to let the existing browser harness own screenshots while Mesurer plans a clean evidence frame:
|
|
254
288
|
|
|
255
289
|
```js
|
|
256
290
|
const plan = await window.__MESURER__.capturePlan({ scope: "selection" })
|
|
@@ -279,7 +313,7 @@ Those remain the three human context controls. `select()` is a programmatic agen
|
|
|
279
313
|
## Portable Agent Skill
|
|
280
314
|
|
|
281
315
|
```bash
|
|
282
|
-
npx --yes --package=mesurer-solid
|
|
316
|
+
npx --yes --package=mesurer-solid mesurer-skill install
|
|
283
317
|
```
|
|
284
318
|
|
|
285
319
|
The installer leaves:
|
|
@@ -323,6 +357,7 @@ Plugins can contribute tools, commands, hooks, overlays, settings, state, servic
|
|
|
323
357
|
```text
|
|
324
358
|
mesurer-solid
|
|
325
359
|
mesurer-solid/core
|
|
360
|
+
mesurer-solid/screenshot
|
|
326
361
|
mesurer-solid/inject
|
|
327
362
|
mesurer-solid/inject-script
|
|
328
363
|
```
|