react-native-inapp-inspector 2.0.0 → 2.0.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.
Files changed (63) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +10 -24
  2. package/dist/commonjs/components/ConsoleLogCard.js +5 -5
  3. package/dist/commonjs/components/EndOfListFooter.js +1 -1
  4. package/dist/commonjs/components/Inspector/AnalyticsTab.js +19 -71
  5. package/dist/commonjs/components/Inspector/BundleTab.js +670 -188
  6. package/dist/commonjs/components/Inspector/ConsoleTab.js +109 -98
  7. package/dist/commonjs/components/Inspector/CrashTab.js +2 -1
  8. package/dist/commonjs/components/Inspector/InspectorHeader.js +102 -19
  9. package/dist/commonjs/components/Inspector/MainScreen.js +147 -17
  10. package/dist/commonjs/components/Inspector/NetworkTab.js +104 -20
  11. package/dist/commonjs/components/Inspector/SettingsPanel.js +1111 -1385
  12. package/dist/commonjs/components/Inspector/TabBar.js +3 -4
  13. package/dist/commonjs/components/JsonViewer.js +9 -4
  14. package/dist/commonjs/components/LogCard.js +31 -1
  15. package/dist/commonjs/components/LogSyntaxHighlighter.d.ts +16 -0
  16. package/dist/commonjs/components/LogSyntaxHighlighter.js +130 -0
  17. package/dist/commonjs/components/NetworkIcons.d.ts +2 -0
  18. package/dist/commonjs/components/NetworkIcons.js +10 -1
  19. package/dist/commonjs/components/Slider.d.ts +13 -0
  20. package/dist/commonjs/components/Slider.js +261 -0
  21. package/dist/commonjs/constants/version.d.ts +1 -1
  22. package/dist/commonjs/constants/version.js +1 -1
  23. package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
  24. package/dist/commonjs/customHooks/crashHandler.js +1 -1
  25. package/dist/commonjs/helpers/index.d.ts +1 -0
  26. package/dist/commonjs/helpers/index.js +15 -0
  27. package/dist/commonjs/helpers/searchQueryParser.d.ts +6 -0
  28. package/dist/commonjs/helpers/searchQueryParser.js +236 -0
  29. package/dist/commonjs/helpers/settingsStore.js +13 -13
  30. package/dist/commonjs/index.js +7 -20
  31. package/dist/commonjs/styles/index.js +35 -35
  32. package/dist/esm/components/ConsoleLogCard.js +5 -5
  33. package/dist/esm/components/EndOfListFooter.js +2 -2
  34. package/dist/esm/components/Inspector/AnalyticsTab.js +21 -73
  35. package/dist/esm/components/Inspector/BundleTab.js +670 -188
  36. package/dist/esm/components/Inspector/ConsoleTab.js +110 -99
  37. package/dist/esm/components/Inspector/CrashTab.js +2 -1
  38. package/dist/esm/components/Inspector/InspectorHeader.js +103 -20
  39. package/dist/esm/components/Inspector/MainScreen.js +115 -18
  40. package/dist/esm/components/Inspector/NetworkTab.js +105 -21
  41. package/dist/esm/components/Inspector/SettingsPanel.js +1114 -1388
  42. package/dist/esm/components/Inspector/TabBar.js +4 -5
  43. package/dist/esm/components/JsonViewer.js +9 -4
  44. package/dist/esm/components/LogCard.js +32 -2
  45. package/dist/esm/components/LogSyntaxHighlighter.d.ts +16 -0
  46. package/dist/esm/components/LogSyntaxHighlighter.js +123 -0
  47. package/dist/esm/components/NetworkIcons.d.ts +2 -0
  48. package/dist/esm/components/NetworkIcons.js +7 -0
  49. package/dist/esm/components/Slider.d.ts +13 -0
  50. package/dist/esm/components/Slider.js +222 -0
  51. package/dist/esm/constants/version.d.ts +1 -1
  52. package/dist/esm/constants/version.js +1 -1
  53. package/dist/esm/customHooks/analyticsLogger.js +1 -1
  54. package/dist/esm/customHooks/crashHandler.js +1 -1
  55. package/dist/esm/helpers/index.d.ts +1 -0
  56. package/dist/esm/helpers/index.js +1 -0
  57. package/dist/esm/helpers/searchQueryParser.d.ts +6 -0
  58. package/dist/esm/helpers/searchQueryParser.js +233 -0
  59. package/dist/esm/helpers/settingsStore.js +13 -13
  60. package/dist/esm/index.js +8 -21
  61. package/dist/esm/styles/index.js +35 -35
  62. package/ios/NetworkInspectorModule.m +81 -41
  63. package/package.json +1 -1
@@ -1,9 +1,42 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
39
+ const react_1 = __importStar(require("react"));
7
40
  const react_native_1 = require("react-native");
8
41
  const InspectorContext_1 = require("./InspectorContext");
9
42
  const ErrorBoundary_1 = __importDefault(require("../ErrorBoundary"));
@@ -34,6 +67,40 @@ const MainScreen = () => {
34
67
  (activeTab === 'logs' && selectedLog != null) ||
35
68
  (activeTab === 'redux' && (selectedReduxSlice != null || selectedReduxAction != null)) ||
36
69
  (activeTab === 'crash' && selectedCrash != null);
70
+ // ─── 60 FPS Transition Animations ──────────────────────────────────────────
71
+ const detailAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
72
+ (0, react_1.useEffect)(() => {
73
+ if (isDetailActive) {
74
+ detailAnim.setValue(0);
75
+ react_native_1.Animated.spring(detailAnim, {
76
+ toValue: 1,
77
+ friction: 8,
78
+ tension: 65,
79
+ useNativeDriver: true,
80
+ }).start();
81
+ }
82
+ }, [isDetailActive]);
83
+ const settingsAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
84
+ (0, react_1.useEffect)(() => {
85
+ if (settingsPage !== null) {
86
+ settingsAnim.setValue(0);
87
+ react_native_1.Animated.spring(settingsAnim, {
88
+ toValue: 1,
89
+ friction: 8,
90
+ tension: 65,
91
+ useNativeDriver: true,
92
+ }).start();
93
+ }
94
+ }, [settingsPage !== null]);
95
+ const tabAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
96
+ (0, react_1.useEffect)(() => {
97
+ tabAnim.setValue(0);
98
+ react_native_1.Animated.timing(tabAnim, {
99
+ toValue: 1,
100
+ duration: 150,
101
+ useNativeDriver: true,
102
+ }).start();
103
+ }, [activeTab]);
37
104
  return (<>
38
105
  {(react_native_1.Platform.OS === 'ios' || react_native_1.Platform.OS === 'android') &&
39
106
  isEnabled &&
@@ -54,23 +121,86 @@ const MainScreen = () => {
54
121
 
55
122
  <InspectorHeader_1.default />
56
123
 
57
- {/* ─── Horizontal Scrollable Tab Bar inside Content ─── */}
58
- {!isDetailActive && settingsPage === null ? (<TabBar_1.default />) : null}
124
+ <react_native_1.View style={{ flex: 1 }}>
125
+ {isReady ? (<react_native_1.View style={{ flex: 1 }}>
126
+ {/* ─── Horizontal Scrollable Tab Bar inside Content ─── */}
127
+ {!isDetailActive && <TabBar_1.default />}
59
128
 
60
- {settingsPage !== null ? (<SettingsPanel_1.default />) : isReady ? (isDetailActive ? (activeTab === 'apis' && selected != null ? (<NetworkDetail_1.default />) : activeTab === 'analytics' && selectedEvent != null ? (<AnalyticsDetail_1.default event={selectedEvent}/>) : activeTab === 'logs' && selectedLog != null ? (<LogDetail_1.default />) : activeTab === 'redux' ? (<ReduxDetail_1.default />) : activeTab === 'crash' && selectedCrash != null ? (<CrashDetail_1.default />) : null) : (<react_native_1.View style={{ flex: 1 }}>
61
- {activeTab === 'apis' && <NetworkTab_1.default />}
62
- {activeTab === 'logs' && <ConsoleTab_1.default />}
63
- {activeTab === 'analytics' && <AnalyticsTab_1.default />}
64
- {activeTab === 'redux' && <ReduxTab_1.default />}
65
- {activeTab === 'bundle' && <BundleTab_1.default />}
66
- {activeTab === 'performance' && <PerformanceTab_1.default />}
67
- {activeTab === 'crash' && <CrashTab_1.default />}
68
- </react_native_1.View>)) : (<react_native_1.View style={styles_1.default.empty}>
69
- <react_native_1.ActivityIndicator size="large" color={AppColors_1.AppColors.purple}/>
70
- <react_native_1.Text style={[styles_1.default.emptySub, { marginTop: 12 }]}>
71
- Loading logs...
72
- </react_native_1.Text>
73
- </react_native_1.View>)}
129
+ {/* Persistent List Layer - Never unmounted, preserves 100% native scroll with smooth tab transition */}
130
+ <react_native_1.Animated.View style={[
131
+ {
132
+ flex: 1,
133
+ opacity: tabAnim,
134
+ transform: [
135
+ {
136
+ translateY: tabAnim.interpolate({
137
+ inputRange: [0, 1],
138
+ outputRange: [6, 0],
139
+ }),
140
+ },
141
+ ],
142
+ },
143
+ (isDetailActive || settingsPage !== null) && {
144
+ pointerEvents: 'none',
145
+ },
146
+ ]}>
147
+ {activeTab === 'apis' && <NetworkTab_1.default />}
148
+ {activeTab === 'logs' && <ConsoleTab_1.default />}
149
+ {activeTab === 'analytics' && <AnalyticsTab_1.default />}
150
+ {activeTab === 'redux' && <ReduxTab_1.default />}
151
+ {activeTab === 'bundle' && <BundleTab_1.default />}
152
+ {activeTab === 'performance' && <PerformanceTab_1.default />}
153
+ {activeTab === 'crash' && <CrashTab_1.default />}
154
+ </react_native_1.Animated.View>
155
+
156
+ {/* Detail View Layer - Rendered on top with smooth slide & spring transition */}
157
+ {isDetailActive && (<react_native_1.Animated.View style={[
158
+ react_native_1.StyleSheet.absoluteFill,
159
+ {
160
+ backgroundColor: AppColors_1.AppColors.contentBg,
161
+ opacity: detailAnim,
162
+ transform: [
163
+ {
164
+ translateX: detailAnim.interpolate({
165
+ inputRange: [0, 1],
166
+ outputRange: [32, 0],
167
+ }),
168
+ },
169
+ ],
170
+ },
171
+ ]}>
172
+ {activeTab === 'apis' && selected != null && (<NetworkDetail_1.default />)}
173
+ {activeTab === 'analytics' && selectedEvent != null && (<AnalyticsDetail_1.default event={selectedEvent}/>)}
174
+ {activeTab === 'logs' && selectedLog != null && (<LogDetail_1.default />)}
175
+ {activeTab === 'redux' && <ReduxDetail_1.default />}
176
+ {activeTab === 'crash' && selectedCrash != null && (<CrashDetail_1.default />)}
177
+ </react_native_1.Animated.View>)}
178
+ </react_native_1.View>) : (<react_native_1.View style={styles_1.default.empty}>
179
+ <react_native_1.ActivityIndicator size="large" color={AppColors_1.AppColors.purple}/>
180
+ <react_native_1.Text style={[styles_1.default.emptySub, { marginTop: 12 }]}>
181
+ Loading logs...
182
+ </react_native_1.Text>
183
+ </react_native_1.View>)}
184
+
185
+ {/* Settings Panel Layer - Rendered on top with smooth slide & spring transition */}
186
+ {settingsPage !== null && (<react_native_1.Animated.View style={[
187
+ react_native_1.StyleSheet.absoluteFill,
188
+ {
189
+ backgroundColor: AppColors_1.AppColors.grayBackground,
190
+ opacity: settingsAnim,
191
+ transform: [
192
+ {
193
+ translateY: settingsAnim.interpolate({
194
+ inputRange: [0, 1],
195
+ outputRange: [24, 0],
196
+ }),
197
+ },
198
+ ],
199
+ },
200
+ ]}>
201
+ <SettingsPanel_1.default />
202
+ </react_native_1.Animated.View>)}
203
+ </react_native_1.View>
74
204
 
75
205
  {/* Bottom floating toast notification */}
76
206
  <Toast_1.default />
@@ -94,29 +94,31 @@ const FilterChip = react_1.default.memo(({ label, color, Icon, badge, active, on
94
94
  return (<TouchableScale_1.default style={styles_1.default.statusFilterWrap} onPress={onPress} hitSlop={10}>
95
95
  <react_native_1.View style={[
96
96
  styles_1.default.statusFilterChip,
97
+ {
98
+ paddingHorizontal: 9,
99
+ paddingVertical: 5,
100
+ borderRadius: 7,
101
+ borderWidth: 1,
102
+ borderColor: active ? color : `${AppColors_1.AppColors.grayBorderSecondary}`,
103
+ backgroundColor: active ? `${color}14` : AppColors_1.AppColors.grayBackground,
104
+ },
97
105
  active && {
98
- borderColor: color,
99
- backgroundColor: `${color}12`,
106
+ shadowColor: color,
107
+ shadowOffset: { width: 0, height: 1 },
108
+ shadowOpacity: 0.2,
109
+ shadowRadius: 2,
110
+ elevation: 1.5,
100
111
  },
101
112
  ]}>
102
- <react_native_1.View style={[
103
- styles_1.default.filterCheckbox,
104
- active && [
105
- styles_1.default.filterCheckboxActive,
106
- { backgroundColor: color },
107
- ],
108
- ]}>
109
- {active && (<NetworkIcons_1.CheckIcon color={AppColors_1.AppColors.white} size={10}/>)}
110
- </react_native_1.View>
111
113
  {badge != null ? (<react_native_1.View style={[
112
114
  styles_1.default.methodBadgeMini,
113
115
  { backgroundColor: badge },
114
116
  ]}/>) : (Icon && (<Icon color={iconColor} size={13}/>))}
115
117
  <react_native_1.Text numberOfLines={1} style={[
116
118
  styles_1.default.statusFilterText,
117
- active && {
118
- color,
119
- fontFamily: AppFonts_1.AppFonts.interBold,
119
+ {
120
+ color: active ? color : AppColors_1.AppColors.grayText,
121
+ fontFamily: active ? AppFonts_1.AppFonts.interBold : AppFonts_1.AppFonts.interMedium,
120
122
  },
121
123
  ]}>
122
124
  {label}
@@ -129,6 +131,19 @@ const NetworkTab = react_1.default.memo(() => {
129
131
  const { t } = (0, i18n_1.useTranslation)();
130
132
  const filtersAccordion = (0, useAccordion_1.default)(false, 300, 260);
131
133
  const apisListRef = (0, react_1.useRef)(null);
134
+ const [isSearchFocused, setIsSearchFocused] = react_1.default.useState(false);
135
+ const QUICK_API_QUERY_TAGS = (0, react_1.useMemo)(() => [
136
+ { label: '⚠️ Failed', query: 'is:error' },
137
+ { label: '🐢 Slow >1s', query: 'slow:>1s' },
138
+ { label: 'POST', query: 'm:POST' },
139
+ { label: 'GET', query: 'm:GET' },
140
+ { label: 'GraphQL', query: 'is:graphql' },
141
+ { label: 'Axios', query: 'client:axios' },
142
+ { label: '200 OK', query: 'status:200' },
143
+ { label: '404', query: 'status:404' },
144
+ { label: '500', query: 'status:500' },
145
+ { label: '🔒 HTTPS', query: 'is:https' },
146
+ ], []);
132
147
  const networkMetrics = (0, react_1.useMemo)(() => {
133
148
  if (!logs || logs.length === 0)
134
149
  return null;
@@ -263,12 +278,38 @@ const NetworkTab = react_1.default.memo(() => {
263
278
  </react_native_1.View>)}
264
279
 
265
280
  <react_native_1.View style={styles_1.default.toolbarRow}>
266
- <react_native_1.View style={styles_1.default.searchContainer}>
267
- <NetworkIcons_1.SearchIcon color={AppColors_1.AppColors.grayTextWeak} size={16}/>
268
- <react_native_1.TextInput placeholder="Search endpoints..." placeholderTextColor={AppColors_1.AppColors.grayTextWeak} value={search} onChangeText={setSearch} style={styles_1.default.searchInput} autoCorrect={false} autoCapitalize="none"/>
269
- {search.length > 0 && (<react_native_1.Pressable onPress={() => setSearch('')} hitSlop={10} style={styles_1.default.clearBtn}>
270
- <NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
271
- </react_native_1.Pressable>)}
281
+ <react_native_1.View style={[
282
+ styles_1.default.searchContainer,
283
+ isSearchFocused && {
284
+ borderColor: AppColors_1.AppColors.purple,
285
+ borderWidth: 1.5,
286
+ },
287
+ ]}>
288
+ <NetworkIcons_1.SearchIcon color={isSearchFocused ? AppColors_1.AppColors.purple : AppColors_1.AppColors.grayTextWeak} size={16}/>
289
+ <react_native_1.TextInput placeholder="Search url, body, is:error, slow:>1s..." placeholderTextColor={AppColors_1.AppColors.grayTextWeak} value={search} onChangeText={setSearch} onFocus={() => setIsSearchFocused(true)} onBlur={() => setIsSearchFocused(false)} style={styles_1.default.searchInput} autoCorrect={false} autoCapitalize="none"/>
290
+ {search.length > 0 && (<react_native_1.View style={{
291
+ flexDirection: 'row',
292
+ alignItems: 'center',
293
+ gap: 4,
294
+ }}>
295
+ <react_native_1.View style={{
296
+ backgroundColor: `${AppColors_1.AppColors.purple}20`,
297
+ borderRadius: 10,
298
+ paddingHorizontal: 6,
299
+ paddingVertical: 2,
300
+ }}>
301
+ <react_native_1.Text style={{
302
+ color: AppColors_1.AppColors.purple,
303
+ fontSize: 10,
304
+ fontFamily: AppFonts_1.AppFonts.interBold,
305
+ }}>
306
+ {filteredLogs.length}
307
+ </react_native_1.Text>
308
+ </react_native_1.View>
309
+ <react_native_1.Pressable onPress={() => setSearch('')} hitSlop={10} style={styles_1.default.clearBtn}>
310
+ <NetworkIcons_1.ClearIcon color={AppColors_1.AppColors.grayTextWeak} size={14}/>
311
+ </react_native_1.Pressable>
312
+ </react_native_1.View>)}
272
313
  </react_native_1.View>
273
314
 
274
315
  <react_native_1.View style={styles_1.default.toolbarRight}>
@@ -315,6 +356,49 @@ const NetworkTab = react_1.default.memo(() => {
315
356
  </react_native_1.View>
316
357
  </react_native_1.View>
317
358
 
359
+ {/* Advanced Search Quick Query Suggestions Bar */}
360
+ {(isSearchFocused || search.length > 0) && (<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} style={{ marginBottom: 6, maxHeight: 30 }} contentContainerStyle={{
361
+ paddingHorizontal: 12,
362
+ flexDirection: 'row',
363
+ alignItems: 'center',
364
+ gap: 6,
365
+ }}>
366
+ {QUICK_API_QUERY_TAGS.map(item => {
367
+ const isSelected = search.includes(item.query);
368
+ return (<TouchableScale_1.default key={item.query} onPress={() => {
369
+ if (isSelected) {
370
+ setSearch(prev => prev.replace(item.query, '').trim());
371
+ }
372
+ else {
373
+ setSearch(prev => prev ? `${prev} ${item.query}`.trim() : item.query);
374
+ }
375
+ }}>
376
+ <react_native_1.View style={{
377
+ paddingHorizontal: 8,
378
+ paddingVertical: 3.5,
379
+ borderRadius: 6,
380
+ backgroundColor: isSelected
381
+ ? AppColors_1.AppColors.purple
382
+ : `${AppColors_1.AppColors.purple}14`,
383
+ borderWidth: 1,
384
+ borderColor: isSelected
385
+ ? AppColors_1.AppColors.purple
386
+ : `${AppColors_1.AppColors.purple}30`,
387
+ }}>
388
+ <react_native_1.Text style={{
389
+ fontFamily: AppFonts_1.AppFonts.interBold,
390
+ fontSize: 10,
391
+ color: isSelected
392
+ ? AppColors_1.AppColors.white
393
+ : AppColors_1.AppColors.purple,
394
+ }}>
395
+ {item.label}
396
+ </react_native_1.Text>
397
+ </react_native_1.View>
398
+ </TouchableScale_1.default>);
399
+ })}
400
+ </react_native_1.ScrollView>)}
401
+
318
402
  <react_native_1.Animated.View style={[
319
403
  filtersAccordion.bodyStyle,
320
404
  { overflow: 'hidden' },