react-native-inapp-inspector 1.1.11 → 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 +93 -479
- package/dist/commonjs/components/AnalyticsEventCard.js +25 -25
- package/dist/commonjs/components/ConsoleLogCard.js +3 -1
- 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 -17
- package/dist/commonjs/components/ReduxTreeView.js +1045 -632
- package/dist/commonjs/components/SectionHeader.d.ts +1 -1
- package/dist/commonjs/components/SectionHeader.js +7 -1
- package/dist/commonjs/components/TouchableScale.js +8 -0
- 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 +3 -0
- package/dist/commonjs/helpers/index.js +103 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +4 -0
- package/dist/commonjs/index.js +385 -339
- package/dist/commonjs/types/index.d.ts +3 -0
- package/dist/esm/components/AnalyticsDetail.js +94 -480
- package/dist/esm/components/AnalyticsEventCard.js +25 -25
- package/dist/esm/components/ConsoleLogCard.js +3 -1
- 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 -17
- package/dist/esm/components/ReduxTreeView.js +1047 -629
- package/dist/esm/components/SectionHeader.d.ts +1 -1
- package/dist/esm/components/SectionHeader.js +8 -2
- package/dist/esm/components/TouchableScale.js +9 -1
- 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 +3 -0
- package/dist/esm/helpers/index.js +100 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +3 -0
- package/dist/esm/index.js +389 -343
- package/dist/esm/types/index.d.ts +3 -0
- package/example/package-lock.json +33 -74
- package/example/package.json +1 -1
- 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;
|
|
@@ -47,7 +47,7 @@ const TouchableScale_1 = __importDefault(require("./TouchableScale"));
|
|
|
47
47
|
const NetworkIcons_1 = require("./NetworkIcons");
|
|
48
48
|
// Stylesheet
|
|
49
49
|
const styles_1 = __importDefault(require("../styles"));
|
|
50
|
-
const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, }) => {
|
|
50
|
+
const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, showSearch, isSearching, onToggleSearch, }) => {
|
|
51
51
|
const isOpen = expanded === undefined ? false : !!expanded;
|
|
52
52
|
const chevronAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(isOpen ? 1 : 0)).current;
|
|
53
53
|
(0, react_1.useEffect)(() => {
|
|
@@ -68,6 +68,12 @@ const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDif
|
|
|
68
68
|
<react_native_1.Text style={styles_1.default.sectionTitle}>{title}</react_native_1.Text>
|
|
69
69
|
</react_native_1.Pressable>
|
|
70
70
|
<react_native_1.View style={styles_1.default.sectionHeaderActions}>
|
|
71
|
+
{showSearch && (<TouchableScale_1.default onPress={onToggleSearch} hitSlop={12} style={[
|
|
72
|
+
styles_1.default.iconSquareBtn,
|
|
73
|
+
isSearching ? styles_1.default.iconSquareBtnActive : null,
|
|
74
|
+
]}>
|
|
75
|
+
<NetworkIcons_1.SearchIcon color={isSearching ? AppColors_1.AppColors.skyBlue : AppColors_1.AppColors.grayTextWeak} size={14}/>
|
|
76
|
+
</TouchableScale_1.default>)}
|
|
71
77
|
{showDiff && (<TouchableScale_1.default onPress={onToggleDiff} hitSlop={12} style={[
|
|
72
78
|
styles_1.default.iconSquareBtn,
|
|
73
79
|
isDiffing ? styles_1.default.iconSquareBtnActive : null,
|
|
@@ -36,6 +36,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
const react_native_1 = require("react-native");
|
|
38
38
|
const TouchableScale = ({ onPress, style, children, hitSlop, disabled, }) => {
|
|
39
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
40
|
+
return (<react_native_1.Pressable disabled={disabled} onPress={onPress} hitSlop={hitSlop} style={({ pressed }) => [
|
|
41
|
+
style,
|
|
42
|
+
{ opacity: pressed ? 0.75 : 1 },
|
|
43
|
+
]}>
|
|
44
|
+
{children}
|
|
45
|
+
</react_native_1.Pressable>);
|
|
46
|
+
}
|
|
39
47
|
const scale = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
|
|
40
48
|
const opacity = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
|
|
41
49
|
const animatePress = (pressed) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.1.
|
|
1
|
+
export declare const LIB_VERSION = "1.1.13";
|
|
@@ -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.13';
|
|
@@ -19,3 +19,6 @@ export declare const getLocalizedFilePath: (path: string | any, country: string
|
|
|
19
19
|
export declare const getLocalizedFilePathWithSlash: (path: string | any, country: string | any, language: string | any) => any;
|
|
20
20
|
export declare const isAllValuesEmpty: (obj: Record<string, any>) => boolean;
|
|
21
21
|
export declare const formatDateTimeToAnalytics: (ts: number) => string;
|
|
22
|
+
export declare const getBundleIdentifier: () => string;
|
|
23
|
+
export declare const getAppName: () => string;
|
|
24
|
+
export declare const handleOpenExternalLink: (url: string) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatDateTimeToAnalytics = exports.isAllValuesEmpty = exports.getLocalizedFilePathWithSlash = exports.getLocalizedFilePath = exports.formatDisplayUrl = exports.getDiff = exports.flattenObject = exports.getNavigationInfo = exports.escapeRegex = exports.deduplicateLogs = exports.getFetchCommand = exports.getCurlCommand = exports.getBaseUrl = exports.getPath = exports.copyToClipboard = exports.getSize = exports.getDurationColor = exports.getStatusColor = exports.formatDateTime = exports.getDomainColor = void 0;
|
|
3
|
+
exports.handleOpenExternalLink = exports.getAppName = exports.getBundleIdentifier = exports.formatDateTimeToAnalytics = exports.isAllValuesEmpty = exports.getLocalizedFilePathWithSlash = exports.getLocalizedFilePath = exports.formatDisplayUrl = exports.getDiff = exports.flattenObject = exports.getNavigationInfo = exports.escapeRegex = exports.deduplicateLogs = exports.getFetchCommand = exports.getCurlCommand = exports.getBaseUrl = exports.getPath = exports.copyToClipboard = exports.getSize = exports.getDurationColor = exports.getStatusColor = exports.formatDateTime = exports.getDomainColor = void 0;
|
|
4
4
|
const react_native_1 = require("react-native");
|
|
5
5
|
// Stylesheet
|
|
6
6
|
const AppColors_1 = require("../styles/AppColors");
|
|
@@ -239,3 +239,105 @@ const formatDateTimeToAnalytics = (ts) => {
|
|
|
239
239
|
});
|
|
240
240
|
};
|
|
241
241
|
exports.formatDateTimeToAnalytics = formatDateTimeToAnalytics;
|
|
242
|
+
const getBundleIdentifier = () => {
|
|
243
|
+
const RNDeviceInfo = react_native_1.NativeModules.RNDeviceInfo;
|
|
244
|
+
if (RNDeviceInfo && typeof RNDeviceInfo.bundleId === 'string') {
|
|
245
|
+
return RNDeviceInfo.bundleId;
|
|
246
|
+
}
|
|
247
|
+
if (RNDeviceInfo && typeof RNDeviceInfo.getBundleId === 'function') {
|
|
248
|
+
try {
|
|
249
|
+
const res = RNDeviceInfo.getBundleId();
|
|
250
|
+
if (typeof res === 'string')
|
|
251
|
+
return res;
|
|
252
|
+
}
|
|
253
|
+
catch (e) { }
|
|
254
|
+
}
|
|
255
|
+
const ExponentConstants = react_native_1.NativeModules.ExponentConstants;
|
|
256
|
+
if (ExponentConstants && ExponentConstants.manifest) {
|
|
257
|
+
const manifest = ExponentConstants.manifest;
|
|
258
|
+
if (manifest.ios && manifest.ios.bundleIdentifier) {
|
|
259
|
+
return manifest.ios.bundleIdentifier;
|
|
260
|
+
}
|
|
261
|
+
if (manifest.android && manifest.android.package) {
|
|
262
|
+
return manifest.android.package;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const ExpoApplication = react_native_1.NativeModules.ExpoApplication;
|
|
266
|
+
if (ExpoApplication && typeof ExpoApplication.applicationId === 'string') {
|
|
267
|
+
return ExpoApplication.applicationId;
|
|
268
|
+
}
|
|
269
|
+
const SourceCode = react_native_1.NativeModules.SourceCode;
|
|
270
|
+
if (SourceCode && typeof SourceCode.scriptURL === 'string') {
|
|
271
|
+
const url = SourceCode.scriptURL;
|
|
272
|
+
if (url.includes('assets/')) {
|
|
273
|
+
try {
|
|
274
|
+
const match = url.match(/assets\/([^/?#]+)/);
|
|
275
|
+
if (match && match[1]) {
|
|
276
|
+
return match[1];
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
catch (e) { }
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return 'org.reactjs.native.example';
|
|
283
|
+
};
|
|
284
|
+
exports.getBundleIdentifier = getBundleIdentifier;
|
|
285
|
+
const getAppName = () => {
|
|
286
|
+
// Try iOS via PlatformConstants
|
|
287
|
+
const constants = react_native_1.NativeModules.PlatformConstants;
|
|
288
|
+
if (constants && typeof constants.interfaceIdiom === 'string') {
|
|
289
|
+
// On iOS, try to get display name from the main bundle
|
|
290
|
+
const SettingsManager = react_native_1.NativeModules.SettingsManager;
|
|
291
|
+
if (SettingsManager && SettingsManager.settings) {
|
|
292
|
+
const appName = SettingsManager.settings.AppleLocale
|
|
293
|
+
? undefined
|
|
294
|
+
: undefined;
|
|
295
|
+
// Fallback: try to parse from SourceCode
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// Try react-native-device-info
|
|
299
|
+
const RNDeviceInfo = react_native_1.NativeModules.RNDeviceInfo;
|
|
300
|
+
if (RNDeviceInfo && typeof RNDeviceInfo.appName === 'string') {
|
|
301
|
+
return RNDeviceInfo.appName;
|
|
302
|
+
}
|
|
303
|
+
// Try Expo
|
|
304
|
+
const ExpoApplication = react_native_1.NativeModules.ExpoApplication;
|
|
305
|
+
if (ExpoApplication && typeof ExpoApplication.applicationName === 'string') {
|
|
306
|
+
return ExpoApplication.applicationName;
|
|
307
|
+
}
|
|
308
|
+
const ExponentConstants = react_native_1.NativeModules.ExponentConstants;
|
|
309
|
+
if (ExponentConstants && ExponentConstants.manifest) {
|
|
310
|
+
const manifest = ExponentConstants.manifest;
|
|
311
|
+
if (manifest.name)
|
|
312
|
+
return manifest.name;
|
|
313
|
+
}
|
|
314
|
+
// Android: try to get from AndroidInfoModule
|
|
315
|
+
const AppInfo = react_native_1.NativeModules.AppInfo;
|
|
316
|
+
if (AppInfo && typeof AppInfo.appName === 'string') {
|
|
317
|
+
return AppInfo.appName;
|
|
318
|
+
}
|
|
319
|
+
// Fallback: derive from bundle ID (last segment, cleaned up)
|
|
320
|
+
const bundleId = (0, exports.getBundleIdentifier)();
|
|
321
|
+
if (bundleId && bundleId !== 'org.reactjs.native.example') {
|
|
322
|
+
const parts = bundleId.split('.');
|
|
323
|
+
const last = parts[parts.length - 1];
|
|
324
|
+
// Capitalize first letter
|
|
325
|
+
return last ? last.charAt(0).toUpperCase() + last.slice(1) : 'App';
|
|
326
|
+
}
|
|
327
|
+
return 'App';
|
|
328
|
+
};
|
|
329
|
+
exports.getAppName = getAppName;
|
|
330
|
+
const handleOpenExternalLink = (url) => {
|
|
331
|
+
if (!url)
|
|
332
|
+
return;
|
|
333
|
+
react_native_1.Alert.alert('Open Link', `Do you want to open this link in your web browser?\n\n${url}`, [
|
|
334
|
+
{ text: 'Cancel', style: 'cancel' },
|
|
335
|
+
{
|
|
336
|
+
text: 'Open',
|
|
337
|
+
onPress: () => {
|
|
338
|
+
react_native_1.Linking.openURL(url).catch(() => { });
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
]);
|
|
342
|
+
};
|
|
343
|
+
exports.handleOpenExternalLink = handleOpenExternalLink;
|
|
@@ -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;
|
|
@@ -9,6 +9,7 @@ exports.setCustomStorage = setCustomStorage;
|
|
|
9
9
|
exports.loadSettings = loadSettings;
|
|
10
10
|
exports.saveSettings = saveSettings;
|
|
11
11
|
exports.clearPersistedSettings = clearPersistedSettings;
|
|
12
|
+
exports.getCustomStorage = getCustomStorage;
|
|
12
13
|
const react_native_1 = require("react-native");
|
|
13
14
|
// In-memory fallback (settings survive for the app session only).
|
|
14
15
|
const memory = new Map();
|
|
@@ -90,3 +91,6 @@ const isPersistentStorageAvailable = () => {
|
|
|
90
91
|
return customStorage !== null || react_native_1.Platform.OS === 'ios';
|
|
91
92
|
};
|
|
92
93
|
exports.isPersistentStorageAvailable = isPersistentStorageAvailable;
|
|
94
|
+
function getCustomStorage() {
|
|
95
|
+
return customStorage;
|
|
96
|
+
}
|