react-native-inapp-inspector 1.1.15 → 1.1.16
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 +137 -130
- package/dist/commonjs/components/CopyButton.d.ts +1 -1
- package/dist/commonjs/components/CopyButton.js +4 -4
- package/dist/commonjs/components/EndOfListFooter.js +2 -3
- package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -8
- package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/ConsoleTab.js +9 -9
- package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +1 -1
- package/dist/commonjs/components/Inspector/InspectorHeader.js +2 -2
- package/dist/commonjs/components/Inspector/LogDetail.d.ts +1 -1
- package/dist/commonjs/components/Inspector/LogDetail.js +2 -2
- package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +1 -1
- package/dist/commonjs/components/Inspector/NetworkDetail.js +2 -2
- package/dist/commonjs/components/Inspector/NetworkTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/NetworkTab.js +10 -9
- package/dist/commonjs/components/Inspector/ReduxTab.d.ts +1 -1
- package/dist/commonjs/components/Inspector/ReduxTab.js +2 -2
- package/dist/commonjs/components/Inspector/TabBar.d.ts +1 -1
- package/dist/commonjs/components/Inspector/TabBar.js +2 -2
- package/dist/commonjs/components/JsonViewer.d.ts +2 -2
- package/dist/commonjs/components/JsonViewer.js +2 -2
- package/dist/commonjs/components/ReduxTreeView.d.ts +2 -2
- package/dist/commonjs/components/ReduxTreeView.js +2 -3
- package/dist/commonjs/components/SegmentedTabs.d.ts +1 -1
- package/dist/commonjs/components/SegmentedTabs.js +2 -2
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/esm/components/CopyButton.d.ts +1 -1
- package/dist/esm/components/CopyButton.js +5 -5
- package/dist/esm/components/EndOfListFooter.js +2 -2
- package/dist/esm/components/Inspector/AnalyticsTab.d.ts +1 -1
- package/dist/esm/components/Inspector/AnalyticsTab.js +7 -8
- package/dist/esm/components/Inspector/ConsoleTab.d.ts +1 -1
- package/dist/esm/components/Inspector/ConsoleTab.js +9 -9
- package/dist/esm/components/Inspector/InspectorHeader.d.ts +1 -1
- package/dist/esm/components/Inspector/InspectorHeader.js +2 -2
- package/dist/esm/components/Inspector/LogDetail.d.ts +1 -1
- package/dist/esm/components/Inspector/LogDetail.js +2 -2
- package/dist/esm/components/Inspector/NetworkDetail.d.ts +1 -1
- package/dist/esm/components/Inspector/NetworkDetail.js +2 -2
- package/dist/esm/components/Inspector/NetworkTab.d.ts +1 -1
- package/dist/esm/components/Inspector/NetworkTab.js +10 -9
- package/dist/esm/components/Inspector/ReduxTab.d.ts +1 -1
- package/dist/esm/components/Inspector/ReduxTab.js +2 -2
- package/dist/esm/components/Inspector/TabBar.d.ts +1 -1
- package/dist/esm/components/Inspector/TabBar.js +2 -2
- package/dist/esm/components/JsonViewer.d.ts +2 -2
- package/dist/esm/components/JsonViewer.js +2 -2
- package/dist/esm/components/ReduxTreeView.d.ts +2 -2
- package/dist/esm/components/ReduxTreeView.js +2 -2
- package/dist/esm/components/SegmentedTabs.d.ts +1 -1
- package/dist/esm/components/SegmentedTabs.js +2 -2
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/example/App.tsx +57 -1
- package/example/README.md +33 -77
- package/package.json +1 -1
|
@@ -64,7 +64,7 @@ const getRelativeTime = (timestamp) => {
|
|
|
64
64
|
return `${hours}h ago`;
|
|
65
65
|
return `${days}d ago`;
|
|
66
66
|
};
|
|
67
|
-
const LogDetail = () => {
|
|
67
|
+
const LogDetail = react_1.default.memo(() => {
|
|
68
68
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
69
69
|
const { selectedLog } = (0, InspectorContext_1.useInspector)();
|
|
70
70
|
const [activeTab, setActiveTab] = (0, react_1.useState)('output');
|
|
@@ -947,7 +947,7 @@ const LogDetail = () => {
|
|
|
947
947
|
</react_native_1.View>)}
|
|
948
948
|
</react_native_1.ScrollView>
|
|
949
949
|
</react_native_1.View>);
|
|
950
|
-
};
|
|
950
|
+
});
|
|
951
951
|
const detailStyles = react_native_1.StyleSheet.create({
|
|
952
952
|
metaDot: {
|
|
953
953
|
fontSize: 10,
|
|
@@ -56,7 +56,7 @@ const AppFonts_1 = require("../../styles/AppFonts");
|
|
|
56
56
|
const constants_1 = require("../../constants");
|
|
57
57
|
const helpers_1 = require("../../helpers");
|
|
58
58
|
const NetworkIcons_1 = require("../NetworkIcons");
|
|
59
|
-
const NetworkDetail = () => {
|
|
59
|
+
const NetworkDetail = react_1.default.memo(() => {
|
|
60
60
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
61
61
|
const { selected, detailDisplayUrl, apiDetailActiveTab, setApiDetailActiveTab, detailSearch, setDetailSearch, reqExpanded, setReqExpanded, resExpanded, setResExpanded, showReqDiff, setShowReqDiff, showResDiff, setShowResDiff, prevRequestData, prevResponseData, logRouteMapRef, } = (0, InspectorContext_1.useInspector)();
|
|
62
62
|
if (!selected)
|
|
@@ -401,5 +401,5 @@ const NetworkDetail = () => {
|
|
|
401
401
|
</>)}
|
|
402
402
|
</react_native_1.ScrollView>
|
|
403
403
|
</react_native_1.View>);
|
|
404
|
-
};
|
|
404
|
+
});
|
|
405
405
|
exports.default = NetworkDetail;
|
|
@@ -59,7 +59,7 @@ const STATUS_META = {
|
|
|
59
59
|
'5xx': { color: AppColors_1.AppColors.errorColor, Icon: NetworkIcons_1.CircleXIcon },
|
|
60
60
|
Failed: { color: AppColors_1.AppColors.errorColor, Icon: NetworkIcons_1.CircleXIcon },
|
|
61
61
|
};
|
|
62
|
-
const FilterChip = ({ label, color, Icon, badge, active, onPress, }) => {
|
|
62
|
+
const FilterChip = react_1.default.memo(({ label, color, Icon, badge, active, onPress, }) => {
|
|
63
63
|
const iconColor = active ? color : AppColors_1.AppColors.grayTextWeak;
|
|
64
64
|
return (<TouchableScale_1.default style={styles_1.default.statusFilterWrap} onPress={onPress} hitSlop={10}>
|
|
65
65
|
<react_native_1.View style={[
|
|
@@ -81,19 +81,20 @@ const FilterChip = ({ label, color, Icon, badge, active, onPress, }) => {
|
|
|
81
81
|
{badge != null ? (<react_native_1.View style={[
|
|
82
82
|
styles_1.default.methodBadgeMini,
|
|
83
83
|
{ backgroundColor: badge },
|
|
84
|
-
]}/>) : (Icon && (<
|
|
85
|
-
|
|
86
|
-
</react_native_1.View>))}
|
|
87
|
-
<react_native_1.Text style={[
|
|
84
|
+
]}/>) : (Icon && (<Icon color={iconColor} size={13}/>))}
|
|
85
|
+
<react_native_1.Text numberOfLines={1} style={[
|
|
88
86
|
styles_1.default.statusFilterText,
|
|
89
|
-
active && {
|
|
87
|
+
active && {
|
|
88
|
+
color,
|
|
89
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
90
|
+
},
|
|
90
91
|
]}>
|
|
91
92
|
{label}
|
|
92
93
|
</react_native_1.Text>
|
|
93
94
|
</react_native_1.View>
|
|
94
95
|
</TouchableScale_1.default>);
|
|
95
|
-
};
|
|
96
|
-
const NetworkTab = () => {
|
|
96
|
+
});
|
|
97
|
+
const NetworkTab = react_1.default.memo(() => {
|
|
97
98
|
const { groupedData, search, setSearch, handleDelete, selectedLogs, sortOrder, setSortOrder, statusFilters, setStatusFilters, methodFilters, setMethodFilters, availableMethods, filteredLogs, logs, toggleSectionFilter, toggleSectionCollapse, minStart, totalRange, newLogIds, toggleSelect, setSelected, isNetworkPaused, setIsNetworkPaused, } = (0, InspectorContext_1.useInspector)();
|
|
98
99
|
const filtersAccordion = (0, useAccordion_1.default)(false, 300, 260);
|
|
99
100
|
const apisListRef = (0, react_1.useRef)(null);
|
|
@@ -277,5 +278,5 @@ const NetworkTab = () => {
|
|
|
277
278
|
</react_native_1.View>
|
|
278
279
|
</TouchableScale_1.default>
|
|
279
280
|
</react_native_1.View>);
|
|
280
|
-
};
|
|
281
|
+
});
|
|
281
282
|
exports.default = NetworkTab;
|
|
@@ -11,7 +11,7 @@ const styles_1 = __importDefault(require("../../styles"));
|
|
|
11
11
|
const AppColors_1 = require("../../styles/AppColors");
|
|
12
12
|
const AppFonts_1 = require("../../styles/AppFonts");
|
|
13
13
|
const NetworkIcons_1 = require("../NetworkIcons");
|
|
14
|
-
const ReduxTab = () => {
|
|
14
|
+
const ReduxTab = react_1.default.memo(() => {
|
|
15
15
|
const { reduxState, reduxLastActionMap, reduxSearch, setReduxSearch, } = (0, InspectorContext_1.useInspector)();
|
|
16
16
|
if (!reduxState) {
|
|
17
17
|
return (<react_native_1.View style={styles_1.default.emptyContainer}>
|
|
@@ -71,5 +71,5 @@ const ReduxTab = () => {
|
|
|
71
71
|
<ReduxTreeView_1.ReduxTreeView state={reduxState} lastActionMap={lastActionMap} search={reduxSearch}/>
|
|
72
72
|
</react_native_1.View>
|
|
73
73
|
</react_native_1.ScrollView>);
|
|
74
|
-
};
|
|
74
|
+
});
|
|
75
75
|
exports.default = ReduxTab;
|
|
@@ -10,7 +10,7 @@ const TouchableScale_1 = __importDefault(require("../TouchableScale"));
|
|
|
10
10
|
const styles_1 = __importDefault(require("../../styles"));
|
|
11
11
|
const AppColors_1 = require("../../styles/AppColors");
|
|
12
12
|
const NetworkIcons_1 = require("../NetworkIcons");
|
|
13
|
-
const TabBar = () => {
|
|
13
|
+
const TabBar = react_1.default.memo(() => {
|
|
14
14
|
const { activeTab, switchActiveTab, tabVisibility, logs, consoleLogs, analyticsEvents, lastReadApisCount, lastReadLogsCount, unreadPulseAnim, } = (0, InspectorContext_1.useInspector)();
|
|
15
15
|
return (<react_native_1.View style={styles_1.default.tabBarContainer}>
|
|
16
16
|
<react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={{ paddingRight: 16 }}>
|
|
@@ -91,5 +91,5 @@ const TabBar = () => {
|
|
|
91
91
|
})}
|
|
92
92
|
</react_native_1.ScrollView>
|
|
93
93
|
</react_native_1.View>);
|
|
94
|
-
};
|
|
94
|
+
});
|
|
95
95
|
exports.default = TabBar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight, maxHeight, mode: externalMode, onModeChange, hideTabs, }: {
|
|
2
|
+
declare const JsonViewer: React.MemoExoticComponent<({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight, maxHeight, mode: externalMode, onModeChange, hideTabs, }: {
|
|
3
3
|
data: unknown;
|
|
4
4
|
search?: string;
|
|
5
5
|
forceOpen?: boolean;
|
|
@@ -10,5 +10,5 @@ declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, wrap,
|
|
|
10
10
|
mode?: "pretty" | "raw" | "table";
|
|
11
11
|
onModeChange?: (mode: "pretty" | "raw" | "table") => void;
|
|
12
12
|
hideTabs?: boolean;
|
|
13
|
-
}) => React.JSX.Element
|
|
13
|
+
}) => React.JSX.Element>;
|
|
14
14
|
export default JsonViewer;
|
|
@@ -49,7 +49,7 @@ const AppColors_1 = require("../styles/AppColors");
|
|
|
49
49
|
const AppFonts_1 = require("../styles/AppFonts");
|
|
50
50
|
const styles_1 = __importDefault(require("../styles"));
|
|
51
51
|
// ── JsonViewer Component ─────────────────────────────────────────────────────
|
|
52
|
-
const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
|
|
52
|
+
const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
|
|
53
53
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
54
54
|
const [mode, setMode] = (0, react_1.useState)(externalMode || 'pretty');
|
|
55
55
|
const rawText = react_1.default.useMemo(() => {
|
|
@@ -185,7 +185,7 @@ const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHei
|
|
|
185
185
|
</react_native_1.ScrollView>))}
|
|
186
186
|
</react_native_1.View>
|
|
187
187
|
</react_native_1.View>);
|
|
188
|
-
};
|
|
188
|
+
});
|
|
189
189
|
const localStyles = react_native_1.StyleSheet.create({
|
|
190
190
|
container: {
|
|
191
191
|
backgroundColor: AppColors_1.AppColors.white,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const ReduxTreeView: ({ state, actionHistory, lastActionMap, search, onSearchChange, autoRefresh, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey, onSelectSliceKey, selectedActionId, onSelectActionId, }: {
|
|
2
|
+
export declare const ReduxTreeView: React.MemoExoticComponent<({ state, actionHistory, lastActionMap, search, onSearchChange, autoRefresh, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey, onSelectSliceKey, selectedActionId, onSelectActionId, }: {
|
|
3
3
|
state: any;
|
|
4
4
|
actionHistory?: any[];
|
|
5
5
|
lastActionMap?: Record<string, any>;
|
|
@@ -13,4 +13,4 @@ export declare const ReduxTreeView: ({ state, actionHistory, lastActionMap, sear
|
|
|
13
13
|
onSelectSliceKey?: (key: string | null) => void;
|
|
14
14
|
selectedActionId?: number | null;
|
|
15
15
|
onSelectActionId?: (id: number | null) => void;
|
|
16
|
-
}) => React.JSX.Element
|
|
16
|
+
}) => React.JSX.Element>;
|
|
@@ -79,7 +79,7 @@ const valueContainsTerm = (val, term) => {
|
|
|
79
79
|
}
|
|
80
80
|
return Object.keys(val).some(key => key.toLowerCase().includes(t) || valueContainsTerm(val[key], term));
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
exports.ReduxTreeView = react_1.default.memo(({ state, actionHistory = [], lastActionMap = {}, search = '', onSearchChange, autoRefresh = true, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey = null, onSelectSliceKey, selectedActionId = null, onSelectActionId, }) => {
|
|
83
83
|
const [activeTab, setActiveTab] = (0, react_1.useState)('state');
|
|
84
84
|
const [actionSubTab, setActionSubTab] = (0, react_1.useState)('payload');
|
|
85
85
|
// local fallbacks if props are not provided
|
|
@@ -747,8 +747,7 @@ const ReduxTreeView = ({ state, actionHistory = [], lastActionMap = {}, search =
|
|
|
747
747
|
}))}
|
|
748
748
|
</react_native_1.ScrollView>)}
|
|
749
749
|
</react_native_1.View>);
|
|
750
|
-
};
|
|
751
|
-
exports.ReduxTreeView = ReduxTreeView;
|
|
750
|
+
});
|
|
752
751
|
const styles = react_native_1.StyleSheet.create({
|
|
753
752
|
container: {
|
|
754
753
|
flex: 1,
|
|
@@ -11,5 +11,5 @@ interface SegmentedTabsProps {
|
|
|
11
11
|
onChange: (key: string) => void;
|
|
12
12
|
style?: ViewStyle | ViewStyle[];
|
|
13
13
|
}
|
|
14
|
-
declare const SegmentedTabs: ({ tabs, activeKey, onChange, style }: SegmentedTabsProps) => React.JSX.Element
|
|
14
|
+
declare const SegmentedTabs: React.MemoExoticComponent<({ tabs, activeKey, onChange, style }: SegmentedTabsProps) => React.JSX.Element>;
|
|
15
15
|
export default SegmentedTabs;
|
|
@@ -7,7 +7,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
7
7
|
const react_native_1 = require("react-native");
|
|
8
8
|
const AppColors_1 = require("../styles/AppColors");
|
|
9
9
|
const AppFonts_1 = require("../styles/AppFonts");
|
|
10
|
-
const SegmentedTabs = ({ tabs, activeKey, onChange, style }) => (<react_native_1.View style={[
|
|
10
|
+
const SegmentedTabs = react_1.default.memo(({ tabs, activeKey, onChange, style }) => (<react_native_1.View style={[
|
|
11
11
|
{
|
|
12
12
|
flexDirection: 'row',
|
|
13
13
|
borderRadius: 8,
|
|
@@ -48,5 +48,5 @@ const SegmentedTabs = ({ tabs, activeKey, onChange, style }) => (<react_native_1
|
|
|
48
48
|
</react_native_1.Text>
|
|
49
49
|
</react_native_1.Pressable>);
|
|
50
50
|
})}
|
|
51
|
-
</react_native_1.View>);
|
|
51
|
+
</react_native_1.View>));
|
|
52
52
|
exports.default = SegmentedTabs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.1.
|
|
1
|
+
export declare const LIB_VERSION = "1.1.16";
|
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LIB_VERSION = void 0;
|
|
4
4
|
// AUTO-GENERATED FILE — do not edit by hand.
|
|
5
5
|
// Regenerated from package.json on every build by scripts/gen-version.js.
|
|
6
|
-
exports.LIB_VERSION = '1.1.
|
|
6
|
+
exports.LIB_VERSION = '1.1.16';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CopyButtonProps } from '../types';
|
|
3
|
-
declare const CopyButton: ({ value, label, iconType }: CopyButtonProps) => React.JSX.Element
|
|
3
|
+
declare const CopyButton: React.MemoExoticComponent<({ value, label, iconType }: CopyButtonProps) => React.JSX.Element>;
|
|
4
4
|
export default CopyButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
2
|
// Components
|
|
3
3
|
import TouchableScale from './TouchableScale';
|
|
4
4
|
// Helpers
|
|
@@ -8,14 +8,14 @@ import { TerminalIcon, FetchIcon, CopyIcon, CheckIcon } from './NetworkIcons';
|
|
|
8
8
|
// Stylesheet
|
|
9
9
|
import { AppColors } from '../styles/AppColors';
|
|
10
10
|
import styles from '../styles';
|
|
11
|
-
const CopyButton = ({ value, label, iconType = 'copy' }) => {
|
|
11
|
+
const CopyButton = React.memo(({ value, label, iconType = 'copy' }) => {
|
|
12
12
|
const [copied, setCopied] = useState(false);
|
|
13
|
-
const handlePress = () => {
|
|
13
|
+
const handlePress = useCallback(() => {
|
|
14
14
|
const resolvedValue = typeof value === 'function' ? value() : value;
|
|
15
15
|
copyToClipboard(resolvedValue, label);
|
|
16
16
|
setCopied(true);
|
|
17
17
|
setTimeout(() => setCopied(false), 1200);
|
|
18
|
-
};
|
|
18
|
+
}, [value, label]);
|
|
19
19
|
const containerStyle = [
|
|
20
20
|
styles.iconSquareBtn,
|
|
21
21
|
copied && styles.iconSquareBtnSuccess,
|
|
@@ -28,5 +28,5 @@ const CopyButton = ({ value, label, iconType = 'copy' }) => {
|
|
|
28
28
|
return (<TouchableScale onPress={handlePress} hitSlop={12} style={containerStyle}>
|
|
29
29
|
{copied ? (<CheckIcon color={AppColors.greenColor} size={14}/>) : (<IconComponent color={AppColors.grayTextWeak} size={14}/>)}
|
|
30
30
|
</TouchableScale>);
|
|
31
|
-
};
|
|
31
|
+
});
|
|
32
32
|
export default CopyButton;
|
|
@@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';
|
|
|
3
3
|
import { AppColors } from '../styles/AppColors';
|
|
4
4
|
import { AppFonts } from '../styles/AppFonts';
|
|
5
5
|
import { CheckIcon } from './NetworkIcons';
|
|
6
|
-
export const EndOfListFooter = ({ count, label, message = "You've reached the end of the list", }) => {
|
|
6
|
+
export const EndOfListFooter = React.memo(({ count, label, message = "You've reached the end of the list", }) => {
|
|
7
7
|
return (<View style={styles.container}>
|
|
8
8
|
<View style={styles.dividerLine}/>
|
|
9
9
|
<View style={styles.badgePill}>
|
|
@@ -19,7 +19,7 @@ export const EndOfListFooter = ({ count, label, message = "You've reached the en
|
|
|
19
19
|
</View>
|
|
20
20
|
<View style={styles.dividerLine}/>
|
|
21
21
|
</View>);
|
|
22
|
-
};
|
|
22
|
+
});
|
|
23
23
|
const styles = StyleSheet.create({
|
|
24
24
|
container: {
|
|
25
25
|
flexDirection: 'row',
|
|
@@ -8,9 +8,8 @@ import styles from '../../styles';
|
|
|
8
8
|
import { AppColors } from '../../styles/AppColors';
|
|
9
9
|
import { getCurrentUserId, getCurrentUserProperties, getDefaultEventParameters, getCollectionEnabled, } from '../../customHooks/analyticsLogger';
|
|
10
10
|
import { SearchIcon, ClearIcon, TrashIcon, EmptyRadarIcon, HeaderPauseIcon, } from '../NetworkIcons';
|
|
11
|
-
const AnalyticsHeader = () => {
|
|
11
|
+
const AnalyticsHeader = React.memo(() => {
|
|
12
12
|
const { filteredAnalyticsEvents, analyticsHeaderExpanded, setAnalyticsHeaderExpanded, } = useInspector();
|
|
13
|
-
const keyExtractor = useCallback((item, index) => item?.id?.toString() ?? index.toString(), []);
|
|
14
13
|
const userId = getCurrentUserId();
|
|
15
14
|
const userProperties = getCurrentUserProperties();
|
|
16
15
|
const defaultParams = getDefaultEventParameters();
|
|
@@ -87,9 +86,10 @@ const AnalyticsHeader = () => {
|
|
|
87
86
|
</View>)}
|
|
88
87
|
</>)}
|
|
89
88
|
</View>);
|
|
90
|
-
};
|
|
91
|
-
const AnalyticsTab = () => {
|
|
92
|
-
const { analyticsSearch, setAnalyticsSearch, handleDelete,
|
|
89
|
+
});
|
|
90
|
+
const AnalyticsTab = React.memo(() => {
|
|
91
|
+
const { filteredAnalyticsEvents, analyticsSearch, setAnalyticsSearch, handleDelete, selectedEvent, setSelectedEvent, newEventIds, logRouteMapRef, isAnalyticsLayoutReady, setIsAnalyticsLayoutReady, isAnalyticsPaused, setIsAnalyticsPaused, } = useInspector();
|
|
92
|
+
const keyExtractor = useCallback((item, index) => item?.id?.toString() ?? index.toString(), []);
|
|
93
93
|
const renderItem = useCallback(({ item, index }) => {
|
|
94
94
|
const prev = filteredAnalyticsEvents[index + 1];
|
|
95
95
|
const next = filteredAnalyticsEvents[index - 1];
|
|
@@ -128,8 +128,7 @@ const AnalyticsTab = () => {
|
|
|
128
128
|
}
|
|
129
129
|
return screenName;
|
|
130
130
|
})()}/>);
|
|
131
|
-
}, [filteredAnalyticsEvents, analyticsSearch, newEventIds, setSelectedEvent]);
|
|
132
|
-
const keyExtractor = useCallback((item, index) => item?.id?.toString() ?? index.toString(), []);
|
|
131
|
+
}, [filteredAnalyticsEvents, analyticsSearch, newEventIds, setSelectedEvent, logRouteMapRef]);
|
|
133
132
|
return (<>
|
|
134
133
|
{/* ─── Search + Shared Toolbar for Analytics ──────────────────────── */}
|
|
135
134
|
{selectedEvent == null && (<View style={[
|
|
@@ -190,5 +189,5 @@ const AnalyticsTab = () => {
|
|
|
190
189
|
]} keyboardShouldPersistTaps="handled"/>) : null}
|
|
191
190
|
</View>
|
|
192
191
|
</>);
|
|
193
|
-
};
|
|
192
|
+
});
|
|
194
193
|
export default AnalyticsTab;
|
|
@@ -11,14 +11,14 @@ import styles from '../../styles';
|
|
|
11
11
|
import { AppColors } from '../../styles/AppColors';
|
|
12
12
|
import { AppFonts } from '../../styles/AppFonts';
|
|
13
13
|
import { SearchIcon, ClearIcon, SortArrowIcon, TrashIcon, LayersIcon, UserIcon, InfoCircleIcon, WarningTriangleIcon, ErrorCircleIcon, AnalyticsIcon, HeaderPauseIcon, } from '../NetworkIcons';
|
|
14
|
-
const ConsoleTab = () => {
|
|
14
|
+
const ConsoleTab = React.memo(() => {
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
const { logSearch, setLogSearch, logSortOrder, setLogSortOrder, handleDelete, logFilters, setLogFilters, logCounts, filteredConsoleLogs, visibleConsoleLogs, isConsolePaused, setIsConsolePaused, } = useInspector();
|
|
17
17
|
const renderItem = useCallback(({ item, index }) => (<AnimatedEntrance index={index} distance={8}>
|
|
18
18
|
<ConsoleLogCard item={item} searchStr={logSearch}/>
|
|
19
19
|
</AnimatedEntrance>), [logSearch]);
|
|
20
20
|
const keyExtractor = useCallback((item, index) => item?.id?.toString() ?? index.toString(), []);
|
|
21
|
-
const listHeader = useMemo(() =>
|
|
21
|
+
const listHeader = useMemo(() => {
|
|
22
22
|
const total = visibleConsoleLogs.length;
|
|
23
23
|
const filtered = filteredConsoleLogs.length;
|
|
24
24
|
const isAllSelected = logFilters.has('all') ||
|
|
@@ -28,8 +28,8 @@ const ConsoleTab = () => {
|
|
|
28
28
|
styles.resultCount,
|
|
29
29
|
{ marginBottom: 4, marginTop: 12 },
|
|
30
30
|
]}>
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
Showing ({filtered}/{total}) logs showing
|
|
32
|
+
</Text>);
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
const activeFilterNames = Array.from(logFilters)
|
|
@@ -46,11 +46,11 @@ const ConsoleTab = () => {
|
|
|
46
46
|
styles.resultCount,
|
|
47
47
|
{ marginBottom: 4, marginTop: 12 },
|
|
48
48
|
]}>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Filtering with {activeFilterNames.join(', ')} (
|
|
50
|
+
{filtered}/{total}) logs is showing
|
|
51
|
+
</Text>);
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}, [visibleConsoleLogs.length, filteredConsoleLogs.length, logFilters]);
|
|
54
54
|
return (<View style={{ flex: 1 }}>
|
|
55
55
|
<View style={{
|
|
56
56
|
backgroundColor: AppColors.white,
|
|
@@ -368,5 +368,5 @@ const ConsoleTab = () => {
|
|
|
368
368
|
filteredConsoleLogs.length === 0 && { flexGrow: 1 },
|
|
369
369
|
]} keyboardShouldPersistTaps="handled"/>
|
|
370
370
|
</View>);
|
|
371
|
-
};
|
|
371
|
+
});
|
|
372
372
|
export default ConsoleTab;
|
|
@@ -14,7 +14,7 @@ import { getAppName } from '../../helpers';
|
|
|
14
14
|
import { getBundleIdentifier } from '../../helpers';
|
|
15
15
|
import { formatTime } from '../../helpers';
|
|
16
16
|
import { WhiteBackNavigation, TrashIcon, SettingsIcon, CloseWhite, ChevronIcon, ClockIcon, } from '../NetworkIcons';
|
|
17
|
-
const InspectorHeader = () => {
|
|
17
|
+
const InspectorHeader = React.memo(() => {
|
|
18
18
|
const { modalHeightPercent, selected, setSelected, selectedEvent, setSelectedEvent, selectedLog, setSelectedLog, showHeaderInfo, setShowHeaderInfo, updateAvailable, latestNpmVersion, clearAnim, activePulseAnim, unreadPulseAnim, runClearAllWithAnimation, setSettingsPage, closeModal, detailTitle, } = useInspector();
|
|
19
19
|
const headerTopPadding = Platform.OS === 'ios' && modalHeightPercent >= 95 ? 44 : 0;
|
|
20
20
|
return (<LinearGradient colors={[AppColors.purple, AppColors.brandPurple]} style={styles.headerGradient}>
|
|
@@ -443,5 +443,5 @@ const InspectorHeader = () => {
|
|
|
443
443
|
</View>
|
|
444
444
|
</View>
|
|
445
445
|
</LinearGradient>);
|
|
446
|
-
};
|
|
446
|
+
});
|
|
447
447
|
export default InspectorHeader;
|
|
@@ -26,7 +26,7 @@ const getRelativeTime = (timestamp) => {
|
|
|
26
26
|
return `${hours}h ago`;
|
|
27
27
|
return `${days}d ago`;
|
|
28
28
|
};
|
|
29
|
-
const LogDetail = () => {
|
|
29
|
+
const LogDetail = React.memo(() => {
|
|
30
30
|
const { t } = useTranslation();
|
|
31
31
|
const { selectedLog } = useInspector();
|
|
32
32
|
const [activeTab, setActiveTab] = useState('output');
|
|
@@ -909,7 +909,7 @@ const LogDetail = () => {
|
|
|
909
909
|
</View>)}
|
|
910
910
|
</ScrollView>
|
|
911
911
|
</View>);
|
|
912
|
-
};
|
|
912
|
+
});
|
|
913
913
|
const detailStyles = StyleSheet.create({
|
|
914
914
|
metaDot: {
|
|
915
915
|
fontSize: 10,
|
|
@@ -18,7 +18,7 @@ import { AppFonts } from '../../styles/AppFonts';
|
|
|
18
18
|
import { METHOD_COLORS } from '../../constants';
|
|
19
19
|
import { getStatusColor, getSize, formatDateTime, getFetchCommand, getCurlCommand, } from '../../helpers';
|
|
20
20
|
import { FailIcon, GlobeIcon, StatusIcon, HeadersIcon, RequestIcon, ResponseIcon, DownloadIcon, ClearIcon, SizeIcon, } from '../NetworkIcons';
|
|
21
|
-
const NetworkDetail = () => {
|
|
21
|
+
const NetworkDetail = React.memo(() => {
|
|
22
22
|
const { t } = useTranslation();
|
|
23
23
|
const { selected, detailDisplayUrl, apiDetailActiveTab, setApiDetailActiveTab, detailSearch, setDetailSearch, reqExpanded, setReqExpanded, resExpanded, setResExpanded, showReqDiff, setShowReqDiff, showResDiff, setShowResDiff, prevRequestData, prevResponseData, logRouteMapRef, } = useInspector();
|
|
24
24
|
if (!selected)
|
|
@@ -363,5 +363,5 @@ const NetworkDetail = () => {
|
|
|
363
363
|
</>)}
|
|
364
364
|
</ScrollView>
|
|
365
365
|
</View>);
|
|
366
|
-
};
|
|
366
|
+
});
|
|
367
367
|
export default NetworkDetail;
|
|
@@ -21,7 +21,7 @@ const STATUS_META = {
|
|
|
21
21
|
'5xx': { color: AppColors.errorColor, Icon: CircleXIcon },
|
|
22
22
|
Failed: { color: AppColors.errorColor, Icon: CircleXIcon },
|
|
23
23
|
};
|
|
24
|
-
const FilterChip = ({ label, color, Icon, badge, active, onPress, }) => {
|
|
24
|
+
const FilterChip = React.memo(({ label, color, Icon, badge, active, onPress, }) => {
|
|
25
25
|
const iconColor = active ? color : AppColors.grayTextWeak;
|
|
26
26
|
return (<TouchableScale style={styles.statusFilterWrap} onPress={onPress} hitSlop={10}>
|
|
27
27
|
<View style={[
|
|
@@ -43,19 +43,20 @@ const FilterChip = ({ label, color, Icon, badge, active, onPress, }) => {
|
|
|
43
43
|
{badge != null ? (<View style={[
|
|
44
44
|
styles.methodBadgeMini,
|
|
45
45
|
{ backgroundColor: badge },
|
|
46
|
-
]}/>) : (Icon && (<
|
|
47
|
-
|
|
48
|
-
</View>))}
|
|
49
|
-
<Text style={[
|
|
46
|
+
]}/>) : (Icon && (<Icon color={iconColor} size={13}/>))}
|
|
47
|
+
<Text numberOfLines={1} style={[
|
|
50
48
|
styles.statusFilterText,
|
|
51
|
-
active && {
|
|
49
|
+
active && {
|
|
50
|
+
color,
|
|
51
|
+
fontFamily: AppFonts.interBold,
|
|
52
|
+
},
|
|
52
53
|
]}>
|
|
53
54
|
{label}
|
|
54
55
|
</Text>
|
|
55
56
|
</View>
|
|
56
57
|
</TouchableScale>);
|
|
57
|
-
};
|
|
58
|
-
const NetworkTab = () => {
|
|
58
|
+
});
|
|
59
|
+
const NetworkTab = React.memo(() => {
|
|
59
60
|
const { groupedData, search, setSearch, handleDelete, selectedLogs, sortOrder, setSortOrder, statusFilters, setStatusFilters, methodFilters, setMethodFilters, availableMethods, filteredLogs, logs, toggleSectionFilter, toggleSectionCollapse, minStart, totalRange, newLogIds, toggleSelect, setSelected, isNetworkPaused, setIsNetworkPaused, } = useInspector();
|
|
60
61
|
const filtersAccordion = useAccordion(false, 300, 260);
|
|
61
62
|
const apisListRef = useRef(null);
|
|
@@ -239,5 +240,5 @@ const NetworkTab = () => {
|
|
|
239
240
|
</View>
|
|
240
241
|
</TouchableScale>
|
|
241
242
|
</View>);
|
|
242
|
-
};
|
|
243
|
+
});
|
|
243
244
|
export default NetworkTab;
|
|
@@ -6,7 +6,7 @@ import styles from '../../styles';
|
|
|
6
6
|
import { AppColors } from '../../styles/AppColors';
|
|
7
7
|
import { AppFonts } from '../../styles/AppFonts';
|
|
8
8
|
import { TerminalIcon, ClearIcon } from '../NetworkIcons';
|
|
9
|
-
const ReduxTab = () => {
|
|
9
|
+
const ReduxTab = React.memo(() => {
|
|
10
10
|
const { reduxState, reduxLastActionMap, reduxSearch, setReduxSearch, } = useInspector();
|
|
11
11
|
if (!reduxState) {
|
|
12
12
|
return (<View style={styles.emptyContainer}>
|
|
@@ -66,5 +66,5 @@ const ReduxTab = () => {
|
|
|
66
66
|
<ReduxTreeView state={reduxState} lastActionMap={lastActionMap} search={reduxSearch}/>
|
|
67
67
|
</View>
|
|
68
68
|
</ScrollView>);
|
|
69
|
-
};
|
|
69
|
+
});
|
|
70
70
|
export default ReduxTab;
|
|
@@ -5,7 +5,7 @@ import TouchableScale from '../TouchableScale';
|
|
|
5
5
|
import styles from '../../styles';
|
|
6
6
|
import { AppColors } from '../../styles/AppColors';
|
|
7
7
|
import { SignalIcon, TerminalIcon, AnalyticsIcon, } from '../NetworkIcons';
|
|
8
|
-
const TabBar = () => {
|
|
8
|
+
const TabBar = React.memo(() => {
|
|
9
9
|
const { activeTab, switchActiveTab, tabVisibility, logs, consoleLogs, analyticsEvents, lastReadApisCount, lastReadLogsCount, unreadPulseAnim, } = useInspector();
|
|
10
10
|
return (<View style={styles.tabBarContainer}>
|
|
11
11
|
<ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={{ paddingRight: 16 }}>
|
|
@@ -86,5 +86,5 @@ const TabBar = () => {
|
|
|
86
86
|
})}
|
|
87
87
|
</ScrollView>
|
|
88
88
|
</View>);
|
|
89
|
-
};
|
|
89
|
+
});
|
|
90
90
|
export default TabBar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight, maxHeight, mode: externalMode, onModeChange, hideTabs, }: {
|
|
2
|
+
declare const JsonViewer: React.MemoExoticComponent<({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight, maxHeight, mode: externalMode, onModeChange, hideTabs, }: {
|
|
3
3
|
data: unknown;
|
|
4
4
|
search?: string;
|
|
5
5
|
forceOpen?: boolean;
|
|
@@ -10,5 +10,5 @@ declare const JsonViewer: ({ data, search, forceOpen, defaultExpandDepth, wrap,
|
|
|
10
10
|
mode?: "pretty" | "raw" | "table";
|
|
11
11
|
onModeChange?: (mode: "pretty" | "raw" | "table") => void;
|
|
12
12
|
hideTabs?: boolean;
|
|
13
|
-
}) => React.JSX.Element
|
|
13
|
+
}) => React.JSX.Element>;
|
|
14
14
|
export default JsonViewer;
|
|
@@ -11,7 +11,7 @@ import { AppColors } from '../styles/AppColors';
|
|
|
11
11
|
import { AppFonts } from '../styles/AppFonts';
|
|
12
12
|
import styles from '../styles';
|
|
13
13
|
// ── JsonViewer Component ─────────────────────────────────────────────────────
|
|
14
|
-
const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
|
|
14
|
+
const JsonViewer = React.memo(({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
const [mode, setMode] = useState(externalMode || 'pretty');
|
|
17
17
|
const rawText = React.useMemo(() => {
|
|
@@ -147,7 +147,7 @@ const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHei
|
|
|
147
147
|
</ScrollView>))}
|
|
148
148
|
</View>
|
|
149
149
|
</View>);
|
|
150
|
-
};
|
|
150
|
+
});
|
|
151
151
|
const localStyles = StyleSheet.create({
|
|
152
152
|
container: {
|
|
153
153
|
backgroundColor: AppColors.white,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const ReduxTreeView: ({ state, actionHistory, lastActionMap, search, onSearchChange, autoRefresh, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey, onSelectSliceKey, selectedActionId, onSelectActionId, }: {
|
|
2
|
+
export declare const ReduxTreeView: React.MemoExoticComponent<({ state, actionHistory, lastActionMap, search, onSearchChange, autoRefresh, onToggleAutoRefresh, onClearHistory, onDetailOpenChange, selectedSliceKey, onSelectSliceKey, selectedActionId, onSelectActionId, }: {
|
|
3
3
|
state: any;
|
|
4
4
|
actionHistory?: any[];
|
|
5
5
|
lastActionMap?: Record<string, any>;
|
|
@@ -13,4 +13,4 @@ export declare const ReduxTreeView: ({ state, actionHistory, lastActionMap, sear
|
|
|
13
13
|
onSelectSliceKey?: (key: string | null) => void;
|
|
14
14
|
selectedActionId?: number | null;
|
|
15
15
|
onSelectActionId?: (id: number | null) => void;
|
|
16
|
-
}) => React.JSX.Element
|
|
16
|
+
}) => React.JSX.Element>;
|