react-native-inapp-inspector 2.3.18 → 2.3.20

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 (358) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +57 -0
  2. package/dist/commonjs/analytics.js +1 -24
  3. package/dist/commonjs/bundle.js +1 -16
  4. package/dist/commonjs/capture.d.ts +2 -0
  5. package/dist/commonjs/capture.js +1 -32
  6. package/dist/commonjs/components/AnalyticsDetail.js +92 -623
  7. package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
  8. package/dist/commonjs/components/AnalyticsGraph.js +70 -370
  9. package/dist/commonjs/components/AnimatedEntrance.js +1 -11
  10. package/dist/commonjs/components/AppHeaderLogo.js +7 -134
  11. package/dist/commonjs/components/BrandCircleIcon.js +73 -118
  12. package/dist/commonjs/components/BrandSquareIcon.js +63 -108
  13. package/dist/commonjs/components/CodeSnippet.js +48 -623
  14. package/dist/commonjs/components/ConsoleLogCard.js +63 -537
  15. package/dist/commonjs/components/CopyButton.js +3 -89
  16. package/dist/commonjs/components/DiffViewer.js +19 -83
  17. package/dist/commonjs/components/DomainHeader.js +27 -127
  18. package/dist/commonjs/components/EmptyState.d.ts +1 -0
  19. package/dist/commonjs/components/EmptyState.js +10 -87
  20. package/dist/commonjs/components/EndOfListFooter.js +7 -81
  21. package/dist/commonjs/components/ErrorBoundary.js +72 -566
  22. package/dist/commonjs/components/HeadersSection.js +31 -110
  23. package/dist/commonjs/components/HighlightText.js +17 -58
  24. package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
  25. package/dist/commonjs/components/Inspector/AboutModal.js +351 -0
  26. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
  27. package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
  28. package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
  29. package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
  30. package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
  31. package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
  32. package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
  33. package/dist/commonjs/components/Inspector/DebuggingTab.js +64 -871
  34. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
  35. package/dist/commonjs/components/Inspector/FabLauncher.js +85 -54
  36. package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
  37. package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +9 -0
  38. package/dist/commonjs/components/Inspector/FeedbackModal.js +167 -521
  39. package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
  40. package/dist/commonjs/components/Inspector/InspectorHeader.js +219 -1093
  41. package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
  42. package/dist/commonjs/components/Inspector/MainScreen.js +60 -332
  43. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +136 -278
  44. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +134 -361
  45. package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
  46. package/dist/commonjs/components/Inspector/NetworkDetail.js +96 -432
  47. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
  48. package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
  49. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +17 -433
  50. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
  51. package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
  52. package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
  53. package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
  54. package/dist/commonjs/components/Inspector/SettingsPanel.js +431 -3431
  55. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
  56. package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
  57. package/dist/commonjs/components/Inspector/TabBar.js +47 -183
  58. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +34 -408
  59. package/dist/commonjs/components/JsonViewer.js +168 -380
  60. package/dist/commonjs/components/LogCard.js +57 -567
  61. package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
  62. package/dist/commonjs/components/MetaAccordion.js +69 -238
  63. package/dist/commonjs/components/MiniBarChart.js +3 -56
  64. package/dist/commonjs/components/MiniLineChart.js +3 -58
  65. package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
  66. package/dist/commonjs/components/NetworkIcons.js +479 -997
  67. package/dist/commonjs/components/QRCodeView.js +5 -79
  68. package/dist/commonjs/components/SectionHeader.js +15 -37
  69. package/dist/commonjs/components/SegmentedTabs.js +7 -61
  70. package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
  71. package/dist/commonjs/components/Slider.js +15 -243
  72. package/dist/commonjs/components/SourcePageCard.js +30 -89
  73. package/dist/commonjs/components/Toast.js +5 -147
  74. package/dist/commonjs/components/TouchableScale.js +3 -24
  75. package/dist/commonjs/components/TreeNode.js +55 -130
  76. package/dist/commonjs/console.js +1 -16
  77. package/dist/commonjs/constants/index.js +1 -32
  78. package/dist/commonjs/constants/telemetryConfig.js +1 -6
  79. package/dist/commonjs/constants/version.d.ts +1 -1
  80. package/dist/commonjs/constants/version.js +1 -4
  81. package/dist/commonjs/crash.js +1 -23
  82. package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
  83. package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
  84. package/dist/commonjs/customHooks/consoleLogger.js +6 -445
  85. package/dist/commonjs/customHooks/crashHandler.js +7 -656
  86. package/dist/commonjs/customHooks/logFilters.js +1 -23
  87. package/dist/commonjs/customHooks/networkLogger.js +2 -536
  88. package/dist/commonjs/customHooks/performanceTracker.js +63 -750
  89. package/dist/commonjs/customHooks/reduxLogger.js +2 -313
  90. package/dist/commonjs/customHooks/storageInspector.js +1 -435
  91. package/dist/commonjs/customHooks/useAccordion.js +1 -18
  92. package/dist/commonjs/decorators/index.js +1 -100
  93. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
  94. package/dist/commonjs/helpers/index.js +8 -921
  95. package/dist/commonjs/helpers/memoryManager.js +1 -99
  96. package/dist/commonjs/helpers/qrGenerator.js +1 -367
  97. package/dist/commonjs/helpers/remoteConfig.js +1 -165
  98. package/dist/commonjs/helpers/searchQueryParser.js +1 -62
  99. package/dist/commonjs/helpers/settingsStore.js +1 -144
  100. package/dist/commonjs/helpers/telemetry.js +1 -501
  101. package/dist/commonjs/helpers/toast.js +1 -20
  102. package/dist/commonjs/i18n/index.js +1 -90
  103. package/dist/commonjs/i18n/locales/en.json +1 -1122
  104. package/dist/commonjs/index.js +5 -2153
  105. package/dist/commonjs/metro.js +6 -468
  106. package/dist/commonjs/native/NativeInspector.d.ts +3 -0
  107. package/dist/commonjs/native/NativeInspector.js +1 -402
  108. package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
  109. package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
  110. package/dist/commonjs/network.js +1 -13
  111. package/dist/commonjs/performance.js +1 -29
  112. package/dist/commonjs/redux.js +1 -20
  113. package/dist/commonjs/storage.js +1 -14
  114. package/dist/commonjs/styles/AppColors.js +1 -423
  115. package/dist/commonjs/styles/AppFonts.js +1 -17
  116. package/dist/commonjs/styles/common.js +1 -190
  117. package/dist/commonjs/styles/index.d.ts +6 -0
  118. package/dist/commonjs/styles/index.js +1 -1589
  119. package/dist/commonjs/types/enums.d.ts +2 -1
  120. package/dist/commonjs/types/enums.js +1 -150
  121. package/dist/commonjs/types/index.js +1 -18
  122. package/dist/commonjs/types/interfaces.d.ts +7 -0
  123. package/dist/commonjs/types/interfaces.js +1 -2
  124. package/dist/esm/analytics.js +1 -2
  125. package/dist/esm/bundle.js +1 -2
  126. package/dist/esm/capture.d.ts +2 -0
  127. package/dist/esm/capture.js +1 -29
  128. package/dist/esm/components/AnalyticsDetail.js +171 -664
  129. package/dist/esm/components/AnalyticsEventCard.js +77 -335
  130. package/dist/esm/components/AnalyticsGraph.js +95 -357
  131. package/dist/esm/components/AnimatedEntrance.js +1 -6
  132. package/dist/esm/components/AppHeaderLogo.js +7 -94
  133. package/dist/esm/components/BrandCircleIcon.js +114 -119
  134. package/dist/esm/components/BrandSquareIcon.js +73 -78
  135. package/dist/esm/components/CodeSnippet.js +58 -595
  136. package/dist/esm/components/ConsoleLogCard.js +91 -526
  137. package/dist/esm/components/CopyButton.js +3 -51
  138. package/dist/esm/components/DiffViewer.js +22 -48
  139. package/dist/esm/components/DomainHeader.js +43 -138
  140. package/dist/esm/components/EmptyState.d.ts +1 -0
  141. package/dist/esm/components/EmptyState.js +17 -56
  142. package/dist/esm/components/EndOfListFooter.js +15 -83
  143. package/dist/esm/components/ErrorBoundary.js +125 -582
  144. package/dist/esm/components/HeadersSection.js +52 -93
  145. package/dist/esm/components/HighlightText.js +17 -53
  146. package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
  147. package/dist/esm/components/Inspector/AboutModal.js +351 -0
  148. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
  149. package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
  150. package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
  151. package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
  152. package/dist/esm/components/Inspector/CrashDetail.js +236 -747
  153. package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
  154. package/dist/esm/components/Inspector/CrashTab.js +177 -711
  155. package/dist/esm/components/Inspector/DebuggingTab.js +156 -923
  156. package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
  157. package/dist/esm/components/Inspector/FabLauncher.js +85 -49
  158. package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
  159. package/dist/esm/components/Inspector/FeedbackModal.d.ts +9 -0
  160. package/dist/esm/components/Inspector/FeedbackModal.js +182 -499
  161. package/dist/esm/components/Inspector/InspectorContext.js +1 -12
  162. package/dist/esm/components/Inspector/InspectorHeader.js +309 -1145
  163. package/dist/esm/components/Inspector/LogDetail.js +235 -1023
  164. package/dist/esm/components/Inspector/MainScreen.js +86 -320
  165. package/dist/esm/components/Inspector/MediaGalleryTab.js +157 -259
  166. package/dist/esm/components/Inspector/MediaPreviewModal.js +153 -340
  167. package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
  168. package/dist/esm/components/Inspector/NetworkDetail.js +141 -472
  169. package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
  170. package/dist/esm/components/Inspector/NetworkTab.js +125 -517
  171. package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
  172. package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
  173. package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
  174. package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
  175. package/dist/esm/components/Inspector/ReduxTab.js +144 -722
  176. package/dist/esm/components/Inspector/SettingsPanel.js +647 -3609
  177. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
  178. package/dist/esm/components/Inspector/StorageTab.js +172 -866
  179. package/dist/esm/components/Inspector/TabBar.js +52 -183
  180. package/dist/esm/components/Inspector/UpdateAvailableModal.js +79 -416
  181. package/dist/esm/components/JsonViewer.js +179 -353
  182. package/dist/esm/components/LogCard.js +93 -565
  183. package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
  184. package/dist/esm/components/MetaAccordion.js +136 -267
  185. package/dist/esm/components/MiniBarChart.js +3 -18
  186. package/dist/esm/components/MiniLineChart.js +3 -20
  187. package/dist/esm/components/NetworkIcons.d.ts +7 -0
  188. package/dist/esm/components/NetworkIcons.js +481 -817
  189. package/dist/esm/components/QRCodeView.js +8 -45
  190. package/dist/esm/components/SectionHeader.js +22 -39
  191. package/dist/esm/components/SegmentedTabs.js +8 -57
  192. package/dist/esm/components/SkeletonPlaceholder.js +30 -163
  193. package/dist/esm/components/Slider.js +24 -213
  194. package/dist/esm/components/SourcePageCard.js +65 -86
  195. package/dist/esm/components/Toast.js +10 -117
  196. package/dist/esm/components/TouchableScale.js +3 -19
  197. package/dist/esm/components/TreeNode.js +58 -95
  198. package/dist/esm/console.js +1 -2
  199. package/dist/esm/constants/index.js +1 -28
  200. package/dist/esm/constants/telemetryConfig.js +1 -3
  201. package/dist/esm/constants/version.d.ts +1 -1
  202. package/dist/esm/constants/version.js +1 -1
  203. package/dist/esm/crash.js +1 -2
  204. package/dist/esm/customHooks/analyticsLogger.js +1 -230
  205. package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
  206. package/dist/esm/customHooks/consoleLogger.js +6 -432
  207. package/dist/esm/customHooks/crashHandler.js +7 -630
  208. package/dist/esm/customHooks/logFilters.js +1 -20
  209. package/dist/esm/customHooks/networkLogger.js +2 -519
  210. package/dist/esm/customHooks/performanceTracker.js +63 -723
  211. package/dist/esm/customHooks/reduxLogger.js +2 -293
  212. package/dist/esm/customHooks/storageInspector.js +1 -418
  213. package/dist/esm/customHooks/useAccordion.js +1 -16
  214. package/dist/esm/decorators/index.js +1 -95
  215. package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
  216. package/dist/esm/helpers/index.js +8 -861
  217. package/dist/esm/helpers/memoryManager.js +1 -91
  218. package/dist/esm/helpers/qrGenerator.js +1 -364
  219. package/dist/esm/helpers/remoteConfig.js +1 -160
  220. package/dist/esm/helpers/searchQueryParser.js +1 -59
  221. package/dist/esm/helpers/settingsStore.js +1 -134
  222. package/dist/esm/helpers/telemetry.js +1 -489
  223. package/dist/esm/helpers/toast.js +1 -15
  224. package/dist/esm/i18n/index.js +1 -78
  225. package/dist/esm/i18n/locales/en.json +1 -1122
  226. package/dist/esm/index.js +7 -1967
  227. package/dist/esm/metro.js +6 -459
  228. package/dist/esm/native/NativeInspector.d.ts +3 -0
  229. package/dist/esm/native/NativeInspector.js +1 -370
  230. package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
  231. package/dist/esm/native/NativeNetworkInspector.js +1 -2
  232. package/dist/esm/network.js +1 -1
  233. package/dist/esm/performance.js +1 -2
  234. package/dist/esm/redux.js +1 -1
  235. package/dist/esm/storage.js +1 -1
  236. package/dist/esm/styles/AppColors.js +1 -417
  237. package/dist/esm/styles/AppFonts.js +1 -13
  238. package/dist/esm/styles/common.js +1 -186
  239. package/dist/esm/styles/index.d.ts +6 -0
  240. package/dist/esm/styles/index.js +1 -1551
  241. package/dist/esm/types/enums.d.ts +2 -1
  242. package/dist/esm/types/enums.js +1 -147
  243. package/dist/esm/types/index.js +1 -2
  244. package/dist/esm/types/interfaces.d.ts +7 -0
  245. package/dist/esm/types/interfaces.js +1 -1
  246. package/ios/NetworkInspectorModule.mm +253 -136
  247. package/package.json +5 -3
  248. package/react-native-inapp-inspector.podspec +1 -1
  249. package/src/native/NativeInspector.ts +17 -0
  250. package/src/native/NativeNetworkInspector.ts +1 -0
  251. package/src/analytics.ts +0 -35
  252. package/src/bundle.ts +0 -25
  253. package/src/capture.ts +0 -101
  254. package/src/components/AnalyticsDetail.tsx +0 -870
  255. package/src/components/AnalyticsEventCard.tsx +0 -444
  256. package/src/components/AnalyticsGraph.tsx +0 -583
  257. package/src/components/AnimatedEntrance.tsx +0 -20
  258. package/src/components/AppHeaderLogo.tsx +0 -143
  259. package/src/components/BrandCircleIcon.tsx +0 -144
  260. package/src/components/BrandSquareIcon.tsx +0 -184
  261. package/src/components/CodeSnippet.tsx +0 -725
  262. package/src/components/ConsoleLogCard.tsx +0 -679
  263. package/src/components/CopyButton.tsx +0 -87
  264. package/src/components/DiffViewer.tsx +0 -82
  265. package/src/components/DomainHeader.tsx +0 -224
  266. package/src/components/EmptyState.tsx +0 -95
  267. package/src/components/EndOfListFooter.tsx +0 -100
  268. package/src/components/ErrorBoundary.tsx +0 -688
  269. package/src/components/HeadersSection.tsx +0 -172
  270. package/src/components/HighlightText.tsx +0 -100
  271. package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
  272. package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
  273. package/src/components/Inspector/BundleTab.tsx +0 -4768
  274. package/src/components/Inspector/ConsoleTab.tsx +0 -726
  275. package/src/components/Inspector/CrashDetail.tsx +0 -997
  276. package/src/components/Inspector/CrashFilterModal.tsx +0 -721
  277. package/src/components/Inspector/CrashTab.tsx +0 -933
  278. package/src/components/Inspector/DebuggingTab.tsx +0 -1103
  279. package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
  280. package/src/components/Inspector/FabLauncher.tsx +0 -80
  281. package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
  282. package/src/components/Inspector/FeedbackModal.tsx +0 -626
  283. package/src/components/Inspector/InspectorContext.tsx +0 -28
  284. package/src/components/Inspector/InspectorHeader.tsx +0 -1545
  285. package/src/components/Inspector/LogDetail.tsx +0 -1431
  286. package/src/components/Inspector/MainScreen.tsx +0 -459
  287. package/src/components/Inspector/MediaGalleryTab.tsx +0 -355
  288. package/src/components/Inspector/MediaPreviewModal.tsx +0 -435
  289. package/src/components/Inspector/NavigationTracker.tsx +0 -13
  290. package/src/components/Inspector/NetworkDetail.tsx +0 -795
  291. package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
  292. package/src/components/Inspector/NetworkTab.tsx +0 -820
  293. package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
  294. package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
  295. package/src/components/Inspector/PerformanceTab.tsx +0 -1967
  296. package/src/components/Inspector/ReduxDetail.tsx +0 -1651
  297. package/src/components/Inspector/ReduxTab.tsx +0 -987
  298. package/src/components/Inspector/SettingsPanel.tsx +0 -4580
  299. package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
  300. package/src/components/Inspector/StorageTab.tsx +0 -1159
  301. package/src/components/Inspector/TabBar.tsx +0 -263
  302. package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
  303. package/src/components/JsonViewer.tsx +0 -547
  304. package/src/components/LogCard.tsx +0 -694
  305. package/src/components/LogSyntaxHighlighter.tsx +0 -178
  306. package/src/components/MetaAccordion.tsx +0 -355
  307. package/src/components/MiniBarChart.tsx +0 -42
  308. package/src/components/MiniLineChart.tsx +0 -33
  309. package/src/components/NetworkIcons.tsx +0 -2599
  310. package/src/components/QRCodeView.tsx +0 -75
  311. package/src/components/SectionHeader.tsx +0 -101
  312. package/src/components/SegmentedTabs.tsx +0 -83
  313. package/src/components/SkeletonPlaceholder.tsx +0 -206
  314. package/src/components/Slider.tsx +0 -300
  315. package/src/components/SourcePageCard.tsx +0 -150
  316. package/src/components/Toast.tsx +0 -131
  317. package/src/components/TouchableScale.tsx +0 -61
  318. package/src/components/TreeNode.tsx +0 -171
  319. package/src/console.ts +0 -24
  320. package/src/constants/index.ts +0 -41
  321. package/src/constants/telemetryConfig.ts +0 -4
  322. package/src/constants/version.ts +0 -3
  323. package/src/crash.ts +0 -32
  324. package/src/customHooks/analyticsLogger.ts +0 -336
  325. package/src/customHooks/bundleAnalyzer.ts +0 -1256
  326. package/src/customHooks/consoleLogger.ts +0 -530
  327. package/src/customHooks/crashHandler.ts +0 -944
  328. package/src/customHooks/logFilters.ts +0 -32
  329. package/src/customHooks/networkLogger.ts +0 -624
  330. package/src/customHooks/performanceTracker.ts +0 -1014
  331. package/src/customHooks/reduxLogger.ts +0 -406
  332. package/src/customHooks/storageInspector.ts +0 -513
  333. package/src/customHooks/useAccordion.tsx +0 -27
  334. package/src/decorators/index.ts +0 -184
  335. package/src/helpers/gaAnalyticsRegistry.ts +0 -204
  336. package/src/helpers/index.ts +0 -1092
  337. package/src/helpers/memoryManager.ts +0 -138
  338. package/src/helpers/qrGenerator.ts +0 -430
  339. package/src/helpers/remoteConfig.ts +0 -212
  340. package/src/helpers/searchQueryParser.ts +0 -84
  341. package/src/helpers/settingsStore.ts +0 -171
  342. package/src/helpers/telemetry.ts +0 -568
  343. package/src/helpers/toast.ts +0 -17
  344. package/src/i18n/index.ts +0 -104
  345. package/src/i18n/locales/en.json +0 -1125
  346. package/src/index.tsx +0 -2635
  347. package/src/metro.ts +0 -598
  348. package/src/network.ts +0 -22
  349. package/src/performance.ts +0 -38
  350. package/src/redux.ts +0 -23
  351. package/src/storage.ts +0 -18
  352. package/src/styles/AppColors.ts +0 -455
  353. package/src/styles/AppFonts.ts +0 -26
  354. package/src/styles/common.ts +0 -209
  355. package/src/styles/index.ts +0 -1606
  356. package/src/types/enums.ts +0 -208
  357. package/src/types/index.ts +0 -34
  358. package/src/types/interfaces.ts +0 -530
@@ -1,1250 +0,0 @@
1
- import React, {useEffect, useMemo, useState} from 'react';
2
- import {
3
- Modal,
4
- Pressable,
5
- ScrollView,
6
- StyleSheet,
7
- Text,
8
- TouchableOpacity,
9
- View,
10
- } from 'react-native';
11
- import {useInspector} from './InspectorContext';
12
- import {AnalyticsFilters, AnalyticsEvent} from '../../types';
13
- import {AppColors} from '../../styles/AppColors';
14
- import {AppFonts} from '../../styles/AppFonts';
15
- import {getEventCategory} from '../../helpers';
16
- import {
17
- FilterIcon,
18
- CloseWhite,
19
- CheckIcon,
20
- CartIcon,
21
- GlobeIcon,
22
- BoltIcon,
23
- SparkleIcon,
24
- MoneyIcon,
25
- ClockIcon,
26
- HourglassIcon,
27
- FlameIcon,
28
- PinIcon,
29
- RepeatIcon,
30
- TargetGoalIcon,
31
- UserIcon,
32
- UserCheckIcon,
33
- PackageBoxIcon,
34
- CodeBracketsIcon,
35
- } from '../NetworkIcons';
36
- import TouchableScale from '../TouchableScale';
37
-
38
- interface AnalyticsFilterModalProps {
39
- visible: boolean;
40
- onClose: () => void;
41
- }
42
-
43
- const DEFAULT_FILTERS: AnalyticsFilters = {
44
- categories: new Set(['all']),
45
- screens: new Set(),
46
- sources: new Set(['all']),
47
- userTypes: new Set(['all']),
48
- timeWindow: 'all',
49
- payloadComplexity: 'all',
50
- hasRevenue: false,
51
- hasItems: false,
52
- hasUserProps: false,
53
- hasParams: false,
54
- onlyDuplicates: false,
55
- onlyConversions: false,
56
- sortBy: 'time_desc',
57
- };
58
-
59
- const AnalyticsFilterModal: React.FC<AnalyticsFilterModalProps> = ({
60
- visible,
61
- onClose,
62
- }) => {
63
- const {
64
- analyticsEvents,
65
- analyticsSearch,
66
- analyticsFilters,
67
- setAnalyticsFilters,
68
- } = useInspector();
69
-
70
- // Staged Draft State: applied ONLY on tapping "Apply Filters"
71
- const [draft, setDraft] = useState<AnalyticsFilters>(() => ({
72
- ...analyticsFilters,
73
- categories: new Set(analyticsFilters.categories),
74
- screens: new Set(analyticsFilters.screens),
75
- sources: new Set(analyticsFilters.sources || ['all']),
76
- userTypes: new Set(analyticsFilters.userTypes || ['all']),
77
- }));
78
-
79
- // Re-sync draft whenever modal opens
80
- useEffect(() => {
81
- if (visible) {
82
- setDraft({
83
- ...analyticsFilters,
84
- categories: new Set(analyticsFilters.categories),
85
- screens: new Set(analyticsFilters.screens),
86
- sources: new Set(analyticsFilters.sources || ['all']),
87
- userTypes: new Set(analyticsFilters.userTypes || ['all']),
88
- });
89
- }
90
- }, [visible, analyticsFilters]);
91
-
92
- // Extract unique screen names from logged events
93
- const uniqueScreens = useMemo(() => {
94
- const screens = new Set<string>();
95
- for (const e of analyticsEvents) {
96
- const scr =
97
- e.screenName ||
98
- e.params?.firebase_screen ||
99
- e.params?.screen_name ||
100
- e.params?.firebase_screen_class ||
101
- e.screenClass;
102
- if (scr && typeof scr === 'string' && scr.trim() !== '') {
103
- screens.add(scr.trim());
104
- }
105
- }
106
- return Array.from(screens);
107
- }, [analyticsEvents]);
108
-
109
- // Toggle Category in Draft
110
- const toggleCategory = (cat: string) => {
111
- setDraft(prev => {
112
- const next = new Set(prev.categories);
113
- if (cat === 'all') {
114
- return {...prev, categories: new Set(['all'])};
115
- }
116
- next.delete('all');
117
- if (next.has(cat)) {
118
- next.delete(cat);
119
- if (next.size === 0) next.add('all');
120
- } else {
121
- next.add(cat);
122
- }
123
- return {...prev, categories: next};
124
- });
125
- };
126
-
127
- // Toggle Screen in Draft
128
- const toggleScreen = (scr: string) => {
129
- setDraft(prev => {
130
- const next = new Set(prev.screens);
131
- if (next.has(scr)) {
132
- next.delete(scr);
133
- } else {
134
- next.add(scr);
135
- }
136
- return {...prev, screens: next};
137
- });
138
- };
139
-
140
- // Toggle Source in Draft
141
- const toggleSource = (src: string) => {
142
- setDraft(prev => {
143
- const next = new Set(prev.sources);
144
- if (src === 'all') {
145
- return {...prev, sources: new Set(['all'])};
146
- }
147
- next.delete('all');
148
- if (next.has(src)) {
149
- next.delete(src);
150
- if (next.size === 0) next.add('all');
151
- } else {
152
- next.add(src);
153
- }
154
- return {...prev, sources: next};
155
- });
156
- };
157
-
158
- // Toggle User Type in Draft
159
- const toggleUserType = (ut: string) => {
160
- setDraft(prev => {
161
- const next = new Set(prev.userTypes);
162
- if (ut === 'all') {
163
- return {...prev, userTypes: new Set(['all'])};
164
- }
165
- next.delete('all');
166
- if (next.has(ut)) {
167
- next.delete(ut);
168
- if (next.size === 0) next.add('all');
169
- } else {
170
- next.add(ut);
171
- }
172
- return {...prev, userTypes: next};
173
- });
174
- };
175
-
176
- // Toggle Boolean Flag in Draft
177
- const toggleFlag = (
178
- key:
179
- | 'hasRevenue'
180
- | 'hasItems'
181
- | 'hasUserProps'
182
- | 'hasParams'
183
- | 'onlyDuplicates'
184
- | 'onlyConversions',
185
- ) => {
186
- setDraft(prev => ({
187
- ...prev,
188
- [key]: !prev[key],
189
- }));
190
- };
191
-
192
- // Set Time Window in Draft
193
- const setTimeWindow = (tw: 'all' | '1m' | '5m' | '15m' | '1h') => {
194
- setDraft(prev => ({...prev, timeWindow: tw}));
195
- };
196
-
197
- // Set Payload Complexity in Draft
198
- const setPayloadComplexity = (
199
- pc: 'all' | 'none' | 'simple' | 'heavy',
200
- ) => {
201
- setDraft(prev => ({...prev, payloadComplexity: pc}));
202
- };
203
-
204
- // Set Sort in Draft
205
- const setSort = (
206
- sortBy: 'time_desc' | 'time_asc' | 'revenue_desc' | 'count_desc',
207
- ) => {
208
- setDraft(prev => ({...prev, sortBy}));
209
- };
210
-
211
- // Reset Draft to default
212
- const handleResetDraft = () => {
213
- setDraft({
214
- categories: new Set(['all']),
215
- screens: new Set(),
216
- sources: new Set(['all']),
217
- userTypes: new Set(['all']),
218
- timeWindow: 'all',
219
- payloadComplexity: 'all',
220
- hasRevenue: false,
221
- hasItems: false,
222
- hasUserProps: false,
223
- hasParams: false,
224
- onlyDuplicates: false,
225
- onlyConversions: false,
226
- sortBy: 'time_desc',
227
- });
228
- };
229
-
230
- // Commit Draft to actual filters
231
- const handleApply = () => {
232
- setAnalyticsFilters({
233
- ...draft,
234
- categories: new Set(draft.categories),
235
- screens: new Set(draft.screens),
236
- sources: new Set(draft.sources),
237
- userTypes: new Set(draft.userTypes),
238
- });
239
- onClose();
240
- };
241
-
242
- // Discard changes & close
243
- const handleDiscard = () => {
244
- setDraft({
245
- ...analyticsFilters,
246
- categories: new Set(analyticsFilters.categories),
247
- screens: new Set(analyticsFilters.screens),
248
- sources: new Set(analyticsFilters.sources || ['all']),
249
- userTypes: new Set(analyticsFilters.userTypes || ['all']),
250
- });
251
- onClose();
252
- };
253
-
254
- // Calculate matching count for Draft in real-time
255
- const draftMatchCount = useMemo(() => {
256
- let events = analyticsEvents;
257
-
258
- if (analyticsSearch) {
259
- const s = analyticsSearch.toLowerCase();
260
- events = events.filter(
261
- e =>
262
- e.name.toLowerCase().includes(s) ||
263
- JSON.stringify(e.params || {}).toLowerCase().includes(s) ||
264
- (e.screenName ?? '').toLowerCase().includes(s) ||
265
- (e.pageTitle ?? '').toLowerCase().includes(s),
266
- );
267
- }
268
-
269
- if (draft.categories.size > 0 && !draft.categories.has('all')) {
270
- events = events.filter(e => {
271
- const cat = getEventCategory(e.name);
272
- return draft.categories.has(cat);
273
- });
274
- }
275
-
276
- if (draft.timeWindow !== 'all') {
277
- const now = Date.now();
278
- const cutoff =
279
- draft.timeWindow === '1m'
280
- ? now - 60 * 1000
281
- : draft.timeWindow === '5m'
282
- ? now - 5 * 60 * 1000
283
- : draft.timeWindow === '15m'
284
- ? now - 15 * 60 * 1000
285
- : now - 60 * 60 * 1000;
286
- events = events.filter(e => e.timestamp >= cutoff);
287
- }
288
-
289
- if (draft.sources.size > 0 && !draft.sources.has('all')) {
290
- events = events.filter(e => draft.sources.has(e.source || 'manual'));
291
- }
292
-
293
- if (draft.userTypes.size > 0 && !draft.userTypes.has('all')) {
294
- events = events.filter(e => {
295
- const isIdentified = Boolean(e.userId && e.userId.trim() !== '');
296
- if (draft.userTypes.has('identified') && isIdentified) return true;
297
- if (draft.userTypes.has('anonymous') && !isIdentified) return true;
298
- return false;
299
- });
300
- }
301
-
302
- if (draft.payloadComplexity !== 'all') {
303
- events = events.filter(e => {
304
- const count = e.params ? Object.keys(e.params).length : 0;
305
- if (draft.payloadComplexity === 'none') return count === 0;
306
- if (draft.payloadComplexity === 'simple') return count >= 1 && count <= 5;
307
- if (draft.payloadComplexity === 'heavy') return count > 5;
308
- return true;
309
- });
310
- }
311
-
312
- if (draft.onlyConversions) {
313
- const CONVERSION_PATTERNS = [
314
- 'purchase',
315
- 'item_purchase',
316
- 'ecommerce_purchase',
317
- 'sign_up',
318
- 'login',
319
- 'lead',
320
- 'generate_lead',
321
- 'tutorial_complete',
322
- 'add_payment_info',
323
- 'begin_checkout',
324
- ];
325
- events = events.filter(e =>
326
- CONVERSION_PATTERNS.some(pat => e.name.toLowerCase().includes(pat)),
327
- );
328
- }
329
-
330
- if (draft.screens.size > 0) {
331
- events = events.filter(e => {
332
- const scr =
333
- e.screenName ||
334
- e.params?.firebase_screen ||
335
- e.params?.screen_name ||
336
- e.params?.firebase_screen_class ||
337
- e.screenClass ||
338
- '';
339
- return draft.screens.has(scr);
340
- });
341
- }
342
-
343
- if (draft.hasRevenue) {
344
- events = events.filter(e => {
345
- const val = e.params?.value ?? e.params?.price;
346
- return val !== undefined && val !== null && Number(val) > 0;
347
- });
348
- }
349
-
350
- if (draft.hasItems) {
351
- events = events.filter(
352
- e => Array.isArray(e.params?.items) && e.params.items.length > 0,
353
- );
354
- }
355
-
356
- if (draft.hasUserProps) {
357
- events = events.filter(
358
- e => e.userProperties && Object.keys(e.userProperties).length > 0,
359
- );
360
- }
361
-
362
- if (draft.hasParams) {
363
- events = events.filter(
364
- e => e.params && Object.keys(e.params).length > 0,
365
- );
366
- }
367
-
368
- return events.length;
369
- }, [analyticsEvents, analyticsSearch, draft]);
370
-
371
- const isAllCategories =
372
- draft.categories.has('all') || draft.categories.size === 0;
373
- const isAllSources = draft.sources.has('all') || draft.sources.size === 0;
374
- const isAllUserTypes =
375
- draft.userTypes.has('all') || draft.userTypes.size === 0;
376
-
377
- return (
378
- <Modal
379
- visible={visible}
380
- transparent
381
- animationType="fade"
382
- onRequestClose={handleDiscard}>
383
- <View style={styles.backdrop}>
384
- <Pressable style={StyleSheet.absoluteFill} onPress={handleDiscard} />
385
-
386
- <View style={styles.modalCard}>
387
- {/* ─── Header ──────────────────────────────────────────────────────── */}
388
- <View style={styles.header}>
389
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 8}}>
390
- <View style={styles.headerIconBox}>
391
- <FilterIcon color={AppColors.brandPurple} size={15} />
392
- </View>
393
- <View>
394
- <Text style={styles.headerTitle}>Analytics Filters</Text>
395
- <Text style={styles.headerSubtitle}>
396
- GA4 Telemetry Dimensions & Metrics
397
- </Text>
398
- </View>
399
- </View>
400
-
401
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 8}}>
402
- <TouchableOpacity
403
- onPress={handleResetDraft}
404
- hitSlop={8}
405
- style={styles.resetBtn}>
406
- <Text style={styles.resetBtnText}>Reset All</Text>
407
- </TouchableOpacity>
408
-
409
- <TouchableOpacity
410
- onPress={handleDiscard}
411
- hitSlop={10}
412
- style={styles.closeBtn}>
413
- <CloseWhite />
414
- </TouchableOpacity>
415
- </View>
416
- </View>
417
-
418
- {/* ─── Scrollable Filter Options ──────────────────────────────────── */}
419
- <ScrollView
420
- style={{maxHeight: 460}}
421
- contentContainerStyle={styles.scrollContent}
422
- showsVerticalScrollIndicator={true}>
423
- {/* 1. Time Horizon Window */}
424
- <View style={styles.section}>
425
- <View style={styles.sectionHeaderRow}>
426
- <ClockIcon color={AppColors.grayTextWeak} size={12} />
427
- <Text style={styles.sectionTitle}>TIME HORIZON</Text>
428
- </View>
429
- <View style={styles.chipsWrap}>
430
- {[
431
- {key: 'all' as const, label: 'All Time'},
432
- {key: '1m' as const, label: 'Last 1 min'},
433
- {key: '5m' as const, label: 'Last 5 mins'},
434
- {key: '15m' as const, label: 'Last 15 mins'},
435
- {key: '1h' as const, label: 'Last 1 hour'},
436
- ].map(item => (
437
- <TouchableScale
438
- key={item.key}
439
- onPress={() => setTimeWindow(item.key)}
440
- style={[
441
- styles.filterPill,
442
- draft.timeWindow === item.key &&
443
- styles.filterPillActive,
444
- ]}>
445
- <Text
446
- style={[
447
- styles.filterPillText,
448
- draft.timeWindow === item.key &&
449
- styles.filterPillTextActive,
450
- ]}>
451
- {item.label}
452
- </Text>
453
- </TouchableScale>
454
- ))}
455
- </View>
456
- </View>
457
-
458
- {/* 2. Category Dimensions */}
459
- <View style={styles.section}>
460
- <View style={styles.sectionHeaderRow}>
461
- <TargetGoalIcon color={AppColors.grayTextWeak} size={12} />
462
- <Text style={styles.sectionTitle}>EVENT CATEGORIES</Text>
463
- </View>
464
- <View style={styles.chipsWrap}>
465
- <TouchableScale
466
- onPress={() => toggleCategory('all')}
467
- style={[
468
- styles.filterPill,
469
- isAllCategories && styles.filterPillActive,
470
- ]}>
471
- {isAllCategories && (
472
- <CheckIcon color={AppColors.white} size={12} />
473
- )}
474
- <Text
475
- style={[
476
- styles.filterPillText,
477
- isAllCategories && styles.filterPillTextActive,
478
- ]}>
479
- All Categories
480
- </Text>
481
- </TouchableScale>
482
-
483
- <TouchableScale
484
- onPress={() => toggleCategory('ecommerce')}
485
- style={[
486
- styles.filterPill,
487
- draft.categories.has('ecommerce') &&
488
- styles.filterPillActive,
489
- ]}>
490
- <CartIcon
491
- color={
492
- draft.categories.has('ecommerce')
493
- ? AppColors.white
494
- : AppColors.amber700
495
- }
496
- size={13}
497
- />
498
- <Text
499
- style={[
500
- styles.filterPillText,
501
- draft.categories.has('ecommerce') &&
502
- styles.filterPillTextActive,
503
- ]}>
504
- Ecommerce
505
- </Text>
506
- </TouchableScale>
507
-
508
- <TouchableScale
509
- onPress={() => toggleCategory('page_view')}
510
- style={[
511
- styles.filterPill,
512
- draft.categories.has('page_view') &&
513
- styles.filterPillActive,
514
- ]}>
515
- <GlobeIcon
516
- color={
517
- draft.categories.has('page_view')
518
- ? AppColors.white
519
- : AppColors.sky600
520
- }
521
- size={13}
522
- />
523
- <Text
524
- style={[
525
- styles.filterPillText,
526
- draft.categories.has('page_view') &&
527
- styles.filterPillTextActive,
528
- ]}>
529
- Screens & Pages
530
- </Text>
531
- </TouchableScale>
532
-
533
- <TouchableScale
534
- onPress={() => toggleCategory('system')}
535
- style={[
536
- styles.filterPill,
537
- draft.categories.has('system') &&
538
- styles.filterPillActive,
539
- ]}>
540
- <BoltIcon
541
- color={
542
- draft.categories.has('system')
543
- ? AppColors.white
544
- : AppColors.purple
545
- }
546
- size={13}
547
- />
548
- <Text
549
- style={[
550
- styles.filterPillText,
551
- draft.categories.has('system') &&
552
- styles.filterPillTextActive,
553
- ]}>
554
- System & Lifecycle
555
- </Text>
556
- </TouchableScale>
557
-
558
- <TouchableScale
559
- onPress={() => toggleCategory('custom')}
560
- style={[
561
- styles.filterPill,
562
- draft.categories.has('custom') &&
563
- styles.filterPillActive,
564
- ]}>
565
- <SparkleIcon
566
- color={
567
- draft.categories.has('custom')
568
- ? AppColors.white
569
- : AppColors.brandPurple
570
- }
571
- size={13}
572
- />
573
- <Text
574
- style={[
575
- styles.filterPillText,
576
- draft.categories.has('custom') &&
577
- styles.filterPillTextActive,
578
- ]}>
579
- Custom Events
580
- </Text>
581
- </TouchableScale>
582
- </View>
583
- </View>
584
-
585
- {/* 3. Goals, Monetization & Attributes */}
586
- <View style={styles.section}>
587
- <View style={styles.sectionHeaderRow}>
588
- <MoneyIcon color={AppColors.grayTextWeak} size={12} />
589
- <Text style={styles.sectionTitle}>
590
- MONETIZATION & ATTRIBUTES
591
- </Text>
592
- </View>
593
- <View style={styles.chipsWrap}>
594
- <TouchableScale
595
- onPress={() => toggleFlag('onlyConversions')}
596
- style={[
597
- styles.filterPill,
598
- draft.onlyConversions && styles.filterPillActive,
599
- ]}>
600
- <TargetGoalIcon
601
- color={
602
- draft.onlyConversions
603
- ? AppColors.white
604
- : AppColors.brandPurple
605
- }
606
- size={13}
607
- />
608
- <Text
609
- style={[
610
- styles.filterPillText,
611
- draft.onlyConversions && styles.filterPillTextActive,
612
- ]}>
613
- Conversion Events Only
614
- </Text>
615
- </TouchableScale>
616
-
617
- <TouchableScale
618
- onPress={() => toggleFlag('hasRevenue')}
619
- style={[
620
- styles.filterPill,
621
- draft.hasRevenue && styles.filterPillActive,
622
- ]}>
623
- <MoneyIcon
624
- color={
625
- draft.hasRevenue
626
- ? AppColors.white
627
- : AppColors.emerald600
628
- }
629
- size={13}
630
- />
631
- <Text
632
- style={[
633
- styles.filterPillText,
634
- draft.hasRevenue && styles.filterPillTextActive,
635
- ]}>
636
- With Revenue (Value &gt; 0)
637
- </Text>
638
- </TouchableScale>
639
-
640
- <TouchableScale
641
- onPress={() => toggleFlag('hasItems')}
642
- style={[
643
- styles.filterPill,
644
- draft.hasItems && styles.filterPillActive,
645
- ]}>
646
- <PackageBoxIcon
647
- color={
648
- draft.hasItems
649
- ? AppColors.white
650
- : AppColors.amber700
651
- }
652
- size={13}
653
- />
654
- <Text
655
- style={[
656
- styles.filterPillText,
657
- draft.hasItems && styles.filterPillTextActive,
658
- ]}>
659
- With Items Payload
660
- </Text>
661
- </TouchableScale>
662
-
663
- <TouchableScale
664
- onPress={() => toggleFlag('hasUserProps')}
665
- style={[
666
- styles.filterPill,
667
- draft.hasUserProps && styles.filterPillActive,
668
- ]}>
669
- <SparkleIcon
670
- color={
671
- draft.hasUserProps
672
- ? AppColors.white
673
- : AppColors.brandPurple
674
- }
675
- size={13}
676
- />
677
- <Text
678
- style={[
679
- styles.filterPillText,
680
- draft.hasUserProps && styles.filterPillTextActive,
681
- ]}>
682
- With User Properties
683
- </Text>
684
- </TouchableScale>
685
-
686
- <TouchableScale
687
- onPress={() => toggleFlag('hasParams')}
688
- style={[
689
- styles.filterPill,
690
- draft.hasParams && styles.filterPillActive,
691
- ]}>
692
- <CodeBracketsIcon
693
- color={
694
- draft.hasParams
695
- ? AppColors.white
696
- : AppColors.grayText
697
- }
698
- size={13}
699
- />
700
- <Text
701
- style={[
702
- styles.filterPillText,
703
- draft.hasParams && styles.filterPillTextActive,
704
- ]}>
705
- With Custom Params
706
- </Text>
707
- </TouchableScale>
708
-
709
- <TouchableScale
710
- onPress={() => toggleFlag('onlyDuplicates')}
711
- style={[
712
- styles.filterPill,
713
- draft.onlyDuplicates && styles.filterPillActive,
714
- ]}>
715
- <RepeatIcon
716
- color={
717
- draft.onlyDuplicates
718
- ? AppColors.white
719
- : AppColors.rose600
720
- }
721
- size={13}
722
- />
723
- <Text
724
- style={[
725
- styles.filterPillText,
726
- draft.onlyDuplicates && styles.filterPillTextActive,
727
- ]}>
728
- Frequent Only (&gt; 1×)
729
- </Text>
730
- </TouchableScale>
731
- </View>
732
- </View>
733
-
734
- {/* 4. User Identification */}
735
- <View style={styles.section}>
736
- <View style={styles.sectionHeaderRow}>
737
- <UserIcon color={AppColors.grayTextWeak} size={12} />
738
- <Text style={styles.sectionTitle}>USER IDENTIFICATION</Text>
739
- </View>
740
- <View style={styles.chipsWrap}>
741
- <TouchableScale
742
- onPress={() => toggleUserType('all')}
743
- style={[
744
- styles.filterPill,
745
- isAllUserTypes && styles.filterPillActive,
746
- ]}>
747
- {isAllUserTypes && (
748
- <CheckIcon color={AppColors.white} size={12} />
749
- )}
750
- <Text
751
- style={[
752
- styles.filterPillText,
753
- isAllUserTypes && styles.filterPillTextActive,
754
- ]}>
755
- All Users
756
- </Text>
757
- </TouchableScale>
758
-
759
- <TouchableScale
760
- onPress={() => toggleUserType('identified')}
761
- style={[
762
- styles.filterPill,
763
- draft.userTypes.has('identified') &&
764
- styles.filterPillActive,
765
- ]}>
766
- <UserCheckIcon
767
- color={
768
- draft.userTypes.has('identified')
769
- ? AppColors.white
770
- : AppColors.greenColor
771
- }
772
- size={13}
773
- />
774
- <Text
775
- style={[
776
- styles.filterPillText,
777
- draft.userTypes.has('identified') &&
778
- styles.filterPillTextActive,
779
- ]}>
780
- Identified (User ID)
781
- </Text>
782
- </TouchableScale>
783
-
784
- <TouchableScale
785
- onPress={() => toggleUserType('anonymous')}
786
- style={[
787
- styles.filterPill,
788
- draft.userTypes.has('anonymous') &&
789
- styles.filterPillActive,
790
- ]}>
791
- <UserIcon
792
- color={
793
- draft.userTypes.has('anonymous')
794
- ? AppColors.white
795
- : AppColors.grayTextWeak
796
- }
797
- size={13}
798
- />
799
- <Text
800
- style={[
801
- styles.filterPillText,
802
- draft.userTypes.has('anonymous') &&
803
- styles.filterPillTextActive,
804
- ]}>
805
- Anonymous
806
- </Text>
807
- </TouchableScale>
808
- </View>
809
- </View>
810
-
811
- {/* 5. Source Logger SDK */}
812
- <View style={styles.section}>
813
- <View style={styles.sectionHeaderRow}>
814
- <BoltIcon color={AppColors.grayTextWeak} size={12} />
815
- <Text style={styles.sectionTitle}>EVENT SOURCE</Text>
816
- </View>
817
- <View style={styles.chipsWrap}>
818
- <TouchableScale
819
- onPress={() => toggleSource('all')}
820
- style={[
821
- styles.filterPill,
822
- isAllSources && styles.filterPillActive,
823
- ]}>
824
- {isAllSources && (
825
- <CheckIcon color={AppColors.white} size={12} />
826
- )}
827
- <Text
828
- style={[
829
- styles.filterPillText,
830
- isAllSources && styles.filterPillTextActive,
831
- ]}>
832
- All Sources
833
- </Text>
834
- </TouchableScale>
835
-
836
- <TouchableScale
837
- onPress={() => toggleSource('firebase')}
838
- style={[
839
- styles.filterPill,
840
- draft.sources.has('firebase') &&
841
- styles.filterPillActive,
842
- ]}>
843
- <Text
844
- style={[
845
- styles.filterPillText,
846
- draft.sources.has('firebase') &&
847
- styles.filterPillTextActive,
848
- ]}>
849
- Firebase / GA SDK
850
- </Text>
851
- </TouchableScale>
852
-
853
- <TouchableScale
854
- onPress={() => toggleSource('manual')}
855
- style={[
856
- styles.filterPill,
857
- draft.sources.has('manual') &&
858
- styles.filterPillActive,
859
- ]}>
860
- <Text
861
- style={[
862
- styles.filterPillText,
863
- draft.sources.has('manual') &&
864
- styles.filterPillTextActive,
865
- ]}>
866
- In-App Logger
867
- </Text>
868
- </TouchableScale>
869
- </View>
870
- </View>
871
-
872
- {/* 6. Payload Complexity */}
873
- <View style={styles.section}>
874
- <View style={styles.sectionHeaderRow}>
875
- <CodeBracketsIcon color={AppColors.grayTextWeak} size={12} />
876
- <Text style={styles.sectionTitle}>PAYLOAD COMPLEXITY</Text>
877
- </View>
878
- <View style={styles.chipsWrap}>
879
- {[
880
- {key: 'all' as const, label: 'All Payloads'},
881
- {key: 'none' as const, label: '0 Params'},
882
- {key: 'simple' as const, label: '1 - 5 Params'},
883
- {key: 'heavy' as const, label: '> 5 Params'},
884
- ].map(item => (
885
- <TouchableScale
886
- key={item.key}
887
- onPress={() => setPayloadComplexity(item.key)}
888
- style={[
889
- styles.filterPill,
890
- draft.payloadComplexity === item.key &&
891
- styles.filterPillActive,
892
- ]}>
893
- <Text
894
- style={[
895
- styles.filterPillText,
896
- draft.payloadComplexity === item.key &&
897
- styles.filterPillTextActive,
898
- ]}>
899
- {item.label}
900
- </Text>
901
- </TouchableScale>
902
- ))}
903
- </View>
904
- </View>
905
-
906
- {/* 7. Discovered Screens (Dimensions) */}
907
- {uniqueScreens.length > 0 && (
908
- <View style={styles.section}>
909
- <View style={styles.sectionHeaderRow}>
910
- <PinIcon color={AppColors.grayTextWeak} size={12} />
911
- <Text style={styles.sectionTitle}>
912
- DISCOVERED SCREENS ({uniqueScreens.length})
913
- </Text>
914
- </View>
915
- <View style={styles.chipsWrap}>
916
- {uniqueScreens.map(scr => {
917
- const isSelected = draft.screens.has(scr);
918
- return (
919
- <TouchableScale
920
- key={scr}
921
- onPress={() => toggleScreen(scr)}
922
- style={[
923
- styles.filterPill,
924
- isSelected && styles.filterPillActive,
925
- ]}>
926
- <PinIcon
927
- color={
928
- isSelected
929
- ? AppColors.white
930
- : AppColors.amber700
931
- }
932
- size={12}
933
- />
934
- <Text
935
- style={[
936
- styles.filterPillText,
937
- isSelected && styles.filterPillTextActive,
938
- ]}>
939
- {scr}
940
- </Text>
941
- </TouchableScale>
942
- );
943
- })}
944
- </View>
945
- </View>
946
- )}
947
-
948
- {/* 8. Sort Order */}
949
- <View style={styles.section}>
950
- <View style={styles.sectionHeaderRow}>
951
- <ClockIcon color={AppColors.grayTextWeak} size={12} />
952
- <Text style={styles.sectionTitle}>SORT ORDER</Text>
953
- </View>
954
- <View style={styles.chipsWrap}>
955
- <TouchableScale
956
- onPress={() => setSort('time_desc')}
957
- style={[
958
- styles.filterPill,
959
- draft.sortBy === 'time_desc' &&
960
- styles.filterPillActive,
961
- ]}>
962
- <ClockIcon
963
- color={
964
- draft.sortBy === 'time_desc'
965
- ? AppColors.white
966
- : AppColors.grayText
967
- }
968
- size={12}
969
- />
970
- <Text
971
- style={[
972
- styles.filterPillText,
973
- draft.sortBy === 'time_desc' &&
974
- styles.filterPillTextActive,
975
- ]}>
976
- Newest First (Default)
977
- </Text>
978
- </TouchableScale>
979
-
980
- <TouchableScale
981
- onPress={() => setSort('time_asc')}
982
- style={[
983
- styles.filterPill,
984
- draft.sortBy === 'time_asc' &&
985
- styles.filterPillActive,
986
- ]}>
987
- <HourglassIcon
988
- color={
989
- draft.sortBy === 'time_asc'
990
- ? AppColors.white
991
- : AppColors.grayText
992
- }
993
- size={12}
994
- />
995
- <Text
996
- style={[
997
- styles.filterPillText,
998
- draft.sortBy === 'time_asc' &&
999
- styles.filterPillTextActive,
1000
- ]}>
1001
- Oldest First
1002
- </Text>
1003
- </TouchableScale>
1004
-
1005
- <TouchableScale
1006
- onPress={() => setSort('revenue_desc')}
1007
- style={[
1008
- styles.filterPill,
1009
- draft.sortBy === 'revenue_desc' &&
1010
- styles.filterPillActive,
1011
- ]}>
1012
- <MoneyIcon
1013
- color={
1014
- draft.sortBy === 'revenue_desc'
1015
- ? AppColors.white
1016
- : AppColors.emerald600
1017
- }
1018
- size={12}
1019
- />
1020
- <Text
1021
- style={[
1022
- styles.filterPillText,
1023
- draft.sortBy === 'revenue_desc' &&
1024
- styles.filterPillTextActive,
1025
- ]}>
1026
- Highest Revenue
1027
- </Text>
1028
- </TouchableScale>
1029
-
1030
- <TouchableScale
1031
- onPress={() => setSort('count_desc')}
1032
- style={[
1033
- styles.filterPill,
1034
- draft.sortBy === 'count_desc' &&
1035
- styles.filterPillActive,
1036
- ]}>
1037
- <FlameIcon
1038
- color={
1039
- draft.sortBy === 'count_desc'
1040
- ? AppColors.white
1041
- : AppColors.darkOrange
1042
- }
1043
- size={12}
1044
- />
1045
- <Text
1046
- style={[
1047
- styles.filterPillText,
1048
- draft.sortBy === 'count_desc' &&
1049
- styles.filterPillTextActive,
1050
- ]}>
1051
- Most Frequent
1052
- </Text>
1053
- </TouchableScale>
1054
- </View>
1055
- </View>
1056
- </ScrollView>
1057
-
1058
- {/* ─── Footer Action Bar (Discard + Apply) ────────────────────────── */}
1059
- <View style={styles.footer}>
1060
- <TouchableOpacity
1061
- onPress={handleDiscard}
1062
- style={styles.discardBtn}
1063
- activeOpacity={0.8}>
1064
- <Text style={styles.discardBtnText}>Discard</Text>
1065
- </TouchableOpacity>
1066
-
1067
- <TouchableOpacity
1068
- onPress={handleApply}
1069
- style={styles.applyBtn}
1070
- activeOpacity={0.85}>
1071
- <Text style={styles.applyBtnText}>
1072
- Apply ({draftMatchCount} Events)
1073
- </Text>
1074
- </TouchableOpacity>
1075
- </View>
1076
- </View>
1077
- </View>
1078
- </Modal>
1079
- );
1080
- };
1081
-
1082
- const styles = StyleSheet.create({
1083
- backdrop: {
1084
- flex: 1,
1085
- backgroundColor: `${AppColors.primaryBlack}85`,
1086
- justifyContent: 'center',
1087
- alignItems: 'center',
1088
- padding: 16,
1089
- },
1090
- modalCard: {
1091
- width: '100%',
1092
- maxWidth: 440,
1093
- backgroundColor: AppColors.white,
1094
- borderRadius: 14,
1095
- borderWidth: 1,
1096
- borderColor: AppColors.dividerColor,
1097
- shadowColor: AppColors.black,
1098
- shadowOpacity: 0.18,
1099
- shadowRadius: 12,
1100
- shadowOffset: {width: 0, height: 4},
1101
- elevation: 8,
1102
- overflow: 'hidden',
1103
- },
1104
- header: {
1105
- flexDirection: 'row',
1106
- alignItems: 'center',
1107
- justifyContent: 'space-between',
1108
- paddingHorizontal: 14,
1109
- paddingVertical: 12,
1110
- borderBottomWidth: 1,
1111
- borderBottomColor: AppColors.dividerColor,
1112
- backgroundColor: `${AppColors.brandPurple}08`,
1113
- },
1114
- headerIconBox: {
1115
- width: 28,
1116
- height: 28,
1117
- borderRadius: 7,
1118
- backgroundColor: `${AppColors.brandPurple}18`,
1119
- alignItems: 'center',
1120
- justifyContent: 'center',
1121
- },
1122
- headerTitle: {
1123
- fontFamily: AppFonts.interBold,
1124
- fontSize: 13.5,
1125
- color: AppColors.primaryBlack,
1126
- },
1127
- headerSubtitle: {
1128
- fontFamily: AppFonts.interMedium,
1129
- fontSize: 10,
1130
- color: AppColors.grayTextWeak,
1131
- },
1132
- resetBtn: {
1133
- paddingHorizontal: 8,
1134
- paddingVertical: 4,
1135
- borderRadius: 5,
1136
- backgroundColor: `${AppColors.darkOrange}14`,
1137
- borderWidth: 1,
1138
- borderColor: `${AppColors.darkOrange}30`,
1139
- },
1140
- resetBtnText: {
1141
- fontFamily: AppFonts.interBold,
1142
- fontSize: 10,
1143
- color: AppColors.darkOrange,
1144
- },
1145
- closeBtn: {
1146
- width: 24,
1147
- height: 24,
1148
- borderRadius: 12,
1149
- backgroundColor: `${AppColors.primaryBlack}18`,
1150
- alignItems: 'center',
1151
- justifyContent: 'center',
1152
- },
1153
- scrollContent: {
1154
- padding: 14,
1155
- gap: 14,
1156
- },
1157
- section: {
1158
- gap: 7,
1159
- },
1160
- sectionHeaderRow: {
1161
- flexDirection: 'row',
1162
- alignItems: 'center',
1163
- gap: 5,
1164
- },
1165
- sectionTitle: {
1166
- fontFamily: AppFonts.interBold,
1167
- fontSize: 9.5,
1168
- color: AppColors.grayTextWeak,
1169
- letterSpacing: 0.5,
1170
- },
1171
- chipsWrap: {
1172
- flexDirection: 'row',
1173
- flexWrap: 'wrap',
1174
- gap: 6.5,
1175
- },
1176
- filterPill: {
1177
- flexDirection: 'row',
1178
- alignItems: 'center',
1179
- gap: 5,
1180
- paddingHorizontal: 9,
1181
- paddingVertical: 5.5,
1182
- borderRadius: 7,
1183
- backgroundColor: AppColors.grayBackground,
1184
- borderWidth: 1,
1185
- borderColor: AppColors.dividerColor,
1186
- },
1187
- filterPillActive: {
1188
- backgroundColor: AppColors.brandPurple,
1189
- borderColor: AppColors.brandPurple,
1190
- shadowColor: AppColors.brandPurple,
1191
- shadowOffset: {width: 0, height: 1},
1192
- shadowOpacity: 0.25,
1193
- shadowRadius: 3,
1194
- elevation: 2,
1195
- },
1196
- filterPillText: {
1197
- fontFamily: AppFonts.interMedium,
1198
- fontSize: 11,
1199
- color: AppColors.primaryBlack,
1200
- },
1201
- filterPillTextActive: {
1202
- color: AppColors.white,
1203
- fontFamily: AppFonts.interBold,
1204
- },
1205
- footer: {
1206
- flexDirection: 'row',
1207
- alignItems: 'center',
1208
- gap: 10,
1209
- paddingHorizontal: 14,
1210
- paddingVertical: 12,
1211
- borderTopWidth: 1,
1212
- borderTopColor: AppColors.dividerColor,
1213
- backgroundColor: AppColors.grayBackground,
1214
- },
1215
- discardBtn: {
1216
- flex: 1,
1217
- paddingVertical: 9.5,
1218
- borderRadius: 8,
1219
- borderWidth: 1,
1220
- borderColor: AppColors.dividerColor,
1221
- backgroundColor: AppColors.white,
1222
- alignItems: 'center',
1223
- justifyContent: 'center',
1224
- },
1225
- discardBtnText: {
1226
- fontFamily: AppFonts.interBold,
1227
- fontSize: 12.5,
1228
- color: AppColors.grayTextStrong,
1229
- },
1230
- applyBtn: {
1231
- flex: 2,
1232
- backgroundColor: AppColors.brandPurple,
1233
- paddingVertical: 9.5,
1234
- borderRadius: 8,
1235
- alignItems: 'center',
1236
- justifyContent: 'center',
1237
- shadowColor: AppColors.brandPurple,
1238
- shadowOffset: {width: 0, height: 1},
1239
- shadowOpacity: 0.25,
1240
- shadowRadius: 3,
1241
- elevation: 2,
1242
- },
1243
- applyBtnText: {
1244
- fontFamily: AppFonts.interBold,
1245
- fontSize: 12.5,
1246
- color: AppColors.white,
1247
- },
1248
- });
1249
-
1250
- export default AnalyticsFilterModal;