react-native-inapp-inspector 1.1.35 → 2.0.1
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/README.md +123 -101
- package/android/build.gradle +13 -1
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +890 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.kt +17 -0
- package/dist/commonjs/components/ConsoleLogCard.js +5 -5
- package/dist/commonjs/components/CopyButton.js +3 -0
- package/dist/commonjs/components/EndOfListFooter.js +1 -1
- package/dist/commonjs/components/ErrorBoundary.js +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +25 -73
- package/dist/commonjs/components/Inspector/BundleTab.js +671 -189
- package/dist/commonjs/components/Inspector/ConsoleTab.js +110 -99
- package/dist/commonjs/components/Inspector/CrashTab.js +99 -91
- package/dist/commonjs/components/Inspector/InspectorHeader.js +107 -20
- package/dist/commonjs/components/Inspector/MainScreen.js +111 -68
- package/dist/commonjs/components/Inspector/NetworkTab.js +151 -30
- package/dist/commonjs/components/Inspector/PerformanceTab.js +96 -3
- package/dist/commonjs/components/Inspector/ReduxTab.js +18 -10
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1218 -1238
- package/dist/commonjs/components/Inspector/TabBar.js +4 -2
- package/dist/commonjs/components/JsonViewer.js +9 -4
- package/dist/commonjs/components/LogCard.js +31 -1
- package/dist/commonjs/components/LogSyntaxHighlighter.d.ts +16 -0
- package/dist/commonjs/components/LogSyntaxHighlighter.js +130 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +3 -0
- package/dist/commonjs/components/NetworkIcons.js +15 -1
- package/dist/commonjs/components/Slider.d.ts +13 -0
- package/dist/commonjs/components/Slider.js +261 -0
- package/dist/commonjs/components/TouchableScale.d.ts +1 -0
- package/dist/commonjs/components/TouchableScale.js +30 -32
- package/dist/commonjs/constants/index.d.ts +1 -2
- package/dist/commonjs/constants/index.js +4 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +4 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +8 -6
- package/dist/commonjs/customHooks/crashHandler.js +8 -1
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +25 -1
- package/dist/commonjs/helpers/searchQueryParser.d.ts +6 -0
- package/dist/commonjs/helpers/searchQueryParser.js +236 -0
- package/dist/commonjs/helpers/settingsStore.d.ts +9 -0
- package/dist/commonjs/helpers/settingsStore.js +59 -3
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +220 -43
- package/dist/commonjs/native/NativeInspector.d.ts +125 -0
- package/dist/commonjs/native/NativeInspector.js +313 -0
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/commonjs/native/NativeNetworkInspector.js +4 -0
- package/dist/commonjs/styles/index.js +41 -41
- package/dist/commonjs/types/enums.d.ts +1 -1
- package/dist/commonjs/types/interfaces.d.ts +9 -0
- package/dist/esm/components/ConsoleLogCard.js +5 -5
- package/dist/esm/components/CopyButton.js +3 -0
- package/dist/esm/components/EndOfListFooter.js +2 -2
- package/dist/esm/components/ErrorBoundary.js +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +27 -75
- package/dist/esm/components/Inspector/BundleTab.js +671 -189
- package/dist/esm/components/Inspector/ConsoleTab.js +111 -100
- package/dist/esm/components/Inspector/CrashTab.js +99 -91
- package/dist/esm/components/Inspector/InspectorHeader.js +108 -21
- package/dist/esm/components/Inspector/MainScreen.js +113 -70
- package/dist/esm/components/Inspector/NetworkTab.js +152 -31
- package/dist/esm/components/Inspector/PerformanceTab.js +96 -3
- package/dist/esm/components/Inspector/ReduxTab.js +18 -10
- package/dist/esm/components/Inspector/SettingsPanel.js +1222 -1242
- package/dist/esm/components/Inspector/TabBar.js +4 -2
- package/dist/esm/components/JsonViewer.js +9 -4
- package/dist/esm/components/LogCard.js +32 -2
- package/dist/esm/components/LogSyntaxHighlighter.d.ts +16 -0
- package/dist/esm/components/LogSyntaxHighlighter.js +123 -0
- package/dist/esm/components/NetworkIcons.d.ts +3 -0
- package/dist/esm/components/NetworkIcons.js +11 -0
- package/dist/esm/components/Slider.d.ts +13 -0
- package/dist/esm/components/Slider.js +222 -0
- package/dist/esm/components/TouchableScale.d.ts +1 -0
- package/dist/esm/components/TouchableScale.js +31 -33
- package/dist/esm/constants/index.d.ts +1 -2
- package/dist/esm/constants/index.js +4 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +4 -0
- package/dist/esm/customHooks/analyticsLogger.js +6 -5
- package/dist/esm/customHooks/crashHandler.js +8 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +11 -1
- package/dist/esm/helpers/searchQueryParser.d.ts +6 -0
- package/dist/esm/helpers/searchQueryParser.js +233 -0
- package/dist/esm/helpers/settingsStore.d.ts +9 -0
- package/dist/esm/helpers/settingsStore.js +58 -3
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +207 -44
- package/dist/esm/native/NativeInspector.d.ts +125 -0
- package/dist/esm/native/NativeInspector.js +289 -0
- package/dist/esm/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/esm/native/NativeNetworkInspector.js +2 -0
- package/dist/esm/styles/index.js +41 -41
- package/dist/esm/types/enums.d.ts +1 -1
- package/dist/esm/types/interfaces.d.ts +9 -0
- package/ios/NetworkInspectorModule.h +6 -0
- package/ios/NetworkInspectorModule.m +760 -5
- package/package.json +13 -2
- package/react-native-inapp-inspector.podspec +7 -2
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +0 -97
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.java +0 -28
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React, { useCallback, useState, useMemo } from 'react';
|
|
1
|
+
import React, { useCallback, useState, useMemo, useEffect } from 'react';
|
|
2
2
|
import { FlatList, Pressable, Text, TextInput, TouchableOpacity, View, } from 'react-native';
|
|
3
3
|
import { animateNextLayout, useInspector } from './InspectorContext';
|
|
4
4
|
import AnalyticsEventCard from '../AnalyticsEventCard';
|
|
5
|
-
import AnalyticsDetail from '../AnalyticsDetail';
|
|
6
5
|
import AnalyticsFilterModal from './AnalyticsFilterModal';
|
|
7
6
|
import EndOfListFooter from '../EndOfListFooter';
|
|
8
7
|
import styles from '../../styles';
|
|
@@ -13,7 +12,7 @@ import Svg, { Path, Rect, Line, Circle, G, Defs, LinearGradient as SvgLinearGrad
|
|
|
13
12
|
import TouchableScale from '../TouchableScale';
|
|
14
13
|
import { getCurrentUserId, getCurrentUserProperties, getDefaultEventParameters, getCollectionEnabled, } from '../../customHooks/analyticsLogger';
|
|
15
14
|
import { getEventCategory, } from '../../helpers';
|
|
16
|
-
import { LayersIcon,
|
|
15
|
+
import { LayersIcon, SearchIcon, ClearIcon, TrashIcon, EmptyRadarIcon, HeaderPauseIcon, FilterIcon, CartIcon, GlobeIcon, BoltIcon, SparkleIcon, PinIcon, MoneyIcon, } from '../NetworkIcons';
|
|
17
16
|
const AnalyticsHeader = React.memo(() => {
|
|
18
17
|
const { t } = useTranslation();
|
|
19
18
|
const { analyticsEvents, filteredAnalyticsEvents, analyticsFilters, setAnalyticsFilters, analyticsHeaderExpanded, setAnalyticsHeaderExpanded, } = useInspector();
|
|
@@ -21,6 +20,10 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
21
20
|
const userProperties = getCurrentUserProperties();
|
|
22
21
|
const defaultParams = getDefaultEventParameters();
|
|
23
22
|
const isTrackingEnabled = getCollectionEnabled();
|
|
23
|
+
// If there are no analytics events in the session, hide the graph, category breakdown, and realtime card
|
|
24
|
+
if (analyticsEvents.length === 0) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
24
27
|
const hasUserProps = Object.keys(userProperties).length > 0;
|
|
25
28
|
const hasDefaultParams = Object.keys(defaultParams).length > 0;
|
|
26
29
|
const totalEvents = filteredAnalyticsEvents.length;
|
|
@@ -119,16 +122,25 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
119
122
|
return { ...prev, categories: nextCategories };
|
|
120
123
|
});
|
|
121
124
|
};
|
|
122
|
-
// 12-Bucket GA4 Realtime Stacked Histogram & Spline Wave Graph (
|
|
125
|
+
// 12-Bucket GA4 Realtime Stacked Histogram & Spline Wave Graph (60s live rolling stream)
|
|
123
126
|
const BUCKET_COUNT = 12;
|
|
124
127
|
const chartHeight = 64;
|
|
125
128
|
const svgWidth = 320;
|
|
126
129
|
const [selectedBucketIdx, setSelectedBucketIdx] = useState(null);
|
|
130
|
+
const [liveTick, setLiveTick] = useState(0);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!isTrackingEnabled)
|
|
133
|
+
return;
|
|
134
|
+
const interval = setInterval(() => {
|
|
135
|
+
setLiveTick(t => (t + 1) % 100000);
|
|
136
|
+
}, 1000);
|
|
137
|
+
return () => clearInterval(interval);
|
|
138
|
+
}, [isTrackingEnabled]);
|
|
127
139
|
const histogramData = useMemo(() => {
|
|
128
140
|
const buckets = [];
|
|
129
141
|
const now = Date.now();
|
|
130
|
-
const windowMs = 60000; // 60s window
|
|
131
|
-
const bucketDuration = windowMs / BUCKET_COUNT;
|
|
142
|
+
const windowMs = 60000; // 60s live rolling window
|
|
143
|
+
const bucketDuration = windowMs / BUCKET_COUNT; // 5s per bucket
|
|
132
144
|
for (let i = 0; i < BUCKET_COUNT; i++) {
|
|
133
145
|
const bucketAgeSec = Math.round(((BUCKET_COUNT - 1 - i) * bucketDuration) / 1000);
|
|
134
146
|
buckets.push({
|
|
@@ -193,7 +205,7 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
193
205
|
peakVal,
|
|
194
206
|
eventRate,
|
|
195
207
|
};
|
|
196
|
-
}, [filteredAnalyticsEvents, chartHeight, svgWidth, t]);
|
|
208
|
+
}, [filteredAnalyticsEvents, chartHeight, svgWidth, liveTick, t]);
|
|
197
209
|
const selectedBucket = selectedBucketIdx != null ? histogramData.buckets[selectedBucketIdx] : null;
|
|
198
210
|
return (<View style={styles.analyticsHeaderCard}>
|
|
199
211
|
{/* ── 1. Top Header Row (GA4 Style) ─────────────────────────────────── */}
|
|
@@ -265,7 +277,7 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
265
277
|
}}/>)}
|
|
266
278
|
</View>
|
|
267
279
|
|
|
268
|
-
{/* Multi-Select Category Buttons
|
|
280
|
+
{/* Multi-Select Category Buttons */}
|
|
269
281
|
<View style={{
|
|
270
282
|
flexDirection: 'row',
|
|
271
283
|
flexWrap: 'wrap',
|
|
@@ -294,18 +306,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
294
306
|
elevation: 2,
|
|
295
307
|
},
|
|
296
308
|
]}>
|
|
297
|
-
<View style={{
|
|
298
|
-
width: 12,
|
|
299
|
-
height: 12,
|
|
300
|
-
borderRadius: 3,
|
|
301
|
-
borderWidth: 1.2,
|
|
302
|
-
borderColor: isAllSelected ? AppColors.white : AppColors.indigo400,
|
|
303
|
-
backgroundColor: isAllSelected ? AppColors.white : 'transparent',
|
|
304
|
-
alignItems: 'center',
|
|
305
|
-
justifyContent: 'center',
|
|
306
|
-
}}>
|
|
307
|
-
{isAllSelected && <CheckIcon color={AppColors.indigo600Alt} size={8}/>}
|
|
308
|
-
</View>
|
|
309
309
|
<LayersIcon color={isAllSelected ? AppColors.white : AppColors.indigo600Alt} size={11}/>
|
|
310
310
|
<Text style={{
|
|
311
311
|
fontFamily: AppFonts.interBold,
|
|
@@ -341,18 +341,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
341
341
|
elevation: 2,
|
|
342
342
|
},
|
|
343
343
|
]}>
|
|
344
|
-
<View style={{
|
|
345
|
-
width: 12,
|
|
346
|
-
height: 12,
|
|
347
|
-
borderRadius: 3,
|
|
348
|
-
borderWidth: 1.2,
|
|
349
|
-
borderColor: isSelected ? AppColors.white : AppColors.amber500,
|
|
350
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
351
|
-
alignItems: 'center',
|
|
352
|
-
justifyContent: 'center',
|
|
353
|
-
}}>
|
|
354
|
-
{isSelected && <CheckIcon color={AppColors.amber600} size={8}/>}
|
|
355
|
-
</View>
|
|
356
344
|
<CartIcon color={isSelected ? AppColors.white : AppColors.amber700} size={11}/>
|
|
357
345
|
<Text style={{
|
|
358
346
|
fontFamily: AppFonts.interBold,
|
|
@@ -388,18 +376,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
388
376
|
elevation: 2,
|
|
389
377
|
},
|
|
390
378
|
]}>
|
|
391
|
-
<View style={{
|
|
392
|
-
width: 12,
|
|
393
|
-
height: 12,
|
|
394
|
-
borderRadius: 3,
|
|
395
|
-
borderWidth: 1.2,
|
|
396
|
-
borderColor: isSelected ? AppColors.white : AppColors.sky400,
|
|
397
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
398
|
-
alignItems: 'center',
|
|
399
|
-
justifyContent: 'center',
|
|
400
|
-
}}>
|
|
401
|
-
{isSelected && <CheckIcon color={AppColors.sky600} size={8}/>}
|
|
402
|
-
</View>
|
|
403
379
|
<GlobeIcon color={isSelected ? AppColors.white : AppColors.sky600} size={11}/>
|
|
404
380
|
<Text style={{
|
|
405
381
|
fontFamily: AppFonts.interBold,
|
|
@@ -435,18 +411,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
435
411
|
elevation: 2,
|
|
436
412
|
},
|
|
437
413
|
]}>
|
|
438
|
-
<View style={{
|
|
439
|
-
width: 12,
|
|
440
|
-
height: 12,
|
|
441
|
-
borderRadius: 3,
|
|
442
|
-
borderWidth: 1.2,
|
|
443
|
-
borderColor: isSelected ? AppColors.white : AppColors.purple400,
|
|
444
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
445
|
-
alignItems: 'center',
|
|
446
|
-
justifyContent: 'center',
|
|
447
|
-
}}>
|
|
448
|
-
{isSelected && <CheckIcon color={AppColors.violet600} size={8}/>}
|
|
449
|
-
</View>
|
|
450
414
|
<BoltIcon color={isSelected ? AppColors.white : AppColors.purple} size={11}/>
|
|
451
415
|
<Text style={{
|
|
452
416
|
fontFamily: AppFonts.interBold,
|
|
@@ -482,18 +446,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
482
446
|
elevation: 2,
|
|
483
447
|
},
|
|
484
448
|
]}>
|
|
485
|
-
<View style={{
|
|
486
|
-
width: 12,
|
|
487
|
-
height: 12,
|
|
488
|
-
borderRadius: 3,
|
|
489
|
-
borderWidth: 1.2,
|
|
490
|
-
borderColor: isSelected ? AppColors.white : AppColors.pink400,
|
|
491
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
492
|
-
alignItems: 'center',
|
|
493
|
-
justifyContent: 'center',
|
|
494
|
-
}}>
|
|
495
|
-
{isSelected && <CheckIcon color={AppColors.pink600} size={8}/>}
|
|
496
|
-
</View>
|
|
497
449
|
<SparkleIcon color={isSelected ? AppColors.white : AppColors.brandPurple} size={11}/>
|
|
498
450
|
<Text style={{
|
|
499
451
|
fontFamily: AppFonts.interBold,
|
|
@@ -590,8 +542,8 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
590
542
|
</View>
|
|
591
543
|
|
|
592
544
|
{/* ── Crashlytics-Style Multi-Bar Histogram with Trendline Overlay ── */}
|
|
593
|
-
<View style={{ height: chartHeight, position: 'relative' }}>
|
|
594
|
-
<Svg width="100%" height={chartHeight} viewBox={`0 0 ${svgWidth} ${chartHeight}`}>
|
|
545
|
+
<View style={{ height: chartHeight, position: 'relative', overflow: 'hidden', borderRadius: 8 }}>
|
|
546
|
+
<Svg width="100%" height={chartHeight} viewBox={`0 0 ${svgWidth} ${chartHeight}`} preserveAspectRatio="none">
|
|
595
547
|
<Defs>
|
|
596
548
|
<SvgLinearGradient id="crashlyticsBarGrad" x1="0" y1="0" x2="0" y2="1">
|
|
597
549
|
<Stop offset="0%" stopColor="#8B5CF6" stopOpacity="0.9"/>
|
|
@@ -689,7 +641,7 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
689
641
|
</View>
|
|
690
642
|
</View>)}
|
|
691
643
|
|
|
692
|
-
{/* Timeline Axis Labels */}
|
|
644
|
+
{/* Timeline Axis Labels (60s Realtime Rolling Stream) */}
|
|
693
645
|
<View style={{
|
|
694
646
|
flexDirection: 'row',
|
|
695
647
|
justifyContent: 'space-between',
|
|
@@ -701,21 +653,21 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
701
653
|
fontSize: 8.5,
|
|
702
654
|
color: AppColors.grayTextWeak,
|
|
703
655
|
}}>
|
|
704
|
-
|
|
656
|
+
-60s
|
|
705
657
|
</Text>
|
|
706
658
|
<Text style={{
|
|
707
659
|
fontFamily: AppFonts.interMedium,
|
|
708
660
|
fontSize: 8.5,
|
|
709
661
|
color: AppColors.grayTextWeak,
|
|
710
662
|
}}>
|
|
711
|
-
|
|
663
|
+
-40s
|
|
712
664
|
</Text>
|
|
713
665
|
<Text style={{
|
|
714
666
|
fontFamily: AppFonts.interMedium,
|
|
715
667
|
fontSize: 8.5,
|
|
716
668
|
color: AppColors.grayTextWeak,
|
|
717
669
|
}}>
|
|
718
|
-
|
|
670
|
+
-20s
|
|
719
671
|
</Text>
|
|
720
672
|
<Text style={{
|
|
721
673
|
fontFamily: AppFonts.interBold,
|
|
@@ -955,7 +907,7 @@ const AnalyticsTab = React.memo(() => {
|
|
|
955
907
|
<AnalyticsFilterModal visible={isFilterModalOpen} onClose={() => setIsFilterModalOpen(false)}/>
|
|
956
908
|
|
|
957
909
|
<View style={{ flex: 1 }} onLayout={() => setIsAnalyticsLayoutReady(true)}>
|
|
958
|
-
{
|
|
910
|
+
{isAnalyticsLayoutReady ? (<FlatList data={filteredAnalyticsEvents} keyExtractor={keyExtractor} ListHeaderComponent={AnalyticsHeader} renderItem={renderItem} initialNumToRender={12} maxToRenderPerBatch={8} windowSize={5} removeClippedSubviews={true} renderToHardwareTextureAndroid={true} ListEmptyComponent={<View style={styles.emptyContainer}>
|
|
959
911
|
<View style={styles.emptyIconWrap}>
|
|
960
912
|
<EmptyRadarIcon color={AppColors.purple} size={32}/>
|
|
961
913
|
</View>
|