react-native-inapp-inspector 1.1.16 → 1.1.18
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 +13 -0
- package/dist/commonjs/components/AnimatedEntrance.js +3 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +8 -0
- package/dist/commonjs/components/AppHeaderLogo.js +85 -0
- package/dist/commonjs/components/Inspector/BundleTab.d.ts +46 -0
- package/dist/commonjs/components/Inspector/BundleTab.js +2439 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +185 -52
- package/dist/commonjs/components/Inspector/MainScreen.js +93 -7
- package/dist/commonjs/components/Inspector/PerformanceTab.d.ts +22 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +1143 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxDetail.js +576 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +433 -49
- package/dist/commonjs/components/Inspector/SettingsPanel.js +13 -2
- package/dist/commonjs/components/Inspector/TabBar.js +16 -6
- package/dist/commonjs/components/JsonViewer.js +91 -30
- package/dist/commonjs/components/LogCard.js +3 -4
- package/dist/commonjs/components/NetworkIcons.d.ts +9 -0
- package/dist/commonjs/components/NetworkIcons.js +63 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/consoleLogger.js +37 -9
- package/dist/commonjs/customHooks/reduxLogger.js +4 -2
- package/dist/commonjs/helpers/index.js +6 -2
- package/dist/commonjs/index.js +18 -1
- package/dist/commonjs/styles/AppColors.js +163 -163
- package/dist/commonjs/styles/index.d.ts +14 -0
- package/dist/commonjs/styles/index.js +14 -0
- package/dist/commonjs/types/enums.d.ts +2 -2
- package/dist/commonjs/types/interfaces.d.ts +11 -0
- package/dist/esm/components/AnimatedEntrance.js +4 -1
- package/dist/esm/components/AppHeaderLogo.d.ts +8 -0
- package/dist/esm/components/AppHeaderLogo.js +45 -0
- package/dist/esm/components/Inspector/BundleTab.d.ts +46 -0
- package/dist/esm/components/Inspector/BundleTab.js +2401 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +151 -51
- package/dist/esm/components/Inspector/MainScreen.js +60 -7
- package/dist/esm/components/Inspector/PerformanceTab.d.ts +22 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +1105 -0
- package/dist/esm/components/Inspector/ReduxDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxDetail.js +538 -0
- package/dist/esm/components/Inspector/ReduxTab.js +402 -51
- package/dist/esm/components/Inspector/SettingsPanel.js +14 -3
- package/dist/esm/components/Inspector/TabBar.js +17 -7
- package/dist/esm/components/JsonViewer.js +92 -31
- package/dist/esm/components/LogCard.js +3 -4
- package/dist/esm/components/NetworkIcons.d.ts +9 -0
- package/dist/esm/components/NetworkIcons.js +55 -1
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/consoleLogger.js +37 -9
- package/dist/esm/customHooks/reduxLogger.js +4 -2
- package/dist/esm/helpers/index.js +6 -2
- package/dist/esm/index.js +18 -1
- package/dist/esm/styles/AppColors.js +163 -163
- package/dist/esm/styles/index.d.ts +14 -0
- package/dist/esm/styles/index.js +14 -0
- package/dist/esm/types/enums.d.ts +2 -2
- package/dist/esm/types/interfaces.d.ts +11 -0
- package/example/App.tsx +5 -1
- package/example/assets/app_icon.png +0 -0
- package/example/ios/Podfile.lock +3 -3
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +18 -9
- package/example/ios/example/Images.xcassets/AppIcon.appiconset/app_icon_1024.png +0 -0
- package/example/package-lock.json +824 -10
- package/example/package.json +6 -2
- package/package.json +4 -2
|
@@ -48,10 +48,63 @@ const NetworkIcons_1 = require("./NetworkIcons");
|
|
|
48
48
|
const AppColors_1 = require("../styles/AppColors");
|
|
49
49
|
const AppFonts_1 = require("../styles/AppFonts");
|
|
50
50
|
const styles_1 = __importDefault(require("../styles"));
|
|
51
|
+
// ── Table Row Component with 3-Line Clamp & Show More/Less ───────────────────
|
|
52
|
+
const JsonTableRow = react_1.default.memo(({ itemKey, val, search, }) => {
|
|
53
|
+
const [expanded, setExpanded] = (0, react_1.useState)(false);
|
|
54
|
+
const isObject = val !== null && typeof val === 'object';
|
|
55
|
+
let rawStr = '';
|
|
56
|
+
if (val === null) {
|
|
57
|
+
rawStr = 'null';
|
|
58
|
+
}
|
|
59
|
+
else if (val === undefined) {
|
|
60
|
+
rawStr = 'undefined';
|
|
61
|
+
}
|
|
62
|
+
else if (isObject) {
|
|
63
|
+
try {
|
|
64
|
+
rawStr = JSON.stringify(val, null, 2);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
rawStr = String(val);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
rawStr = String(val);
|
|
72
|
+
}
|
|
73
|
+
const isMultiline = rawStr.includes('\n') || rawStr.length > 90;
|
|
74
|
+
return (<react_native_1.View style={localStyles.tableRow}>
|
|
75
|
+
<react_native_1.View style={{ flex: 2, paddingRight: 8 }}>
|
|
76
|
+
<HighlightText_1.default text={itemKey} search={search} style={localStyles.tableCellKey} highlightStyle={localStyles.highlight}/>
|
|
77
|
+
{isObject && (<react_native_1.Text style={localStyles.tableTypeBadge}>
|
|
78
|
+
{Array.isArray(val) ? `Array(${val.length})` : 'Object'}
|
|
79
|
+
</react_native_1.Text>)}
|
|
80
|
+
</react_native_1.View>
|
|
81
|
+
|
|
82
|
+
<react_native_1.View style={{ flex: 3 }}>
|
|
83
|
+
<HighlightText_1.default text={rawStr} search={search} style={[
|
|
84
|
+
localStyles.tableCellValue,
|
|
85
|
+
isObject && localStyles.tableCellRawCode,
|
|
86
|
+
]} highlightStyle={localStyles.highlight} numberOfLines={expanded ? undefined : 3} selectable={true}/>
|
|
87
|
+
{isMultiline && (<react_native_1.TouchableOpacity onPress={() => setExpanded(prev => !prev)} hitSlop={6} style={localStyles.showMoreBtn}>
|
|
88
|
+
<react_native_1.Text style={localStyles.showMoreText}>
|
|
89
|
+
{expanded ? 'Show less ▲' : 'Show more ▼'}
|
|
90
|
+
</react_native_1.Text>
|
|
91
|
+
</react_native_1.TouchableOpacity>)}
|
|
92
|
+
</react_native_1.View>
|
|
93
|
+
</react_native_1.View>);
|
|
94
|
+
});
|
|
51
95
|
// ── JsonViewer Component ─────────────────────────────────────────────────────
|
|
52
96
|
const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
|
|
53
97
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
54
|
-
const [
|
|
98
|
+
const [internalMode, setInternalMode] = (0, react_1.useState)('pretty');
|
|
99
|
+
const mode = externalMode ?? internalMode;
|
|
100
|
+
const setMode = (newMode) => {
|
|
101
|
+
if (onModeChange) {
|
|
102
|
+
onModeChange(newMode);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
setInternalMode(newMode);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
55
108
|
const rawText = react_1.default.useMemo(() => {
|
|
56
109
|
if (typeof data === 'string') {
|
|
57
110
|
return data;
|
|
@@ -65,12 +118,9 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
|
|
|
65
118
|
}, [data]);
|
|
66
119
|
(0, react_1.useEffect)(() => {
|
|
67
120
|
if (externalMode) {
|
|
68
|
-
|
|
121
|
+
setInternalMode(externalMode);
|
|
69
122
|
}
|
|
70
123
|
}, [externalMode]);
|
|
71
|
-
(0, react_1.useEffect)(() => {
|
|
72
|
-
onModeChange?.(mode);
|
|
73
|
-
}, [mode, onModeChange]);
|
|
74
124
|
const contentWrapperStyle = [
|
|
75
125
|
localStyles.contentWrapper,
|
|
76
126
|
{ backgroundColor: AppColors_1.AppColors.contentBg },
|
|
@@ -83,7 +133,9 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
|
|
|
83
133
|
];
|
|
84
134
|
// Determine type and size details
|
|
85
135
|
const isObject = typeof data === 'object' && data !== null;
|
|
86
|
-
const isEmpty =
|
|
136
|
+
const isEmpty = data === null ||
|
|
137
|
+
data === undefined ||
|
|
138
|
+
(isObject && Object.keys(data).length === 0);
|
|
87
139
|
// Render Table view (Key-Value flat table for root keys)
|
|
88
140
|
const renderTableMode = () => {
|
|
89
141
|
if (!isObject) {
|
|
@@ -103,28 +155,7 @@ const JsonViewer = react_1.default.memo(({ data, search, forceOpen, defaultExpan
|
|
|
103
155
|
<react_native_1.Text style={[localStyles.tableHeaderCell, { flex: 2 }]}>{t('network.jsonViewer.key')}</react_native_1.Text>
|
|
104
156
|
<react_native_1.Text style={[localStyles.tableHeaderCell, { flex: 3 }]}>{t('network.jsonViewer.value')}</react_native_1.Text>
|
|
105
157
|
</react_native_1.View>
|
|
106
|
-
{keys.map((key) => {
|
|
107
|
-
const val = data[key];
|
|
108
|
-
let displayVal = '';
|
|
109
|
-
if (val === null) {
|
|
110
|
-
displayVal = 'null';
|
|
111
|
-
}
|
|
112
|
-
else if (val === undefined) {
|
|
113
|
-
displayVal = 'undefined';
|
|
114
|
-
}
|
|
115
|
-
else if (typeof val === 'object') {
|
|
116
|
-
displayVal = Array.isArray(val) ? `[Array(${val.length})]` : '{Object}';
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
displayVal = String(val);
|
|
120
|
-
}
|
|
121
|
-
return (<react_native_1.View key={key} style={localStyles.tableRow}>
|
|
122
|
-
<react_native_1.Text style={[localStyles.tableCellKey, { flex: 2 }]}>{key}</react_native_1.Text>
|
|
123
|
-
<react_native_1.Text style={[localStyles.tableCellValue, { flex: 3 }]} numberOfLines={2}>
|
|
124
|
-
{displayVal}
|
|
125
|
-
</react_native_1.Text>
|
|
126
|
-
</react_native_1.View>);
|
|
127
|
-
})}
|
|
158
|
+
{keys.map((key) => (<JsonTableRow key={key} itemKey={key} val={data[key]} search={search}/>))}
|
|
128
159
|
</react_native_1.View>);
|
|
129
160
|
};
|
|
130
161
|
// Tree View Content
|
|
@@ -258,11 +289,36 @@ const localStyles = react_native_1.StyleSheet.create({
|
|
|
258
289
|
fontSize: 12.5,
|
|
259
290
|
color: AppColors_1.AppColors.purple,
|
|
260
291
|
},
|
|
292
|
+
tableTypeBadge: {
|
|
293
|
+
fontFamily: AppFonts_1.AppFonts.interMedium,
|
|
294
|
+
fontSize: 9.5,
|
|
295
|
+
color: AppColors_1.AppColors.slate400,
|
|
296
|
+
marginTop: 2,
|
|
297
|
+
},
|
|
261
298
|
tableCellValue: {
|
|
262
299
|
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
263
|
-
fontSize: 12
|
|
300
|
+
fontSize: 12,
|
|
264
301
|
color: AppColors_1.AppColors.primaryBlack,
|
|
265
|
-
lineHeight:
|
|
302
|
+
lineHeight: 17,
|
|
303
|
+
},
|
|
304
|
+
tableCellRawCode: {
|
|
305
|
+
fontFamily: AppFonts_1.AppFonts.interRegular,
|
|
306
|
+
fontSize: 11.5,
|
|
307
|
+
color: AppColors_1.AppColors.slate700,
|
|
308
|
+
backgroundColor: `${AppColors_1.AppColors.slate100}80`,
|
|
309
|
+
padding: 6,
|
|
310
|
+
borderRadius: 6,
|
|
311
|
+
},
|
|
312
|
+
showMoreBtn: {
|
|
313
|
+
alignSelf: 'flex-start',
|
|
314
|
+
marginTop: 4,
|
|
315
|
+
paddingVertical: 2,
|
|
316
|
+
paddingHorizontal: 4,
|
|
317
|
+
},
|
|
318
|
+
showMoreText: {
|
|
319
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
320
|
+
fontSize: 11,
|
|
321
|
+
color: AppColors_1.AppColors.purple,
|
|
266
322
|
},
|
|
267
323
|
emptyTable: {
|
|
268
324
|
padding: 24,
|
|
@@ -274,5 +330,10 @@ const localStyles = react_native_1.StyleSheet.create({
|
|
|
274
330
|
fontSize: 12.5,
|
|
275
331
|
color: AppColors_1.AppColors.slate400,
|
|
276
332
|
},
|
|
333
|
+
highlight: {
|
|
334
|
+
backgroundColor: '#FEF08A',
|
|
335
|
+
color: '#854D0E',
|
|
336
|
+
fontFamily: AppFonts_1.AppFonts.interBold,
|
|
337
|
+
},
|
|
277
338
|
});
|
|
278
339
|
exports.default = JsonViewer;
|
|
@@ -77,9 +77,8 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
|
|
|
77
77
|
}, [isNew]);
|
|
78
78
|
const path = (0, helpers_1.getPath)(item.url);
|
|
79
79
|
const baseUrl = (0, helpers_1.getBaseUrl)(item.url) || item.url;
|
|
80
|
-
const cleanHost = baseUrl.replace(/^https?:\/\//, '');
|
|
81
80
|
const slug = path && path !== '/' ? path : item.url;
|
|
82
|
-
const showSlug = slug !==
|
|
81
|
+
const showSlug = slug !== baseUrl && slug !== item.url;
|
|
83
82
|
const triggeredAt = (0, helpers_1.formatDateTime)(item.startTime);
|
|
84
83
|
const isJson = item.url.split('?')[0].toLowerCase().endsWith('.json');
|
|
85
84
|
return (<TouchableScale_1.default onPress={onPress} style={[
|
|
@@ -90,7 +89,7 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
|
|
|
90
89
|
},
|
|
91
90
|
]}>
|
|
92
91
|
<react_native_1.View style={styles_1.default.cardBody}>
|
|
93
|
-
{/* Row 1: Header (Checkbox, Serial, Method Badge, Base URL / Host, Status Pill) */}
|
|
92
|
+
{/* Row 1: Header (Checkbox, Serial, Method Badge, Base URL / Host with HTTPS, Status Pill) */}
|
|
94
93
|
<react_native_1.View style={styles_1.default.cardHeaderRow}>
|
|
95
94
|
<react_native_1.View style={styles_1.default.cardHeaderLeft}>
|
|
96
95
|
<react_native_1.Pressable onPress={() => onToggleSelect(item.id)} hitSlop={12} style={[
|
|
@@ -110,7 +109,7 @@ const LogCard = react_1.default.memo(function LogCard({ item, onPress, timelineM
|
|
|
110
109
|
</react_native_1.Text>
|
|
111
110
|
</react_native_1.View>
|
|
112
111
|
|
|
113
|
-
<HighlightText_1.default text={
|
|
112
|
+
<HighlightText_1.default text={baseUrl || item.url} search={searchStr} style={styles_1.default.cardHostText} highlightStyle={styles_1.default.highlight} numberOfLines={1} ellipsizeMode="tail"/>
|
|
114
113
|
</react_native_1.View>
|
|
115
114
|
|
|
116
115
|
<react_native_1.View style={[
|
|
@@ -57,3 +57,12 @@ export declare const SortIcon: ({ ascending, color, size, }: any) => React.JSX.E
|
|
|
57
57
|
export declare const PrettyIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
58
58
|
export declare const RawIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
59
59
|
export declare const TableIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
60
|
+
export declare const PackageIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
61
|
+
export declare const ForwardChevronIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
62
|
+
export declare const BundleIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
63
|
+
export declare const LiveStateIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
64
|
+
export declare const TimelineIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
65
|
+
export declare const StorageIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
66
|
+
export declare const MetadataIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
67
|
+
export declare const ReduxIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
68
|
+
export declare const PerformanceIcon: ({ color, size, }: any) => React.JSX.Element;
|
|
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.InfoCircleIcon = exports.UserIcon = exports.LayersIcon = exports.WipeIcon = exports.FolderIcon = exports.SettingsIcon = exports.EyeIcon = exports.JsIcon = exports.CssIcon = exports.HtmlIcon = exports.BrandSquareIcon = exports.BrandCircleIcon = exports.MoonIcon = exports.SunIcon = exports.DebugIcon = exports.InsightsIcon = exports.AnalyticsIcon = exports.WhiteBackNavigation = exports.CloseWhite = exports.DownloadIcon = exports.FilterIcon = exports.ChevronIcon = exports.SortArrowIcon = exports.GlobeIcon = exports.DiffIcon = exports.SignalIcon = exports.ExportIcon = exports.HeaderPauseIcon = exports.TrashIcon = exports.FailIcon = exports.CircleAlertIcon = exports.CircleXIcon = exports.CircleCheckIcon = exports.CheckIcon = exports.TerminalIcon = exports.FetchIcon = exports.CopyIcon = exports.HeadersIcon = exports.ResponseIcon = exports.RequestIcon = exports.SizeIcon = exports.StatusIcon = exports.CalendarIcon = exports.ClockIcon = exports.ClearIcon = exports.SearchIcon = exports.ExpandCollapseIcon = exports.ScreenIcon = exports.MapPinIcon = exports.EmptyRadarIcon = void 0;
|
|
40
|
-
exports.TableIcon = exports.RawIcon = exports.PrettyIcon = exports.SortIcon = exports.MotionIcon = exports.TrendingUpIcon = exports.ErrorCircleIcon = exports.WarningTriangleIcon = void 0;
|
|
40
|
+
exports.PerformanceIcon = exports.ReduxIcon = exports.MetadataIcon = exports.StorageIcon = exports.TimelineIcon = exports.LiveStateIcon = exports.BundleIcon = exports.ForwardChevronIcon = exports.PackageIcon = exports.TableIcon = exports.RawIcon = exports.PrettyIcon = exports.SortIcon = exports.MotionIcon = exports.TrendingUpIcon = exports.ErrorCircleIcon = exports.WarningTriangleIcon = void 0;
|
|
41
41
|
const react_1 = __importDefault(require("react"));
|
|
42
42
|
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
43
43
|
// Stylesheet
|
|
@@ -446,3 +446,65 @@ const TableIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) =
|
|
|
446
446
|
</react_native_svg_1.default>);
|
|
447
447
|
};
|
|
448
448
|
exports.TableIcon = TableIcon;
|
|
449
|
+
const PackageIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => {
|
|
450
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
451
|
+
<react_native_svg_1.Path d="M16.5 9.4 7.55 4.24a1.78 1.78 0 0 0-2.5 1.55v12.42a1.78 1.78 0 0 0 .86 1.52l8.95 5.16a1.78 1.78 0 0 0 1.78 0l8.95-5.16a1.78 1.78 0 0 0 .86-1.52V5.79a1.78 1.78 0 0 0-2.5-1.55L16.5 9.4z" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
452
|
+
<react_native_svg_1.Path d="M3.29 7 12 12.01 20.71 7M12 22.08V12" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
453
|
+
</react_native_svg_1.default>);
|
|
454
|
+
};
|
|
455
|
+
exports.PackageIcon = PackageIcon;
|
|
456
|
+
const ForwardChevronIcon = ({ color = AppColors_1.AppColors.grayTextWeak, size = 14, }) => {
|
|
457
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
458
|
+
<react_native_svg_1.Path d="M9 18l6-6-6-6" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
459
|
+
</react_native_svg_1.default>);
|
|
460
|
+
};
|
|
461
|
+
exports.ForwardChevronIcon = ForwardChevronIcon;
|
|
462
|
+
exports.BundleIcon = exports.PackageIcon;
|
|
463
|
+
const LiveStateIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
|
|
464
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
465
|
+
<react_native_svg_1.Path d="M12 3v3M12 18v3M3 12h3M18 12h3" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
466
|
+
<react_native_svg_1.Circle cx="12" cy="12" r="3.5" stroke={color} strokeWidth="1.8" fill={`${color}22`}/>
|
|
467
|
+
<react_native_svg_1.Circle cx="12" cy="12" r="1.5" fill={color}/>
|
|
468
|
+
</react_native_svg_1.default>);
|
|
469
|
+
};
|
|
470
|
+
exports.LiveStateIcon = LiveStateIcon;
|
|
471
|
+
const TimelineIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
|
|
472
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
473
|
+
<react_native_svg_1.Circle cx="12" cy="12" r="8.5" stroke={color} strokeWidth="1.8"/>
|
|
474
|
+
<react_native_svg_1.Path d="M12 7.5v4.5l3 2" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
475
|
+
</react_native_svg_1.default>);
|
|
476
|
+
};
|
|
477
|
+
exports.TimelineIcon = TimelineIcon;
|
|
478
|
+
const StorageIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
|
|
479
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
480
|
+
<react_native_svg_1.Ellipse cx="12" cy="6" rx="8" ry="2.8" stroke={color} strokeWidth="1.8"/>
|
|
481
|
+
<react_native_svg_1.Path d="M20 12c0 1.55-3.58 2.8-8 2.8s-8-1.25-8-2.8" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
|
|
482
|
+
<react_native_svg_1.Path d="M4 6v12c0 1.55 3.58 2.8 8 2.8s8-1.25 8-2.8V6" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
|
|
483
|
+
</react_native_svg_1.default>);
|
|
484
|
+
};
|
|
485
|
+
exports.StorageIcon = StorageIcon;
|
|
486
|
+
const MetadataIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
|
|
487
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
488
|
+
<react_native_svg_1.Circle cx="12" cy="12" r="8.5" stroke={color} strokeWidth="1.8"/>
|
|
489
|
+
<react_native_svg_1.Path d="M12 16v-4M12 8.2h.01" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
490
|
+
</react_native_svg_1.default>);
|
|
491
|
+
};
|
|
492
|
+
exports.MetadataIcon = MetadataIcon;
|
|
493
|
+
const ReduxIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
|
|
494
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
495
|
+
<react_native_svg_1.Circle cx="12" cy="12" r="4" stroke={color} strokeWidth="1.8"/>
|
|
496
|
+
<react_native_svg_1.Path d="M12 3a9 9 0 0 1 9 9M12 21a9 9 0 0 1-9-9" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
|
|
497
|
+
<react_native_svg_1.Circle cx="21" cy="12" r="1.5" fill={color}/>
|
|
498
|
+
<react_native_svg_1.Circle cx="3" cy="12" r="1.5" fill={color}/>
|
|
499
|
+
</react_native_svg_1.default>);
|
|
500
|
+
};
|
|
501
|
+
exports.ReduxIcon = ReduxIcon;
|
|
502
|
+
const PerformanceIcon = ({ color = AppColors_1.AppColors.purple, size = 14, }) => {
|
|
503
|
+
return (<react_native_svg_1.default width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
504
|
+
<react_native_svg_1.Path d="M12 3v2M5.636 5.636l1.414 1.414M18.364 5.636l-1.414 1.414M3 12h2M19 12h2" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
|
|
505
|
+
<react_native_svg_1.Path d="M12 19a7 7 0 1 0-7-7c0 1.93.784 3.68 2.05 4.95" stroke={color} strokeWidth="1.8" strokeLinecap="round"/>
|
|
506
|
+
<react_native_svg_1.Path d="M12 12l3.5-3.5" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
507
|
+
<react_native_svg_1.Circle cx="12" cy="12" r="1.5" fill={color}/>
|
|
508
|
+
</react_native_svg_1.default>);
|
|
509
|
+
};
|
|
510
|
+
exports.PerformanceIcon = PerformanceIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.1.
|
|
1
|
+
export declare const LIB_VERSION = "1.1.18";
|
|
@@ -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.18';
|
|
@@ -66,6 +66,16 @@ const symbolicateStack = async (stackString) => {
|
|
|
66
66
|
catch { }
|
|
67
67
|
return null;
|
|
68
68
|
};
|
|
69
|
+
const isLoggerInternal = (line) => {
|
|
70
|
+
const l = line.toLowerCase();
|
|
71
|
+
return (l.includes('getstackdetails') ||
|
|
72
|
+
l.includes('addlog') ||
|
|
73
|
+
l.includes('consolelogger') ||
|
|
74
|
+
l.includes('setupconsolelogger') ||
|
|
75
|
+
l.includes('formatargs') ||
|
|
76
|
+
l.includes('react-native-inapp-inspector') ||
|
|
77
|
+
l.trim() === 'error');
|
|
78
|
+
};
|
|
69
79
|
const getStackDetails = (args) => {
|
|
70
80
|
try {
|
|
71
81
|
let errorStack;
|
|
@@ -92,11 +102,7 @@ const getStackDetails = (args) => {
|
|
|
92
102
|
let fallbackCaller;
|
|
93
103
|
for (let i = 0; i < lines.length; i++) {
|
|
94
104
|
const line = lines[i];
|
|
95
|
-
if (!line ||
|
|
96
|
-
line.includes('consoleLogger') ||
|
|
97
|
-
line.includes('setupConsoleLogger') ||
|
|
98
|
-
line.includes('react-native-inapp-inspector') ||
|
|
99
|
-
line.trim() === 'Error') {
|
|
105
|
+
if (!line || isLoggerInternal(line)) {
|
|
100
106
|
continue;
|
|
101
107
|
}
|
|
102
108
|
const isInternal = line.includes('react-native/Libraries') ||
|
|
@@ -113,10 +119,7 @@ const getStackDetails = (args) => {
|
|
|
113
119
|
break;
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
|
-
const cleanedStack = lines
|
|
117
|
-
.filter(l => !l.includes('consoleLogger') &&
|
|
118
|
-
!l.includes('setupConsoleLogger'))
|
|
119
|
-
.join('\n');
|
|
122
|
+
const cleanedStack = lines.filter(l => !isLoggerInternal(l)).join('\n');
|
|
120
123
|
const caller = userCaller || fallbackCaller || 'Unknown';
|
|
121
124
|
return { caller, stack: cleanedStack || stackToUse, errorStack, stackToUse };
|
|
122
125
|
}
|
|
@@ -162,6 +165,31 @@ const addLog = (type, args, sourceMethod) => {
|
|
|
162
165
|
logs.unshift(newLog);
|
|
163
166
|
logs = logs.slice(0, MAX_LOGS);
|
|
164
167
|
notify();
|
|
168
|
+
// Asynchronously symbolicate stack trace via Metro in development
|
|
169
|
+
if (newLog.stack && typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
170
|
+
symbolicateStack(newLog.stack)
|
|
171
|
+
.then(symbolicatedFrames => {
|
|
172
|
+
if (symbolicatedFrames && symbolicatedFrames.length > 0) {
|
|
173
|
+
const validFrames = symbolicatedFrames.filter(f => f.file &&
|
|
174
|
+
!f.file.includes('react-native/Libraries') &&
|
|
175
|
+
!f.file.includes('node_modules') &&
|
|
176
|
+
!isLoggerInternal(f.file) &&
|
|
177
|
+
!isLoggerInternal(f.methodName || ''));
|
|
178
|
+
const topFrame = validFrames[0] || symbolicatedFrames[0];
|
|
179
|
+
if (topFrame) {
|
|
180
|
+
const cleanMethod = topFrame.methodName || 'anonymous';
|
|
181
|
+
const cleanFile = topFrame.file.split('/').pop() || topFrame.file;
|
|
182
|
+
newLog.caller = `${cleanMethod} (${cleanFile}:${topFrame.lineNumber || 1}:${topFrame.column || 1})`;
|
|
183
|
+
}
|
|
184
|
+
newLog.stack = symbolicatedFrames
|
|
185
|
+
.filter(f => !isLoggerInternal(f.file || '') && !isLoggerInternal(f.methodName || ''))
|
|
186
|
+
.map(f => ` at ${f.methodName || 'anonymous'} (${f.file}:${f.lineNumber || 1}:${f.column || 1})`)
|
|
187
|
+
.join('\n');
|
|
188
|
+
notify();
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
.catch(() => { });
|
|
192
|
+
}
|
|
165
193
|
// Asynchronously symbolicate stack trace using Metro in DEV mode
|
|
166
194
|
if (stackToUse && typeof __DEV__ !== 'undefined' && __DEV__) {
|
|
167
195
|
const currentLogId = newLog.id;
|
|
@@ -79,7 +79,8 @@ function recordAction(action, prevState, nextState) {
|
|
|
79
79
|
const payload = action && typeof action === 'object' && action.payload !== undefined
|
|
80
80
|
? action.payload
|
|
81
81
|
: null;
|
|
82
|
-
const
|
|
82
|
+
const now = Date.now();
|
|
83
|
+
const timestamp = new Date(now).toLocaleTimeString();
|
|
83
84
|
const affectedSlices = [];
|
|
84
85
|
if (prevState &&
|
|
85
86
|
nextState &&
|
|
@@ -87,7 +88,7 @@ function recordAction(action, prevState, nextState) {
|
|
|
87
88
|
typeof nextState === 'object') {
|
|
88
89
|
Object.keys(nextState).forEach(key => {
|
|
89
90
|
if (prevState[key] !== nextState[key]) {
|
|
90
|
-
lastActionForReducer[key] = { type, payload, timestamp };
|
|
91
|
+
lastActionForReducer[key] = { type, payload, timestamp, updatedAt: now };
|
|
91
92
|
affectedSlices.push(key);
|
|
92
93
|
}
|
|
93
94
|
});
|
|
@@ -97,6 +98,7 @@ function recordAction(action, prevState, nextState) {
|
|
|
97
98
|
type,
|
|
98
99
|
payload,
|
|
99
100
|
timestamp,
|
|
101
|
+
updatedAt: now,
|
|
100
102
|
affectedSlices,
|
|
101
103
|
prevState,
|
|
102
104
|
nextState,
|
|
@@ -489,10 +489,14 @@ const parseStackLine = (rawLine, isOrigin = false) => {
|
|
|
489
489
|
columnNumber = locMatch[3];
|
|
490
490
|
}
|
|
491
491
|
// Clean file name (remove query strings, packager urls, and parent paths)
|
|
492
|
-
let cleanPath = fullPath
|
|
492
|
+
let cleanPath = fullPath
|
|
493
|
+
.split('?')[0]
|
|
494
|
+
.split('&')[0]
|
|
495
|
+
.replace(/[)]+$/, '')
|
|
496
|
+
.replace(/\/\/+$/, '');
|
|
493
497
|
// Remove protocol prefixes
|
|
494
498
|
cleanPath = cleanPath.replace(/^(?:https?:\/\/[^\/]+\/|file:\/\/\/|webpack:\/\/\/?)/, '');
|
|
495
|
-
const fileName = cleanPath.split('/').pop() || cleanPath;
|
|
499
|
+
const fileName = cleanPath.split('/').filter(Boolean).pop() || cleanPath;
|
|
496
500
|
// Determine file extension (.tsx, .jsx, .ts, .js)
|
|
497
501
|
const extMatch = fileName.match(/\.([a-z0-9]+)$/i);
|
|
498
502
|
const ext = extMatch ? extMatch[1].toLowerCase() : '';
|
package/dist/commonjs/index.js
CHANGED
|
@@ -61,7 +61,7 @@ const reduxLogger_1 = require("./customHooks/reduxLogger");
|
|
|
61
61
|
const constants_1 = require("./constants");
|
|
62
62
|
// Stylesheet
|
|
63
63
|
const styles_1 = require("./styles");
|
|
64
|
-
const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigationRef, }) => {
|
|
64
|
+
const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigationRef, appIcon, environment, }) => {
|
|
65
65
|
// Set custom storage synchronously during render phase
|
|
66
66
|
(0, settingsStore_1.setCustomStorage)(storage || null);
|
|
67
67
|
const [isDark, setIsDark] = (0, react_1.useState)(false);
|
|
@@ -80,6 +80,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
80
80
|
const [search, setSearch] = (0, react_1.useState)('');
|
|
81
81
|
const [detailSearch, setDetailSearch] = (0, react_1.useState)('');
|
|
82
82
|
const [reduxSearch, setReduxSearch] = (0, react_1.useState)('');
|
|
83
|
+
const [selectedReduxSlice, setSelectedReduxSlice] = (0, react_1.useState)(null);
|
|
84
|
+
const [selectedReduxAction, setSelectedReduxAction] = (0, react_1.useState)(null);
|
|
85
|
+
const [reduxActiveSubTab, setReduxActiveSubTab] = (0, react_1.useState)('state');
|
|
83
86
|
const [apiDetailActiveTab, setApiDetailActiveTab] = (0, react_1.useState)('response');
|
|
84
87
|
(0, react_1.useEffect)(() => {
|
|
85
88
|
react_native_1.LogBox.ignoreAllLogs(enabled);
|
|
@@ -186,6 +189,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
186
189
|
logs: true,
|
|
187
190
|
analytics: true,
|
|
188
191
|
redux: false,
|
|
192
|
+
bundle: false,
|
|
193
|
+
performance: false,
|
|
189
194
|
});
|
|
190
195
|
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(100);
|
|
191
196
|
const [reduxAutoRefresh, setReduxAutoRefreshState] = (0, react_1.useState)(true);
|
|
@@ -204,6 +209,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
204
209
|
logs: true,
|
|
205
210
|
analytics: true,
|
|
206
211
|
redux: false,
|
|
212
|
+
bundle: false,
|
|
213
|
+
performance: false,
|
|
207
214
|
});
|
|
208
215
|
setDefaultTab('apis');
|
|
209
216
|
setMaxNetworkLogs(100);
|
|
@@ -261,6 +268,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
261
268
|
logs: true,
|
|
262
269
|
analytics: true,
|
|
263
270
|
redux: false,
|
|
271
|
+
bundle: false,
|
|
272
|
+
performance: false,
|
|
264
273
|
},
|
|
265
274
|
...(saved.tabVisibility || {}),
|
|
266
275
|
apis: true,
|
|
@@ -1128,6 +1137,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1128
1137
|
closeModal,
|
|
1129
1138
|
isReady,
|
|
1130
1139
|
isEnabled,
|
|
1140
|
+
appIcon,
|
|
1141
|
+
environment,
|
|
1131
1142
|
modalHeightPercent,
|
|
1132
1143
|
setModalHeightPercent,
|
|
1133
1144
|
modalAnimationType,
|
|
@@ -1236,6 +1247,12 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1236
1247
|
reduxLastActionMap,
|
|
1237
1248
|
reduxSearch,
|
|
1238
1249
|
setReduxSearch,
|
|
1250
|
+
selectedReduxSlice,
|
|
1251
|
+
setSelectedReduxSlice,
|
|
1252
|
+
selectedReduxAction,
|
|
1253
|
+
setSelectedReduxAction,
|
|
1254
|
+
reduxActiveSubTab,
|
|
1255
|
+
setReduxActiveSubTab,
|
|
1239
1256
|
// ─── Settings ───────────────────────────────────────────────────────
|
|
1240
1257
|
settingsActiveSubTab,
|
|
1241
1258
|
setSettingsActiveSubTab,
|