@pixelmatters/markup 1.26.0 → 1.27.1
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 +97 -15
- package/dist/widget.d.ts +39 -0
- package/dist/widget.js +1395 -1310
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
- package/skills/install-markup-widget/SKILL.md +14 -13
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ sources:
|
|
|
7
7
|
- 'Pixelmatters/markup:packages/widget/src/widget.ts'
|
|
8
8
|
metadata:
|
|
9
9
|
library: pixelmatters-markup
|
|
10
|
-
library_version: '1.
|
|
10
|
+
library_version: '1.27.1'
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
`@pixelmatters/markup` is a Preact widget that runs inside a shadow DOM and talks to a hosted Convex backend at `https://<deployment>.convex.site`. The host page calls `init({ apiUrl, apiKey })` once at the app root and gets back a `destroy()` function. Everything else lives inside the widget bundle: pin anchoring, threads, mentions, identity, screenshots, real-time updates.
|
|
@@ -26,7 +26,7 @@ For a `<script>`-tag drop-in (no bundler / CMS / page-builder), use the inline E
|
|
|
26
26
|
|
|
27
27
|
```html
|
|
28
28
|
<script type="module">
|
|
29
|
-
import { init } from 'https://esm.sh/@pixelmatters/markup@1.
|
|
29
|
+
import { init } from 'https://esm.sh/@pixelmatters/markup@1.27.1'
|
|
30
30
|
init({ apiUrl: '…', apiKey: '…' })
|
|
31
31
|
</script>
|
|
32
32
|
```
|
|
@@ -36,7 +36,7 @@ If the host disallows inline JS, use the auto-init form. `data-markup-widget="tr
|
|
|
36
36
|
```html
|
|
37
37
|
<script
|
|
38
38
|
type="module"
|
|
39
|
-
src="https://esm.sh/@pixelmatters/markup@1.
|
|
39
|
+
src="https://esm.sh/@pixelmatters/markup@1.27.1"
|
|
40
40
|
data-markup-widget="true"
|
|
41
41
|
data-api-url="…"
|
|
42
42
|
data-api-key="…"
|
|
@@ -111,15 +111,16 @@ A request from an unlisted origin gets `403 Origin not allowed` with no CORS hea
|
|
|
111
111
|
|
|
112
112
|
## Config options
|
|
113
113
|
|
|
114
|
-
| Option | Type | Default | Notes
|
|
115
|
-
| -------------- | ---------------------------------------------------- | ----------------- |
|
|
116
|
-
| `apiUrl` | `string` | required | `https://*.convex.site`
|
|
117
|
-
| `apiKey` | `string` | required | `markup_…`
|
|
118
|
-
| `position` | `'bottom-right' \| 'bottom-left' \| 'bottom-center'` | `'bottom-right'` | Initial toolbar corner. Users move it with the Position picker in the overflow menu, and the choice is per-mount and resets on reload
|
|
119
|
-
| `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | `'auto'` follows the host's `prefers-color-scheme`. A user's pick in the overflow menu persists and outranks this on later `init()`
|
|
120
|
-
| `screenshots` | `ScreenshotsConfig` (see below) | enabled, defaults | Capture toggle and PII-scrub options
|
|
121
|
-
| `dashboardUrl` | `string` | none | Adds an **Account →** link to the signed-in identity menu and retargets the "Powered by Markup" line. For self-hosters
|
|
122
|
-
| `
|
|
114
|
+
| Option | Type | Default | Notes |
|
|
115
|
+
| -------------- | ---------------------------------------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
116
|
+
| `apiUrl` | `string` | required | `https://*.convex.site` |
|
|
117
|
+
| `apiKey` | `string` | required | `markup_…` |
|
|
118
|
+
| `position` | `'bottom-right' \| 'bottom-left' \| 'bottom-center'` | `'bottom-right'` | Initial toolbar corner. Users move it with the Position picker in the overflow menu, and the choice is per-mount and resets on reload |
|
|
119
|
+
| `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | `'auto'` follows the host's `prefers-color-scheme`. A user's pick in the overflow menu persists and outranks this on later `init()` |
|
|
120
|
+
| `screenshots` | `ScreenshotsConfig` (see below) | enabled, defaults | Capture toggle and PII-scrub options |
|
|
121
|
+
| `dashboardUrl` | `string` | none | Adds an **Account →** link to the signed-in identity menu and retargets the "Powered by Markup" line. For self-hosters |
|
|
122
|
+
| `routeParams` | `string[]` | `[]` | Query params that name a _view_ rather than filter one, so each gets its own route and its own pins (a wizard's `?step=`). Leave empty unless a param really changes what the page is — adopting it re-keys new threads and needs a backfill for old ones |
|
|
123
|
+
| `fab` | `'default' \| 'icon-only'` | none | **Deprecated, ignored since 1.15.0.** Accepted so old configs still compile; `init()` drops it and warns once. Remove it |
|
|
123
124
|
|
|
124
125
|
### Screenshots & PII scrub
|
|
125
126
|
|
|
@@ -203,7 +204,7 @@ Walk these in order when the widget is misbehaving:
|
|
|
203
204
|
- **Don't wrap in a provider component.** `init` is the whole public API.
|
|
204
205
|
- **Don't call `init` inside a route component.** Mount at the app root once.
|
|
205
206
|
- **Don't hardcode the API key.** Use env vars so rotations don't require a code change.
|
|
206
|
-
- **Don't ship CDN URLs without a version pin.** `@pixelmatters/markup@1.
|
|
207
|
+
- **Don't ship CDN URLs without a version pin.** `@pixelmatters/markup@1.27.1`, not `@pixelmatters/markup`.
|
|
207
208
|
- **Don't add `https://*.convex.site` to `connect-src` and assume that's the whole CSP story.** The deployment domain (`<your-deployment>.convex.site`) is what the widget hits over HTTP, and it must be listed explicitly. Live thread updates go to `wss://<your-deployment>.convex.cloud`, an origin the widget derives from `apiUrl`, so `connect-src` needs both. `img-src` needs `blob:`, `data:`, and the host serving profile pictures; `style-src` needs `'unsafe-inline'` because the widget appends its stylesheet as a `<style>` element inside its shadow root. Add `https://esm.sh` to `script-src` only if you took the CDN path.
|
|
208
209
|
|
|
209
210
|
## Versioning & releases
|