@pixelmatters/markup 1.23.0 → 1.25.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 +12 -8
- package/dist/widget.d.ts +37 -8
- package/dist/widget.js +2567 -2130
- 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.25.0'
|
|
41
41
|
// or
|
|
42
|
-
// import { init } from 'https://esm.run/@pixelmatters/markup@1.
|
|
42
|
+
// import { init } from 'https://esm.run/@pixelmatters/markup@1.25.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.25.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.25.0"
|
|
61
61
|
data-markup-widget="true"
|
|
62
62
|
data-api-url="https://your-deployment.convex.site"
|
|
63
63
|
data-api-key="markup_..."
|
|
@@ -219,7 +219,9 @@ Appearance persists to the host page's `localStorage` (`markup:widget:theme`) an
|
|
|
219
219
|
|
|
220
220
|
**Show resolved threads** is off by default. Turned on, the widget also renders the route's most recently resolved threads (up to 100) as muted check-mark pins. Opening one shows the thread read-only: no replies, edits, reactions or resolve button. Reopening still happens from the dashboard.
|
|
221
221
|
|
|
222
|
-
The last two menu rows open
|
|
222
|
+
The last two menu rows open inside the menu itself, replacing the rows with a
|
|
223
|
+
reading panel and a **Back** button. `Esc` steps back to the rows, and again to
|
|
224
|
+
close.
|
|
223
225
|
|
|
224
226
|
- **Privacy & data.** A plain-language account of what the widget holds, generated from the live session rather than from a policy document: who you're posting as, what a comment sends, what sits in this site's storage, whether captures are on, and the single host the widget talks to. Anonymous visitors also get **Forget me on this site** here, with the same arm-then-confirm as the identity menu.
|
|
225
227
|
- **Keyboard shortcuts.** The table below, in the modifier vocabulary of the reader's platform. The menu is the only way in on purpose: a key binding for it (`?` being the conventional one) would compete with whatever your app already binds, and the widget can't see your handlers to know.
|
|
@@ -273,6 +275,7 @@ The overflow menu's **Privacy & data** panel restates all of this for the person
|
|
|
273
275
|
Capture degrades instead of failing outright:
|
|
274
276
|
|
|
275
277
|
- **An image the browser won't hand over** comes through blank, and the rest of the page still captures. A third-party avatar served without CORS headers is the usual culprit. It used to abort the whole screenshot.
|
|
278
|
+
- **Icons from an SVG sprite** are fetched and inlined before the capture. The capture renders your page as an SVG document, which is not allowed to load anything external, so a `<use href="/sprite.svg#icon">` would otherwise draw nothing — on a design system that ships its icons that way, every icon in the screenshot went missing. A sprite the widget can't read (cross-origin without CORS headers, or outside your `connect-src`) leaves those icons blank and the rest captures as before.
|
|
276
279
|
- **An oversized capture** is re-encoded until it fits the server's 2 MB cap: quality drops first (0.85 → 0.6), then the raster shrinks (full → ¾ → ½), because a smaller sharp screenshot beats a full-size illegible one.
|
|
277
280
|
- **If nothing works**, the composer reads _Screenshot unavailable_ and the comment posts without one. Previously the row just disappeared, which looked identical to screenshots being switched off for the project.
|
|
278
281
|
|
|
@@ -372,7 +375,7 @@ For a `<script>` tag drop-in (no bundler), use the inline ESM form and **pin the
|
|
|
372
375
|
|
|
373
376
|
```html
|
|
374
377
|
<script type="module">
|
|
375
|
-
import { init } from 'https://esm.sh/@pixelmatters/markup@1.
|
|
378
|
+
import { init } from 'https://esm.sh/@pixelmatters/markup@1.25.0'
|
|
376
379
|
|
|
377
380
|
init({
|
|
378
381
|
apiUrl: '...',
|
|
@@ -388,7 +391,7 @@ If inline JS is disallowed (some CMS / page-builder editors), use the auto-init
|
|
|
388
391
|
```html
|
|
389
392
|
<script
|
|
390
393
|
type="module"
|
|
391
|
-
src="https://esm.sh/@pixelmatters/markup@1.
|
|
394
|
+
src="https://esm.sh/@pixelmatters/markup@1.25.0"
|
|
392
395
|
data-markup-widget="true"
|
|
393
396
|
data-api-url="..."
|
|
394
397
|
data-api-key="..."
|
|
@@ -420,11 +423,12 @@ If the host page ships a CSP, the widget needs:
|
|
|
420
423
|
| ------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
421
424
|
| `connect-src` | `https://<deployment>.convex.site` | threads, comments, identity, screenshot upload, error reports |
|
|
422
425
|
| `connect-src` | `wss://<deployment>.convex.cloud` | live thread updates |
|
|
426
|
+
| `connect-src` | your own origin, if you serve icons from an SVG sprite | fetched so `<use href="/sprite.svg#icon">` icons aren't blank in screenshots |
|
|
423
427
|
| `img-src` | wherever your team's profile pictures are hosted, plus `blob:` and `data:` | avatars, the screenshot preview thumbnail, and the capture pipeline |
|
|
424
428
|
| `script-src` | `https://esm.sh` | CDN path only; a bundled install needs nothing here |
|
|
425
429
|
| `style-src` | `'unsafe-inline'` | the widget appends its stylesheet as a `<style>` element inside its own shadow root |
|
|
426
430
|
|
|
427
|
-
Only `img-src`
|
|
431
|
+
Only `img-src` and the sprite entry degrade gracefully: a blocked avatar falls back to initials, and a blocked image or sprite in a capture comes through blank. A missing `connect-src` entry stops the widget working at all, and a missing `style-src` one leaves it unstyled.
|
|
428
432
|
|
|
429
433
|
## Browser support
|
|
430
434
|
|
package/dist/widget.d.ts
CHANGED
|
@@ -7,28 +7,48 @@ export type WidgetTheme = 'light' | 'dark' | 'auto';
|
|
|
7
7
|
*/
|
|
8
8
|
export type WidgetFab = 'default' | 'icon-only';
|
|
9
9
|
export interface ScreenshotsConfig {
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Disable screenshot capture entirely.
|
|
12
|
+
*
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
11
15
|
enabled?: boolean;
|
|
12
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Also masks all inputs/selects/textareas in addition to the default sensitive set.
|
|
18
|
+
*
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
13
21
|
strictScrub?: boolean;
|
|
14
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Custom CSS selector — matched elements are always masked.
|
|
24
|
+
*
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
15
27
|
redactSelector?: string;
|
|
16
28
|
}
|
|
17
29
|
export interface WidgetConfig {
|
|
18
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Convex deployment site URL, e.g. `https://your-deployment.convex.site`
|
|
32
|
+
*/
|
|
19
33
|
apiUrl: string;
|
|
20
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Raw API key minted from a project's settings page
|
|
36
|
+
*/
|
|
21
37
|
apiKey: string;
|
|
22
38
|
/**
|
|
23
39
|
* Initial corner for the toolbar. Defaults to bottom-right. Users can
|
|
24
40
|
* move it afterwards from the toolbar's overflow menu.
|
|
41
|
+
*
|
|
42
|
+
* @default 'bottom-right'
|
|
25
43
|
*/
|
|
26
44
|
position?: 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
27
45
|
/**
|
|
28
46
|
* Visual theme.
|
|
29
47
|
* - `'light'` — force light palette
|
|
30
48
|
* - `'dark'` — force dark palette
|
|
31
|
-
* - `'auto'`
|
|
49
|
+
* - `'auto'` — follow the host's `prefers-color-scheme`
|
|
50
|
+
*
|
|
51
|
+
* @default 'auto'
|
|
32
52
|
*/
|
|
33
53
|
theme?: WidgetTheme;
|
|
34
54
|
/**
|
|
@@ -37,20 +57,27 @@ export interface WidgetConfig {
|
|
|
37
57
|
* `'icon-only'` describes anything the widget can render. Accepted
|
|
38
58
|
* (and dropped) so upgrading doesn't break callers that still pass it;
|
|
39
59
|
* remove it from your config. Will be deleted in the next major.
|
|
60
|
+
*
|
|
61
|
+
* @default undefined
|
|
40
62
|
*/
|
|
41
63
|
fab?: WidgetFab;
|
|
42
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Screenshot capture and PII-scrub options.
|
|
66
|
+
*
|
|
67
|
+
* @default undefined
|
|
68
|
+
*/
|
|
43
69
|
screenshots?: ScreenshotsConfig;
|
|
44
70
|
/**
|
|
45
71
|
* Optional dashboard URL the widget links to from the verified-user
|
|
46
72
|
* identity menu ("Account →"). When omitted the menu hides the
|
|
47
73
|
* Account entry. Useful for self-hosters whose dashboard origin
|
|
48
74
|
* isn't statically known to the widget.
|
|
75
|
+
*
|
|
76
|
+
* @default 'https://markup.pixelmatters.dev'
|
|
49
77
|
*/
|
|
50
78
|
dashboardUrl?: string;
|
|
51
79
|
/**
|
|
52
80
|
* Product telemetry — counts of widget interactions, sent to Markup.
|
|
53
|
-
* Default: enabled.
|
|
54
81
|
*
|
|
55
82
|
* What it is not: it adds no third-party script, sets no cookie and
|
|
56
83
|
* writes nothing to storage, and carries no identifier for the person
|
|
@@ -60,6 +87,8 @@ export interface WidgetConfig {
|
|
|
60
87
|
*
|
|
61
88
|
* Set `false` if your privacy policy or DPA is easier to write
|
|
62
89
|
* without it.
|
|
90
|
+
*
|
|
91
|
+
* @default true
|
|
63
92
|
*/
|
|
64
93
|
analytics?: boolean;
|
|
65
94
|
}
|