react-native-inapp-inspector 1.1.13 → 1.1.15

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 (250) hide show
  1. package/README.md +9 -34
  2. package/dist/commonjs/assets/svgAssets.d.ts +3 -0
  3. package/dist/commonjs/assets/svgAssets.js +17 -0
  4. package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
  5. package/dist/commonjs/components/AnalyticsEventCard.js +120 -50
  6. package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
  7. package/dist/commonjs/components/AnalyticsGraph.js +8 -8
  8. package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
  9. package/dist/commonjs/components/AnalyticsTabView.js +157 -0
  10. package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
  11. package/dist/commonjs/components/AnimatedEntrance.js +2 -2
  12. package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
  13. package/dist/commonjs/components/ApiDetailView.js +304 -0
  14. package/dist/commonjs/components/ApisTabView.d.ts +33 -0
  15. package/dist/commonjs/components/ApisTabView.js +235 -0
  16. package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
  17. package/dist/commonjs/components/CodeSnippet.js +34 -34
  18. package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
  19. package/dist/commonjs/components/ConsoleLogCard.js +262 -442
  20. package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
  21. package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
  22. package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
  23. package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
  24. package/dist/commonjs/components/DiffViewer.js +4 -2
  25. package/dist/commonjs/components/DomainHeader.js +66 -41
  26. package/dist/commonjs/components/EmptyState.d.ts +2 -2
  27. package/dist/commonjs/components/EmptyState.js +2 -2
  28. package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
  29. package/dist/commonjs/components/EndOfListFooter.js +90 -0
  30. package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
  31. package/dist/commonjs/components/ErrorBoundary.js +28 -28
  32. package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
  33. package/dist/commonjs/components/FloatingBubble.js +75 -0
  34. package/dist/commonjs/components/HeadersSection.js +5 -3
  35. package/dist/commonjs/components/HighlightText.d.ts +1 -1
  36. package/dist/commonjs/components/HighlightText.js +5 -7
  37. package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
  38. package/dist/commonjs/components/Inspector/AnalyticsTab.js +232 -0
  39. package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
  40. package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
  41. package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
  42. package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
  43. package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
  44. package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
  45. package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
  46. package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
  47. package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
  48. package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
  49. package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
  50. package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
  51. package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
  52. package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
  53. package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
  54. package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
  55. package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
  56. package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
  57. package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
  58. package/dist/commonjs/components/Inspector/NetworkTab.js +281 -0
  59. package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
  60. package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
  61. package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
  62. package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
  63. package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
  64. package/dist/commonjs/components/Inspector/TabBar.js +95 -0
  65. package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
  66. package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
  67. package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
  68. package/dist/commonjs/components/InspectorHeader.js +329 -0
  69. package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
  70. package/dist/commonjs/components/InspectorTabBar.js +90 -0
  71. package/dist/commonjs/components/JsonViewer.d.ts +4 -1
  72. package/dist/commonjs/components/JsonViewer.js +110 -171
  73. package/dist/commonjs/components/LogCard.js +109 -86
  74. package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
  75. package/dist/commonjs/components/MetaAccordion.js +23 -21
  76. package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
  77. package/dist/commonjs/components/NavigationTracker.js +76 -0
  78. package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
  79. package/dist/commonjs/components/NetworkIcons.js +54 -8
  80. package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
  81. package/dist/commonjs/components/ReduxTabView.js +56 -0
  82. package/dist/commonjs/components/ReduxTreeView.js +241 -200
  83. package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
  84. package/dist/commonjs/components/SegmentedTabs.js +52 -0
  85. package/dist/commonjs/components/SettingsView.d.ts +13 -0
  86. package/dist/commonjs/components/SettingsView.js +328 -0
  87. package/dist/commonjs/components/TouchableScale.d.ts +2 -2
  88. package/dist/commonjs/components/TouchableScale.js +2 -2
  89. package/dist/commonjs/components/TreeNode.js +2 -2
  90. package/dist/commonjs/constants/index.js +1 -12
  91. package/dist/commonjs/constants/version.d.ts +1 -1
  92. package/dist/commonjs/constants/version.js +1 -1
  93. package/dist/commonjs/customHooks/analyticsLogger.d.ts +8 -0
  94. package/dist/commonjs/customHooks/analyticsLogger.js +42 -1
  95. package/dist/commonjs/customHooks/consoleLogger.js +137 -13
  96. package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
  97. package/dist/commonjs/customHooks/networkLogger.js +0 -1
  98. package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
  99. package/dist/commonjs/enums/index.d.ts +39 -0
  100. package/dist/commonjs/enums/index.js +50 -0
  101. package/dist/commonjs/helpers/index.d.ts +27 -1
  102. package/dist/commonjs/helpers/index.js +187 -12
  103. package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
  104. package/dist/commonjs/i18n/en.json +144 -0
  105. package/dist/commonjs/i18n/index.d.ts +2 -0
  106. package/dist/commonjs/i18n/index.js +27 -0
  107. package/dist/commonjs/i18n/locales/en.json +314 -0
  108. package/dist/commonjs/index.d.ts +2 -3
  109. package/dist/commonjs/index.js +207 -4927
  110. package/dist/commonjs/styles/AppColors.d.ts +148 -0
  111. package/dist/commonjs/styles/AppColors.js +176 -0
  112. package/dist/commonjs/styles/common.d.ts +3 -0
  113. package/dist/commonjs/styles/common.js +201 -0
  114. package/dist/commonjs/styles/index.d.ts +219 -435
  115. package/dist/commonjs/styles/index.js +312 -488
  116. package/dist/commonjs/types/enums.d.ts +9 -0
  117. package/dist/commonjs/types/enums.js +4 -0
  118. package/dist/commonjs/types/index.d.ts +4 -111
  119. package/dist/commonjs/types/index.js +16 -0
  120. package/dist/commonjs/types/interfaces.d.ts +337 -0
  121. package/dist/commonjs/types/interfaces.js +2 -0
  122. package/dist/esm/assets/svgAssets.d.ts +3 -0
  123. package/dist/esm/assets/svgAssets.js +14 -0
  124. package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
  125. package/dist/esm/components/AnalyticsEventCard.js +118 -48
  126. package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
  127. package/dist/esm/components/AnalyticsGraph.js +8 -8
  128. package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
  129. package/dist/esm/components/AnalyticsTabView.js +151 -0
  130. package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
  131. package/dist/esm/components/AnimatedEntrance.js +2 -2
  132. package/dist/esm/components/ApiDetailView.d.ts +22 -0
  133. package/dist/esm/components/ApiDetailView.js +264 -0
  134. package/dist/esm/components/ApisTabView.d.ts +33 -0
  135. package/dist/esm/components/ApisTabView.js +196 -0
  136. package/dist/esm/components/CodeSnippet.d.ts +1 -5
  137. package/dist/esm/components/CodeSnippet.js +34 -34
  138. package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
  139. package/dist/esm/components/ConsoleLogCard.js +262 -409
  140. package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
  141. package/dist/esm/components/ConsoleLogDetailView.js +271 -0
  142. package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
  143. package/dist/esm/components/ConsoleLogsTabView.js +348 -0
  144. package/dist/esm/components/DiffViewer.js +4 -2
  145. package/dist/esm/components/DomainHeader.js +66 -41
  146. package/dist/esm/components/EmptyState.d.ts +2 -2
  147. package/dist/esm/components/EmptyState.js +2 -2
  148. package/dist/esm/components/EndOfListFooter.d.ts +8 -0
  149. package/dist/esm/components/EndOfListFooter.js +83 -0
  150. package/dist/esm/components/ErrorBoundary.d.ts +5 -14
  151. package/dist/esm/components/ErrorBoundary.js +29 -29
  152. package/dist/esm/components/FloatingBubble.d.ts +14 -0
  153. package/dist/esm/components/FloatingBubble.js +68 -0
  154. package/dist/esm/components/HeadersSection.js +5 -3
  155. package/dist/esm/components/HighlightText.d.ts +1 -1
  156. package/dist/esm/components/HighlightText.js +5 -7
  157. package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
  158. package/dist/esm/components/Inspector/AnalyticsTab.js +194 -0
  159. package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
  160. package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
  161. package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
  162. package/dist/esm/components/Inspector/FabLauncher.js +49 -0
  163. package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
  164. package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
  165. package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
  166. package/dist/esm/components/Inspector/InspectorContext.js +13 -0
  167. package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
  168. package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
  169. package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
  170. package/dist/esm/components/Inspector/LogDetail.js +925 -0
  171. package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
  172. package/dist/esm/components/Inspector/MainScreen.js +63 -0
  173. package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
  174. package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
  175. package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
  176. package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
  177. package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
  178. package/dist/esm/components/Inspector/NetworkTab.js +243 -0
  179. package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
  180. package/dist/esm/components/Inspector/ReduxTab.js +70 -0
  181. package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
  182. package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
  183. package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
  184. package/dist/esm/components/Inspector/TabBar.js +90 -0
  185. package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
  186. package/dist/esm/components/Inspector/WebViewTab.js +752 -0
  187. package/dist/esm/components/InspectorHeader.d.ts +19 -0
  188. package/dist/esm/components/InspectorHeader.js +323 -0
  189. package/dist/esm/components/InspectorTabBar.d.ts +16 -0
  190. package/dist/esm/components/InspectorTabBar.js +84 -0
  191. package/dist/esm/components/JsonViewer.d.ts +4 -1
  192. package/dist/esm/components/JsonViewer.js +111 -172
  193. package/dist/esm/components/LogCard.js +111 -88
  194. package/dist/esm/components/MetaAccordion.d.ts +1 -10
  195. package/dist/esm/components/MetaAccordion.js +23 -21
  196. package/dist/esm/components/NavigationTracker.d.ts +7 -0
  197. package/dist/esm/components/NavigationTracker.js +39 -0
  198. package/dist/esm/components/NetworkIcons.d.ts +6 -0
  199. package/dist/esm/components/NetworkIcons.js +46 -6
  200. package/dist/esm/components/ReduxTabView.d.ts +9 -0
  201. package/dist/esm/components/ReduxTabView.js +50 -0
  202. package/dist/esm/components/ReduxTreeView.js +243 -202
  203. package/dist/esm/components/SegmentedTabs.d.ts +15 -0
  204. package/dist/esm/components/SegmentedTabs.js +47 -0
  205. package/dist/esm/components/SettingsView.d.ts +13 -0
  206. package/dist/esm/components/SettingsView.js +321 -0
  207. package/dist/esm/components/TouchableScale.d.ts +2 -2
  208. package/dist/esm/components/TouchableScale.js +2 -2
  209. package/dist/esm/components/TreeNode.js +2 -2
  210. package/dist/esm/constants/index.js +1 -12
  211. package/dist/esm/constants/version.d.ts +1 -1
  212. package/dist/esm/constants/version.js +1 -1
  213. package/dist/esm/customHooks/analyticsLogger.d.ts +8 -0
  214. package/dist/esm/customHooks/analyticsLogger.js +37 -0
  215. package/dist/esm/customHooks/consoleLogger.js +137 -13
  216. package/dist/esm/customHooks/networkLogger.d.ts +0 -1
  217. package/dist/esm/customHooks/networkLogger.js +0 -1
  218. package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
  219. package/dist/esm/enums/index.d.ts +39 -0
  220. package/dist/esm/enums/index.js +47 -0
  221. package/dist/esm/helpers/index.d.ts +27 -1
  222. package/dist/esm/helpers/index.js +180 -11
  223. package/dist/esm/helpers/settingsStore.d.ts +2 -24
  224. package/dist/esm/i18n/en.json +144 -0
  225. package/dist/esm/i18n/index.d.ts +2 -0
  226. package/dist/esm/i18n/index.js +22 -0
  227. package/dist/esm/i18n/locales/en.json +314 -0
  228. package/dist/esm/index.d.ts +2 -3
  229. package/dist/esm/index.js +207 -4923
  230. package/dist/esm/styles/AppColors.d.ts +148 -0
  231. package/dist/esm/styles/AppColors.js +176 -0
  232. package/dist/esm/styles/common.d.ts +3 -0
  233. package/dist/esm/styles/common.js +197 -0
  234. package/dist/esm/styles/index.d.ts +219 -435
  235. package/dist/esm/styles/index.js +312 -488
  236. package/dist/esm/types/enums.d.ts +9 -0
  237. package/dist/esm/types/enums.js +3 -0
  238. package/dist/esm/types/index.d.ts +4 -111
  239. package/dist/esm/types/index.js +2 -1
  240. package/dist/esm/types/interfaces.d.ts +337 -0
  241. package/dist/esm/types/interfaces.js +1 -0
  242. package/example/App.tsx +88 -1
  243. package/example/android/app/build.gradle +29 -1
  244. package/example/android/app/src/main/java/com/example/MainApplication.kt +25 -0
  245. package/example/android/build.gradle +31 -4
  246. package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  247. package/example/android/gradle.properties +1 -0
  248. package/example/android/settings.gradle +20 -1
  249. package/example/package-lock.json +1 -1
  250. package/package.json +3 -1
@@ -2,44 +2,85 @@ import React, { useEffect, useRef } from 'react';
2
2
  import { Animated, StyleSheet, Text, View } from 'react-native';
3
3
  import { AppColors } from '../styles/AppColors';
4
4
  import { AppFonts } from '../styles/AppFonts';
5
+ import { formatGap, formatTime } from '../helpers';
5
6
  import HighlightText from './HighlightText';
6
7
  import TouchableScale from './TouchableScale';
7
8
  // ─── Palette (Google Analytics colours) ───────────────────────────────────────
8
9
  const EVENT_PALETTE = [
9
- '#4285F4', // blue
10
- '#34A853', // green
11
- '#9C27B0', // purple
12
- '#00897B', // teal
13
- '#E53935', // red
14
- '#F57C00', // orange
15
- '#1565C0', // dark blue
16
- '#2E7D32', // dark green
10
+ AppColors.googleBlue, // blue
11
+ AppColors.googleGreen, // green
12
+ AppColors.googlePurple, // purple
13
+ AppColors.googleTeal, // teal
14
+ AppColors.googleRed, // red
15
+ AppColors.googleOrange, // orange
16
+ AppColors.blue700, // dark blue
17
+ AppColors.materialGreen, // dark green
17
18
  ];
18
19
  export function getEventColor(name) {
20
+ const safeName = typeof name === 'string' ? name : String(name || '');
19
21
  let hash = 0;
20
- for (let i = 0; i < name.length; i++) {
21
- hash = (hash * 31 + name.charCodeAt(i)) | 0;
22
+ for (let i = 0; i < safeName.length; i++) {
23
+ hash = (hash * 31 + safeName.charCodeAt(i)) | 0;
22
24
  }
23
25
  return EVENT_PALETTE[Math.abs(hash) % EVENT_PALETTE.length];
24
26
  }
25
27
  // ─── Helpers ──────────────────────────────────────────────────────────────────
26
- function formatTime(ts) {
27
- const d = new Date(ts);
28
- const hh = String(d.getHours()).padStart(2, '0');
29
- const mm = String(d.getMinutes()).padStart(2, '0');
30
- const ss = String(d.getSeconds()).padStart(2, '0');
31
- const ms = String(d.getMilliseconds()).padStart(3, '0');
32
- return `${hh}:${mm}:${ss}.${ms}`;
28
+ function getEventCategory(name) {
29
+ if (!name)
30
+ return 'Custom';
31
+ const lowercaseName = name.toLowerCase();
32
+ if (lowercaseName === 'screen_view' || lowercaseName === 'page_view') {
33
+ return 'Page View';
34
+ }
35
+ // Ecommerce events
36
+ const ecommerceEvents = [
37
+ 'purchase', 'add_to_cart', 'begin_checkout', 'view_item',
38
+ 'select_item', 'remove_from_cart', 'view_cart',
39
+ 'add_shipping_info', 'add_payment_info', 'refund',
40
+ 'view_item_list', 'select_promotion', 'view_promotion'
41
+ ];
42
+ if (ecommerceEvents.includes(lowercaseName)) {
43
+ return 'Ecommerce';
44
+ }
45
+ // Firebase System Auto-events
46
+ const systemEvents = [
47
+ 'first_open', 'session_start', 'user_engagement',
48
+ 'app_clear_data', 'app_exception', 'app_update', 'os_update',
49
+ 'notification_receive', 'notification_open', 'notification_dismiss',
50
+ 'screen_active', 'screen_inactive'
51
+ ];
52
+ if (systemEvents.includes(lowercaseName) || lowercaseName.startsWith('firebase_') || lowercaseName.startsWith('_')) {
53
+ return 'System';
54
+ }
55
+ return 'Custom';
33
56
  }
34
- function formatGap(ms) {
35
- if (ms < 1000)
36
- return `+${ms}ms`;
37
- const s = Math.round(ms / 1000);
38
- if (s < 60)
39
- return `+${s}s`;
40
- const m = Math.floor(s / 60);
41
- const rem = s % 60;
42
- return rem > 0 ? `+${m}m ${rem}s` : `+${m}m`;
57
+ function getCategoryColors(category) {
58
+ switch (category) {
59
+ case 'Page View':
60
+ return {
61
+ bg: AppColors.blueBg,
62
+ border: AppColors.blueBorder,
63
+ text: AppColors.blue800,
64
+ };
65
+ case 'Ecommerce':
66
+ return {
67
+ bg: AppColors.greenBg,
68
+ border: AppColors.greenBorder,
69
+ text: AppColors.materialGreen,
70
+ };
71
+ case 'System':
72
+ return {
73
+ bg: AppColors.greyBg,
74
+ border: AppColors.greyBorder,
75
+ text: AppColors.grey600,
76
+ };
77
+ default:
78
+ return {
79
+ bg: AppColors.purpleBg,
80
+ border: AppColors.purpleBorder,
81
+ text: AppColors.purpleText,
82
+ };
83
+ }
43
84
  }
44
85
  // ─── Component ────────────────────────────────────────────────────────────────
45
86
  const AnalyticsEventCard = React.memo(function AnalyticsEventCard({ event, onPress, isNew = false, searchStr = '', msSincePrev, computedScreenName, }) {
@@ -89,6 +130,19 @@ const AnalyticsEventCard = React.memo(function AnalyticsEventCard({ event, onPre
89
130
  <HighlightText text={event.name} search={searchStr} style={[cardStyles.eventName, { color: color }]} highlightStyle={cardStyles.highlight}/>
90
131
  </View>
91
132
 
133
+ {(() => {
134
+ const category = getEventCategory(event.name);
135
+ const tagColors = getCategoryColors(category);
136
+ return (<View style={[
137
+ cardStyles.categoryBadge,
138
+ { backgroundColor: tagColors.bg, borderColor: tagColors.border },
139
+ ]}>
140
+ <Text style={[cardStyles.categoryText, { color: tagColors.text }]}>
141
+ {category}
142
+ </Text>
143
+ </View>);
144
+ })()}
145
+
92
146
  {event.count !== undefined ? (<View style={[
93
147
  cardStyles.duplicateBadge,
94
148
  event.count === 1 && {
@@ -112,20 +166,24 @@ const AnalyticsEventCard = React.memo(function AnalyticsEventCard({ event, onPre
112
166
  {/* Bottom Row: Metadata Chips & Sparkline */}
113
167
  <View style={cardStyles.cardBody}>
114
168
  <View style={cardStyles.chipsRow}>
115
- {computedScreenName ||
116
- event.screenName ||
117
- event.params?.firebase_screen ||
118
- event.params?.screen_name ||
119
- event.params?.firebase_screen_class ? (<View style={[cardStyles.chip, { backgroundColor: AppColors.grayBackground, borderColor: AppColors.grayBorderSecondary }]}>
120
- <View style={[cardStyles.screenDot, { backgroundColor: color }]}/>
121
- <Text style={[cardStyles.chipText, { color: AppColors.grayText }]} numberOfLines={1}>
122
- {computedScreenName ||
169
+ {(() => {
170
+ const rawScreenName = computedScreenName ||
123
171
  event.screenName ||
124
172
  event.params?.firebase_screen ||
125
173
  event.params?.screen_name ||
126
- event.params?.firebase_screen_class}
127
- </Text>
128
- </View>) : null}
174
+ event.params?.firebase_screen_class;
175
+ if (!rawScreenName)
176
+ return null;
177
+ const screenNameStr = typeof rawScreenName === 'object'
178
+ ? JSON.stringify(rawScreenName)
179
+ : String(rawScreenName);
180
+ return (<View style={[cardStyles.chip, { backgroundColor: AppColors.grayBackground, borderColor: AppColors.grayBorderSecondary }]}>
181
+ <View style={[cardStyles.screenDot, { backgroundColor: color }]}/>
182
+ <Text style={[cardStyles.chipText, { color: AppColors.grayText }]} numberOfLines={1}>
183
+ {screenNameStr}
184
+ </Text>
185
+ </View>);
186
+ })()}
129
187
 
130
188
  <View style={[cardStyles.chip, { backgroundColor: AppColors.grayBackground, borderColor: AppColors.grayBorderSecondary }]}>
131
189
  <Text style={[cardStyles.chipText, { color: AppColors.grayText }]}>
@@ -140,8 +198,8 @@ const AnalyticsEventCard = React.memo(function AnalyticsEventCard({ event, onPre
140
198
  {(() => {
141
199
  const items = event.params?.items;
142
200
  if (Array.isArray(items) && items.length > 0) {
143
- return (<View style={[cardStyles.chip, { backgroundColor: '#FEF3C7', borderColor: '#FDE68A' }]}>
144
- <Text style={[cardStyles.chipText, { color: '#D97706', fontFamily: AppFonts.interBold }]}>
201
+ return (<View style={[cardStyles.chip, { backgroundColor: AppColors.amberBg, borderColor: AppColors.amberBorder }]}>
202
+ <Text style={[cardStyles.chipText, { color: AppColors.amber700, fontFamily: AppFonts.interBold }]}>
145
203
  🛒 {items.length} {items.length === 1 ? 'item' : 'items'}
146
204
  </Text>
147
205
  </View>);
@@ -155,8 +213,8 @@ const AnalyticsEventCard = React.memo(function AnalyticsEventCard({ event, onPre
155
213
  const isPrimitive = typeof val === 'string' || typeof val === 'number';
156
214
  if (isPrimitive) {
157
215
  const currencyStr = typeof currency === 'string' || typeof currency === 'number' ? String(currency) : '';
158
- return (<View style={[cardStyles.chip, { backgroundColor: '#ECFDF5', borderColor: '#A7F3D0' }]}>
159
- <Text style={[cardStyles.chipText, { color: '#059669', fontFamily: AppFonts.interBold }]}>
216
+ return (<View style={[cardStyles.chip, { backgroundColor: AppColors.emeraldBg, borderColor: AppColors.emeraldBorder }]}>
217
+ <Text style={[cardStyles.chipText, { color: AppColors.emerald600, fontFamily: AppFonts.interBold }]}>
160
218
  💰 {String(val)} {currencyStr}
161
219
  </Text>
162
220
  </View>);
@@ -185,12 +243,12 @@ const cardStyles = StyleSheet.create({
185
243
  letterSpacing: 0.5,
186
244
  },
187
245
  modernCard: {
188
- backgroundColor: '#FFFFFF',
246
+ backgroundColor: AppColors.white,
189
247
  borderRadius: 8,
190
248
  borderWidth: 1,
191
- borderColor: '#EFEFEF',
249
+ borderColor: AppColors.dividerColor,
192
250
  padding: 8,
193
- shadowColor: '#000',
251
+ shadowColor: AppColors.black,
194
252
  shadowOpacity: 0.03,
195
253
  shadowRadius: 3,
196
254
  shadowOffset: { width: 0, height: 1 },
@@ -220,7 +278,7 @@ const cardStyles = StyleSheet.create({
220
278
  color: AppColors.grayTextWeak,
221
279
  },
222
280
  highlight: {
223
- backgroundColor: '#FFE44D',
281
+ backgroundColor: AppColors.yellowHighlight,
224
282
  color: AppColors.primaryBlack,
225
283
  borderRadius: 2,
226
284
  },
@@ -258,8 +316,8 @@ const cardStyles = StyleSheet.create({
258
316
  marginRight: 4,
259
317
  },
260
318
  duplicateBadge: {
261
- backgroundColor: '#FFE4E6',
262
- borderColor: '#FCC2D7',
319
+ backgroundColor: AppColors.roseBg,
320
+ borderColor: AppColors.roseBorder,
263
321
  borderWidth: 1,
264
322
  paddingHorizontal: 5,
265
323
  paddingVertical: 2,
@@ -268,7 +326,19 @@ const cardStyles = StyleSheet.create({
268
326
  duplicateText: {
269
327
  fontFamily: AppFonts.interBold,
270
328
  fontSize: 9,
271
- color: '#E11D48',
329
+ color: AppColors.rose600,
330
+ textTransform: 'uppercase',
331
+ letterSpacing: 0.5,
332
+ },
333
+ categoryBadge: {
334
+ borderWidth: 1,
335
+ paddingHorizontal: 5,
336
+ paddingVertical: 2,
337
+ borderRadius: 4,
338
+ },
339
+ categoryText: {
340
+ fontFamily: AppFonts.interBold,
341
+ fontSize: 9,
272
342
  textTransform: 'uppercase',
273
343
  letterSpacing: 0.5,
274
344
  },
@@ -1,8 +1,4 @@
1
1
  import React from 'react';
2
- import { AnalyticsEvent } from '../types';
3
- interface Props {
4
- event: AnalyticsEvent;
5
- accentColor: string;
6
- }
7
- declare const AnalyticsGraph: ({ event, accentColor }: Props) => React.JSX.Element;
2
+ import { AnalyticsGraphProps } from '../types';
3
+ declare const AnalyticsGraph: ({ event, accentColor }: AnalyticsGraphProps) => React.JSX.Element;
8
4
  export default AnalyticsGraph;
@@ -53,7 +53,7 @@ const AnalyticsGraph = ({ event, accentColor }) => {
53
53
  const typeData = [
54
54
  { label: 'Strings', value: paramTypes.string, color: AppColors.purple },
55
55
  { label: 'Numbers', value: paramTypes.number, color: AppColors.skyBlue },
56
- { label: 'Booleans', value: paramTypes.boolean, color: '#F59E0B' }, // Amber
56
+ { label: 'Booleans', value: paramTypes.boolean, color: AppColors.amber500 }, // Amber
57
57
  { label: 'Objects', value: paramTypes.object, color: AppColors.greenColor },
58
58
  ].filter(d => d.value > 0);
59
59
  strings.sort((a, b) => b.value - a.value);
@@ -94,7 +94,7 @@ const AnalyticsGraph = ({ event, accentColor }) => {
94
94
  <BarChart data={filteredItems.map((item, i) => ({
95
95
  label: item.item_name || item.item_id || `Item ${i + 1}`,
96
96
  value: item.price,
97
- }))} accentColor={AppColors.successGreen || '#22C55E'} maxBarWidth={maxBarWidth} isGradient={false}/>
97
+ }))} accentColor={AppColors.successGreen} maxBarWidth={maxBarWidth} isGradient={false}/>
98
98
  </View>)}
99
99
  </View>);
100
100
  };
@@ -181,12 +181,12 @@ const GaugeChart = ({ data, accentColor, }) => {
181
181
  paddingTop: 6,
182
182
  paddingBottom: 6,
183
183
  }}>
184
- {data.map((d, i) => {
184
+ {data.map(d => {
185
185
  const fillPct = Math.min(Math.abs(d.value) / maxVal, 1);
186
186
  const strokeDashoffset = Math.max(circumference - fillPct * circumference, 0.001); // avoid exact 0
187
187
  return (<View key={d.label} style={{ alignItems: 'center', width: 70 }}>
188
188
  <Svg width="60" height="60" viewBox="0 0 60 60">
189
- <Circle cx="30" cy="30" r={radius} stroke="#F3F4F6" strokeWidth={stroke} fill="none"/>
189
+ <Circle cx="30" cy="30" r={radius} stroke={AppColors.grayBorderSecondary} strokeWidth={stroke} fill="none"/>
190
190
  <Circle cx="30" cy="30" r={radius} stroke={accentColor} strokeWidth={stroke} fill="none" strokeLinecap="round" strokeDasharray={circumference} strokeDashoffset={strokeDashoffset} rotation="-90" origin="30, 30"/>
191
191
  </Svg>
192
192
  <View style={{
@@ -248,12 +248,12 @@ const CalendarChart = ({ data, accentColor, }) => {
248
248
  <View style={{
249
249
  width: 58,
250
250
  height: 62,
251
- backgroundColor: '#FFFFFF',
251
+ backgroundColor: AppColors.white,
252
252
  borderRadius: 8,
253
253
  borderWidth: 1,
254
254
  borderColor: AppColors.grayBorderSecondary,
255
255
  overflow: 'hidden',
256
- shadowColor: '#000',
256
+ shadowColor: AppColors.black,
257
257
  shadowOpacity: 0.05,
258
258
  shadowRadius: 4,
259
259
  shadowOffset: { width: 0, height: 2 },
@@ -269,7 +269,7 @@ const CalendarChart = ({ data, accentColor, }) => {
269
269
  <Text style={{
270
270
  fontFamily: AppFonts.interBold,
271
271
  fontSize: 9,
272
- color: '#FFF',
272
+ color: AppColors.white,
273
273
  textTransform: 'uppercase',
274
274
  letterSpacing: 0.5,
275
275
  }}>
@@ -281,7 +281,7 @@ const CalendarChart = ({ data, accentColor, }) => {
281
281
  flex: 1,
282
282
  justifyContent: 'center',
283
283
  alignItems: 'center',
284
- backgroundColor: '#FAFAFA',
284
+ backgroundColor: AppColors.grayBackground,
285
285
  }}>
286
286
  <Text style={{
287
287
  fontFamily: AppFonts.interBold,
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { AnalyticsEvent } from '../types';
3
+ interface AnalyticsTabViewProps {
4
+ analyticsSearch: string;
5
+ onSetAnalyticsSearch: (val: string) => void;
6
+ onDeleteEvents: () => void;
7
+ selectedEvent: AnalyticsEvent | null;
8
+ onSelectEvent: (event: AnalyticsEvent | null) => void;
9
+ filteredAnalyticsEvents: AnalyticsEvent[];
10
+ visibleAnalyticsEvents: AnalyticsEvent[];
11
+ currentUserProperties: Record<string, any>;
12
+ currentUserId: string | null;
13
+ }
14
+ export declare const AnalyticsTabView: React.FC<AnalyticsTabViewProps>;
15
+ export default AnalyticsTabView;
@@ -0,0 +1,151 @@
1
+ import React from 'react';
2
+ import { FlatList, Pressable, Text, TextInput, View, } from 'react-native';
3
+ import { useTranslation } from 'react-i18next';
4
+ import TouchableScale from './TouchableScale';
5
+ import AnalyticsEventCard from './AnalyticsEventCard';
6
+ import AnalyticsDetail from './AnalyticsDetail';
7
+ import EmptyState from './EmptyState';
8
+ import AnimatedEntrance from './AnimatedEntrance';
9
+ import { SearchIcon, ClearIcon, WipeIcon, UserIcon, } from './NetworkIcons';
10
+ import { AppColors } from '../styles/AppColors';
11
+ import { AppFonts } from '../styles/AppFonts';
12
+ import styles from '../styles';
13
+ export const AnalyticsTabView = React.memo(({ analyticsSearch, onSetAnalyticsSearch, onDeleteEvents, selectedEvent, onSelectEvent, filteredAnalyticsEvents, visibleAnalyticsEvents, currentUserProperties, currentUserId, }) => {
14
+ const { t } = useTranslation();
15
+ const [userPropsExpanded, setUserPropsExpanded] = React.useState(false);
16
+ const renderItem = React.useCallback(({ item, index }) => (<AnimatedEntrance index={index} distance={8}>
17
+ <AnalyticsEventCard event={item} searchStr={analyticsSearch} onPress={() => onSelectEvent(item)}/>
18
+ </AnimatedEntrance>), [analyticsSearch, onSelectEvent]);
19
+ const keyExtractor = React.useCallback((item, index) => item.id != null ? item.id.toString() : index.toString(), []);
20
+ const renderAnalyticsHeader = () => {
21
+ const hasProps = Object.keys(currentUserProperties ?? {}).length > 0;
22
+ const total = visibleAnalyticsEvents.length;
23
+ const filtered = filteredAnalyticsEvents.length;
24
+ return (<View style={{ paddingHorizontal: 16, paddingTop: 8, paddingBottom: 4 }}>
25
+ {(hasProps || currentUserId) && (<View style={{
26
+ backgroundColor: AppColors.primaryLight,
27
+ borderRadius: 10,
28
+ borderWidth: 1,
29
+ borderColor: AppColors.grayBorderSecondary,
30
+ marginBottom: 10,
31
+ overflow: 'hidden',
32
+ }}>
33
+ <Pressable onPress={() => setUserPropsExpanded(v => !v)} style={{
34
+ flexDirection: 'row',
35
+ alignItems: 'center',
36
+ justifyContent: 'space-between',
37
+ padding: 10,
38
+ backgroundColor: AppColors.grayBackground,
39
+ }}>
40
+ <View style={{
41
+ flexDirection: 'row',
42
+ alignItems: 'center',
43
+ gap: 6,
44
+ }}>
45
+ <UserIcon color={AppColors.purple} size={14}/>
46
+ <Text style={{
47
+ fontFamily: AppFonts.interBold,
48
+ fontSize: 12,
49
+ color: AppColors.primaryBlack,
50
+ }}>
51
+ {t('analytics.user_context')}
52
+ </Text>
53
+ {currentUserId && (<View style={{
54
+ backgroundColor: 'rgba(104,75,155,0.1)',
55
+ paddingHorizontal: 6,
56
+ paddingVertical: 1,
57
+ borderRadius: 4,
58
+ }}>
59
+ <Text style={{
60
+ fontFamily: AppFonts.interBold,
61
+ fontSize: 9,
62
+ color: AppColors.purple,
63
+ }}>
64
+ {t('analytics.id')}: {currentUserId}
65
+ </Text>
66
+ </View>)}
67
+ </View>
68
+ <Text style={{
69
+ fontFamily: AppFonts.interMedium,
70
+ fontSize: 11,
71
+ color: AppColors.purple,
72
+ }}>
73
+ {userPropsExpanded ? t('analytics.hide_props') : t('analytics.show_props')}
74
+ </Text>
75
+ </Pressable>
76
+
77
+ {userPropsExpanded && hasProps && (<View style={{
78
+ padding: 10,
79
+ borderTopWidth: 1,
80
+ borderTopColor: AppColors.dividerColor,
81
+ gap: 4,
82
+ }}>
83
+ {Object.entries(currentUserProperties ?? {}).map(([k, v]) => (<View key={k} style={{
84
+ flexDirection: 'row',
85
+ justifyContent: 'space-between',
86
+ }}>
87
+ <Text style={{
88
+ fontFamily: AppFonts.interMedium,
89
+ fontSize: 11,
90
+ color: AppColors.grayTextWeak,
91
+ }}>
92
+ {k}
93
+ </Text>
94
+ <Text style={{
95
+ fontFamily: AppFonts.interBold,
96
+ fontSize: 11,
97
+ color: AppColors.primaryBlack,
98
+ }}>
99
+ {String(v)}
100
+ </Text>
101
+ </View>))}
102
+ </View>)}
103
+ </View>)}
104
+
105
+ <Text style={[styles.resultCount, { marginBottom: 4 }]}>
106
+ {t('filters.showing_analytics', { filtered, total })}
107
+ </Text>
108
+ </View>);
109
+ };
110
+ return (<View style={{ flex: 1 }}>
111
+ {selectedEvent != null ? (<AnalyticsDetail event={selectedEvent} onClose={() => onSelectEvent(null)}/>) : (<View style={{ flex: 1 }}>
112
+ <View style={{
113
+ backgroundColor: AppColors.white,
114
+ borderBottomWidth: 1,
115
+ borderBottomColor: AppColors.dividerColor,
116
+ paddingBottom: 6,
117
+ }}>
118
+ <View style={[
119
+ styles.toolbarRow,
120
+ { marginTop: 12, marginBottom: 8 },
121
+ ]}>
122
+ <View style={styles.searchContainer}>
123
+ <SearchIcon color={AppColors.grayTextWeak} size={16}/>
124
+ <TextInput placeholder={t('search.analytics_placeholder')} placeholderTextColor={AppColors.grayTextWeak} value={analyticsSearch} onChangeText={onSetAnalyticsSearch} style={styles.searchInput} autoCorrect={false} autoCapitalize="none"/>
125
+ {analyticsSearch.length > 0 && (<Pressable onPress={() => onSetAnalyticsSearch('')} hitSlop={10} style={styles.clearBtn}>
126
+ <ClearIcon color={AppColors.grayTextWeak} size={14}/>
127
+ </Pressable>)}
128
+ </View>
129
+
130
+ <View style={styles.toolbarRight}>
131
+ <TouchableScale style={[
132
+ styles.toolbarBtn,
133
+ {
134
+ borderColor: 'rgba(255,46,87,0.22)',
135
+ backgroundColor: 'rgba(255,46,87,0.06)',
136
+ },
137
+ ]} onPress={onDeleteEvents} hitSlop={6}>
138
+ <WipeIcon color={AppColors.errorColor} size={15}/>
139
+ </TouchableScale>
140
+ </View>
141
+ </View>
142
+ </View>
143
+
144
+ <FlatList data={filteredAnalyticsEvents} keyExtractor={keyExtractor} ListHeaderComponent={renderAnalyticsHeader} renderItem={renderItem} initialNumToRender={15} maxToRenderPerBatch={15} windowSize={7} removeClippedSubviews={true} ListEmptyComponent={<EmptyState isSearch={analyticsSearch.length > 0}/>} contentContainerStyle={[
145
+ styles.listContent,
146
+ filteredAnalyticsEvents.length === 0 && { flexGrow: 1 },
147
+ ]} keyboardShouldPersistTaps="handled"/>
148
+ </View>)}
149
+ </View>);
150
+ });
151
+ export default AnalyticsTabView;
@@ -8,5 +8,5 @@ interface AnimatedEntranceProps {
8
8
  index?: number;
9
9
  style?: ViewStyle | ViewStyle[];
10
10
  }
11
- declare const AnimatedEntrance: ({ children, delay, distance, duration, index, style, }: AnimatedEntranceProps) => React.JSX.Element;
11
+ declare const AnimatedEntrance: React.NamedExoticComponent<AnimatedEntranceProps>;
12
12
  export default AnimatedEntrance;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import { Animated } from 'react-native';
3
- const AnimatedEntrance = ({ children, delay = 0, distance = 10, duration = 220, index = 0, style, }) => {
3
+ const AnimatedEntrance = React.memo(function AnimatedEntrance({ children, delay = 0, distance = 10, duration = 220, index = 0, style, }) {
4
4
  const progress = useRef(new Animated.Value(0)).current;
5
5
  useEffect(() => {
6
6
  progress.setValue(0);
@@ -33,5 +33,5 @@ const AnimatedEntrance = ({ children, delay = 0, distance = 10, duration = 220,
33
33
  ]}>
34
34
  {children}
35
35
  </Animated.View>);
36
- };
36
+ });
37
37
  export default AnimatedEntrance;
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { NetworkLog } from '../types';
3
+ import { ApiDetailTab } from '../enums';
4
+ interface ApiDetailViewProps {
5
+ selected: NetworkLog;
6
+ apiDetailActiveTab: ApiDetailTab | 'metadata' | 'headers' | 'request' | 'response';
7
+ onSetApiDetailActiveTab: (tab: ApiDetailTab | 'metadata' | 'headers' | 'request' | 'response') => void;
8
+ detailSearch: string;
9
+ onSetDetailSearch: (val: string) => void;
10
+ reqExpanded: boolean;
11
+ onToggleReqExpanded: () => void;
12
+ resExpanded: boolean;
13
+ onToggleResExpanded: () => void;
14
+ showReqDiff: boolean;
15
+ onToggleShowReqDiff: () => void;
16
+ showResDiff: boolean;
17
+ onToggleShowResDiff: () => void;
18
+ prevRequestData: any;
19
+ prevResponseData: any;
20
+ }
21
+ export declare const ApiDetailView: React.FC<ApiDetailViewProps>;
22
+ export default ApiDetailView;