react-native-inapp-inspector 2.3.5 → 2.3.6

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 (226) hide show
  1. package/dist/commonjs/analytics.d.ts +0 -4
  2. package/dist/commonjs/analytics.js +0 -4
  3. package/dist/commonjs/bundle.d.ts +0 -4
  4. package/dist/commonjs/bundle.js +0 -4
  5. package/dist/commonjs/components/AnalyticsDetail.js +18 -27
  6. package/dist/commonjs/components/AnalyticsEventCard.js +9 -12
  7. package/dist/commonjs/components/AnalyticsGraph.js +10 -15
  8. package/dist/commonjs/components/AppHeaderLogo.js +0 -3
  9. package/dist/commonjs/components/BrandCircleIcon.js +15 -15
  10. package/dist/commonjs/components/BrandSquareIcon.js +20 -20
  11. package/dist/commonjs/components/CodeSnippet.js +6 -19
  12. package/dist/commonjs/components/ConsoleLogCard.js +0 -1
  13. package/dist/commonjs/components/CopyButton.js +0 -4
  14. package/dist/commonjs/components/DiffViewer.js +0 -2
  15. package/dist/commonjs/components/DomainHeader.js +0 -4
  16. package/dist/commonjs/components/EmptyState.js +0 -3
  17. package/dist/commonjs/components/ErrorBoundary.js +5 -10
  18. package/dist/commonjs/components/HeadersSection.js +0 -5
  19. package/dist/commonjs/components/HighlightText.js +1 -4
  20. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +11 -26
  21. package/dist/commonjs/components/Inspector/AnalyticsTab.js +34 -40
  22. package/dist/commonjs/components/Inspector/BundleTab.js +56 -84
  23. package/dist/commonjs/components/Inspector/ConsoleTab.js +7 -7
  24. package/dist/commonjs/components/Inspector/CrashDetail.js +18 -20
  25. package/dist/commonjs/components/Inspector/CrashFilterModal.js +0 -1
  26. package/dist/commonjs/components/Inspector/CrashTab.js +11 -20
  27. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +12 -24
  28. package/dist/commonjs/components/Inspector/FabLauncher.js +1 -1
  29. package/dist/commonjs/components/Inspector/InspectorContext.js +0 -2
  30. package/dist/commonjs/components/Inspector/InspectorHeader.js +7 -8
  31. package/dist/commonjs/components/Inspector/LogDetail.js +27 -29
  32. package/dist/commonjs/components/Inspector/MainScreen.js +9 -10
  33. package/dist/commonjs/components/Inspector/NetworkDetail.js +10 -11
  34. package/dist/commonjs/components/Inspector/NetworkTab.js +14 -14
  35. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +6 -9
  36. package/dist/commonjs/components/Inspector/PerformanceTab.js +30 -43
  37. package/dist/commonjs/components/Inspector/ReduxDetail.js +18 -34
  38. package/dist/commonjs/components/Inspector/ReduxTab.js +11 -20
  39. package/dist/commonjs/components/Inspector/SettingsPanel.js +32 -36
  40. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +6 -6
  41. package/dist/commonjs/components/Inspector/StorageTab.js +14 -26
  42. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +5 -6
  43. package/dist/commonjs/components/JsonViewer.js +3 -10
  44. package/dist/commonjs/components/LogCard.js +7 -7
  45. package/dist/commonjs/components/MetaAccordion.js +1 -7
  46. package/dist/commonjs/components/NetworkIcons.js +12 -16
  47. package/dist/commonjs/components/SectionHeader.js +0 -4
  48. package/dist/commonjs/components/SkeletonPlaceholder.js +6 -6
  49. package/dist/commonjs/components/Slider.js +6 -6
  50. package/dist/commonjs/components/SourcePageCard.js +0 -4
  51. package/dist/commonjs/components/TreeNode.js +0 -4
  52. package/dist/commonjs/console.d.ts +0 -4
  53. package/dist/commonjs/console.js +0 -4
  54. package/dist/commonjs/constants/index.js +6 -9
  55. package/dist/commonjs/constants/telemetryConfig.d.ts +7 -0
  56. package/dist/commonjs/constants/telemetryConfig.js +10 -0
  57. package/dist/commonjs/constants/version.d.ts +1 -1
  58. package/dist/commonjs/constants/version.js +1 -3
  59. package/dist/commonjs/crash.d.ts +0 -4
  60. package/dist/commonjs/crash.js +0 -4
  61. package/dist/commonjs/customHooks/analyticsLogger.d.ts +0 -7
  62. package/dist/commonjs/customHooks/analyticsLogger.js +3 -59
  63. package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +0 -9
  64. package/dist/commonjs/customHooks/bundleAnalyzer.js +3 -86
  65. package/dist/commonjs/customHooks/consoleLogger.js +0 -16
  66. package/dist/commonjs/customHooks/crashHandler.d.ts +0 -28
  67. package/dist/commonjs/customHooks/crashHandler.js +0 -55
  68. package/dist/commonjs/customHooks/logFilters.d.ts +0 -4
  69. package/dist/commonjs/customHooks/logFilters.js +0 -11
  70. package/dist/commonjs/customHooks/networkLogger.js +2 -13
  71. package/dist/commonjs/customHooks/performanceTracker.d.ts +0 -27
  72. package/dist/commonjs/customHooks/performanceTracker.js +0 -31
  73. package/dist/commonjs/customHooks/reduxLogger.d.ts +0 -12
  74. package/dist/commonjs/customHooks/reduxLogger.js +0 -51
  75. package/dist/commonjs/customHooks/storageInspector.d.ts +0 -40
  76. package/dist/commonjs/customHooks/storageInspector.js +1 -56
  77. package/dist/commonjs/decorators/index.d.ts +0 -37
  78. package/dist/commonjs/decorators/index.js +0 -42
  79. package/dist/commonjs/helpers/gaAnalyticsRegistry.d.ts +0 -10
  80. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +0 -26
  81. package/dist/commonjs/helpers/index.d.ts +0 -7
  82. package/dist/commonjs/helpers/index.js +1 -42
  83. package/dist/commonjs/helpers/memoryManager.d.ts +0 -11
  84. package/dist/commonjs/helpers/memoryManager.js +0 -13
  85. package/dist/commonjs/helpers/searchQueryParser.d.ts +0 -4
  86. package/dist/commonjs/helpers/searchQueryParser.js +0 -18
  87. package/dist/commonjs/helpers/settingsStore.js +0 -8
  88. package/dist/commonjs/helpers/telemetry.d.ts +2 -0
  89. package/dist/commonjs/helpers/telemetry.js +302 -0
  90. package/dist/commonjs/i18n/index.d.ts +0 -9
  91. package/dist/commonjs/i18n/index.js +0 -15
  92. package/dist/commonjs/index.js +15 -97
  93. package/dist/commonjs/native/NativeInspector.d.ts +0 -54
  94. package/dist/commonjs/native/NativeInspector.js +0 -56
  95. package/dist/commonjs/network.d.ts +0 -4
  96. package/dist/commonjs/network.js +0 -4
  97. package/dist/commonjs/performance.d.ts +0 -4
  98. package/dist/commonjs/performance.js +0 -4
  99. package/dist/commonjs/redux.d.ts +0 -4
  100. package/dist/commonjs/redux.js +0 -4
  101. package/dist/commonjs/storage.d.ts +0 -4
  102. package/dist/commonjs/storage.js +0 -4
  103. package/dist/commonjs/styles/AppColors.d.ts +0 -3
  104. package/dist/commonjs/styles/AppColors.js +15 -30
  105. package/dist/commonjs/styles/AppFonts.d.ts +0 -4
  106. package/dist/commonjs/styles/AppFonts.js +0 -4
  107. package/dist/commonjs/styles/common.js +0 -11
  108. package/dist/commonjs/styles/index.js +0 -8
  109. package/dist/commonjs/types/enums.js +0 -3
  110. package/dist/commonjs/types/interfaces.d.ts +3 -3
  111. package/dist/esm/analytics.d.ts +0 -4
  112. package/dist/esm/analytics.js +0 -4
  113. package/dist/esm/bundle.d.ts +0 -4
  114. package/dist/esm/bundle.js +0 -4
  115. package/dist/esm/components/AnalyticsDetail.js +18 -27
  116. package/dist/esm/components/AnalyticsEventCard.js +9 -12
  117. package/dist/esm/components/AnalyticsGraph.js +10 -15
  118. package/dist/esm/components/AppHeaderLogo.js +0 -3
  119. package/dist/esm/components/BrandCircleIcon.js +15 -15
  120. package/dist/esm/components/BrandSquareIcon.js +20 -20
  121. package/dist/esm/components/CodeSnippet.js +6 -19
  122. package/dist/esm/components/ConsoleLogCard.js +0 -1
  123. package/dist/esm/components/CopyButton.js +0 -4
  124. package/dist/esm/components/DiffViewer.js +0 -2
  125. package/dist/esm/components/DomainHeader.js +0 -4
  126. package/dist/esm/components/EmptyState.js +0 -3
  127. package/dist/esm/components/ErrorBoundary.js +5 -10
  128. package/dist/esm/components/HeadersSection.js +0 -5
  129. package/dist/esm/components/HighlightText.js +1 -4
  130. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +11 -26
  131. package/dist/esm/components/Inspector/AnalyticsTab.js +34 -40
  132. package/dist/esm/components/Inspector/BundleTab.js +56 -84
  133. package/dist/esm/components/Inspector/ConsoleTab.js +7 -7
  134. package/dist/esm/components/Inspector/CrashDetail.js +18 -20
  135. package/dist/esm/components/Inspector/CrashFilterModal.js +0 -1
  136. package/dist/esm/components/Inspector/CrashTab.js +11 -20
  137. package/dist/esm/components/Inspector/DeviceInfoTab.js +12 -24
  138. package/dist/esm/components/Inspector/FabLauncher.js +1 -1
  139. package/dist/esm/components/Inspector/InspectorContext.js +0 -2
  140. package/dist/esm/components/Inspector/InspectorHeader.js +7 -8
  141. package/dist/esm/components/Inspector/LogDetail.js +27 -29
  142. package/dist/esm/components/Inspector/MainScreen.js +9 -10
  143. package/dist/esm/components/Inspector/NetworkDetail.js +10 -11
  144. package/dist/esm/components/Inspector/NetworkTab.js +14 -14
  145. package/dist/esm/components/Inspector/NpmUpdateToast.js +6 -9
  146. package/dist/esm/components/Inspector/PerformanceTab.js +30 -43
  147. package/dist/esm/components/Inspector/ReduxDetail.js +18 -34
  148. package/dist/esm/components/Inspector/ReduxTab.js +11 -20
  149. package/dist/esm/components/Inspector/SettingsPanel.js +32 -36
  150. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +6 -6
  151. package/dist/esm/components/Inspector/StorageTab.js +14 -26
  152. package/dist/esm/components/Inspector/UpdateAvailableModal.js +5 -6
  153. package/dist/esm/components/JsonViewer.js +3 -10
  154. package/dist/esm/components/LogCard.js +7 -7
  155. package/dist/esm/components/MetaAccordion.js +1 -7
  156. package/dist/esm/components/NetworkIcons.js +12 -16
  157. package/dist/esm/components/SectionHeader.js +0 -4
  158. package/dist/esm/components/SkeletonPlaceholder.js +6 -6
  159. package/dist/esm/components/Slider.js +6 -6
  160. package/dist/esm/components/SourcePageCard.js +0 -4
  161. package/dist/esm/components/TreeNode.js +0 -4
  162. package/dist/esm/console.d.ts +0 -4
  163. package/dist/esm/console.js +0 -4
  164. package/dist/esm/constants/index.js +6 -9
  165. package/dist/esm/constants/telemetryConfig.d.ts +7 -0
  166. package/dist/esm/constants/telemetryConfig.js +7 -0
  167. package/dist/esm/constants/version.d.ts +1 -1
  168. package/dist/esm/constants/version.js +1 -3
  169. package/dist/esm/crash.d.ts +0 -4
  170. package/dist/esm/crash.js +0 -4
  171. package/dist/esm/customHooks/analyticsLogger.d.ts +0 -7
  172. package/dist/esm/customHooks/analyticsLogger.js +3 -59
  173. package/dist/esm/customHooks/bundleAnalyzer.d.ts +0 -9
  174. package/dist/esm/customHooks/bundleAnalyzer.js +3 -86
  175. package/dist/esm/customHooks/consoleLogger.js +0 -16
  176. package/dist/esm/customHooks/crashHandler.d.ts +0 -28
  177. package/dist/esm/customHooks/crashHandler.js +0 -55
  178. package/dist/esm/customHooks/logFilters.d.ts +0 -4
  179. package/dist/esm/customHooks/logFilters.js +0 -11
  180. package/dist/esm/customHooks/networkLogger.js +2 -13
  181. package/dist/esm/customHooks/performanceTracker.d.ts +0 -27
  182. package/dist/esm/customHooks/performanceTracker.js +0 -31
  183. package/dist/esm/customHooks/reduxLogger.d.ts +0 -12
  184. package/dist/esm/customHooks/reduxLogger.js +0 -51
  185. package/dist/esm/customHooks/storageInspector.d.ts +0 -40
  186. package/dist/esm/customHooks/storageInspector.js +1 -56
  187. package/dist/esm/decorators/index.d.ts +0 -37
  188. package/dist/esm/decorators/index.js +0 -42
  189. package/dist/esm/helpers/gaAnalyticsRegistry.d.ts +0 -10
  190. package/dist/esm/helpers/gaAnalyticsRegistry.js +0 -26
  191. package/dist/esm/helpers/index.d.ts +0 -7
  192. package/dist/esm/helpers/index.js +1 -42
  193. package/dist/esm/helpers/memoryManager.d.ts +0 -11
  194. package/dist/esm/helpers/memoryManager.js +0 -13
  195. package/dist/esm/helpers/searchQueryParser.d.ts +0 -4
  196. package/dist/esm/helpers/searchQueryParser.js +0 -18
  197. package/dist/esm/helpers/settingsStore.js +0 -8
  198. package/dist/esm/helpers/telemetry.d.ts +2 -0
  199. package/dist/esm/helpers/telemetry.js +298 -0
  200. package/dist/esm/i18n/index.d.ts +0 -9
  201. package/dist/esm/i18n/index.js +0 -15
  202. package/dist/esm/index.js +15 -97
  203. package/dist/esm/native/NativeInspector.d.ts +0 -54
  204. package/dist/esm/native/NativeInspector.js +0 -56
  205. package/dist/esm/network.d.ts +0 -4
  206. package/dist/esm/network.js +0 -4
  207. package/dist/esm/performance.d.ts +0 -4
  208. package/dist/esm/performance.js +0 -4
  209. package/dist/esm/redux.d.ts +0 -4
  210. package/dist/esm/redux.js +0 -4
  211. package/dist/esm/storage.d.ts +0 -4
  212. package/dist/esm/storage.js +0 -4
  213. package/dist/esm/styles/AppColors.d.ts +0 -3
  214. package/dist/esm/styles/AppColors.js +15 -30
  215. package/dist/esm/styles/AppFonts.d.ts +0 -4
  216. package/dist/esm/styles/AppFonts.js +0 -4
  217. package/dist/esm/styles/common.js +0 -11
  218. package/dist/esm/styles/index.js +0 -8
  219. package/dist/esm/types/enums.js +0 -3
  220. package/dist/esm/types/interfaces.d.ts +3 -3
  221. package/package.json +2 -2
  222. package/src/constants/telemetryConfig.ts +16 -0
  223. package/src/constants/version.ts +1 -1
  224. package/src/helpers/telemetry.ts +341 -0
  225. package/src/index.tsx +15 -1
  226. package/src/types/interfaces.ts +3 -0
@@ -1,16 +1,3 @@
1
- // #8 — Redux inspector module.
2
- //
3
- // Two integration paths, both feeding the same timeline/state snapshot:
4
- //
5
- // 1. `inspectorReduxMiddleware` (recommended) — a standard Redux middleware.
6
- // Because it sits inside the middleware chain it sees EVERY action,
7
- // including ones dispatched from thunks, sagas, listeners and RTK Query.
8
- //
9
- // 2. `connectReduxStore(store)` — zero-config fallback. It wraps the outer
10
- // `store.dispatch` AND diffs state on `store.subscribe`, so even actions
11
- // that bypass the wrapped dispatch (thunk/saga internals capture the raw
12
- // dispatch reference at store-creation time) still update the state tree
13
- // and per-reducer "last action" consistently.
14
1
  import { parseStackLine } from '../helpers';
15
2
  let currentReduxState = null;
16
3
  const listeners = new Set();
@@ -41,9 +28,6 @@ export const pruneReduxHistory = (targetCount) => {
41
28
  }
42
29
  return Math.max(0, pruned);
43
30
  };
44
- // Guards against double-instrumentation (e.g. connectReduxStore called twice,
45
- // or middleware + connect used together) which previously produced duplicate
46
- // timeline entries and inconsistent counts.
47
31
  const connectedStores = new WeakSet();
48
32
  let middlewareAttached = false;
49
33
  export const isReduxConnected = () => middlewareAttached || currentReduxState != null || actionHistory.length > 0;
@@ -89,7 +73,6 @@ function actionTypeOf(action) {
89
73
  function detectActionOrigin(stack, actionType, actionObj) {
90
74
  const stackLower = (stack || '').toLowerCase();
91
75
  const typeLower = (actionType || '').toLowerCase();
92
- // Explicit hint on action if developer tagged it
93
76
  if (actionObj && actionObj.__origin) {
94
77
  const raw = String(actionObj.__origin).toLowerCase();
95
78
  if (raw.includes('saga'))
@@ -99,7 +82,6 @@ function detectActionOrigin(stack, actionType, actionObj) {
99
82
  if (raw.includes('ui'))
100
83
  return { originType: 'ui' };
101
84
  }
102
- // 1. Saga Detection (Stack + Action naming conventions)
103
85
  const isSaga = stackLower.includes('redux-saga') ||
104
86
  stackLower.includes('runputeffect') ||
105
87
  stackLower.includes('proc.js') ||
@@ -111,7 +93,6 @@ function detectActionOrigin(stack, actionType, actionObj) {
111
93
  typeLower.includes('saga') ||
112
94
  typeLower.startsWith('saga/') ||
113
95
  typeLower.startsWith('@saga/');
114
- // 2. Thunk / RTK Query Detection
115
96
  const isThunk = stackLower.includes('createasyncthunk') ||
116
97
  stackLower.includes('redux-thunk') ||
117
98
  stackLower.includes('rtk-query') ||
@@ -121,12 +102,10 @@ function detectActionOrigin(stack, actionType, actionObj) {
121
102
  typeLower.endsWith('/pending') ||
122
103
  typeLower.endsWith('/fulfilled') ||
123
104
  typeLower.endsWith('/rejected');
124
- // 3. Parse Stack Frames to find best application caller
125
105
  const lines = (stack || '').split('\n').map(l => l.trim()).filter(Boolean);
126
106
  let bestFrame = null;
127
107
  for (let i = 0; i < lines.length; i++) {
128
108
  const line = lines[i];
129
- // Ignore logger / middleware lines inside inspector
130
109
  if (line.includes('reduxLogger') ||
131
110
  line.includes('inspectorReduxMiddleware') ||
132
111
  line.includes('recordAction') ||
@@ -177,7 +156,6 @@ function extractSliceName(actionType, affectedSlices) {
177
156
  if (affectedSlices && affectedSlices.length > 0) {
178
157
  return affectedSlices[0];
179
158
  }
180
- // If Redux Toolkit action format: e.g. "users/fetchById" -> "users"
181
159
  const match = actionType.match(/^([a-zA-Z0-9_\-]+)\//);
182
160
  if (match && match[1] && !match[1].startsWith('@@')) {
183
161
  return match[1];
@@ -242,27 +220,11 @@ function recordAction(action, prevState, nextState, rawStack) {
242
220
  if (globalReduxAutoRefresh) {
243
221
  currentReduxState = nextState;
244
222
  }
245
- // Timeline / last-action map always changed — notify even when the state
246
- // tree snapshot is paused so those panels stay live.
247
223
  notify();
248
224
  }
249
- /**
250
- * Standard Redux middleware — add it to your store to capture every action,
251
- * including those dispatched from thunks, sagas and RTK Query:
252
- *
253
- * const store = configureStore({
254
- * reducer,
255
- * middleware: gDM => gDM().concat(inspectorReduxMiddleware),
256
- * });
257
- *
258
- * Pair with `connectReduxStore(store)` (safe — they de-duplicate) or rely on
259
- * the middleware alone; the initial snapshot is taken on the first action.
260
- */
261
225
  export const inspectorReduxMiddleware = (storeApi) => (next) => (action) => {
262
226
  middlewareAttached = true;
263
227
  const capturedStack = new Error().stack || '';
264
- // Thunks are functions — let them run; their inner plain-action dispatches
265
- // pass back through this same middleware, so nothing is lost.
266
228
  if (typeof action === 'function') {
267
229
  return next(action);
268
230
  }
@@ -281,22 +243,15 @@ export const connectReduxStore = (store) => {
281
243
  console.warn('[NetworkInspector] Invalid Redux store passed to connectReduxStore.');
282
244
  return;
283
245
  }
284
- // Idempotent — connecting the same store twice must not double-wrap
285
- // dispatch or double-record the timeline.
286
246
  if (connectedStores.has(store)) {
287
247
  return;
288
248
  }
289
249
  connectedStores.add(store);
290
- // Wrap the outer dispatch so directly dispatched actions get full
291
- // type/payload attribution. Skipped when the middleware is already
292
- // attached, otherwise every direct dispatch would be recorded twice.
293
250
  const originalDispatch = store.dispatch.bind(store);
294
251
  let inWrappedDispatch = false;
295
252
  store.dispatch = (action) => {
296
253
  const capturedStack = new Error().stack || '';
297
254
  if (middlewareAttached || typeof action === 'function') {
298
- // Middleware handles recording, or it's a thunk whose inner dispatches
299
- // will be picked up individually.
300
255
  inWrappedDispatch = true;
301
256
  try {
302
257
  return originalDispatch(action);
@@ -318,9 +273,6 @@ export const connectReduxStore = (store) => {
318
273
  return result;
319
274
  };
320
275
  setReduxState(store.getState());
321
- // Subscribe-diff fallback: catches state changes whose dispatch bypassed
322
- // the wrapper above (thunk/saga internals hold the raw dispatch reference).
323
- // Without this, the tree and per-reducer last-action drifted out of sync.
324
276
  let lastSeenState = store.getState();
325
277
  store.subscribe(() => {
326
278
  const nextState = store.getState();
@@ -329,15 +281,12 @@ export const connectReduxStore = (store) => {
329
281
  const prevState = lastSeenState;
330
282
  lastSeenState = nextState;
331
283
  if (inWrappedDispatch || middlewareAttached) {
332
- // Already recorded with proper attribution; just refresh the snapshot.
333
284
  if (globalReduxAutoRefresh) {
334
285
  currentReduxState = nextState;
335
286
  notify();
336
287
  }
337
288
  return;
338
289
  }
339
- // Change arrived outside the wrapped dispatch — record it so the
340
- // timeline stays consistent, even without the original action type.
341
290
  const subStack = new Error().stack || '';
342
291
  recordAction({ type: '@@inspector/EXTERNAL_STATE_CHANGE' }, prevState, nextState, subStack);
343
292
  });
@@ -6,62 +6,22 @@ export interface StorageEntry {
6
6
  byteSize: number;
7
7
  }
8
8
  export type StorageDriver = 'asyncStorage' | 'mmkv';
9
- /**
10
- * Register an AsyncStorage instance with the inspector (optional override).
11
- */
12
9
  export declare const connectAsyncStorage: (storageInstance: any) => void;
13
- /**
14
- * Register an MMKV instance with the inspector (optional override).
15
- */
16
10
  export declare const connectMMKV: (mmkvInstance: any, id?: string) => void;
17
- /**
18
- * Auto-detect AsyncStorage:
19
- * 1. Explicit connection
20
- * 2. Global instance
21
- * 3. Dynamic require '@react-native-async-storage/async-storage'
22
- * 4. Native Bridge Direct interface
23
- */
24
11
  export declare const getResolvedAsyncStorage: () => any;
25
- /**
26
- * Auto-detect MMKV:
27
- * 1. Explicit connection
28
- * 2. Dynamic require 'react-native-mmkv' & instantiate default instance
29
- * 3. Global MMKV / JSI instances
30
- */
31
12
  export declare const getResolvedMMKV: (id?: string) => any;
32
13
  export declare const isAsyncStorageConnected: () => boolean;
33
14
  export declare const isMMKVConnected: () => boolean;
34
15
  export declare const getRegisteredMMKVInstanceIds: () => string[];
35
- /**
36
- * Calculate approximate byte size of a UTF-8 string
37
- */
38
16
  export declare const calculateByteSize: (str: string) => number;
39
- /**
40
- * Determine type and format value safely without blocking JS thread
41
- */
42
17
  export declare const analyzeStorageValue: (rawVal: any) => {
43
18
  strVal: string;
44
19
  parsedValue?: any;
45
20
  type: "json" | "string" | "number" | "boolean" | "null";
46
21
  byteSize: number;
47
22
  };
48
- /**
49
- * Fetch all storage entries for given driver
50
- */
51
23
  export declare const fetchStorageEntries: (driver: StorageDriver, instanceId?: string) => Promise<StorageEntry[]>;
52
- /**
53
- * Create or Update a key-value entry (CRUD: Create / Update)
54
- */
55
24
  export declare const setStorageEntry: (driver: StorageDriver, key: string, value: string, instanceId?: string) => Promise<boolean>;
56
- /**
57
- * Delete a single key (CRUD: Delete)
58
- */
59
25
  export declare const removeStorageEntry: (driver: StorageDriver, key: string, instanceId?: string) => Promise<boolean>;
60
- /**
61
- * Wipe all keys for given storage (CRUD: Clear All)
62
- */
63
26
  export declare const clearStorageDriver: (driver: StorageDriver, instanceId?: string) => Promise<boolean>;
64
- /**
65
- * Subscribe to storage mutations
66
- */
67
27
  export declare const subscribeToStorageChanges: (listener: () => void) => (() => void);
@@ -1,10 +1,6 @@
1
- // Universal In-App Storage Inspector Adapter for AsyncStorage & MMKV
2
- // Supports automatic module resolution, NativeModules SQLite fallback, custom instances, and full CRUD operations.
3
1
  import { NativeModules } from 'react-native';
4
- // In-memory registered storage references
5
2
  let customAsyncStorage = null;
6
3
  const customMMKVInstances = new Map();
7
- // Listeners for storage mutations
8
4
  const changeListeners = new Set();
9
5
  const notifyChange = () => {
10
6
  changeListeners.forEach(listener => {
@@ -14,28 +10,18 @@ const notifyChange = () => {
14
10
  catch { }
15
11
  });
16
12
  };
17
- /**
18
- * Register an AsyncStorage instance with the inspector (optional override).
19
- */
20
13
  export const connectAsyncStorage = (storageInstance) => {
21
14
  if (storageInstance) {
22
15
  customAsyncStorage = storageInstance;
23
16
  notifyChange();
24
17
  }
25
18
  };
26
- /**
27
- * Register an MMKV instance with the inspector (optional override).
28
- */
29
19
  export const connectMMKV = (mmkvInstance, id = 'default') => {
30
20
  if (mmkvInstance) {
31
21
  customMMKVInstances.set(id, mmkvInstance);
32
22
  notifyChange();
33
23
  }
34
24
  };
35
- /**
36
- * Native Bridge Fallback for AsyncStorage:
37
- * Directly interfaces with NativeModules.RNCAsyncStorage without needing JS package imports.
38
- */
39
25
  const getNativeAsyncStorageBridge = () => {
40
26
  const nativeModule = NativeModules.RNCAsyncStorage ||
41
27
  NativeModules.RNC_AsyncSQLiteDBStorage ||
@@ -130,17 +116,9 @@ const getNativeAsyncStorageBridge = () => {
130
116
  }
131
117
  return null;
132
118
  };
133
- /**
134
- * Auto-detect AsyncStorage:
135
- * 1. Explicit connection
136
- * 2. Global instance
137
- * 3. Dynamic require '@react-native-async-storage/async-storage'
138
- * 4. Native Bridge Direct interface
139
- */
140
119
  export const getResolvedAsyncStorage = () => {
141
120
  if (customAsyncStorage)
142
121
  return customAsyncStorage;
143
- // 1. Global instances
144
122
  try {
145
123
  const maybeReq = globalThis?.__inAppAsyncStorage ||
146
124
  globalThis?.AsyncStorage ||
@@ -150,7 +128,6 @@ export const getResolvedAsyncStorage = () => {
150
128
  }
151
129
  }
152
130
  catch { }
153
- // 2. Dynamic runtime require
154
131
  try {
155
132
  const req = typeof globalThis?.require === 'function'
156
133
  ? globalThis.require
@@ -177,24 +154,16 @@ export const getResolvedAsyncStorage = () => {
177
154
  }
178
155
  }
179
156
  catch { }
180
- // 3. Native Bridge Fallback (Direct SQLite)
181
157
  const nativeBridge = getNativeAsyncStorageBridge();
182
158
  if (nativeBridge) {
183
159
  return nativeBridge;
184
160
  }
185
161
  return null;
186
162
  };
187
- /**
188
- * Auto-detect MMKV:
189
- * 1. Explicit connection
190
- * 2. Dynamic require 'react-native-mmkv' & instantiate default instance
191
- * 3. Global MMKV / JSI instances
192
- */
193
163
  export const getResolvedMMKV = (id = 'default') => {
194
164
  if (customMMKVInstances.has(id)) {
195
165
  return customMMKVInstances.get(id);
196
166
  }
197
- // 1. Dynamic require
198
167
  try {
199
168
  const req = typeof globalThis?.require === 'function'
200
169
  ? globalThis.require
@@ -216,7 +185,6 @@ export const getResolvedMMKV = (id = 'default') => {
216
185
  }
217
186
  }
218
187
  catch { }
219
- // 2. Global references
220
188
  try {
221
189
  const globalMMKV = globalThis?.mmkv ||
222
190
  global?.mmkv ||
@@ -243,20 +211,14 @@ export const isMMKVConnected = () => {
243
211
  return Boolean(getResolvedMMKV());
244
212
  };
245
213
  export const getRegisteredMMKVInstanceIds = () => {
246
- getResolvedMMKV(); // trigger auto-discovery
214
+ getResolvedMMKV();
247
215
  return Array.from(customMMKVInstances.keys());
248
216
  };
249
- /**
250
- * Calculate approximate byte size of a UTF-8 string
251
- */
252
217
  export const calculateByteSize = (str) => {
253
218
  if (!str)
254
219
  return 0;
255
220
  return str.length * 2;
256
221
  };
257
- /**
258
- * Determine type and format value safely without blocking JS thread
259
- */
260
222
  export const analyzeStorageValue = (rawVal) => {
261
223
  if (rawVal === null || rawVal === undefined) {
262
224
  return { strVal: 'null', type: 'null', byteSize: 4 };
@@ -272,7 +234,6 @@ export const analyzeStorageValue = (rawVal) => {
272
234
  const trimmed = strVal.trim();
273
235
  if ((trimmed.startsWith('{') && trimmed.endsWith('}')) ||
274
236
  (trimmed.startsWith('[') && trimmed.endsWith(']'))) {
275
- // For small/medium JSON, parse eagerly; for huge payloads (>10KB), parse lazily on expand
276
237
  if (trimmed.length < 10000) {
277
238
  try {
278
239
  const parsed = JSON.parse(trimmed);
@@ -290,9 +251,6 @@ export const analyzeStorageValue = (rawVal) => {
290
251
  }
291
252
  return { strVal, type: 'string', byteSize };
292
253
  };
293
- /**
294
- * Fetch all storage entries for given driver
295
- */
296
254
  export const fetchStorageEntries = async (driver, instanceId) => {
297
255
  const entries = [];
298
256
  if (driver === 'asyncStorage') {
@@ -375,13 +333,9 @@ export const fetchStorageEntries = async (driver, instanceId) => {
375
333
  console.warn('[StorageInspector] Error reading MMKV keys:', err);
376
334
  }
377
335
  }
378
- // Sort alphabetically by key
379
336
  entries.sort((a, b) => a.key.localeCompare(b.key));
380
337
  return entries;
381
338
  };
382
- /**
383
- * Create or Update a key-value entry (CRUD: Create / Update)
384
- */
385
339
  export const setStorageEntry = async (driver, key, value, instanceId) => {
386
340
  if (!key.trim())
387
341
  return false;
@@ -408,9 +362,6 @@ export const setStorageEntry = async (driver, key, value, instanceId) => {
408
362
  }
409
363
  return false;
410
364
  };
411
- /**
412
- * Delete a single key (CRUD: Delete)
413
- */
414
365
  export const removeStorageEntry = async (driver, key, instanceId) => {
415
366
  try {
416
367
  if (driver === 'asyncStorage') {
@@ -435,9 +386,6 @@ export const removeStorageEntry = async (driver, key, instanceId) => {
435
386
  }
436
387
  return false;
437
388
  };
438
- /**
439
- * Wipe all keys for given storage (CRUD: Clear All)
440
- */
441
389
  export const clearStorageDriver = async (driver, instanceId) => {
442
390
  try {
443
391
  if (driver === 'asyncStorage') {
@@ -462,9 +410,6 @@ export const clearStorageDriver = async (driver, instanceId) => {
462
410
  }
463
411
  return false;
464
412
  };
465
- /**
466
- * Subscribe to storage mutations
467
- */
468
413
  export const subscribeToStorageChanges = (listener) => {
469
414
  changeListeners.add(listener);
470
415
  return () => {
@@ -4,45 +4,8 @@ export interface InspectLogOptions {
4
4
  logResult?: boolean;
5
5
  logDuration?: boolean;
6
6
  }
7
- /**
8
- * `@InspectLog`: Automatically logs method execution, arguments, duration, and return values
9
- * to the In-App Inspector Console.
10
- *
11
- * @example
12
- * ```ts
13
- * class UserService {
14
- * @InspectLog({ tag: 'API', logArgs: true, logDuration: true })
15
- * async fetchUser(id: string) {
16
- * return api.get(`/users/${id}`);
17
- * }
18
- * }
19
- * ```
20
- */
21
7
  export declare function InspectLog(options?: InspectLogOptions): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
22
- /**
23
- * `@InspectTrackTime`: Measures and logs execution duration for critical functions.
24
- *
25
- * @example
26
- * ```ts
27
- * class FeedManager {
28
- * @InspectTrackTime('Feed Data Processing')
29
- * processFeedItems(items: FeedItem[]) { ... }
30
- * }
31
- * ```
32
- */
33
8
  export declare function InspectTrackTime(label?: string): (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
34
- /**
35
- * `@InspectCatch`: Safely catches unhandled exceptions thrown inside the method,
36
- * logs them to the In-App Inspector, and returns a fallback value.
37
- *
38
- * @example
39
- * ```ts
40
- * class AuthService {
41
- * @InspectCatch({ fallback: null, tag: 'AUTH' })
42
- * async getCachedToken() { ... }
43
- * }
44
- * ```
45
- */
46
9
  export declare function InspectCatch(options?: {
47
10
  fallback?: any;
48
11
  tag?: string;
@@ -1,22 +1,3 @@
1
- // ─── Method & Class Decorators for React Native In-App Inspector ─────────────
2
- //
3
- // Clean TypeScript decorators to seamlessly annotate methods, asynchronous actions,
4
- // and API services with automatic inspection, logging, timing, and error boundaries.
5
- // ─────────────────────────────────────────────────────────────────────────────
6
- /**
7
- * `@InspectLog`: Automatically logs method execution, arguments, duration, and return values
8
- * to the In-App Inspector Console.
9
- *
10
- * @example
11
- * ```ts
12
- * class UserService {
13
- * @InspectLog({ tag: 'API', logArgs: true, logDuration: true })
14
- * async fetchUser(id: string) {
15
- * return api.get(`/users/${id}`);
16
- * }
17
- * }
18
- * ```
19
- */
20
1
  export function InspectLog(options = {}) {
21
2
  const { tag = 'Inspect', logArgs = true, logResult = true, logDuration = true, } = options;
22
3
  return function (_target, propertyKey, descriptor) {
@@ -62,17 +43,6 @@ export function InspectLog(options = {}) {
62
43
  return descriptor;
63
44
  };
64
45
  }
65
- /**
66
- * `@InspectTrackTime`: Measures and logs execution duration for critical functions.
67
- *
68
- * @example
69
- * ```ts
70
- * class FeedManager {
71
- * @InspectTrackTime('Feed Data Processing')
72
- * processFeedItems(items: FeedItem[]) { ... }
73
- * }
74
- * ```
75
- */
76
46
  export function InspectTrackTime(label) {
77
47
  return function (_target, propertyKey, descriptor) {
78
48
  const originalMethod = descriptor.value;
@@ -100,18 +70,6 @@ export function InspectTrackTime(label) {
100
70
  return descriptor;
101
71
  };
102
72
  }
103
- /**
104
- * `@InspectCatch`: Safely catches unhandled exceptions thrown inside the method,
105
- * logs them to the In-App Inspector, and returns a fallback value.
106
- *
107
- * @example
108
- * ```ts
109
- * class AuthService {
110
- * @InspectCatch({ fallback: null, tag: 'AUTH' })
111
- * async getCachedToken() { ... }
112
- * }
113
- * ```
114
- */
115
73
  export function InspectCatch(options = {}) {
116
74
  const { fallback = undefined, tag = 'Catch' } = options;
117
75
  return function (_target, propertyKey, descriptor) {
@@ -4,15 +4,5 @@ export interface GAPlugin {
4
4
  name: string;
5
5
  resolveCategory?: (eventName: string, params?: Record<string, any>) => GAEventCategory | string | null | undefined;
6
6
  }
7
- /**
8
- * Register a dynamic Google Analytics / Firebase plugin or custom resolver.
9
- */
10
7
  export declare const registerGAPlugin: (plugin: GAPlugin) => void;
11
- /**
12
- * Dynamically resolves the GA4 event category using:
13
- * 1. Registered dynamic GA plugins
14
- * 2. Runtime Firebase Analytics inspection
15
- * 3. GA4 standard event taxonomies (O(1) Set lookup)
16
- * 4. Semantic pattern & prefix analysis
17
- */
18
8
  export declare const getEventCategory: (name: string, params?: Record<string, any>) => GAEventCategory;
@@ -1,11 +1,5 @@
1
- // ─── Google Analytics (GA4) & Firebase Analytics Dynamic Registry ─────────────
2
- //
3
- // Dynamically inspects GA4 / Firebase Analytics runtime schemas, auto-detects
4
- // standard GA4 event taxonomies, and supports dynamic GA plugins.
5
- // ─────────────────────────────────────────────────────────────────────────────
6
1
  import { GAEventCategory } from '../types/enums';
7
2
  export { GAEventCategory };
8
- // ─── Official GA4 & Firebase Standard Event Sets ─────────────────────────────
9
3
  const GA4_PAGE_VIEW_EVENTS = new Set([
10
4
  'screen_view',
11
5
  'page_view',
@@ -70,19 +64,12 @@ const GA4_SYSTEM_EVENTS = new Set([
70
64
  'ad_query',
71
65
  'ad_exposure',
72
66
  ]);
73
- // ─── Registered Dynamic Plugins ──────────────────────────────────────────────
74
67
  const registeredPlugins = [];
75
- /**
76
- * Register a dynamic Google Analytics / Firebase plugin or custom resolver.
77
- */
78
68
  export const registerGAPlugin = (plugin) => {
79
69
  if (!registeredPlugins.some(p => p.name === plugin.name)) {
80
70
  registeredPlugins.push(plugin);
81
71
  }
82
72
  };
83
- /**
84
- * Attempt dynamic inspection of host runtime Firebase / Google Analytics modules.
85
- */
86
73
  const tryInspectRuntimeFirebaseAnalytics = () => {
87
74
  try {
88
75
  const firebaseAnalytics = require('@react-native-firebase/analytics');
@@ -105,23 +92,13 @@ const tryInspectRuntimeFirebaseAnalytics = () => {
105
92
  }
106
93
  }
107
94
  catch {
108
- // Optional dependency - safe fallback to built-in GA4 taxonomy
109
95
  }
110
96
  };
111
- // Initialize dynamic runtime inspection once
112
97
  tryInspectRuntimeFirebaseAnalytics();
113
- /**
114
- * Dynamically resolves the GA4 event category using:
115
- * 1. Registered dynamic GA plugins
116
- * 2. Runtime Firebase Analytics inspection
117
- * 3. GA4 standard event taxonomies (O(1) Set lookup)
118
- * 4. Semantic pattern & prefix analysis
119
- */
120
98
  export const getEventCategory = (name, params) => {
121
99
  if (!name || typeof name !== 'string')
122
100
  return 'custom';
123
101
  const cleanName = name.trim().toLowerCase();
124
- // 1. Run through registered dynamic plugins
125
102
  for (const plugin of registeredPlugins) {
126
103
  if (plugin.resolveCategory) {
127
104
  const category = plugin.resolveCategory(cleanName, params);
@@ -129,7 +106,6 @@ export const getEventCategory = (name, params) => {
129
106
  return category;
130
107
  }
131
108
  }
132
- // 2. Exact GA4 taxonomy matching (O(1))
133
109
  if (GA4_PAGE_VIEW_EVENTS.has(cleanName)) {
134
110
  return 'page_view';
135
111
  }
@@ -139,7 +115,6 @@ export const getEventCategory = (name, params) => {
139
115
  if (GA4_SYSTEM_EVENTS.has(cleanName)) {
140
116
  return 'system';
141
117
  }
142
- // 3. Prefix & namespace detection
143
118
  if (cleanName.startsWith('firebase_') ||
144
119
  cleanName.startsWith('ga_') ||
145
120
  cleanName.startsWith('gtag_') ||
@@ -147,7 +122,6 @@ export const getEventCategory = (name, params) => {
147
122
  cleanName.startsWith('google_')) {
148
123
  return 'system';
149
124
  }
150
- // 4. Semantic pattern matching
151
125
  if (cleanName.endsWith('_view') ||
152
126
  cleanName.endsWith('_screen') ||
153
127
  cleanName.startsWith('screen_') ||
@@ -31,15 +31,10 @@ export declare const getAppVersionAndBuild: () => {
31
31
  formatted: string;
32
32
  };
33
33
  export declare const handleOpenExternalLink: (url: string) => void;
34
- /** Formats a timestamp as HH:MM:SS (no milliseconds). */
35
34
  export declare const formatTimeShort: (ts: number) => string;
36
- /** Formats a timestamp as HH:MM:SS.mmm (with milliseconds). */
37
35
  export declare const formatTime: (ts: number) => string;
38
- /** Formats a relative gap like "+2s" / "+1m 5s" / "+350ms". */
39
36
  export declare const formatGap: (ms: number) => string;
40
- /** Finds the first JSON object/array embedded anywhere in a log message. */
41
37
  export declare const getJsonContent: (message: string) => JsonContent | null;
42
- /** Pretty-prints JSON data showing 3-4 lines with trailing "..." */
43
38
  export declare const getJsonPreviewText: (data: any, maxLines?: number) => {
44
39
  text: string;
45
40
  hasMore: boolean;
@@ -59,9 +54,7 @@ export interface ParsedStackFrame {
59
54
  isOrigin?: boolean;
60
55
  copyableLocation: string;
61
56
  }
62
- /** Parses a stack trace line to extract function name, file name, extension (.tsx/.jsx/.ts), line, and column numbers */
63
57
  export declare const parseStackLine: (rawLine: string, isOrigin?: boolean) => ParsedStackFrame;
64
- /** Opens a file and line number directly in VS Code / system editor */
65
58
  export declare const openInVSCode: (filePath: string, lineNumber?: string | number, columnNumber?: string | number) => void;
66
59
  export declare const ANALYTICS_EVENT_PALETTE: string[];
67
60
  export declare const getEventColor: (name: string) => string;