react-native-inapp-inspector 1.1.34 → 1.1.36
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/ConsoleLogCard.js +57 -56
- package/dist/commonjs/components/CopyButton.js +7 -1
- package/dist/commonjs/components/Inspector/BundleTab.js +19 -19
- package/dist/commonjs/components/Inspector/CrashDetail.js +16 -12
- package/dist/commonjs/components/Inspector/InspectorHeader.js +16 -16
- package/dist/commonjs/components/Inspector/MainScreen.js +6 -2
- package/dist/commonjs/components/Inspector/NetworkTab.js +97 -1
- package/dist/commonjs/components/Inspector/ReduxDetail.js +24 -19
- package/dist/commonjs/components/Inspector/ReduxTab.js +12 -8
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1243 -673
- package/dist/commonjs/components/LogCard.js +27 -9
- package/dist/commonjs/components/MetaAccordion.js +42 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +9 -0
- package/dist/commonjs/components/NetworkIcons.js +48 -1
- package/dist/commonjs/components/Toast.js +3 -3
- package/dist/commonjs/components/TouchableScale.d.ts +4 -2
- package/dist/commonjs/components/TouchableScale.js +4 -4
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +10 -1
- package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +2 -0
- package/dist/commonjs/customHooks/bundleAnalyzer.js +26 -17
- package/dist/commonjs/customHooks/consoleLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/consoleLogger.js +10 -1
- package/dist/commonjs/customHooks/crashHandler.d.ts +2 -0
- package/dist/commonjs/customHooks/crashHandler.js +10 -1
- package/dist/commonjs/customHooks/networkLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/networkLogger.js +12 -1
- package/dist/commonjs/customHooks/performanceTracker.d.ts +3 -1
- package/dist/commonjs/customHooks/performanceTracker.js +18 -4
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/reduxLogger.js +10 -1
- package/dist/commonjs/i18n/locales/en.json +96 -28
- package/dist/commonjs/index.js +78 -34
- package/dist/commonjs/styles/AppColors.d.ts +28 -0
- package/dist/commonjs/styles/AppColors.js +30 -0
- package/dist/esm/components/ConsoleLogCard.js +58 -57
- package/dist/esm/components/CopyButton.js +7 -1
- package/dist/esm/components/Inspector/BundleTab.js +19 -19
- package/dist/esm/components/Inspector/CrashDetail.js +16 -12
- package/dist/esm/components/Inspector/InspectorHeader.js +16 -16
- package/dist/esm/components/Inspector/MainScreen.js +6 -2
- package/dist/esm/components/Inspector/NetworkTab.js +99 -3
- package/dist/esm/components/Inspector/ReduxDetail.js +24 -19
- package/dist/esm/components/Inspector/ReduxTab.js +12 -8
- package/dist/esm/components/Inspector/SettingsPanel.js +1246 -676
- package/dist/esm/components/LogCard.js +27 -9
- package/dist/esm/components/MetaAccordion.js +42 -0
- package/dist/esm/components/NetworkIcons.d.ts +9 -0
- package/dist/esm/components/NetworkIcons.js +38 -0
- package/dist/esm/components/Toast.js +3 -3
- package/dist/esm/components/TouchableScale.d.ts +4 -2
- package/dist/esm/components/TouchableScale.js +4 -4
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +2 -0
- package/dist/esm/customHooks/analyticsLogger.js +7 -0
- package/dist/esm/customHooks/bundleAnalyzer.d.ts +2 -0
- package/dist/esm/customHooks/bundleAnalyzer.js +23 -16
- package/dist/esm/customHooks/consoleLogger.d.ts +2 -0
- package/dist/esm/customHooks/consoleLogger.js +7 -0
- package/dist/esm/customHooks/crashHandler.d.ts +2 -0
- package/dist/esm/customHooks/crashHandler.js +7 -0
- package/dist/esm/customHooks/networkLogger.d.ts +2 -0
- package/dist/esm/customHooks/networkLogger.js +9 -0
- package/dist/esm/customHooks/performanceTracker.d.ts +3 -1
- package/dist/esm/customHooks/performanceTracker.js +15 -3
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
- package/dist/esm/customHooks/reduxLogger.js +7 -0
- package/dist/esm/i18n/locales/en.json +96 -28
- package/dist/esm/index.js +64 -20
- package/dist/esm/styles/AppColors.d.ts +28 -0
- package/dist/esm/styles/AppColors.js +30 -0
- package/package.json +3 -2
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ReduxHistoryEntry } from '../types';
|
|
2
2
|
export { ReduxHistoryEntry };
|
|
3
|
+
export declare const setReduxModuleEnabled: (enabled: boolean) => void;
|
|
4
|
+
export declare const getReduxModuleEnabled: () => boolean;
|
|
3
5
|
export declare const isReduxConnected: () => boolean;
|
|
4
6
|
export declare const getReduxState: () => any;
|
|
5
7
|
export declare const setReduxAutoRefresh: (val: boolean) => void;
|
|
@@ -13,11 +13,18 @@
|
|
|
13
13
|
// dispatch reference at store-creation time) still update the state tree
|
|
14
14
|
// and per-reducer "last action" consistently.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.connectReduxStore = exports.inspectorReduxMiddleware = exports.subscribeReduxState = exports.setReduxState = exports.clearActionHistory = exports.getActionHistory = exports.clearLastActionForReducer = exports.getLastActionForReducer = exports.getReduxAutoRefresh = exports.setReduxAutoRefresh = exports.getReduxState = exports.isReduxConnected = void 0;
|
|
16
|
+
exports.connectReduxStore = exports.inspectorReduxMiddleware = exports.subscribeReduxState = exports.setReduxState = exports.clearActionHistory = exports.getActionHistory = exports.clearLastActionForReducer = exports.getLastActionForReducer = exports.getReduxAutoRefresh = exports.setReduxAutoRefresh = exports.getReduxState = exports.isReduxConnected = exports.getReduxModuleEnabled = exports.setReduxModuleEnabled = void 0;
|
|
17
17
|
const helpers_1 = require("../helpers");
|
|
18
18
|
let currentReduxState = null;
|
|
19
19
|
const listeners = new Set();
|
|
20
20
|
let globalReduxAutoRefresh = true;
|
|
21
|
+
let isReduxModuleEnabled = false;
|
|
22
|
+
const setReduxModuleEnabled = (enabled) => {
|
|
23
|
+
isReduxModuleEnabled = enabled;
|
|
24
|
+
};
|
|
25
|
+
exports.setReduxModuleEnabled = setReduxModuleEnabled;
|
|
26
|
+
const getReduxModuleEnabled = () => isReduxModuleEnabled;
|
|
27
|
+
exports.getReduxModuleEnabled = getReduxModuleEnabled;
|
|
21
28
|
let lastActionForReducer = {};
|
|
22
29
|
let actionHistory = [];
|
|
23
30
|
const MAX_HISTORY = 50;
|
|
@@ -176,6 +183,8 @@ function extractSliceName(actionType, affectedSlices) {
|
|
|
176
183
|
return undefined;
|
|
177
184
|
}
|
|
178
185
|
function recordAction(action, prevState, nextState, rawStack) {
|
|
186
|
+
if (!isReduxModuleEnabled)
|
|
187
|
+
return;
|
|
179
188
|
const stack = rawStack || new Error().stack || '';
|
|
180
189
|
const type = actionTypeOf(action);
|
|
181
190
|
const payload = action && typeof action === 'object' && action.payload !== undefined
|
|
@@ -39,12 +39,35 @@
|
|
|
39
39
|
"redux": "Redux"
|
|
40
40
|
},
|
|
41
41
|
"settings": {
|
|
42
|
-
"mainTitle": "Settings",
|
|
42
|
+
"mainTitle": "Settings & Modules",
|
|
43
|
+
"mainSubtitle": "Manage modules and preferences",
|
|
43
44
|
"requiredBadge": "REQUIRED",
|
|
44
45
|
"defaultBadge": "DEFAULT",
|
|
45
46
|
"notConnectedBadge": "NOT CONNECTED",
|
|
46
47
|
"notDetectedBadge": "NOT DETECTED",
|
|
47
48
|
"readOnlyBadge": "READ ONLY",
|
|
49
|
+
"coreBadge": "CORE",
|
|
50
|
+
"activeBadge": "ACTIVE",
|
|
51
|
+
"dormantBadge": "DORMANT",
|
|
52
|
+
"protectedBadge": "PROTECTED",
|
|
53
|
+
"modulesAndTools": "Modules & Tools",
|
|
54
|
+
"uiPreferences": "UI Preferences",
|
|
55
|
+
"zeroOverheadTitle": "Zero Background Overhead",
|
|
56
|
+
"zeroOverheadDesc": "Check the modules you wish to activate. Disabled modules consume 0% CPU & memory until saved.",
|
|
57
|
+
"unsavedPending": "● Unsaved selections pending",
|
|
58
|
+
"allSynchronized": "All modules synchronized",
|
|
59
|
+
"modulesActive": "{{active}} of {{total}} Modules Active",
|
|
60
|
+
"saveChanges": "Save Changes",
|
|
61
|
+
"settingsSaved": "Settings Saved",
|
|
62
|
+
"settingsSavedDesc": "Active module configurations have been successfully updated.",
|
|
63
|
+
"configure": "Configure",
|
|
64
|
+
"appearanceTheme": "APPEARANCE & THEME",
|
|
65
|
+
"windowLayout": "WINDOW & LAYOUT",
|
|
66
|
+
"startupDefault": "STARTUP & DEFAULT SCREEN",
|
|
67
|
+
"logFiltersDeduplication": "LOG FILTERS & DEDUPLICATION",
|
|
68
|
+
"resetSettings": "Reset All Settings",
|
|
69
|
+
"resetSettingsDesc": "Wipe customized preferences back to default",
|
|
70
|
+
"reset": "Reset",
|
|
48
71
|
"reduxNotConnectedTip": "Redux store is not connected. Call connectReduxStore(store) or use inspectorReduxMiddleware to enable.",
|
|
49
72
|
"analyticsNotConnectedTip": "Analytics is not initialized. Call setupAnalyticsLogger(analytics()) to enable.",
|
|
50
73
|
"tabVisibility": "Tab Visibility",
|
|
@@ -55,7 +78,7 @@
|
|
|
55
78
|
"title": "APIs Settings",
|
|
56
79
|
"total": "Total: {{count}}",
|
|
57
80
|
"maxRequestLogs": "Max Request Logs",
|
|
58
|
-
"maxRequestLogsDescription": "
|
|
81
|
+
"maxRequestLogsDescription": "Buffer size of network requests preserved in memory",
|
|
59
82
|
"clearNetworkLogs": "Clear Network Logs",
|
|
60
83
|
"clearNetworkLogsDescription": "{{count}} requests stored",
|
|
61
84
|
"networkLogsCleared": "Network logs cleared.",
|
|
@@ -69,56 +92,91 @@
|
|
|
69
92
|
"title": "Logs Settings",
|
|
70
93
|
"total": "Total: {{count}}",
|
|
71
94
|
"maxConsoleLogs": "Max Console Logs",
|
|
72
|
-
"maxConsoleLogsDescription": "How many console
|
|
73
|
-
"logLevels": "Log
|
|
74
|
-
"logLevelsDescription": "
|
|
75
|
-
"showInfo": "Show
|
|
76
|
-
"
|
|
77
|
-
"
|
|
95
|
+
"maxConsoleLogsDescription": "How many console messages to retain",
|
|
96
|
+
"logLevels": "Log Severities",
|
|
97
|
+
"logLevelsDescription": "Select which severities to capture in Logs",
|
|
98
|
+
"showInfo": "Show Info logs",
|
|
99
|
+
"showInfoDesc": "Informational logs & debug prints",
|
|
100
|
+
"showWarn": "Show Warning logs",
|
|
101
|
+
"showWarnDesc": "Warning notices & deprecations",
|
|
102
|
+
"showError": "Show Error logs",
|
|
103
|
+
"showErrorDesc": "Runtime errors & exceptions",
|
|
78
104
|
"clearConsoleLogs": "Clear Console Logs",
|
|
79
105
|
"clearConsoleLogsDescription": "{{count}} logs stored",
|
|
80
106
|
"consoleLogsCleared": "Console logs cleared."
|
|
81
107
|
},
|
|
82
108
|
"analytics": {
|
|
83
109
|
"title": "Analytics Settings",
|
|
84
|
-
"total": "
|
|
85
|
-
"maxAnalyticsEvents": "
|
|
86
|
-
"maxAnalyticsEventsDescription": "
|
|
87
|
-
"clearAnalyticsEvents": "Clear Analytics
|
|
88
|
-
"clearAnalyticsEventsDescription": "
|
|
110
|
+
"total": "Events: {{count}}",
|
|
111
|
+
"maxAnalyticsEvents": "Events Captured",
|
|
112
|
+
"maxAnalyticsEventsDescription": "{{count}} analytics events stored in buffer",
|
|
113
|
+
"clearAnalyticsEvents": "Clear Analytics History",
|
|
114
|
+
"clearAnalyticsEventsDescription": "Wipe all captured telemetry events",
|
|
89
115
|
"analyticsEventsCleared": "Analytics events cleared."
|
|
90
116
|
},
|
|
91
117
|
"redux": {
|
|
92
118
|
"title": "Redux Settings",
|
|
93
119
|
"reducers": "Reducers: {{count}}",
|
|
94
120
|
"autoRefresh": "Auto-refresh Store",
|
|
95
|
-
"autoRefreshDescription": "
|
|
121
|
+
"autoRefreshDescription": "Capture Redux store state tree on every dispatch",
|
|
96
122
|
"defaultJsonExpandDepth": "Default JSON Expand Depth",
|
|
97
123
|
"defaultJsonExpandDepthDescription": "Initial depth of Redux state tree to auto-expand",
|
|
98
124
|
"clearReduxState": "Clear Redux State",
|
|
99
|
-
"clearReduxStateDescription": "Reset state snapshot in inspector",
|
|
100
|
-
"clearReduxStateEmpty": "No store snapshot
|
|
125
|
+
"clearReduxStateDescription": "Reset current state snapshot in inspector",
|
|
126
|
+
"clearReduxStateEmpty": "No store snapshot recorded",
|
|
101
127
|
"reduxStateCleared": "Redux state snapshot cleared.",
|
|
102
128
|
"clearReduxTimeline": "Clear Redux Timeline",
|
|
103
129
|
"clearReduxTimelineDescription": "Remove all captured action history",
|
|
104
130
|
"reduxTimelineCleared": "Redux action history cleared."
|
|
105
131
|
},
|
|
132
|
+
"bundle": {
|
|
133
|
+
"title": "Bundle Settings",
|
|
134
|
+
"sourceBundler": "Metro Source Bundler",
|
|
135
|
+
"sourceBundlerDesc": "Parses live module trees and calculates binary size breakdowns",
|
|
136
|
+
"clearCache": "Clear Bundle Cache",
|
|
137
|
+
"clearCacheDesc": "Force re-fetching and parsing of JS bundle",
|
|
138
|
+
"cacheCleared": "Bundle analysis cache cleared."
|
|
139
|
+
},
|
|
140
|
+
"performance": {
|
|
141
|
+
"title": "Performance Settings",
|
|
142
|
+
"frameMeasurement": "Live Frame Measurement",
|
|
143
|
+
"frameMeasurementDesc": "Samples UI/JS frame rates & detects wasteful re-renders",
|
|
144
|
+
"clearEvents": "Clear Performance Events",
|
|
145
|
+
"clearEventsDesc": "Reset recorded jank and FPS drops history",
|
|
146
|
+
"eventsCleared": "Performance events cleared."
|
|
147
|
+
},
|
|
148
|
+
"crash": {
|
|
149
|
+
"title": "Crash Settings",
|
|
150
|
+
"maxCrashLogs": "Max Crash Logs",
|
|
151
|
+
"maxCrashLogsDesc": "How many crash records to preserve in history",
|
|
152
|
+
"globalGuard": "Global Crash Guard",
|
|
153
|
+
"globalGuardDesc": "Intercepts native, JS, and render errors directly",
|
|
154
|
+
"clearHistory": "Clear Crash History",
|
|
155
|
+
"clearHistoryDesc": "{{count}} crash logs stored",
|
|
156
|
+
"historyCleared": "Crash logs cleared."
|
|
157
|
+
},
|
|
106
158
|
"general": {
|
|
107
|
-
"darkMode": "Dark Mode",
|
|
108
|
-
"darkModeDescription": "
|
|
109
|
-
"modalHeight": "
|
|
110
|
-
"modalHeightDescription": "
|
|
111
|
-
"modalAnimation": "
|
|
112
|
-
"modalAnimationDescription": "
|
|
159
|
+
"darkMode": "Dark Mode Theme",
|
|
160
|
+
"darkModeDescription": "Toggle sleek dark aesthetic or light contrast",
|
|
161
|
+
"modalHeight": "Inspector Window Height",
|
|
162
|
+
"modalHeightDescription": "Modal screen coverage percentage",
|
|
163
|
+
"modalAnimation": "Transition Animation",
|
|
164
|
+
"modalAnimationDescription": "Entrance and dismissal presentation style",
|
|
113
165
|
"duplicateLogs": "Show Duplicate Logs",
|
|
114
|
-
"duplicateLogsDescription": "
|
|
166
|
+
"duplicateLogsDescription": "Off: Identical repeated entries collapse into ×N badges",
|
|
167
|
+
"defaultOpeningTab": "Default Opening Tab",
|
|
168
|
+
"defaultOpeningTabDesc": "Initial tab active when launcher button is tapped",
|
|
169
|
+
"activeConsoleLogLevels": "Active Console Log Levels",
|
|
170
|
+
"activeConsoleLogLevelsDesc": "Select which severities to capture in Logs",
|
|
115
171
|
"resetToDefaults": "Reset to Defaults",
|
|
116
172
|
"resetToDefaultsDescription": "Restore all inspector settings",
|
|
117
173
|
"resetConfirmationTitle": "Settings Reset",
|
|
118
174
|
"resetConfirmationMessage": "All settings have been reset to default values.",
|
|
119
175
|
"storageStatus": "Persistent Storage",
|
|
120
|
-
"storageStatusEnabled": "Settings
|
|
121
|
-
"
|
|
176
|
+
"storageStatusEnabled": "Settings Storage: Persistent ({{type}})",
|
|
177
|
+
"storageStatusEnabledDesc": "Your preferences and module visibility persist across app reboots.",
|
|
178
|
+
"storageStatusDisabled": "Settings Storage: In-Memory (Temporary)",
|
|
179
|
+
"storageStatusDisabledDesc": "Preferences reset on app kill. Pass custom storage to <NetworkInspector storage={...} /> to persist on Android."
|
|
122
180
|
}
|
|
123
181
|
},
|
|
124
182
|
"network": {
|
|
@@ -178,10 +236,20 @@
|
|
|
178
236
|
"noMatchingHeaders": "No matching headers",
|
|
179
237
|
"diffHidden": "{ Diff hidden }",
|
|
180
238
|
"noDiff": "No differences from previous API.",
|
|
239
|
+
"healthTitle": "Network Health & Telemetry",
|
|
240
|
+
"successRate": "Success Rate",
|
|
241
|
+
"avgLatency": "Avg Latency",
|
|
242
|
+
"p95Latency": "P95 Latency",
|
|
243
|
+
"bandwidth": "Bandwidth",
|
|
244
|
+
"fastest": "Fastest",
|
|
245
|
+
"slowest": "Slowest",
|
|
246
|
+
"timingWaterfall": "Timing Waterfall & Latency",
|
|
247
|
+
"throughput": "Throughput",
|
|
248
|
+
"performanceTier": "Performance Tier",
|
|
181
249
|
"perf": {
|
|
182
|
-
"fast": "Fast",
|
|
183
|
-
"moderate": "Moderate",
|
|
184
|
-
"slow": "Slow"
|
|
250
|
+
"fast": "Fast (< 200ms)",
|
|
251
|
+
"moderate": "Moderate (200-800ms)",
|
|
252
|
+
"slow": "Slow (> 800ms)"
|
|
185
253
|
},
|
|
186
254
|
"jsonViewer": {
|
|
187
255
|
"pretty": "Pretty",
|
package/dist/commonjs/index.js
CHANGED
|
@@ -60,6 +60,8 @@ const logFilters_1 = require("./customHooks/logFilters");
|
|
|
60
60
|
const crashHandler_1 = require("./customHooks/crashHandler");
|
|
61
61
|
const analyticsLogger_1 = require("./customHooks/analyticsLogger");
|
|
62
62
|
const reduxLogger_1 = require("./customHooks/reduxLogger");
|
|
63
|
+
const performanceTracker_1 = require("./customHooks/performanceTracker");
|
|
64
|
+
const bundleAnalyzer_1 = require("./customHooks/bundleAnalyzer");
|
|
63
65
|
const constants_1 = require("./constants");
|
|
64
66
|
// Stylesheet
|
|
65
67
|
const styles_1 = require("./styles");
|
|
@@ -205,11 +207,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
205
207
|
const [tabVisibility, setTabVisibility] = (0, react_1.useState)({
|
|
206
208
|
apis: true,
|
|
207
209
|
logs: true,
|
|
208
|
-
analytics:
|
|
210
|
+
analytics: false,
|
|
209
211
|
redux: false,
|
|
210
212
|
bundle: false,
|
|
211
213
|
performance: false,
|
|
212
|
-
crash:
|
|
214
|
+
crash: false,
|
|
213
215
|
});
|
|
214
216
|
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(100);
|
|
215
217
|
const [reduxAutoRefresh, setReduxAutoRefreshState] = (0, react_1.useState)(true);
|
|
@@ -217,6 +219,16 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
217
219
|
// #6 — tab the inspector opens on. Shown with a DEFAULT badge in Settings.
|
|
218
220
|
const [defaultTab, setDefaultTab] = (0, react_1.useState)('apis');
|
|
219
221
|
const [showDuplicateLogs, setShowDuplicateLogs] = (0, react_1.useState)(false);
|
|
222
|
+
// Synchronize runtime background listeners with active settings
|
|
223
|
+
(0, react_1.useEffect)(() => {
|
|
224
|
+
(0, networkLogger_1.setNetworkModuleEnabled)(!!tabVisibility.apis);
|
|
225
|
+
(0, consoleLogger_1.setConsoleModuleEnabled)(!!tabVisibility.logs);
|
|
226
|
+
(0, analyticsLogger_1.setAnalyticsModuleEnabled)(!!tabVisibility.analytics);
|
|
227
|
+
(0, reduxLogger_1.setReduxModuleEnabled)(!!tabVisibility.redux);
|
|
228
|
+
(0, performanceTracker_1.setPerformanceModuleEnabled)(!!tabVisibility.performance);
|
|
229
|
+
(0, crashHandler_1.setCrashModuleEnabled)(!!tabVisibility.crash);
|
|
230
|
+
(0, bundleAnalyzer_1.setBundleModuleEnabled)(!!tabVisibility.bundle);
|
|
231
|
+
}, [tabVisibility]);
|
|
220
232
|
const resetToDefaults = async () => {
|
|
221
233
|
await (0, settingsStore_1.clearPersistedSettings)();
|
|
222
234
|
setIsDark(false);
|
|
@@ -226,11 +238,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
226
238
|
setTabVisibility({
|
|
227
239
|
apis: true,
|
|
228
240
|
logs: true,
|
|
229
|
-
analytics:
|
|
241
|
+
analytics: false,
|
|
230
242
|
redux: false,
|
|
231
243
|
bundle: false,
|
|
232
244
|
performance: false,
|
|
233
|
-
crash:
|
|
245
|
+
crash: false,
|
|
234
246
|
});
|
|
235
247
|
setDefaultTab('apis');
|
|
236
248
|
setMaxCrashLogs(100);
|
|
@@ -266,9 +278,6 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
266
278
|
...prev,
|
|
267
279
|
...saved.tabVisibility,
|
|
268
280
|
apis: true, // APIs is always required
|
|
269
|
-
crash: saved.tabVisibility.crash !== undefined
|
|
270
|
-
? saved.tabVisibility.crash
|
|
271
|
-
: true,
|
|
272
281
|
}));
|
|
273
282
|
if (saved.defaultTab)
|
|
274
283
|
setDefaultTab(saved.defaultTab);
|
|
@@ -290,11 +299,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
290
299
|
...{
|
|
291
300
|
apis: true,
|
|
292
301
|
logs: true,
|
|
293
|
-
analytics:
|
|
302
|
+
analytics: false,
|
|
294
303
|
redux: false,
|
|
295
304
|
bundle: false,
|
|
296
305
|
performance: false,
|
|
297
|
-
crash:
|
|
306
|
+
crash: false,
|
|
298
307
|
},
|
|
299
308
|
...(saved.tabVisibility || {}),
|
|
300
309
|
apis: true,
|
|
@@ -659,13 +668,37 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
659
668
|
loop.start();
|
|
660
669
|
return () => loop.stop();
|
|
661
670
|
}, [unreadPulseAnim]);
|
|
662
|
-
|
|
671
|
+
const isVisibleRefObj = (0, react_1.useRef)(visible);
|
|
672
|
+
// #6 — every time the inspector is opened, land on chosen default tab & sync latest logs
|
|
663
673
|
(0, react_1.useEffect)(() => {
|
|
674
|
+
isVisibleRefObj.current = visible;
|
|
664
675
|
if (visible) {
|
|
665
676
|
const target = defaultTab === 'apis' || tabVisibility?.[defaultTab]
|
|
666
677
|
? defaultTab
|
|
667
678
|
: 'apis';
|
|
668
679
|
setActiveTab(target);
|
|
680
|
+
// Instant synchronization of data collected while modal was closed
|
|
681
|
+
if (latestNetworkLogsRef.current.length > 0) {
|
|
682
|
+
const deduped = (0, helpers_1.deduplicateLogs)(latestNetworkLogsRef.current);
|
|
683
|
+
const incoming = new Set(deduped.map(l => l.id));
|
|
684
|
+
prevLogIdsRef.current = incoming;
|
|
685
|
+
setLogs(deduped);
|
|
686
|
+
}
|
|
687
|
+
if (latestConsoleLogsRef.current.length > 0) {
|
|
688
|
+
setConsoleLogs(latestConsoleLogsRef.current);
|
|
689
|
+
}
|
|
690
|
+
if (latestAnalyticsEventsRef.current.length > 0) {
|
|
691
|
+
setAnalyticsEvents(latestAnalyticsEventsRef.current);
|
|
692
|
+
}
|
|
693
|
+
const freshState = (0, reduxLogger_1.getReduxState)();
|
|
694
|
+
if (freshState) {
|
|
695
|
+
setReduxState(typeof freshState === 'object' ? { ...freshState } : freshState);
|
|
696
|
+
setReduxLastActionMap({ ...(0, reduxLogger_1.getLastActionForReducer)() });
|
|
697
|
+
}
|
|
698
|
+
const freshCrashes = (0, crashHandler_1.getCrashRecords)();
|
|
699
|
+
if (freshCrashes.length > 0) {
|
|
700
|
+
setCrashRecords(freshCrashes);
|
|
701
|
+
}
|
|
669
702
|
}
|
|
670
703
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
671
704
|
}, [visible]);
|
|
@@ -693,6 +726,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
693
726
|
(0, consoleLogger_1.setupConsoleLogger)();
|
|
694
727
|
(0, analyticsLogger_1.autoSetupAnalyticsLogger)();
|
|
695
728
|
(0, crashHandler_1.setupGlobalCrashHandler)();
|
|
729
|
+
const isVisibleRef = isVisibleRefObj;
|
|
696
730
|
const unsubscribeCrash = (0, crashHandler_1.subscribeCrashEvents)(crashInfo => {
|
|
697
731
|
if (crashInfo.message === '__CLEARED__') {
|
|
698
732
|
setCrashRecords([]);
|
|
@@ -700,7 +734,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
700
734
|
return;
|
|
701
735
|
}
|
|
702
736
|
const updated = (0, crashHandler_1.getCrashRecords)();
|
|
703
|
-
|
|
737
|
+
if (isVisibleRef.current) {
|
|
738
|
+
setCrashRecords(updated);
|
|
739
|
+
}
|
|
704
740
|
});
|
|
705
741
|
// Sync crashes recorded before this subscription ran (e.g. a render crash
|
|
706
742
|
// during the very first commit, which fires before effects are mounted).
|
|
@@ -714,6 +750,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
714
750
|
latestNetworkLogsRef.current = raw;
|
|
715
751
|
if (isNetworkPausedRef.current)
|
|
716
752
|
return;
|
|
753
|
+
if (!isVisibleRef.current)
|
|
754
|
+
return; // ZERO-RENDER INACTIVE MODE
|
|
717
755
|
clearTimeout(timeoutId);
|
|
718
756
|
const updateNetworkState = () => {
|
|
719
757
|
const deduped = (0, helpers_1.deduplicateLogs)(raw);
|
|
@@ -753,6 +791,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
753
791
|
latestAnalyticsEventsRef.current = raw;
|
|
754
792
|
if (isAnalyticsPausedRef.current)
|
|
755
793
|
return;
|
|
794
|
+
if (!isVisibleRef.current)
|
|
795
|
+
return; // ZERO-RENDER INACTIVE MODE
|
|
756
796
|
clearTimeout(analyticsTimeoutId);
|
|
757
797
|
const updateAnalyticsState = () => {
|
|
758
798
|
const incoming = new Set(raw.map(e => e.id));
|
|
@@ -790,6 +830,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
790
830
|
latestConsoleLogsRef.current = raw;
|
|
791
831
|
if (isConsolePausedRef.current)
|
|
792
832
|
return;
|
|
833
|
+
if (!isVisibleRef.current)
|
|
834
|
+
return; // ZERO-RENDER INACTIVE MODE
|
|
793
835
|
clearTimeout(consoleTimeoutId);
|
|
794
836
|
if (isFirstConsoleCall) {
|
|
795
837
|
isFirstConsoleCall = false;
|
|
@@ -802,11 +844,13 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
802
844
|
}
|
|
803
845
|
});
|
|
804
846
|
const initialReduxState = (0, reduxLogger_1.getReduxState)();
|
|
805
|
-
|
|
806
|
-
|
|
847
|
+
if (initialReduxState) {
|
|
848
|
+
setReduxState(typeof initialReduxState === 'object' ? { ...initialReduxState } : initialReduxState);
|
|
849
|
+
setReduxLastActionMap({ ...(0, reduxLogger_1.getLastActionForReducer)() });
|
|
850
|
+
}
|
|
807
851
|
const unsubscribeRedux = (0, reduxLogger_1.subscribeReduxState)(() => {
|
|
808
|
-
|
|
809
|
-
|
|
852
|
+
if (!isVisibleRef.current)
|
|
853
|
+
return; // ZERO-RENDER INACTIVE MODE
|
|
810
854
|
const freshState = (0, reduxLogger_1.getReduxState)();
|
|
811
855
|
setReduxState(freshState && typeof freshState === 'object' ? { ...freshState } : freshState);
|
|
812
856
|
setReduxLastActionMap({ ...(0, reduxLogger_1.getLastActionForReducer)() });
|
|
@@ -1611,25 +1655,25 @@ Object.defineProperty(exports, "getLastActionForReducer", { enumerable: true, ge
|
|
|
1611
1655
|
var gaAnalyticsRegistry_1 = require("./helpers/gaAnalyticsRegistry");
|
|
1612
1656
|
Object.defineProperty(exports, "getEventCategory", { enumerable: true, get: function () { return gaAnalyticsRegistry_1.getEventCategory; } });
|
|
1613
1657
|
Object.defineProperty(exports, "registerGAPlugin", { enumerable: true, get: function () { return gaAnalyticsRegistry_1.registerGAPlugin; } });
|
|
1614
|
-
var
|
|
1615
|
-
Object.defineProperty(exports, "usePerformanceTracker", { enumerable: true, get: function () { return
|
|
1616
|
-
Object.defineProperty(exports, "useComponentProfiler", { enumerable: true, get: function () { return
|
|
1617
|
-
Object.defineProperty(exports, "useNavigationProfiler", { enumerable: true, get: function () { return
|
|
1618
|
-
Object.defineProperty(exports, "trackComponentRender", { enumerable: true, get: function () { return
|
|
1619
|
-
Object.defineProperty(exports, "trackNavigationTransition", { enumerable: true, get: function () { return
|
|
1620
|
-
Object.defineProperty(exports, "trackHeavyTask", { enumerable: true, get: function () { return
|
|
1621
|
-
Object.defineProperty(exports, "measureAsync", { enumerable: true, get: function () { return
|
|
1622
|
-
Object.defineProperty(exports, "getHermesMemoryStats", { enumerable: true, get: function () { return
|
|
1623
|
-
Object.defineProperty(exports, "registerComponentProfile", { enumerable: true, get: function () { return
|
|
1624
|
-
Object.defineProperty(exports, "subscribeRenderProfiles", { enumerable: true, get: function () { return
|
|
1625
|
-
Object.defineProperty(exports, "getRenderProfiles", { enumerable: true, get: function () { return
|
|
1626
|
-
Object.defineProperty(exports, "logPerformanceEvent", { enumerable: true, get: function () { return
|
|
1627
|
-
Object.defineProperty(exports, "clearPerformanceEvents", { enumerable: true, get: function () { return
|
|
1628
|
-
Object.defineProperty(exports, "subscribePerformanceEvents", { enumerable: true, get: function () { return
|
|
1629
|
-
Object.defineProperty(exports, "getPerformanceEvents", { enumerable: true, get: function () { return
|
|
1630
|
-
Object.defineProperty(exports, "getInitialRenderProfiles", { enumerable: true, get: function () { return
|
|
1631
|
-
Object.defineProperty(exports, "getInitialPerformanceEvents", { enumerable: true, get: function () { return
|
|
1632
|
-
Object.defineProperty(exports, "generateFixSnippet", { enumerable: true, get: function () { return
|
|
1658
|
+
var performanceTracker_2 = require("./customHooks/performanceTracker");
|
|
1659
|
+
Object.defineProperty(exports, "usePerformanceTracker", { enumerable: true, get: function () { return performanceTracker_2.usePerformanceTracker; } });
|
|
1660
|
+
Object.defineProperty(exports, "useComponentProfiler", { enumerable: true, get: function () { return performanceTracker_2.useComponentProfiler; } });
|
|
1661
|
+
Object.defineProperty(exports, "useNavigationProfiler", { enumerable: true, get: function () { return performanceTracker_2.useNavigationProfiler; } });
|
|
1662
|
+
Object.defineProperty(exports, "trackComponentRender", { enumerable: true, get: function () { return performanceTracker_2.trackComponentRender; } });
|
|
1663
|
+
Object.defineProperty(exports, "trackNavigationTransition", { enumerable: true, get: function () { return performanceTracker_2.trackNavigationTransition; } });
|
|
1664
|
+
Object.defineProperty(exports, "trackHeavyTask", { enumerable: true, get: function () { return performanceTracker_2.trackHeavyTask; } });
|
|
1665
|
+
Object.defineProperty(exports, "measureAsync", { enumerable: true, get: function () { return performanceTracker_2.measureAsync; } });
|
|
1666
|
+
Object.defineProperty(exports, "getHermesMemoryStats", { enumerable: true, get: function () { return performanceTracker_2.getHermesMemoryStats; } });
|
|
1667
|
+
Object.defineProperty(exports, "registerComponentProfile", { enumerable: true, get: function () { return performanceTracker_2.registerComponentProfile; } });
|
|
1668
|
+
Object.defineProperty(exports, "subscribeRenderProfiles", { enumerable: true, get: function () { return performanceTracker_2.subscribeRenderProfiles; } });
|
|
1669
|
+
Object.defineProperty(exports, "getRenderProfiles", { enumerable: true, get: function () { return performanceTracker_2.getRenderProfiles; } });
|
|
1670
|
+
Object.defineProperty(exports, "logPerformanceEvent", { enumerable: true, get: function () { return performanceTracker_2.logPerformanceEvent; } });
|
|
1671
|
+
Object.defineProperty(exports, "clearPerformanceEvents", { enumerable: true, get: function () { return performanceTracker_2.clearPerformanceEvents; } });
|
|
1672
|
+
Object.defineProperty(exports, "subscribePerformanceEvents", { enumerable: true, get: function () { return performanceTracker_2.subscribePerformanceEvents; } });
|
|
1673
|
+
Object.defineProperty(exports, "getPerformanceEvents", { enumerable: true, get: function () { return performanceTracker_2.getPerformanceEvents; } });
|
|
1674
|
+
Object.defineProperty(exports, "getInitialRenderProfiles", { enumerable: true, get: function () { return performanceTracker_2.getInitialRenderProfiles; } });
|
|
1675
|
+
Object.defineProperty(exports, "getInitialPerformanceEvents", { enumerable: true, get: function () { return performanceTracker_2.getInitialPerformanceEvents; } });
|
|
1676
|
+
Object.defineProperty(exports, "generateFixSnippet", { enumerable: true, get: function () { return performanceTracker_2.generateFixSnippet; } });
|
|
1633
1677
|
var decorators_1 = require("./decorators");
|
|
1634
1678
|
Object.defineProperty(exports, "InspectLog", { enumerable: true, get: function () { return decorators_1.InspectLog; } });
|
|
1635
1679
|
Object.defineProperty(exports, "InspectTrackTime", { enumerable: true, get: function () { return decorators_1.InspectTrackTime; } });
|
|
@@ -154,6 +154,20 @@ declare const LightColors: {
|
|
|
154
154
|
greyBorder: string;
|
|
155
155
|
paperBg: string;
|
|
156
156
|
contentBg: string;
|
|
157
|
+
toastBg: string;
|
|
158
|
+
toastBorder: string;
|
|
159
|
+
mintGreenBg: string;
|
|
160
|
+
mintGreenBorder: string;
|
|
161
|
+
mintGreenText: string;
|
|
162
|
+
amberWarmBg: string;
|
|
163
|
+
amberWarmBorder: string;
|
|
164
|
+
amberWarmText: string;
|
|
165
|
+
violetSoftBg: string;
|
|
166
|
+
violetSoftBorder: string;
|
|
167
|
+
violetSoftText: string;
|
|
168
|
+
skySoftBg: string;
|
|
169
|
+
skySoftBorder: string;
|
|
170
|
+
skySoftText: string;
|
|
157
171
|
domainColors: string[];
|
|
158
172
|
};
|
|
159
173
|
export declare const getThemeColors: (isDark: boolean) => {
|
|
@@ -312,6 +326,20 @@ export declare const getThemeColors: (isDark: boolean) => {
|
|
|
312
326
|
greyBorder: string;
|
|
313
327
|
paperBg: string;
|
|
314
328
|
contentBg: string;
|
|
329
|
+
toastBg: string;
|
|
330
|
+
toastBorder: string;
|
|
331
|
+
mintGreenBg: string;
|
|
332
|
+
mintGreenBorder: string;
|
|
333
|
+
mintGreenText: string;
|
|
334
|
+
amberWarmBg: string;
|
|
335
|
+
amberWarmBorder: string;
|
|
336
|
+
amberWarmText: string;
|
|
337
|
+
violetSoftBg: string;
|
|
338
|
+
violetSoftBorder: string;
|
|
339
|
+
violetSoftText: string;
|
|
340
|
+
skySoftBg: string;
|
|
341
|
+
skySoftBorder: string;
|
|
342
|
+
skySoftText: string;
|
|
315
343
|
domainColors: string[];
|
|
316
344
|
};
|
|
317
345
|
export declare const AppColors: typeof LightColors;
|
|
@@ -164,6 +164,21 @@ const LightColors = {
|
|
|
164
164
|
greyBorder: '#E3DFEC',
|
|
165
165
|
paperBg: '#FBF9FC',
|
|
166
166
|
contentBg: '#F8F7FB',
|
|
167
|
+
// ─── Toast / Glass / Chip Tokens ───
|
|
168
|
+
toastBg: '#0F172AEE',
|
|
169
|
+
toastBorder: '#33415588',
|
|
170
|
+
mintGreenBg: '#ECFDF5',
|
|
171
|
+
mintGreenBorder: '#A7F3D0',
|
|
172
|
+
mintGreenText: '#059669',
|
|
173
|
+
amberWarmBg: '#FFFBEB',
|
|
174
|
+
amberWarmBorder: '#FDE68A',
|
|
175
|
+
amberWarmText: '#92400E',
|
|
176
|
+
violetSoftBg: '#EDE9FE',
|
|
177
|
+
violetSoftBorder: '#DDD6FE',
|
|
178
|
+
violetSoftText: '#7C3AED',
|
|
179
|
+
skySoftBg: '#E0F2FE',
|
|
180
|
+
skySoftBorder: '#BAE6FD',
|
|
181
|
+
skySoftText: '#0284C7',
|
|
167
182
|
// ─── Domain Colors (Thai Airways Themed) ───
|
|
168
183
|
domainColors: [
|
|
169
184
|
'#5C2D91',
|
|
@@ -240,6 +255,21 @@ const DarkColors = {
|
|
|
240
255
|
amber700: '#C5A059',
|
|
241
256
|
amber800: '#B89758',
|
|
242
257
|
green500: '#22C55E',
|
|
258
|
+
// ─── Toast / Glass / Chip Tokens (Dark) ───
|
|
259
|
+
toastBg: '#1E293BEE',
|
|
260
|
+
toastBorder: '#47556988',
|
|
261
|
+
mintGreenBg: '#064E3B66',
|
|
262
|
+
mintGreenBorder: '#05966988',
|
|
263
|
+
mintGreenText: '#34D399',
|
|
264
|
+
amberWarmBg: '#451A0366',
|
|
265
|
+
amberWarmBorder: '#D9770688',
|
|
266
|
+
amberWarmText: '#FCD34D',
|
|
267
|
+
violetSoftBg: '#3B076466',
|
|
268
|
+
violetSoftBorder: '#7C3AED88',
|
|
269
|
+
violetSoftText: '#C084FC',
|
|
270
|
+
skySoftBg: '#082F4966',
|
|
271
|
+
skySoftBorder: '#0284C788',
|
|
272
|
+
skySoftText: '#38BDF8',
|
|
243
273
|
green600: '#16A34A',
|
|
244
274
|
green700: '#15803D',
|
|
245
275
|
green800: '#166534',
|