react-native-inapp-inspector 2.0.0 → 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/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +10 -24
- package/dist/commonjs/components/ConsoleLogCard.js +5 -5
- package/dist/commonjs/components/EndOfListFooter.js +1 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +19 -71
- package/dist/commonjs/components/Inspector/BundleTab.js +670 -188
- package/dist/commonjs/components/Inspector/ConsoleTab.js +109 -98
- package/dist/commonjs/components/Inspector/CrashTab.js +2 -1
- package/dist/commonjs/components/Inspector/InspectorHeader.js +102 -19
- package/dist/commonjs/components/Inspector/MainScreen.js +147 -17
- package/dist/commonjs/components/Inspector/NetworkTab.js +104 -20
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1111 -1385
- package/dist/commonjs/components/Inspector/TabBar.js +3 -4
- 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 +2 -0
- package/dist/commonjs/components/NetworkIcons.js +10 -1
- package/dist/commonjs/components/Slider.d.ts +13 -0
- package/dist/commonjs/components/Slider.js +261 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +15 -0
- package/dist/commonjs/helpers/searchQueryParser.d.ts +6 -0
- package/dist/commonjs/helpers/searchQueryParser.js +236 -0
- package/dist/commonjs/helpers/settingsStore.js +13 -13
- package/dist/commonjs/index.js +7 -20
- package/dist/commonjs/styles/index.js +35 -35
- package/dist/esm/components/ConsoleLogCard.js +5 -5
- package/dist/esm/components/EndOfListFooter.js +2 -2
- package/dist/esm/components/Inspector/AnalyticsTab.js +21 -73
- package/dist/esm/components/Inspector/BundleTab.js +670 -188
- package/dist/esm/components/Inspector/ConsoleTab.js +110 -99
- package/dist/esm/components/Inspector/CrashTab.js +2 -1
- package/dist/esm/components/Inspector/InspectorHeader.js +103 -20
- package/dist/esm/components/Inspector/MainScreen.js +115 -18
- package/dist/esm/components/Inspector/NetworkTab.js +105 -21
- package/dist/esm/components/Inspector/SettingsPanel.js +1114 -1388
- package/dist/esm/components/Inspector/TabBar.js +4 -5
- 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 +2 -0
- package/dist/esm/components/NetworkIcons.js +7 -0
- package/dist/esm/components/Slider.d.ts +13 -0
- package/dist/esm/components/Slider.js +222 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.js +1 -1
- package/dist/esm/customHooks/crashHandler.js +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/searchQueryParser.d.ts +6 -0
- package/dist/esm/helpers/searchQueryParser.js +233 -0
- package/dist/esm/helpers/settingsStore.js +13 -13
- package/dist/esm/index.js +8 -21
- package/dist/esm/styles/index.js +35 -35
- package/ios/NetworkInspectorModule.m +81 -41
- package/package.json +1 -1
|
@@ -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();
|
|
@@ -123,16 +122,25 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
123
122
|
return { ...prev, categories: nextCategories };
|
|
124
123
|
});
|
|
125
124
|
};
|
|
126
|
-
// 12-Bucket GA4 Realtime Stacked Histogram & Spline Wave Graph (
|
|
125
|
+
// 12-Bucket GA4 Realtime Stacked Histogram & Spline Wave Graph (60s live rolling stream)
|
|
127
126
|
const BUCKET_COUNT = 12;
|
|
128
127
|
const chartHeight = 64;
|
|
129
128
|
const svgWidth = 320;
|
|
130
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]);
|
|
131
139
|
const histogramData = useMemo(() => {
|
|
132
140
|
const buckets = [];
|
|
133
141
|
const now = Date.now();
|
|
134
|
-
const windowMs = 60000; // 60s window
|
|
135
|
-
const bucketDuration = windowMs / BUCKET_COUNT;
|
|
142
|
+
const windowMs = 60000; // 60s live rolling window
|
|
143
|
+
const bucketDuration = windowMs / BUCKET_COUNT; // 5s per bucket
|
|
136
144
|
for (let i = 0; i < BUCKET_COUNT; i++) {
|
|
137
145
|
const bucketAgeSec = Math.round(((BUCKET_COUNT - 1 - i) * bucketDuration) / 1000);
|
|
138
146
|
buckets.push({
|
|
@@ -197,7 +205,7 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
197
205
|
peakVal,
|
|
198
206
|
eventRate,
|
|
199
207
|
};
|
|
200
|
-
}, [filteredAnalyticsEvents, chartHeight, svgWidth, t]);
|
|
208
|
+
}, [filteredAnalyticsEvents, chartHeight, svgWidth, liveTick, t]);
|
|
201
209
|
const selectedBucket = selectedBucketIdx != null ? histogramData.buckets[selectedBucketIdx] : null;
|
|
202
210
|
return (<View style={styles.analyticsHeaderCard}>
|
|
203
211
|
{/* ── 1. Top Header Row (GA4 Style) ─────────────────────────────────── */}
|
|
@@ -269,7 +277,7 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
269
277
|
}}/>)}
|
|
270
278
|
</View>
|
|
271
279
|
|
|
272
|
-
{/* Multi-Select Category Buttons
|
|
280
|
+
{/* Multi-Select Category Buttons */}
|
|
273
281
|
<View style={{
|
|
274
282
|
flexDirection: 'row',
|
|
275
283
|
flexWrap: 'wrap',
|
|
@@ -298,18 +306,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
298
306
|
elevation: 2,
|
|
299
307
|
},
|
|
300
308
|
]}>
|
|
301
|
-
<View style={{
|
|
302
|
-
width: 12,
|
|
303
|
-
height: 12,
|
|
304
|
-
borderRadius: 3,
|
|
305
|
-
borderWidth: 1.2,
|
|
306
|
-
borderColor: isAllSelected ? AppColors.white : AppColors.indigo400,
|
|
307
|
-
backgroundColor: isAllSelected ? AppColors.white : 'transparent',
|
|
308
|
-
alignItems: 'center',
|
|
309
|
-
justifyContent: 'center',
|
|
310
|
-
}}>
|
|
311
|
-
{isAllSelected && <CheckIcon color={AppColors.indigo600Alt} size={8}/>}
|
|
312
|
-
</View>
|
|
313
309
|
<LayersIcon color={isAllSelected ? AppColors.white : AppColors.indigo600Alt} size={11}/>
|
|
314
310
|
<Text style={{
|
|
315
311
|
fontFamily: AppFonts.interBold,
|
|
@@ -345,18 +341,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
345
341
|
elevation: 2,
|
|
346
342
|
},
|
|
347
343
|
]}>
|
|
348
|
-
<View style={{
|
|
349
|
-
width: 12,
|
|
350
|
-
height: 12,
|
|
351
|
-
borderRadius: 3,
|
|
352
|
-
borderWidth: 1.2,
|
|
353
|
-
borderColor: isSelected ? AppColors.white : AppColors.amber500,
|
|
354
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
355
|
-
alignItems: 'center',
|
|
356
|
-
justifyContent: 'center',
|
|
357
|
-
}}>
|
|
358
|
-
{isSelected && <CheckIcon color={AppColors.amber600} size={8}/>}
|
|
359
|
-
</View>
|
|
360
344
|
<CartIcon color={isSelected ? AppColors.white : AppColors.amber700} size={11}/>
|
|
361
345
|
<Text style={{
|
|
362
346
|
fontFamily: AppFonts.interBold,
|
|
@@ -392,18 +376,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
392
376
|
elevation: 2,
|
|
393
377
|
},
|
|
394
378
|
]}>
|
|
395
|
-
<View style={{
|
|
396
|
-
width: 12,
|
|
397
|
-
height: 12,
|
|
398
|
-
borderRadius: 3,
|
|
399
|
-
borderWidth: 1.2,
|
|
400
|
-
borderColor: isSelected ? AppColors.white : AppColors.sky400,
|
|
401
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
402
|
-
alignItems: 'center',
|
|
403
|
-
justifyContent: 'center',
|
|
404
|
-
}}>
|
|
405
|
-
{isSelected && <CheckIcon color={AppColors.sky600} size={8}/>}
|
|
406
|
-
</View>
|
|
407
379
|
<GlobeIcon color={isSelected ? AppColors.white : AppColors.sky600} size={11}/>
|
|
408
380
|
<Text style={{
|
|
409
381
|
fontFamily: AppFonts.interBold,
|
|
@@ -439,18 +411,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
439
411
|
elevation: 2,
|
|
440
412
|
},
|
|
441
413
|
]}>
|
|
442
|
-
<View style={{
|
|
443
|
-
width: 12,
|
|
444
|
-
height: 12,
|
|
445
|
-
borderRadius: 3,
|
|
446
|
-
borderWidth: 1.2,
|
|
447
|
-
borderColor: isSelected ? AppColors.white : AppColors.purple400,
|
|
448
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
449
|
-
alignItems: 'center',
|
|
450
|
-
justifyContent: 'center',
|
|
451
|
-
}}>
|
|
452
|
-
{isSelected && <CheckIcon color={AppColors.violet600} size={8}/>}
|
|
453
|
-
</View>
|
|
454
414
|
<BoltIcon color={isSelected ? AppColors.white : AppColors.purple} size={11}/>
|
|
455
415
|
<Text style={{
|
|
456
416
|
fontFamily: AppFonts.interBold,
|
|
@@ -486,18 +446,6 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
486
446
|
elevation: 2,
|
|
487
447
|
},
|
|
488
448
|
]}>
|
|
489
|
-
<View style={{
|
|
490
|
-
width: 12,
|
|
491
|
-
height: 12,
|
|
492
|
-
borderRadius: 3,
|
|
493
|
-
borderWidth: 1.2,
|
|
494
|
-
borderColor: isSelected ? AppColors.white : AppColors.pink400,
|
|
495
|
-
backgroundColor: isSelected ? AppColors.white : 'transparent',
|
|
496
|
-
alignItems: 'center',
|
|
497
|
-
justifyContent: 'center',
|
|
498
|
-
}}>
|
|
499
|
-
{isSelected && <CheckIcon color={AppColors.pink600} size={8}/>}
|
|
500
|
-
</View>
|
|
501
449
|
<SparkleIcon color={isSelected ? AppColors.white : AppColors.brandPurple} size={11}/>
|
|
502
450
|
<Text style={{
|
|
503
451
|
fontFamily: AppFonts.interBold,
|
|
@@ -693,7 +641,7 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
693
641
|
</View>
|
|
694
642
|
</View>)}
|
|
695
643
|
|
|
696
|
-
{/* Timeline Axis Labels */}
|
|
644
|
+
{/* Timeline Axis Labels (60s Realtime Rolling Stream) */}
|
|
697
645
|
<View style={{
|
|
698
646
|
flexDirection: 'row',
|
|
699
647
|
justifyContent: 'space-between',
|
|
@@ -705,21 +653,21 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
705
653
|
fontSize: 8.5,
|
|
706
654
|
color: AppColors.grayTextWeak,
|
|
707
655
|
}}>
|
|
708
|
-
|
|
656
|
+
-60s
|
|
709
657
|
</Text>
|
|
710
658
|
<Text style={{
|
|
711
659
|
fontFamily: AppFonts.interMedium,
|
|
712
660
|
fontSize: 8.5,
|
|
713
661
|
color: AppColors.grayTextWeak,
|
|
714
662
|
}}>
|
|
715
|
-
|
|
663
|
+
-40s
|
|
716
664
|
</Text>
|
|
717
665
|
<Text style={{
|
|
718
666
|
fontFamily: AppFonts.interMedium,
|
|
719
667
|
fontSize: 8.5,
|
|
720
668
|
color: AppColors.grayTextWeak,
|
|
721
669
|
}}>
|
|
722
|
-
|
|
670
|
+
-20s
|
|
723
671
|
</Text>
|
|
724
672
|
<Text style={{
|
|
725
673
|
fontFamily: AppFonts.interBold,
|
|
@@ -959,7 +907,7 @@ const AnalyticsTab = React.memo(() => {
|
|
|
959
907
|
<AnalyticsFilterModal visible={isFilterModalOpen} onClose={() => setIsFilterModalOpen(false)}/>
|
|
960
908
|
|
|
961
909
|
<View style={{ flex: 1 }} onLayout={() => setIsAnalyticsLayoutReady(true)}>
|
|
962
|
-
{
|
|
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}>
|
|
963
911
|
<View style={styles.emptyIconWrap}>
|
|
964
912
|
<EmptyRadarIcon color={AppColors.purple} size={32}/>
|
|
965
913
|
</View>
|