react-native-inapp-inspector 2.2.2 → 2.2.3
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.
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/package.json +2 -1
- package/src/analytics.ts +35 -0
- package/src/bundle.ts +25 -0
- package/src/components/AnalyticsDetail.tsx +865 -0
- package/src/components/AnalyticsEventCard.tsx +441 -0
- package/src/components/AnalyticsGraph.tsx +583 -0
- package/src/components/AnimatedEntrance.tsx +64 -0
- package/src/components/AppHeaderLogo.tsx +109 -0
- package/src/components/BrandCircleIcon.tsx +144 -0
- package/src/components/BrandSquareIcon.tsx +144 -0
- package/src/components/CodeSnippet.tsx +725 -0
- package/src/components/ConsoleLogCard.tsx +628 -0
- package/src/components/CopyButton.tsx +87 -0
- package/src/components/DiffViewer.tsx +82 -0
- package/src/components/DomainHeader.tsx +237 -0
- package/src/components/EmptyState.tsx +73 -0
- package/src/components/EndOfListFooter.tsx +100 -0
- package/src/components/ErrorBoundary.tsx +688 -0
- package/src/components/HeadersSection.tsx +192 -0
- package/src/components/HighlightText.tsx +100 -0
- package/src/components/Inspector/AnalyticsFilterModal.tsx +1250 -0
- package/src/components/Inspector/AnalyticsTab.tsx +1336 -0
- package/src/components/Inspector/BundleTab.tsx +4731 -0
- package/src/components/Inspector/ConsoleTab.tsx +702 -0
- package/src/components/Inspector/CrashDetail.tsx +941 -0
- package/src/components/Inspector/CrashFilterModal.tsx +721 -0
- package/src/components/Inspector/CrashTab.tsx +871 -0
- package/src/components/Inspector/FabLauncher.tsx +80 -0
- package/src/components/Inspector/InspectorContext.tsx +28 -0
- package/src/components/Inspector/InspectorHeader.tsx +973 -0
- package/src/components/Inspector/LogDetail.tsx +1427 -0
- package/src/components/Inspector/MainScreen.tsx +258 -0
- package/src/components/Inspector/NavigationTracker.tsx +13 -0
- package/src/components/Inspector/NetworkDetail.tsx +794 -0
- package/src/components/Inspector/NetworkTab.tsx +1095 -0
- package/src/components/Inspector/NpmUpdateToast.tsx +392 -0
- package/src/components/Inspector/PerformanceTab.tsx +1894 -0
- package/src/components/Inspector/ReduxDetail.tsx +1651 -0
- package/src/components/Inspector/ReduxTab.tsx +954 -0
- package/src/components/Inspector/SettingsPanel.tsx +3181 -0
- package/src/components/Inspector/TabBar.tsx +187 -0
- package/src/components/Inspector/TelemetryConsentModal.tsx +392 -0
- package/src/components/Inspector/UpdateAvailableModal.tsx +545 -0
- package/src/components/JsonViewer.tsx +486 -0
- package/src/components/LogCard.tsx +491 -0
- package/src/components/LogSyntaxHighlighter.tsx +178 -0
- package/src/components/MetaAccordion.tsx +340 -0
- package/src/components/MiniBarChart.tsx +42 -0
- package/src/components/MiniLineChart.tsx +33 -0
- package/src/components/NetworkIcons.tsx +2118 -0
- package/src/components/SectionHeader.tsx +113 -0
- package/src/components/SegmentedTabs.tsx +83 -0
- package/src/components/Slider.tsx +300 -0
- package/src/components/SourcePageCard.tsx +148 -0
- package/src/components/Toast.tsx +131 -0
- package/src/components/TouchableScale.tsx +91 -0
- package/src/components/TreeNode.tsx +186 -0
- package/src/console.ts +24 -0
- package/src/constants/index.ts +38 -0
- package/src/constants/version.ts +3 -0
- package/src/crash.ts +32 -0
- package/src/customHooks/analyticsLogger.ts +336 -0
- package/src/customHooks/bundleAnalyzer.ts +1231 -0
- package/src/customHooks/consoleLogger.ts +497 -0
- package/src/customHooks/crashHandler.ts +944 -0
- package/src/customHooks/logFilters.ts +32 -0
- package/src/customHooks/networkLogger.ts +419 -0
- package/src/customHooks/performanceTracker.ts +1014 -0
- package/src/customHooks/reduxLogger.ts +406 -0
- package/src/customHooks/useAccordion.tsx +60 -0
- package/src/decorators/index.ts +184 -0
- package/src/helpers/gaAnalyticsRegistry.ts +204 -0
- package/src/helpers/index.ts +860 -0
- package/src/helpers/memoryManager.ts +138 -0
- package/src/helpers/searchQueryParser.ts +283 -0
- package/src/helpers/settingsStore.ts +171 -0
- package/src/helpers/telemetry.ts +505 -0
- package/src/helpers/toast.ts +17 -0
- package/src/i18n/index.ts +69 -0
- package/src/i18n/locales/en.json +1052 -0
- package/src/index.tsx +2336 -0
- package/src/native/NativeInspector.ts +397 -0
- package/src/native/NativeNetworkInspector.ts +24 -0
- package/src/network.ts +22 -0
- package/src/performance.ts +38 -0
- package/src/redux.ts +23 -0
- package/src/styles/AppColors.ts +408 -0
- package/src/styles/AppFonts.ts +8 -0
- package/src/styles/common.ts +209 -0
- package/src/styles/index.ts +1570 -0
- package/src/types/enums.ts +194 -0
- package/src/types/index.ts +34 -0
- package/src/types/interfaces.ts +515 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import React, {useState, useEffect, useRef} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ActivityIndicator,
|
|
4
|
+
Animated,
|
|
5
|
+
Modal,
|
|
6
|
+
Platform,
|
|
7
|
+
Pressable,
|
|
8
|
+
StatusBar,
|
|
9
|
+
StyleSheet,
|
|
10
|
+
Text,
|
|
11
|
+
View,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import {useInspector} from './InspectorContext';
|
|
14
|
+
import ErrorBoundary from '../ErrorBoundary';
|
|
15
|
+
import FabLauncher from './FabLauncher';
|
|
16
|
+
import InspectorHeader from './InspectorHeader';
|
|
17
|
+
import TabBar from './TabBar';
|
|
18
|
+
import NetworkTab from './NetworkTab';
|
|
19
|
+
import NetworkDetail from './NetworkDetail';
|
|
20
|
+
import LogDetail from './LogDetail';
|
|
21
|
+
import ConsoleTab from './ConsoleTab';
|
|
22
|
+
import AnalyticsTab from './AnalyticsTab';
|
|
23
|
+
import AnalyticsDetail from '../AnalyticsDetail';
|
|
24
|
+
import ReduxTab from './ReduxTab';
|
|
25
|
+
import ReduxDetail from './ReduxDetail';
|
|
26
|
+
import BundleTab from './BundleTab';
|
|
27
|
+
import PerformanceTab from './PerformanceTab';
|
|
28
|
+
import CrashTab from './CrashTab';
|
|
29
|
+
import CrashDetail from './CrashDetail';
|
|
30
|
+
import SettingsPanel from './SettingsPanel';
|
|
31
|
+
import TelemetryConsentModal from './TelemetryConsentModal';
|
|
32
|
+
import NpmUpdateToast from './NpmUpdateToast';
|
|
33
|
+
import Toast from '../Toast';
|
|
34
|
+
import styles from '../../styles';
|
|
35
|
+
import {AppColors} from '../../styles/AppColors';
|
|
36
|
+
import NavigationTracker from './NavigationTracker';
|
|
37
|
+
|
|
38
|
+
const MainScreen = () => {
|
|
39
|
+
const {
|
|
40
|
+
visible,
|
|
41
|
+
modalAnimationType,
|
|
42
|
+
closeModal,
|
|
43
|
+
modalHeightPercent,
|
|
44
|
+
selected,
|
|
45
|
+
selectedEvent,
|
|
46
|
+
selectedLog,
|
|
47
|
+
selectedReduxSlice,
|
|
48
|
+
selectedReduxAction,
|
|
49
|
+
selectedCrash,
|
|
50
|
+
settingsPage,
|
|
51
|
+
activeTab,
|
|
52
|
+
isReady,
|
|
53
|
+
isEnabled,
|
|
54
|
+
useNativeFab,
|
|
55
|
+
hasNavigationContext,
|
|
56
|
+
setNavState,
|
|
57
|
+
} = useInspector();
|
|
58
|
+
|
|
59
|
+
const isDetailActive =
|
|
60
|
+
(activeTab === 'apis' && selected != null) ||
|
|
61
|
+
(activeTab === 'analytics' && selectedEvent != null) ||
|
|
62
|
+
(activeTab === 'logs' && selectedLog != null) ||
|
|
63
|
+
(activeTab === 'redux' && (selectedReduxSlice != null || selectedReduxAction != null)) ||
|
|
64
|
+
(activeTab === 'crash' && selectedCrash != null);
|
|
65
|
+
|
|
66
|
+
// ─── 60 FPS Transition Animations ──────────────────────────────────────────
|
|
67
|
+
const detailAnim = useRef(new Animated.Value(0)).current;
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (isDetailActive) {
|
|
70
|
+
detailAnim.setValue(0);
|
|
71
|
+
Animated.spring(detailAnim, {
|
|
72
|
+
toValue: 1,
|
|
73
|
+
friction: 8,
|
|
74
|
+
tension: 65,
|
|
75
|
+
useNativeDriver: true,
|
|
76
|
+
}).start();
|
|
77
|
+
}
|
|
78
|
+
}, [isDetailActive]);
|
|
79
|
+
|
|
80
|
+
const settingsAnim = useRef(new Animated.Value(0)).current;
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (settingsPage !== null) {
|
|
83
|
+
settingsAnim.setValue(0);
|
|
84
|
+
Animated.spring(settingsAnim, {
|
|
85
|
+
toValue: 1,
|
|
86
|
+
friction: 8,
|
|
87
|
+
tension: 65,
|
|
88
|
+
useNativeDriver: true,
|
|
89
|
+
}).start();
|
|
90
|
+
}
|
|
91
|
+
}, [settingsPage !== null]);
|
|
92
|
+
|
|
93
|
+
const tabAnim = useRef(new Animated.Value(1)).current;
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
tabAnim.setValue(0);
|
|
96
|
+
Animated.timing(tabAnim, {
|
|
97
|
+
toValue: 1,
|
|
98
|
+
duration: 150,
|
|
99
|
+
useNativeDriver: true,
|
|
100
|
+
}).start();
|
|
101
|
+
}, [activeTab]);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<>
|
|
105
|
+
{(Platform.OS === 'ios' || Platform.OS === 'android') &&
|
|
106
|
+
isEnabled &&
|
|
107
|
+
!visible &&
|
|
108
|
+
!useNativeFab && <FabLauncher />}
|
|
109
|
+
<Modal
|
|
110
|
+
visible={visible}
|
|
111
|
+
animationType={modalAnimationType}
|
|
112
|
+
transparent
|
|
113
|
+
statusBarTranslucent={true}>
|
|
114
|
+
{visible && (
|
|
115
|
+
<ErrorBoundary onClose={closeModal}>
|
|
116
|
+
<View style={styles.modalBackdrop}>
|
|
117
|
+
<Pressable
|
|
118
|
+
style={styles.modalBackdropPressable}
|
|
119
|
+
onPress={closeModal}
|
|
120
|
+
/>
|
|
121
|
+
<View
|
|
122
|
+
style={[
|
|
123
|
+
styles.modalContentCard,
|
|
124
|
+
{
|
|
125
|
+
height: `${modalHeightPercent}%`,
|
|
126
|
+
borderTopLeftRadius: modalHeightPercent >= 100 ? 0 : 20,
|
|
127
|
+
borderTopRightRadius: modalHeightPercent >= 100 ? 0 : 20,
|
|
128
|
+
},
|
|
129
|
+
]}>
|
|
130
|
+
<StatusBar
|
|
131
|
+
translucent
|
|
132
|
+
backgroundColor="transparent"
|
|
133
|
+
barStyle="light-content"
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
<InspectorHeader />
|
|
137
|
+
|
|
138
|
+
<View style={{flex: 1}}>
|
|
139
|
+
{isReady ? (
|
|
140
|
+
<View style={{flex: 1}}>
|
|
141
|
+
{/* ─── Horizontal Scrollable Tab Bar inside Content ─── */}
|
|
142
|
+
{!isDetailActive && <TabBar />}
|
|
143
|
+
|
|
144
|
+
{/* Persistent List Layer - Never unmounted, preserves 100% native scroll with smooth tab transition */}
|
|
145
|
+
<Animated.View
|
|
146
|
+
style={[
|
|
147
|
+
{
|
|
148
|
+
flex: 1,
|
|
149
|
+
opacity: tabAnim,
|
|
150
|
+
transform: [
|
|
151
|
+
{
|
|
152
|
+
translateY: tabAnim.interpolate({
|
|
153
|
+
inputRange: [0, 1],
|
|
154
|
+
outputRange: [6, 0],
|
|
155
|
+
}),
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
(isDetailActive || settingsPage !== null) && {
|
|
160
|
+
pointerEvents: 'none',
|
|
161
|
+
},
|
|
162
|
+
]}>
|
|
163
|
+
{activeTab === 'apis' && <NetworkTab />}
|
|
164
|
+
{activeTab === 'logs' && <ConsoleTab />}
|
|
165
|
+
{activeTab === 'analytics' && <AnalyticsTab />}
|
|
166
|
+
{activeTab === 'redux' && <ReduxTab />}
|
|
167
|
+
{activeTab === 'bundle' && <BundleTab />}
|
|
168
|
+
{activeTab === 'performance' && <PerformanceTab />}
|
|
169
|
+
{activeTab === 'crash' && <CrashTab />}
|
|
170
|
+
</Animated.View>
|
|
171
|
+
|
|
172
|
+
{/* Detail View Layer - Rendered on top with smooth slide & spring transition */}
|
|
173
|
+
{isDetailActive && (
|
|
174
|
+
<Animated.View
|
|
175
|
+
style={[
|
|
176
|
+
StyleSheet.absoluteFill,
|
|
177
|
+
{
|
|
178
|
+
backgroundColor: AppColors.contentBg,
|
|
179
|
+
opacity: detailAnim,
|
|
180
|
+
transform: [
|
|
181
|
+
{
|
|
182
|
+
translateX: detailAnim.interpolate({
|
|
183
|
+
inputRange: [0, 1],
|
|
184
|
+
outputRange: [32, 0],
|
|
185
|
+
}),
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
]}>
|
|
190
|
+
{activeTab === 'apis' && selected != null && (
|
|
191
|
+
<NetworkDetail />
|
|
192
|
+
)}
|
|
193
|
+
{activeTab === 'analytics' && selectedEvent != null && (
|
|
194
|
+
<AnalyticsDetail event={selectedEvent} />
|
|
195
|
+
)}
|
|
196
|
+
{activeTab === 'logs' && selectedLog != null && (
|
|
197
|
+
<LogDetail />
|
|
198
|
+
)}
|
|
199
|
+
{activeTab === 'redux' && <ReduxDetail />}
|
|
200
|
+
{activeTab === 'crash' && selectedCrash != null && (
|
|
201
|
+
<CrashDetail />
|
|
202
|
+
)}
|
|
203
|
+
</Animated.View>
|
|
204
|
+
)}
|
|
205
|
+
</View>
|
|
206
|
+
) : (
|
|
207
|
+
<View style={styles.empty}>
|
|
208
|
+
<ActivityIndicator size="large" color={AppColors.purple} />
|
|
209
|
+
<Text style={[styles.emptySub, {marginTop: 12}]}>
|
|
210
|
+
Loading logs...
|
|
211
|
+
</Text>
|
|
212
|
+
</View>
|
|
213
|
+
)}
|
|
214
|
+
|
|
215
|
+
{/* Settings Panel Layer - Rendered on top with smooth slide & spring transition */}
|
|
216
|
+
{settingsPage !== null && (
|
|
217
|
+
<Animated.View
|
|
218
|
+
style={[
|
|
219
|
+
StyleSheet.absoluteFill,
|
|
220
|
+
{
|
|
221
|
+
backgroundColor: AppColors.grayBackground,
|
|
222
|
+
opacity: settingsAnim,
|
|
223
|
+
transform: [
|
|
224
|
+
{
|
|
225
|
+
translateY: settingsAnim.interpolate({
|
|
226
|
+
inputRange: [0, 1],
|
|
227
|
+
outputRange: [24, 0],
|
|
228
|
+
}),
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
]}>
|
|
233
|
+
<SettingsPanel />
|
|
234
|
+
</Animated.View>
|
|
235
|
+
)}
|
|
236
|
+
</View>
|
|
237
|
+
|
|
238
|
+
{/* Bottom floating toast notification */}
|
|
239
|
+
<Toast />
|
|
240
|
+
|
|
241
|
+
{/* NPM Version Update Toast with timeout progress bar */}
|
|
242
|
+
<NpmUpdateToast />
|
|
243
|
+
</View>
|
|
244
|
+
</View>
|
|
245
|
+
</ErrorBoundary>
|
|
246
|
+
)}
|
|
247
|
+
{hasNavigationContext && (
|
|
248
|
+
<NavigationTracker onStateChange={setNavState} />
|
|
249
|
+
)}
|
|
250
|
+
</Modal>
|
|
251
|
+
|
|
252
|
+
{/* Anonymous Telemetry Consent Dialog at root viewport */}
|
|
253
|
+
<TelemetryConsentModal />
|
|
254
|
+
</>
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export default MainScreen;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {useEffect} from 'react';
|
|
2
|
+
import {useNavigationState} from '@react-navigation/native';
|
|
3
|
+
import {NavigationTrackerProps} from '../../types';
|
|
4
|
+
|
|
5
|
+
const NavigationTracker = ({onStateChange}: NavigationTrackerProps): null => {
|
|
6
|
+
const navState = useNavigationState(state => state);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
onStateChange(navState);
|
|
9
|
+
}, [navState, onStateChange]);
|
|
10
|
+
return null;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default NavigationTracker;
|