@bbearai/react-native 0.2.3 → 0.3.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 +46 -12
- package/dist/index.d.mts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +1818 -3293
- package/dist/index.mjs +1831 -3299
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bbearai/react-native
|
|
2
2
|
|
|
3
|
-
BugBear QA widget for React Native mobile apps.
|
|
3
|
+
BugBear QA widget for React Native mobile apps. Features a navigation-stack-based UI with 10 dedicated screens for testing, bug reporting, messaging, and profile management.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,22 +10,35 @@ npm install @bbearai/react-native @bbearai/core
|
|
|
10
10
|
yarn add @bbearai/react-native @bbearai/core
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
### Optional: Image attachments
|
|
14
|
+
|
|
15
|
+
For image attachments in bug reports and messages:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install react-native-image-picker
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This is an optional peer dependency — the widget works without it but won't show image picker buttons.
|
|
22
|
+
|
|
13
23
|
## Quick Start
|
|
14
24
|
|
|
15
25
|
```tsx
|
|
16
|
-
import { BugBearProvider,
|
|
26
|
+
import { BugBearProvider, BugBearButton } from '@bbearai/react-native';
|
|
17
27
|
|
|
18
28
|
function App() {
|
|
19
29
|
return (
|
|
20
30
|
<BugBearProvider
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
config={{
|
|
32
|
+
projectId: 'your-project-id',
|
|
33
|
+
dashboardUrl: 'https://app.bugbear.ai',
|
|
34
|
+
getCurrentUser: async () => ({
|
|
35
|
+
id: user.id,
|
|
36
|
+
email: user.email,
|
|
37
|
+
}),
|
|
38
|
+
}}
|
|
26
39
|
>
|
|
27
40
|
<YourApp />
|
|
28
|
-
<
|
|
41
|
+
<BugBearButton position="bottom-right" />
|
|
29
42
|
</BugBearProvider>
|
|
30
43
|
);
|
|
31
44
|
}
|
|
@@ -96,13 +109,34 @@ If you're using Yarn workspaces, you can also configure hoisting to ensure a sin
|
|
|
96
109
|
|
|
97
110
|
```tsx
|
|
98
111
|
<BugBearProvider
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
config={{
|
|
113
|
+
projectId: 'your-project-id', // Required: Your BugBear project ID
|
|
114
|
+
getCurrentUser: async () => {...}, // Required: Return current user info
|
|
115
|
+
dashboardUrl: 'https://app.bugbear.ai', // Optional: Web dashboard link in widget
|
|
116
|
+
getNavigationHistory: () => [...], // Optional: Custom navigation tracking
|
|
117
|
+
onNavigate: (route) => {...}, // Optional: Deep link handler for test cases
|
|
118
|
+
onReportSubmitted: (report) => {...}, // Optional: Callback after report submission
|
|
119
|
+
}}
|
|
103
120
|
>
|
|
104
121
|
```
|
|
105
122
|
|
|
123
|
+
## Widget Architecture
|
|
124
|
+
|
|
125
|
+
The widget uses a navigation stack pattern with 10 screens:
|
|
126
|
+
|
|
127
|
+
| Screen | Purpose |
|
|
128
|
+
|--------|---------|
|
|
129
|
+
| **Home** | Smart hero banner + 2x2 action grid + progress bar + web dashboard link |
|
|
130
|
+
| **Test Detail** | One-test-at-a-time execution with pass/fail/skip actions |
|
|
131
|
+
| **Test List** | All assignments grouped by folder with filter bar |
|
|
132
|
+
| **Test Feedback** | Star rating + quality flags after pass/fail |
|
|
133
|
+
| **Report** | Bug/feedback submission with type, severity, description |
|
|
134
|
+
| **Report Success** | Confirmation with auto-return to home |
|
|
135
|
+
| **Message List** | Thread list with unread badges + compose button |
|
|
136
|
+
| **Thread Detail** | Chat bubbles + reply composer |
|
|
137
|
+
| **Compose Message** | New thread form with subject + message |
|
|
138
|
+
| **Profile** | Tester info, stats, and editable fields |
|
|
139
|
+
|
|
106
140
|
## Navigation Tracking
|
|
107
141
|
|
|
108
142
|
BugBear can automatically track navigation history for better bug context. If you're using React Navigation:
|
package/dist/index.d.mts
CHANGED
|
@@ -24,18 +24,29 @@ interface BugBearContextValue {
|
|
|
24
24
|
/** Get all messages in a thread */
|
|
25
25
|
getThreadMessages: (threadId: string) => Promise<TesterMessage[]>;
|
|
26
26
|
/** Send a message to a thread */
|
|
27
|
-
sendMessage: (threadId: string, content: string
|
|
27
|
+
sendMessage: (threadId: string, content: string, attachments?: Array<{
|
|
28
|
+
type: 'image' | 'document' | 'video_link';
|
|
29
|
+
url: string;
|
|
30
|
+
name: string;
|
|
31
|
+
}>) => Promise<boolean>;
|
|
28
32
|
/** Mark a thread as read */
|
|
29
33
|
markAsRead: (threadId: string) => Promise<void>;
|
|
30
34
|
/** Create a new thread */
|
|
31
35
|
createThread: (options: {
|
|
32
36
|
subject: string;
|
|
33
37
|
message: string;
|
|
38
|
+
attachments?: Array<{
|
|
39
|
+
type: 'image' | 'document' | 'video_link';
|
|
40
|
+
url: string;
|
|
41
|
+
name: string;
|
|
42
|
+
}>;
|
|
34
43
|
}) => Promise<{
|
|
35
44
|
success: boolean;
|
|
36
45
|
threadId?: string;
|
|
37
46
|
error?: string;
|
|
38
47
|
}>;
|
|
48
|
+
/** Upload an image from a local URI (React Native) */
|
|
49
|
+
uploadImage: (uri: string, bucket?: 'screenshots' | 'discussion-attachments') => Promise<string | null>;
|
|
39
50
|
activeSession: QASession | null;
|
|
40
51
|
sessionFindings: QAFinding[];
|
|
41
52
|
startSession: (options?: StartSessionOptions) => Promise<{
|
|
@@ -61,6 +72,8 @@ interface BugBearContextValue {
|
|
|
61
72
|
}>;
|
|
62
73
|
/** Refresh tester info from server */
|
|
63
74
|
refreshTesterInfo: () => Promise<void>;
|
|
75
|
+
/** URL to the BugBear web dashboard (for linking testers to the full web experience) */
|
|
76
|
+
dashboardUrl?: string;
|
|
64
77
|
}
|
|
65
78
|
declare function useBugBear(): BugBearContextValue;
|
|
66
79
|
interface BugBearProviderProps {
|
|
@@ -95,6 +108,6 @@ interface BugBearButtonProps {
|
|
|
95
108
|
/** Maximum Y position from bottom of screen */
|
|
96
109
|
maxYOffset?: number;
|
|
97
110
|
}
|
|
98
|
-
declare function BugBearButton({
|
|
111
|
+
declare function BugBearButton({ position, buttonStyle, draggable, initialX, initialY, minY, maxYOffset, }: BugBearButtonProps): React.JSX.Element | null;
|
|
99
112
|
|
|
100
113
|
export { BugBearButton, BugBearProvider, useBugBear };
|
package/dist/index.d.ts
CHANGED
|
@@ -24,18 +24,29 @@ interface BugBearContextValue {
|
|
|
24
24
|
/** Get all messages in a thread */
|
|
25
25
|
getThreadMessages: (threadId: string) => Promise<TesterMessage[]>;
|
|
26
26
|
/** Send a message to a thread */
|
|
27
|
-
sendMessage: (threadId: string, content: string
|
|
27
|
+
sendMessage: (threadId: string, content: string, attachments?: Array<{
|
|
28
|
+
type: 'image' | 'document' | 'video_link';
|
|
29
|
+
url: string;
|
|
30
|
+
name: string;
|
|
31
|
+
}>) => Promise<boolean>;
|
|
28
32
|
/** Mark a thread as read */
|
|
29
33
|
markAsRead: (threadId: string) => Promise<void>;
|
|
30
34
|
/** Create a new thread */
|
|
31
35
|
createThread: (options: {
|
|
32
36
|
subject: string;
|
|
33
37
|
message: string;
|
|
38
|
+
attachments?: Array<{
|
|
39
|
+
type: 'image' | 'document' | 'video_link';
|
|
40
|
+
url: string;
|
|
41
|
+
name: string;
|
|
42
|
+
}>;
|
|
34
43
|
}) => Promise<{
|
|
35
44
|
success: boolean;
|
|
36
45
|
threadId?: string;
|
|
37
46
|
error?: string;
|
|
38
47
|
}>;
|
|
48
|
+
/** Upload an image from a local URI (React Native) */
|
|
49
|
+
uploadImage: (uri: string, bucket?: 'screenshots' | 'discussion-attachments') => Promise<string | null>;
|
|
39
50
|
activeSession: QASession | null;
|
|
40
51
|
sessionFindings: QAFinding[];
|
|
41
52
|
startSession: (options?: StartSessionOptions) => Promise<{
|
|
@@ -61,6 +72,8 @@ interface BugBearContextValue {
|
|
|
61
72
|
}>;
|
|
62
73
|
/** Refresh tester info from server */
|
|
63
74
|
refreshTesterInfo: () => Promise<void>;
|
|
75
|
+
/** URL to the BugBear web dashboard (for linking testers to the full web experience) */
|
|
76
|
+
dashboardUrl?: string;
|
|
64
77
|
}
|
|
65
78
|
declare function useBugBear(): BugBearContextValue;
|
|
66
79
|
interface BugBearProviderProps {
|
|
@@ -95,6 +108,6 @@ interface BugBearButtonProps {
|
|
|
95
108
|
/** Maximum Y position from bottom of screen */
|
|
96
109
|
maxYOffset?: number;
|
|
97
110
|
}
|
|
98
|
-
declare function BugBearButton({
|
|
111
|
+
declare function BugBearButton({ position, buttonStyle, draggable, initialX, initialY, minY, maxYOffset, }: BugBearButtonProps): React.JSX.Element | null;
|
|
99
112
|
|
|
100
113
|
export { BugBearButton, BugBearProvider, useBugBear };
|