react-native-inapp-inspector 1.1.35 → 2.0.0
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/README.md +123 -101
- package/android/build.gradle +13 -1
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +904 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.kt +17 -0
- package/dist/commonjs/components/CopyButton.js +3 -0
- package/dist/commonjs/components/ErrorBoundary.js +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/commonjs/components/Inspector/BundleTab.js +1 -1
- package/dist/commonjs/components/Inspector/ConsoleTab.js +1 -1
- package/dist/commonjs/components/Inspector/CrashTab.js +97 -90
- package/dist/commonjs/components/Inspector/InspectorHeader.js +12 -8
- package/dist/commonjs/components/Inspector/MainScreen.js +14 -101
- package/dist/commonjs/components/Inspector/NetworkTab.js +47 -10
- package/dist/commonjs/components/Inspector/PerformanceTab.js +96 -3
- package/dist/commonjs/components/Inspector/ReduxTab.js +18 -10
- package/dist/commonjs/components/Inspector/SettingsPanel.js +342 -88
- package/dist/commonjs/components/Inspector/TabBar.js +6 -3
- package/dist/commonjs/components/NetworkIcons.d.ts +1 -0
- package/dist/commonjs/components/NetworkIcons.js +6 -1
- package/dist/commonjs/components/TouchableScale.d.ts +1 -0
- package/dist/commonjs/components/TouchableScale.js +30 -32
- package/dist/commonjs/constants/index.d.ts +1 -2
- package/dist/commonjs/constants/index.js +4 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +4 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +7 -5
- package/dist/commonjs/customHooks/crashHandler.js +7 -0
- package/dist/commonjs/helpers/index.js +10 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +9 -0
- package/dist/commonjs/helpers/settingsStore.js +59 -3
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +229 -39
- package/dist/commonjs/native/NativeInspector.d.ts +125 -0
- package/dist/commonjs/native/NativeInspector.js +313 -0
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/commonjs/native/NativeNetworkInspector.js +4 -0
- package/dist/commonjs/styles/index.js +6 -6
- package/dist/commonjs/types/enums.d.ts +1 -1
- package/dist/commonjs/types/interfaces.d.ts +9 -0
- package/dist/esm/components/CopyButton.js +3 -0
- package/dist/esm/components/ErrorBoundary.js +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/esm/components/Inspector/BundleTab.js +1 -1
- package/dist/esm/components/Inspector/ConsoleTab.js +1 -1
- package/dist/esm/components/Inspector/CrashTab.js +97 -90
- package/dist/esm/components/Inspector/InspectorHeader.js +13 -9
- package/dist/esm/components/Inspector/MainScreen.js +15 -69
- package/dist/esm/components/Inspector/NetworkTab.js +47 -10
- package/dist/esm/components/Inspector/PerformanceTab.js +96 -3
- package/dist/esm/components/Inspector/ReduxTab.js +18 -10
- package/dist/esm/components/Inspector/SettingsPanel.js +344 -90
- package/dist/esm/components/Inspector/TabBar.js +7 -4
- package/dist/esm/components/NetworkIcons.d.ts +1 -0
- package/dist/esm/components/NetworkIcons.js +4 -0
- package/dist/esm/components/TouchableScale.d.ts +1 -0
- package/dist/esm/components/TouchableScale.js +31 -33
- package/dist/esm/constants/index.d.ts +1 -2
- package/dist/esm/constants/index.js +4 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +4 -0
- package/dist/esm/customHooks/analyticsLogger.js +5 -4
- package/dist/esm/customHooks/crashHandler.js +7 -0
- package/dist/esm/helpers/index.js +10 -1
- package/dist/esm/helpers/settingsStore.d.ts +9 -0
- package/dist/esm/helpers/settingsStore.js +58 -3
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +215 -39
- package/dist/esm/native/NativeInspector.d.ts +125 -0
- package/dist/esm/native/NativeInspector.js +289 -0
- package/dist/esm/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/esm/native/NativeNetworkInspector.js +2 -0
- package/dist/esm/styles/index.js +6 -6
- package/dist/esm/types/enums.d.ts +1 -1
- package/dist/esm/types/interfaces.d.ts +9 -0
- package/ios/NetworkInspectorModule.h +6 -0
- package/ios/NetworkInspectorModule.m +720 -5
- package/package.json +13 -2
- package/react-native-inapp-inspector.podspec +7 -2
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +0 -97
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.java +0 -28
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchNativeCachedPage = exports.pushNativeLogRecord = exports.getNativeSystemMetrics = exports.triggerNativeHaptic = exports.setNativeStorageItem = exports.getNativeStorageItem = exports.subscribeNativeDeviceShake = exports.getNativeFpsMetrics = exports.stopNativeFpsMonitoring = exports.startNativeFpsMonitoring = exports.subscribeNativeFloatingButtonPress = exports.setNativeFloatingButtonBadge = exports.hideNativeFloatingButton = exports.showNativeFloatingButton = exports.subscribeNativeCrashes = exports.enableNativeCrashProtection = exports.getNativeDeviceMetrics = exports.isNativeModuleAvailable = void 0;
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const NativeNetworkInspector_1 = __importDefault(require("./NativeNetworkInspector"));
|
|
9
|
+
// Seamless TurboModule (New Architecture / JSI) & Legacy NativeModules Bridge resolution
|
|
10
|
+
const NativeModule = NativeNetworkInspector_1.default || react_native_1.NativeModules.NetworkInspectorModule;
|
|
11
|
+
const isNativeModuleAvailable = () => {
|
|
12
|
+
return !!NativeModule;
|
|
13
|
+
};
|
|
14
|
+
exports.isNativeModuleAvailable = isNativeModuleAvailable;
|
|
15
|
+
const nativeEmitter = (0, exports.isNativeModuleAvailable)()
|
|
16
|
+
? new react_native_1.NativeEventEmitter(NativeModule)
|
|
17
|
+
: null;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves low-level native hardware and system metrics (RAM, Heap, Disk, Battery, CPU).
|
|
20
|
+
*/
|
|
21
|
+
const getNativeDeviceMetrics = async () => {
|
|
22
|
+
if (!NativeModule || !NativeModule.getDeviceMetrics) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const metrics = await NativeModule.getDeviceMetrics();
|
|
27
|
+
return metrics;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.getNativeDeviceMetrics = getNativeDeviceMetrics;
|
|
34
|
+
/**
|
|
35
|
+
* Enables native signal and uncaught exception protection in the iOS / Android runtime.
|
|
36
|
+
* Automatically ensures the native floating icon is shown and available before UI renders.
|
|
37
|
+
*/
|
|
38
|
+
const enableNativeCrashProtection = async (options) => {
|
|
39
|
+
if (!NativeModule || !NativeModule.enableNativeCrashProtection) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const result = await NativeModule.enableNativeCrashProtection();
|
|
44
|
+
if (options?.showFloatingButton !== false) {
|
|
45
|
+
await (0, exports.showNativeFloatingButton)();
|
|
46
|
+
}
|
|
47
|
+
return !!result;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.enableNativeCrashProtection = enableNativeCrashProtection;
|
|
54
|
+
/**
|
|
55
|
+
* Subscribes to fatal native crash events caught by the iOS / Kotlin exception handlers.
|
|
56
|
+
*/
|
|
57
|
+
const subscribeNativeCrashes = (callback) => {
|
|
58
|
+
if (!nativeEmitter) {
|
|
59
|
+
return () => { };
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
const subscription = nativeEmitter.addListener('onNativeCrash', callback);
|
|
63
|
+
return () => {
|
|
64
|
+
subscription.remove();
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
return () => { };
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
exports.subscribeNativeCrashes = subscribeNativeCrashes;
|
|
72
|
+
/**
|
|
73
|
+
* Displays the 100% native main-thread floating overlay button.
|
|
74
|
+
* Dragging & touches run on the native UI thread, completely isolated from JS thread stalls.
|
|
75
|
+
*/
|
|
76
|
+
const showNativeFloatingButton = async (options) => {
|
|
77
|
+
if (!NativeModule || !NativeModule.showFloatingButton) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const result = await NativeModule.showFloatingButton(options || {});
|
|
82
|
+
return !!result;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.showNativeFloatingButton = showNativeFloatingButton;
|
|
89
|
+
/**
|
|
90
|
+
* Hides the native floating overlay button.
|
|
91
|
+
*/
|
|
92
|
+
const hideNativeFloatingButton = async () => {
|
|
93
|
+
if (!NativeModule || !NativeModule.hideFloatingButton) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
const result = await NativeModule.hideFloatingButton();
|
|
98
|
+
return !!result;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
exports.hideNativeFloatingButton = hideNativeFloatingButton;
|
|
105
|
+
/**
|
|
106
|
+
* Updates the badge/status dot on the native floating overlay button.
|
|
107
|
+
*/
|
|
108
|
+
const setNativeFloatingButtonBadge = async (hasBadge) => {
|
|
109
|
+
if (!NativeModule || !NativeModule.setFloatingButtonBadge) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
const result = await NativeModule.setFloatingButtonBadge(hasBadge);
|
|
114
|
+
return !!result;
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
exports.setNativeFloatingButtonBadge = setNativeFloatingButtonBadge;
|
|
121
|
+
/**
|
|
122
|
+
* Subscribes to tap events on the native floating button.
|
|
123
|
+
*/
|
|
124
|
+
const subscribeNativeFloatingButtonPress = (callback) => {
|
|
125
|
+
if (!nativeEmitter) {
|
|
126
|
+
return () => { };
|
|
127
|
+
}
|
|
128
|
+
try {
|
|
129
|
+
const subscription = nativeEmitter.addListener('onFloatingButtonPress', callback);
|
|
130
|
+
return () => {
|
|
131
|
+
subscription.remove();
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
return () => { };
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
exports.subscribeNativeFloatingButtonPress = subscribeNativeFloatingButtonPress;
|
|
139
|
+
/**
|
|
140
|
+
* Starts hardware-accurate native UI thread FPS tracking (CADisplayLink / Choreographer).
|
|
141
|
+
*/
|
|
142
|
+
const startNativeFpsMonitoring = async () => {
|
|
143
|
+
if (!NativeModule || !NativeModule.startFpsMonitoring) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
const result = await NativeModule.startFpsMonitoring();
|
|
148
|
+
return !!result;
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
exports.startNativeFpsMonitoring = startNativeFpsMonitoring;
|
|
155
|
+
/**
|
|
156
|
+
* Stops native FPS tracking.
|
|
157
|
+
*/
|
|
158
|
+
const stopNativeFpsMonitoring = async () => {
|
|
159
|
+
if (!NativeModule || !NativeModule.stopFpsMonitoring) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
const result = await NativeModule.stopFpsMonitoring();
|
|
164
|
+
return !!result;
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
exports.stopNativeFpsMonitoring = stopNativeFpsMonitoring;
|
|
171
|
+
/**
|
|
172
|
+
* Reads the latest live hardware FPS from CADisplayLink (iOS) or Choreographer (Android).
|
|
173
|
+
*/
|
|
174
|
+
const getNativeFpsMetrics = async () => {
|
|
175
|
+
if (!NativeModule || !NativeModule.getFpsMetrics) {
|
|
176
|
+
return { fps: 60, targetFps: 60 };
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const metrics = await NativeModule.getFpsMetrics();
|
|
180
|
+
return {
|
|
181
|
+
fps: typeof metrics?.fps === 'number' ? metrics.fps : 60,
|
|
182
|
+
targetFps: typeof metrics?.targetFps === 'number' ? metrics.targetFps : 60,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
return { fps: 60, targetFps: 60 };
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
exports.getNativeFpsMetrics = getNativeFpsMetrics;
|
|
190
|
+
/**
|
|
191
|
+
* Subscribes to physical hardware shake events (or Cmd+Ctrl+Z on iOS simulator).
|
|
192
|
+
*/
|
|
193
|
+
const subscribeNativeDeviceShake = (callback) => {
|
|
194
|
+
if (!nativeEmitter) {
|
|
195
|
+
return () => { };
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
const subscription = nativeEmitter.addListener('onDeviceShake', callback);
|
|
199
|
+
return () => {
|
|
200
|
+
subscription.remove();
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return () => { };
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
exports.subscribeNativeDeviceShake = subscribeNativeDeviceShake;
|
|
208
|
+
/**
|
|
209
|
+
* Reads a persisted value synchronously from native NSUserDefaults / SharedPreferences.
|
|
210
|
+
*/
|
|
211
|
+
const getNativeStorageItem = async (key) => {
|
|
212
|
+
if (!NativeModule || !NativeModule.getNativeStorageItem) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
const val = await NativeModule.getNativeStorageItem(key);
|
|
217
|
+
return typeof val === 'string' ? val : null;
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
exports.getNativeStorageItem = getNativeStorageItem;
|
|
224
|
+
/**
|
|
225
|
+
* Persists a key-value pair to native NSUserDefaults / SharedPreferences with 0ms latency.
|
|
226
|
+
*/
|
|
227
|
+
const setNativeStorageItem = async (key, value) => {
|
|
228
|
+
if (!NativeModule || !NativeModule.setNativeStorageItem) {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
try {
|
|
232
|
+
const result = await NativeModule.setNativeStorageItem(key, value);
|
|
233
|
+
return !!result;
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
exports.setNativeStorageItem = setNativeStorageItem;
|
|
240
|
+
/**
|
|
241
|
+
* Triggers hardware native haptic feedback (iOS UIFeedbackGenerator / Android VibrationEffect).
|
|
242
|
+
*/
|
|
243
|
+
const triggerNativeHaptic = async (style = 'light') => {
|
|
244
|
+
if (!NativeModule || !NativeModule.triggerHaptic) {
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
const result = await NativeModule.triggerHaptic(style);
|
|
249
|
+
return !!result;
|
|
250
|
+
}
|
|
251
|
+
catch {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
exports.triggerNativeHaptic = triggerNativeHaptic;
|
|
256
|
+
/**
|
|
257
|
+
* Retrieves live system thermal state and RAM telemetry directly from native layer.
|
|
258
|
+
*/
|
|
259
|
+
const getNativeSystemMetrics = async () => {
|
|
260
|
+
if (!NativeModule || !NativeModule.getNativeSystemMetrics) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
const metrics = await NativeModule.getNativeSystemMetrics();
|
|
265
|
+
return metrics;
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
exports.getNativeSystemMetrics = getNativeSystemMetrics;
|
|
272
|
+
/**
|
|
273
|
+
* Pushes a log payload to native background worker queues for instant native page caching.
|
|
274
|
+
*/
|
|
275
|
+
const pushNativeLogRecord = async (pageKey, jsonPayload) => {
|
|
276
|
+
if (!NativeModule || !NativeModule.pushNativeLogRecord) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
try {
|
|
280
|
+
const result = await NativeModule.pushNativeLogRecord(pageKey, jsonPayload);
|
|
281
|
+
return !!result;
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
exports.pushNativeLogRecord = pushNativeLogRecord;
|
|
288
|
+
/**
|
|
289
|
+
* Fetches pre-indexed, pre-sliced page data directly from native background memory queues.
|
|
290
|
+
* Delivers instantaneous 0ms page loading without blocking JS render thread.
|
|
291
|
+
*/
|
|
292
|
+
const fetchNativeCachedPage = async (pageKey, offset = 0, limit = 50, query = '') => {
|
|
293
|
+
if (!NativeModule || !NativeModule.getNativeCachedPage) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
try {
|
|
297
|
+
const rawJson = await NativeModule.getNativeCachedPage(pageKey, offset, limit, query);
|
|
298
|
+
if (!rawJson)
|
|
299
|
+
return null;
|
|
300
|
+
const parsed = JSON.parse(rawJson);
|
|
301
|
+
const parsedItems = (parsed.items || []).map((item) => typeof item === 'string' ? JSON.parse(item) : item);
|
|
302
|
+
return {
|
|
303
|
+
pageKey: parsed.pageKey || pageKey,
|
|
304
|
+
total: parsed.total || 0,
|
|
305
|
+
offset: parsed.offset || offset,
|
|
306
|
+
items: parsedItems,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
exports.fetchNativeCachedPage = fetchNativeCachedPage;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
enableNativeCrashProtection(): Promise<boolean>;
|
|
4
|
+
getDeviceMetrics(): Promise<Object>;
|
|
5
|
+
showFloatingButton(options: Object): Promise<boolean>;
|
|
6
|
+
hideFloatingButton(): Promise<boolean>;
|
|
7
|
+
setFloatingButtonBadge(hasBadge: boolean): Promise<boolean>;
|
|
8
|
+
setFloatingButtonPosition(x: number, y: number): Promise<boolean>;
|
|
9
|
+
startFpsMonitoring(): Promise<boolean>;
|
|
10
|
+
stopFpsMonitoring(): Promise<boolean>;
|
|
11
|
+
getFpsMetrics(): Promise<Object>;
|
|
12
|
+
getNativeStorageItem(key: string): Promise<string | null>;
|
|
13
|
+
setNativeStorageItem(key: string, value: string | null): Promise<boolean>;
|
|
14
|
+
triggerHaptic(style: string): Promise<boolean>;
|
|
15
|
+
getNativeSystemMetrics(): Promise<Object>;
|
|
16
|
+
pushNativeLogRecord(pageKey: string, jsonPayload: string): Promise<boolean>;
|
|
17
|
+
getNativeCachedPage(pageKey: string, offset: number, limit: number, query: string): Promise<string>;
|
|
18
|
+
addListener(eventName: string): void;
|
|
19
|
+
removeListeners(count: number): void;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: Spec;
|
|
22
|
+
export default _default;
|
|
@@ -176,8 +176,8 @@ const getRawStyles = (colors) => ({
|
|
|
176
176
|
// #2 — scroll-to-top button, always shown at the bottom right.
|
|
177
177
|
scrollTopBtn: {
|
|
178
178
|
position: 'absolute',
|
|
179
|
-
bottom:
|
|
180
|
-
right:
|
|
179
|
+
bottom: 22,
|
|
180
|
+
right: 16,
|
|
181
181
|
width: 38,
|
|
182
182
|
height: 38,
|
|
183
183
|
borderRadius: 19,
|
|
@@ -186,10 +186,10 @@ const getRawStyles = (colors) => ({
|
|
|
186
186
|
justifyContent: 'center',
|
|
187
187
|
shadowColor: colors.black,
|
|
188
188
|
shadowOffset: { width: 0, height: 3 },
|
|
189
|
-
shadowOpacity: 0.
|
|
190
|
-
shadowRadius:
|
|
191
|
-
elevation:
|
|
192
|
-
zIndex:
|
|
189
|
+
shadowOpacity: 0.3,
|
|
190
|
+
shadowRadius: 6,
|
|
191
|
+
elevation: 12,
|
|
192
|
+
zIndex: 999,
|
|
193
193
|
},
|
|
194
194
|
detailScroll: { flex: 1 },
|
|
195
195
|
closeButtonSquare: {
|
|
@@ -25,7 +25,7 @@ export declare const StatusFilter: {
|
|
|
25
25
|
readonly FiveXx: "5xx";
|
|
26
26
|
readonly Failed: "Failed";
|
|
27
27
|
};
|
|
28
|
-
export type StatusFilter = (typeof StatusFilter)[keyof typeof StatusFilter];
|
|
28
|
+
export type StatusFilter = (typeof StatusFilter)[keyof typeof StatusFilter] | string;
|
|
29
29
|
export declare const SortOrder: {
|
|
30
30
|
readonly Newest: "newest";
|
|
31
31
|
readonly Oldest: "oldest";
|
|
@@ -140,6 +140,9 @@ export interface PersistedSettings {
|
|
|
140
140
|
defaultTab?: string;
|
|
141
141
|
maxNetworkLogs?: number;
|
|
142
142
|
maxConsoleLogs?: number;
|
|
143
|
+
maxAnalyticsEventsLimit?: number;
|
|
144
|
+
maxCrashLogs?: number;
|
|
145
|
+
isAutoRamLimitEnabled?: boolean;
|
|
143
146
|
showConsoleLevels?: {
|
|
144
147
|
info: boolean;
|
|
145
148
|
warn: boolean;
|
|
@@ -197,6 +200,7 @@ export interface InspectorContextValue {
|
|
|
197
200
|
activePulseAnim: Animated.Value;
|
|
198
201
|
unreadPulseAnim: Animated.Value;
|
|
199
202
|
runClearAllWithAnimation: () => void;
|
|
203
|
+
useNativeFab: boolean;
|
|
200
204
|
fabPan: Animated.ValueXY;
|
|
201
205
|
fabPanResponder: PanResponderInstance;
|
|
202
206
|
fabDraggedRef: React.MutableRefObject<boolean>;
|
|
@@ -313,6 +317,11 @@ export interface InspectorContextValue {
|
|
|
313
317
|
setMaxNetworkLogs: React.Dispatch<React.SetStateAction<number>>;
|
|
314
318
|
maxConsoleLogs: number;
|
|
315
319
|
setMaxConsoleLogs: React.Dispatch<React.SetStateAction<number>>;
|
|
320
|
+
maxAnalyticsEventsLimit: number;
|
|
321
|
+
setMaxAnalyticsEventsLimit: React.Dispatch<React.SetStateAction<number>>;
|
|
322
|
+
isAutoRamLimitEnabled: boolean;
|
|
323
|
+
setIsAutoRamLimitEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
324
|
+
deviceFreeRamMb: number;
|
|
316
325
|
reduxAutoRefresh: boolean;
|
|
317
326
|
setReduxAutoRefreshState: React.Dispatch<React.SetStateAction<boolean>>;
|
|
318
327
|
reduxExpandDepth: number;
|
|
@@ -4,6 +4,7 @@ import { Share } from 'react-native';
|
|
|
4
4
|
import TouchableScale from './TouchableScale';
|
|
5
5
|
// Helpers
|
|
6
6
|
import { copyToClipboard } from '../helpers';
|
|
7
|
+
import { triggerNativeHaptic } from '../native/NativeInspector';
|
|
7
8
|
// Assets
|
|
8
9
|
import { TerminalIcon, FetchIcon, CopyIcon, CheckIcon } from './NetworkIcons';
|
|
9
10
|
// Stylesheet
|
|
@@ -12,6 +13,7 @@ import styles from '../styles';
|
|
|
12
13
|
const CopyButton = React.memo(({ value, label, iconType = 'copy' }) => {
|
|
13
14
|
const [copied, setCopied] = useState(false);
|
|
14
15
|
const handlePress = useCallback(() => {
|
|
16
|
+
triggerNativeHaptic('success');
|
|
15
17
|
const resolvedValue = typeof value === 'function' ? value() : value;
|
|
16
18
|
copyToClipboard(resolvedValue, label);
|
|
17
19
|
setCopied(true);
|
|
@@ -19,6 +21,7 @@ const CopyButton = React.memo(({ value, label, iconType = 'copy' }) => {
|
|
|
19
21
|
}, [value, label]);
|
|
20
22
|
const handleLongPress = useCallback(() => {
|
|
21
23
|
try {
|
|
24
|
+
triggerNativeHaptic('medium');
|
|
22
25
|
const resolvedValue = typeof value === 'function' ? value() : value;
|
|
23
26
|
const textToShare = typeof resolvedValue === 'string'
|
|
24
27
|
? resolvedValue
|
|
@@ -7,6 +7,7 @@ import { t } from '../i18n';
|
|
|
7
7
|
import { WarningTriangleIcon, CopyIcon, RefreshCcwIcon, ClearIcon, CircleAlertIcon, } from './NetworkIcons';
|
|
8
8
|
import { handleInterceptedCrash } from '../customHooks/crashHandler';
|
|
9
9
|
import { CrashType } from '../types/enums';
|
|
10
|
+
import { showNativeFloatingButton, setNativeFloatingButtonBadge, } from '../native/NativeInspector';
|
|
10
11
|
function parseStackTrace(stack) {
|
|
11
12
|
if (!stack)
|
|
12
13
|
return { rootFrame: null, frames: [] };
|
|
@@ -109,6 +110,8 @@ ${error.stack || 'No stack trace available'}
|
|
|
109
110
|
try {
|
|
110
111
|
const stack = error?.stack || errorInfo?.componentStack || '';
|
|
111
112
|
handleInterceptedCrash(error, stack, false, CrashType.Render, errorInfo?.componentStack);
|
|
113
|
+
showNativeFloatingButton();
|
|
114
|
+
setNativeFloatingButtonBadge(true);
|
|
112
115
|
}
|
|
113
116
|
catch { }
|
|
114
117
|
}
|
|
@@ -21,6 +21,10 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
21
21
|
const userProperties = getCurrentUserProperties();
|
|
22
22
|
const defaultParams = getDefaultEventParameters();
|
|
23
23
|
const isTrackingEnabled = getCollectionEnabled();
|
|
24
|
+
// If there are no analytics events in the session, hide the graph, category breakdown, and realtime card
|
|
25
|
+
if (analyticsEvents.length === 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
24
28
|
const hasUserProps = Object.keys(userProperties).length > 0;
|
|
25
29
|
const hasDefaultParams = Object.keys(defaultParams).length > 0;
|
|
26
30
|
const totalEvents = filteredAnalyticsEvents.length;
|
|
@@ -590,8 +594,8 @@ const AnalyticsHeader = React.memo(() => {
|
|
|
590
594
|
</View>
|
|
591
595
|
|
|
592
596
|
{/* ── Crashlytics-Style Multi-Bar Histogram with Trendline Overlay ── */}
|
|
593
|
-
<View style={{ height: chartHeight, position: 'relative' }}>
|
|
594
|
-
<Svg width="100%" height={chartHeight} viewBox={`0 0 ${svgWidth} ${chartHeight}`}>
|
|
597
|
+
<View style={{ height: chartHeight, position: 'relative', overflow: 'hidden', borderRadius: 8 }}>
|
|
598
|
+
<Svg width="100%" height={chartHeight} viewBox={`0 0 ${svgWidth} ${chartHeight}`} preserveAspectRatio="none">
|
|
595
599
|
<Defs>
|
|
596
600
|
<SvgLinearGradient id="crashlyticsBarGrad" x1="0" y1="0" x2="0" y2="1">
|
|
597
601
|
<Stop offset="0%" stopColor="#8B5CF6" stopOpacity="0.9"/>
|
|
@@ -955,7 +959,7 @@ const AnalyticsTab = React.memo(() => {
|
|
|
955
959
|
<AnalyticsFilterModal visible={isFilterModalOpen} onClose={() => setIsFilterModalOpen(false)}/>
|
|
956
960
|
|
|
957
961
|
<View style={{ flex: 1 }} onLayout={() => setIsAnalyticsLayoutReady(true)}>
|
|
958
|
-
{selectedEvent != null ? (<AnalyticsDetail event={selectedEvent}/>) : isAnalyticsLayoutReady ? (<FlatList data={filteredAnalyticsEvents} keyExtractor={keyExtractor} ListHeaderComponent={AnalyticsHeader} renderItem={renderItem} initialNumToRender={
|
|
962
|
+
{selectedEvent != null ? (<AnalyticsDetail event={selectedEvent}/>) : isAnalyticsLayoutReady ? (<FlatList data={filteredAnalyticsEvents} keyExtractor={keyExtractor} ListHeaderComponent={AnalyticsHeader} renderItem={renderItem} initialNumToRender={12} maxToRenderPerBatch={8} windowSize={5} removeClippedSubviews={true} renderToHardwareTextureAndroid={true} ListEmptyComponent={<View style={styles.emptyContainer}>
|
|
959
963
|
<View style={styles.emptyIconWrap}>
|
|
960
964
|
<EmptyRadarIcon color={AppColors.purple} size={32}/>
|
|
961
965
|
</View>
|
|
@@ -816,7 +816,7 @@ const BundleTab = React.memo(() => {
|
|
|
816
816
|
{analysis.scriptURL.length} chars
|
|
817
817
|
</Text>
|
|
818
818
|
</View>
|
|
819
|
-
<Text selectable={true} style={{
|
|
819
|
+
<Text selectable={true} numberOfLines={1} ellipsizeMode="tail" style={{
|
|
820
820
|
fontFamily: AppFonts.interMedium,
|
|
821
821
|
fontSize: 11,
|
|
822
822
|
color: AppColors.skyBlue,
|
|
@@ -469,7 +469,7 @@ const ConsoleTab = React.memo(() => {
|
|
|
469
469
|
</ScrollView>
|
|
470
470
|
</View>
|
|
471
471
|
|
|
472
|
-
<FlatList data={filteredConsoleLogs} keyExtractor={keyExtractor} ListHeaderComponent={listHeader} renderItem={renderItem} initialNumToRender={
|
|
472
|
+
<FlatList data={filteredConsoleLogs} keyExtractor={keyExtractor} ListHeaderComponent={listHeader} renderItem={renderItem} initialNumToRender={12} maxToRenderPerBatch={8} windowSize={5} removeClippedSubviews={true} renderToHardwareTextureAndroid={true} ListEmptyComponent={<EmptyState isSearch={logSearch.length > 0 || logFilters.size > 0}/>} ListFooterComponent={filteredConsoleLogs.length > 0 ? (<EndOfListFooter count={filteredConsoleLogs.length} label="logs"/>) : null} contentContainerStyle={[
|
|
473
473
|
styles.listContent,
|
|
474
474
|
filteredConsoleLogs.length === 0 && { flexGrow: 1 },
|
|
475
475
|
]} keyboardShouldPersistTaps="handled"/>
|