react-native-inapp-inspector 2.2.5 → 2.2.7
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 +0 -10
- package/dist/commonjs/components/Inspector/InspectorHeader.js +0 -73
- package/dist/commonjs/components/Inspector/MainScreen.js +0 -4
- package/dist/commonjs/components/Inspector/SettingsPanel.js +2 -107
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +0 -1
- package/dist/commonjs/helpers/index.js +0 -1
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.js +2 -19
- package/dist/esm/components/Inspector/InspectorHeader.js +0 -73
- package/dist/esm/components/Inspector/MainScreen.js +0 -4
- package/dist/esm/components/Inspector/SettingsPanel.js +2 -107
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/index.d.ts +0 -1
- package/dist/esm/helpers/index.js +0 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -12
- package/ios/NetworkInspectorModule.mm +1 -10
- package/package.json +2 -2
- package/src/components/Inspector/InspectorHeader.tsx +0 -93
- package/src/components/Inspector/MainScreen.tsx +0 -4
- package/src/components/Inspector/SettingsPanel.tsx +2 -128
- package/src/constants/version.ts +1 -1
- package/src/helpers/index.ts +0 -1
- package/src/index.tsx +2 -24
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.d.ts +0 -3
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +0 -353
- package/dist/commonjs/helpers/telemetry.d.ts +0 -99
- package/dist/commonjs/helpers/telemetry.js +0 -398
- package/dist/esm/components/Inspector/TelemetryConsentModal.d.ts +0 -3
- package/dist/esm/components/Inspector/TelemetryConsentModal.js +0 -316
- package/dist/esm/helpers/telemetry.d.ts +0 -99
- package/dist/esm/helpers/telemetry.js +0 -380
- package/src/components/Inspector/TelemetryConsentModal.tsx +0 -357
- package/src/helpers/telemetry.ts +0 -505
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import React, {useState, useEffect} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Modal,
|
|
4
|
-
View,
|
|
5
|
-
Text,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
Animated,
|
|
9
|
-
Platform,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
import {BrandSquareIcon} from '../BrandSquareIcon';
|
|
12
|
-
import {
|
|
13
|
-
SettingsIcon,
|
|
14
|
-
ShieldCheckIcon,
|
|
15
|
-
CheckIcon,
|
|
16
|
-
ClearIcon,
|
|
17
|
-
} from '../NetworkIcons';
|
|
18
|
-
import {
|
|
19
|
-
getTelemetryConsentStatus,
|
|
20
|
-
setTelemetryConsent,
|
|
21
|
-
sendSessionTelemetryPing,
|
|
22
|
-
} from '../../helpers/telemetry';
|
|
23
|
-
|
|
24
|
-
export const TelemetryConsentModal = () => {
|
|
25
|
-
const [visible, setVisible] = useState(false);
|
|
26
|
-
const fadeAnim = useState(new Animated.Value(0))[0];
|
|
27
|
-
const scaleAnim = useState(new Animated.Value(0.92))[0];
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
let isMounted = true;
|
|
31
|
-
getTelemetryConsentStatus().then(status => {
|
|
32
|
-
if (isMounted && status === 'undetermined') {
|
|
33
|
-
setVisible(true);
|
|
34
|
-
Animated.parallel([
|
|
35
|
-
Animated.timing(fadeAnim, {
|
|
36
|
-
toValue: 1,
|
|
37
|
-
duration: 250,
|
|
38
|
-
useNativeDriver: true,
|
|
39
|
-
}),
|
|
40
|
-
Animated.spring(scaleAnim, {
|
|
41
|
-
toValue: 1,
|
|
42
|
-
friction: 8,
|
|
43
|
-
tension: 45,
|
|
44
|
-
useNativeDriver: true,
|
|
45
|
-
}),
|
|
46
|
-
]).start();
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return () => {
|
|
50
|
-
isMounted = false;
|
|
51
|
-
};
|
|
52
|
-
}, [fadeAnim, scaleAnim]);
|
|
53
|
-
|
|
54
|
-
const handleDecision = async (granted: boolean) => {
|
|
55
|
-
Animated.parallel([
|
|
56
|
-
Animated.timing(fadeAnim, {
|
|
57
|
-
toValue: 0,
|
|
58
|
-
duration: 180,
|
|
59
|
-
useNativeDriver: true,
|
|
60
|
-
}),
|
|
61
|
-
Animated.timing(scaleAnim, {
|
|
62
|
-
toValue: 0.92,
|
|
63
|
-
duration: 180,
|
|
64
|
-
useNativeDriver: true,
|
|
65
|
-
}),
|
|
66
|
-
]).start(async () => {
|
|
67
|
-
setVisible(false);
|
|
68
|
-
await setTelemetryConsent(granted);
|
|
69
|
-
if (granted) {
|
|
70
|
-
// Immediately trigger the session initialization ping
|
|
71
|
-
sendSessionTelemetryPing({force: true});
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
if (!visible) return null;
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<Modal
|
|
80
|
-
transparent
|
|
81
|
-
visible={visible}
|
|
82
|
-
animationType="none"
|
|
83
|
-
statusBarTranslucent>
|
|
84
|
-
<View style={styles.overlay}>
|
|
85
|
-
<Animated.View
|
|
86
|
-
style={[
|
|
87
|
-
styles.card,
|
|
88
|
-
{
|
|
89
|
-
opacity: fadeAnim,
|
|
90
|
-
transform: [{scale: scaleAnim}],
|
|
91
|
-
},
|
|
92
|
-
]}>
|
|
93
|
-
{/* Top-Right Dismiss Icon Button */}
|
|
94
|
-
<TouchableOpacity
|
|
95
|
-
style={styles.topCloseButton}
|
|
96
|
-
onPress={() => handleDecision(false)}
|
|
97
|
-
hitSlop={10}
|
|
98
|
-
activeOpacity={0.7}>
|
|
99
|
-
<ClearIcon size={12} color="#64748B" />
|
|
100
|
-
</TouchableOpacity>
|
|
101
|
-
|
|
102
|
-
{/* Centered Enlarged Square Brand Icon Header */}
|
|
103
|
-
<View style={styles.headerSection}>
|
|
104
|
-
<View style={styles.iconHaloRing}>
|
|
105
|
-
<BrandSquareIcon size={54} />
|
|
106
|
-
</View>
|
|
107
|
-
|
|
108
|
-
<Text style={styles.title}>Help Improve In-App Inspector</Text>
|
|
109
|
-
<Text style={styles.subtitle}>Anonymous Diagnostic Insights</Text>
|
|
110
|
-
|
|
111
|
-
{/* Subheading instruction hint badge */}
|
|
112
|
-
<View style={styles.hintBadge}>
|
|
113
|
-
<SettingsIcon size={12} color="#6366F1" />
|
|
114
|
-
<Text style={styles.hintBadgeText}>
|
|
115
|
-
You can enable or disable this anytime in Settings
|
|
116
|
-
</Text>
|
|
117
|
-
</View>
|
|
118
|
-
</View>
|
|
119
|
-
|
|
120
|
-
{/* Description */}
|
|
121
|
-
<Text style={styles.description}>
|
|
122
|
-
To help us continually enhance tooling performance and compatibility,
|
|
123
|
-
would you mind sharing anonymous diagnostics (such as React Native
|
|
124
|
-
version, JavaScript engine, and device architecture)?
|
|
125
|
-
</Text>
|
|
126
|
-
|
|
127
|
-
{/* Privacy Callout Box */}
|
|
128
|
-
<View style={styles.privacyBadge}>
|
|
129
|
-
<View style={styles.privacyShieldWrapper}>
|
|
130
|
-
<ShieldCheckIcon size={15} color="#7C3AED" />
|
|
131
|
-
</View>
|
|
132
|
-
<Text style={styles.privacyText}>
|
|
133
|
-
<Text style={styles.privacyHighlight}>Privacy Guaranteed:</Text> We
|
|
134
|
-
strictly collect non-identifiable technical metrics. No user data,
|
|
135
|
-
passwords, tokens, or network payload bodies are ever captured.
|
|
136
|
-
</Text>
|
|
137
|
-
</View>
|
|
138
|
-
|
|
139
|
-
{/* Enhanced Action Buttons with Icons */}
|
|
140
|
-
<View style={styles.buttonRow}>
|
|
141
|
-
<TouchableOpacity
|
|
142
|
-
style={styles.declineButton}
|
|
143
|
-
onPress={() => handleDecision(false)}
|
|
144
|
-
activeOpacity={0.7}>
|
|
145
|
-
<ClearIcon size={12} color="#64748B" />
|
|
146
|
-
<Text style={styles.declineText}>Not Now</Text>
|
|
147
|
-
</TouchableOpacity>
|
|
148
|
-
|
|
149
|
-
<TouchableOpacity
|
|
150
|
-
style={styles.allowButton}
|
|
151
|
-
onPress={() => handleDecision(true)}
|
|
152
|
-
activeOpacity={0.85}>
|
|
153
|
-
<CheckIcon size={13} color="#FFFFFF" />
|
|
154
|
-
<Text style={styles.allowText}>Allow & Share</Text>
|
|
155
|
-
</TouchableOpacity>
|
|
156
|
-
</View>
|
|
157
|
-
</Animated.View>
|
|
158
|
-
</View>
|
|
159
|
-
</Modal>
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
const fontStack = Platform.select({
|
|
164
|
-
ios: {
|
|
165
|
-
fontFamily: 'System',
|
|
166
|
-
},
|
|
167
|
-
android: {
|
|
168
|
-
fontFamily: 'sans-serif',
|
|
169
|
-
},
|
|
170
|
-
default: {},
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
const styles = StyleSheet.create({
|
|
174
|
-
overlay: {
|
|
175
|
-
flex: 1,
|
|
176
|
-
backgroundColor: 'rgba(15, 23, 42, 0.56)',
|
|
177
|
-
justifyContent: 'center',
|
|
178
|
-
alignItems: 'center',
|
|
179
|
-
paddingHorizontal: 20,
|
|
180
|
-
zIndex: 999999,
|
|
181
|
-
},
|
|
182
|
-
card: {
|
|
183
|
-
width: '100%',
|
|
184
|
-
maxWidth: 356,
|
|
185
|
-
backgroundColor: '#FFFFFF',
|
|
186
|
-
borderRadius: 24,
|
|
187
|
-
borderWidth: 1,
|
|
188
|
-
borderColor: '#E2E8F0',
|
|
189
|
-
paddingHorizontal: 20,
|
|
190
|
-
paddingTop: 22,
|
|
191
|
-
paddingBottom: 20,
|
|
192
|
-
alignItems: 'center',
|
|
193
|
-
shadowColor: '#0F172A',
|
|
194
|
-
shadowOffset: {width: 0, height: 16},
|
|
195
|
-
shadowOpacity: 0.22,
|
|
196
|
-
shadowRadius: 32,
|
|
197
|
-
elevation: 24,
|
|
198
|
-
},
|
|
199
|
-
topCloseButton: {
|
|
200
|
-
position: 'absolute',
|
|
201
|
-
top: 14,
|
|
202
|
-
right: 14,
|
|
203
|
-
width: 28,
|
|
204
|
-
height: 28,
|
|
205
|
-
borderRadius: 14,
|
|
206
|
-
backgroundColor: '#F8FAFC',
|
|
207
|
-
justifyContent: 'center',
|
|
208
|
-
alignItems: 'center',
|
|
209
|
-
borderWidth: 1,
|
|
210
|
-
borderColor: '#E2E8F0',
|
|
211
|
-
zIndex: 10,
|
|
212
|
-
},
|
|
213
|
-
headerSection: {
|
|
214
|
-
alignItems: 'center',
|
|
215
|
-
width: '100%',
|
|
216
|
-
marginBottom: 4,
|
|
217
|
-
},
|
|
218
|
-
iconHaloRing: {
|
|
219
|
-
width: 66,
|
|
220
|
-
height: 66,
|
|
221
|
-
borderRadius: 20,
|
|
222
|
-
backgroundColor: '#FAF5FF',
|
|
223
|
-
justifyContent: 'center',
|
|
224
|
-
alignItems: 'center',
|
|
225
|
-
borderWidth: 1.5,
|
|
226
|
-
borderColor: '#F3E8FF',
|
|
227
|
-
marginBottom: 8,
|
|
228
|
-
shadowColor: '#7C3AED',
|
|
229
|
-
shadowOffset: {width: 0, height: 4},
|
|
230
|
-
shadowOpacity: 0.16,
|
|
231
|
-
shadowRadius: 10,
|
|
232
|
-
elevation: 4,
|
|
233
|
-
},
|
|
234
|
-
title: {
|
|
235
|
-
fontSize: 17,
|
|
236
|
-
fontWeight: '800',
|
|
237
|
-
color: '#0F172A',
|
|
238
|
-
letterSpacing: -0.4,
|
|
239
|
-
textAlign: 'center',
|
|
240
|
-
lineHeight: 22,
|
|
241
|
-
marginBottom: 2,
|
|
242
|
-
...fontStack,
|
|
243
|
-
},
|
|
244
|
-
subtitle: {
|
|
245
|
-
fontSize: 11.5,
|
|
246
|
-
fontWeight: '600',
|
|
247
|
-
color: '#7C3AED',
|
|
248
|
-
textAlign: 'center',
|
|
249
|
-
letterSpacing: 0.2,
|
|
250
|
-
marginBottom: 6,
|
|
251
|
-
...fontStack,
|
|
252
|
-
},
|
|
253
|
-
hintBadge: {
|
|
254
|
-
flexDirection: 'row',
|
|
255
|
-
alignItems: 'center',
|
|
256
|
-
justifyContent: 'center',
|
|
257
|
-
gap: 5,
|
|
258
|
-
backgroundColor: '#EDE9FE80',
|
|
259
|
-
borderWidth: 1,
|
|
260
|
-
borderColor: '#DDD6FE',
|
|
261
|
-
borderRadius: 7,
|
|
262
|
-
paddingHorizontal: 8,
|
|
263
|
-
paddingVertical: 3,
|
|
264
|
-
marginBottom: 8,
|
|
265
|
-
},
|
|
266
|
-
hintBadgeText: {
|
|
267
|
-
fontSize: 10,
|
|
268
|
-
fontWeight: '600',
|
|
269
|
-
color: '#6D28D9',
|
|
270
|
-
textAlign: 'center',
|
|
271
|
-
...fontStack,
|
|
272
|
-
},
|
|
273
|
-
description: {
|
|
274
|
-
fontSize: 12,
|
|
275
|
-
lineHeight: 17.5,
|
|
276
|
-
color: '#475569',
|
|
277
|
-
textAlign: 'center',
|
|
278
|
-
marginBottom: 12,
|
|
279
|
-
paddingHorizontal: 2,
|
|
280
|
-
...fontStack,
|
|
281
|
-
},
|
|
282
|
-
privacyBadge: {
|
|
283
|
-
flexDirection: 'row',
|
|
284
|
-
alignItems: 'flex-start',
|
|
285
|
-
backgroundColor: '#F8FAFC',
|
|
286
|
-
borderRadius: 12,
|
|
287
|
-
paddingVertical: 8,
|
|
288
|
-
paddingHorizontal: 10,
|
|
289
|
-
borderWidth: 1,
|
|
290
|
-
borderColor: '#E2E8F0',
|
|
291
|
-
marginBottom: 14,
|
|
292
|
-
width: '100%',
|
|
293
|
-
},
|
|
294
|
-
privacyShieldWrapper: {
|
|
295
|
-
marginRight: 7,
|
|
296
|
-
marginTop: 1,
|
|
297
|
-
},
|
|
298
|
-
privacyText: {
|
|
299
|
-
flex: 1,
|
|
300
|
-
fontSize: 10.8,
|
|
301
|
-
lineHeight: 15,
|
|
302
|
-
color: '#475569',
|
|
303
|
-
...fontStack,
|
|
304
|
-
},
|
|
305
|
-
privacyHighlight: {
|
|
306
|
-
fontWeight: '700',
|
|
307
|
-
color: '#1E293B',
|
|
308
|
-
},
|
|
309
|
-
buttonRow: {
|
|
310
|
-
flexDirection: 'row',
|
|
311
|
-
justifyContent: 'space-between',
|
|
312
|
-
alignItems: 'center',
|
|
313
|
-
gap: 10,
|
|
314
|
-
width: '100%',
|
|
315
|
-
},
|
|
316
|
-
declineButton: {
|
|
317
|
-
flex: 1,
|
|
318
|
-
flexDirection: 'row',
|
|
319
|
-
alignItems: 'center',
|
|
320
|
-
justifyContent: 'center',
|
|
321
|
-
gap: 5,
|
|
322
|
-
paddingVertical: 11,
|
|
323
|
-
borderRadius: 12,
|
|
324
|
-
backgroundColor: '#F1F5F9',
|
|
325
|
-
borderWidth: 1,
|
|
326
|
-
borderColor: '#E2E8F0',
|
|
327
|
-
},
|
|
328
|
-
declineText: {
|
|
329
|
-
fontSize: 13,
|
|
330
|
-
fontWeight: '600',
|
|
331
|
-
color: '#475569',
|
|
332
|
-
...fontStack,
|
|
333
|
-
},
|
|
334
|
-
allowButton: {
|
|
335
|
-
flex: 1,
|
|
336
|
-
flexDirection: 'row',
|
|
337
|
-
alignItems: 'center',
|
|
338
|
-
justifyContent: 'center',
|
|
339
|
-
gap: 5,
|
|
340
|
-
paddingVertical: 11,
|
|
341
|
-
borderRadius: 12,
|
|
342
|
-
backgroundColor: '#7C3AED',
|
|
343
|
-
shadowColor: '#7C3AED',
|
|
344
|
-
shadowOffset: {width: 0, height: 3},
|
|
345
|
-
shadowOpacity: 0.28,
|
|
346
|
-
shadowRadius: 6,
|
|
347
|
-
elevation: 4,
|
|
348
|
-
},
|
|
349
|
-
allowText: {
|
|
350
|
-
fontSize: 13,
|
|
351
|
-
fontWeight: '700',
|
|
352
|
-
color: '#FFFFFF',
|
|
353
|
-
...fontStack,
|
|
354
|
-
},
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
export default TelemetryConsentModal;
|