@softistx/pulsarix-widget 0.5.0 → 0.6.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 CHANGED
@@ -50,7 +50,7 @@ Attributes (all optional but the key): `data-locale` (`en` default, `fr`), `data
50
50
  `data-accent-color` (a hex seed for the theme; without it the widget wears the host's `@softistx/material` theme, else material's built-in `lavande`), `data-inherit-theme="false"` (never inherit the host's theme; see "Theme"), `data-api-base` (the
51
51
  pulsarix origin; defaults to the host that served the loader), `data-launcher="false"` (no
52
52
  floating button; open it with `window.PulsarixWidget.open()`) or `data-launcher="auto|pill|icon"`
53
- (`auto` is the default: icon below 640 px, pill above), `data-offset-bottom` and `data-offset-side` (see "The launcher"), `data-mask-text="true"` (the
53
+ (any value other than `false` gives the round FAB), `data-offset-bottom` and `data-offset-side` (see "The launcher"), `data-mask-text="true"` (the
54
54
  "Mask the text on the page" screenshot option starts on; see "Screenshots"), `data-attachments="false"`
55
55
  (no screenshot and no file controls; see "Attached files"), `data-privacy-url` (an http(s) link to your
56
56
  own privacy page, shown after the privacy line), `data-prefill-email` and `data-prefill-title` (starting
@@ -164,9 +164,9 @@ bundle has loaded is queued. An unsupported theme or locale is ignored.
164
164
  - `setMetadata` replaces the whole object (same limits as `metadata` at mount); a report already sent keeps
165
165
  the metadata it was sent with.
166
166
  - `setLocale` changes the widget's own strings at once. The built-in labels of `@softistx/material` follow
167
- when the form is next idle: on an idle form the typed fields, the type, the impact and the tab are kept
167
+ when the form is next idle: on an idle form the typed fields, the type and the impact are kept
168
168
  and files or a screenshot already attached are dropped; while a report is being sent, on the confirmation
169
- or on the "My requests" tab nothing is rebuilt (and nothing is lost), and those labels switch once the
169
+ or in the "My requests" view nothing is rebuilt (and nothing is lost), and those labels switch once the
170
170
  reporter is back on the form or the dialog closes.
171
171
  - A repeated call before the bundle loads replaces the earlier one: only the last of each setter runs.
172
172
  - With `inheritTheme`, an explicit `setTheme` wins over the host's mode until the `theme` attribute is
@@ -181,8 +181,9 @@ works, and its limits: [docs/integration.md](docs/integration.md#9-inheriting-th
181
181
 
182
182
  ## The launcher
183
183
 
184
- `launcher: "auto"` (default) shows a 48 px round icon button below 640 px of viewport width and the text
185
- pill above, switching live. `"pill"` and `"icon"` force one, `false` removes it. To clear a sticky bar,
184
+ The launcher is one round FAB with the pulsarix mark at every width; with an identity token it opens a
185
+ menu with "Report a problem" and "My requests" (unread badge), and its accessible name carries the unread
186
+ count. `"auto"`, `"pill"` and `"icon"` all give the FAB, `false` removes it (the `pill` and `icon` values are kept for compatibility and are no-ops; the text pill is gone). With the launcher removed or held hidden, an identified reporter has no way to the requests list: keep it visible for them. To clear a sticky bar,
186
187
  `offset: { bottom: 88 }` (or `--pulsarix-launcher-bottom` / `--pulsarix-launcher-side` in your own CSS), and
187
188
  `setLauncherVisible(false)` hides only the launcher, never an open dialog, and `holdLauncher()` hides it the same way while a host's own sticky bar is up (ref-counted, call the returned function to release); with the script tag it is
188
189
  `window.PulsarixWidget.setLauncherVisible(false)`. A negative or malformed offset is ignored. Details and examples:
@@ -220,11 +221,11 @@ never in a URL. A malformed token is ignored. A token given with `identify()` or
220
221
  is kept in the widget's memory and is not written to the page; a token in `data-identity` is an
221
222
  attribute of the element, so it is visible in the DOM (prefer `identify()` when that matters).
222
223
 
223
- - Without a token the dialog is today's form, with no tabs.
224
- - With one, the dialog has two tabs, New request and My requests. My requests is one list with
224
+ - Without a token the dialog is the one report form, and the e-mail field is asked.
225
+ - With one, the FAB opens a menu with "Report a problem" and "My requests" (no e-mail field). My requests is its own view, with its own title, and one list with
225
226
  filter chips and their counts (Open by default, Resolved, Declined, All); requests with
226
227
  unread replies come first, and the list is read again each time the dialog opens.
227
- - The launcher and the My requests tab show the unread count.
228
+ - The FAB (in its name) and the My requests menu item show the unread count.
228
229
  - Opening a request shows its thread: the original message, then the replies of the team (plain
229
230
  text, with their file names). The reporter can reply, with up to three files sent the same way as
230
231
  a report's (the ticket upload below), resolve the request, and reopen a resolved one for 30 days.
@@ -338,24 +339,31 @@ With the npm route, call `widget.identify(token)` on the handle `mount()` return
338
339
  ## Screenshots
339
340
 
340
341
  A report can carry one optional screenshot, never taken without a click (and a per-report
341
- choice). The right pane of the dialog offers:
342
+ choice). The one "Attachments" control of the form offers:
342
343
 
343
- - **Add a screenshot**: the browser's screen capture (`getDisplayMedia`). The widget hides itself
344
+ - **Capture this page** (under the one "Add" control): the browser's screen capture (`getDisplayMedia`). The widget hides itself
344
345
  (`visibility`, not unmount, so the form keeps its text) while the frame is grabbed, then shows
345
346
  itself again. Not offered on a phone, without the API, or under a Permissions-Policy that blocks
346
347
  `display-capture`.
347
- - **Upload an image**: always offered, and the only choice where capture is unavailable or was
348
- refused. PNG, JPEG or WebP, 25 megapixels at most.
348
+ - **Upload a file** (under "Add"): always offered, and the only choice where capture is unavailable or was
349
+ refused. PNG, JPEG, WebP or PDF. An uploaded image opens in the same editor as a capture (a PDF is
350
+ a plain attachment).
349
351
  - **Mask the text on the page** (off by default; `data-mask-text="true"`, or `maskText: true` in `init` / `mount`, turns it on when the dialog opens): covers the
350
352
  page's text with opaque boxes before the picture is taken. It needs the current tab to be shared;
351
353
  otherwise the widget says it cannot and nothing is captured. Mark anything that must stay visible
352
354
  with `data-capture-unmask`.
353
355
 
354
- The picture opens in an editor (a separate chunk, fetched when first needed) with a pen, a highlighter,
356
+ A capture or an uploaded image opens straight in the editor (a separate chunk, fetched when first needed) with a pen, a highlighter,
355
357
  an arrow, a box, text, a solid "Redact" box (redacted pixels are one opaque colour) and Crop, which trims the
356
358
  picture before it is kept. Only the flattened
357
- export (2560 px on its longest side at most) is kept; the raw capture is dropped, its object URLs
358
- revoked and no media track stays live. Retake and Remove are offered. A report is complete without
359
+ export (2560 px on its longest side at most) is kept when you save; Cancel in the editor keeps the
360
+ capture as it was taken. No media track stays live. The screenshot and the files share one list of removable thumbnails. Every image has an "Edit" button that reopens it (the
361
+ kept image, not the raw capture). Each capture records the page it was taken on (origin and path, never
362
+ the query or the fragment), shown under it ("Captured on ...") and in the editor. The report's
363
+ `pageUrl` is the first capture's page, and each capture's page is also sent as a `metadata` entry
364
+ (`capture-1-page`, `capture-2-page`, ... by position among the captures; those keys are reserved: a
365
+ host entry of that shape is dropped, and when the whole passes the metadata limits the host's entries
366
+ are dropped from the end first). A report is complete without
359
367
  any of this. No `blob:` image source is needed in your CSP (the editor draws on canvases), and a
360
368
  `Permissions-Policy` without `display-capture` turns the capture button off.
361
369
 
@@ -377,7 +385,7 @@ widget.on("pulsarix:error", (event) => console.warn(event.detail.code));
377
385
  ## Attached files
378
386
 
379
387
  Besides the screenshot, a reporter can attach up to 3 files (PNG, JPEG, WebP or PDF, 5 MB each,
380
- 12 MB for the report, screenshot included) by dropping them on the zone or with Browse. The
388
+ 12 MB for the report, screenshot included) by dropping them on the dialog or with "Add" then "Upload a file". The
381
389
  checks mirror the API's, so a refused file is shown with its reason and never sent; the list shows
382
390
  each file's type icon, name, size, a thumbnail for images, a Remove button, and its progress while
383
391
  the report goes out.