react-native-inapp-inspector 1.1.32 → 1.1.34

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.
@@ -12,13 +12,13 @@ import styles from '../../styles';
12
12
  import { AppColors } from '../../styles/AppColors';
13
13
  import { AppFonts } from '../../styles/AppFonts';
14
14
  import { getActionHistory, getReduxAutoRefresh, setReduxAutoRefresh, } from '../../customHooks/reduxLogger';
15
- import { TerminalIcon, SearchIcon, ClearIcon, LayersIcon, ClockIcon, ForwardChevronIcon, SortArrowIcon, BoltIcon, TextAaIcon, HeaderPauseIcon, } from '../NetworkIcons';
15
+ import { TerminalIcon, SearchIcon, ClearIcon, LayersIcon, ClockIcon, ForwardChevronIcon, SortArrowIcon, BoltIcon, AtomIcon, ScreenIcon, ListenerIcon, DocIcon, LoadingSpinnerIcon, CircleAlertIcon, TextAaIcon, HeaderPauseIcon, } from '../NetworkIcons';
16
16
  const getOriginBadge = (originType) => {
17
17
  switch (originType) {
18
18
  case 'saga':
19
19
  return {
20
20
  label: 'SAGA',
21
- icon: '⚡',
21
+ renderIcon: (color, size = 9) => <BoltIcon color={color} size={size}/>,
22
22
  bg: AppColors.purple100,
23
23
  text: AppColors.brandPurple,
24
24
  border: AppColors.purple200,
@@ -26,7 +26,7 @@ const getOriginBadge = (originType) => {
26
26
  case 'thunk':
27
27
  return {
28
28
  label: 'THUNK',
29
- icon: '⚛️',
29
+ renderIcon: (color, size = 9) => <AtomIcon color={color} size={size}/>,
30
30
  bg: AppColors.amber100,
31
31
  text: AppColors.amber800Warm,
32
32
  border: AppColors.amber200,
@@ -34,7 +34,7 @@ const getOriginBadge = (originType) => {
34
34
  case 'ui':
35
35
  return {
36
36
  label: 'UI',
37
- icon: '📱',
37
+ renderIcon: (color, size = 9) => <ScreenIcon color={color} size={size}/>,
38
38
  bg: AppColors.sky100,
39
39
  text: AppColors.sky600,
40
40
  border: AppColors.sky400,
@@ -42,7 +42,7 @@ const getOriginBadge = (originType) => {
42
42
  case 'listener':
43
43
  return {
44
44
  label: 'LISTENER',
45
- icon: '👂',
45
+ renderIcon: (color, size = 9) => <ListenerIcon color={color} size={size}/>,
46
46
  bg: AppColors.teal100,
47
47
  text: AppColors.teal700,
48
48
  border: AppColors.teal400,
@@ -50,54 +50,13 @@ const getOriginBadge = (originType) => {
50
50
  default:
51
51
  return {
52
52
  label: 'DIRECT',
53
- icon: '⚡',
53
+ renderIcon: (color, size = 9) => <BoltIcon color={color} size={size}/>,
54
54
  bg: AppColors.slate100,
55
55
  text: AppColors.slate700,
56
56
  border: AppColors.slate200,
57
57
  };
58
58
  }
59
59
  };
60
- const getKeyChipStyle = (key) => {
61
- const k = key.toLowerCase();
62
- if (k.includes('load') || k.includes('pend') || k.includes('status')) {
63
- return {
64
- bg: AppColors.amber100,
65
- border: AppColors.amber200,
66
- text: AppColors.amber800Warm,
67
- dot: AppColors.darkOrange,
68
- };
69
- }
70
- if (k.includes('err') || k.includes('fail') || k.includes('reject')) {
71
- return {
72
- bg: AppColors.red100,
73
- border: AppColors.errorBorder,
74
- text: AppColors.red600,
75
- dot: AppColors.errorColor,
76
- };
77
- }
78
- if (k.includes('user') || k.includes('auth') || k.includes('token') || k.includes('profile')) {
79
- return {
80
- bg: AppColors.indigo50,
81
- border: AppColors.indigo400,
82
- text: AppColors.indigo600Alt,
83
- dot: AppColors.indigo500,
84
- };
85
- }
86
- if (k.includes('item') || k.includes('data') || k.includes('list') || k.includes('entit') || k.includes('count')) {
87
- return {
88
- bg: AppColors.emeraldBg,
89
- border: AppColors.emeraldBorder,
90
- text: AppColors.emerald700,
91
- dot: AppColors.emerald500,
92
- };
93
- }
94
- return {
95
- bg: AppColors.slate100,
96
- border: AppColors.slate200,
97
- text: AppColors.slate700,
98
- dot: AppColors.slate400,
99
- };
100
- };
101
60
  const ReduxTab = React.memo(() => {
102
61
  const { t } = useTranslation();
103
62
  const { reduxState, reduxLastActionMap, reduxSearch, setReduxSearch, setSelectedReduxSlice, } = useInspector();
@@ -131,17 +90,12 @@ const ReduxTab = React.memo(() => {
131
90
  const isObject = sliceVal && typeof sliceVal === 'object';
132
91
  let typeLabel = 'Primitive';
133
92
  let keysCount = 0;
134
- let topKeys = [];
135
- let totalKeysCount = 0;
136
93
  if (isArray) {
137
94
  keysCount = sliceVal.length;
138
95
  typeLabel = `Array [${keysCount}]`;
139
96
  }
140
97
  else if (isObject) {
141
- const objKeys = Object.keys(sliceVal);
142
- totalKeysCount = objKeys.length;
143
- keysCount = totalKeysCount;
144
- topKeys = objKeys.slice(0, 4);
98
+ keysCount = Object.keys(sliceVal).length;
145
99
  typeLabel = `Object {${keysCount}}`;
146
100
  }
147
101
  else if (typeof sliceVal !== 'undefined') {
@@ -211,8 +165,6 @@ const ReduxTab = React.memo(() => {
211
165
  keysCount,
212
166
  sizeStr: getSize(sliceVal),
213
167
  typeLabel,
214
- topKeys,
215
- totalKeysCount,
216
168
  status,
217
169
  statusMessage,
218
170
  timelineCount,
@@ -227,8 +179,7 @@ const ReduxTab = React.memo(() => {
227
179
  if (reduxSearch.trim().length > 0) {
228
180
  const q = reduxSearch.toLowerCase();
229
181
  list = list.filter(item => item.name.toLowerCase().includes(q) ||
230
- (item.lastAction && item.lastAction.type.toLowerCase().includes(q)) ||
231
- item.topKeys.some(k => k.toLowerCase().includes(q)));
182
+ (item.lastAction && item.lastAction.type.toLowerCase().includes(q)));
232
183
  }
233
184
  return [...list].sort((a, b) => {
234
185
  if (sortMode === 'latest') {
@@ -271,9 +222,11 @@ const ReduxTab = React.memo(() => {
271
222
 
272
223
  {/* Status Badge */}
273
224
  {item.status === 'loading' ? (<View style={reduxTabStyles.loadingPill}>
274
- <Text style={reduxTabStyles.loadingPillText}>⏳ Loading</Text>
225
+ <LoadingSpinnerIcon color={AppColors.amber800Warm} size={10}/>
226
+ <Text style={reduxTabStyles.loadingPillText}>Loading</Text>
275
227
  </View>) : item.status === 'error' ? (<View style={reduxTabStyles.errorPill}>
276
- <Text style={reduxTabStyles.errorPillText}>⚠️ Error</Text>
228
+ <CircleAlertIcon color={AppColors.red600} size={10}/>
229
+ <Text style={reduxTabStyles.errorPillText}>Error</Text>
277
230
  </View>) : item.status === 'empty' ? (<View style={reduxTabStyles.emptyPill}>
278
231
  <Text style={reduxTabStyles.emptyPillText}>Empty</Text>
279
232
  </View>) : (<View style={reduxTabStyles.livePill}>
@@ -307,41 +260,6 @@ const ReduxTab = React.memo(() => {
307
260
  </View>)}
308
261
  </View>
309
262
 
310
- {/* Keys Preview Chips (if object has keys) */}
311
- {item.topKeys.length > 0 && (<View style={reduxTabStyles.keysContainer}>
312
- <Text style={reduxTabStyles.keysHeading}>Keys:</Text>
313
- <View style={reduxTabStyles.keysWrap}>
314
- {item.topKeys.map((k, kIdx) => {
315
- const chipStyle = getKeyChipStyle(k);
316
- return (<View key={kIdx} style={[
317
- reduxTabStyles.keyChip,
318
- {
319
- backgroundColor: chipStyle.bg,
320
- borderColor: chipStyle.border,
321
- },
322
- ]}>
323
- <View style={{
324
- width: 5,
325
- height: 5,
326
- borderRadius: 2.5,
327
- backgroundColor: chipStyle.dot,
328
- }}/>
329
- <Text style={[
330
- reduxTabStyles.keyChipText,
331
- { color: chipStyle.text },
332
- ]} numberOfLines={1}>
333
- {k}
334
- </Text>
335
- </View>);
336
- })}
337
- {item.totalKeysCount > item.topKeys.length && (<View style={reduxTabStyles.keyMoreChip}>
338
- <Text style={reduxTabStyles.keyMoreChipText}>
339
- +{item.totalKeysCount - item.topKeys.length}
340
- </Text>
341
- </View>)}
342
- </View>
343
- </View>)}
344
-
345
263
  {/* Bottom row: Last Dispatched Action with Origin & Trigger Line */}
346
264
  {item.lastAction && (<View style={reduxTabStyles.lastActionRow}>
347
265
  <View style={{ flexDirection: 'row', alignItems: 'center', gap: 5, flex: 1, minWidth: 0, flexWrap: 'wrap' }}>
@@ -349,29 +267,30 @@ const ReduxTab = React.memo(() => {
349
267
  <Text style={reduxTabStyles.lastActionLabel}>{t('redux.last', 'Last')}:</Text>
350
268
 
351
269
  {/* Origin Badge */}
352
- {item.lastAction.originType && (<View style={{
353
- flexDirection: 'row',
354
- alignItems: 'center',
355
- gap: 2.5,
356
- backgroundColor: getOriginBadge(item.lastAction.originType).bg,
357
- paddingHorizontal: 4.5,
358
- paddingVertical: 1.5,
359
- borderRadius: 3.5,
360
- borderWidth: 1,
361
- borderColor: getOriginBadge(item.lastAction.originType).border,
362
- }}>
363
- <Text style={{ fontSize: 8.5 }}>
364
- {getOriginBadge(item.lastAction.originType).icon}
365
- </Text>
366
- <Text style={{
367
- fontFamily: AppFonts.interBold,
368
- fontSize: 8,
369
- color: getOriginBadge(item.lastAction.originType).text,
370
- letterSpacing: 0.3,
371
- }}>
372
- {getOriginBadge(item.lastAction.originType).label}
373
- </Text>
374
- </View>)}
270
+ {item.lastAction.originType && (() => {
271
+ const origin = getOriginBadge(item.lastAction.originType);
272
+ return (<View style={{
273
+ flexDirection: 'row',
274
+ alignItems: 'center',
275
+ gap: 2.5,
276
+ backgroundColor: origin.bg,
277
+ paddingHorizontal: 4.5,
278
+ paddingVertical: 1.5,
279
+ borderRadius: 3.5,
280
+ borderWidth: 1,
281
+ borderColor: origin.border,
282
+ }}>
283
+ {origin.renderIcon(origin.text, 8.5)}
284
+ <Text style={{
285
+ fontFamily: AppFonts.interBold,
286
+ fontSize: 8,
287
+ color: origin.text,
288
+ letterSpacing: 0.3,
289
+ }}>
290
+ {origin.label}
291
+ </Text>
292
+ </View>);
293
+ })()}
375
294
 
376
295
  <HighlightText text={item.lastAction.type} search={reduxSearch} style={reduxTabStyles.lastActionValue} highlightStyle={reduxTabStyles.highlight} numberOfLines={1}/>
377
296
 
@@ -379,7 +298,7 @@ const ReduxTab = React.memo(() => {
379
298
  {item.lastAction.callerFile && (<Pressable onPress={() => openInVSCode(item.lastAction.callerFile, item.lastAction.callerLine, item.lastAction.callerCol)} hitSlop={6} style={{
380
299
  flexDirection: 'row',
381
300
  alignItems: 'center',
382
- gap: 2,
301
+ gap: 2.5,
383
302
  backgroundColor: AppColors.sky100,
384
303
  paddingHorizontal: 4.5,
385
304
  paddingVertical: 1.5,
@@ -387,12 +306,13 @@ const ReduxTab = React.memo(() => {
387
306
  borderWidth: 0.5,
388
307
  borderColor: AppColors.sky400,
389
308
  }}>
309
+ <DocIcon color={AppColors.sky600} size={9}/>
390
310
  <Text style={{
391
311
  fontFamily: AppFonts.interMedium,
392
312
  fontSize: 8.5,
393
313
  color: AppColors.sky600,
394
314
  }}>
395
- 📄 {item.lastAction.callerFile.split('/').pop()}:{item.lastAction.callerLine || 1}
315
+ {item.lastAction.callerFile.split('/').pop()}:{item.lastAction.callerLine || 1}
396
316
  </Text>
397
317
  </Pressable>)}
398
318
 
@@ -431,20 +351,27 @@ const ReduxTab = React.memo(() => {
431
351
  <View style={[reduxTabStyles.statCol, { flex: 1.6 }]}>
432
352
  <View style={{ flexDirection: 'row', alignItems: 'center', gap: 4 }}>
433
353
  <Text style={reduxTabStyles.statHeading}>LAST ACTION</Text>
434
- {lastGlobalAction?.originType && (<View style={{
435
- backgroundColor: getOriginBadge(lastGlobalAction.originType).bg,
436
- paddingHorizontal: 4,
437
- paddingVertical: 1,
438
- borderRadius: 3,
439
- }}>
440
- <Text style={{
441
- fontFamily: AppFonts.interBold,
442
- fontSize: 7.5,
443
- color: getOriginBadge(lastGlobalAction.originType).text,
444
- }}>
445
- {getOriginBadge(lastGlobalAction.originType).label}
446
- </Text>
447
- </View>)}
354
+ {lastGlobalAction?.originType && (() => {
355
+ const origin = getOriginBadge(lastGlobalAction.originType);
356
+ return (<View style={{
357
+ flexDirection: 'row',
358
+ alignItems: 'center',
359
+ gap: 2,
360
+ backgroundColor: origin.bg,
361
+ paddingHorizontal: 4,
362
+ paddingVertical: 1,
363
+ borderRadius: 3,
364
+ }}>
365
+ {origin.renderIcon(origin.text, 8)}
366
+ <Text style={{
367
+ fontFamily: AppFonts.interBold,
368
+ fontSize: 7.5,
369
+ color: origin.text,
370
+ }}>
371
+ {origin.label}
372
+ </Text>
373
+ </View>);
374
+ })()}
448
375
  </View>
449
376
  <Text style={reduxTabStyles.statLastAction} numberOfLines={1}>
450
377
  {lastGlobalAction ? lastGlobalAction.type : 'Initial'}
@@ -745,54 +672,6 @@ const reduxTabStyles = StyleSheet.create({
745
672
  fontSize: 9.5,
746
673
  color: AppColors.grayTextWeak,
747
674
  },
748
- keysContainer: {
749
- flexDirection: 'row',
750
- alignItems: 'center',
751
- gap: 6,
752
- marginTop: 4,
753
- marginBottom: 4,
754
- },
755
- keysHeading: {
756
- fontFamily: AppFonts.interMedium,
757
- fontSize: 10,
758
- color: AppColors.grayTextWeak,
759
- },
760
- keysWrap: {
761
- flexDirection: 'row',
762
- flexWrap: 'wrap',
763
- gap: 4,
764
- flex: 1,
765
- },
766
- keyChip: {
767
- flexDirection: 'row',
768
- alignItems: 'center',
769
- gap: 4,
770
- backgroundColor: AppColors.slate100,
771
- paddingHorizontal: 6,
772
- paddingVertical: 2.5,
773
- borderRadius: 5,
774
- borderWidth: 1,
775
- borderColor: AppColors.slate200,
776
- maxWidth: 120,
777
- },
778
- keyChipText: {
779
- fontFamily: AppFonts.interBold,
780
- fontSize: 9.5,
781
- color: AppColors.slate700,
782
- },
783
- keyMoreChip: {
784
- backgroundColor: AppColors.purple100,
785
- paddingHorizontal: 5,
786
- paddingVertical: 2,
787
- borderRadius: 4,
788
- borderWidth: 1,
789
- borderColor: AppColors.purple200,
790
- },
791
- keyMoreChipText: {
792
- fontFamily: AppFonts.interBold,
793
- fontSize: 9,
794
- color: AppColors.brandPurple,
795
- },
796
675
  lastActionRow: {
797
676
  flexDirection: 'row',
798
677
  alignItems: 'center',
@@ -113,3 +113,5 @@ export declare const TrailIcon: ({ color, size, }: IconProps) => React.JSX.Eleme
113
113
  export declare const RawJsonIcon: ({ color, size, }: IconProps) => React.JSX.Element;
114
114
  export declare const AppFramesIcon: ({ color, size, }: IconProps) => React.JSX.Element;
115
115
  export declare const AllFramesIcon: ({ color, size, }: IconProps) => React.JSX.Element;
116
+ export declare const ListenerIcon: ({ color, size, }: IconProps) => React.JSX.Element;
117
+ export declare const LoadingSpinnerIcon: ({ color, size, }: IconProps) => React.JSX.Element;
@@ -651,3 +651,14 @@ export const AllFramesIcon = ({ color = AppColors.grayTextWeak, size = 14, }) =>
651
651
  <Rect x="16" y="16" width="4" height="4" rx="1" fill={color}/>
652
652
  </Svg>);
653
653
  };
654
+ export const ListenerIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => {
655
+ return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
656
+ <Path d="M3 18v-6a9 9 0 0 1 18 0v6" stroke={color} strokeWidth="2" strokeLinecap="round"/>
657
+ <Path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3v5zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3v5z" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
658
+ </Svg>);
659
+ };
660
+ export const LoadingSpinnerIcon = ({ color = AppColors.amber800Warm, size = 12, }) => {
661
+ return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
662
+ <Path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" stroke={color} strokeWidth="2.2" strokeLinecap="round"/>
663
+ </Svg>);
664
+ };
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "1.1.32";
1
+ export declare const LIB_VERSION = "1.1.34";
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED FILE — do not edit by hand.
2
2
  // Regenerated from package.json on every build by scripts/gen-version.js.
3
- export const LIB_VERSION = '1.1.32';
3
+ export const LIB_VERSION = '1.1.34';
@@ -111,8 +111,11 @@ export declare const trackRuntimeDefine: () => void;
111
111
  */
112
112
  export declare const parseBundleSource: (bundleText: string, totalBytes: number, scriptURL: string, isLive?: boolean) => HostBundleAnalysisResult;
113
113
  /**
114
- * Automatically fetch and analyze the real running bundle for the host app.
115
- * Supports dynamic port detection (8081, 8082, 8083, etc.) and parallel dev server probing.
114
+ * Returns an instant baseline bundle analysis synchronously (never blocks UI).
115
+ */
116
+ export declare const getInitialBundleAnalysis: () => HostBundleAnalysisResult;
117
+ /**
118
+ * Asynchronously fetch and analyze the running Metro bundle in the background.
116
119
  */
117
120
  export declare const analyzeHostAppBundle: (forceRefresh?: boolean) => Promise<HostBundleAnalysisResult>;
118
121
  export declare const clearCachedBundleAnalysis: () => void;