react-feedback-surveys 1.3.0 → 1.4.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 +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ import 'react-feedback-surveys/index.css';
|
|
|
102
102
|
textButtonLabel="Send"
|
|
103
103
|
thankYouMessage="Thanks for your feedback!"
|
|
104
104
|
onScoreSubmit={({ value }) => {/* ... */}}
|
|
105
|
-
onFeedbackSubmit={({ value,
|
|
105
|
+
onFeedbackSubmit={({ value, text }) => {/* ... */}}
|
|
106
106
|
/>
|
|
107
107
|
```
|
|
108
108
|
|
|
@@ -131,7 +131,7 @@ import 'react-feedback-surveys/index.css';
|
|
|
131
131
|
textButtonLabel="Send"
|
|
132
132
|
thankYouMessage="Thank you for your feedback!"
|
|
133
133
|
onScoreSubmit={({ value }) => {/* ... */}}
|
|
134
|
-
onFeedbackSubmit={({ value,
|
|
134
|
+
onFeedbackSubmit={({ value, text }) => {/* ... */}}
|
|
135
135
|
/>
|
|
136
136
|
```
|
|
137
137
|
|
|
@@ -164,7 +164,7 @@ import 'react-feedback-surveys/index.css';
|
|
|
164
164
|
textButtonLabel="Send"
|
|
165
165
|
thankYouMessage="Thank you for your feedback!"
|
|
166
166
|
onScoreSubmit={({ value }) => {/* ... */}}
|
|
167
|
-
onFeedbackSubmit={({ value,
|
|
167
|
+
onFeedbackSubmit={({ value, text }) => {/* ... */}}
|
|
168
168
|
/>
|
|
169
169
|
```
|
|
170
170
|
|
|
@@ -195,7 +195,7 @@ import 'react-feedback-surveys/index.css';
|
|
|
195
195
|
textButtonLabel="Send"
|
|
196
196
|
thankYouMessage="Thank you for your feedback!"
|
|
197
197
|
onScoreSubmit={({ value }) => {/* ... */}}
|
|
198
|
-
onFeedbackSubmit={({ value,
|
|
198
|
+
onFeedbackSubmit={({ value, text }) => {/* ... */}}
|
|
199
199
|
/>
|
|
200
200
|
```
|
|
201
201
|
|
|
@@ -302,7 +302,7 @@ Most props are shared across all survey widgets. Each widget differs only in its
|
|
|
302
302
|
| Prop | Type | Required | Description |
|
|
303
303
|
|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------------------------|
|
|
304
304
|
| `onScoreSubmit` | `({ value: number }) => void \| Promise<void>` | - | Fires immediately when a score is selected, before any follow-up feedback screen. Captures the raw rating. |
|
|
305
|
-
| `onFeedbackSubmit` | `({ value: number;
|
|
305
|
+
| `onFeedbackSubmit` | `({ value: number; text?: string \| string[] }) => void \| Promise<void>` | - | Fires when feedback is submitted. Includes the selected score and the user’s text(s). |
|
|
306
306
|
|
|
307
307
|
> **Event behavior**
|
|
308
308
|
|
|
@@ -324,7 +324,7 @@ This callback provides both the original score and the user's input.
|
|
|
324
324
|
|
|
325
325
|
**Arguments:**
|
|
326
326
|
- `value: number` — the same score previously passed to `onScoreSubmit`
|
|
327
|
-
- `
|
|
327
|
+
- `text: string | string[]` — depends on `responseType`:
|
|
328
328
|
- `text`: a single text comment
|
|
329
329
|
- `choices`: an array of selected options (may include a free-text comment if enabled)
|
|
330
330
|
|
|
@@ -567,7 +567,7 @@ import 'react-feedback-surveys/index.css';
|
|
|
567
567
|
minLabel="Very unsatisfied"
|
|
568
568
|
maxLabel="Very satisfied"
|
|
569
569
|
onScoreSubmit={({ value }) => {/* ... */}}
|
|
570
|
-
onFeedbackSubmit={({ value,
|
|
570
|
+
onFeedbackSubmit={({ value, text }) => {/* ... */}}
|
|
571
571
|
/>
|
|
572
572
|
```
|
|
573
573
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -307,7 +307,7 @@ const Q = "_base_1nuw0_1", X = {
|
|
|
307
307
|
if (n) {
|
|
308
308
|
c(!0);
|
|
309
309
|
try {
|
|
310
|
-
await n({ value: o,
|
|
310
|
+
await n({ value: o, text: y }), f(!0);
|
|
311
311
|
} catch (v) {
|
|
312
312
|
p(v instanceof Error ? v : new Error("Failed to submit"));
|
|
313
313
|
} finally {
|