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;
|
|
@@ -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,6 +1,14 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
|
-
import { Animated, Pressable, StyleSheet } from 'react-native';
|
|
2
|
+
import { Animated, Pressable, StyleSheet, Platform } from 'react-native';
|
|
3
3
|
const TouchableScale = ({ onPress, style, children, hitSlop, disabled, }) => {
|
|
4
|
+
if (Platform.OS === 'android') {
|
|
5
|
+
return (<Pressable disabled={disabled} onPress={onPress} hitSlop={hitSlop} style={({ pressed }) => [
|
|
6
|
+
style,
|
|
7
|
+
{ opacity: pressed ? 0.75 : 1 },
|
|
8
|
+
]}>
|
|
9
|
+
{children}
|
|
10
|
+
</Pressable>);
|
|
11
|
+
}
|
|
4
12
|
const scale = useRef(new Animated.Value(1)).current;
|
|
5
13
|
const opacity = useRef(new Animated.Value(1)).current;
|
|
6
14
|
const animatePress = (pressed) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.1.
|
|
1
|
+
export declare const 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,4 +1,4 @@
|
|
|
1
|
-
import { Clipboard, Platform, ToastAndroid, Alert } 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
|
|
@@ -216,3 +216,102 @@ export const formatDateTimeToAnalytics = (ts) => {
|
|
|
216
216
|
second: '2-digit',
|
|
217
217
|
});
|
|
218
218
|
};
|
|
219
|
+
export const getBundleIdentifier = () => {
|
|
220
|
+
const RNDeviceInfo = NativeModules.RNDeviceInfo;
|
|
221
|
+
if (RNDeviceInfo && typeof RNDeviceInfo.bundleId === 'string') {
|
|
222
|
+
return RNDeviceInfo.bundleId;
|
|
223
|
+
}
|
|
224
|
+
if (RNDeviceInfo && typeof RNDeviceInfo.getBundleId === 'function') {
|
|
225
|
+
try {
|
|
226
|
+
const res = RNDeviceInfo.getBundleId();
|
|
227
|
+
if (typeof res === 'string')
|
|
228
|
+
return res;
|
|
229
|
+
}
|
|
230
|
+
catch (e) { }
|
|
231
|
+
}
|
|
232
|
+
const ExponentConstants = NativeModules.ExponentConstants;
|
|
233
|
+
if (ExponentConstants && ExponentConstants.manifest) {
|
|
234
|
+
const manifest = ExponentConstants.manifest;
|
|
235
|
+
if (manifest.ios && manifest.ios.bundleIdentifier) {
|
|
236
|
+
return manifest.ios.bundleIdentifier;
|
|
237
|
+
}
|
|
238
|
+
if (manifest.android && manifest.android.package) {
|
|
239
|
+
return manifest.android.package;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const ExpoApplication = NativeModules.ExpoApplication;
|
|
243
|
+
if (ExpoApplication && typeof ExpoApplication.applicationId === 'string') {
|
|
244
|
+
return ExpoApplication.applicationId;
|
|
245
|
+
}
|
|
246
|
+
const SourceCode = NativeModules.SourceCode;
|
|
247
|
+
if (SourceCode && typeof SourceCode.scriptURL === 'string') {
|
|
248
|
+
const url = SourceCode.scriptURL;
|
|
249
|
+
if (url.includes('assets/')) {
|
|
250
|
+
try {
|
|
251
|
+
const match = url.match(/assets\/([^/?#]+)/);
|
|
252
|
+
if (match && match[1]) {
|
|
253
|
+
return match[1];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
catch (e) { }
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return 'org.reactjs.native.example';
|
|
260
|
+
};
|
|
261
|
+
export const getAppName = () => {
|
|
262
|
+
// Try iOS via PlatformConstants
|
|
263
|
+
const constants = NativeModules.PlatformConstants;
|
|
264
|
+
if (constants && typeof constants.interfaceIdiom === 'string') {
|
|
265
|
+
// On iOS, try to get display name from the main bundle
|
|
266
|
+
const SettingsManager = NativeModules.SettingsManager;
|
|
267
|
+
if (SettingsManager && SettingsManager.settings) {
|
|
268
|
+
const appName = SettingsManager.settings.AppleLocale
|
|
269
|
+
? undefined
|
|
270
|
+
: undefined;
|
|
271
|
+
// Fallback: try to parse from SourceCode
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
// Try react-native-device-info
|
|
275
|
+
const RNDeviceInfo = NativeModules.RNDeviceInfo;
|
|
276
|
+
if (RNDeviceInfo && typeof RNDeviceInfo.appName === 'string') {
|
|
277
|
+
return RNDeviceInfo.appName;
|
|
278
|
+
}
|
|
279
|
+
// Try Expo
|
|
280
|
+
const ExpoApplication = NativeModules.ExpoApplication;
|
|
281
|
+
if (ExpoApplication && typeof ExpoApplication.applicationName === 'string') {
|
|
282
|
+
return ExpoApplication.applicationName;
|
|
283
|
+
}
|
|
284
|
+
const ExponentConstants = NativeModules.ExponentConstants;
|
|
285
|
+
if (ExponentConstants && ExponentConstants.manifest) {
|
|
286
|
+
const manifest = ExponentConstants.manifest;
|
|
287
|
+
if (manifest.name)
|
|
288
|
+
return manifest.name;
|
|
289
|
+
}
|
|
290
|
+
// Android: try to get from AndroidInfoModule
|
|
291
|
+
const AppInfo = NativeModules.AppInfo;
|
|
292
|
+
if (AppInfo && typeof AppInfo.appName === 'string') {
|
|
293
|
+
return AppInfo.appName;
|
|
294
|
+
}
|
|
295
|
+
// Fallback: derive from bundle ID (last segment, cleaned up)
|
|
296
|
+
const bundleId = getBundleIdentifier();
|
|
297
|
+
if (bundleId && bundleId !== 'org.reactjs.native.example') {
|
|
298
|
+
const parts = bundleId.split('.');
|
|
299
|
+
const last = parts[parts.length - 1];
|
|
300
|
+
// Capitalize first letter
|
|
301
|
+
return last ? last.charAt(0).toUpperCase() + last.slice(1) : 'App';
|
|
302
|
+
}
|
|
303
|
+
return 'App';
|
|
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;
|