react-native-inapp-inspector 1.1.12 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/components/AnalyticsDetail.js +64 -21
- package/dist/commonjs/components/AnalyticsEventCard.js +100 -13
- package/dist/commonjs/components/HighlightText.js +1 -1
- package/dist/commonjs/components/JsonViewer.d.ts +3 -1
- package/dist/commonjs/components/JsonViewer.js +327 -9
- package/dist/commonjs/components/MetaAccordion.d.ts +10 -1
- package/dist/commonjs/components/MetaAccordion.js +121 -24
- package/dist/commonjs/components/NetworkIcons.d.ts +1 -0
- package/dist/commonjs/components/NetworkIcons.js +8 -1
- package/dist/commonjs/components/ReduxTreeView.d.ts +12 -3
- package/dist/commonjs/components/ReduxTreeView.js +1096 -278
- package/dist/commonjs/components/SectionHeader.d.ts +1 -1
- package/dist/commonjs/components/SectionHeader.js +7 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +42 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/reduxLogger.js +2 -0
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +15 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +4 -0
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.js +347 -444
- package/dist/commonjs/styles/index.d.ts +92 -33
- package/dist/commonjs/styles/index.js +101 -45
- package/dist/commonjs/types/index.d.ts +3 -0
- package/dist/esm/components/AnalyticsDetail.js +64 -21
- package/dist/esm/components/AnalyticsEventCard.js +100 -13
- package/dist/esm/components/HighlightText.js +3 -3
- package/dist/esm/components/JsonViewer.d.ts +3 -1
- package/dist/esm/components/JsonViewer.js +295 -10
- package/dist/esm/components/MetaAccordion.d.ts +10 -1
- package/dist/esm/components/MetaAccordion.js +90 -26
- package/dist/esm/components/NetworkIcons.d.ts +1 -0
- package/dist/esm/components/NetworkIcons.js +6 -0
- package/dist/esm/components/ReduxTreeView.d.ts +12 -3
- package/dist/esm/components/ReduxTreeView.js +1095 -279
- package/dist/esm/components/SectionHeader.d.ts +1 -1
- package/dist/esm/components/SectionHeader.js +8 -2
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/esm/customHooks/analyticsLogger.js +37 -0
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
- package/dist/esm/customHooks/reduxLogger.js +2 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +14 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +3 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +345 -446
- package/dist/esm/styles/index.d.ts +92 -33
- package/dist/esm/styles/index.js +101 -45
- package/dist/esm/types/index.d.ts +3 -0
- package/example/android/app/build.gradle +29 -1
- package/example/android/app/src/main/java/com/example/MainApplication.kt +25 -0
- package/example/android/build.gradle +31 -4
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradle.properties +1 -0
- package/example/android/settings.gradle +20 -1
- package/example/package-lock.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,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.1.
|
|
1
|
+
export declare const LIB_VERSION = "1.1.14";
|
|
@@ -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.14';
|
|
@@ -2,6 +2,14 @@ import { AnalyticsEvent } from '../types';
|
|
|
2
2
|
export declare const subscribeAnalyticsEvents: (callback: (events: AnalyticsEvent[]) => void) => () => void;
|
|
3
3
|
export declare const clearAnalyticsEvents: () => void;
|
|
4
4
|
export declare const getAnalyticsEvents: () => AnalyticsEvent[];
|
|
5
|
+
export declare const getCurrentUserProperties: () => {
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
};
|
|
8
|
+
export declare const getCurrentUserId: () => string;
|
|
9
|
+
export declare const getDefaultEventParameters: () => {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export declare const getCollectionEnabled: () => boolean;
|
|
5
13
|
/**
|
|
6
14
|
* Directly push an event into the inspector without going through Firebase.
|
|
7
15
|
* Useful for custom analytics wrappers or testing.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// setUserId(id)
|
|
23
23
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.autoSetupAnalyticsLogger = exports.setupAnalyticsLogger = exports.logAnalyticsEvent = exports.getAnalyticsEvents = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = void 0;
|
|
25
|
+
exports.autoSetupAnalyticsLogger = exports.setupAnalyticsLogger = exports.logAnalyticsEvent = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.getAnalyticsEvents = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = void 0;
|
|
26
26
|
// ─── Internal state ───────────────────────────────────────────────────────────
|
|
27
27
|
let events = [];
|
|
28
28
|
let listeners = [];
|
|
@@ -30,6 +30,8 @@ let counter = 0;
|
|
|
30
30
|
// Running snapshot of user properties set so far — attached to every event
|
|
31
31
|
let currentUserProperties = {};
|
|
32
32
|
let currentUserId;
|
|
33
|
+
let currentDefaultEventParameters = {};
|
|
34
|
+
let isCollectionEnabled = true;
|
|
33
35
|
// ─── Core helpers ─────────────────────────────────────────────────────────────
|
|
34
36
|
const notify = () => {
|
|
35
37
|
const snapshot = [...events];
|
|
@@ -56,6 +58,14 @@ const clearAnalyticsEvents = () => {
|
|
|
56
58
|
exports.clearAnalyticsEvents = clearAnalyticsEvents;
|
|
57
59
|
const getAnalyticsEvents = () => [...events];
|
|
58
60
|
exports.getAnalyticsEvents = getAnalyticsEvents;
|
|
61
|
+
const getCurrentUserProperties = () => ({ ...currentUserProperties });
|
|
62
|
+
exports.getCurrentUserProperties = getCurrentUserProperties;
|
|
63
|
+
const getCurrentUserId = () => currentUserId;
|
|
64
|
+
exports.getCurrentUserId = getCurrentUserId;
|
|
65
|
+
const getDefaultEventParameters = () => ({ ...currentDefaultEventParameters });
|
|
66
|
+
exports.getDefaultEventParameters = getDefaultEventParameters;
|
|
67
|
+
const getCollectionEnabled = () => isCollectionEnabled;
|
|
68
|
+
exports.getCollectionEnabled = getCollectionEnabled;
|
|
59
69
|
// ─── Manual logging (escape hatch, rarely needed) ────────────────────────────
|
|
60
70
|
/**
|
|
61
71
|
* Directly push an event into the inspector without going through Firebase.
|
|
@@ -154,8 +164,39 @@ const setupAnalyticsLogger = (analyticsInstance) => {
|
|
|
154
164
|
const originalSetUserId = analyticsInstance.setUserId.bind(analyticsInstance);
|
|
155
165
|
analyticsInstance.setUserId = async (id) => {
|
|
156
166
|
currentUserId = id ?? undefined;
|
|
167
|
+
notify();
|
|
157
168
|
return originalSetUserId(id);
|
|
158
169
|
};
|
|
170
|
+
// ── setDefaultEventParameters ──────────────────────────────────────────────
|
|
171
|
+
if (typeof analyticsInstance.setDefaultEventParameters === 'function') {
|
|
172
|
+
const originalSetDefaultEventParameters = analyticsInstance.setDefaultEventParameters.bind(analyticsInstance);
|
|
173
|
+
analyticsInstance.setDefaultEventParameters = async (params) => {
|
|
174
|
+
currentDefaultEventParameters = params ?? {};
|
|
175
|
+
notify();
|
|
176
|
+
return originalSetDefaultEventParameters(params);
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
// ── setAnalyticsCollectionEnabled ───────────────────────────────────────────
|
|
180
|
+
if (typeof analyticsInstance.setAnalyticsCollectionEnabled === 'function') {
|
|
181
|
+
const originalSetAnalyticsCollectionEnabled = analyticsInstance.setAnalyticsCollectionEnabled.bind(analyticsInstance);
|
|
182
|
+
analyticsInstance.setAnalyticsCollectionEnabled = async (enabled) => {
|
|
183
|
+
isCollectionEnabled = enabled;
|
|
184
|
+
notify();
|
|
185
|
+
return originalSetAnalyticsCollectionEnabled(enabled);
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
// ── resetAnalyticsData ──────────────────────────────────────────────────────
|
|
189
|
+
if (typeof analyticsInstance.resetAnalyticsData === 'function') {
|
|
190
|
+
const originalResetAnalyticsData = analyticsInstance.resetAnalyticsData.bind(analyticsInstance);
|
|
191
|
+
analyticsInstance.resetAnalyticsData = async () => {
|
|
192
|
+
(0, exports.clearAnalyticsEvents)();
|
|
193
|
+
currentUserProperties = {};
|
|
194
|
+
currentUserId = undefined;
|
|
195
|
+
currentDefaultEventParameters = {};
|
|
196
|
+
notify();
|
|
197
|
+
return originalResetAnalyticsData();
|
|
198
|
+
};
|
|
199
|
+
}
|
|
159
200
|
};
|
|
160
201
|
exports.setupAnalyticsLogger = setupAnalyticsLogger;
|
|
161
202
|
const autoSetupAnalyticsLogger = () => {
|
|
@@ -21,3 +21,4 @@ export declare const isAllValuesEmpty: (obj: Record<string, any>) => boolean;
|
|
|
21
21
|
export declare const formatDateTimeToAnalytics: (ts: number) => string;
|
|
22
22
|
export declare const getBundleIdentifier: () => string;
|
|
23
23
|
export declare const getAppName: () => string;
|
|
24
|
+
export declare const handleOpenExternalLink: (url: string) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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;
|
|
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");
|
|
@@ -327,3 +327,17 @@ const getAppName = () => {
|
|
|
327
327
|
return 'App';
|
|
328
328
|
};
|
|
329
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
|
+
}
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare const NetworkInspectorWrapper: (props: any) => React.JSX.Element;
|
|
|
3
3
|
export default NetworkInspectorWrapper;
|
|
4
4
|
export { setupNetworkLogger, clearNetworkLogs, subscribeNetworkLogs, addAxiosInterceptors, } from './customHooks/networkLogger';
|
|
5
5
|
export { setupConsoleLogger, clearConsoleLogs, subscribeConsoleLogs, } from './customHooks/consoleLogger';
|
|
6
|
-
export { setupAnalyticsLogger, logAnalyticsEvent, subscribeAnalyticsEvents, clearAnalyticsEvents, } from './customHooks/analyticsLogger';
|
|
6
|
+
export { setupAnalyticsLogger, logAnalyticsEvent, subscribeAnalyticsEvents, clearAnalyticsEvents, getCurrentUserProperties, getCurrentUserId, getDefaultEventParameters, getCollectionEnabled, } from './customHooks/analyticsLogger';
|
|
7
7
|
export { WebView, getWebViewLogs, getWebViewNavHistory, getWebViewHtml, getWebViewCss, getWebViewJs, getWebViewHtmlUrl, clearWebViewData, subscribeWebView, } from './customHooks/webViewLogger';
|
|
8
8
|
export { default as ErrorBoundary } from './components/ErrorBoundary';
|
|
9
9
|
export { connectReduxStore, inspectorReduxMiddleware, getReduxState, subscribeReduxState, getActionHistory, clearActionHistory, } from './customHooks/reduxLogger';
|