yaver-feedback-react-native 0.7.17 → 0.8.1

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
@@ -42,6 +42,57 @@ export interface FeedbackConfig {
42
42
  preferredDeviceId?: string;
43
43
  /** How feedback collection is triggered */
44
44
  trigger?: 'shake' | 'floating-button' | 'manual';
45
+ /**
46
+ * Small tap-to-open icon that floats above the app so the user
47
+ * doesn't have to shake every time they want to open feedback.
48
+ * Single tap → open the feedback modal; long-press → menu with
49
+ * "Hide icon" (persisted across launches via AsyncStorage).
50
+ *
51
+ * - `'auto'` (default) → `'after-shake'` on iOS/Android, `'off'` on web.
52
+ * - `'always'` → visible from app launch.
53
+ * - `'after-shake'` → hidden until the first shake this session.
54
+ * - `'off'` → never rendered. Shake still works.
55
+ *
56
+ * The user can always override `'always'` / `'auto'` by long-pressing
57
+ * → Hide. Devs can clear that override via
58
+ * `YaverFeedback.resetQuickIconPreference()`.
59
+ */
60
+ quickIcon?: 'auto' | 'always' | 'after-shake' | 'off';
61
+ /**
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.
68
+ */
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;
90
+ /**
91
+ * Initial position of the quick-action icon, in pixels from the
92
+ * top-left. Default: near the top-right corner of the screen. The
93
+ * icon is draggable at runtime — this is only the first mount.
94
+ */
95
+ quickIconInitialPosition?: { x: number; y: number };
45
96
  /** Enable/disable the SDK. Defaults to __DEV__ */
46
97
  enabled?: boolean;
47
98
  /**
@@ -161,6 +212,8 @@ export interface FeedbackBundle {
161
212
  metadata: FeedbackMetadata;
162
213
  /** Screen-recording file path, when produced by the "Start Recording" action. */
163
214
  video?: string;
215
+ /** Optional audio attachment path. */
216
+ audio?: string;
164
217
  screenshots: string[];
165
218
  /** Captured errors with stack traces, attached via attachError / wrapErrorHandler. */
166
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, {