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/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) → `'always'` on iOS/Android, `'off'` on web.
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
- * Background color for the quick-action icon. Default: '#6366f1'
63
- * (indigo). Pick something distinctive so the icon never visually
64
- * collides with your own FAB.
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, {