@pixelmatters/markup 1.29.0 → 1.30.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 +17 -16
- package/dist/widget.d.ts +4 -3
- package/dist/widget.js +7 -7
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
- package/skills/install-markup-widget/SKILL.md +4 -4
package/README.md
CHANGED
|
@@ -37,9 +37,9 @@ CDN drop-in, no build step. Paste this just before `</body>`:
|
|
|
37
37
|
```html
|
|
38
38
|
<script type="module">
|
|
39
39
|
// Pin the exact version; esm.sh resolves it from npm
|
|
40
|
-
import { init } from 'https://esm.sh/@pixelmatters/markup@1.
|
|
40
|
+
import { init } from 'https://esm.sh/@pixelmatters/markup@1.30.0'
|
|
41
41
|
// or
|
|
42
|
-
// import { init } from 'https://esm.run/@pixelmatters/markup@1.
|
|
42
|
+
// import { init } from 'https://esm.run/@pixelmatters/markup@1.30.0'
|
|
43
43
|
|
|
44
44
|
init({
|
|
45
45
|
apiUrl: 'https://your-deployment.convex.site',
|
|
@@ -50,14 +50,14 @@ CDN drop-in, no build step. Paste this just before `</body>`:
|
|
|
50
50
|
</script>
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
> **Why pin the version?** CDN URLs without a version (`@pixelmatters/markup`) resolve to whatever's `latest` on npm, so a future major release will break your page with no warning. Always pin (`@pixelmatters/markup@1.
|
|
53
|
+
> **Why pin the version?** CDN URLs without a version (`@pixelmatters/markup`) resolve to whatever's `latest` on npm, so a future major release will break your page with no warning. Always pin (`@pixelmatters/markup@1.30.0`).
|
|
54
54
|
|
|
55
55
|
If your platform doesn't allow inline JS (some CMS / page-builder editors), use the auto-init form instead. Point a `<script src=…>` at the bundle and pass config via `data-*` attributes:
|
|
56
56
|
|
|
57
57
|
```html
|
|
58
58
|
<script
|
|
59
59
|
type="module"
|
|
60
|
-
src="https://esm.sh/@pixelmatters/markup@1.
|
|
60
|
+
src="https://esm.sh/@pixelmatters/markup@1.30.0"
|
|
61
61
|
data-markup-widget="true"
|
|
62
62
|
data-api-url="https://your-deployment.convex.site"
|
|
63
63
|
data-api-key="markup_..."
|
|
@@ -255,15 +255,16 @@ close.
|
|
|
255
255
|
|
|
256
256
|
### Keyboard & mouse
|
|
257
257
|
|
|
258
|
-
| Shortcut | Action
|
|
259
|
-
| --------------------- |
|
|
260
|
-
| `c` | Start placing a markup (ignored while typing)
|
|
261
|
-
| `@` | In a composer, open the member picker. `↑`/`↓` to move, `enter` or `tab` to pick
|
|
262
|
-
| `cmd/ctrl + enter` | Post the comment being written
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
| `cmd/ctrl +
|
|
266
|
-
|
|
|
258
|
+
| Shortcut | Action |
|
|
259
|
+
| --------------------- | --------------------------------------------------------------------------------- |
|
|
260
|
+
| `c` | Start placing a markup (ignored while typing) |
|
|
261
|
+
| `@` | In a composer, open the member picker. `↑`/`↓` to move, `enter` or `tab` to pick |
|
|
262
|
+
| `cmd/ctrl + enter` | Post the comment being written |
|
|
263
|
+
| `enter` | Send a reply. `shift + enter` adds a new line, as `enter` does on touch keyboards |
|
|
264
|
+
| `esc` | Cancel placement, dismiss the mention picker, or close the open popover / menu |
|
|
265
|
+
| `cmd/ctrl + .` | Toggle HUD visibility |
|
|
266
|
+
| `cmd/ctrl + click` | Click the toolbar's comment button to hide the HUD with a hint toast |
|
|
267
|
+
| Drag a popover header | Move the open thread / new-thread popover; resets to the pin on reopen |
|
|
267
268
|
|
|
268
269
|
## Screenshots & privacy
|
|
269
270
|
|
|
@@ -401,7 +402,7 @@ to start from `anchorSource` and confirm it, not to trust it blindly.
|
|
|
401
402
|
|
|
402
403
|
## How it works
|
|
403
404
|
|
|
404
|
-
- The widget mounts `<div id="markup-widget">` on `document.body` and attaches an open shadow root.
|
|
405
|
+
- The widget mounts `<div id="markup-widget">` on `document.body` and attaches an open shadow root. It does so once the page is idle, or 2 s after `init()` on a page that never is, so `init()` returns before the element exists.
|
|
405
406
|
- All UI lives in that shadow root, with `:host { all: initial }` blocking style inheritance.
|
|
406
407
|
- The host element is `position: fixed; inset: 0; pointer-events: none`, so the widget paints over the entire viewport without blocking the host's clicks; only the toolbar and active popovers opt back in to pointer events.
|
|
407
408
|
- Pins are anchored as `(x, y)` fractions of the document plus a CSS path from the nearest landmark (a stable `id`, `data-testid`, `main`, `form`, `table`, …) and the element's text. The path wins when it still resolves, relaxing from the top if a wrapper changed, and a match whose text differs is rejected; the fraction is the fallback so pins survive layout changes.
|
|
@@ -495,7 +496,7 @@ For a `<script>` tag drop-in (no bundler), use the inline ESM form and **pin the
|
|
|
495
496
|
|
|
496
497
|
```html
|
|
497
498
|
<script type="module">
|
|
498
|
-
import { init } from 'https://esm.sh/@pixelmatters/markup@1.
|
|
499
|
+
import { init } from 'https://esm.sh/@pixelmatters/markup@1.30.0'
|
|
499
500
|
|
|
500
501
|
init({
|
|
501
502
|
apiUrl: '...',
|
|
@@ -511,7 +512,7 @@ If inline JS is disallowed (some CMS / page-builder editors), use the auto-init
|
|
|
511
512
|
```html
|
|
512
513
|
<script
|
|
513
514
|
type="module"
|
|
514
|
-
src="https://esm.sh/@pixelmatters/markup@1.
|
|
515
|
+
src="https://esm.sh/@pixelmatters/markup@1.30.0"
|
|
515
516
|
data-markup-widget="true"
|
|
516
517
|
data-api-url="..."
|
|
517
518
|
data-api-key="..."
|
package/dist/widget.d.ts
CHANGED
|
@@ -132,9 +132,10 @@ export interface WidgetConfig {
|
|
|
132
132
|
analytics?: boolean;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
* Mounts the feedback widget on the page
|
|
136
|
-
*
|
|
137
|
-
*
|
|
135
|
+
* Mounts the feedback widget on the page once it is idle, or after
|
|
136
|
+
* `IDLE_MOUNT_TIMEOUT_MS` on a page that never is. Idempotent — calling init
|
|
137
|
+
* again with the same config is a no-op; calling with different config tears
|
|
138
|
+
* down the previous instance first. A host removed from the document by the page
|
|
138
139
|
* (a body swap on navigation, say) is remounted even when the config matches.
|
|
139
140
|
*
|
|
140
141
|
* Returns a function that unmounts this instance and removes its host
|