react-native-inapp-inspector 2.0.0 → 2.0.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.
Files changed (95) hide show
  1. package/README.md +10 -0
  2. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  3. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/8.9/gc.properties +0 -0
  10. package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
  11. package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
  12. package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
  13. package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
  14. package/android/.gradle/9.2.0/gc.properties +0 -0
  15. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  16. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  17. package/android/.gradle/vcs-1/gc.properties +0 -0
  18. package/android/build/reports/problems/problems-report.html +659 -0
  19. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +33 -24
  20. package/dist/commonjs/components/ConsoleLogCard.js +5 -5
  21. package/dist/commonjs/components/EndOfListFooter.js +1 -1
  22. package/dist/commonjs/components/Inspector/AnalyticsTab.js +19 -71
  23. package/dist/commonjs/components/Inspector/BundleTab.js +670 -188
  24. package/dist/commonjs/components/Inspector/ConsoleTab.js +109 -98
  25. package/dist/commonjs/components/Inspector/CrashTab.js +2 -1
  26. package/dist/commonjs/components/Inspector/InspectorHeader.js +102 -19
  27. package/dist/commonjs/components/Inspector/MainScreen.js +151 -17
  28. package/dist/commonjs/components/Inspector/NetworkTab.js +104 -20
  29. package/dist/commonjs/components/Inspector/SettingsPanel.js +1111 -1385
  30. package/dist/commonjs/components/Inspector/TabBar.js +3 -4
  31. package/dist/commonjs/components/Inspector/TelemetryConsentModal.d.ts +3 -0
  32. package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +212 -0
  33. package/dist/commonjs/components/JsonViewer.js +9 -4
  34. package/dist/commonjs/components/LogCard.js +31 -1
  35. package/dist/commonjs/components/LogSyntaxHighlighter.d.ts +16 -0
  36. package/dist/commonjs/components/LogSyntaxHighlighter.js +130 -0
  37. package/dist/commonjs/components/NetworkIcons.d.ts +2 -0
  38. package/dist/commonjs/components/NetworkIcons.js +10 -1
  39. package/dist/commonjs/components/Slider.d.ts +13 -0
  40. package/dist/commonjs/components/Slider.js +261 -0
  41. package/dist/commonjs/constants/version.d.ts +1 -1
  42. package/dist/commonjs/constants/version.js +1 -1
  43. package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
  44. package/dist/commonjs/customHooks/crashHandler.js +1 -1
  45. package/dist/commonjs/helpers/index.d.ts +2 -0
  46. package/dist/commonjs/helpers/index.js +16 -0
  47. package/dist/commonjs/helpers/searchQueryParser.d.ts +6 -0
  48. package/dist/commonjs/helpers/searchQueryParser.js +236 -0
  49. package/dist/commonjs/helpers/settingsStore.js +13 -13
  50. package/dist/commonjs/helpers/telemetry.d.ts +99 -0
  51. package/dist/commonjs/helpers/telemetry.js +398 -0
  52. package/dist/commonjs/index.d.ts +2 -0
  53. package/dist/commonjs/index.js +30 -21
  54. package/dist/commonjs/native/NativeInspector.d.ts +5 -0
  55. package/dist/commonjs/native/NativeInspector.js +3 -2
  56. package/dist/commonjs/styles/index.js +35 -35
  57. package/dist/esm/components/ConsoleLogCard.js +5 -5
  58. package/dist/esm/components/EndOfListFooter.js +2 -2
  59. package/dist/esm/components/Inspector/AnalyticsTab.js +21 -73
  60. package/dist/esm/components/Inspector/BundleTab.js +670 -188
  61. package/dist/esm/components/Inspector/ConsoleTab.js +110 -99
  62. package/dist/esm/components/Inspector/CrashTab.js +2 -1
  63. package/dist/esm/components/Inspector/InspectorHeader.js +103 -20
  64. package/dist/esm/components/Inspector/MainScreen.js +119 -18
  65. package/dist/esm/components/Inspector/NetworkTab.js +105 -21
  66. package/dist/esm/components/Inspector/SettingsPanel.js +1114 -1388
  67. package/dist/esm/components/Inspector/TabBar.js +4 -5
  68. package/dist/esm/components/Inspector/TelemetryConsentModal.d.ts +3 -0
  69. package/dist/esm/components/Inspector/TelemetryConsentModal.js +175 -0
  70. package/dist/esm/components/JsonViewer.js +9 -4
  71. package/dist/esm/components/LogCard.js +32 -2
  72. package/dist/esm/components/LogSyntaxHighlighter.d.ts +16 -0
  73. package/dist/esm/components/LogSyntaxHighlighter.js +123 -0
  74. package/dist/esm/components/NetworkIcons.d.ts +2 -0
  75. package/dist/esm/components/NetworkIcons.js +7 -0
  76. package/dist/esm/components/Slider.d.ts +13 -0
  77. package/dist/esm/components/Slider.js +222 -0
  78. package/dist/esm/constants/version.d.ts +1 -1
  79. package/dist/esm/constants/version.js +1 -1
  80. package/dist/esm/customHooks/analyticsLogger.js +1 -1
  81. package/dist/esm/customHooks/crashHandler.js +1 -1
  82. package/dist/esm/helpers/index.d.ts +2 -0
  83. package/dist/esm/helpers/index.js +2 -0
  84. package/dist/esm/helpers/searchQueryParser.d.ts +6 -0
  85. package/dist/esm/helpers/searchQueryParser.js +233 -0
  86. package/dist/esm/helpers/settingsStore.js +13 -13
  87. package/dist/esm/helpers/telemetry.d.ts +99 -0
  88. package/dist/esm/helpers/telemetry.js +380 -0
  89. package/dist/esm/index.d.ts +2 -0
  90. package/dist/esm/index.js +20 -21
  91. package/dist/esm/native/NativeInspector.d.ts +5 -0
  92. package/dist/esm/native/NativeInspector.js +3 -2
  93. package/dist/esm/styles/index.js +35 -35
  94. package/ios/{NetworkInspectorModule.m → NetworkInspectorModule.mm} +193 -97
  95. package/package.json +2 -2
@@ -10,7 +10,7 @@ import EndOfListFooter from '../EndOfListFooter';
10
10
  import styles from '../../styles';
11
11
  import { AppColors } from '../../styles/AppColors';
12
12
  import { AppFonts } from '../../styles/AppFonts';
13
- import { SearchIcon, ClearIcon, SortArrowIcon, TrashIcon, LayersIcon, CheckIcon, UserIcon, InfoCircleIcon, WarningTriangleIcon, ErrorCircleIcon, AnalyticsIcon, HeaderPauseIcon, } from '../NetworkIcons';
13
+ import { SearchIcon, ClearIcon, SortArrowIcon, TrashIcon, LayersIcon, UserIcon, InfoCircleIcon, WarningTriangleIcon, ErrorCircleIcon, AnalyticsIcon, HeaderPauseIcon, } from '../NetworkIcons';
14
14
  const ConsoleTab = React.memo(() => {
15
15
  const { t } = useTranslation();
16
16
  const { logSearch, setLogSearch, logSortOrder, setLogSortOrder, handleDelete, logFilters, setLogFilters, logCounts, filteredConsoleLogs, visibleConsoleLogs, isConsolePaused, setIsConsolePaused, } = useInspector();
@@ -51,6 +51,8 @@ const ConsoleTab = React.memo(() => {
51
51
  </Text>);
52
52
  }
53
53
  }, [visibleConsoleLogs.length, filteredConsoleLogs.length, logFilters]);
54
+ const [isSearchFocused, setIsSearchFocused] = React.useState(false);
55
+ const QUICK_TAG_SUGGESTIONS = useMemo(() => ['[AXIOS]', '[API]', '[REDUX]', '[ANALYTICS]', '[AUTH]', '[WARN]', '[ERROR]'], []);
54
56
  return (<View style={{ flex: 1 }}>
55
57
  <View style={{
56
58
  backgroundColor: AppColors.white,
@@ -62,12 +64,38 @@ const ConsoleTab = React.memo(() => {
62
64
  styles.toolbarRow,
63
65
  { marginTop: 12, marginBottom: 8 },
64
66
  ]}>
65
- <View style={styles.searchContainer}>
66
- <SearchIcon color={AppColors.grayTextWeak} size={16}/>
67
- <TextInput placeholder={t('console.searchPlaceholder')} placeholderTextColor={AppColors.grayTextWeak} value={logSearch} onChangeText={setLogSearch} style={styles.searchInput} autoCorrect={false} autoCapitalize="none"/>
68
- {logSearch.length > 0 && (<Pressable onPress={() => setLogSearch('')} hitSlop={10} style={styles.clearBtn}>
69
- <ClearIcon color={AppColors.grayTextWeak} size={14}/>
70
- </Pressable>)}
67
+ <View style={[
68
+ styles.searchContainer,
69
+ isSearchFocused && {
70
+ borderColor: AppColors.purple,
71
+ borderWidth: 1.5,
72
+ },
73
+ ]}>
74
+ <SearchIcon color={isSearchFocused ? AppColors.purple : AppColors.grayTextWeak} size={16}/>
75
+ <TextInput placeholder={t('console.searchPlaceholder')} placeholderTextColor={AppColors.grayTextWeak} value={logSearch} onChangeText={setLogSearch} onFocus={() => setIsSearchFocused(true)} onBlur={() => setIsSearchFocused(false)} style={styles.searchInput} autoCorrect={false} autoCapitalize="none"/>
76
+ {logSearch.length > 0 && (<View style={{
77
+ flexDirection: 'row',
78
+ alignItems: 'center',
79
+ gap: 4,
80
+ }}>
81
+ <View style={{
82
+ backgroundColor: `${AppColors.purple}20`,
83
+ borderRadius: 10,
84
+ paddingHorizontal: 6,
85
+ paddingVertical: 2,
86
+ }}>
87
+ <Text style={{
88
+ color: AppColors.purple,
89
+ fontSize: 10,
90
+ fontFamily: AppFonts.interBold,
91
+ }}>
92
+ {filteredConsoleLogs.length}
93
+ </Text>
94
+ </View>
95
+ <Pressable onPress={() => setLogSearch('')} hitSlop={10} style={styles.clearBtn}>
96
+ <ClearIcon color={AppColors.grayTextWeak} size={14}/>
97
+ </Pressable>
98
+ </View>)}
71
99
  </View>
72
100
 
73
101
  <View style={styles.toolbarRight}>
@@ -97,6 +125,49 @@ const ConsoleTab = React.memo(() => {
97
125
  </View>
98
126
  </View>
99
127
 
128
+ {/* Quick Tag Search Suggestions Bar */}
129
+ {(isSearchFocused || logSearch.length > 0) && (<ScrollView horizontal showsHorizontalScrollIndicator={false} style={{ marginBottom: 6, maxHeight: 30 }} contentContainerStyle={{
130
+ paddingHorizontal: 16,
131
+ flexDirection: 'row',
132
+ alignItems: 'center',
133
+ gap: 6,
134
+ }}>
135
+ {QUICK_TAG_SUGGESTIONS.map(tag => {
136
+ const isSelected = logSearch.includes(tag);
137
+ return (<TouchableScale key={tag} onPress={() => {
138
+ if (isSelected) {
139
+ setLogSearch(prev => prev.replace(tag, '').trim());
140
+ }
141
+ else {
142
+ setLogSearch(prev => prev ? `${prev} ${tag}`.trim() : tag);
143
+ }
144
+ }}>
145
+ <View style={{
146
+ paddingHorizontal: 8,
147
+ paddingVertical: 3,
148
+ borderRadius: 6,
149
+ backgroundColor: isSelected
150
+ ? AppColors.purple
151
+ : `${AppColors.purple}14`,
152
+ borderWidth: 1,
153
+ borderColor: isSelected
154
+ ? AppColors.purple
155
+ : `${AppColors.purple}30`,
156
+ }}>
157
+ <Text style={{
158
+ fontFamily: AppFonts.interBold,
159
+ fontSize: 10,
160
+ color: isSelected
161
+ ? AppColors.white
162
+ : AppColors.purple,
163
+ }}>
164
+ {tag}
165
+ </Text>
166
+ </View>
167
+ </TouchableScale>);
168
+ })}
169
+ </ScrollView>)}
170
+
100
171
  <ScrollView horizontal showsHorizontalScrollIndicator={false} style={{ marginVertical: 4, maxHeight: 46 }} contentContainerStyle={{
101
172
  paddingHorizontal: 16,
102
173
  paddingBottom: 4,
@@ -115,7 +186,9 @@ const ConsoleTab = React.memo(() => {
115
186
  {
116
187
  backgroundColor: active ? AppColors.indigo600Alt : AppColors.indigo50,
117
188
  borderColor: active ? AppColors.indigo600 : AppColors.indigo400,
118
- borderRadius: 7,
189
+ borderRadius: 8,
190
+ paddingHorizontal: 10,
191
+ paddingVertical: 6,
119
192
  },
120
193
  active && {
121
194
  shadowColor: AppColors.indigo600Alt,
@@ -128,21 +201,9 @@ const ConsoleTab = React.memo(() => {
128
201
  <View style={{
129
202
  flexDirection: 'row',
130
203
  alignItems: 'center',
131
- gap: 5,
132
- }}>
133
- <View style={{
134
- width: 12,
135
- height: 12,
136
- borderRadius: 3,
137
- borderWidth: 1.2,
138
- borderColor: active ? AppColors.white : AppColors.indigo400,
139
- backgroundColor: active ? AppColors.white : 'transparent',
140
- alignItems: 'center',
141
- justifyContent: 'center',
204
+ gap: 6,
142
205
  }}>
143
- {active && <CheckIcon color={AppColors.indigo600Alt} size={8}/>}
144
- </View>
145
- <LayersIcon size={12} color={active ? AppColors.white : AppColors.indigo600Alt}/>
206
+ <LayersIcon size={13} color={active ? AppColors.white : AppColors.indigo600Alt}/>
146
207
  <Text numberOfLines={1} style={[
147
208
  styles.statusFilterText,
148
209
  {
@@ -177,7 +238,9 @@ const ConsoleTab = React.memo(() => {
177
238
  {
178
239
  backgroundColor: active ? AppColors.teal600 : AppColors.teal100,
179
240
  borderColor: active ? AppColors.teal600 : AppColors.teal400,
180
- borderRadius: 7,
241
+ borderRadius: 8,
242
+ paddingHorizontal: 10,
243
+ paddingVertical: 6,
181
244
  },
182
245
  active && {
183
246
  shadowColor: AppColors.teal600,
@@ -190,21 +253,9 @@ const ConsoleTab = React.memo(() => {
190
253
  <View style={{
191
254
  flexDirection: 'row',
192
255
  alignItems: 'center',
193
- gap: 5,
256
+ gap: 6,
194
257
  }}>
195
- <View style={{
196
- width: 12,
197
- height: 12,
198
- borderRadius: 3,
199
- borderWidth: 1.2,
200
- borderColor: active ? AppColors.white : AppColors.teal400,
201
- backgroundColor: active ? AppColors.white : 'transparent',
202
- alignItems: 'center',
203
- justifyContent: 'center',
204
- }}>
205
- {active && <CheckIcon color={AppColors.teal600} size={8}/>}
206
- </View>
207
- <UserIcon size={12} color={active ? AppColors.white : AppColors.teal600}/>
258
+ <UserIcon size={13} color={active ? AppColors.white : AppColors.teal600}/>
208
259
  <Text numberOfLines={1} style={[
209
260
  styles.statusFilterText,
210
261
  {
@@ -239,7 +290,9 @@ const ConsoleTab = React.memo(() => {
239
290
  {
240
291
  backgroundColor: active ? AppColors.sky600 : AppColors.sky100,
241
292
  borderColor: active ? AppColors.blue700 : AppColors.sky400,
242
- borderRadius: 7,
293
+ borderRadius: 8,
294
+ paddingHorizontal: 10,
295
+ paddingVertical: 6,
243
296
  },
244
297
  active && {
245
298
  shadowColor: AppColors.sky600,
@@ -252,21 +305,9 @@ const ConsoleTab = React.memo(() => {
252
305
  <View style={{
253
306
  flexDirection: 'row',
254
307
  alignItems: 'center',
255
- gap: 5,
308
+ gap: 6,
256
309
  }}>
257
- <View style={{
258
- width: 12,
259
- height: 12,
260
- borderRadius: 3,
261
- borderWidth: 1.2,
262
- borderColor: active ? AppColors.white : AppColors.sky400,
263
- backgroundColor: active ? AppColors.white : 'transparent',
264
- alignItems: 'center',
265
- justifyContent: 'center',
266
- }}>
267
- {active && <CheckIcon color={AppColors.sky600} size={8}/>}
268
- </View>
269
- <InfoCircleIcon size={12} color={active ? AppColors.white : AppColors.sky600}/>
310
+ <InfoCircleIcon size={13} color={active ? AppColors.white : AppColors.sky600}/>
270
311
  <Text numberOfLines={1} style={[
271
312
  styles.statusFilterText,
272
313
  {
@@ -301,7 +342,9 @@ const ConsoleTab = React.memo(() => {
301
342
  {
302
343
  backgroundColor: active ? AppColors.amber600 : AppColors.amber100,
303
344
  borderColor: active ? AppColors.amber700 : AppColors.amber200,
304
- borderRadius: 7,
345
+ borderRadius: 8,
346
+ paddingHorizontal: 10,
347
+ paddingVertical: 6,
305
348
  },
306
349
  active && {
307
350
  shadowColor: AppColors.amber600,
@@ -314,21 +357,9 @@ const ConsoleTab = React.memo(() => {
314
357
  <View style={{
315
358
  flexDirection: 'row',
316
359
  alignItems: 'center',
317
- gap: 5,
318
- }}>
319
- <View style={{
320
- width: 12,
321
- height: 12,
322
- borderRadius: 3,
323
- borderWidth: 1.2,
324
- borderColor: active ? AppColors.white : AppColors.amber500,
325
- backgroundColor: active ? AppColors.white : 'transparent',
326
- alignItems: 'center',
327
- justifyContent: 'center',
360
+ gap: 6,
328
361
  }}>
329
- {active && <CheckIcon color={AppColors.amber600} size={8}/>}
330
- </View>
331
- <WarningTriangleIcon size={12} color={active ? AppColors.white : AppColors.amber700}/>
362
+ <WarningTriangleIcon size={13} color={active ? AppColors.white : AppColors.amber700}/>
332
363
  <Text numberOfLines={1} style={[
333
364
  styles.statusFilterText,
334
365
  {
@@ -363,7 +394,9 @@ const ConsoleTab = React.memo(() => {
363
394
  {
364
395
  backgroundColor: active ? AppColors.red500 : AppColors.red100,
365
396
  borderColor: active ? AppColors.red600 : AppColors.errorBorder,
366
- borderRadius: 7,
397
+ borderRadius: 8,
398
+ paddingHorizontal: 10,
399
+ paddingVertical: 6,
367
400
  },
368
401
  active && {
369
402
  shadowColor: AppColors.red500,
@@ -376,21 +409,9 @@ const ConsoleTab = React.memo(() => {
376
409
  <View style={{
377
410
  flexDirection: 'row',
378
411
  alignItems: 'center',
379
- gap: 5,
380
- }}>
381
- <View style={{
382
- width: 12,
383
- height: 12,
384
- borderRadius: 3,
385
- borderWidth: 1.2,
386
- borderColor: active ? AppColors.white : AppColors.red500,
387
- backgroundColor: active ? AppColors.white : 'transparent',
388
- alignItems: 'center',
389
- justifyContent: 'center',
412
+ gap: 6,
390
413
  }}>
391
- {active && <CheckIcon color={AppColors.red500} size={8}/>}
392
- </View>
393
- <ErrorCircleIcon size={12} color={active ? AppColors.white : AppColors.red500}/>
414
+ <ErrorCircleIcon size={13} color={active ? AppColors.white : AppColors.red500}/>
394
415
  <Text numberOfLines={1} style={[
395
416
  styles.statusFilterText,
396
417
  {
@@ -425,7 +446,9 @@ const ConsoleTab = React.memo(() => {
425
446
  {
426
447
  backgroundColor: active ? AppColors.violet600 : AppColors.purple100,
427
448
  borderColor: active ? AppColors.purple700 : AppColors.purple200,
428
- borderRadius: 7,
449
+ borderRadius: 8,
450
+ paddingHorizontal: 10,
451
+ paddingVertical: 6,
429
452
  },
430
453
  active && {
431
454
  shadowColor: AppColors.violet600,
@@ -438,29 +461,17 @@ const ConsoleTab = React.memo(() => {
438
461
  <View style={{
439
462
  flexDirection: 'row',
440
463
  alignItems: 'center',
441
- gap: 5,
442
- }}>
443
- <View style={{
444
- width: 12,
445
- height: 12,
446
- borderRadius: 3,
447
- borderWidth: 1.2,
448
- borderColor: active ? AppColors.white : AppColors.purple400,
449
- backgroundColor: active ? AppColors.white : 'transparent',
450
- alignItems: 'center',
451
- justifyContent: 'center',
464
+ gap: 6,
452
465
  }}>
453
- {active && <CheckIcon color={AppColors.violet600} size={8}/>}
454
- </View>
455
- <AnalyticsIcon size={12} color={active ? AppColors.white : AppColors.purple}/>
466
+ <AnalyticsIcon size={13} color={active ? AppColors.white : AppColors.violet600}/>
456
467
  <Text numberOfLines={1} style={[
457
468
  styles.statusFilterText,
458
469
  {
459
- color: active ? AppColors.white : AppColors.brandPurple,
470
+ color: active ? AppColors.white : AppColors.purpleText,
460
471
  fontFamily: AppFonts.interBold,
461
472
  },
462
473
  ]}>
463
- {t('tabs.analytics', 'Analytics')} ({logCounts.analytics})
474
+ {t('console.analytics', 'Analytics')} ({logCounts.analytics})
464
475
  </Text>
465
476
  </View>
466
477
  </View>
@@ -657,10 +657,11 @@ const localStyles = StyleSheet.create({
657
657
  color: AppColors.grayTextWeak,
658
658
  },
659
659
  emptyContainer: {
660
+ flexGrow: 1,
660
661
  alignItems: 'center',
661
662
  justifyContent: 'center',
662
663
  padding: 32,
663
- marginTop: 40,
664
+ paddingBottom: 80,
664
665
  },
665
666
  emptyIconCircle: {
666
667
  width: 72,
@@ -10,9 +10,9 @@ import { AppFonts } from '../../styles/AppFonts';
10
10
  import { METHOD_COLORS } from '../../constants';
11
11
  import { LIB_VERSION } from '../../constants';
12
12
  import { getStatusColor, getAppName, getBundleIdentifier, formatTime, getSize } from '../../helpers';
13
- import { WhiteBackNavigation, TrashIcon, SettingsIcon, CloseWhite, ClockIcon, SizeIcon, AppleIcon, AndroidIcon, NpmIcon, } from '../NetworkIcons';
13
+ import { WhiteBackNavigation, TrashIcon, SettingsIcon, CloseWhite, ClockIcon, SizeIcon, AppleIcon, AndroidIcon, NpmIcon, ResetIcon, } from '../NetworkIcons';
14
14
  const InspectorHeader = React.memo(() => {
15
- const { modalHeightPercent, appIcon, selected, setSelected, selectedEvent, setSelectedEvent, selectedLog, setSelectedLog, selectedReduxSlice, setSelectedReduxSlice, selectedReduxAction, setSelectedReduxAction, reduxState, reduxLastActionMap, showHeaderInfo, setShowHeaderInfo, updateAvailable, latestNpmVersion, clearAnim, activePulseAnim, unreadPulseAnim, runClearAllWithAnimation, setSettingsPage, closeModal, detailTitle, activeTab, environment, selectedCrash, setSelectedCrash, } = useInspector();
15
+ const { modalHeightPercent, appIcon, selected, setSelected, selectedEvent, setSelectedEvent, selectedLog, setSelectedLog, selectedReduxSlice, setSelectedReduxSlice, selectedReduxAction, setSelectedReduxAction, reduxState, reduxLastActionMap, showHeaderInfo, setShowHeaderInfo, updateAvailable, latestNpmVersion, clearAnim, activePulseAnim, unreadPulseAnim, runClearAllWithAnimation, settingsPage, setSettingsPage, resetToDefaults, closeModal, detailTitle, activeTab, environment, selectedCrash, setSelectedCrash, } = useInspector();
16
16
  const envConfig = useMemo(() => {
17
17
  const rawEnv = (environment || (__DEV__ ? 'DEV' : 'PROD')).trim();
18
18
  const clean = rawEnv.toUpperCase();
@@ -53,9 +53,30 @@ const InspectorHeader = React.memo(() => {
53
53
  (activeTab === 'logs' && selectedLog != null) ||
54
54
  (activeTab === 'redux' && (selectedReduxSlice != null || selectedReduxAction != null)) ||
55
55
  (activeTab === 'crash' && selectedCrash != null);
56
- const isAnySelected = isDetailView;
56
+ const isSettingsView = settingsPage !== null;
57
+ const isAnySelected = isDetailView || isSettingsView;
58
+ const settingsModuleTitle = useMemo(() => {
59
+ switch (settingsPage) {
60
+ case 'apis':
61
+ return 'APIs (Network)';
62
+ case 'logs':
63
+ return 'Console Logs';
64
+ case 'performance':
65
+ return 'Performance Tracker';
66
+ case 'bundle':
67
+ return 'Bundle Analyzer';
68
+ case 'crash':
69
+ return 'Crash Protection';
70
+ case 'analytics':
71
+ return 'Analytics Logger';
72
+ case 'redux':
73
+ return 'Redux Inspector';
74
+ default:
75
+ return 'Settings & Modules';
76
+ }
77
+ }, [settingsPage]);
57
78
  const headerTopPadding = Platform.OS === 'ios' && modalHeightPercent >= 95 ? 44 : 0;
58
- return (<LinearGradient colors={[AppColors.purple, AppColors.brandPurple]} style={styles.headerGradient}>
79
+ return (<LinearGradient colors={['#4F46E5', '#7C3AED']} start={{ x: 0, y: 0 }} end={{ x: 1, y: 1 }} style={styles.headerGradient}>
59
80
  <View style={{ paddingTop: headerTopPadding, width: '100%' }}>
60
81
  <View style={styles.header}>
61
82
  <View style={[
@@ -63,12 +84,21 @@ const InspectorHeader = React.memo(() => {
63
84
  {
64
85
  flexDirection: 'row',
65
86
  alignItems: 'center',
66
- gap: 12,
87
+ gap: 8,
67
88
  flex: !isDetailView ? 1 : 0,
68
89
  minWidth: 0,
69
90
  },
70
91
  ]}>
71
92
  <TouchableScale onPress={() => {
93
+ if (isSettingsView) {
94
+ if (settingsPage === 'main') {
95
+ setSettingsPage(null);
96
+ }
97
+ else {
98
+ setSettingsPage('main');
99
+ }
100
+ return;
101
+ }
72
102
  requestAnimationFrame(() => {
73
103
  setSelected(null);
74
104
  setSelectedEvent(null);
@@ -101,7 +131,43 @@ const InspectorHeader = React.memo(() => {
101
131
  <WhiteBackNavigation />
102
132
  </TouchableScale>
103
133
 
104
- {!isAnySelected ? (<View style={{
134
+ {isSettingsView ? (<View style={{ gap: 2, flex: 1, minWidth: 0 }}>
135
+ <View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
136
+ <Text style={{
137
+ fontFamily: AppFonts.interBold,
138
+ fontSize: 16,
139
+ color: AppColors.white,
140
+ letterSpacing: -0.2,
141
+ }} numberOfLines={1}>
142
+ {settingsModuleTitle}
143
+ </Text>
144
+ {settingsPage === 'main' && (<View style={{
145
+ backgroundColor: `${AppColors.white}26`,
146
+ paddingHorizontal: 6,
147
+ paddingVertical: 1.5,
148
+ borderRadius: 10,
149
+ borderWidth: 1,
150
+ borderColor: `${AppColors.white}20`,
151
+ }}>
152
+ <Text style={{
153
+ fontFamily: AppFonts.interBold,
154
+ fontSize: 9,
155
+ color: AppColors.white,
156
+ }}>
157
+ v{LIB_VERSION}
158
+ </Text>
159
+ </View>)}
160
+ </View>
161
+ <Text style={{
162
+ fontFamily: AppFonts.interRegular,
163
+ fontSize: 10.5,
164
+ color: `${AppColors.white}CC`,
165
+ }} numberOfLines={1}>
166
+ {settingsPage === 'main'
167
+ ? 'Manage modules and preferences'
168
+ : 'Configure module parameters'}
169
+ </Text>
170
+ </View>) : !isAnySelected ? (<View style={{
105
171
  flexDirection: 'row',
106
172
  alignItems: 'center',
107
173
  gap: 8,
@@ -109,7 +175,7 @@ const InspectorHeader = React.memo(() => {
109
175
  minWidth: 0,
110
176
  marginRight: 6,
111
177
  }}>
112
- <AppHeaderLogo size={38} customIcon={appIcon}/>
178
+ <AppHeaderLogo size={30} customIcon={appIcon}/>
113
179
  <View style={{ gap: 2.5, flex: 1, minWidth: 0 }}>
114
180
  <View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, minWidth: 0 }}>
115
181
  <Text style={[styles.headerTitle, { flexShrink: 1 }]} numberOfLines={1} ellipsizeMode="tail">
@@ -189,22 +255,26 @@ const InspectorHeader = React.memo(() => {
189
255
  </View>
190
256
 
191
257
  <Pressable onPress={() => Linking.openURL('https://www.npmjs.com/package/react-native-inapp-inspector').catch(() => { })} style={{
192
- backgroundColor: '#CB383726',
193
- borderRadius: 4,
194
- paddingHorizontal: 5,
195
- paddingVertical: 1.5,
196
- borderWidth: 1,
197
- borderColor: '#CB383780',
258
+ backgroundColor: '#FFFFFF',
259
+ borderRadius: 5,
260
+ paddingHorizontal: 6,
261
+ paddingVertical: 2,
198
262
  flexDirection: 'row',
199
263
  alignItems: 'center',
200
- gap: 3.5,
264
+ gap: 4,
201
265
  flexShrink: 0,
266
+ shadowColor: '#000000',
267
+ shadowOffset: { width: 0, height: 1 },
268
+ shadowOpacity: 0.15,
269
+ shadowRadius: 2,
270
+ elevation: 2,
202
271
  }}>
203
- <NpmIcon size={11} color="#FF6B6B"/>
272
+ <NpmIcon size={11} color="#CB3837"/>
204
273
  <Text style={{
205
274
  fontFamily: AppFonts.interBold,
206
- fontSize: 9,
207
- color: '#FF6B6B',
275
+ fontSize: 9.5,
276
+ color: '#CB3837',
277
+ letterSpacing: 0.2,
208
278
  }} numberOfLines={1}>
209
279
  v{LIB_VERSION}
210
280
  </Text>
@@ -494,6 +564,19 @@ const InspectorHeader = React.memo(() => {
494
564
  gap: 8,
495
565
  },
496
566
  ]}>
567
+ {isSettingsView && (<TouchableScale onPress={() => {
568
+ Alert.alert('Reset All Settings', 'This restores all module visibility and UI preferences to defaults. Continue?', [
569
+ { text: 'Cancel', style: 'cancel' },
570
+ {
571
+ text: 'Reset',
572
+ style: 'destructive',
573
+ onPress: resetToDefaults,
574
+ },
575
+ ]);
576
+ }} hitSlop={15} style={styles.closeButtonSquare}>
577
+ <ResetIcon color={AppColors.white} size={14}/>
578
+ </TouchableScale>)}
579
+
497
580
  {!isAnySelected && (<TouchableScale onPress={() => {
498
581
  Alert.alert('Clear Everything', 'This clears all tabs — APIs, Logs, Analytics, Redux timeline and Crash history. Continue?', [
499
582
  { text: 'Cancel', style: 'cancel' },
@@ -520,16 +603,16 @@ const InspectorHeader = React.memo(() => {
520
603
  },
521
604
  ],
522
605
  }}>
523
- <TrashIcon color={AppColors.white} size={16}/>
606
+ <TrashIcon color={AppColors.white} size={14}/>
524
607
  </Animated.View>
525
608
  </TouchableScale>)}
526
609
 
527
610
  {!isAnySelected && (<TouchableScale onPress={() => setSettingsPage('main')} hitSlop={15} style={styles.closeButtonSquare}>
528
- <SettingsIcon color={AppColors.white} size={16}/>
611
+ <SettingsIcon color={AppColors.white} size={14}/>
529
612
  </TouchableScale>)}
530
613
 
531
614
  <TouchableScale onPress={closeModal} hitSlop={15} style={styles.closeButtonSquare}>
532
- <CloseWhite size={16}/>
615
+ <CloseWhite size={14}/>
533
616
  </TouchableScale>
534
617
  </View>
535
618
  </View>