yaver-feedback-react-native 0.8.0 → 0.8.2
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 +40 -6
- package/dist/AuthOverlay.js +1 -1
- package/dist/FeedbackModal.js +475 -265
- package/dist/P2PClient.d.ts +9 -3
- package/dist/P2PClient.js +30 -2
- package/dist/QuickActionIcon.d.ts +10 -2
- package/dist/QuickActionIcon.js +49 -12
- package/dist/YaverFeedback.d.ts +5 -0
- package/dist/YaverFeedback.js +24 -0
- package/dist/__tests__/P2PClient.test.js +30 -0
- package/dist/__tests__/YaverFeedback.test.js +39 -0
- package/dist/capture.d.ts +11 -0
- package/dist/capture.js +59 -0
- package/dist/index.d.ts +8 -7
- package/dist/index.js +9 -7
- package/dist/preferences.d.ts +11 -0
- package/dist/preferences.js +82 -0
- package/dist/types.d.ts +29 -4
- package/dist/upload.d.ts +1 -0
- package/dist/upload.js +8 -0
- package/package.json +11 -5
- package/src/AuthOverlay.tsx +1 -0
- package/src/FeedbackModal.tsx +561 -319
- package/src/P2PClient.ts +44 -3
- package/src/QuickActionIcon.tsx +76 -13
- package/src/YaverFeedback.ts +31 -0
- package/src/__tests__/P2PClient.test.ts +40 -0
- package/src/__tests__/YaverFeedback.test.ts +42 -0
- package/src/capture.ts +74 -0
- package/src/index.ts +8 -6
- package/src/preferences.ts +96 -0
- package/src/types.ts +29 -4
- package/src/upload.ts +9 -0
package/src/types.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface FeedbackConfig {
|
|
|
48
48
|
* Single tap → open the feedback modal; long-press → menu with
|
|
49
49
|
* "Hide icon" (persisted across launches via AsyncStorage).
|
|
50
50
|
*
|
|
51
|
-
* - `'auto'` (default) → `'
|
|
51
|
+
* - `'auto'` (default) → `'after-shake'` on iOS/Android, `'off'` on web.
|
|
52
52
|
* - `'always'` → visible from app launch.
|
|
53
53
|
* - `'after-shake'` → hidden until the first shake this session.
|
|
54
54
|
* - `'off'` → never rendered. Shake still works.
|
|
@@ -59,11 +59,34 @@ export interface FeedbackConfig {
|
|
|
59
59
|
*/
|
|
60
60
|
quickIcon?: 'auto' | 'always' | 'after-shake' | 'off';
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
62
|
+
* Deprecated alias for `quickIconBackgroundColor`.
|
|
63
|
+
*
|
|
64
|
+
* Background color for the quick-action icon. The SDK now defaults
|
|
65
|
+
* to a high-visibility safety orange so the icon reads as a utility
|
|
66
|
+
* affordance instead of blending into the common blue/indigo FAB
|
|
67
|
+
* palette many mobile apps already use.
|
|
65
68
|
*/
|
|
66
69
|
quickIconColor?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Background color for the quick-action icon.
|
|
72
|
+
* Default: '#ff6b2c' (safety orange).
|
|
73
|
+
*/
|
|
74
|
+
quickIconBackgroundColor?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Foreground/text color for the quick-action icon label.
|
|
77
|
+
* Default: '#111111'.
|
|
78
|
+
*/
|
|
79
|
+
quickIconForegroundColor?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Border color for the quick-action icon.
|
|
82
|
+
* Default: 'rgba(255,255,255,0.92)'.
|
|
83
|
+
*/
|
|
84
|
+
quickIconBorderColor?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Shadow color for the quick-action icon.
|
|
87
|
+
* Default: '#000000'.
|
|
88
|
+
*/
|
|
89
|
+
quickIconShadowColor?: string;
|
|
67
90
|
/**
|
|
68
91
|
* Initial position of the quick-action icon, in pixels from the
|
|
69
92
|
* top-left. Default: near the top-right corner of the screen. The
|
|
@@ -189,6 +212,8 @@ export interface FeedbackBundle {
|
|
|
189
212
|
metadata: FeedbackMetadata;
|
|
190
213
|
/** Screen-recording file path, when produced by the "Start Recording" action. */
|
|
191
214
|
video?: string;
|
|
215
|
+
/** Optional audio attachment path. */
|
|
216
|
+
audio?: string;
|
|
192
217
|
screenshots: string[];
|
|
193
218
|
/** Captured errors with stack traces, attached via attachError / wrapErrorHandler. */
|
|
194
219
|
errors?: CapturedError[];
|
package/src/upload.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { FeedbackBundle } from './types';
|
|
|
8
8
|
* - `metadata` (JSON string)
|
|
9
9
|
* - `screenshot_0`, `screenshot_1`, ... (image files)
|
|
10
10
|
* - `video` (video file, if present)
|
|
11
|
+
* - `audio` (audio file, if present)
|
|
11
12
|
*
|
|
12
13
|
* Returns the parsed agent response — typically `{ ok, id, reportId }`.
|
|
13
14
|
* Callers can inspect `.id` / `.reportId` to drive a follow-up
|
|
@@ -43,6 +44,14 @@ export async function uploadFeedback(
|
|
|
43
44
|
} as any);
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
if (bundle.audio) {
|
|
48
|
+
formData.append('audio', {
|
|
49
|
+
uri: Platform.OS === 'android' ? `file://${bundle.audio}` : bundle.audio,
|
|
50
|
+
type: 'audio/m4a',
|
|
51
|
+
name: 'voice_note.m4a',
|
|
52
|
+
} as any);
|
|
53
|
+
}
|
|
54
|
+
|
|
46
55
|
const url = agentUrl.replace(/\/$/, '') + '/feedback';
|
|
47
56
|
|
|
48
57
|
const response = await fetch(url, {
|