react-native-inapp-inspector 2.2.9 → 2.3.1
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/AppHeaderLogo.js +45 -12
- package/dist/commonjs/components/BrandSquareIcon.js +92 -49
- package/dist/commonjs/components/EmptyState.d.ts +7 -2
- package/dist/commonjs/components/EmptyState.js +11 -5
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +29 -18
- package/dist/commonjs/components/Inspector/ConsoleTab.js +6 -1
- package/dist/commonjs/components/Inspector/CrashDetail.js +43 -9
- package/dist/commonjs/components/Inspector/CrashTab.js +34 -3
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +80 -16
- package/dist/commonjs/components/Inspector/InspectorHeader.js +16 -3
- package/dist/commonjs/components/Inspector/MainScreen.js +7 -11
- package/dist/commonjs/components/Inspector/NetworkDetail.js +3 -2
- package/dist/commonjs/components/Inspector/NetworkTab.js +103 -4
- package/dist/commonjs/components/Inspector/ReduxTab.js +19 -3
- package/dist/commonjs/components/Inspector/SettingsPanel.js +4 -4
- package/dist/commonjs/components/Inspector/StorageTab.js +123 -92
- package/dist/commonjs/components/JsonViewer.js +2 -0
- package/dist/commonjs/components/MetaAccordion.js +15 -3
- package/dist/commonjs/components/SkeletonPlaceholder.d.ts +6 -0
- package/dist/commonjs/components/SkeletonPlaceholder.js +208 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/networkLogger.d.ts +3 -0
- package/dist/commonjs/customHooks/networkLogger.js +10 -1
- package/dist/commonjs/customHooks/storageInspector.d.ts +2 -2
- package/dist/commonjs/customHooks/storageInspector.js +17 -13
- package/dist/commonjs/helpers/index.d.ts +6 -0
- package/dist/commonjs/helpers/index.js +196 -6
- package/dist/commonjs/helpers/searchQueryParser.js +62 -20
- package/dist/commonjs/i18n/index.d.ts +13 -0
- package/dist/commonjs/i18n/index.js +35 -2
- package/dist/commonjs/index.d.ts +3 -0
- package/dist/commonjs/index.js +108 -35
- package/dist/commonjs/styles/AppColors.d.ts +4 -0
- package/dist/commonjs/styles/AppColors.js +11 -1
- package/dist/commonjs/styles/AppFonts.d.ts +11 -0
- package/dist/commonjs/styles/AppFonts.js +11 -1
- package/dist/commonjs/types/interfaces.d.ts +2 -2
- package/dist/esm/components/AppHeaderLogo.js +45 -12
- package/dist/esm/components/BrandSquareIcon.js +92 -49
- package/dist/esm/components/EmptyState.d.ts +7 -2
- package/dist/esm/components/EmptyState.js +11 -5
- package/dist/esm/components/Inspector/AnalyticsTab.js +30 -19
- package/dist/esm/components/Inspector/ConsoleTab.js +6 -1
- package/dist/esm/components/Inspector/CrashDetail.js +43 -9
- package/dist/esm/components/Inspector/CrashTab.js +34 -3
- package/dist/esm/components/Inspector/DeviceInfoTab.js +80 -16
- package/dist/esm/components/Inspector/InspectorHeader.js +17 -4
- package/dist/esm/components/Inspector/MainScreen.js +8 -12
- package/dist/esm/components/Inspector/NetworkDetail.js +3 -2
- package/dist/esm/components/Inspector/NetworkTab.js +103 -4
- package/dist/esm/components/Inspector/ReduxTab.js +19 -3
- package/dist/esm/components/Inspector/SettingsPanel.js +4 -4
- package/dist/esm/components/Inspector/StorageTab.js +124 -93
- package/dist/esm/components/JsonViewer.js +2 -0
- package/dist/esm/components/MetaAccordion.js +15 -3
- package/dist/esm/components/SkeletonPlaceholder.d.ts +6 -0
- package/dist/esm/components/SkeletonPlaceholder.js +173 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/networkLogger.d.ts +3 -0
- package/dist/esm/customHooks/networkLogger.js +8 -0
- package/dist/esm/customHooks/storageInspector.d.ts +2 -2
- package/dist/esm/customHooks/storageInspector.js +17 -13
- package/dist/esm/helpers/index.d.ts +6 -0
- package/dist/esm/helpers/index.js +193 -5
- package/dist/esm/helpers/searchQueryParser.js +62 -20
- package/dist/esm/i18n/index.d.ts +13 -0
- package/dist/esm/i18n/index.js +33 -3
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +97 -37
- package/dist/esm/styles/AppColors.d.ts +4 -0
- package/dist/esm/styles/AppColors.js +9 -0
- package/dist/esm/styles/AppFonts.d.ts +11 -0
- package/dist/esm/styles/AppFonts.js +9 -0
- package/dist/esm/types/interfaces.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/AppHeaderLogo.tsx +46 -12
- package/src/components/BrandSquareIcon.tsx +127 -78
- package/src/components/EmptyState.tsx +27 -5
- package/src/components/Inspector/AnalyticsTab.tsx +48 -27
- package/src/components/Inspector/ConsoleTab.tsx +10 -0
- package/src/components/Inspector/CrashDetail.tsx +65 -9
- package/src/components/Inspector/CrashTab.tsx +41 -3
- package/src/components/Inspector/DeviceInfoTab.tsx +87 -16
- package/src/components/Inspector/InspectorHeader.tsx +24 -4
- package/src/components/Inspector/MainScreen.tsx +7 -11
- package/src/components/Inspector/NetworkDetail.tsx +4 -4
- package/src/components/Inspector/NetworkTab.tsx +129 -4
- package/src/components/Inspector/ReduxTab.tsx +26 -8
- package/src/components/Inspector/SettingsPanel.tsx +4 -4
- package/src/components/Inspector/StorageTab.tsx +191 -117
- package/src/components/JsonViewer.tsx +2 -0
- package/src/components/MetaAccordion.tsx +18 -3
- package/src/components/SkeletonPlaceholder.tsx +206 -0
- package/src/constants/version.ts +1 -1
- package/src/customHooks/networkLogger.ts +15 -0
- package/src/customHooks/storageInspector.ts +18 -14
- package/src/helpers/index.ts +213 -5
- package/src/helpers/searchQueryParser.ts +63 -20
- package/src/i18n/index.ts +38 -3
- package/src/index.tsx +124 -37
- package/src/styles/AppColors.ts +9 -0
- package/src/styles/AppFonts.ts +16 -0
- package/src/types/interfaces.ts +2 -2
package/dist/commonjs/index.js
CHANGED
|
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.registerComponentProfile = exports.getHermesMemoryStats = exports.measureAsync = exports.trackHeavyTask = exports.trackNavigationTransition = exports.trackComponentRender = exports.useNavigationProfiler = exports.useComponentProfiler = exports.usePerformanceTracker = exports.registerGAPlugin = exports.getEventCategory = exports.getLastActionForReducer = exports.clearActionHistory = exports.getActionHistory = exports.subscribeReduxState = exports.getReduxState = exports.inspectorReduxMiddleware = exports.connectReduxStore = exports.ErrorBoundary = exports.CrashTab = exports.computeCrashFingerprint = exports.recordUserActionBreadcrumb = exports.recordReduxBreadcrumb = exports.recordNetworkBreadcrumb = exports.recordNavigationBreadcrumb = exports.addCrashBreadcrumb = exports.recordCustomCrash = exports.parseCrashStackTrace = exports.exportCrashReport = exports.simulateTestCrash = exports.clearCrashRecords = exports.getCrashRecords = exports.emitCrashEvent = exports.subscribeCrashEvents = exports.setupGlobalCrashHandler = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.logAnalyticsEvent = exports.setupAnalyticsLogger = exports.subscribeConsoleLogs = exports.clearConsoleLogs = exports.setupConsoleLogger = exports.addAxiosInterceptors = exports.subscribeNetworkLogs = exports.clearNetworkLogs = exports.setupNetworkLogger = void 0;
|
|
40
40
|
exports.connectMMKV = exports.connectAsyncStorage = exports.BrandCircleIcon = exports.BrandSquareIcon = exports.prunePerformanceEvents = exports.getMaxPerformanceEventsLimit = exports.setMaxPerformanceEventsLimit = exports.pruneCrashRecords = exports.getMaxCrashLogsLimit = exports.pruneAnalyticsLogs = exports.getMaxAnalyticsLogsLimit = exports.setMaxAnalyticsLogsLimit = exports.pruneReduxHistory = exports.getMaxReduxHistoryLimit = exports.setMaxReduxHistoryLimit = exports.pruneConsoleLogs = exports.getMaxConsoleLogsLimit = exports.setMaxConsoleLogsLimit = exports.pruneNetworkLogs = exports.getMaxNetworkLogsLimit = exports.setMaxNetworkLogsLimit = exports.subscribeMemoryWarning = exports.pruneAllLogs = exports.setupMemoryWarningHandler = exports.isNativeModuleAvailable = exports.setNativeStorageItem = exports.getNativeStorageItem = exports.getNativeFpsMetrics = exports.stopNativeFpsMonitoring = exports.startNativeFpsMonitoring = exports.subscribeNativeDeviceShake = exports.subscribeNativeFloatingButtonPress = exports.setNativeFloatingButtonBadge = exports.hideNativeFloatingButton = exports.showNativeFloatingButton = exports.subscribeNativeCrashes = exports.enableNativeCrashProtection = exports.getNativeDeviceMetrics = exports.InspectCatch = exports.InspectTrackTime = exports.InspectLog = exports.generateFixSnippet = exports.getInitialPerformanceEvents = exports.getInitialRenderProfiles = exports.getPerformanceEvents = exports.subscribePerformanceEvents = exports.clearPerformanceEvents = exports.logPerformanceEvent = exports.getRenderProfiles = exports.subscribeRenderProfiles = void 0;
|
|
41
|
-
exports.BreadcrumbType = exports.CrashFilterType = exports.CrashDetailSubTab = exports.CrashExportFormat = exports.CrashType = exports.PerformanceSubTab = exports.BundleSubTab = exports.DiffResultType = exports.StackFrameType = exports.GAEventCategory = exports.AnalyticsEventSource = exports.ConsoleLogType = exports.LogFilter = exports.SettingsSubTab = exports.SettingsPage = exports.ModalAnimationType = exports.LocalFilter = exports.SortOrder = exports.StatusFilter = exports.Method = exports.ActiveTab = exports.subscribeToStorageChanges = exports.clearStorageDriver = exports.removeStorageEntry = exports.setStorageEntry = exports.fetchStorageEntries = exports.getRegisteredMMKVInstanceIds = exports.isMMKVConnected = exports.isAsyncStorageConnected = void 0;
|
|
41
|
+
exports.I18nextProvider = exports.setTranslations = exports.addTranslations = exports.setLanguage = exports.useTranslation = exports.i18n = exports.t = exports.updateAppColorsTheme = exports.getThemeColors = exports.setAppColors = exports.AppColors = exports.setAppFonts = exports.AppFonts = exports.BreadcrumbType = exports.CrashFilterType = exports.CrashDetailSubTab = exports.CrashExportFormat = exports.CrashType = exports.PerformanceSubTab = exports.BundleSubTab = exports.DiffResultType = exports.StackFrameType = exports.GAEventCategory = exports.AnalyticsEventSource = exports.ConsoleLogType = exports.LogFilter = exports.SettingsSubTab = exports.SettingsPage = exports.ModalAnimationType = exports.LocalFilter = exports.SortOrder = exports.StatusFilter = exports.Method = exports.ActiveTab = exports.subscribeToStorageChanges = exports.clearStorageDriver = exports.removeStorageEntry = exports.setStorageEntry = exports.fetchStorageEntries = exports.getRegisteredMMKVInstanceIds = exports.isMMKVConnected = exports.isAsyncStorageConnected = void 0;
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const react_native_1 = require("react-native");
|
|
44
44
|
const native_1 = require("@react-navigation/native");
|
|
@@ -68,7 +68,7 @@ const NativeInspector_2 = require("./native/NativeInspector");
|
|
|
68
68
|
const constants_1 = require("./constants");
|
|
69
69
|
// Stylesheet
|
|
70
70
|
const styles_1 = require("./styles");
|
|
71
|
-
const NetworkInspector = ({ enabled = true,
|
|
71
|
+
const NetworkInspector = ({ enabled = true, storage, navigationRef, appIcon, environment, initialVisible = false, visible: controlledVisible, }) => {
|
|
72
72
|
// Set custom storage synchronously during render phase
|
|
73
73
|
(0, settingsStore_1.setCustomStorage)(storage || null);
|
|
74
74
|
const [isDark, setIsDark] = (0, react_1.useState)(false);
|
|
@@ -80,7 +80,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
80
80
|
const [modalHeightPercent, setModalHeightPercent] = (0, react_1.useState)(90);
|
|
81
81
|
const [modalAnimationType, setModalAnimationType] = (0, react_1.useState)('slide');
|
|
82
82
|
const [logs, setLogs] = (0, react_1.useState)([]);
|
|
83
|
-
const [visible, setVisible] = (0, react_1.useState)(
|
|
83
|
+
const [visible, setVisible] = (0, react_1.useState)(controlledVisible ?? initialVisible ?? false);
|
|
84
84
|
(0, react_1.useEffect)(() => {
|
|
85
85
|
if (controlledVisible !== undefined) {
|
|
86
86
|
setVisible(controlledVisible);
|
|
@@ -224,8 +224,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
224
224
|
bundle: false,
|
|
225
225
|
performance: false,
|
|
226
226
|
crash: false,
|
|
227
|
-
device:
|
|
228
|
-
storage:
|
|
227
|
+
device: false,
|
|
228
|
+
storage: false,
|
|
229
229
|
});
|
|
230
230
|
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(100);
|
|
231
231
|
const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(75);
|
|
@@ -280,8 +280,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
280
280
|
bundle: false,
|
|
281
281
|
performance: false,
|
|
282
282
|
crash: false,
|
|
283
|
-
device:
|
|
284
|
-
storage:
|
|
283
|
+
device: false,
|
|
284
|
+
storage: false,
|
|
285
285
|
});
|
|
286
286
|
setDefaultTab('apis');
|
|
287
287
|
setIsAutoRamLimitEnabled(true);
|
|
@@ -355,6 +355,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
355
355
|
bundle: false,
|
|
356
356
|
performance: false,
|
|
357
357
|
crash: false,
|
|
358
|
+
device: false,
|
|
359
|
+
storage: false,
|
|
358
360
|
},
|
|
359
361
|
...(saved.tabVisibility || {}),
|
|
360
362
|
apis: true,
|
|
@@ -580,12 +582,21 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
580
582
|
const navigationContext = react_1.default.useContext(native_1.NavigationContext);
|
|
581
583
|
const hasNavigationContext = navigationContext !== undefined;
|
|
582
584
|
const currentRouteRef = (0, react_1.useRef)({
|
|
583
|
-
path: '
|
|
585
|
+
path: '',
|
|
584
586
|
params: null,
|
|
585
587
|
});
|
|
588
|
+
(0, react_1.useEffect)(() => {
|
|
589
|
+
(0, networkLogger_1.setRouteInfoProvider)(() => currentRouteRef.current);
|
|
590
|
+
return () => {
|
|
591
|
+
(0, networkLogger_1.setRouteInfoProvider)(null);
|
|
592
|
+
};
|
|
593
|
+
}, []);
|
|
586
594
|
(0, react_1.useEffect)(() => {
|
|
587
595
|
if (navState) {
|
|
588
|
-
|
|
596
|
+
const info = (0, helpers_1.getNavigationInfo)(navState);
|
|
597
|
+
if (info?.path) {
|
|
598
|
+
currentRouteRef.current = info;
|
|
599
|
+
}
|
|
589
600
|
}
|
|
590
601
|
}, [navState]);
|
|
591
602
|
(0, react_1.useEffect)(() => {
|
|
@@ -594,9 +605,22 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
594
605
|
const updateState = () => {
|
|
595
606
|
try {
|
|
596
607
|
if (typeof navigationRef.isReady === 'function' && navigationRef.isReady()) {
|
|
608
|
+
const currentRoute = typeof navigationRef.getCurrentRoute === 'function'
|
|
609
|
+
? navigationRef.getCurrentRoute()
|
|
610
|
+
: null;
|
|
611
|
+
if (currentRoute?.name) {
|
|
612
|
+
currentRouteRef.current = {
|
|
613
|
+
path: currentRoute.name,
|
|
614
|
+
params: currentRoute.params || null,
|
|
615
|
+
};
|
|
616
|
+
}
|
|
597
617
|
const state = navigationRef.getRootState();
|
|
598
618
|
if (state) {
|
|
599
619
|
setNavState(state);
|
|
620
|
+
const routeInfo = (0, helpers_1.getNavigationInfo)(state);
|
|
621
|
+
if (routeInfo?.path) {
|
|
622
|
+
currentRouteRef.current = routeInfo;
|
|
623
|
+
}
|
|
600
624
|
}
|
|
601
625
|
}
|
|
602
626
|
}
|
|
@@ -760,22 +784,26 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
760
784
|
const useNativeFab = (react_native_1.Platform.OS === 'ios' || react_native_1.Platform.OS === 'android') && isNativeModule;
|
|
761
785
|
// 100% Native Main-Thread Floating Button Lifecycle
|
|
762
786
|
(0, react_1.useEffect)(() => {
|
|
763
|
-
if (!useNativeFab || !
|
|
787
|
+
if (!useNativeFab || !enabled) {
|
|
764
788
|
if (useNativeFab) {
|
|
765
|
-
(0, NativeInspector_2.hideNativeFloatingButton)();
|
|
789
|
+
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
766
790
|
}
|
|
767
791
|
return;
|
|
768
792
|
}
|
|
769
793
|
if (visible) {
|
|
770
|
-
(0, NativeInspector_2.hideNativeFloatingButton)();
|
|
794
|
+
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
771
795
|
}
|
|
772
796
|
else {
|
|
773
|
-
(0, NativeInspector_2.showNativeFloatingButton)();
|
|
774
|
-
(0, NativeInspector_2.setNativeFloatingButtonBadge)(logs.length > 0 || analyticsEvents.length > 0);
|
|
797
|
+
(0, NativeInspector_2.showNativeFloatingButton)().catch(() => { });
|
|
798
|
+
(0, NativeInspector_2.setNativeFloatingButtonBadge)(logs.length > 0 || analyticsEvents.length > 0).catch(() => { });
|
|
775
799
|
}
|
|
800
|
+
return () => {
|
|
801
|
+
if (useNativeFab) {
|
|
802
|
+
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
803
|
+
}
|
|
804
|
+
};
|
|
776
805
|
}, [
|
|
777
806
|
useNativeFab,
|
|
778
|
-
isEnabled,
|
|
779
807
|
enabled,
|
|
780
808
|
visible,
|
|
781
809
|
logs.length,
|
|
@@ -834,20 +862,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
834
862
|
if (freshCrashes.length > 0) {
|
|
835
863
|
setCrashRecords(freshCrashes);
|
|
836
864
|
}
|
|
837
|
-
|
|
838
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
839
|
-
}, [visible]);
|
|
840
|
-
(0, react_1.useEffect)(() => {
|
|
841
|
-
if (visible) {
|
|
842
|
-
const task = react_native_1.InteractionManager.runAfterInteractions(() => {
|
|
865
|
+
const frame = requestAnimationFrame(() => {
|
|
843
866
|
setIsReady(true);
|
|
844
867
|
});
|
|
845
|
-
const fallbackTimer = setTimeout(() => {
|
|
846
|
-
setIsReady(true);
|
|
847
|
-
}, 350);
|
|
848
868
|
return () => {
|
|
849
|
-
|
|
850
|
-
clearTimeout(fallbackTimer);
|
|
869
|
+
cancelAnimationFrame(frame);
|
|
851
870
|
};
|
|
852
871
|
}
|
|
853
872
|
else {
|
|
@@ -908,7 +927,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
908
927
|
if (freshIds.size > 0) {
|
|
909
928
|
freshIds.forEach(id => {
|
|
910
929
|
if (!logRouteMapRef.current.has(id)) {
|
|
911
|
-
|
|
930
|
+
const matchedLog = deduped.find(l => l.id === id);
|
|
931
|
+
const resolvedRoute = matchedLog?.routeInfo || currentRouteRef.current;
|
|
932
|
+
logRouteMapRef.current.set(id, resolvedRoute);
|
|
912
933
|
}
|
|
913
934
|
});
|
|
914
935
|
setNewLogIds(freshIds);
|
|
@@ -921,6 +942,12 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
921
942
|
const deduped = (0, helpers_1.deduplicateLogs)(raw);
|
|
922
943
|
const incoming = new Set(deduped.map(l => l.id));
|
|
923
944
|
prevLogIdsRef.current = incoming;
|
|
945
|
+
deduped.forEach(l => {
|
|
946
|
+
if (!logRouteMapRef.current.has(l.id)) {
|
|
947
|
+
const resolvedRoute = l?.routeInfo || currentRouteRef.current;
|
|
948
|
+
logRouteMapRef.current.set(l.id, resolvedRoute);
|
|
949
|
+
}
|
|
950
|
+
});
|
|
924
951
|
setLogs(deduped);
|
|
925
952
|
}
|
|
926
953
|
else {
|
|
@@ -1192,8 +1219,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1192
1219
|
const groups = [];
|
|
1193
1220
|
for (let i = 0; i < filteredLogs.length; i++) {
|
|
1194
1221
|
const log = filteredLogs[i];
|
|
1195
|
-
const routeInfo = logRouteMapRef.current.get(log.id);
|
|
1196
|
-
const pageName =
|
|
1222
|
+
const routeInfo = logRouteMapRef.current.get(log.id) || log?.routeInfo;
|
|
1223
|
+
const pageName = (0, helpers_1.getLogPageName)(log, routeInfo);
|
|
1197
1224
|
if (groups.length === 0 ||
|
|
1198
1225
|
groups[groups.length - 1].pageName !== pageName) {
|
|
1199
1226
|
groups.push({ pageName, color: (0, helpers_1.getDomainColor)(pageName), logs: [] });
|
|
@@ -1446,7 +1473,28 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1446
1473
|
log.type || '',
|
|
1447
1474
|
log.sourceMethod || '',
|
|
1448
1475
|
].join(' ').toLowerCase();
|
|
1449
|
-
return queryTokens.every(token =>
|
|
1476
|
+
return queryTokens.every(token => {
|
|
1477
|
+
if (token.startsWith('level:') || token.startsWith('is:') || token.startsWith('type:')) {
|
|
1478
|
+
const flag = token.replace(/^(level:|is:|type:)/, '').trim();
|
|
1479
|
+
if (flag === 'error' || flag === 'err')
|
|
1480
|
+
return log.type === 'error';
|
|
1481
|
+
if (flag === 'warn' || flag === 'warning')
|
|
1482
|
+
return log.type === 'warn';
|
|
1483
|
+
if (flag === 'info')
|
|
1484
|
+
return log.type === 'info';
|
|
1485
|
+
if (flag === 'log')
|
|
1486
|
+
return log.sourceMethod === 'log';
|
|
1487
|
+
if (flag === 'analytics')
|
|
1488
|
+
return (log.message || '').toLowerCase().includes('[analytics');
|
|
1489
|
+
}
|
|
1490
|
+
if (token === 'error' || token === 'err') {
|
|
1491
|
+
return log.type === 'error' || searchTarget.includes(token);
|
|
1492
|
+
}
|
|
1493
|
+
if (token === 'warn' || token === 'warning') {
|
|
1494
|
+
return log.type === 'warn' || searchTarget.includes(token);
|
|
1495
|
+
}
|
|
1496
|
+
return searchTarget.includes(token);
|
|
1497
|
+
});
|
|
1450
1498
|
});
|
|
1451
1499
|
}
|
|
1452
1500
|
// #7 — apply sort order (newest/oldest first)
|
|
@@ -1654,7 +1702,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1654
1702
|
setVisible,
|
|
1655
1703
|
closeModal,
|
|
1656
1704
|
isReady,
|
|
1657
|
-
|
|
1705
|
+
enabled,
|
|
1706
|
+
isEnabled: enabled,
|
|
1658
1707
|
appIcon,
|
|
1659
1708
|
environment,
|
|
1660
1709
|
modalHeightPercent,
|
|
@@ -1831,14 +1880,22 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1831
1880
|
</InspectorContext_1.InspectorContext.Provider>);
|
|
1832
1881
|
};
|
|
1833
1882
|
const NetworkInspectorWrapper = (props) => {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1883
|
+
const enabled = props?.enabled ?? true;
|
|
1884
|
+
(0, react_1.useEffect)(() => {
|
|
1885
|
+
if (!enabled) {
|
|
1886
|
+
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
1887
|
+
}
|
|
1888
|
+
return () => {
|
|
1889
|
+
(0, NativeInspector_2.hideNativeFloatingButton)().catch(() => { });
|
|
1890
|
+
};
|
|
1891
|
+
}, [enabled]);
|
|
1892
|
+
// If enabled is false, return null immediately with 0 overhead
|
|
1893
|
+
if (!enabled) {
|
|
1837
1894
|
return null;
|
|
1838
1895
|
}
|
|
1839
1896
|
return (<i18n_1.I18nextProvider i18n={i18n_1.i18n}>
|
|
1840
1897
|
<ErrorBoundary_1.default fallbackType="inline">
|
|
1841
|
-
<NetworkInspector {...props}/>
|
|
1898
|
+
<NetworkInspector {...props} enabled={enabled}/>
|
|
1842
1899
|
</ErrorBoundary_1.default>
|
|
1843
1900
|
</i18n_1.I18nextProvider>);
|
|
1844
1901
|
};
|
|
@@ -1994,3 +2051,19 @@ Object.defineProperty(exports, "CrashExportFormat", { enumerable: true, get: fun
|
|
|
1994
2051
|
Object.defineProperty(exports, "CrashDetailSubTab", { enumerable: true, get: function () { return types_1.CrashDetailSubTab; } });
|
|
1995
2052
|
Object.defineProperty(exports, "CrashFilterType", { enumerable: true, get: function () { return types_1.CrashFilterType; } });
|
|
1996
2053
|
Object.defineProperty(exports, "BreadcrumbType", { enumerable: true, get: function () { return types_1.BreadcrumbType; } });
|
|
2054
|
+
var AppFonts_1 = require("./styles/AppFonts");
|
|
2055
|
+
Object.defineProperty(exports, "AppFonts", { enumerable: true, get: function () { return AppFonts_1.AppFonts; } });
|
|
2056
|
+
Object.defineProperty(exports, "setAppFonts", { enumerable: true, get: function () { return AppFonts_1.setAppFonts; } });
|
|
2057
|
+
var AppColors_1 = require("./styles/AppColors");
|
|
2058
|
+
Object.defineProperty(exports, "AppColors", { enumerable: true, get: function () { return AppColors_1.AppColors; } });
|
|
2059
|
+
Object.defineProperty(exports, "setAppColors", { enumerable: true, get: function () { return AppColors_1.setAppColors; } });
|
|
2060
|
+
Object.defineProperty(exports, "getThemeColors", { enumerable: true, get: function () { return AppColors_1.getThemeColors; } });
|
|
2061
|
+
Object.defineProperty(exports, "updateAppColorsTheme", { enumerable: true, get: function () { return AppColors_1.updateAppColorsTheme; } });
|
|
2062
|
+
var i18n_2 = require("./i18n");
|
|
2063
|
+
Object.defineProperty(exports, "t", { enumerable: true, get: function () { return i18n_2.t; } });
|
|
2064
|
+
Object.defineProperty(exports, "i18n", { enumerable: true, get: function () { return i18n_2.i18n; } });
|
|
2065
|
+
Object.defineProperty(exports, "useTranslation", { enumerable: true, get: function () { return i18n_2.useTranslation; } });
|
|
2066
|
+
Object.defineProperty(exports, "setLanguage", { enumerable: true, get: function () { return i18n_2.setLanguage; } });
|
|
2067
|
+
Object.defineProperty(exports, "addTranslations", { enumerable: true, get: function () { return i18n_2.addTranslations; } });
|
|
2068
|
+
Object.defineProperty(exports, "setTranslations", { enumerable: true, get: function () { return i18n_2.setTranslations; } });
|
|
2069
|
+
Object.defineProperty(exports, "I18nextProvider", { enumerable: true, get: function () { return i18n_2.I18nextProvider; } });
|
|
@@ -344,4 +344,8 @@ export declare const getThemeColors: (isDark: boolean) => {
|
|
|
344
344
|
};
|
|
345
345
|
export declare const AppColors: typeof LightColors;
|
|
346
346
|
export declare const updateAppColorsTheme: (isDark: boolean) => void;
|
|
347
|
+
/**
|
|
348
|
+
* Configure or override specific color tokens used throughout the inspector.
|
|
349
|
+
*/
|
|
350
|
+
export declare const setAppColors: (customColors: Partial<typeof LightColors>) => void;
|
|
347
351
|
export default AppColors;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateAppColorsTheme = exports.AppColors = exports.getThemeColors = void 0;
|
|
3
|
+
exports.setAppColors = exports.updateAppColorsTheme = exports.AppColors = exports.getThemeColors = void 0;
|
|
4
4
|
const LightColors = {
|
|
5
5
|
// ─── Core (Thai Airways Royal Palette) ───
|
|
6
6
|
primaryLight: '#FFFFFF',
|
|
@@ -389,4 +389,14 @@ const updateAppColorsTheme = (isDark) => {
|
|
|
389
389
|
Object.assign(exports.AppColors, (0, exports.getThemeColors)(isDark));
|
|
390
390
|
};
|
|
391
391
|
exports.updateAppColorsTheme = updateAppColorsTheme;
|
|
392
|
+
/**
|
|
393
|
+
* Configure or override specific color tokens used throughout the inspector.
|
|
394
|
+
*/
|
|
395
|
+
const setAppColors = (customColors) => {
|
|
396
|
+
if (!customColors || typeof customColors !== 'object')
|
|
397
|
+
return;
|
|
398
|
+
Object.assign(exports.AppColors, customColors);
|
|
399
|
+
Object.assign(LightColors, customColors);
|
|
400
|
+
};
|
|
401
|
+
exports.setAppColors = setAppColors;
|
|
392
402
|
exports.default = exports.AppColors;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
export interface AppFontConfig {
|
|
2
|
+
interRegular?: string;
|
|
3
|
+
interMedium?: string;
|
|
4
|
+
interBold?: string;
|
|
5
|
+
Sfprotext?: string;
|
|
6
|
+
}
|
|
1
7
|
export declare const AppFonts: {
|
|
2
8
|
interRegular: string;
|
|
3
9
|
interMedium: string;
|
|
4
10
|
interBold: string;
|
|
5
11
|
Sfprotext: string;
|
|
6
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Configure or override font families used across all inspector screens.
|
|
15
|
+
* Useful when integrating into apps with custom font setups or system fonts.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAppFonts: (customFonts: Partial<typeof AppFonts>) => void;
|
|
7
18
|
export default AppFonts;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AppFonts = void 0;
|
|
3
|
+
exports.setAppFonts = exports.AppFonts = void 0;
|
|
4
4
|
exports.AppFonts = {
|
|
5
5
|
interRegular: 'Inter-Regular',
|
|
6
6
|
interMedium: 'Inter-Medium',
|
|
7
7
|
interBold: 'Inter-Bold',
|
|
8
8
|
Sfprotext: 'Inter-Regular',
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Configure or override font families used across all inspector screens.
|
|
12
|
+
* Useful when integrating into apps with custom font setups or system fonts.
|
|
13
|
+
*/
|
|
14
|
+
const setAppFonts = (customFonts) => {
|
|
15
|
+
if (!customFonts || typeof customFonts !== 'object')
|
|
16
|
+
return;
|
|
17
|
+
Object.assign(exports.AppFonts, customFonts);
|
|
18
|
+
};
|
|
19
|
+
exports.setAppFonts = setAppFonts;
|
|
10
20
|
exports.default = exports.AppFonts;
|
|
@@ -106,6 +106,7 @@ export interface NetworkLog {
|
|
|
106
106
|
/** Client identifier: axios, fetch, xhr, apollo, etc. */
|
|
107
107
|
client?: 'axios' | 'fetch' | 'xhr' | 'apollo' | 'graphql' | string;
|
|
108
108
|
caller?: string;
|
|
109
|
+
routeInfo?: RouteInfo;
|
|
109
110
|
}
|
|
110
111
|
export interface RouteInfo {
|
|
111
112
|
path: string;
|
|
@@ -156,8 +157,6 @@ export interface PersistedSettings {
|
|
|
156
157
|
}
|
|
157
158
|
export interface NetworkInspectorProps {
|
|
158
159
|
enabled?: boolean;
|
|
159
|
-
isEnabled?: boolean;
|
|
160
|
-
forceEnable?: boolean;
|
|
161
160
|
storage?: InspectorStorage;
|
|
162
161
|
navigationRef?: any;
|
|
163
162
|
appIcon?: any;
|
|
@@ -173,6 +172,7 @@ export interface InspectorContextValue {
|
|
|
173
172
|
setVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
174
173
|
closeModal: () => void;
|
|
175
174
|
isReady: boolean;
|
|
175
|
+
enabled: boolean;
|
|
176
176
|
isEnabled: boolean;
|
|
177
177
|
appIcon?: any;
|
|
178
178
|
environment?: string;
|
|
@@ -12,15 +12,23 @@ export const AppHeaderLogo = ({ size = 46, customIcon, }) => {
|
|
|
12
12
|
height: size,
|
|
13
13
|
});
|
|
14
14
|
return (<View style={[
|
|
15
|
-
logoStyles.
|
|
16
|
-
{
|
|
15
|
+
logoStyles.svgContainer,
|
|
16
|
+
{
|
|
17
|
+
width: size,
|
|
18
|
+
height: size,
|
|
19
|
+
borderRadius: Math.round(size * 0.23),
|
|
20
|
+
},
|
|
17
21
|
]}>
|
|
18
22
|
{clonedIcon}
|
|
19
23
|
</View>);
|
|
20
24
|
}
|
|
21
25
|
return (<View style={[
|
|
22
|
-
logoStyles.
|
|
23
|
-
{
|
|
26
|
+
logoStyles.imageContainer,
|
|
27
|
+
{
|
|
28
|
+
width: size,
|
|
29
|
+
height: size,
|
|
30
|
+
borderRadius: Math.round(size * 0.23),
|
|
31
|
+
},
|
|
24
32
|
]}>
|
|
25
33
|
<Image source={customIcon} style={logoStyles.image} resizeMode="cover"/>
|
|
26
34
|
</View>);
|
|
@@ -32,33 +40,58 @@ export const AppHeaderLogo = ({ size = 46, customIcon, }) => {
|
|
|
32
40
|
android: { uri: 'ic_launcher' },
|
|
33
41
|
default: { uri: 'AppIcon' },
|
|
34
42
|
});
|
|
35
|
-
return (<View style={[
|
|
43
|
+
return (<View style={[
|
|
44
|
+
logoStyles.imageContainer,
|
|
45
|
+
{
|
|
46
|
+
width: size,
|
|
47
|
+
height: size,
|
|
48
|
+
borderRadius: Math.round(size * 0.23),
|
|
49
|
+
},
|
|
50
|
+
]}>
|
|
36
51
|
<Image source={nativeSource} style={logoStyles.image} resizeMode="cover" onError={() => setLoadError(true)}/>
|
|
37
52
|
</View>);
|
|
38
53
|
}
|
|
39
54
|
// 3. Fallback: Inspector's Signature Owl Brand Logo
|
|
40
55
|
return (<View style={[
|
|
41
|
-
logoStyles.
|
|
42
|
-
{
|
|
56
|
+
logoStyles.svgContainer,
|
|
57
|
+
{
|
|
58
|
+
width: size,
|
|
59
|
+
height: size,
|
|
60
|
+
borderRadius: Math.round(size * 0.23),
|
|
61
|
+
},
|
|
43
62
|
]}>
|
|
44
63
|
<BrandSquareIcon size={size}/>
|
|
45
64
|
</View>);
|
|
46
65
|
};
|
|
47
66
|
const logoStyles = StyleSheet.create({
|
|
48
|
-
|
|
49
|
-
|
|
67
|
+
svgContainer: {
|
|
68
|
+
overflow: 'hidden',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
shadowColor: '#000',
|
|
72
|
+
shadowOffset: { width: 0, height: 2 },
|
|
73
|
+
shadowOpacity: 0.25,
|
|
74
|
+
shadowRadius: 3,
|
|
75
|
+
elevation: 3,
|
|
76
|
+
},
|
|
77
|
+
imageContainer: {
|
|
50
78
|
overflow: 'hidden',
|
|
51
79
|
backgroundColor: 'rgba(255, 255, 255, 0.15)',
|
|
52
80
|
borderWidth: 1,
|
|
53
|
-
borderColor: 'rgba(255, 255, 255, 0.
|
|
54
|
-
padding: 2
|
|
81
|
+
borderColor: 'rgba(255, 255, 255, 0.35)',
|
|
82
|
+
padding: 2,
|
|
55
83
|
alignItems: 'center',
|
|
56
84
|
justifyContent: 'center',
|
|
85
|
+
shadowColor: '#000',
|
|
86
|
+
shadowOffset: { width: 0, height: 2 },
|
|
87
|
+
shadowOpacity: 0.25,
|
|
88
|
+
shadowRadius: 3,
|
|
89
|
+
elevation: 3,
|
|
57
90
|
},
|
|
58
91
|
image: {
|
|
59
92
|
width: '100%',
|
|
60
93
|
height: '100%',
|
|
61
|
-
borderRadius:
|
|
94
|
+
borderRadius: 8,
|
|
62
95
|
},
|
|
63
96
|
});
|
|
64
97
|
export default AppHeaderLogo;
|