react-native-inapp-inspector 1.1.34 → 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/ConsoleLogCard.js +57 -56
- package/dist/commonjs/components/CopyButton.js +10 -1
- package/dist/commonjs/components/ErrorBoundary.js +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/commonjs/components/Inspector/BundleTab.js +20 -20
- package/dist/commonjs/components/Inspector/ConsoleTab.js +1 -1
- package/dist/commonjs/components/Inspector/CrashDetail.js +16 -12
- package/dist/commonjs/components/Inspector/CrashTab.js +97 -90
- package/dist/commonjs/components/Inspector/InspectorHeader.js +28 -24
- package/dist/commonjs/components/Inspector/MainScreen.js +20 -103
- package/dist/commonjs/components/Inspector/NetworkTab.js +143 -10
- package/dist/commonjs/components/Inspector/PerformanceTab.js +96 -3
- package/dist/commonjs/components/Inspector/ReduxDetail.js +24 -19
- package/dist/commonjs/components/Inspector/ReduxTab.js +30 -18
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1578 -754
- package/dist/commonjs/components/Inspector/TabBar.js +6 -3
- package/dist/commonjs/components/LogCard.js +27 -9
- package/dist/commonjs/components/MetaAccordion.js +42 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +10 -0
- package/dist/commonjs/components/NetworkIcons.js +53 -1
- package/dist/commonjs/components/Toast.js +3 -3
- package/dist/commonjs/components/TouchableScale.d.ts +5 -2
- 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 +6 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +16 -5
- 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 +17 -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/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/i18n/locales/en.json +96 -28
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +307 -73
- 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/AppColors.d.ts +28 -0
- package/dist/commonjs/styles/AppColors.js +30 -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/ConsoleLogCard.js +58 -57
- package/dist/esm/components/CopyButton.js +10 -1
- package/dist/esm/components/ErrorBoundary.js +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/esm/components/Inspector/BundleTab.js +20 -20
- package/dist/esm/components/Inspector/ConsoleTab.js +1 -1
- package/dist/esm/components/Inspector/CrashDetail.js +16 -12
- package/dist/esm/components/Inspector/CrashTab.js +97 -90
- package/dist/esm/components/Inspector/InspectorHeader.js +29 -25
- package/dist/esm/components/Inspector/MainScreen.js +21 -71
- package/dist/esm/components/Inspector/NetworkTab.js +145 -12
- package/dist/esm/components/Inspector/PerformanceTab.js +96 -3
- package/dist/esm/components/Inspector/ReduxDetail.js +24 -19
- package/dist/esm/components/Inspector/ReduxTab.js +30 -18
- package/dist/esm/components/Inspector/SettingsPanel.js +1582 -758
- package/dist/esm/components/Inspector/TabBar.js +7 -4
- package/dist/esm/components/LogCard.js +27 -9
- package/dist/esm/components/MetaAccordion.js +42 -0
- package/dist/esm/components/NetworkIcons.d.ts +10 -0
- package/dist/esm/components/NetworkIcons.js +42 -0
- package/dist/esm/components/Toast.js +3 -3
- package/dist/esm/components/TouchableScale.d.ts +5 -2
- 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 +6 -0
- package/dist/esm/customHooks/analyticsLogger.js +12 -4
- 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 +14 -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/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/i18n/locales/en.json +96 -28
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +279 -59
- 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/AppColors.d.ts +28 -0
- package/dist/esm/styles/AppColors.js +30 -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 +15 -3
- 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,125 @@
|
|
|
1
|
+
export interface NativeDeviceMetrics {
|
|
2
|
+
totalRAM?: number;
|
|
3
|
+
freeRAM?: number;
|
|
4
|
+
usedRAM?: number;
|
|
5
|
+
residentMemory?: number;
|
|
6
|
+
virtualMemory?: number;
|
|
7
|
+
isLowMemory?: boolean;
|
|
8
|
+
nativeHeapAllocated?: number;
|
|
9
|
+
nativeHeapSize?: number;
|
|
10
|
+
nativeHeapFree?: number;
|
|
11
|
+
freeStorage?: number;
|
|
12
|
+
totalStorage?: number;
|
|
13
|
+
batteryPercent?: number;
|
|
14
|
+
isCharging?: boolean;
|
|
15
|
+
deviceModel?: string;
|
|
16
|
+
deviceBrand?: string;
|
|
17
|
+
osVersion?: string;
|
|
18
|
+
apiLevel?: number;
|
|
19
|
+
cpuAbi?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface NativeCrashEvent {
|
|
22
|
+
platform: 'android' | 'ios';
|
|
23
|
+
error: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
stack?: string;
|
|
26
|
+
threadName?: string;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
}
|
|
29
|
+
export declare const isNativeModuleAvailable: () => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves low-level native hardware and system metrics (RAM, Heap, Disk, Battery, CPU).
|
|
32
|
+
*/
|
|
33
|
+
export declare const getNativeDeviceMetrics: () => Promise<NativeDeviceMetrics | null>;
|
|
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
|
+
export declare const enableNativeCrashProtection: (options?: {
|
|
39
|
+
showFloatingButton?: boolean;
|
|
40
|
+
}) => Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Subscribes to fatal native crash events caught by the iOS / Kotlin exception handlers.
|
|
43
|
+
*/
|
|
44
|
+
export declare const subscribeNativeCrashes: (callback: (event: NativeCrashEvent) => void) => (() => void);
|
|
45
|
+
export interface FloatingButtonOptions {
|
|
46
|
+
size?: number;
|
|
47
|
+
x?: number;
|
|
48
|
+
y?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Displays the 100% native main-thread floating overlay button.
|
|
52
|
+
* Dragging & touches run on the native UI thread, completely isolated from JS thread stalls.
|
|
53
|
+
*/
|
|
54
|
+
export declare const showNativeFloatingButton: (options?: FloatingButtonOptions) => Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Hides the native floating overlay button.
|
|
57
|
+
*/
|
|
58
|
+
export declare const hideNativeFloatingButton: () => Promise<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Updates the badge/status dot on the native floating overlay button.
|
|
61
|
+
*/
|
|
62
|
+
export declare const setNativeFloatingButtonBadge: (hasBadge: boolean) => Promise<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* Subscribes to tap events on the native floating button.
|
|
65
|
+
*/
|
|
66
|
+
export declare const subscribeNativeFloatingButtonPress: (callback: () => void) => (() => void);
|
|
67
|
+
/**
|
|
68
|
+
* Starts hardware-accurate native UI thread FPS tracking (CADisplayLink / Choreographer).
|
|
69
|
+
*/
|
|
70
|
+
export declare const startNativeFpsMonitoring: () => Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Stops native FPS tracking.
|
|
73
|
+
*/
|
|
74
|
+
export declare const stopNativeFpsMonitoring: () => Promise<boolean>;
|
|
75
|
+
export interface NativeFpsMetrics {
|
|
76
|
+
fps: number;
|
|
77
|
+
targetFps: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Reads the latest live hardware FPS from CADisplayLink (iOS) or Choreographer (Android).
|
|
81
|
+
*/
|
|
82
|
+
export declare const getNativeFpsMetrics: () => Promise<NativeFpsMetrics>;
|
|
83
|
+
/**
|
|
84
|
+
* Subscribes to physical hardware shake events (or Cmd+Ctrl+Z on iOS simulator).
|
|
85
|
+
*/
|
|
86
|
+
export declare const subscribeNativeDeviceShake: (callback: () => void) => (() => void);
|
|
87
|
+
/**
|
|
88
|
+
* Reads a persisted value synchronously from native NSUserDefaults / SharedPreferences.
|
|
89
|
+
*/
|
|
90
|
+
export declare const getNativeStorageItem: (key: string) => Promise<string | null>;
|
|
91
|
+
/**
|
|
92
|
+
* Persists a key-value pair to native NSUserDefaults / SharedPreferences with 0ms latency.
|
|
93
|
+
*/
|
|
94
|
+
export declare const setNativeStorageItem: (key: string, value: string | null) => Promise<boolean>;
|
|
95
|
+
export type HapticStyle = 'light' | 'medium' | 'heavy' | 'success' | 'warning' | 'error';
|
|
96
|
+
/**
|
|
97
|
+
* Triggers hardware native haptic feedback (iOS UIFeedbackGenerator / Android VibrationEffect).
|
|
98
|
+
*/
|
|
99
|
+
export declare const triggerNativeHaptic: (style?: HapticStyle) => Promise<boolean>;
|
|
100
|
+
export interface NativeSystemMetrics {
|
|
101
|
+
thermalState: 'nominal' | 'fair' | 'serious' | 'critical';
|
|
102
|
+
residentRamMb: number;
|
|
103
|
+
totalPhysicalRamMb: number;
|
|
104
|
+
fps: number;
|
|
105
|
+
activeCpuCores: number;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Retrieves live system thermal state and RAM telemetry directly from native layer.
|
|
109
|
+
*/
|
|
110
|
+
export declare const getNativeSystemMetrics: () => Promise<NativeSystemMetrics | null>;
|
|
111
|
+
/**
|
|
112
|
+
* Pushes a log payload to native background worker queues for instant native page caching.
|
|
113
|
+
*/
|
|
114
|
+
export declare const pushNativeLogRecord: (pageKey: "apis" | "logs" | "analytics" | "crash", jsonPayload: string) => Promise<boolean>;
|
|
115
|
+
export interface NativeCachedPageResult<T = any> {
|
|
116
|
+
pageKey: string;
|
|
117
|
+
total: number;
|
|
118
|
+
offset: number;
|
|
119
|
+
items: T[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Fetches pre-indexed, pre-sliced page data directly from native background memory queues.
|
|
123
|
+
* Delivers instantaneous 0ms page loading without blocking JS render thread.
|
|
124
|
+
*/
|
|
125
|
+
export declare const fetchNativeCachedPage: <T = any>(pageKey: "apis" | "logs" | "analytics" | "crash", offset?: number, limit?: number, query?: string) => Promise<NativeCachedPageResult<T> | null>;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { NativeModules, NativeEventEmitter } from 'react-native';
|
|
2
|
+
import NativeNetworkInspector from './NativeNetworkInspector';
|
|
3
|
+
// Seamless TurboModule (New Architecture / JSI) & Legacy NativeModules Bridge resolution
|
|
4
|
+
const NativeModule = NativeNetworkInspector || NativeModules.NetworkInspectorModule;
|
|
5
|
+
export const isNativeModuleAvailable = () => {
|
|
6
|
+
return !!NativeModule;
|
|
7
|
+
};
|
|
8
|
+
const nativeEmitter = isNativeModuleAvailable()
|
|
9
|
+
? new NativeEventEmitter(NativeModule)
|
|
10
|
+
: null;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves low-level native hardware and system metrics (RAM, Heap, Disk, Battery, CPU).
|
|
13
|
+
*/
|
|
14
|
+
export const getNativeDeviceMetrics = async () => {
|
|
15
|
+
if (!NativeModule || !NativeModule.getDeviceMetrics) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const metrics = await NativeModule.getDeviceMetrics();
|
|
20
|
+
return metrics;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Enables native signal and uncaught exception protection in the iOS / Android runtime.
|
|
28
|
+
* Automatically ensures the native floating icon is shown and available before UI renders.
|
|
29
|
+
*/
|
|
30
|
+
export const enableNativeCrashProtection = async (options) => {
|
|
31
|
+
if (!NativeModule || !NativeModule.enableNativeCrashProtection) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const result = await NativeModule.enableNativeCrashProtection();
|
|
36
|
+
if (options?.showFloatingButton !== false) {
|
|
37
|
+
await showNativeFloatingButton();
|
|
38
|
+
}
|
|
39
|
+
return !!result;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Subscribes to fatal native crash events caught by the iOS / Kotlin exception handlers.
|
|
47
|
+
*/
|
|
48
|
+
export const subscribeNativeCrashes = (callback) => {
|
|
49
|
+
if (!nativeEmitter) {
|
|
50
|
+
return () => { };
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const subscription = nativeEmitter.addListener('onNativeCrash', callback);
|
|
54
|
+
return () => {
|
|
55
|
+
subscription.remove();
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
return () => { };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Displays the 100% native main-thread floating overlay button.
|
|
64
|
+
* Dragging & touches run on the native UI thread, completely isolated from JS thread stalls.
|
|
65
|
+
*/
|
|
66
|
+
export const showNativeFloatingButton = async (options) => {
|
|
67
|
+
if (!NativeModule || !NativeModule.showFloatingButton) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const result = await NativeModule.showFloatingButton(options || {});
|
|
72
|
+
return !!result;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Hides the native floating overlay button.
|
|
80
|
+
*/
|
|
81
|
+
export const hideNativeFloatingButton = async () => {
|
|
82
|
+
if (!NativeModule || !NativeModule.hideFloatingButton) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const result = await NativeModule.hideFloatingButton();
|
|
87
|
+
return !!result;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Updates the badge/status dot on the native floating overlay button.
|
|
95
|
+
*/
|
|
96
|
+
export const setNativeFloatingButtonBadge = async (hasBadge) => {
|
|
97
|
+
if (!NativeModule || !NativeModule.setFloatingButtonBadge) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
const result = await NativeModule.setFloatingButtonBadge(hasBadge);
|
|
102
|
+
return !!result;
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Subscribes to tap events on the native floating button.
|
|
110
|
+
*/
|
|
111
|
+
export const subscribeNativeFloatingButtonPress = (callback) => {
|
|
112
|
+
if (!nativeEmitter) {
|
|
113
|
+
return () => { };
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const subscription = nativeEmitter.addListener('onFloatingButtonPress', callback);
|
|
117
|
+
return () => {
|
|
118
|
+
subscription.remove();
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
return () => { };
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Starts hardware-accurate native UI thread FPS tracking (CADisplayLink / Choreographer).
|
|
127
|
+
*/
|
|
128
|
+
export const startNativeFpsMonitoring = async () => {
|
|
129
|
+
if (!NativeModule || !NativeModule.startFpsMonitoring) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
const result = await NativeModule.startFpsMonitoring();
|
|
134
|
+
return !!result;
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Stops native FPS tracking.
|
|
142
|
+
*/
|
|
143
|
+
export const stopNativeFpsMonitoring = async () => {
|
|
144
|
+
if (!NativeModule || !NativeModule.stopFpsMonitoring) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
const result = await NativeModule.stopFpsMonitoring();
|
|
149
|
+
return !!result;
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Reads the latest live hardware FPS from CADisplayLink (iOS) or Choreographer (Android).
|
|
157
|
+
*/
|
|
158
|
+
export const getNativeFpsMetrics = async () => {
|
|
159
|
+
if (!NativeModule || !NativeModule.getFpsMetrics) {
|
|
160
|
+
return { fps: 60, targetFps: 60 };
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
const metrics = await NativeModule.getFpsMetrics();
|
|
164
|
+
return {
|
|
165
|
+
fps: typeof metrics?.fps === 'number' ? metrics.fps : 60,
|
|
166
|
+
targetFps: typeof metrics?.targetFps === 'number' ? metrics.targetFps : 60,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return { fps: 60, targetFps: 60 };
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Subscribes to physical hardware shake events (or Cmd+Ctrl+Z on iOS simulator).
|
|
175
|
+
*/
|
|
176
|
+
export const subscribeNativeDeviceShake = (callback) => {
|
|
177
|
+
if (!nativeEmitter) {
|
|
178
|
+
return () => { };
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
const subscription = nativeEmitter.addListener('onDeviceShake', callback);
|
|
182
|
+
return () => {
|
|
183
|
+
subscription.remove();
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
return () => { };
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Reads a persisted value synchronously from native NSUserDefaults / SharedPreferences.
|
|
192
|
+
*/
|
|
193
|
+
export const getNativeStorageItem = async (key) => {
|
|
194
|
+
if (!NativeModule || !NativeModule.getNativeStorageItem) {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
const val = await NativeModule.getNativeStorageItem(key);
|
|
199
|
+
return typeof val === 'string' ? val : null;
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Persists a key-value pair to native NSUserDefaults / SharedPreferences with 0ms latency.
|
|
207
|
+
*/
|
|
208
|
+
export const setNativeStorageItem = async (key, value) => {
|
|
209
|
+
if (!NativeModule || !NativeModule.setNativeStorageItem) {
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
try {
|
|
213
|
+
const result = await NativeModule.setNativeStorageItem(key, value);
|
|
214
|
+
return !!result;
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Triggers hardware native haptic feedback (iOS UIFeedbackGenerator / Android VibrationEffect).
|
|
222
|
+
*/
|
|
223
|
+
export const triggerNativeHaptic = async (style = 'light') => {
|
|
224
|
+
if (!NativeModule || !NativeModule.triggerHaptic) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
const result = await NativeModule.triggerHaptic(style);
|
|
229
|
+
return !!result;
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Retrieves live system thermal state and RAM telemetry directly from native layer.
|
|
237
|
+
*/
|
|
238
|
+
export const getNativeSystemMetrics = async () => {
|
|
239
|
+
if (!NativeModule || !NativeModule.getNativeSystemMetrics) {
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
try {
|
|
243
|
+
const metrics = await NativeModule.getNativeSystemMetrics();
|
|
244
|
+
return metrics;
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Pushes a log payload to native background worker queues for instant native page caching.
|
|
252
|
+
*/
|
|
253
|
+
export const pushNativeLogRecord = async (pageKey, jsonPayload) => {
|
|
254
|
+
if (!NativeModule || !NativeModule.pushNativeLogRecord) {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
const result = await NativeModule.pushNativeLogRecord(pageKey, jsonPayload);
|
|
259
|
+
return !!result;
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Fetches pre-indexed, pre-sliced page data directly from native background memory queues.
|
|
267
|
+
* Delivers instantaneous 0ms page loading without blocking JS render thread.
|
|
268
|
+
*/
|
|
269
|
+
export const fetchNativeCachedPage = async (pageKey, offset = 0, limit = 50, query = '') => {
|
|
270
|
+
if (!NativeModule || !NativeModule.getNativeCachedPage) {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
try {
|
|
274
|
+
const rawJson = await NativeModule.getNativeCachedPage(pageKey, offset, limit, query);
|
|
275
|
+
if (!rawJson)
|
|
276
|
+
return null;
|
|
277
|
+
const parsed = JSON.parse(rawJson);
|
|
278
|
+
const parsedItems = (parsed.items || []).map((item) => typeof item === 'string' ? JSON.parse(item) : item);
|
|
279
|
+
return {
|
|
280
|
+
pageKey: parsed.pageKey || pageKey,
|
|
281
|
+
total: parsed.total || 0,
|
|
282
|
+
offset: parsed.offset || offset,
|
|
283
|
+
items: parsedItems,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
return null;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -161,6 +161,21 @@ const LightColors = {
|
|
|
161
161
|
greyBorder: '#E3DFEC',
|
|
162
162
|
paperBg: '#FBF9FC',
|
|
163
163
|
contentBg: '#F8F7FB',
|
|
164
|
+
// ─── Toast / Glass / Chip Tokens ───
|
|
165
|
+
toastBg: '#0F172AEE',
|
|
166
|
+
toastBorder: '#33415588',
|
|
167
|
+
mintGreenBg: '#ECFDF5',
|
|
168
|
+
mintGreenBorder: '#A7F3D0',
|
|
169
|
+
mintGreenText: '#059669',
|
|
170
|
+
amberWarmBg: '#FFFBEB',
|
|
171
|
+
amberWarmBorder: '#FDE68A',
|
|
172
|
+
amberWarmText: '#92400E',
|
|
173
|
+
violetSoftBg: '#EDE9FE',
|
|
174
|
+
violetSoftBorder: '#DDD6FE',
|
|
175
|
+
violetSoftText: '#7C3AED',
|
|
176
|
+
skySoftBg: '#E0F2FE',
|
|
177
|
+
skySoftBorder: '#BAE6FD',
|
|
178
|
+
skySoftText: '#0284C7',
|
|
164
179
|
// ─── Domain Colors (Thai Airways Themed) ───
|
|
165
180
|
domainColors: [
|
|
166
181
|
'#5C2D91',
|
|
@@ -237,6 +252,21 @@ const DarkColors = {
|
|
|
237
252
|
amber700: '#C5A059',
|
|
238
253
|
amber800: '#B89758',
|
|
239
254
|
green500: '#22C55E',
|
|
255
|
+
// ─── Toast / Glass / Chip Tokens (Dark) ───
|
|
256
|
+
toastBg: '#1E293BEE',
|
|
257
|
+
toastBorder: '#47556988',
|
|
258
|
+
mintGreenBg: '#064E3B66',
|
|
259
|
+
mintGreenBorder: '#05966988',
|
|
260
|
+
mintGreenText: '#34D399',
|
|
261
|
+
amberWarmBg: '#451A0366',
|
|
262
|
+
amberWarmBorder: '#D9770688',
|
|
263
|
+
amberWarmText: '#FCD34D',
|
|
264
|
+
violetSoftBg: '#3B076466',
|
|
265
|
+
violetSoftBorder: '#7C3AED88',
|
|
266
|
+
violetSoftText: '#C084FC',
|
|
267
|
+
skySoftBg: '#082F4966',
|
|
268
|
+
skySoftBorder: '#0284C788',
|
|
269
|
+
skySoftText: '#38BDF8',
|
|
240
270
|
green600: '#16A34A',
|
|
241
271
|
green700: '#15803D',
|
|
242
272
|
green800: '#166534',
|
package/dist/esm/styles/index.js
CHANGED
|
@@ -140,8 +140,8 @@ export const getRawStyles = (colors) => ({
|
|
|
140
140
|
// #2 — scroll-to-top button, always shown at the bottom right.
|
|
141
141
|
scrollTopBtn: {
|
|
142
142
|
position: 'absolute',
|
|
143
|
-
bottom:
|
|
144
|
-
right:
|
|
143
|
+
bottom: 22,
|
|
144
|
+
right: 16,
|
|
145
145
|
width: 38,
|
|
146
146
|
height: 38,
|
|
147
147
|
borderRadius: 19,
|
|
@@ -150,10 +150,10 @@ export const getRawStyles = (colors) => ({
|
|
|
150
150
|
justifyContent: 'center',
|
|
151
151
|
shadowColor: colors.black,
|
|
152
152
|
shadowOffset: { width: 0, height: 3 },
|
|
153
|
-
shadowOpacity: 0.
|
|
154
|
-
shadowRadius:
|
|
155
|
-
elevation:
|
|
156
|
-
zIndex:
|
|
153
|
+
shadowOpacity: 0.3,
|
|
154
|
+
shadowRadius: 6,
|
|
155
|
+
elevation: 12,
|
|
156
|
+
zIndex: 999,
|
|
157
157
|
},
|
|
158
158
|
detailScroll: { flex: 1 },
|
|
159
159
|
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;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
#import <React/RCTEventEmitter.h>
|
|
3
3
|
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
|
+
#import <RNInAppInspectorSpec/RNInAppInspectorSpec.h>
|
|
6
|
+
@interface NetworkInspectorModule : RCTEventEmitter <NativeNetworkInspectorSpec, RCTBridgeModule>
|
|
7
|
+
#else
|
|
4
8
|
@interface NetworkInspectorModule : RCTEventEmitter <RCTBridgeModule>
|
|
9
|
+
#endif
|
|
5
10
|
|
|
6
11
|
- (void)emitCrashEventWithMessage:(NSString *)message stackTrace:(NSString *)stackTrace;
|
|
7
12
|
|
|
8
13
|
@end
|
|
14
|
+
|