react-native-inapp-inspector 1.1.11 → 1.1.12
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 +57 -486
- package/dist/commonjs/components/AnalyticsEventCard.js +25 -25
- package/dist/commonjs/components/ConsoleLogCard.js +3 -1
- package/dist/commonjs/components/ReduxTreeView.d.ts +0 -14
- package/dist/commonjs/components/ReduxTreeView.js +43 -448
- 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/helpers/index.d.ts +2 -0
- package/dist/commonjs/helpers/index.js +89 -1
- package/dist/commonjs/index.js +299 -272
- package/dist/esm/components/AnalyticsDetail.js +58 -487
- package/dist/esm/components/AnalyticsEventCard.js +25 -25
- package/dist/esm/components/ConsoleLogCard.js +3 -1
- package/dist/esm/components/ReduxTreeView.d.ts +0 -14
- package/dist/esm/components/ReduxTreeView.js +43 -441
- 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/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/index.js +87 -1
- package/dist/esm/index.js +302 -275
- package/example/package-lock.json +33 -74
- package/example/package.json +1 -1
- package/package.json +1 -1
|
@@ -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.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,91 @@ 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;
|