react-native-inapp-inspector 2.2.3 → 2.2.4

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 (86) hide show
  1. package/dist/commonjs/components/AnalyticsDetail.js +5 -1
  2. package/dist/commonjs/components/AnalyticsEventCard.js +2 -1
  3. package/dist/commonjs/components/DiffViewer.js +1 -1
  4. package/dist/commonjs/components/Inspector/BundleTab.js +22 -0
  5. package/dist/commonjs/components/Inspector/DeviceInfoTab.d.ts +3 -0
  6. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +835 -0
  7. package/dist/commonjs/components/Inspector/InspectorHeader.js +12 -14
  8. package/dist/commonjs/components/Inspector/LogDetail.js +6 -3
  9. package/dist/commonjs/components/Inspector/MainScreen.js +7 -3
  10. package/dist/commonjs/components/Inspector/NetworkTab.js +92 -15
  11. package/dist/commonjs/components/Inspector/PerformanceTab.js +38 -12
  12. package/dist/commonjs/components/Inspector/SettingsPanel.js +440 -229
  13. package/dist/commonjs/components/Inspector/StorageTab.d.ts +3 -0
  14. package/dist/commonjs/components/Inspector/StorageTab.js +892 -0
  15. package/dist/commonjs/components/Inspector/TabBar.js +14 -0
  16. package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +11 -2
  17. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +4 -1
  18. package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
  19. package/dist/commonjs/components/NetworkIcons.js +30 -1
  20. package/dist/commonjs/constants/version.d.ts +1 -1
  21. package/dist/commonjs/constants/version.js +1 -1
  22. package/dist/commonjs/customHooks/bundleAnalyzer.js +44 -22
  23. package/dist/commonjs/customHooks/storageInspector.d.ts +67 -0
  24. package/dist/commonjs/customHooks/storageInspector.js +486 -0
  25. package/dist/commonjs/i18n/locales/en.json +8 -2
  26. package/dist/commonjs/index.d.ts +1 -0
  27. package/dist/commonjs/index.js +16 -1
  28. package/dist/commonjs/storage.d.ts +5 -0
  29. package/dist/commonjs/storage.js +18 -0
  30. package/dist/commonjs/types/enums.d.ts +5 -0
  31. package/dist/commonjs/types/enums.js +5 -0
  32. package/dist/esm/components/AnalyticsDetail.js +6 -2
  33. package/dist/esm/components/AnalyticsEventCard.js +2 -1
  34. package/dist/esm/components/DiffViewer.js +1 -1
  35. package/dist/esm/components/Inspector/BundleTab.js +22 -0
  36. package/dist/esm/components/Inspector/DeviceInfoTab.d.ts +3 -0
  37. package/dist/esm/components/Inspector/DeviceInfoTab.js +796 -0
  38. package/dist/esm/components/Inspector/InspectorHeader.js +13 -15
  39. package/dist/esm/components/Inspector/LogDetail.js +7 -4
  40. package/dist/esm/components/Inspector/MainScreen.js +7 -3
  41. package/dist/esm/components/Inspector/NetworkTab.js +93 -16
  42. package/dist/esm/components/Inspector/PerformanceTab.js +39 -13
  43. package/dist/esm/components/Inspector/SettingsPanel.js +441 -230
  44. package/dist/esm/components/Inspector/StorageTab.d.ts +3 -0
  45. package/dist/esm/components/Inspector/StorageTab.js +853 -0
  46. package/dist/esm/components/Inspector/TabBar.js +15 -1
  47. package/dist/esm/components/Inspector/TelemetryConsentModal.js +11 -2
  48. package/dist/esm/components/Inspector/UpdateAvailableModal.js +4 -1
  49. package/dist/esm/components/NetworkIcons.d.ts +6 -0
  50. package/dist/esm/components/NetworkIcons.js +23 -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/bundleAnalyzer.js +44 -22
  54. package/dist/esm/customHooks/storageInspector.d.ts +67 -0
  55. package/dist/esm/customHooks/storageInspector.js +469 -0
  56. package/dist/esm/i18n/locales/en.json +8 -2
  57. package/dist/esm/index.d.ts +1 -0
  58. package/dist/esm/index.js +5 -0
  59. package/dist/esm/storage.d.ts +5 -0
  60. package/dist/esm/storage.js +5 -0
  61. package/dist/esm/types/enums.d.ts +5 -0
  62. package/dist/esm/types/enums.js +5 -0
  63. package/package.json +8 -1
  64. package/src/components/AnalyticsDetail.tsx +6 -1
  65. package/src/components/AnalyticsEventCard.tsx +2 -1
  66. package/src/components/DiffViewer.tsx +1 -1
  67. package/src/components/Inspector/BundleTab.tsx +29 -0
  68. package/src/components/Inspector/DeviceInfoTab.tsx +1204 -0
  69. package/src/components/Inspector/InspectorHeader.tsx +13 -14
  70. package/src/components/Inspector/LogDetail.tsx +15 -11
  71. package/src/components/Inspector/MainScreen.tsx +7 -3
  72. package/src/components/Inspector/NetworkTab.tsx +104 -16
  73. package/src/components/Inspector/PerformanceTab.tsx +46 -12
  74. package/src/components/Inspector/SettingsPanel.tsx +570 -304
  75. package/src/components/Inspector/StorageTab.tsx +1048 -0
  76. package/src/components/Inspector/TabBar.tsx +20 -0
  77. package/src/components/Inspector/TelemetryConsentModal.tsx +26 -2
  78. package/src/components/Inspector/UpdateAvailableModal.tsx +13 -1
  79. package/src/components/NetworkIcons.tsx +103 -0
  80. package/src/constants/version.ts +1 -1
  81. package/src/customHooks/bundleAnalyzer.ts +47 -22
  82. package/src/customHooks/storageInspector.ts +509 -0
  83. package/src/i18n/locales/en.json +8 -2
  84. package/src/index.tsx +21 -1
  85. package/src/storage.ts +18 -0
  86. package/src/types/enums.ts +5 -0
@@ -32,6 +32,7 @@ import {
32
32
  AndroidIcon,
33
33
  NpmIcon,
34
34
  ResetIcon,
35
+ BoltIcon,
35
36
  } from '../NetworkIcons';
36
37
 
37
38
  const InspectorHeader = React.memo(() => {
@@ -363,8 +364,9 @@ const InspectorHeader = React.memo(() => {
363
364
  color: '#FFFFFF',
364
365
  letterSpacing: 0.3,
365
366
  }}>
366
- UPDATE
367
+ UPDATE
367
368
  </Text>
369
+ <BoltIcon size={9} color="#FFFFFF" />
368
370
  </Pressable>
369
371
  )}
370
372
  </View>
@@ -420,27 +422,24 @@ const InspectorHeader = React.memo(() => {
420
422
  }
421
423
  }}
422
424
  style={{
423
- backgroundColor: '#FFFFFF',
425
+ flexDirection: 'row',
426
+ alignItems: 'center',
427
+ backgroundColor: `${AppColors.white}1F`,
424
428
  borderRadius: 5,
425
429
  paddingHorizontal: 6,
426
430
  paddingVertical: 2,
427
- flexDirection: 'row',
428
- alignItems: 'center',
429
431
  gap: 4,
432
+ borderWidth: 1,
433
+ borderColor: `${AppColors.white}2E`,
430
434
  flexShrink: 0,
431
- shadowColor: '#000000',
432
- shadowOffset: {width: 0, height: 1},
433
- shadowOpacity: 0.15,
434
- shadowRadius: 2,
435
- elevation: 2,
436
435
  }}>
437
- <NpmIcon size={11} color="#CB3837" />
436
+ <NpmIcon size={10} color="#FF6B6B" />
438
437
  <Text
439
438
  style={{
440
- fontFamily: AppFonts.interBold,
439
+ fontFamily: AppFonts.interMedium,
441
440
  fontSize: 9.5,
442
- color: '#CB3837',
443
- letterSpacing: 0.2,
441
+ color: `${AppColors.white}EB`,
442
+ letterSpacing: 0.1,
444
443
  }}
445
444
  numberOfLines={1}>
446
445
  v{LIB_VERSION}
@@ -452,7 +451,7 @@ const InspectorHeader = React.memo(() => {
452
451
  fontSize: 9,
453
452
  color: '#F59E0B',
454
453
  }}>
455
-
454
+
456
455
  </Text>
457
456
  )}
458
457
  </Pressable>
@@ -26,6 +26,7 @@ import {
26
26
  InfoCircleIcon,
27
27
  DocIcon,
28
28
  ExternalLinkIcon,
29
+ FolderIcon,
29
30
  } from '../NetworkIcons';
30
31
  import {AppColors} from '../../styles/AppColors';
31
32
  import {AppFonts} from '../../styles/AppFonts';
@@ -1156,17 +1157,20 @@ const LogDetail = React.memo(() => {
1156
1157
  paddingVertical: 4.5,
1157
1158
  gap: 6,
1158
1159
  }}>
1159
- <Text
1160
- selectable
1161
- style={{
1162
- fontFamily: AppFonts.interRegular,
1163
- fontSize: 9.5,
1164
- color: AppColors.grayTextStrong,
1165
- flex: 1,
1166
- }}
1167
- numberOfLines={1}>
1168
- 📂 {frame.fullPath}
1169
- </Text>
1160
+ <View style={{flexDirection: 'row', alignItems: 'center', gap: 5, flex: 1}}>
1161
+ <FolderIcon size={12} color={AppColors.grayTextWeak} />
1162
+ <Text
1163
+ selectable
1164
+ style={{
1165
+ fontFamily: AppFonts.interRegular,
1166
+ fontSize: 9.5,
1167
+ color: AppColors.grayTextStrong,
1168
+ flex: 1,
1169
+ }}
1170
+ numberOfLines={1}>
1171
+ {frame.fullPath}
1172
+ </Text>
1173
+ </View>
1170
1174
 
1171
1175
  <View
1172
1176
  style={{
@@ -27,6 +27,8 @@ import BundleTab from './BundleTab';
27
27
  import PerformanceTab from './PerformanceTab';
28
28
  import CrashTab from './CrashTab';
29
29
  import CrashDetail from './CrashDetail';
30
+ import DeviceInfoTab from './DeviceInfoTab';
31
+ import StorageTab from './StorageTab';
30
32
  import SettingsPanel from './SettingsPanel';
31
33
  import TelemetryConsentModal from './TelemetryConsentModal';
32
34
  import NpmUpdateToast from './NpmUpdateToast';
@@ -167,6 +169,8 @@ const MainScreen = () => {
167
169
  {activeTab === 'bundle' && <BundleTab />}
168
170
  {activeTab === 'performance' && <PerformanceTab />}
169
171
  {activeTab === 'crash' && <CrashTab />}
172
+ {activeTab === 'device' && <DeviceInfoTab />}
173
+ {activeTab === 'storage' && <StorageTab />}
170
174
  </Animated.View>
171
175
 
172
176
  {/* Detail View Layer - Rendered on top with smooth slide & spring transition */}
@@ -240,6 +244,9 @@ const MainScreen = () => {
240
244
 
241
245
  {/* NPM Version Update Toast with timeout progress bar */}
242
246
  <NpmUpdateToast />
247
+
248
+ {/* Anonymous Telemetry Consent Dialog shown ONLY when inspector is active */}
249
+ <TelemetryConsentModal />
243
250
  </View>
244
251
  </View>
245
252
  </ErrorBoundary>
@@ -248,9 +255,6 @@ const MainScreen = () => {
248
255
  <NavigationTracker onStateChange={setNavState} />
249
256
  )}
250
257
  </Modal>
251
-
252
- {/* Anonymous Telemetry Consent Dialog at root viewport */}
253
- <TelemetryConsentModal />
254
258
  </>
255
259
  );
256
260
  };
@@ -36,6 +36,13 @@ import {
36
36
  LayersIcon,
37
37
  HeaderPauseIcon,
38
38
  ClockIcon,
39
+ GlobeIcon,
40
+ RequestIcon,
41
+ ResponseIcon,
42
+ HeadersIcon,
43
+ AtomIcon,
44
+ BoltIcon,
45
+ ShieldAlertIcon,
39
46
  } from '../NetworkIcons';
40
47
 
41
48
  const STATUS_META: Record<
@@ -277,26 +284,90 @@ const NetworkTab = React.memo(() => {
277
284
  [quickCounts],
278
285
  );
279
286
 
280
- const SEARCH_SCOPES: Array<{id: SearchScope; label: string}> = [
281
- {id: 'all', label: 'All'},
282
- {id: 'url', label: 'URL / Path'},
283
- {id: 'reqBody', label: 'Payload'},
284
- {id: 'resBody', label: 'Response'},
285
- {id: 'headers', label: 'Headers'},
287
+ const SEARCH_SCOPES: Array<{
288
+ id: SearchScope;
289
+ label: string;
290
+ icon: (color: string) => React.JSX.Element;
291
+ }> = [
292
+ {
293
+ id: 'all',
294
+ label: 'All',
295
+ icon: color => <LayersIcon size={9.5} color={color} />,
296
+ },
297
+ {
298
+ id: 'url',
299
+ label: 'URL / Path',
300
+ icon: color => <GlobeIcon size={9.5} color={color} />,
301
+ },
302
+ {
303
+ id: 'reqBody',
304
+ label: 'Payload',
305
+ icon: color => <RequestIcon size={9.5} color={color} />,
306
+ },
307
+ {
308
+ id: 'resBody',
309
+ label: 'Response',
310
+ icon: color => <ResponseIcon size={9.5} color={color} />,
311
+ },
312
+ {
313
+ id: 'headers',
314
+ label: 'Headers',
315
+ icon: color => <HeadersIcon size={9.5} color={color} />,
316
+ },
286
317
  ];
287
318
 
288
319
  const QUICK_API_QUERY_TAGS = useMemo(
289
320
  () => [
290
- {label: '⚠️ Failed', query: 'is:error'},
291
- {label: '🐢 Slow >1s', query: 'slow:>1s'},
292
- {label: 'POST', query: 'm:POST'},
293
- {label: 'GET', query: 'm:GET'},
294
- {label: 'GraphQL', query: 'is:graphql'},
295
- {label: 'Axios', query: 'client:axios'},
296
- {label: '200 OK', query: 'status:200'},
297
- {label: '404', query: 'status:404'},
298
- {label: '500', query: 'status:500'},
299
- {label: '🔒 HTTPS', query: 'is:https'},
321
+ {
322
+ label: 'Failed',
323
+ query: 'is:error',
324
+ icon: (color: string) => <CircleXIcon size={9.5} color={color} />,
325
+ },
326
+ {
327
+ label: 'Slow (>1s)',
328
+ query: 'slow:>1s',
329
+ icon: (color: string) => <ClockIcon size={9.5} color={color} />,
330
+ },
331
+ {
332
+ label: 'POST',
333
+ query: 'm:POST',
334
+ icon: (color: string) => <RequestIcon size={9.5} color={color} />,
335
+ },
336
+ {
337
+ label: 'GET',
338
+ query: 'm:GET',
339
+ icon: (color: string) => <ResponseIcon size={9.5} color={color} />,
340
+ },
341
+ {
342
+ label: 'GraphQL',
343
+ query: 'is:graphql',
344
+ icon: (color: string) => <AtomIcon size={9.5} color={color} />,
345
+ },
346
+ {
347
+ label: 'Axios',
348
+ query: 'client:axios',
349
+ icon: (color: string) => <BoltIcon size={9.5} color={color} />,
350
+ },
351
+ {
352
+ label: '200 OK',
353
+ query: 'status:200',
354
+ icon: (color: string) => <CircleCheckIcon size={9.5} color={color} />,
355
+ },
356
+ {
357
+ label: '404',
358
+ query: 'status:404',
359
+ icon: (color: string) => <CircleAlertIcon size={9.5} color={color} />,
360
+ },
361
+ {
362
+ label: '500',
363
+ query: 'status:500',
364
+ icon: (color: string) => <CircleXIcon size={9.5} color={color} />,
365
+ },
366
+ {
367
+ label: 'HTTPS',
368
+ query: 'is:https',
369
+ icon: (color: string) => <ShieldAlertIcon size={9.5} color={color} />,
370
+ },
300
371
  ],
301
372
  [],
302
373
  );
@@ -715,6 +786,7 @@ const NetworkTab = React.memo(() => {
715
786
  {QUICK_CHIPS.map(chip => {
716
787
  const isActive = quickFilter === chip.id;
717
788
  const chipColor = chip.color || AppColors.purple;
789
+ const iconColor = isActive ? AppColors.white : chipColor;
718
790
  return (
719
791
  <TouchableScale
720
792
  key={chip.id}
@@ -737,6 +809,13 @@ const NetworkTab = React.memo(() => {
737
809
  : `${chipColor}30`,
738
810
  gap: 5,
739
811
  }}>
812
+ {chip.id === 'all' && <LayersIcon size={11} color={iconColor} />}
813
+ {chip.id === 'errors' && <CircleXIcon size={11} color={iconColor} />}
814
+ {chip.id === 'success' && <CircleCheckIcon size={11} color={iconColor} />}
815
+ {chip.id === 'slow' && <ClockIcon size={11} color={iconColor} />}
816
+ {chip.id === 'POST' && <RequestIcon size={11} color={iconColor} />}
817
+ {chip.id === 'GET' && <ResponseIcon size={11} color={iconColor} />}
818
+ {chip.id === 'graphql' && <AtomIcon size={11} color={iconColor} />}
740
819
  <Text
741
820
  style={{
742
821
  fontFamily: AppFonts.interBold,
@@ -802,12 +881,16 @@ const NetworkTab = React.memo(() => {
802
881
  }}>
803
882
  {SEARCH_SCOPES.map(s => {
804
883
  const isSelected = searchScope === s.id;
884
+ const iconColor = isSelected ? AppColors.white : AppColors.grayText;
805
885
  return (
806
886
  <TouchableScale
807
887
  key={s.id}
808
888
  onPress={() => setSearchScope(s.id)}>
809
889
  <View
810
890
  style={{
891
+ flexDirection: 'row',
892
+ alignItems: 'center',
893
+ gap: 4,
811
894
  paddingHorizontal: 7,
812
895
  paddingVertical: 2.5,
813
896
  borderRadius: 5,
@@ -819,6 +902,7 @@ const NetworkTab = React.memo(() => {
819
902
  ? AppColors.purple
820
903
  : AppColors.grayBorderSecondary,
821
904
  }}>
905
+ {s.icon(iconColor)}
822
906
  <Text
823
907
  style={{
824
908
  fontFamily: AppFonts.interBold,
@@ -867,6 +951,9 @@ const NetworkTab = React.memo(() => {
867
951
  }}>
868
952
  <View
869
953
  style={{
954
+ flexDirection: 'row',
955
+ alignItems: 'center',
956
+ gap: 4,
870
957
  paddingHorizontal: 7,
871
958
  paddingVertical: 2.5,
872
959
  borderRadius: 5,
@@ -878,6 +965,7 @@ const NetworkTab = React.memo(() => {
878
965
  ? AppColors.purple
879
966
  : `${AppColors.purple}30`,
880
967
  }}>
968
+ {item.icon(isSelected ? AppColors.white : AppColors.purple)}
881
969
  <Text
882
970
  style={{
883
971
  fontFamily: AppFonts.interBold,
@@ -29,6 +29,7 @@ import {getRuntimeDiagnostics} from '../../helpers';
29
29
  import {
30
30
  SearchIcon,
31
31
  CircleXIcon,
32
+ CircleAlertIcon,
32
33
  PerformanceIcon,
33
34
  BoltIcon,
34
35
  LightbulbIcon,
@@ -37,6 +38,7 @@ import {
37
38
  AtomIcon,
38
39
  BrainIcon,
39
40
  GlobeIcon,
41
+ ChevronIcon,
40
42
  } from '../NetworkIcons';
41
43
  import {
42
44
  getPerformanceEvents,
@@ -507,15 +509,40 @@ const PerformanceTab = React.memo(() => {
507
509
  contentContainerStyle={perfStyles.categoryScroll}>
508
510
  {(
509
511
  [
510
- {key: 'ALL', label: t('performance.catAll')},
511
- {key: 'JANKY', label: t('performance.catJanky')},
512
- {key: 'NAVIGATION', label: t('performance.catNavigation')},
513
- {key: 'RENDER', label: t('performance.catRender')},
514
- {key: 'MEMORY', label: t('performance.catMemory')},
515
- {key: 'IO', label: t('performance.catIo')},
512
+ {
513
+ key: 'ALL',
514
+ label: t('performance.catAll'),
515
+ icon: (color: string) => <PerformanceIcon size={12} color={color} />,
516
+ },
517
+ {
518
+ key: 'JANKY',
519
+ label: t('performance.catJanky'),
520
+ icon: (color: string) => <CircleAlertIcon size={12} color={color} />,
521
+ },
522
+ {
523
+ key: 'NAVIGATION',
524
+ label: t('performance.catNavigation'),
525
+ icon: (color: string) => <MapIcon size={12} color={color} />,
526
+ },
527
+ {
528
+ key: 'RENDER',
529
+ label: t('performance.catRender'),
530
+ icon: (color: string) => <AtomIcon size={12} color={color} />,
531
+ },
532
+ {
533
+ key: 'MEMORY',
534
+ label: t('performance.catMemory'),
535
+ icon: (color: string) => <BrainIcon size={12} color={color} />,
536
+ },
537
+ {
538
+ key: 'IO',
539
+ label: t('performance.catIo'),
540
+ icon: (color: string) => <GlobeIcon size={12} color={color} />,
541
+ },
516
542
  ] as const
517
543
  ).map(cat => {
518
544
  const isSelected = filterCategory === cat.key;
545
+ const iconColor = isSelected ? AppColors.white : AppColors.grayTextWeak;
519
546
  return (
520
547
  <TouchableScale
521
548
  key={cat.key}
@@ -523,7 +550,9 @@ const PerformanceTab = React.memo(() => {
523
550
  style={[
524
551
  perfStyles.categoryChip,
525
552
  isSelected && perfStyles.categoryChipActive,
553
+ {flexDirection: 'row', alignItems: 'center', gap: 5},
526
554
  ]}>
555
+ {cat.icon(iconColor)}
527
556
  <Text
528
557
  style={[
529
558
  perfStyles.categoryChipText,
@@ -1079,12 +1108,15 @@ const PerformanceTab = React.memo(() => {
1079
1108
 
1080
1109
  {/* Bottleneck Thread Tag */}
1081
1110
  {event.bottleneckThread && (
1082
- <View style={perfStyles.bottleneckTag}>
1111
+ <View style={[perfStyles.bottleneckTag, {flexDirection: 'row', alignItems: 'center', gap: 3}]}>
1112
+ {event.bottleneckThread === 'JS Thread' && (
1113
+ <BoltIcon size={10} color={AppColors.warningIconGold} />
1114
+ )}
1083
1115
  <Text style={perfStyles.bottleneckTagText}>
1084
1116
  {event.bottleneckThread === 'JS Thread'
1085
- ? `⚡ ${t('performance.jsBound')}`
1117
+ ? t('performance.jsBound')
1086
1118
  : event.bottleneckThread === 'UI Thread'
1087
- ? `🎨 ${t('performance.uiBound')}`
1119
+ ? t('performance.uiBound')
1088
1120
  : t('performance.balanced')}
1089
1121
  </Text>
1090
1122
  </View>
@@ -1096,9 +1128,11 @@ const PerformanceTab = React.memo(() => {
1096
1128
  value={() => event}
1097
1129
  label={t('common.copyJson')}
1098
1130
  />
1099
- <Text style={perfStyles.expandChevron}>
1100
- {isExpanded ? '▲' : '▼'}
1101
- </Text>
1131
+ <ChevronIcon
1132
+ isExpanded={isExpanded}
1133
+ size={14}
1134
+ color={AppColors.grayTextWeak}
1135
+ />
1102
1136
  </View>
1103
1137
  </View>
1104
1138