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.
Files changed (122) hide show
  1. package/README.md +123 -101
  2. package/android/build.gradle +13 -1
  3. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +904 -0
  4. package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.kt +17 -0
  5. package/dist/commonjs/components/ConsoleLogCard.js +57 -56
  6. package/dist/commonjs/components/CopyButton.js +10 -1
  7. package/dist/commonjs/components/ErrorBoundary.js +3 -0
  8. package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -3
  9. package/dist/commonjs/components/Inspector/BundleTab.js +20 -20
  10. package/dist/commonjs/components/Inspector/ConsoleTab.js +1 -1
  11. package/dist/commonjs/components/Inspector/CrashDetail.js +16 -12
  12. package/dist/commonjs/components/Inspector/CrashTab.js +97 -90
  13. package/dist/commonjs/components/Inspector/InspectorHeader.js +28 -24
  14. package/dist/commonjs/components/Inspector/MainScreen.js +20 -103
  15. package/dist/commonjs/components/Inspector/NetworkTab.js +143 -10
  16. package/dist/commonjs/components/Inspector/PerformanceTab.js +96 -3
  17. package/dist/commonjs/components/Inspector/ReduxDetail.js +24 -19
  18. package/dist/commonjs/components/Inspector/ReduxTab.js +30 -18
  19. package/dist/commonjs/components/Inspector/SettingsPanel.js +1578 -754
  20. package/dist/commonjs/components/Inspector/TabBar.js +6 -3
  21. package/dist/commonjs/components/LogCard.js +27 -9
  22. package/dist/commonjs/components/MetaAccordion.js +42 -0
  23. package/dist/commonjs/components/NetworkIcons.d.ts +10 -0
  24. package/dist/commonjs/components/NetworkIcons.js +53 -1
  25. package/dist/commonjs/components/Toast.js +3 -3
  26. package/dist/commonjs/components/TouchableScale.d.ts +5 -2
  27. package/dist/commonjs/components/TouchableScale.js +30 -32
  28. package/dist/commonjs/constants/index.d.ts +1 -2
  29. package/dist/commonjs/constants/index.js +4 -0
  30. package/dist/commonjs/constants/version.d.ts +1 -1
  31. package/dist/commonjs/constants/version.js +1 -1
  32. package/dist/commonjs/customHooks/analyticsLogger.d.ts +6 -0
  33. package/dist/commonjs/customHooks/analyticsLogger.js +16 -5
  34. package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +2 -0
  35. package/dist/commonjs/customHooks/bundleAnalyzer.js +26 -17
  36. package/dist/commonjs/customHooks/consoleLogger.d.ts +2 -0
  37. package/dist/commonjs/customHooks/consoleLogger.js +10 -1
  38. package/dist/commonjs/customHooks/crashHandler.d.ts +2 -0
  39. package/dist/commonjs/customHooks/crashHandler.js +17 -1
  40. package/dist/commonjs/customHooks/networkLogger.d.ts +2 -0
  41. package/dist/commonjs/customHooks/networkLogger.js +12 -1
  42. package/dist/commonjs/customHooks/performanceTracker.d.ts +3 -1
  43. package/dist/commonjs/customHooks/performanceTracker.js +18 -4
  44. package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
  45. package/dist/commonjs/customHooks/reduxLogger.js +10 -1
  46. package/dist/commonjs/helpers/index.js +10 -1
  47. package/dist/commonjs/helpers/settingsStore.d.ts +9 -0
  48. package/dist/commonjs/helpers/settingsStore.js +59 -3
  49. package/dist/commonjs/i18n/locales/en.json +96 -28
  50. package/dist/commonjs/index.d.ts +1 -0
  51. package/dist/commonjs/index.js +307 -73
  52. package/dist/commonjs/native/NativeInspector.d.ts +125 -0
  53. package/dist/commonjs/native/NativeInspector.js +313 -0
  54. package/dist/commonjs/native/NativeNetworkInspector.d.ts +22 -0
  55. package/dist/commonjs/native/NativeNetworkInspector.js +4 -0
  56. package/dist/commonjs/styles/AppColors.d.ts +28 -0
  57. package/dist/commonjs/styles/AppColors.js +30 -0
  58. package/dist/commonjs/styles/index.js +6 -6
  59. package/dist/commonjs/types/enums.d.ts +1 -1
  60. package/dist/commonjs/types/interfaces.d.ts +9 -0
  61. package/dist/esm/components/ConsoleLogCard.js +58 -57
  62. package/dist/esm/components/CopyButton.js +10 -1
  63. package/dist/esm/components/ErrorBoundary.js +3 -0
  64. package/dist/esm/components/Inspector/AnalyticsTab.js +7 -3
  65. package/dist/esm/components/Inspector/BundleTab.js +20 -20
  66. package/dist/esm/components/Inspector/ConsoleTab.js +1 -1
  67. package/dist/esm/components/Inspector/CrashDetail.js +16 -12
  68. package/dist/esm/components/Inspector/CrashTab.js +97 -90
  69. package/dist/esm/components/Inspector/InspectorHeader.js +29 -25
  70. package/dist/esm/components/Inspector/MainScreen.js +21 -71
  71. package/dist/esm/components/Inspector/NetworkTab.js +145 -12
  72. package/dist/esm/components/Inspector/PerformanceTab.js +96 -3
  73. package/dist/esm/components/Inspector/ReduxDetail.js +24 -19
  74. package/dist/esm/components/Inspector/ReduxTab.js +30 -18
  75. package/dist/esm/components/Inspector/SettingsPanel.js +1582 -758
  76. package/dist/esm/components/Inspector/TabBar.js +7 -4
  77. package/dist/esm/components/LogCard.js +27 -9
  78. package/dist/esm/components/MetaAccordion.js +42 -0
  79. package/dist/esm/components/NetworkIcons.d.ts +10 -0
  80. package/dist/esm/components/NetworkIcons.js +42 -0
  81. package/dist/esm/components/Toast.js +3 -3
  82. package/dist/esm/components/TouchableScale.d.ts +5 -2
  83. package/dist/esm/components/TouchableScale.js +31 -33
  84. package/dist/esm/constants/index.d.ts +1 -2
  85. package/dist/esm/constants/index.js +4 -0
  86. package/dist/esm/constants/version.d.ts +1 -1
  87. package/dist/esm/constants/version.js +1 -1
  88. package/dist/esm/customHooks/analyticsLogger.d.ts +6 -0
  89. package/dist/esm/customHooks/analyticsLogger.js +12 -4
  90. package/dist/esm/customHooks/bundleAnalyzer.d.ts +2 -0
  91. package/dist/esm/customHooks/bundleAnalyzer.js +23 -16
  92. package/dist/esm/customHooks/consoleLogger.d.ts +2 -0
  93. package/dist/esm/customHooks/consoleLogger.js +7 -0
  94. package/dist/esm/customHooks/crashHandler.d.ts +2 -0
  95. package/dist/esm/customHooks/crashHandler.js +14 -0
  96. package/dist/esm/customHooks/networkLogger.d.ts +2 -0
  97. package/dist/esm/customHooks/networkLogger.js +9 -0
  98. package/dist/esm/customHooks/performanceTracker.d.ts +3 -1
  99. package/dist/esm/customHooks/performanceTracker.js +15 -3
  100. package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
  101. package/dist/esm/customHooks/reduxLogger.js +7 -0
  102. package/dist/esm/helpers/index.js +10 -1
  103. package/dist/esm/helpers/settingsStore.d.ts +9 -0
  104. package/dist/esm/helpers/settingsStore.js +58 -3
  105. package/dist/esm/i18n/locales/en.json +96 -28
  106. package/dist/esm/index.d.ts +1 -0
  107. package/dist/esm/index.js +279 -59
  108. package/dist/esm/native/NativeInspector.d.ts +125 -0
  109. package/dist/esm/native/NativeInspector.js +289 -0
  110. package/dist/esm/native/NativeNetworkInspector.d.ts +22 -0
  111. package/dist/esm/native/NativeNetworkInspector.js +2 -0
  112. package/dist/esm/styles/AppColors.d.ts +28 -0
  113. package/dist/esm/styles/AppColors.js +30 -0
  114. package/dist/esm/styles/index.js +6 -6
  115. package/dist/esm/types/enums.d.ts +1 -1
  116. package/dist/esm/types/interfaces.d.ts +9 -0
  117. package/ios/NetworkInspectorModule.h +6 -0
  118. package/ios/NetworkInspectorModule.m +720 -5
  119. package/package.json +15 -3
  120. package/react-native-inapp-inspector.podspec +7 -2
  121. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +0 -97
  122. 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,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;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_native_1 = require("react-native");
4
+ exports.default = react_native_1.TurboModuleRegistry.get('NetworkInspectorModule');
@@ -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',
@@ -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: 25,
180
- right: 15,
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.25,
190
- shadowRadius: 5,
191
- elevation: 6,
192
- zIndex: 50,
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;