@mhosaic/feedback 0.26.1 → 0.27.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 +24 -0
- package/dist/{chunk-3CYS47XC.mjs → chunk-BXUX5UTI.mjs} +504 -63
- package/dist/chunk-BXUX5UTI.mjs.map +1 -0
- package/dist/embed.min.js +183 -6
- package/dist/embed.min.js.map +1 -1
- package/dist/error-tracking.d.ts +1 -1
- package/dist/{index-B8Q72Whs.d.ts → index-BYDyenfe.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/loader/react.d.ts +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +1 -1
- package/dist/replay.d.ts +1 -1
- package/dist/telemetry.d.ts +1 -1
- package/dist/{types-CRCxVLFH.d.ts → types-C4iSSmUD.d.ts} +4 -0
- package/dist/webvitals.d.ts +1 -1
- package/dist/widget.min.js +184 -7
- package/dist/widget.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3CYS47XC.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -79,6 +79,30 @@ import { FeedbackProvider } from '@mhosaic/feedback/react'
|
|
|
79
79
|
|
|
80
80
|
The CLI auto-wires this for Vite + React apps on `init`. For Next/Remix/Vue/SvelteKit/Astro/Nuxt, see the framework-specific reference docs at `packages/cli/skills/integrate-feedback/references/` (or `~/.claude/skills/integrate-feedback/references/` after `install-skill`).
|
|
81
81
|
|
|
82
|
+
## Configuration
|
|
83
|
+
|
|
84
|
+
| Option | Type | Default | Description |
|
|
85
|
+
|---|---|---|---|
|
|
86
|
+
| `apiKey` | string | — | **Required.** Public key for this project (e.g. `pk_proj_…`). Obtained during `mhosaic-feedback provision`. |
|
|
87
|
+
| `endpoint` | string | — | **Required.** Base URL of your mhosaic-feedback backend (e.g. `https://feedback.example.com`). The widget POSTs reports to `${endpoint}/api/feedback/v1/reports/`. |
|
|
88
|
+
| `env` | string | `prod` | Environment tag (e.g. `prod`, `staging`, `dev`). Sent with every report; falls back to `prod` when unset. Useful for filtering backend reports by deployment. |
|
|
89
|
+
| `user` | `UserIdentity` | `undefined` | Host-supplied user identity (`id`, `email`, `name`). Set via `fb.identify(…)` after auth resolves; the FAB stays hidden until then. |
|
|
90
|
+
| `metadata` | object | `undefined` | Free-form key-value metadata sent with each report. Updated via `fb.setMetadata(…)`. |
|
|
91
|
+
| `getCurrentPage` | function | `() => window.location.pathname` | Router-aware page-path resolver. Return the current page path (e.g. `/dashboard`) or null to fall back to `pathname`. Enables "feedback on this page" grouping when the Board is scoped. |
|
|
92
|
+
| `openToCurrentPageFeedback` | boolean | `false` | When true, opening the FAB jumps to the Board scoped to the current page (if that page has feedback), else the Send form. Default false — the FAB opens to Send by default so the primary submit flow is uninterrupted. The "This page" chip on the Send tab and the Board's page-scope toggle are always available. Note: the Send-tab strip now passively surfaces the same "feedback on this page" info regardless of this flag. |
|
|
93
|
+
| `showPageActivity` | boolean | `true` | Ambient page-activity surfaces: FAB count badge, hover peek panel, and the Send-tab "open reports on this page" strip. Identified users only. Set `false` to hide all three. The Board's This page / All pages control is always available. |
|
|
94
|
+
| `showFAB` | boolean | `true` | Show/hide the main feedback FAB. Set `false` to hide; call `fb.show()` / `fb.hide()` to toggle at runtime. |
|
|
95
|
+
| `theme` | string | `auto` | `light` \| `dark` \| `auto` \| `none` accepted by the type, but not yet wired to a resolver — the widget always follows the host's `prefers-color-scheme` (i.e. `auto` behavior) regardless of this setting. |
|
|
96
|
+
| `locale` | string | auto-detected from `navigator.language` | Language code for UI text. Falls back to English for any locale other than `fr`, which ships built-in. |
|
|
97
|
+
| `maskAllInputs` | boolean | `false` | Accepted by the type but not currently wired to screenshot capture — setting it has no effect today. Screenshots are user-attached only (dropzone/paste/file picker/annotator); nothing in the current submit flow auto-captures or masks the DOM. |
|
|
98
|
+
| `sanitizeUrl` | function | — | Optional hook to redact sensitive URL segments before sending (e.g. tokens, session IDs). Receives the report's `page_url`; return the sanitized version. |
|
|
99
|
+
| `beforeSend` | function | — | Optional hook to intercept/modify a report before submission. Receives the payload; return modified payload, `false` to cancel, or a promise. Useful for adding custom fields or blocking reports by type/severity. |
|
|
100
|
+
| `onSubmitSuccess` | function | — | Optional callback on successful submission. Receives the `SubmittedReport` object (id, status, created_at). |
|
|
101
|
+
| `onError` | function | — | Optional callback on widget errors (e.g. network failures, validation errors). Receives the `Error` object. |
|
|
102
|
+
| `attachTo` | string \| Element | — | CSS selector or DOM element for widget mount point. Defaults to document body. |
|
|
103
|
+
| `translations` | object | — | Override UI text strings. Merges with built-in locale strings. |
|
|
104
|
+
| `qaMeter` | `QaMeterConfig` | `undefined` | Opt-in QA Meter (second FAB). Set `qaMeter.source` to enable (URL, inline artifact, or async loader). See [QA Meter integration](https://github.com/mhosaic-technologies/feedback-tool-mhosaic/blob/main/docs/qa-meter/INTEGRATING.md). |
|
|
105
|
+
|
|
82
106
|
## Opt-in modules
|
|
83
107
|
|
|
84
108
|
| Subpath | What it does | Approx gzip |
|