react-native-inapp-inspector 2.3.14 → 2.3.16
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 +1 -0
- package/dist/commonjs/components/AnimatedEntrance.js +3 -3
- package/dist/commonjs/components/ConsoleLogCard.js +174 -100
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +0 -22
- package/dist/commonjs/components/Inspector/ConsoleTab.js +25 -38
- package/dist/commonjs/components/Inspector/CrashTab.js +19 -28
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +198 -98
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.js +552 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +58 -6
- package/dist/commonjs/components/Inspector/MainScreen.js +100 -58
- package/dist/commonjs/components/Inspector/NetworkTab.js +26 -371
- package/dist/commonjs/components/Inspector/NpmStarPrompt.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +494 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +40 -7
- package/dist/commonjs/components/Inspector/ReduxTab.js +3 -23
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1035 -173
- package/dist/commonjs/components/Inspector/StorageTab.js +23 -28
- package/dist/commonjs/components/Inspector/TabBar.js +50 -15
- package/dist/commonjs/components/JsonViewer.js +14 -2
- package/dist/commonjs/components/LogCard.js +428 -227
- package/dist/commonjs/components/NetworkIcons.d.ts +5 -0
- package/dist/commonjs/components/NetworkIcons.js +33 -2
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +34 -2
- package/dist/commonjs/customHooks/crashHandler.js +1 -1
- package/dist/commonjs/customHooks/networkLogger.js +184 -26
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +1 -0
- package/dist/commonjs/helpers/remoteConfig.d.ts +4 -0
- package/dist/commonjs/helpers/remoteConfig.js +165 -0
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +39 -291
- package/dist/commonjs/helpers/telemetry.d.ts +5 -0
- package/dist/commonjs/helpers/telemetry.js +339 -8
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +173 -29
- package/dist/commonjs/styles/AppFonts.d.ts +2 -0
- package/dist/commonjs/styles/AppFonts.js +1 -0
- package/dist/commonjs/styles/index.d.ts +22 -0
- package/dist/commonjs/styles/index.js +19 -0
- package/dist/commonjs/types/enums.d.ts +1 -0
- package/dist/commonjs/types/enums.js +1 -0
- package/dist/commonjs/types/interfaces.d.ts +12 -0
- package/dist/esm/components/AnimatedEntrance.js +3 -3
- package/dist/esm/components/ConsoleLogCard.js +141 -100
- package/dist/esm/components/Inspector/AnalyticsTab.js +1 -23
- package/dist/esm/components/Inspector/ConsoleTab.js +26 -39
- package/dist/esm/components/Inspector/CrashTab.js +20 -29
- package/dist/esm/components/Inspector/DeviceInfoTab.js +198 -98
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +7 -0
- package/dist/esm/components/Inspector/FeedbackModal.js +515 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +60 -8
- package/dist/esm/components/Inspector/MainScreen.js +101 -59
- package/dist/esm/components/Inspector/NetworkTab.js +27 -372
- package/dist/esm/components/Inspector/NpmStarPrompt.d.ts +3 -0
- package/dist/esm/components/Inspector/NpmStarPrompt.js +454 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +40 -7
- package/dist/esm/components/Inspector/ReduxTab.js +4 -24
- package/dist/esm/components/Inspector/SettingsPanel.js +1038 -176
- package/dist/esm/components/Inspector/StorageTab.js +23 -28
- package/dist/esm/components/Inspector/TabBar.js +50 -15
- package/dist/esm/components/JsonViewer.js +14 -2
- package/dist/esm/components/LogCard.js +422 -221
- package/dist/esm/components/NetworkIcons.d.ts +5 -0
- package/dist/esm/components/NetworkIcons.js +26 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +34 -2
- package/dist/esm/customHooks/crashHandler.js +1 -1
- package/dist/esm/customHooks/networkLogger.js +184 -26
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/remoteConfig.d.ts +4 -0
- package/dist/esm/helpers/remoteConfig.js +160 -0
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +39 -291
- package/dist/esm/helpers/telemetry.d.ts +5 -0
- package/dist/esm/helpers/telemetry.js +332 -9
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +171 -29
- package/dist/esm/styles/AppFonts.d.ts +2 -0
- package/dist/esm/styles/AppFonts.js +1 -0
- package/dist/esm/styles/index.d.ts +22 -0
- package/dist/esm/styles/index.js +19 -0
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -0
- package/dist/esm/types/interfaces.d.ts +12 -0
- package/package.json +1 -1
- package/src/components/AnimatedEntrance.tsx +3 -3
- package/src/components/ConsoleLogCard.tsx +154 -103
- package/src/components/Inspector/AnalyticsTab.tsx +0 -23
- package/src/components/Inspector/ConsoleTab.tsx +27 -41
- package/src/components/Inspector/CrashTab.tsx +19 -28
- package/src/components/Inspector/DeviceInfoTab.tsx +224 -102
- package/src/components/Inspector/FeedbackModal.tsx +626 -0
- package/src/components/Inspector/InspectorHeader.tsx +83 -5
- package/src/components/Inspector/MainScreen.tsx +61 -6
- package/src/components/Inspector/NetworkTab.tsx +70 -480
- package/src/components/Inspector/NpmStarPrompt.tsx +532 -0
- package/src/components/Inspector/PerformanceTab.tsx +44 -8
- package/src/components/Inspector/ReduxTab.tsx +9 -24
- package/src/components/Inspector/SettingsPanel.tsx +1162 -197
- package/src/components/Inspector/StorageTab.tsx +27 -30
- package/src/components/Inspector/TabBar.tsx +57 -20
- package/src/components/JsonViewer.tsx +15 -2
- package/src/components/LogCard.tsx +528 -339
- package/src/components/NetworkIcons.tsx +92 -0
- package/src/constants/version.ts +1 -1
- package/src/customHooks/analyticsLogger.ts +1 -1
- package/src/customHooks/consoleLogger.ts +36 -3
- package/src/customHooks/crashHandler.ts +1 -1
- package/src/customHooks/networkLogger.ts +214 -26
- package/src/helpers/index.ts +1 -0
- package/src/helpers/remoteConfig.ts +212 -0
- package/src/helpers/searchQueryParser.ts +42 -284
- package/src/helpers/telemetry.ts +381 -10
- package/src/index.tsx +374 -211
- package/src/styles/AppFonts.ts +2 -0
- package/src/styles/index.ts +20 -1
- package/src/types/enums.ts +1 -0
- package/src/types/interfaces.ts +12 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
2
2
|
import { View, Text, ScrollView, FlatList, TextInput, Modal, Alert, StyleSheet, ActivityIndicator, Platform, } from 'react-native';
|
|
3
3
|
import TouchableScale from '../TouchableScale';
|
|
4
|
-
import globalStyles from '../../styles';
|
|
5
4
|
import { AppColors } from '../../styles/AppColors';
|
|
6
5
|
import { AppFonts } from '../../styles/AppFonts';
|
|
7
6
|
import { useTranslation } from '../../i18n';
|
|
@@ -232,8 +231,11 @@ export const StorageTab = React.memo(() => {
|
|
|
232
231
|
const filteredEntries = useMemo(() => {
|
|
233
232
|
if (!search.trim())
|
|
234
233
|
return entries;
|
|
235
|
-
const
|
|
236
|
-
return entries.filter(e =>
|
|
234
|
+
const tokens = search.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
235
|
+
return entries.filter(e => {
|
|
236
|
+
const corpus = `${e.key} ${e.value}`.toLowerCase();
|
|
237
|
+
return tokens.every(tok => corpus.includes(tok));
|
|
238
|
+
});
|
|
237
239
|
}, [entries, search]);
|
|
238
240
|
const totalBytes = useMemo(() => {
|
|
239
241
|
return entries.reduce((sum, e) => sum + e.byteSize, 0);
|
|
@@ -371,36 +373,29 @@ export const StorageTab = React.memo(() => {
|
|
|
371
373
|
<DatabaseIcon size={28} color={AppColors.grayTextWeak}/>
|
|
372
374
|
</View>
|
|
373
375
|
<Text style={styles.emptyTitle}>
|
|
374
|
-
{search
|
|
376
|
+
{search.trim().length > 0
|
|
377
|
+
? 'No matching keys found'
|
|
378
|
+
: `No ${activeDriver === 'asyncStorage' ? 'AsyncStorage' : 'MMKV'} Keys`}
|
|
375
379
|
</Text>
|
|
376
380
|
<Text style={styles.emptySubtitle}>
|
|
377
|
-
{search
|
|
378
|
-
?
|
|
381
|
+
{search.trim().length > 0
|
|
382
|
+
? `No keys or values match "${search}"`
|
|
379
383
|
: `Storage is auto-detected. Tap "+ Add" above to create your first ${activeDriver === 'asyncStorage' ? 'AsyncStorage' : 'MMKV'} key!`}
|
|
380
384
|
</Text>
|
|
385
|
+
{search.trim().length > 0 && (<TouchableScale onPress={() => setSearch('')} style={{
|
|
386
|
+
marginTop: 12,
|
|
387
|
+
paddingHorizontal: 14,
|
|
388
|
+
paddingVertical: 6,
|
|
389
|
+
borderRadius: 8,
|
|
390
|
+
backgroundColor: AppColors.grayBackground,
|
|
391
|
+
borderWidth: 1,
|
|
392
|
+
borderColor: AppColors.grayBorderSecondary,
|
|
393
|
+
}}>
|
|
394
|
+
<Text style={{ color: AppColors.brandPurple, fontSize: 12, fontFamily: AppFonts.interBold }}>
|
|
395
|
+
Clear Search
|
|
396
|
+
</Text>
|
|
397
|
+
</TouchableScale>)}
|
|
381
398
|
</View>} ListFooterComponent={<View style={{ height: 60 }}/>}/>
|
|
382
|
-
|
|
383
|
-
<TouchableScale onPress={() => {
|
|
384
|
-
try {
|
|
385
|
-
listRef.current?.scrollToOffset({
|
|
386
|
-
offset: 0,
|
|
387
|
-
animated: true,
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
catch {
|
|
391
|
-
try {
|
|
392
|
-
listRef.current?.scrollToIndex({
|
|
393
|
-
index: 0,
|
|
394
|
-
animated: true,
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
catch { }
|
|
398
|
-
}
|
|
399
|
-
}} hitSlop={12} style={globalStyles.scrollTopBtn}>
|
|
400
|
-
<View style={{ transform: [{ rotate: '180deg' }] }}>
|
|
401
|
-
<ChevronIcon color={AppColors.white} size={18}/>
|
|
402
|
-
</View>
|
|
403
|
-
</TouchableScale>
|
|
404
399
|
</>)}
|
|
405
400
|
|
|
406
401
|
|
|
@@ -3,6 +3,7 @@ import { Animated, Platform, ScrollView, Text, View, } from 'react-native';
|
|
|
3
3
|
import { useInspector } from './InspectorContext';
|
|
4
4
|
import styles from '../../styles';
|
|
5
5
|
import { AppColors } from '../../styles/AppColors';
|
|
6
|
+
import { AppFonts } from '../../styles/AppFonts';
|
|
6
7
|
import TouchableScale from '../TouchableScale';
|
|
7
8
|
import { SignalIcon, TerminalIcon, AnalyticsIcon, PackageIcon, ReduxIcon, PerformanceIcon, CrashIcon, SmartphoneIcon, DatabaseIcon, QrCodeIcon, } from '../NetworkIcons';
|
|
8
9
|
import { isReduxConnected } from '../../customHooks/reduxLogger';
|
|
@@ -16,60 +17,70 @@ const TabBar = React.memo(() => {
|
|
|
16
17
|
<ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={{ paddingRight: 16 }}>
|
|
17
18
|
{[
|
|
18
19
|
{
|
|
20
|
+
id: 1,
|
|
19
21
|
key: 'apis',
|
|
20
22
|
label: 'APIs',
|
|
21
23
|
count: logs.length,
|
|
22
24
|
icon: 'apis',
|
|
23
25
|
},
|
|
24
26
|
{
|
|
27
|
+
id: 2,
|
|
25
28
|
key: 'logs',
|
|
26
29
|
label: 'Logs',
|
|
27
30
|
count: consoleLogs.length,
|
|
28
31
|
icon: 'logs',
|
|
29
32
|
},
|
|
30
33
|
{
|
|
34
|
+
id: 3,
|
|
31
35
|
key: 'analytics',
|
|
32
36
|
label: 'Analytics',
|
|
33
37
|
count: analyticsEvents.length,
|
|
34
38
|
icon: 'analytics',
|
|
35
39
|
},
|
|
36
40
|
{
|
|
41
|
+
id: 4,
|
|
37
42
|
key: 'redux',
|
|
38
43
|
label: 'Redux',
|
|
39
44
|
count: 0,
|
|
40
45
|
icon: 'redux',
|
|
41
46
|
},
|
|
42
47
|
{
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
id: 5,
|
|
49
|
+
key: 'storage',
|
|
50
|
+
label: 'Storage',
|
|
45
51
|
count: 0,
|
|
46
|
-
icon: '
|
|
52
|
+
icon: 'storage',
|
|
47
53
|
},
|
|
48
54
|
{
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
id: 6,
|
|
56
|
+
key: 'device',
|
|
57
|
+
label: 'Device',
|
|
51
58
|
count: 0,
|
|
52
|
-
icon: '
|
|
59
|
+
icon: 'device',
|
|
53
60
|
},
|
|
54
61
|
{
|
|
62
|
+
id: 7,
|
|
55
63
|
key: 'crash',
|
|
56
64
|
label: 'Crash',
|
|
57
65
|
count: crashRecords?.length || 0,
|
|
58
66
|
icon: 'crash',
|
|
59
67
|
},
|
|
60
68
|
{
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
id: 8,
|
|
70
|
+
key: 'bundle',
|
|
71
|
+
label: 'Bundle',
|
|
63
72
|
count: 0,
|
|
64
|
-
icon: '
|
|
73
|
+
icon: 'bundle',
|
|
65
74
|
},
|
|
66
75
|
{
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
id: 9,
|
|
77
|
+
key: 'performance',
|
|
78
|
+
label: 'Performance',
|
|
69
79
|
count: 0,
|
|
70
|
-
icon: '
|
|
80
|
+
icon: 'performance',
|
|
71
81
|
},
|
|
72
82
|
{
|
|
83
|
+
id: 10,
|
|
73
84
|
key: 'debugging',
|
|
74
85
|
label: 'Debugging',
|
|
75
86
|
count: 0,
|
|
@@ -119,12 +130,36 @@ const TabBar = React.memo(() => {
|
|
|
119
130
|
{tab.icon === 'logs' && (<TerminalIcon color={iconColor} size={14}/>)}
|
|
120
131
|
{tab.icon === 'analytics' && (<AnalyticsIcon color={iconColor} size={14}/>)}
|
|
121
132
|
{tab.icon === 'redux' && (<ReduxIcon color={iconColor} size={14}/>)}
|
|
133
|
+
{tab.icon === 'storage' && (<DatabaseIcon color={iconColor} size={14}/>)}
|
|
134
|
+
{tab.icon === 'device' && (<SmartphoneIcon color={iconColor} size={14}/>)}
|
|
135
|
+
{tab.icon === 'crash' && (<CrashIcon color={iconColor} size={14}/>)}
|
|
122
136
|
{tab.icon === 'bundle' && (<PackageIcon color={iconColor} size={14}/>)}
|
|
123
137
|
{tab.icon === 'performance' && (<PerformanceIcon color={iconColor} size={14}/>)}
|
|
124
|
-
{tab.icon === 'crash' && (<CrashIcon color={iconColor} size={14}/>)}
|
|
125
|
-
{tab.icon === 'device' && (<SmartphoneIcon color={iconColor} size={14}/>)}
|
|
126
|
-
{tab.icon === 'storage' && (<DatabaseIcon color={iconColor} size={14}/>)}
|
|
127
138
|
{tab.icon === 'debugging' && (<QrCodeIcon color={iconColor} size={14}/>)}
|
|
139
|
+
<View style={{
|
|
140
|
+
minWidth: 20,
|
|
141
|
+
height: 20,
|
|
142
|
+
paddingHorizontal: 4,
|
|
143
|
+
borderRadius: 10,
|
|
144
|
+
backgroundColor: isActive
|
|
145
|
+
? `${AppColors.white}33`
|
|
146
|
+
: `${AppColors.purple}1F`,
|
|
147
|
+
borderWidth: 1,
|
|
148
|
+
borderColor: isActive
|
|
149
|
+
? `${AppColors.white}66`
|
|
150
|
+
: `${AppColors.purple}40`,
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
justifyContent: 'center',
|
|
153
|
+
}}>
|
|
154
|
+
<Text style={{
|
|
155
|
+
fontFamily: AppFonts.interBold,
|
|
156
|
+
fontSize: 9.5,
|
|
157
|
+
lineHeight: 12,
|
|
158
|
+
color: isActive ? AppColors.white : AppColors.purple,
|
|
159
|
+
}}>
|
|
160
|
+
#{tab.id}
|
|
161
|
+
</Text>
|
|
162
|
+
</View>
|
|
128
163
|
<Text numberOfLines={1} ellipsizeMode="tail" style={[
|
|
129
164
|
styles.contentTabButtonText,
|
|
130
165
|
isActive &&
|
|
@@ -111,10 +111,22 @@ const JsonViewer = React.memo(({ data, search, forceOpen, defaultExpandDepth = 1
|
|
|
111
111
|
<Text style={localStyles.tableCellValue}>{String(data)}</Text>
|
|
112
112
|
</View>);
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
let keys = Object.keys(data);
|
|
115
|
+
if (search && search.trim().length > 0) {
|
|
116
|
+
const q = search.trim().toLowerCase();
|
|
117
|
+
keys = keys.filter(key => {
|
|
118
|
+
const val = data[key];
|
|
119
|
+
const valStr = typeof val === 'object' && val !== null ? JSON.stringify(val) : String(val);
|
|
120
|
+
return key.toLowerCase().includes(q) || valStr.toLowerCase().includes(q);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
115
123
|
if (keys.length === 0) {
|
|
116
124
|
return (<View style={localStyles.emptyTable}>
|
|
117
|
-
<Text style={localStyles.emptyTableText}>
|
|
125
|
+
<Text style={localStyles.emptyTableText}>
|
|
126
|
+
{search && search.trim().length > 0
|
|
127
|
+
? 'No matching keys or values found'
|
|
128
|
+
: t('network.jsonViewer.emptyTable')}
|
|
129
|
+
</Text>
|
|
118
130
|
</View>);
|
|
119
131
|
}
|
|
120
132
|
return (<View style={localStyles.tableView}>
|