react-native-inapp-inspector 1.1.12 → 1.1.13
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/components/AnalyticsDetail.js +64 -21
- package/dist/commonjs/components/HighlightText.js +1 -1
- package/dist/commonjs/components/JsonViewer.d.ts +3 -1
- package/dist/commonjs/components/JsonViewer.js +327 -9
- package/dist/commonjs/components/MetaAccordion.d.ts +10 -1
- package/dist/commonjs/components/MetaAccordion.js +121 -24
- package/dist/commonjs/components/NetworkIcons.d.ts +1 -0
- package/dist/commonjs/components/NetworkIcons.js +8 -1
- package/dist/commonjs/components/ReduxTreeView.d.ts +12 -3
- package/dist/commonjs/components/ReduxTreeView.js +1096 -278
- package/dist/commonjs/components/SectionHeader.d.ts +1 -1
- package/dist/commonjs/components/SectionHeader.js +7 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/reduxLogger.js +2 -0
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +15 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +4 -0
- package/dist/commonjs/index.js +110 -91
- package/dist/commonjs/types/index.d.ts +3 -0
- package/dist/esm/components/AnalyticsDetail.js +64 -21
- package/dist/esm/components/HighlightText.js +3 -3
- package/dist/esm/components/JsonViewer.d.ts +3 -1
- package/dist/esm/components/JsonViewer.js +295 -10
- package/dist/esm/components/MetaAccordion.d.ts +10 -1
- package/dist/esm/components/MetaAccordion.js +90 -26
- package/dist/esm/components/NetworkIcons.d.ts +1 -0
- package/dist/esm/components/NetworkIcons.js +6 -0
- package/dist/esm/components/ReduxTreeView.d.ts +12 -3
- package/dist/esm/components/ReduxTreeView.js +1095 -279
- package/dist/esm/components/SectionHeader.d.ts +1 -1
- package/dist/esm/components/SectionHeader.js +8 -2
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
- package/dist/esm/customHooks/reduxLogger.js +2 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +14 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +3 -0
- package/dist/esm/index.js +111 -92
- package/dist/esm/types/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SectionHeaderProps } from '../types';
|
|
3
|
-
declare const SectionHeader: ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, }: SectionHeaderProps) => React.JSX.Element;
|
|
3
|
+
declare const SectionHeader: ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, showSearch, isSearching, onToggleSearch, }: SectionHeaderProps) => React.JSX.Element;
|
|
4
4
|
export default SectionHeader;
|
|
@@ -6,10 +6,10 @@ import { AppColors } from '../styles/AppColors';
|
|
|
6
6
|
import CopyButton from './CopyButton';
|
|
7
7
|
import TouchableScale from './TouchableScale';
|
|
8
8
|
// Assets
|
|
9
|
-
import { RequestIcon, ResponseIcon, HeadersIcon, DiffIcon, ChevronIcon, } from './NetworkIcons';
|
|
9
|
+
import { RequestIcon, ResponseIcon, HeadersIcon, DiffIcon, ChevronIcon, SearchIcon, } from './NetworkIcons';
|
|
10
10
|
// Stylesheet
|
|
11
11
|
import styles from '../styles';
|
|
12
|
-
const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, }) => {
|
|
12
|
+
const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, showSearch, isSearching, onToggleSearch, }) => {
|
|
13
13
|
const isOpen = expanded === undefined ? false : !!expanded;
|
|
14
14
|
const chevronAnim = useRef(new Animated.Value(isOpen ? 1 : 0)).current;
|
|
15
15
|
useEffect(() => {
|
|
@@ -30,6 +30,12 @@ const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDif
|
|
|
30
30
|
<Text style={styles.sectionTitle}>{title}</Text>
|
|
31
31
|
</Pressable>
|
|
32
32
|
<View style={styles.sectionHeaderActions}>
|
|
33
|
+
{showSearch && (<TouchableScale onPress={onToggleSearch} hitSlop={12} style={[
|
|
34
|
+
styles.iconSquareBtn,
|
|
35
|
+
isSearching ? styles.iconSquareBtnActive : null,
|
|
36
|
+
]}>
|
|
37
|
+
<SearchIcon color={isSearching ? AppColors.skyBlue : AppColors.grayTextWeak} size={14}/>
|
|
38
|
+
</TouchableScale>)}
|
|
33
39
|
{showDiff && (<TouchableScale onPress={onToggleDiff} hitSlop={12} style={[
|
|
34
40
|
styles.iconSquareBtn,
|
|
35
41
|
isDiffing ? styles.iconSquareBtnActive : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.1.
|
|
1
|
+
export declare const LIB_VERSION = "1.1.13";
|
|
@@ -21,3 +21,4 @@ export declare const isAllValuesEmpty: (obj: Record<string, any>) => boolean;
|
|
|
21
21
|
export declare const formatDateTimeToAnalytics: (ts: number) => string;
|
|
22
22
|
export declare const getBundleIdentifier: () => string;
|
|
23
23
|
export declare const getAppName: () => string;
|
|
24
|
+
export declare const handleOpenExternalLink: (url: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Clipboard, Platform, ToastAndroid, Alert, NativeModules } from 'react-native';
|
|
1
|
+
import { Clipboard, Platform, ToastAndroid, Alert, NativeModules, Linking } from 'react-native';
|
|
2
2
|
// Stylesheet
|
|
3
3
|
import { AppColors } from '../styles/AppColors';
|
|
4
4
|
// Constants
|
|
@@ -302,3 +302,16 @@ export const getAppName = () => {
|
|
|
302
302
|
}
|
|
303
303
|
return 'App';
|
|
304
304
|
};
|
|
305
|
+
export const handleOpenExternalLink = (url) => {
|
|
306
|
+
if (!url)
|
|
307
|
+
return;
|
|
308
|
+
Alert.alert('Open Link', `Do you want to open this link in your web browser?\n\n${url}`, [
|
|
309
|
+
{ text: 'Cancel', style: 'cancel' },
|
|
310
|
+
{
|
|
311
|
+
text: 'Open',
|
|
312
|
+
onPress: () => {
|
|
313
|
+
Linking.openURL(url).catch(() => { });
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
]);
|
|
317
|
+
};
|
|
@@ -27,3 +27,4 @@ export declare function loadSettings(): Promise<PersistedSettings>;
|
|
|
27
27
|
export declare function saveSettings(settings: PersistedSettings): void;
|
|
28
28
|
export declare function clearPersistedSettings(): Promise<void>;
|
|
29
29
|
export declare const isPersistentStorageAvailable: () => boolean;
|
|
30
|
+
export declare function getCustomStorage(): InspectorStorage | null;
|
package/dist/esm/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import { formatDateTime, getStatusColor, getNavigationInfo, deduplicateLogs, get
|
|
|
26
26
|
// #5 — settings persistence
|
|
27
27
|
import { loadSettings, saveSettings, setCustomStorage, isPersistentStorageAvailable, clearPersistedSettings, } from './helpers/settingsStore';
|
|
28
28
|
// Assets
|
|
29
|
-
import { EmptyRadarIcon, FailIcon, SearchIcon, ScreenIcon, ClearIcon, SortArrowIcon, FilterIcon, InsightsIcon, GlobeIcon, DownloadIcon, CloseWhite, TrashIcon, WhiteBackNavigation, TerminalIcon, SignalIcon, AnalyticsIcon, SunIcon, MoonIcon, BrandCircleIcon,
|
|
29
|
+
import { EmptyRadarIcon, FailIcon, SearchIcon, ScreenIcon, ClearIcon, SortArrowIcon, FilterIcon, InsightsIcon, GlobeIcon, DownloadIcon, CloseWhite, TrashIcon, WhiteBackNavigation, TerminalIcon, SignalIcon, AnalyticsIcon, SunIcon, MoonIcon, BrandCircleIcon, HtmlIcon, CssIcon, JsIcon, ClockIcon, EyeIcon, CheckIcon, SettingsIcon, RequestIcon, ResponseIcon, HeadersIcon, StatusIcon, ChevronIcon, WipeIcon, LayersIcon, UserIcon, InfoCircleIcon, WarningTriangleIcon, ErrorCircleIcon, TrendingUpIcon, MotionIcon, } from './components/NetworkIcons';
|
|
30
30
|
import ErrorBoundary from './components/ErrorBoundary';
|
|
31
31
|
// Stylesheet
|
|
32
32
|
import { AppColors } from './styles/AppColors';
|
|
@@ -154,6 +154,7 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
|
|
|
154
154
|
const [sectionFilters, setSectionFilters] = useState({});
|
|
155
155
|
const [collapsedSections, setCollapsedSections] = useState(new Set());
|
|
156
156
|
const [showNetworkMenu, setShowNetworkMenu] = useState(false);
|
|
157
|
+
const [showHeaderInfo, setShowHeaderInfo] = useState(false);
|
|
157
158
|
const [showUiMenu, setShowUiMenu] = useState(false);
|
|
158
159
|
const [sortOrder, setSortOrder] = useState('newest');
|
|
159
160
|
// #7 — sort order for the Logs (console) tab
|
|
@@ -3711,16 +3712,16 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
|
|
|
3711
3712
|
<WhiteBackNavigation />
|
|
3712
3713
|
</TouchableScale>
|
|
3713
3714
|
|
|
3714
|
-
{selected == null && selectedEvent == null ? (<
|
|
3715
|
+
{selected == null && selectedEvent == null ? (<TouchableScale onPress={() => setShowHeaderInfo(prev => !prev)} style={{
|
|
3715
3716
|
flexDirection: 'row',
|
|
3716
3717
|
alignItems: 'center',
|
|
3717
|
-
gap:
|
|
3718
|
+
gap: 10,
|
|
3718
3719
|
flex: 1,
|
|
3719
3720
|
}}>
|
|
3720
3721
|
<View style={{
|
|
3721
|
-
width:
|
|
3722
|
-
height:
|
|
3723
|
-
borderRadius:
|
|
3722
|
+
width: 38,
|
|
3723
|
+
height: 38,
|
|
3724
|
+
borderRadius: 19,
|
|
3724
3725
|
backgroundColor: 'rgba(255,255,255,0.13)',
|
|
3725
3726
|
borderWidth: 1.5,
|
|
3726
3727
|
borderColor: 'rgba(255,255,255,0.25)',
|
|
@@ -3731,17 +3732,13 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
|
|
|
3731
3732
|
shadowRadius: 4,
|
|
3732
3733
|
shadowOffset: { width: 0, height: 2 },
|
|
3733
3734
|
}}>
|
|
3734
|
-
<
|
|
3735
|
+
<BrandCircleIcon size={34}/>
|
|
3735
3736
|
</View>
|
|
3736
3737
|
<View style={{ gap: 2, flex: 1 }}>
|
|
3737
3738
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
|
|
3738
3739
|
<Text style={[styles.headerTitle]} numberOfLines={1}>
|
|
3739
|
-
{getAppName()}
|
|
3740
|
-
<Text style={{ fontFamily: AppFonts.interRegular, fontSize: 13, color: 'rgba(255,255,255,0.6)' }}>
|
|
3741
|
-
(Inspector)
|
|
3742
|
-
</Text>
|
|
3740
|
+
{getAppName()}
|
|
3743
3741
|
</Text>
|
|
3744
|
-
{/* #1 — pulsing dot when a newer version is on NPM */}
|
|
3745
3742
|
{updateAvailable && (<Pressable hitSlop={10} onPress={() => Alert.alert('Update Available', `react-native-inapp-inspector v${latestNpmVersion} is available on NPM (installed: v${LIB_VERSION}).`, [
|
|
3746
3743
|
{ text: 'Later', style: 'cancel' },
|
|
3747
3744
|
{
|
|
@@ -3764,98 +3761,120 @@ const NetworkInspector = ({ enabled = true, storage, navigationRef, }) => {
|
|
|
3764
3761
|
}}/>
|
|
3765
3762
|
</Pressable>)}
|
|
3766
3763
|
</View>
|
|
3767
|
-
<Text style={{
|
|
3768
|
-
fontFamily: AppFonts.interRegular,
|
|
3769
|
-
fontSize: 10.5,
|
|
3770
|
-
color: 'rgba(255, 255, 255, 0.6)',
|
|
3771
|
-
marginTop: 1,
|
|
3772
|
-
}} selectable={true} numberOfLines={1}>
|
|
3773
|
-
{getBundleIdentifier()}
|
|
3774
|
-
</Text>
|
|
3775
3764
|
<View style={{
|
|
3776
3765
|
flexDirection: 'row',
|
|
3777
3766
|
alignItems: 'center',
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
alignItems: 'center',
|
|
3785
|
-
borderRadius: 6,
|
|
3786
|
-
overflow: 'hidden',
|
|
3767
|
+
alignSelf: 'flex-start',
|
|
3768
|
+
backgroundColor: 'rgba(255,255,255,0.1)',
|
|
3769
|
+
borderRadius: 10,
|
|
3770
|
+
paddingHorizontal: 8,
|
|
3771
|
+
paddingVertical: 3,
|
|
3772
|
+
gap: 5,
|
|
3787
3773
|
borderWidth: 1,
|
|
3788
|
-
borderColor: 'rgba(255,255,255,0.
|
|
3774
|
+
borderColor: 'rgba(255,255,255,0.15)',
|
|
3789
3775
|
}}>
|
|
3790
|
-
<View style={{
|
|
3791
|
-
paddingHorizontal: 5,
|
|
3792
|
-
paddingVertical: 2,
|
|
3793
|
-
backgroundColor: 'rgba(255,255,255,0.28)',
|
|
3794
|
-
}}>
|
|
3795
|
-
<Text style={{
|
|
3796
|
-
fontFamily: AppFonts.interBold,
|
|
3797
|
-
fontSize: 9,
|
|
3798
|
-
color: '#FFFFFF',
|
|
3799
|
-
letterSpacing: 0.3,
|
|
3800
|
-
}}>
|
|
3801
|
-
{Platform.OS === 'ios' ? 'iOS' : 'Android'}
|
|
3802
|
-
</Text>
|
|
3803
|
-
</View>
|
|
3804
|
-
<View style={{
|
|
3805
|
-
paddingHorizontal: 5,
|
|
3806
|
-
paddingVertical: 2,
|
|
3807
|
-
backgroundColor: 'rgba(255,255,255,0.12)',
|
|
3808
|
-
}}>
|
|
3809
|
-
<Text style={{
|
|
3810
|
-
fontFamily: AppFonts.interMedium,
|
|
3811
|
-
fontSize: 9.5,
|
|
3812
|
-
color: 'rgba(255,255,255,0.92)',
|
|
3813
|
-
}}>
|
|
3814
|
-
{String(Platform.Version)}
|
|
3815
|
-
</Text>
|
|
3816
|
-
</View>
|
|
3817
|
-
</View>
|
|
3818
|
-
|
|
3819
|
-
{/* npm chip */}
|
|
3820
3776
|
<View style={{
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
borderRadius:
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3777
|
+
width: 6,
|
|
3778
|
+
height: 6,
|
|
3779
|
+
borderRadius: 3,
|
|
3780
|
+
backgroundColor: '#4ADE80',
|
|
3781
|
+
}}/>
|
|
3782
|
+
<Text style={{
|
|
3783
|
+
fontFamily: AppFonts.interMedium,
|
|
3784
|
+
fontSize: 10,
|
|
3785
|
+
color: 'rgba(255, 255, 255, 0.85)',
|
|
3786
|
+
letterSpacing: 0.2,
|
|
3787
|
+
}} numberOfLines={1}>
|
|
3788
|
+
{getBundleIdentifier()}
|
|
3789
|
+
</Text>
|
|
3790
|
+
<Animated.View style={{
|
|
3791
|
+
transform: [{ rotate: showHeaderInfo ? '180deg' : '0deg' }],
|
|
3792
|
+
marginLeft: 2,
|
|
3827
3793
|
}}>
|
|
3794
|
+
<ChevronIcon color="rgba(255,255,255,0.6)" size={12}/>
|
|
3795
|
+
</Animated.View>
|
|
3796
|
+
</View>
|
|
3797
|
+
{showHeaderInfo && (<View style={{
|
|
3798
|
+
flexDirection: 'row',
|
|
3799
|
+
alignItems: 'center',
|
|
3800
|
+
gap: 6,
|
|
3801
|
+
marginTop: 4,
|
|
3802
|
+
}}>
|
|
3828
3803
|
<View style={{
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3804
|
+
flexDirection: 'row',
|
|
3805
|
+
alignItems: 'center',
|
|
3806
|
+
borderRadius: 6,
|
|
3807
|
+
overflow: 'hidden',
|
|
3808
|
+
borderWidth: 1,
|
|
3809
|
+
borderColor: 'rgba(255,255,255,0.18)',
|
|
3810
|
+
}}>
|
|
3811
|
+
<View style={{
|
|
3812
|
+
paddingHorizontal: 5,
|
|
3813
|
+
paddingVertical: 2,
|
|
3814
|
+
backgroundColor: 'rgba(255,255,255,0.28)',
|
|
3815
|
+
}}>
|
|
3816
|
+
<Text style={{
|
|
3817
|
+
fontFamily: AppFonts.interBold,
|
|
3818
|
+
fontSize: 9,
|
|
3819
|
+
color: '#FFFFFF',
|
|
3820
|
+
letterSpacing: 0.3,
|
|
3821
|
+
}}>
|
|
3822
|
+
{Platform.OS === 'ios' ? 'iOS' : 'Android'}
|
|
3823
|
+
</Text>
|
|
3824
|
+
</View>
|
|
3825
|
+
<View style={{
|
|
3826
|
+
paddingHorizontal: 5,
|
|
3827
|
+
paddingVertical: 2,
|
|
3828
|
+
backgroundColor: 'rgba(255,255,255,0.12)',
|
|
3829
|
+
}}>
|
|
3830
|
+
<Text style={{
|
|
3831
|
+
fontFamily: AppFonts.interMedium,
|
|
3832
|
+
fontSize: 9.5,
|
|
3833
|
+
color: 'rgba(255,255,255,0.92)',
|
|
3834
|
+
}}>
|
|
3835
|
+
{String(Platform.Version)}
|
|
3836
|
+
</Text>
|
|
3837
|
+
</View>
|
|
3841
3838
|
</View>
|
|
3842
3839
|
<View style={{
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3840
|
+
flexDirection: 'row',
|
|
3841
|
+
alignItems: 'center',
|
|
3842
|
+
borderRadius: 6,
|
|
3843
|
+
overflow: 'hidden',
|
|
3844
|
+
borderWidth: 1,
|
|
3845
|
+
borderColor: 'rgba(255,255,255,0.18)',
|
|
3846
|
+
}}>
|
|
3847
|
+
<View style={{
|
|
3848
|
+
paddingHorizontal: 5,
|
|
3849
|
+
paddingVertical: 2,
|
|
3850
|
+
backgroundColor: 'rgba(255,255,255,0.28)',
|
|
3851
|
+
}}>
|
|
3852
|
+
<Text style={{
|
|
3853
|
+
fontFamily: AppFonts.interBold,
|
|
3854
|
+
fontSize: 9,
|
|
3855
|
+
color: '#FFFFFF',
|
|
3856
|
+
letterSpacing: 0.3,
|
|
3857
|
+
}}>
|
|
3858
|
+
npm
|
|
3859
|
+
</Text>
|
|
3860
|
+
</View>
|
|
3861
|
+
<View style={{
|
|
3862
|
+
paddingHorizontal: 5,
|
|
3863
|
+
paddingVertical: 2,
|
|
3864
|
+
backgroundColor: 'rgba(255,255,255,0.12)',
|
|
3865
|
+
}}>
|
|
3866
|
+
<Text style={{
|
|
3867
|
+
fontFamily: AppFonts.interMedium,
|
|
3868
|
+
fontSize: 9.5,
|
|
3869
|
+
color: 'rgba(255,255,255,0.92)',
|
|
3870
|
+
}}>
|
|
3871
|
+
v{LIB_VERSION}
|
|
3872
|
+
</Text>
|
|
3873
|
+
</View>
|
|
3854
3874
|
</View>
|
|
3855
|
-
</View>
|
|
3856
|
-
</View>
|
|
3875
|
+
</View>)}
|
|
3857
3876
|
</View>
|
|
3858
|
-
</
|
|
3877
|
+
</TouchableScale>) : null}
|
|
3859
3878
|
</View>
|
|
3860
3879
|
|
|
3861
3880
|
<View style={styles.headerCenter}>
|
package/package.json
CHANGED