react-native-inapp-inspector 1.1.16 → 1.1.18

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 (67) hide show
  1. package/README.md +13 -0
  2. package/dist/commonjs/components/AnimatedEntrance.js +3 -0
  3. package/dist/commonjs/components/AppHeaderLogo.d.ts +8 -0
  4. package/dist/commonjs/components/AppHeaderLogo.js +85 -0
  5. package/dist/commonjs/components/Inspector/BundleTab.d.ts +46 -0
  6. package/dist/commonjs/components/Inspector/BundleTab.js +2439 -0
  7. package/dist/commonjs/components/Inspector/InspectorHeader.js +185 -52
  8. package/dist/commonjs/components/Inspector/MainScreen.js +93 -7
  9. package/dist/commonjs/components/Inspector/PerformanceTab.d.ts +22 -0
  10. package/dist/commonjs/components/Inspector/PerformanceTab.js +1143 -0
  11. package/dist/commonjs/components/Inspector/ReduxDetail.d.ts +3 -0
  12. package/dist/commonjs/components/Inspector/ReduxDetail.js +576 -0
  13. package/dist/commonjs/components/Inspector/ReduxTab.js +433 -49
  14. package/dist/commonjs/components/Inspector/SettingsPanel.js +13 -2
  15. package/dist/commonjs/components/Inspector/TabBar.js +16 -6
  16. package/dist/commonjs/components/JsonViewer.js +91 -30
  17. package/dist/commonjs/components/LogCard.js +3 -4
  18. package/dist/commonjs/components/NetworkIcons.d.ts +9 -0
  19. package/dist/commonjs/components/NetworkIcons.js +63 -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/consoleLogger.js +37 -9
  23. package/dist/commonjs/customHooks/reduxLogger.js +4 -2
  24. package/dist/commonjs/helpers/index.js +6 -2
  25. package/dist/commonjs/index.js +18 -1
  26. package/dist/commonjs/styles/AppColors.js +163 -163
  27. package/dist/commonjs/styles/index.d.ts +14 -0
  28. package/dist/commonjs/styles/index.js +14 -0
  29. package/dist/commonjs/types/enums.d.ts +2 -2
  30. package/dist/commonjs/types/interfaces.d.ts +11 -0
  31. package/dist/esm/components/AnimatedEntrance.js +4 -1
  32. package/dist/esm/components/AppHeaderLogo.d.ts +8 -0
  33. package/dist/esm/components/AppHeaderLogo.js +45 -0
  34. package/dist/esm/components/Inspector/BundleTab.d.ts +46 -0
  35. package/dist/esm/components/Inspector/BundleTab.js +2401 -0
  36. package/dist/esm/components/Inspector/InspectorHeader.js +151 -51
  37. package/dist/esm/components/Inspector/MainScreen.js +60 -7
  38. package/dist/esm/components/Inspector/PerformanceTab.d.ts +22 -0
  39. package/dist/esm/components/Inspector/PerformanceTab.js +1105 -0
  40. package/dist/esm/components/Inspector/ReduxDetail.d.ts +3 -0
  41. package/dist/esm/components/Inspector/ReduxDetail.js +538 -0
  42. package/dist/esm/components/Inspector/ReduxTab.js +402 -51
  43. package/dist/esm/components/Inspector/SettingsPanel.js +14 -3
  44. package/dist/esm/components/Inspector/TabBar.js +17 -7
  45. package/dist/esm/components/JsonViewer.js +92 -31
  46. package/dist/esm/components/LogCard.js +3 -4
  47. package/dist/esm/components/NetworkIcons.d.ts +9 -0
  48. package/dist/esm/components/NetworkIcons.js +55 -1
  49. package/dist/esm/constants/version.d.ts +1 -1
  50. package/dist/esm/constants/version.js +1 -1
  51. package/dist/esm/customHooks/consoleLogger.js +37 -9
  52. package/dist/esm/customHooks/reduxLogger.js +4 -2
  53. package/dist/esm/helpers/index.js +6 -2
  54. package/dist/esm/index.js +18 -1
  55. package/dist/esm/styles/AppColors.js +163 -163
  56. package/dist/esm/styles/index.d.ts +14 -0
  57. package/dist/esm/styles/index.js +14 -0
  58. package/dist/esm/types/enums.d.ts +2 -2
  59. package/dist/esm/types/interfaces.d.ts +11 -0
  60. package/example/App.tsx +5 -1
  61. package/example/assets/app_icon.png +0 -0
  62. package/example/ios/Podfile.lock +3 -3
  63. package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +18 -9
  64. package/example/ios/example/Images.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
  65. package/example/package-lock.json +824 -10
  66. package/example/package.json +6 -2
  67. package/package.json +4 -2
@@ -1,26 +1,96 @@
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 react_native_linear_gradient_1 = __importDefault(require("react-native-linear-gradient"));
9
42
  const InspectorContext_1 = require("./InspectorContext");
10
43
  const TouchableScale_1 = __importDefault(require("../TouchableScale"));
11
- const BrandSquareIcon_1 = __importDefault(require("../BrandSquareIcon"));
44
+ const AppHeaderLogo_1 = __importDefault(require("../AppHeaderLogo"));
12
45
  const styles_1 = __importDefault(require("../../styles"));
13
46
  const AppColors_1 = require("../../styles/AppColors");
14
47
  const AppFonts_1 = require("../../styles/AppFonts");
15
48
  const constants_1 = require("../../constants");
16
49
  const constants_2 = require("../../constants");
17
50
  const helpers_1 = require("../../helpers");
18
- const helpers_2 = require("../../helpers");
19
- const helpers_3 = require("../../helpers");
20
- const helpers_4 = require("../../helpers");
21
51
  const NetworkIcons_1 = require("../NetworkIcons");
22
52
  const InspectorHeader = react_1.default.memo(() => {
23
- const { modalHeightPercent, selected, setSelected, selectedEvent, setSelectedEvent, selectedLog, setSelectedLog, showHeaderInfo, setShowHeaderInfo, updateAvailable, latestNpmVersion, clearAnim, activePulseAnim, unreadPulseAnim, runClearAllWithAnimation, setSettingsPage, closeModal, detailTitle, } = (0, InspectorContext_1.useInspector)();
53
+ 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, } = (0, InspectorContext_1.useInspector)();
54
+ const envConfig = (0, react_1.useMemo)(() => {
55
+ const rawEnv = (environment || (__DEV__ ? 'DEV' : 'PROD')).trim();
56
+ const clean = rawEnv.toUpperCase();
57
+ if (clean === 'DEV' || clean.includes('DEV') || clean === 'LOCAL') {
58
+ return {
59
+ label: rawEnv,
60
+ bg: 'rgba(16, 185, 129, 0.25)', // emerald
61
+ border: 'rgba(110, 231, 183, 0.55)',
62
+ text: '#A7F3D0',
63
+ };
64
+ }
65
+ if (clean === 'UAT' || clean === 'QA' || clean === 'TEST') {
66
+ return {
67
+ label: rawEnv,
68
+ bg: 'rgba(245, 158, 11, 0.28)', // amber
69
+ border: 'rgba(252, 211, 77, 0.6)',
70
+ text: '#FDE68A',
71
+ };
72
+ }
73
+ if (clean === 'PREPROD' || clean === 'STAGE' || clean === 'STAGING') {
74
+ return {
75
+ label: rawEnv,
76
+ bg: 'rgba(139, 92, 246, 0.28)', // purple
77
+ border: 'rgba(196, 181, 253, 0.6)',
78
+ text: '#DDD6FE',
79
+ };
80
+ }
81
+ // PROD / Live
82
+ return {
83
+ label: rawEnv,
84
+ bg: 'rgba(244, 63, 94, 0.25)', // rose
85
+ border: 'rgba(253, 164, 175, 0.55)',
86
+ text: '#FECDD3',
87
+ };
88
+ }, [environment]);
89
+ const isDetailView = (activeTab === 'apis' && selected != null) ||
90
+ (activeTab === 'analytics' && selectedEvent != null) ||
91
+ (activeTab === 'logs' && selectedLog != null) ||
92
+ (activeTab === 'redux' && (selectedReduxSlice != null || selectedReduxAction != null));
93
+ const isAnySelected = isDetailView;
24
94
  const headerTopPadding = react_native_1.Platform.OS === 'ios' && modalHeightPercent >= 95 ? 44 : 0;
25
95
  return (<react_native_linear_gradient_1.default colors={[AppColors_1.AppColors.purple, AppColors_1.AppColors.brandPurple]} style={styles_1.default.headerGradient}>
26
96
  <react_native_1.View style={{ paddingTop: headerTopPadding, width: '100%' }}>
@@ -31,11 +101,7 @@ const InspectorHeader = react_1.default.memo(() => {
31
101
  flexDirection: 'row',
32
102
  alignItems: 'center',
33
103
  gap: 16,
34
- flex: selected == null &&
35
- selectedEvent == null &&
36
- selectedLog == null
37
- ? 5
38
- : 1,
104
+ flex: !isDetailView ? 5 : 1,
39
105
  },
40
106
  ]}>
41
107
  <TouchableScale_1.default onPress={() => {
@@ -43,6 +109,8 @@ const InspectorHeader = react_1.default.memo(() => {
43
109
  setSelected(null);
44
110
  setSelectedEvent(null);
45
111
  setSelectedLog(null);
112
+ setSelectedReduxSlice(null);
113
+ setSelectedReduxAction(null);
46
114
  });
47
115
  }} hitSlop={15} style={[
48
116
  {
@@ -55,9 +123,7 @@ const InspectorHeader = react_1.default.memo(() => {
55
123
  borderWidth: 1,
56
124
  borderColor: `${AppColors_1.AppColors.white}4D`,
57
125
  },
58
- selected == null &&
59
- selectedEvent == null &&
60
- selectedLog == null && { display: 'none' },
126
+ !isAnySelected && { display: 'none' },
61
127
  ]}>
62
128
  {/* Soft outer glow to fake a blurred circle */}
63
129
  <react_native_1.View style={{
@@ -70,36 +136,32 @@ const InspectorHeader = react_1.default.memo(() => {
70
136
  <NetworkIcons_1.WhiteBackNavigation />
71
137
  </TouchableScale_1.default>
72
138
 
73
- {selected == null &&
74
- selectedEvent == null &&
75
- selectedLog == null ? (<TouchableScale_1.default onPress={() => setShowHeaderInfo(prev => !prev)} style={{
139
+ {!isAnySelected ? (<TouchableScale_1.default onPress={() => setShowHeaderInfo(prev => !prev)} style={{
76
140
  flexDirection: 'row',
77
141
  alignItems: 'flex-start',
78
142
  gap: 10,
79
143
  flex: 1,
80
144
  }}>
81
- <react_native_1.View style={{
82
- width: 46,
83
- height: 46,
84
- borderRadius: 12,
85
- alignItems: 'center',
86
- justifyContent: 'center',
87
- backgroundColor: `${AppColors_1.AppColors.white}21`,
88
- borderWidth: 1.5,
89
- borderColor: `${AppColors_1.AppColors.white}40`,
90
- shadowColor: AppColors_1.AppColors.black,
91
- shadowOpacity: 0.15,
92
- shadowRadius: 4,
93
- shadowOffset: { width: 0, height: 2 },
94
- flexShrink: 0,
95
- }}>
96
- <BrandSquareIcon_1.default size={42}/>
97
- </react_native_1.View>
145
+ <AppHeaderLogo_1.default size={46} customIcon={appIcon}/>
98
146
  <react_native_1.View style={{ gap: 2, flex: 1 }}>
99
- <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
147
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 6, flexWrap: 'wrap' }}>
100
148
  <react_native_1.Text style={[styles_1.default.headerTitle]} numberOfLines={1}>
101
- {(0, helpers_2.getAppName)()}
149
+ {(0, helpers_1.getAppName)()}
102
150
  </react_native_1.Text>
151
+ <react_native_1.View style={[
152
+ styles_1.default.envBadge,
153
+ {
154
+ backgroundColor: envConfig.bg,
155
+ borderColor: envConfig.border,
156
+ },
157
+ ]}>
158
+ <react_native_1.Text style={[
159
+ styles_1.default.envBadgeText,
160
+ { color: envConfig.text },
161
+ ]}>
162
+ {envConfig.label}
163
+ </react_native_1.Text>
164
+ </react_native_1.View>
103
165
  {updateAvailable && (<react_native_1.Pressable hitSlop={10} onPress={() => react_native_1.Alert.alert('Update Available', `react-native-inapp-inspector v${latestNpmVersion} is available on NPM (installed: v${constants_2.LIB_VERSION}).`, [
104
166
  { text: 'Later', style: 'cancel' },
105
167
  {
@@ -146,7 +208,7 @@ const InspectorHeader = react_1.default.memo(() => {
146
208
  color: `${AppColors_1.AppColors.white}D9`,
147
209
  letterSpacing: 0.2,
148
210
  }} numberOfLines={1}>
149
- {(0, helpers_3.getBundleIdentifier)()}
211
+ {(0, helpers_1.getBundleIdentifier)()}
150
212
  </react_native_1.Text>
151
213
  <react_native_1.Animated.View style={{
152
214
  transform: [{ rotate: showHeaderInfo ? '180deg' : '0deg' }],
@@ -238,10 +300,8 @@ const InspectorHeader = react_1.default.memo(() => {
238
300
  </TouchableScale_1.default>) : null}
239
301
  </react_native_1.View>
240
302
 
241
- {(selected != null ||
242
- selectedEvent != null ||
243
- selectedLog != null) && (<react_native_1.View style={styles_1.default.headerCenter}>
244
- {selected != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
303
+ {isDetailView && (<react_native_1.View style={styles_1.default.headerCenter}>
304
+ {activeTab === 'apis' && selected != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
245
305
  <react_native_1.View style={styles_1.default.headerDetailRow}>
246
306
  <react_native_1.View style={[
247
307
  styles_1.default.headerMethodBadge,
@@ -302,7 +362,7 @@ const InspectorHeader = react_1.default.memo(() => {
302
362
  </react_native_1.Text>
303
363
  </react_native_1.View>
304
364
  </react_native_1.View>
305
- </react_native_1.View>) : selectedEvent != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
365
+ </react_native_1.View>) : activeTab === 'analytics' && selectedEvent != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
306
366
  <react_native_1.View style={styles_1.default.headerDetailRow}>
307
367
  <react_native_1.View style={[
308
368
  styles_1.default.headerMethodBadge,
@@ -340,7 +400,7 @@ const InspectorHeader = react_1.default.memo(() => {
340
400
  {selectedEvent.source}
341
401
  </react_native_1.Text>
342
402
  </react_native_1.View>
343
- </react_native_1.View>) : selectedLog != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
403
+ </react_native_1.View>) : activeTab === 'logs' && selectedLog != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
344
404
  <react_native_1.View style={styles_1.default.headerDetailRow}>
345
405
  <react_native_1.View style={[
346
406
  styles_1.default.headerMethodBadge,
@@ -373,27 +433,100 @@ const InspectorHeader = react_1.default.memo(() => {
373
433
  borderRadius: 20,
374
434
  backgroundColor: `${AppColors_1.AppColors.white}29`,
375
435
  }}>
376
- <NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.white} size={11}/>
377
- <react_native_1.Text style={styles_1.default.headerSubTitle}>
378
- {(0, helpers_4.formatTime)(selectedLog.timestamp)}
436
+ <NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.white} size={11}/>
437
+ <react_native_1.Text style={styles_1.default.headerSubTitle}>
438
+ {(0, helpers_1.formatTime)(selectedLog.timestamp)}
439
+ </react_native_1.Text>
440
+ </react_native_1.View>
441
+ </react_native_1.View>
442
+ </react_native_1.View>) : activeTab === 'redux' && selectedReduxSlice != null ? ((() => {
443
+ const sliceData = reduxState?.[selectedReduxSlice];
444
+ const keyCount = sliceData && typeof sliceData === 'object'
445
+ ? Object.keys(sliceData).length
446
+ : typeof sliceData !== 'undefined'
447
+ ? 1
448
+ : 0;
449
+ const sliceSize = (0, helpers_1.getSize)(sliceData);
450
+ const lastAction = reduxLastActionMap[selectedReduxSlice];
451
+ return (<react_native_1.View style={styles_1.default.headerDetailCenter}>
452
+ <react_native_1.View style={styles_1.default.headerDetailRow}>
453
+ <react_native_1.View style={[
454
+ styles_1.default.headerMethodBadge,
455
+ {
456
+ backgroundColor: `${AppColors_1.AppColors.purple}4D`,
457
+ },
458
+ ]}>
459
+ <react_native_1.Text style={styles_1.default.headerMethodText}>
460
+ SLICE
461
+ </react_native_1.Text>
462
+ </react_native_1.View>
463
+ <react_native_1.Text style={styles_1.default.headerDetailTitle} numberOfLines={1} ellipsizeMode="middle">
464
+ {selectedReduxSlice}
465
+ </react_native_1.Text>
466
+ </react_native_1.View>
467
+ <react_native_1.View style={styles_1.default.headerDetailSubRow}>
468
+ <react_native_1.View style={[
469
+ styles_1.default.headerStatusDot,
470
+ { backgroundColor: AppColors_1.AppColors.liveGreen },
471
+ ]}/>
472
+ <react_native_1.Text style={styles_1.default.headerSubTitle}>
473
+ Live
474
+ </react_native_1.Text>
475
+ <react_native_1.Text style={[styles_1.default.headerSubTitle, { opacity: 0.6 }]}>•</react_native_1.Text>
476
+ <react_native_1.Text style={styles_1.default.headerSubTitle}>
477
+ {keyCount} keys
478
+ </react_native_1.Text>
479
+ <react_native_1.Text style={[styles_1.default.headerSubTitle, { opacity: 0.6 }]}>•</react_native_1.Text>
480
+ <react_native_1.Text style={styles_1.default.headerSubTitle}>
481
+ {sliceSize}
482
+ </react_native_1.Text>
483
+ {lastAction?.timestamp && (<>
484
+ <react_native_1.Text style={[styles_1.default.headerSubTitle, { opacity: 0.6 }]}>•</react_native_1.Text>
485
+ <react_native_1.View style={{ flexDirection: 'row', alignItems: 'center', gap: 3 }}>
486
+ <NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.white} size={10}/>
487
+ <react_native_1.Text style={styles_1.default.headerSubTitle}>
488
+ {lastAction.timestamp}
489
+ </react_native_1.Text>
490
+ </react_native_1.View>
491
+ </>)}
492
+ </react_native_1.View>
493
+ </react_native_1.View>);
494
+ })()) : activeTab === 'redux' && selectedReduxAction != null ? (<react_native_1.View style={styles_1.default.headerDetailCenter}>
495
+ <react_native_1.View style={styles_1.default.headerDetailRow}>
496
+ <react_native_1.View style={[
497
+ styles_1.default.headerMethodBadge,
498
+ {
499
+ backgroundColor: `${AppColors_1.AppColors.brandPurple}4D`,
500
+ },
501
+ ]}>
502
+ <react_native_1.Text style={styles_1.default.headerMethodText}>
503
+ ACTION
379
504
  </react_native_1.Text>
380
505
  </react_native_1.View>
506
+ <react_native_1.Text style={styles_1.default.headerDetailTitle} numberOfLines={1} ellipsizeMode="middle">
507
+ {selectedReduxAction.type}
508
+ </react_native_1.Text>
509
+ </react_native_1.View>
510
+ <react_native_1.View style={styles_1.default.headerDetailSubRow}>
511
+ <react_native_1.View style={[
512
+ styles_1.default.headerStatusDot,
513
+ { backgroundColor: AppColors_1.AppColors.purple },
514
+ ]}/>
515
+ <react_native_1.Text style={styles_1.default.headerSubTitle}>
516
+ {selectedReduxAction.timestamp || 'Dispatched'}
517
+ </react_native_1.Text>
381
518
  </react_native_1.View>
382
519
  </react_native_1.View>) : null}
383
520
  </react_native_1.View>)}
384
521
 
385
522
  <react_native_1.View style={[
386
523
  styles_1.default.headerRight,
387
- selected == null &&
388
- selectedEvent == null &&
389
- selectedLog == null && {
524
+ !isAnySelected && {
390
525
  flexShrink: 0,
391
526
  minWidth: 116,
392
527
  },
393
528
  ]}>
394
- {selected == null &&
395
- selectedEvent == null &&
396
- selectedLog == null && (<TouchableScale_1.default onPress={() => {
529
+ {!isAnySelected && (<TouchableScale_1.default onPress={() => {
397
530
  react_native_1.Alert.alert('Clear Everything', 'This clears all tabs — APIs, Logs, Analytics and Redux timeline. Continue?', [
398
531
  { text: 'Cancel', style: 'cancel' },
399
532
  {
@@ -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"));
@@ -15,13 +48,32 @@ const NetworkDetail_1 = __importDefault(require("./NetworkDetail"));
15
48
  const LogDetail_1 = __importDefault(require("./LogDetail"));
16
49
  const ConsoleTab_1 = __importDefault(require("./ConsoleTab"));
17
50
  const AnalyticsTab_1 = __importDefault(require("./AnalyticsTab"));
51
+ const AnalyticsDetail_1 = __importDefault(require("../AnalyticsDetail"));
18
52
  const ReduxTab_1 = __importDefault(require("./ReduxTab"));
53
+ const ReduxDetail_1 = __importDefault(require("./ReduxDetail"));
54
+ const BundleTab_1 = __importDefault(require("./BundleTab"));
55
+ const PerformanceTab_1 = __importDefault(require("./PerformanceTab"));
19
56
  const SettingsPanel_1 = __importDefault(require("./SettingsPanel"));
20
57
  const styles_1 = __importDefault(require("../../styles"));
21
58
  const AppColors_1 = require("../../styles/AppColors");
22
59
  const NavigationTracker_1 = __importDefault(require("./NavigationTracker"));
23
60
  const MainScreen = () => {
24
- const { visible, modalAnimationType, closeModal, modalHeightPercent, selected, selectedEvent, selectedLog, settingsPage, activeTab, isReady, isEnabled, hasNavigationContext, setNavState, } = (0, InspectorContext_1.useInspector)();
61
+ const { visible, modalAnimationType, closeModal, modalHeightPercent, selected, selectedEvent, selectedLog, selectedReduxSlice, selectedReduxAction, settingsPage, activeTab, isReady, isEnabled, hasNavigationContext, setNavState, } = (0, InspectorContext_1.useInspector)();
62
+ // Lazy-mount each tab on first visit and cache it in memory for 0ms instantaneous switching
63
+ const [mountedTabs, setMountedTabs] = (0, react_1.useState)({
64
+ [activeTab]: true,
65
+ });
66
+ (0, react_1.useEffect)(() => {
67
+ setMountedTabs(prev => {
68
+ if (prev[activeTab])
69
+ return prev;
70
+ return { ...prev, [activeTab]: true };
71
+ });
72
+ }, [activeTab]);
73
+ const isDetailActive = (activeTab === 'apis' && selected != null) ||
74
+ (activeTab === 'analytics' && selectedEvent != null) ||
75
+ (activeTab === 'logs' && selectedLog != null) ||
76
+ (activeTab === 'redux' && (selectedReduxSlice != null || selectedReduxAction != null));
25
77
  return (<>
26
78
  {isEnabled && <FabLauncher_1.default />}
27
79
  <react_native_1.Modal visible={visible} animationType={modalAnimationType} transparent>
@@ -37,12 +89,46 @@ const MainScreen = () => {
37
89
  <InspectorHeader_1.default />
38
90
 
39
91
  {/* ─── Horizontal Scrollable Tab Bar inside Content ─── */}
40
- {selected == null &&
41
- selectedEvent == null &&
42
- selectedLog == null &&
43
- settingsPage === null ? (<TabBar_1.default />) : null}
92
+ {!isDetailActive && settingsPage === null ? (<TabBar_1.default />) : null}
44
93
 
45
- {isReady ? (activeTab === 'analytics' ? (<AnalyticsTab_1.default />) : activeTab === 'apis' && selected == null ? (<NetworkTab_1.default />) : activeTab === 'logs' && selectedLog == null ? (<ConsoleTab_1.default />) : activeTab === 'logs' ? (<LogDetail_1.default />) : activeTab === 'redux' ? (<ReduxTab_1.default />) : (<NetworkDetail_1.default />)) : (<react_native_1.View style={styles_1.default.empty}>
94
+ {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 />) : null) : (<>
95
+ <react_native_1.View style={{
96
+ flex: 1,
97
+ display: activeTab === 'apis' ? 'flex' : 'none',
98
+ }}>
99
+ {mountedTabs.apis && <NetworkTab_1.default />}
100
+ </react_native_1.View>
101
+ <react_native_1.View style={{
102
+ flex: 1,
103
+ display: activeTab === 'logs' ? 'flex' : 'none',
104
+ }}>
105
+ {mountedTabs.logs && <ConsoleTab_1.default />}
106
+ </react_native_1.View>
107
+ <react_native_1.View style={{
108
+ flex: 1,
109
+ display: activeTab === 'analytics' ? 'flex' : 'none',
110
+ }}>
111
+ {mountedTabs.analytics && <AnalyticsTab_1.default />}
112
+ </react_native_1.View>
113
+ <react_native_1.View style={{
114
+ flex: 1,
115
+ display: activeTab === 'redux' ? 'flex' : 'none',
116
+ }}>
117
+ {mountedTabs.redux && <ReduxTab_1.default />}
118
+ </react_native_1.View>
119
+ <react_native_1.View style={{
120
+ flex: 1,
121
+ display: activeTab === 'bundle' ? 'flex' : 'none',
122
+ }}>
123
+ {mountedTabs.bundle && <BundleTab_1.default />}
124
+ </react_native_1.View>
125
+ <react_native_1.View style={{
126
+ flex: 1,
127
+ display: activeTab === 'performance' ? 'flex' : 'none',
128
+ }}>
129
+ {mountedTabs.performance && <PerformanceTab_1.default />}
130
+ </react_native_1.View>
131
+ </>)) : (<react_native_1.View style={styles_1.default.empty}>
46
132
  <react_native_1.ActivityIndicator size="large" color={AppColors_1.AppColors.purple}/>
47
133
  <react_native_1.Text style={[styles_1.default.emptySub, { marginTop: 12 }]}>
48
134
  Loading logs...
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export interface PerformanceEvent {
3
+ id: string;
4
+ timestamp: number;
5
+ type: 'fps_drop' | 'slow_render' | 'transition' | 'memory' | 'network' | 'bridge' | 'touch';
6
+ category: 'render' | 'navigation' | 'memory' | 'io' | 'bridge';
7
+ fps: number;
8
+ durationMs: number;
9
+ label: string;
10
+ detail: string;
11
+ source?: string;
12
+ breakdown?: {
13
+ jsTimeMs: number;
14
+ uiTimeMs: number;
15
+ bridgeLatencyMs?: number;
16
+ };
17
+ heapDeltaKb?: number;
18
+ advice?: string;
19
+ severity: 'optimal' | 'warning' | 'critical';
20
+ }
21
+ declare const PerformanceTab: React.MemoExoticComponent<() => React.JSX.Element>;
22
+ export default PerformanceTab;