@mushi-mushi/react-native 0.1.0 → 0.2.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 +23 -4
- package/dist/index.cjs +454 -40
- package/dist/index.d.cts +71 -4
- package/dist/index.d.ts +71 -4
- package/dist/index.js +482 -38
- package/package.json +76 -73
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, FC } from 'react';
|
|
3
3
|
|
|
4
4
|
interface ConsoleEntry {
|
|
5
5
|
level: 'log' | 'warn' | 'error';
|
|
@@ -33,6 +33,9 @@ interface DeviceInfo {
|
|
|
33
33
|
screenHeight: number;
|
|
34
34
|
pixelRatio: number;
|
|
35
35
|
fontScale: number;
|
|
36
|
+
systemName?: string;
|
|
37
|
+
locale?: string;
|
|
38
|
+
timezone?: string;
|
|
36
39
|
}
|
|
37
40
|
declare function getDeviceInfo(): DeviceInfo;
|
|
38
41
|
|
|
@@ -41,7 +44,7 @@ interface MushiRNConfig {
|
|
|
41
44
|
apiKey: string;
|
|
42
45
|
endpoint?: string;
|
|
43
46
|
widget?: {
|
|
44
|
-
trigger?: 'shake' | 'button' | 'both';
|
|
47
|
+
trigger?: 'shake' | 'button' | 'both' | 'manual';
|
|
45
48
|
shakeThreshold?: number;
|
|
46
49
|
buttonPosition?: 'bottom-right' | 'bottom-left';
|
|
47
50
|
};
|
|
@@ -86,6 +89,70 @@ declare function useMushiWidget(): {
|
|
|
86
89
|
close: () => void | undefined;
|
|
87
90
|
};
|
|
88
91
|
|
|
92
|
+
/**
|
|
93
|
+
* FILE: MushiBottomSheet.tsx
|
|
94
|
+
* PURPOSE: Bottom-sheet modal for conversational bug reporting in React Native
|
|
95
|
+
*
|
|
96
|
+
* OVERVIEW:
|
|
97
|
+
* - Slide-up modal built entirely on RN built-ins (Modal, Animated, PanResponder)
|
|
98
|
+
* - Conversational flow: category → description → submit → confirmation
|
|
99
|
+
* - Drag-to-dismiss via PanResponder on the handle area
|
|
100
|
+
* - Dark/light theme via useColorScheme
|
|
101
|
+
*
|
|
102
|
+
* DEPENDENCIES:
|
|
103
|
+
* - React Native built-in APIs only (no third-party libs)
|
|
104
|
+
* - MushiContext from ../provider for submitReport
|
|
105
|
+
*
|
|
106
|
+
* USAGE:
|
|
107
|
+
* - Rendered internally by MushiProvider; controlled via `visible` / `onClose` props
|
|
108
|
+
* - Can also be used standalone: <MushiBottomSheet visible={…} onClose={…} />
|
|
109
|
+
*
|
|
110
|
+
* TECHNICAL DETAILS:
|
|
111
|
+
* - PanResponder threshold: 80 px downward drag dismisses
|
|
112
|
+
* - Animated.spring for slide-up, Animated.timing for backdrop
|
|
113
|
+
* - Success confirmation auto-closes after 1.4 s
|
|
114
|
+
*
|
|
115
|
+
* NOTES:
|
|
116
|
+
* - KeyboardAvoidingView wraps the sheet so the text input stays visible
|
|
117
|
+
* - Categories match the web SDK: bug, slow, visual, confusing, other
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
interface MushiBottomSheetProps {
|
|
121
|
+
visible: boolean;
|
|
122
|
+
onClose: () => void;
|
|
123
|
+
}
|
|
124
|
+
declare const MushiBottomSheet: FC<MushiBottomSheetProps>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* FILE: MushiFloatingButton.tsx
|
|
128
|
+
* PURPOSE: Floating action button (FAB) that triggers the Mushi bug-report bottom sheet
|
|
129
|
+
*
|
|
130
|
+
* OVERVIEW:
|
|
131
|
+
* - Renders a persistent 🐛 button at bottom-right or bottom-left
|
|
132
|
+
* - Animated press-scale effect via Animated.spring
|
|
133
|
+
* - Position configurable through `buttonPosition` prop
|
|
134
|
+
*
|
|
135
|
+
* DEPENDENCIES:
|
|
136
|
+
* - React Native built-in APIs only
|
|
137
|
+
*
|
|
138
|
+
* USAGE:
|
|
139
|
+
* - Rendered automatically by MushiProvider when widget.trigger is 'button' or 'both'
|
|
140
|
+
* - Can be used standalone: <MushiFloatingButton onPress={…} />
|
|
141
|
+
*
|
|
142
|
+
* TECHNICAL DETAILS:
|
|
143
|
+
* - Uses Animated.Value for scale, driven by onPressIn / onPressOut
|
|
144
|
+
* - Safe-area aware: extra bottom padding on iOS
|
|
145
|
+
*
|
|
146
|
+
* NOTES:
|
|
147
|
+
* - Keeps zIndex high (9999) so it floats above app content
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
interface MushiFloatingButtonProps {
|
|
151
|
+
onPress: () => void;
|
|
152
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
153
|
+
}
|
|
154
|
+
declare const MushiFloatingButton: FC<MushiFloatingButtonProps>;
|
|
155
|
+
|
|
89
156
|
interface NavigationEntry {
|
|
90
157
|
screen: string;
|
|
91
158
|
timestamp: number;
|
|
@@ -106,11 +173,11 @@ declare class AsyncStorageQueue {
|
|
|
106
173
|
apiEndpoint: string;
|
|
107
174
|
apiKey: string;
|
|
108
175
|
});
|
|
109
|
-
enqueue(report:
|
|
176
|
+
enqueue(report: object): Promise<void>;
|
|
110
177
|
flush(): Promise<number>;
|
|
111
178
|
size(): Promise<number>;
|
|
112
179
|
private getQueue;
|
|
113
180
|
private getAsyncStorage;
|
|
114
181
|
}
|
|
115
182
|
|
|
116
|
-
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MushiProvider, type MushiRNConfig, type MushiRNInstance, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|
|
183
|
+
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MushiBottomSheet, type MushiBottomSheetProps, MushiFloatingButton, type MushiFloatingButtonProps, MushiProvider, type MushiRNConfig, type MushiRNInstance, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, FC } from 'react';
|
|
3
3
|
|
|
4
4
|
interface ConsoleEntry {
|
|
5
5
|
level: 'log' | 'warn' | 'error';
|
|
@@ -33,6 +33,9 @@ interface DeviceInfo {
|
|
|
33
33
|
screenHeight: number;
|
|
34
34
|
pixelRatio: number;
|
|
35
35
|
fontScale: number;
|
|
36
|
+
systemName?: string;
|
|
37
|
+
locale?: string;
|
|
38
|
+
timezone?: string;
|
|
36
39
|
}
|
|
37
40
|
declare function getDeviceInfo(): DeviceInfo;
|
|
38
41
|
|
|
@@ -41,7 +44,7 @@ interface MushiRNConfig {
|
|
|
41
44
|
apiKey: string;
|
|
42
45
|
endpoint?: string;
|
|
43
46
|
widget?: {
|
|
44
|
-
trigger?: 'shake' | 'button' | 'both';
|
|
47
|
+
trigger?: 'shake' | 'button' | 'both' | 'manual';
|
|
45
48
|
shakeThreshold?: number;
|
|
46
49
|
buttonPosition?: 'bottom-right' | 'bottom-left';
|
|
47
50
|
};
|
|
@@ -86,6 +89,70 @@ declare function useMushiWidget(): {
|
|
|
86
89
|
close: () => void | undefined;
|
|
87
90
|
};
|
|
88
91
|
|
|
92
|
+
/**
|
|
93
|
+
* FILE: MushiBottomSheet.tsx
|
|
94
|
+
* PURPOSE: Bottom-sheet modal for conversational bug reporting in React Native
|
|
95
|
+
*
|
|
96
|
+
* OVERVIEW:
|
|
97
|
+
* - Slide-up modal built entirely on RN built-ins (Modal, Animated, PanResponder)
|
|
98
|
+
* - Conversational flow: category → description → submit → confirmation
|
|
99
|
+
* - Drag-to-dismiss via PanResponder on the handle area
|
|
100
|
+
* - Dark/light theme via useColorScheme
|
|
101
|
+
*
|
|
102
|
+
* DEPENDENCIES:
|
|
103
|
+
* - React Native built-in APIs only (no third-party libs)
|
|
104
|
+
* - MushiContext from ../provider for submitReport
|
|
105
|
+
*
|
|
106
|
+
* USAGE:
|
|
107
|
+
* - Rendered internally by MushiProvider; controlled via `visible` / `onClose` props
|
|
108
|
+
* - Can also be used standalone: <MushiBottomSheet visible={…} onClose={…} />
|
|
109
|
+
*
|
|
110
|
+
* TECHNICAL DETAILS:
|
|
111
|
+
* - PanResponder threshold: 80 px downward drag dismisses
|
|
112
|
+
* - Animated.spring for slide-up, Animated.timing for backdrop
|
|
113
|
+
* - Success confirmation auto-closes after 1.4 s
|
|
114
|
+
*
|
|
115
|
+
* NOTES:
|
|
116
|
+
* - KeyboardAvoidingView wraps the sheet so the text input stays visible
|
|
117
|
+
* - Categories match the web SDK: bug, slow, visual, confusing, other
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
interface MushiBottomSheetProps {
|
|
121
|
+
visible: boolean;
|
|
122
|
+
onClose: () => void;
|
|
123
|
+
}
|
|
124
|
+
declare const MushiBottomSheet: FC<MushiBottomSheetProps>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* FILE: MushiFloatingButton.tsx
|
|
128
|
+
* PURPOSE: Floating action button (FAB) that triggers the Mushi bug-report bottom sheet
|
|
129
|
+
*
|
|
130
|
+
* OVERVIEW:
|
|
131
|
+
* - Renders a persistent 🐛 button at bottom-right or bottom-left
|
|
132
|
+
* - Animated press-scale effect via Animated.spring
|
|
133
|
+
* - Position configurable through `buttonPosition` prop
|
|
134
|
+
*
|
|
135
|
+
* DEPENDENCIES:
|
|
136
|
+
* - React Native built-in APIs only
|
|
137
|
+
*
|
|
138
|
+
* USAGE:
|
|
139
|
+
* - Rendered automatically by MushiProvider when widget.trigger is 'button' or 'both'
|
|
140
|
+
* - Can be used standalone: <MushiFloatingButton onPress={…} />
|
|
141
|
+
*
|
|
142
|
+
* TECHNICAL DETAILS:
|
|
143
|
+
* - Uses Animated.Value for scale, driven by onPressIn / onPressOut
|
|
144
|
+
* - Safe-area aware: extra bottom padding on iOS
|
|
145
|
+
*
|
|
146
|
+
* NOTES:
|
|
147
|
+
* - Keeps zIndex high (9999) so it floats above app content
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
interface MushiFloatingButtonProps {
|
|
151
|
+
onPress: () => void;
|
|
152
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
153
|
+
}
|
|
154
|
+
declare const MushiFloatingButton: FC<MushiFloatingButtonProps>;
|
|
155
|
+
|
|
89
156
|
interface NavigationEntry {
|
|
90
157
|
screen: string;
|
|
91
158
|
timestamp: number;
|
|
@@ -106,11 +173,11 @@ declare class AsyncStorageQueue {
|
|
|
106
173
|
apiEndpoint: string;
|
|
107
174
|
apiKey: string;
|
|
108
175
|
});
|
|
109
|
-
enqueue(report:
|
|
176
|
+
enqueue(report: object): Promise<void>;
|
|
110
177
|
flush(): Promise<number>;
|
|
111
178
|
size(): Promise<number>;
|
|
112
179
|
private getQueue;
|
|
113
180
|
private getAsyncStorage;
|
|
114
181
|
}
|
|
115
182
|
|
|
116
|
-
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MushiProvider, type MushiRNConfig, type MushiRNInstance, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|
|
183
|
+
export { AsyncStorageQueue, type ConsoleEntry, type DeviceInfo, MushiBottomSheet, type MushiBottomSheetProps, MushiFloatingButton, type MushiFloatingButtonProps, MushiProvider, type MushiRNConfig, type MushiRNInstance, type NavigationEntry, type NetworkEntry, getDeviceInfo, setupConsoleCapture, setupNetworkCapture, useMushi, useMushiReport, useMushiWidget, useNavigationCapture };
|