@pixelmatters/markup 1.0.2 → 1.2.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.
Files changed (4) hide show
  1. package/README.md +24 -15
  2. package/dist/react.js +570 -429
  3. package/dist/widget.js +1028 -887
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -89,23 +89,25 @@ export default function App() {
89
89
 
90
90
  Mounts the widget. Idempotent: re-calling with the same config is a no-op; calling with a different config tears down the previous instance first. Returns the `destroy` function.
91
91
 
92
- | Option | Type | Default | Description |
93
- | ---------- | --------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------- |
94
- | `apiUrl` | `string` | required | Convex deployment site URL (`https://*.convex.site`) |
95
- | `apiKey` | `string` | required | Project API key — mint one in the dashboard |
96
- | `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Where the floating action button sits |
97
- | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Visual theme — `'light'` or `'dark'`, or `'auto'` (default) to follow the host's `prefers-color-scheme` |
92
+ | Option | Type | Default | Description |
93
+ | ---------- | --------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
94
+ | `apiUrl` | `string` | required | Convex deployment site URL (`https://*.convex.site`) |
95
+ | `apiKey` | `string` | required | Project API key — mint one in the dashboard |
96
+ | `position` | `'bottom-right' \| 'bottom-left'` | `'bottom-right'` | Initial corner for the floating action button — users can drag it across the viewport midline to flip corners at runtime |
97
+ | `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Visual theme — `'light'` or `'dark'`, or `'auto'` (default) to follow the host's `prefers-color-scheme` |
98
98
 
99
99
  ### `destroy()`
100
100
 
101
101
  Unmounts the widget and removes the host element. Safe to call when nothing is mounted.
102
102
 
103
- ### Keyboard
103
+ ### Keyboard & mouse
104
104
 
105
- | Shortcut | Action |
106
- | ------------------ | ----------------------------------------------- |
107
- | `cmd/ctrl + .` | Toggle HUD visibility |
108
- | `cmd/ctrl + click` | Click the FAB to hide the HUD with a hint toast |
105
+ | Shortcut | Action |
106
+ | --------------------- | ---------------------------------------------------------------------- |
107
+ | `cmd/ctrl + .` | Toggle HUD visibility |
108
+ | `cmd/ctrl + click` | Click the FAB to hide the HUD with a hint toast |
109
+ | Drag the FAB | Snap it to whichever bottom corner the pointer ends in |
110
+ | Drag a popover header | Move the open thread / new-thread popover; resets to the pin on reopen |
109
111
 
110
112
  ## How it works
111
113
 
@@ -131,7 +133,7 @@ The popup origin is validated against the project's `allowedDomains` before any
131
133
  1. Sign in to the Markup dashboard.
132
134
  2. Open your project → **Settings → API Keys**.
133
135
  3. Click **New key**, label it, and copy the raw key — it's shown once.
134
- 4. Open **Settings → Domains** and add the host domain (`app.example.com`, `*.staging.example.com`). `localhost` is auto-allowed in dev.
136
+ 4. Open **Settings → Domains** and add the host domain (`app.example.com`, `*.staging.example.com`). Production deployments do not auto-allow `localhost`; add it to the allowlist explicitly if you test against the deployment from `http://localhost`.
135
137
 
136
138
  ## AI prompt
137
139
 
@@ -141,14 +143,17 @@ Paste the block below into Claude, ChatGPT, Cursor, or any other LLM and it'll w
141
143
  You are helping me install the **`@pixelmatters/markup`** feedback widget into my web app.
142
144
 
143
145
  ## What it is
146
+
144
147
  A drop-in feedback widget published on npm as `@pixelmatters/markup`. It mounts a floating action button that lets users pin threaded comments (and optional annotated screenshots) anywhere on the page. It runs inside a shadow DOM so it doesn't affect host CSS.
145
148
 
146
149
  ## My credentials
147
- - `apiUrl`: `https://<MY_DEPLOYMENT>.convex.site` ← replace with the value from Markup dashboard → Settings → Install
148
- - `apiKey`: `markup_...` ← replace with a key from Markup dashboard → Settings → API Keys
149
- Store these in environment variables (e.g. `VITE_MARKUP_API_URL`, `VITE_MARKUP_API_KEY`, or the equivalent for my framework). Do not hardcode them.
150
+
151
+ - `apiUrl`: `https://<MY_DEPLOYMENT>.convex.site` ← replace with the value from Markup dashboard → Settings → Install
152
+ - `apiKey`: `markup_...` replace with a key from Markup dashboard Settings API Keys
153
+ Store these in environment variables (e.g. `VITE_MARKUP_API_URL`, `VITE_MARKUP_API_KEY`, or the equivalent for my framework). Do not hardcode them.
150
154
 
151
155
  ## API
156
+
152
157
  ```ts
153
158
  import { init, destroy } from '@pixelmatters/markup'
154
159
  // or:
@@ -163,6 +168,7 @@ init({
163
168
  ```
164
169
 
165
170
  For a `<script>` tag drop-in (no bundler), use:
171
+
166
172
  ```html
167
173
  <script
168
174
  type="module"
@@ -173,9 +179,11 @@ For a `<script>` tag drop-in (no bundler), use:
173
179
  data-position="bottom-right"
174
180
  ></script>
175
181
  ```
182
+
176
183
  The `data-markup-widget="true"` attribute is required.
177
184
 
178
185
  ## Your task
186
+
179
187
  1. Detect my framework (React, Vue, Svelte, Next.js, plain HTML, etc.) by inspecting the project.
180
188
  2. Install `@pixelmatters/markup` with the package manager already in use (pnpm/npm/yarn).
181
189
  3. Wire the widget into the **root layout / app shell** so it shows on every page.
@@ -184,6 +192,7 @@ The `data-markup-widget="true"` attribute is required.
184
192
  6. Show me a diff of the changes and a one-line note on how to verify (e.g. "run dev server, click the button in the bottom-right").
185
193
 
186
194
  Constraints:
195
+
187
196
  - Do **not** add CSS imports or provider components — the widget needs neither.
188
197
  - Do **not** hardcode the key.
189
198
  - If the project has a CSP, add `https://unpkg.com` to `script-src` only if I'm using the `<script>` tag path.