react-native-inapp-inspector 2.3.19 → 2.3.21

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 (353) hide show
  1. package/README.md +14 -14
  2. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +67 -0
  3. package/dist/commonjs/analytics.js +1 -24
  4. package/dist/commonjs/bundle.js +1 -16
  5. package/dist/commonjs/capture.js +1 -35
  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.js +10 -87
  19. package/dist/commonjs/components/EndOfListFooter.js +7 -81
  20. package/dist/commonjs/components/ErrorBoundary.js +72 -566
  21. package/dist/commonjs/components/HeadersSection.js +31 -110
  22. package/dist/commonjs/components/HighlightText.js +17 -58
  23. package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
  24. package/dist/commonjs/components/Inspector/AboutModal.js +243 -0
  25. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
  26. package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
  27. package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
  28. package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
  29. package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
  30. package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
  31. package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
  32. package/dist/commonjs/components/Inspector/DebuggingTab.js +74 -875
  33. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
  34. package/dist/commonjs/components/Inspector/FabLauncher.js +42 -466
  35. package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
  36. package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
  37. package/dist/commonjs/components/Inspector/InspectorHeader.js +191 -1110
  38. package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
  39. package/dist/commonjs/components/Inspector/MainScreen.js +52 -335
  40. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +97 -644
  41. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +90 -605
  42. package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
  43. package/dist/commonjs/components/Inspector/NetworkDetail.js +89 -411
  44. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
  45. package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
  46. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +18 -434
  47. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
  48. package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
  49. package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
  50. package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
  51. package/dist/commonjs/components/Inspector/SettingsPanel.js +427 -3807
  52. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
  53. package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
  54. package/dist/commonjs/components/Inspector/TabBar.js +36 -334
  55. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +37 -412
  56. package/dist/commonjs/components/JsonViewer.js +168 -381
  57. package/dist/commonjs/components/LogCard.js +57 -567
  58. package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
  59. package/dist/commonjs/components/MetaAccordion.js +69 -238
  60. package/dist/commonjs/components/MiniBarChart.js +3 -56
  61. package/dist/commonjs/components/MiniLineChart.js +3 -58
  62. package/dist/commonjs/components/NetworkIcons.d.ts +13 -0
  63. package/dist/commonjs/components/NetworkIcons.js +521 -1022
  64. package/dist/commonjs/components/QRCodeView.js +5 -79
  65. package/dist/commonjs/components/SectionHeader.js +15 -37
  66. package/dist/commonjs/components/SegmentedTabs.js +7 -62
  67. package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
  68. package/dist/commonjs/components/Slider.js +15 -243
  69. package/dist/commonjs/components/SourcePageCard.js +30 -89
  70. package/dist/commonjs/components/Toast.js +5 -147
  71. package/dist/commonjs/components/TouchableScale.js +3 -24
  72. package/dist/commonjs/components/TreeNode.js +55 -130
  73. package/dist/commonjs/console.js +1 -16
  74. package/dist/commonjs/constants/index.js +1 -32
  75. package/dist/commonjs/constants/telemetryConfig.js +1 -6
  76. package/dist/commonjs/constants/version.d.ts +1 -1
  77. package/dist/commonjs/constants/version.js +1 -4
  78. package/dist/commonjs/crash.js +1 -23
  79. package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
  80. package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
  81. package/dist/commonjs/customHooks/consoleLogger.js +6 -445
  82. package/dist/commonjs/customHooks/crashHandler.js +7 -656
  83. package/dist/commonjs/customHooks/logFilters.js +1 -23
  84. package/dist/commonjs/customHooks/networkLogger.js +2 -536
  85. package/dist/commonjs/customHooks/performanceTracker.js +63 -750
  86. package/dist/commonjs/customHooks/reduxLogger.js +2 -313
  87. package/dist/commonjs/customHooks/storageInspector.js +1 -435
  88. package/dist/commonjs/customHooks/useAccordion.js +1 -18
  89. package/dist/commonjs/decorators/index.js +1 -100
  90. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
  91. package/dist/commonjs/helpers/index.d.ts +1 -0
  92. package/dist/commonjs/helpers/index.js +8 -921
  93. package/dist/commonjs/helpers/memoryManager.js +1 -99
  94. package/dist/commonjs/helpers/qrGenerator.js +1 -367
  95. package/dist/commonjs/helpers/remoteConfig.js +1 -165
  96. package/dist/commonjs/helpers/searchQueryParser.js +1 -62
  97. package/dist/commonjs/helpers/settingsStore.js +1 -144
  98. package/dist/commonjs/helpers/telemetry.js +1 -501
  99. package/dist/commonjs/helpers/toast.js +1 -20
  100. package/dist/commonjs/i18n/index.js +1 -90
  101. package/dist/commonjs/i18n/locales/en.json +1 -1140
  102. package/dist/commonjs/index.js +5 -2168
  103. package/dist/commonjs/metro.js +6 -468
  104. package/dist/commonjs/native/NativeInspector.d.ts +1 -0
  105. package/dist/commonjs/native/NativeInspector.js +1 -415
  106. package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
  107. package/dist/commonjs/network.js +1 -13
  108. package/dist/commonjs/performance.js +1 -29
  109. package/dist/commonjs/redux.js +1 -20
  110. package/dist/commonjs/storage.js +1 -14
  111. package/dist/commonjs/styles/AppColors.js +1 -423
  112. package/dist/commonjs/styles/AppFonts.js +1 -17
  113. package/dist/commonjs/styles/common.js +1 -190
  114. package/dist/commonjs/styles/index.d.ts +6 -0
  115. package/dist/commonjs/styles/index.js +1 -1589
  116. package/dist/commonjs/types/enums.d.ts +0 -1
  117. package/dist/commonjs/types/enums.js +1 -152
  118. package/dist/commonjs/types/index.js +1 -18
  119. package/dist/commonjs/types/interfaces.d.ts +2 -2
  120. package/dist/commonjs/types/interfaces.js +1 -2
  121. package/dist/esm/analytics.js +1 -2
  122. package/dist/esm/bundle.js +1 -2
  123. package/dist/esm/capture.js +1 -32
  124. package/dist/esm/components/AnalyticsDetail.js +171 -664
  125. package/dist/esm/components/AnalyticsEventCard.js +77 -335
  126. package/dist/esm/components/AnalyticsGraph.js +95 -357
  127. package/dist/esm/components/AnimatedEntrance.js +1 -6
  128. package/dist/esm/components/AppHeaderLogo.js +7 -94
  129. package/dist/esm/components/BrandCircleIcon.js +114 -119
  130. package/dist/esm/components/BrandSquareIcon.js +73 -78
  131. package/dist/esm/components/CodeSnippet.js +58 -595
  132. package/dist/esm/components/ConsoleLogCard.js +91 -526
  133. package/dist/esm/components/CopyButton.js +3 -51
  134. package/dist/esm/components/DiffViewer.js +22 -48
  135. package/dist/esm/components/DomainHeader.js +43 -138
  136. package/dist/esm/components/EmptyState.js +17 -56
  137. package/dist/esm/components/EndOfListFooter.js +15 -83
  138. package/dist/esm/components/ErrorBoundary.js +125 -582
  139. package/dist/esm/components/HeadersSection.js +52 -93
  140. package/dist/esm/components/HighlightText.js +17 -53
  141. package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
  142. package/dist/esm/components/Inspector/AboutModal.js +243 -0
  143. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
  144. package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
  145. package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
  146. package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
  147. package/dist/esm/components/Inspector/CrashDetail.js +236 -747
  148. package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
  149. package/dist/esm/components/Inspector/CrashTab.js +177 -711
  150. package/dist/esm/components/Inspector/DebuggingTab.js +164 -925
  151. package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
  152. package/dist/esm/components/Inspector/FabLauncher.js +68 -454
  153. package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
  154. package/dist/esm/components/Inspector/InspectorContext.js +1 -12
  155. package/dist/esm/components/Inspector/InspectorHeader.js +282 -1163
  156. package/dist/esm/components/Inspector/LogDetail.js +235 -1023
  157. package/dist/esm/components/Inspector/MainScreen.js +78 -323
  158. package/dist/esm/components/Inspector/MediaGalleryTab.js +143 -650
  159. package/dist/esm/components/Inspector/MediaPreviewModal.js +138 -613
  160. package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
  161. package/dist/esm/components/Inspector/NetworkDetail.js +138 -455
  162. package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
  163. package/dist/esm/components/Inspector/NetworkTab.js +125 -517
  164. package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
  165. package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
  166. package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
  167. package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
  168. package/dist/esm/components/Inspector/ReduxTab.js +144 -722
  169. package/dist/esm/components/Inspector/SettingsPanel.js +643 -3985
  170. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
  171. package/dist/esm/components/Inspector/StorageTab.js +172 -866
  172. package/dist/esm/components/Inspector/TabBar.js +45 -305
  173. package/dist/esm/components/Inspector/UpdateAvailableModal.js +80 -418
  174. package/dist/esm/components/JsonViewer.js +179 -354
  175. package/dist/esm/components/LogCard.js +93 -565
  176. package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
  177. package/dist/esm/components/MetaAccordion.js +136 -267
  178. package/dist/esm/components/MiniBarChart.js +3 -18
  179. package/dist/esm/components/MiniLineChart.js +3 -20
  180. package/dist/esm/components/NetworkIcons.d.ts +13 -0
  181. package/dist/esm/components/NetworkIcons.js +523 -838
  182. package/dist/esm/components/QRCodeView.js +8 -45
  183. package/dist/esm/components/SectionHeader.js +22 -39
  184. package/dist/esm/components/SegmentedTabs.js +8 -58
  185. package/dist/esm/components/SkeletonPlaceholder.js +30 -163
  186. package/dist/esm/components/Slider.js +24 -213
  187. package/dist/esm/components/SourcePageCard.js +65 -86
  188. package/dist/esm/components/Toast.js +10 -117
  189. package/dist/esm/components/TouchableScale.js +3 -19
  190. package/dist/esm/components/TreeNode.js +58 -95
  191. package/dist/esm/console.js +1 -2
  192. package/dist/esm/constants/index.js +1 -28
  193. package/dist/esm/constants/telemetryConfig.js +1 -3
  194. package/dist/esm/constants/version.d.ts +1 -1
  195. package/dist/esm/constants/version.js +1 -1
  196. package/dist/esm/crash.js +1 -2
  197. package/dist/esm/customHooks/analyticsLogger.js +1 -230
  198. package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
  199. package/dist/esm/customHooks/consoleLogger.js +6 -432
  200. package/dist/esm/customHooks/crashHandler.js +7 -630
  201. package/dist/esm/customHooks/logFilters.js +1 -20
  202. package/dist/esm/customHooks/networkLogger.js +2 -519
  203. package/dist/esm/customHooks/performanceTracker.js +63 -723
  204. package/dist/esm/customHooks/reduxLogger.js +2 -293
  205. package/dist/esm/customHooks/storageInspector.js +1 -418
  206. package/dist/esm/customHooks/useAccordion.js +1 -16
  207. package/dist/esm/decorators/index.js +1 -95
  208. package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
  209. package/dist/esm/helpers/index.d.ts +1 -0
  210. package/dist/esm/helpers/index.js +8 -861
  211. package/dist/esm/helpers/memoryManager.js +1 -91
  212. package/dist/esm/helpers/qrGenerator.js +1 -364
  213. package/dist/esm/helpers/remoteConfig.js +1 -160
  214. package/dist/esm/helpers/searchQueryParser.js +1 -59
  215. package/dist/esm/helpers/settingsStore.js +1 -134
  216. package/dist/esm/helpers/telemetry.js +1 -489
  217. package/dist/esm/helpers/toast.js +1 -15
  218. package/dist/esm/i18n/index.js +1 -78
  219. package/dist/esm/i18n/locales/en.json +1 -1140
  220. package/dist/esm/index.js +7 -1982
  221. package/dist/esm/metro.js +6 -459
  222. package/dist/esm/native/NativeInspector.d.ts +1 -0
  223. package/dist/esm/native/NativeInspector.js +1 -382
  224. package/dist/esm/native/NativeNetworkInspector.js +1 -2
  225. package/dist/esm/network.js +1 -1
  226. package/dist/esm/performance.js +1 -2
  227. package/dist/esm/redux.js +1 -1
  228. package/dist/esm/storage.js +1 -1
  229. package/dist/esm/styles/AppColors.js +1 -417
  230. package/dist/esm/styles/AppFonts.js +1 -13
  231. package/dist/esm/styles/common.js +1 -186
  232. package/dist/esm/styles/index.d.ts +6 -0
  233. package/dist/esm/styles/index.js +1 -1551
  234. package/dist/esm/types/enums.d.ts +0 -1
  235. package/dist/esm/types/enums.js +1 -149
  236. package/dist/esm/types/index.js +1 -2
  237. package/dist/esm/types/interfaces.d.ts +2 -2
  238. package/dist/esm/types/interfaces.js +1 -1
  239. package/ios/NetworkInspectorModule.mm +60 -12
  240. package/package.json +5 -3
  241. package/src/native/NativeInspector.ts +18 -0
  242. package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +0 -7
  243. package/dist/commonjs/components/Inspector/FeedbackModal.js +0 -552
  244. package/dist/esm/components/Inspector/FeedbackModal.d.ts +0 -7
  245. package/dist/esm/components/Inspector/FeedbackModal.js +0 -515
  246. package/src/analytics.ts +0 -35
  247. package/src/bundle.ts +0 -25
  248. package/src/capture.ts +0 -109
  249. package/src/components/AnalyticsDetail.tsx +0 -870
  250. package/src/components/AnalyticsEventCard.tsx +0 -444
  251. package/src/components/AnalyticsGraph.tsx +0 -583
  252. package/src/components/AnimatedEntrance.tsx +0 -20
  253. package/src/components/AppHeaderLogo.tsx +0 -143
  254. package/src/components/BrandCircleIcon.tsx +0 -144
  255. package/src/components/BrandSquareIcon.tsx +0 -184
  256. package/src/components/CodeSnippet.tsx +0 -725
  257. package/src/components/ConsoleLogCard.tsx +0 -679
  258. package/src/components/CopyButton.tsx +0 -87
  259. package/src/components/DiffViewer.tsx +0 -82
  260. package/src/components/DomainHeader.tsx +0 -224
  261. package/src/components/EmptyState.tsx +0 -97
  262. package/src/components/EndOfListFooter.tsx +0 -100
  263. package/src/components/ErrorBoundary.tsx +0 -688
  264. package/src/components/HeadersSection.tsx +0 -172
  265. package/src/components/HighlightText.tsx +0 -100
  266. package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
  267. package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
  268. package/src/components/Inspector/BundleTab.tsx +0 -4768
  269. package/src/components/Inspector/ConsoleTab.tsx +0 -726
  270. package/src/components/Inspector/CrashDetail.tsx +0 -997
  271. package/src/components/Inspector/CrashFilterModal.tsx +0 -721
  272. package/src/components/Inspector/CrashTab.tsx +0 -933
  273. package/src/components/Inspector/DebuggingTab.tsx +0 -1103
  274. package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
  275. package/src/components/Inspector/FabLauncher.tsx +0 -590
  276. package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
  277. package/src/components/Inspector/FeedbackModal.tsx +0 -626
  278. package/src/components/Inspector/InspectorContext.tsx +0 -28
  279. package/src/components/Inspector/InspectorHeader.tsx +0 -1583
  280. package/src/components/Inspector/LogDetail.tsx +0 -1431
  281. package/src/components/Inspector/MainScreen.tsx +0 -460
  282. package/src/components/Inspector/MediaGalleryTab.tsx +0 -829
  283. package/src/components/Inspector/MediaPreviewModal.tsx +0 -783
  284. package/src/components/Inspector/NavigationTracker.tsx +0 -13
  285. package/src/components/Inspector/NetworkDetail.tsx +0 -778
  286. package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
  287. package/src/components/Inspector/NetworkTab.tsx +0 -820
  288. package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
  289. package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
  290. package/src/components/Inspector/PerformanceTab.tsx +0 -1967
  291. package/src/components/Inspector/ReduxDetail.tsx +0 -1651
  292. package/src/components/Inspector/ReduxTab.tsx +0 -987
  293. package/src/components/Inspector/SettingsPanel.tsx +0 -5136
  294. package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
  295. package/src/components/Inspector/StorageTab.tsx +0 -1159
  296. package/src/components/Inspector/TabBar.tsx +0 -431
  297. package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
  298. package/src/components/JsonViewer.tsx +0 -549
  299. package/src/components/LogCard.tsx +0 -694
  300. package/src/components/LogSyntaxHighlighter.tsx +0 -178
  301. package/src/components/MetaAccordion.tsx +0 -355
  302. package/src/components/MiniBarChart.tsx +0 -42
  303. package/src/components/MiniLineChart.tsx +0 -33
  304. package/src/components/NetworkIcons.tsx +0 -2655
  305. package/src/components/QRCodeView.tsx +0 -75
  306. package/src/components/SectionHeader.tsx +0 -101
  307. package/src/components/SegmentedTabs.tsx +0 -84
  308. package/src/components/SkeletonPlaceholder.tsx +0 -206
  309. package/src/components/Slider.tsx +0 -300
  310. package/src/components/SourcePageCard.tsx +0 -150
  311. package/src/components/Toast.tsx +0 -131
  312. package/src/components/TouchableScale.tsx +0 -61
  313. package/src/components/TreeNode.tsx +0 -171
  314. package/src/console.ts +0 -24
  315. package/src/constants/index.ts +0 -41
  316. package/src/constants/telemetryConfig.ts +0 -4
  317. package/src/constants/version.ts +0 -3
  318. package/src/crash.ts +0 -32
  319. package/src/customHooks/analyticsLogger.ts +0 -336
  320. package/src/customHooks/bundleAnalyzer.ts +0 -1256
  321. package/src/customHooks/consoleLogger.ts +0 -530
  322. package/src/customHooks/crashHandler.ts +0 -944
  323. package/src/customHooks/logFilters.ts +0 -32
  324. package/src/customHooks/networkLogger.ts +0 -624
  325. package/src/customHooks/performanceTracker.ts +0 -1014
  326. package/src/customHooks/reduxLogger.ts +0 -406
  327. package/src/customHooks/storageInspector.ts +0 -513
  328. package/src/customHooks/useAccordion.tsx +0 -27
  329. package/src/decorators/index.ts +0 -184
  330. package/src/helpers/gaAnalyticsRegistry.ts +0 -204
  331. package/src/helpers/index.ts +0 -1092
  332. package/src/helpers/memoryManager.ts +0 -138
  333. package/src/helpers/qrGenerator.ts +0 -430
  334. package/src/helpers/remoteConfig.ts +0 -212
  335. package/src/helpers/searchQueryParser.ts +0 -84
  336. package/src/helpers/settingsStore.ts +0 -171
  337. package/src/helpers/telemetry.ts +0 -568
  338. package/src/helpers/toast.ts +0 -17
  339. package/src/i18n/index.ts +0 -104
  340. package/src/i18n/locales/en.json +0 -1141
  341. package/src/index.tsx +0 -2650
  342. package/src/metro.ts +0 -598
  343. package/src/network.ts +0 -22
  344. package/src/performance.ts +0 -38
  345. package/src/redux.ts +0 -23
  346. package/src/storage.ts +0 -18
  347. package/src/styles/AppColors.ts +0 -455
  348. package/src/styles/AppFonts.ts +0 -26
  349. package/src/styles/common.ts +0 -209
  350. package/src/styles/index.ts +0 -1606
  351. package/src/types/enums.ts +0 -210
  352. package/src/types/index.ts +0 -34
  353. package/src/types/interfaces.ts +0 -535
@@ -1,987 +0,0 @@
1
- import React, {useCallback, useMemo, useRef, useState} from 'react';
2
- import {
3
- FlatList,
4
- Platform,
5
- Pressable,
6
- StyleSheet,
7
- Text,
8
- TextInput,
9
- TouchableOpacity,
10
- View,
11
- } from 'react-native';
12
- import {useTranslation} from '../../i18n';
13
- import {useInspector} from './InspectorContext';
14
- import TouchableScale from '../TouchableScale';
15
- import AnimatedEntrance from '../AnimatedEntrance';
16
- import EmptyState from '../EmptyState';
17
- import EndOfListFooter from '../EndOfListFooter';
18
- import HighlightText from '../HighlightText';
19
- import {getSize, openInVSCode} from '../../helpers';
20
- import styles from '../../styles';
21
- import {AppColors} from '../../styles/AppColors';
22
- import {AppFonts} from '../../styles/AppFonts';
23
- import {
24
- getActionHistory,
25
- getReduxAutoRefresh,
26
- setReduxAutoRefresh,
27
- } from '../../customHooks/reduxLogger';
28
- import {
29
- TerminalIcon,
30
- SearchIcon,
31
- ClearIcon,
32
- LayersIcon,
33
- ClockIcon,
34
- ForwardChevronIcon,
35
- SortArrowIcon,
36
- BoltIcon,
37
- AtomIcon,
38
- ScreenIcon,
39
- ListenerIcon,
40
- DocIcon,
41
- LoadingSpinnerIcon,
42
- CircleAlertIcon,
43
- TextAaIcon,
44
- StorageIcon,
45
- HeaderPauseIcon,
46
- ChevronIcon,
47
- } from '../NetworkIcons';
48
-
49
- interface ReduxSliceItem {
50
- id: string;
51
- name: string;
52
- keysCount: number;
53
- sizeStr: string;
54
- typeLabel: string;
55
- status: 'live' | 'loading' | 'error' | 'empty';
56
- statusMessage?: string;
57
- timelineCount: number;
58
- lastAction?: {
59
- type: string;
60
- timestamp: string;
61
- updatedAt: number;
62
- payloadPreview?: string;
63
- originType?: 'saga' | 'thunk' | 'ui' | 'direct' | 'listener';
64
- callerFile?: string;
65
- callerLine?: number;
66
- callerCol?: number;
67
- };
68
- updatedAt: number;
69
- }
70
-
71
- const getOriginBadge = (originType?: string) => {
72
- switch (originType) {
73
- case 'saga':
74
- return {
75
- label: 'SAGA',
76
- renderIcon: (color: string, size = 9) => <BoltIcon color={color} size={size} />,
77
- bg: AppColors.purple100,
78
- text: AppColors.brandPurple,
79
- border: AppColors.purple200,
80
- };
81
- case 'thunk':
82
- return {
83
- label: 'THUNK',
84
- renderIcon: (color: string, size = 9) => <AtomIcon color={color} size={size} />,
85
- bg: AppColors.amber100,
86
- text: AppColors.amber800Warm,
87
- border: AppColors.amber200,
88
- };
89
- case 'ui':
90
- return {
91
- label: 'UI',
92
- renderIcon: (color: string, size = 9) => <ScreenIcon color={color} size={size} />,
93
- bg: AppColors.sky100,
94
- text: AppColors.sky600,
95
- border: AppColors.sky400,
96
- };
97
- case 'listener':
98
- return {
99
- label: 'LISTENER',
100
- renderIcon: (color: string, size = 9) => <ListenerIcon color={color} size={size} />,
101
- bg: AppColors.teal100,
102
- text: AppColors.teal700,
103
- border: AppColors.teal400,
104
- };
105
- default:
106
- return {
107
- label: 'DIRECT',
108
- renderIcon: (color: string, size = 9) => <BoltIcon color={color} size={size} />,
109
- bg: AppColors.slate100,
110
- text: AppColors.slate700,
111
- border: AppColors.slate200,
112
- };
113
- }
114
- };
115
-
116
- const ReduxTab = React.memo(() => {
117
- const {t} = useTranslation();
118
- const {
119
- reduxState,
120
- reduxLastActionMap,
121
- reduxSearch,
122
- setReduxSearch,
123
- setSelectedReduxSlice,
124
- } = useInspector();
125
-
126
- const listRef = useRef<FlatList>(null);
127
-
128
- // Sort mode: 'latest' (newest updated first) vs 'alpha' (A-Z)
129
- const [sortMode, setSortMode] = useState<'latest' | 'alpha'>('latest');
130
-
131
- // Pause / Live Auto-Refresh State
132
- const [isReduxPaused, setIsReduxPaused] = useState<boolean>(
133
- !getReduxAutoRefresh(),
134
- );
135
-
136
- const handleTogglePause = useCallback(() => {
137
- setIsReduxPaused(prev => {
138
- const next = !prev;
139
- setReduxAutoRefresh(!next);
140
- return next;
141
- });
142
- }, []);
143
-
144
- // Total state size calculation
145
- const totalStateSize = useMemo(() => {
146
- return getSize(reduxState);
147
- }, [reduxState]);
148
-
149
- // Fetch full action history for timeline counts
150
- const allActions = useMemo(() => {
151
- return getActionHistory();
152
- }, [reduxLastActionMap]);
153
-
154
- // Compute slice items with exact timestamps & rich details
155
- const sliceItems: ReduxSliceItem[] = useMemo(() => {
156
- if (!reduxState || typeof reduxState !== 'object') return [];
157
- const keys = Object.keys(reduxState);
158
- return keys.map(key => {
159
- const sliceVal = reduxState[key];
160
- const isArray = Array.isArray(sliceVal);
161
- const isObject = sliceVal && typeof sliceVal === 'object';
162
-
163
- let typeLabel = 'Primitive';
164
- let keysCount = 0;
165
-
166
- if (isArray) {
167
- keysCount = sliceVal.length;
168
- typeLabel = `Array [${keysCount}]`;
169
- } else if (isObject) {
170
- keysCount = Object.keys(sliceVal).length;
171
- typeLabel = `Object {${keysCount}}`;
172
- } else if (typeof sliceVal !== 'undefined') {
173
- keysCount = 1;
174
- typeLabel = typeof sliceVal;
175
- }
176
-
177
- // Determine state status
178
- let status: 'live' | 'loading' | 'error' | 'empty' = 'live';
179
- let statusMessage: string | undefined;
180
-
181
- if (isObject) {
182
- if (
183
- sliceVal.loading === true ||
184
- sliceVal.isLoading === true ||
185
- sliceVal.status === 'loading' ||
186
- sliceVal.status === 'pending'
187
- ) {
188
- status = 'loading';
189
- statusMessage = 'Loading';
190
- } else if (
191
- sliceVal.error ||
192
- sliceVal.hasError ||
193
- sliceVal.status === 'error' ||
194
- sliceVal.status === 'failed'
195
- ) {
196
- status = 'error';
197
- statusMessage = typeof sliceVal.error === 'string' ? sliceVal.error : 'Error';
198
- } else if (keysCount === 0) {
199
- status = 'empty';
200
- statusMessage = 'Empty';
201
- }
202
- }
203
-
204
- const lastActionRaw = reduxLastActionMap[key];
205
- const updatedAt = lastActionRaw?.updatedAt || 0;
206
-
207
- // Count actions affecting this slice in timeline
208
- const timelineCount = allActions.filter(action => {
209
- if (!action.affectedSlices || action.affectedSlices.length === 0) return true;
210
- return action.affectedSlices.includes(key);
211
- }).length;
212
-
213
- let lastAction: ReduxSliceItem['lastAction'] = undefined;
214
- if (lastActionRaw) {
215
- let payloadPreview: string | undefined;
216
- if (lastActionRaw.payload !== undefined && lastActionRaw.payload !== null) {
217
- try {
218
- if (typeof lastActionRaw.payload === 'object') {
219
- const pKeys = Object.keys(lastActionRaw.payload);
220
- payloadPreview = `{ ${pKeys.slice(0, 3).join(', ')}${pKeys.length > 3 ? '...' : ''} }`;
221
- } else {
222
- payloadPreview = String(lastActionRaw.payload);
223
- }
224
- } catch {}
225
- }
226
-
227
- lastAction = {
228
- type: lastActionRaw.type,
229
- timestamp: lastActionRaw.timestamp,
230
- updatedAt: lastActionRaw.updatedAt,
231
- payloadPreview,
232
- originType: lastActionRaw.originType,
233
- callerFile: lastActionRaw.callerFile,
234
- callerLine: lastActionRaw.callerLine,
235
- callerCol: lastActionRaw.callerCol,
236
- };
237
- }
238
-
239
- return {
240
- id: `slice-${key}`,
241
- name: key,
242
- keysCount,
243
- sizeStr: getSize(sliceVal),
244
- typeLabel,
245
- status,
246
- statusMessage,
247
- timelineCount,
248
- lastAction,
249
- updatedAt,
250
- };
251
- });
252
- }, [reduxState, reduxLastActionMap, allActions]);
253
-
254
- // Filter & Sort slices: by default, the most recently updated item is at the FIRST position
255
- const filteredSlices = useMemo(() => {
256
- let list = sliceItems;
257
- if (reduxSearch && reduxSearch.trim().length > 0) {
258
- const queryTokens = reduxSearch.trim().toLowerCase().split(/\s+/).filter(Boolean);
259
- list = list.filter(item => {
260
- const sliceVal = reduxState ? reduxState[item.name] : null;
261
- const searchTarget = [
262
- item.name || '',
263
- item.lastAction?.type || '',
264
- item.lastAction?.payloadPreview || '',
265
- item.lastAction?.originType || '',
266
- item.status || '',
267
- item.statusMessage || '',
268
- sliceVal ? (typeof sliceVal === 'string' ? sliceVal : JSON.stringify(sliceVal)) : '',
269
- ].join(' ').toLowerCase();
270
-
271
- return queryTokens.every(tok => searchTarget.includes(tok));
272
- });
273
- }
274
-
275
- return [...list].sort((a, b) => {
276
- if (sortMode === 'latest') {
277
- // Most recently updated item first
278
- if (b.updatedAt !== a.updatedAt) {
279
- return b.updatedAt - a.updatedAt;
280
- }
281
- return a.name.localeCompare(b.name);
282
- }
283
- return a.name.localeCompare(b.name);
284
- });
285
- }, [sliceItems, reduxSearch, sortMode, reduxState]);
286
-
287
- const lastGlobalAction = useMemo(() => {
288
- const actions = Object.values(reduxLastActionMap);
289
- if (actions.length === 0) return null;
290
- return actions.reduce((latest, curr) => {
291
- if (!latest) return curr;
292
- return (curr.updatedAt || 0) > (latest.updatedAt || 0) ? curr : latest;
293
- }, null as any);
294
- }, [reduxLastActionMap]);
295
-
296
- const renderSliceItem = useCallback(
297
- ({item, index}: {item: ReduxSliceItem; index: number}) => {
298
- const isRecentlyUpdated =
299
- item.updatedAt > 0 && Date.now() - item.updatedAt < 5000;
300
-
301
- return (
302
- <AnimatedEntrance index={index} distance={8}>
303
- <TouchableScale
304
- onPress={() => {
305
- setSelectedReduxSlice(item.name);
306
- }}
307
- style={[
308
- reduxTabStyles.card,
309
- isRecentlyUpdated && reduxTabStyles.cardRecentlyUpdated,
310
- ]}>
311
- {/* Top row: Badge + Slice Name + Status + Timestamp + Chevron */}
312
- <View style={reduxTabStyles.cardHeader}>
313
- <View style={reduxTabStyles.sliceBadge}>
314
- <Text style={reduxTabStyles.sliceBadgeText}>SLICE</Text>
315
- </View>
316
-
317
- <HighlightText
318
- text={item.name}
319
- search={reduxSearch}
320
- style={reduxTabStyles.sliceName}
321
- highlightStyle={reduxTabStyles.highlight}
322
- />
323
-
324
- {/* Status Badge */}
325
- {item.status === 'loading' ? (
326
- <View style={reduxTabStyles.loadingPill}>
327
- <LoadingSpinnerIcon color={AppColors.amber800Warm} size={10} />
328
- <Text style={reduxTabStyles.loadingPillText}>Loading</Text>
329
- </View>
330
- ) : item.status === 'error' ? (
331
- <View style={reduxTabStyles.errorPill}>
332
- <CircleAlertIcon color={AppColors.red600} size={10} />
333
- <Text style={reduxTabStyles.errorPillText}>Error</Text>
334
- </View>
335
- ) : item.status === 'empty' ? (
336
- <View style={reduxTabStyles.emptyPill}>
337
- <Text style={reduxTabStyles.emptyPillText}>Empty</Text>
338
- </View>
339
- ) : (
340
- <View style={reduxTabStyles.livePill}>
341
- <View style={reduxTabStyles.liveDot} />
342
- <Text style={reduxTabStyles.livePillText}>Live</Text>
343
- </View>
344
- )}
345
-
346
- {item.lastAction?.timestamp && (
347
- <View style={reduxTabStyles.timePill}>
348
- <ClockIcon color={AppColors.purple} size={10} />
349
- <Text style={reduxTabStyles.timeText}>
350
- {item.lastAction.timestamp}
351
- </Text>
352
- </View>
353
- )}
354
-
355
- <ForwardChevronIcon color={AppColors.grayTextWeak} size={13} />
356
- </View>
357
-
358
- {/* Middle row: Stats pills */}
359
- <View style={reduxTabStyles.statsRow}>
360
- <View style={reduxTabStyles.pill}>
361
- <LayersIcon color={AppColors.grayTextWeak} size={11} />
362
- <Text style={reduxTabStyles.pillValue}>{item.typeLabel}</Text>
363
- </View>
364
- <View style={reduxTabStyles.pill}>
365
- <Text style={reduxTabStyles.pillLabel}>Size:</Text>
366
- <Text style={reduxTabStyles.pillValue}>{item.sizeStr}</Text>
367
- </View>
368
- {item.timelineCount > 0 && (
369
- <View style={reduxTabStyles.pill}>
370
- <Text style={reduxTabStyles.pillLabel}>Actions:</Text>
371
- <Text style={reduxTabStyles.pillValue}>{item.timelineCount}</Text>
372
- </View>
373
- )}
374
- </View>
375
-
376
- {/* Bottom row: Last Dispatched Action with Origin & Trigger Line */}
377
- {item.lastAction && (
378
- <View style={reduxTabStyles.lastActionRow}>
379
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 5, flex: 1, minWidth: 0, flexWrap: 'wrap'}}>
380
- <BoltIcon color={AppColors.brandPurple} size={12} />
381
- <Text style={reduxTabStyles.lastActionLabel}>{t('redux.last', 'Last')}:</Text>
382
-
383
- {/* Origin Badge */}
384
- {item.lastAction.originType && (() => {
385
- const origin = getOriginBadge(item.lastAction.originType);
386
- return (
387
- <View
388
- style={{
389
- flexDirection: 'row',
390
- alignItems: 'center',
391
- gap: 2.5,
392
- backgroundColor: origin.bg,
393
- paddingHorizontal: 4.5,
394
- paddingVertical: 1.5,
395
- borderRadius: 3.5,
396
- borderWidth: 1,
397
- borderColor: origin.border,
398
- }}>
399
- {origin.renderIcon(origin.text, 8.5)}
400
- <Text
401
- style={{
402
- fontFamily: AppFonts.interBold,
403
- fontSize: 8,
404
- color: origin.text,
405
- letterSpacing: 0.3,
406
- }}>
407
- {origin.label}
408
- </Text>
409
- </View>
410
- );
411
- })()}
412
-
413
- <HighlightText
414
- text={item.lastAction.type}
415
- search={reduxSearch}
416
- style={reduxTabStyles.lastActionValue}
417
- highlightStyle={reduxTabStyles.highlight}
418
- numberOfLines={1}
419
- />
420
-
421
- {/* Triggered from file preview */}
422
- {item.lastAction.callerFile && (
423
- <Pressable
424
- onPress={() =>
425
- openInVSCode(
426
- item.lastAction!.callerFile!,
427
- item.lastAction!.callerLine,
428
- item.lastAction!.callerCol,
429
- )
430
- }
431
- hitSlop={6}
432
- style={{
433
- flexDirection: 'row',
434
- alignItems: 'center',
435
- gap: 2.5,
436
- backgroundColor: AppColors.sky100,
437
- paddingHorizontal: 4.5,
438
- paddingVertical: 1.5,
439
- borderRadius: 3,
440
- borderWidth: 0.5,
441
- borderColor: AppColors.sky400,
442
- }}>
443
- <DocIcon color={AppColors.sky600} size={9} />
444
- <Text
445
- style={{
446
- fontFamily: AppFonts.interMedium,
447
- fontSize: 8.5,
448
- color: AppColors.sky600,
449
- }}>
450
- {item.lastAction.callerFile.split('/').pop()}:{item.lastAction.callerLine || 1}
451
- </Text>
452
- </Pressable>
453
- )}
454
-
455
- {item.lastAction.payloadPreview && (
456
- <Text style={reduxTabStyles.payloadPreviewText} numberOfLines={1}>
457
- {item.lastAction.payloadPreview}
458
- </Text>
459
- )}
460
- </View>
461
- </View>
462
- )}
463
- </TouchableScale>
464
- </AnimatedEntrance>
465
- );
466
- },
467
- [reduxSearch, setSelectedReduxSlice, t],
468
- );
469
-
470
- if (!reduxState) {
471
- return (
472
- <View style={styles.emptyContainer}>
473
- <View style={styles.emptyIconWrap}>
474
- <TerminalIcon color={AppColors.purple} size={32} />
475
- </View>
476
- <Text style={styles.emptyTitle}>No Redux Store Connected</Text>
477
- <Text style={styles.emptySub}>
478
- Call connectReduxStore(store) or use inspectorReduxMiddleware at app initialization.
479
- </Text>
480
- </View>
481
- );
482
- }
483
-
484
- return (
485
- <View style={{flex: 1, backgroundColor: AppColors.grayBackground}}>
486
- {/* ─── Top Stats Overview Card ─── */}
487
- <View style={reduxTabStyles.overviewCard}>
488
- <View style={reduxTabStyles.statCol}>
489
- <Text style={reduxTabStyles.statHeading}>ACTIVE SLICES</Text>
490
- <Text style={reduxTabStyles.statBigVal}>{sliceItems.length}</Text>
491
- </View>
492
- <View style={reduxTabStyles.statDivider} />
493
- <View style={reduxTabStyles.statCol}>
494
- <Text style={reduxTabStyles.statHeading}>TOTAL STATE</Text>
495
- <Text style={reduxTabStyles.statBigVal}>{totalStateSize}</Text>
496
- </View>
497
- <View style={reduxTabStyles.statDivider} />
498
- <View style={[reduxTabStyles.statCol, {flex: 1.6}]}>
499
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
500
- <Text style={reduxTabStyles.statHeading}>LAST ACTION</Text>
501
- {lastGlobalAction?.originType && (() => {
502
- const origin = getOriginBadge(lastGlobalAction.originType);
503
- return (
504
- <View
505
- style={{
506
- flexDirection: 'row',
507
- alignItems: 'center',
508
- gap: 2,
509
- backgroundColor: origin.bg,
510
- paddingHorizontal: 4,
511
- paddingVertical: 1,
512
- borderRadius: 3,
513
- }}>
514
- {origin.renderIcon(origin.text, 8)}
515
- <Text
516
- style={{
517
- fontFamily: AppFonts.interBold,
518
- fontSize: 7.5,
519
- color: origin.text,
520
- }}>
521
- {origin.label}
522
- </Text>
523
- </View>
524
- );
525
- })()}
526
- </View>
527
- <Text style={reduxTabStyles.statLastAction} numberOfLines={1}>
528
- {lastGlobalAction ? lastGlobalAction.type : 'Initial'}
529
- </Text>
530
- {lastGlobalAction?.timestamp && (
531
- <Text style={reduxTabStyles.statLastTime}>
532
- {lastGlobalAction.timestamp}
533
- </Text>
534
- )}
535
- </View>
536
- </View>
537
-
538
- {/* ─── Search & Sort Bar ─── */}
539
- <View style={reduxTabStyles.toolbarContainer}>
540
- <View style={reduxTabStyles.searchRow}>
541
- <View style={styles.searchContainer}>
542
- <SearchIcon color={AppColors.grayTextWeak} size={15} />
543
- <TextInput
544
- accessible={true}
545
- accessibilityRole="search"
546
- accessibilityLabel="Search Redux slices or actions"
547
- accessibilityHint="Type to filter state slices in real time"
548
- placeholder="Search Redux slices or actions..."
549
- placeholderTextColor={AppColors.grayTextWeak}
550
- value={reduxSearch}
551
- onChangeText={setReduxSearch}
552
- style={styles.searchInput}
553
- autoCorrect={false}
554
- autoCapitalize="none"
555
- />
556
- {reduxSearch.length > 0 && (
557
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
558
- <View
559
- style={{
560
- backgroundColor: `${AppColors.purple}20`,
561
- borderRadius: 10,
562
- paddingHorizontal: 6,
563
- paddingVertical: 1.5,
564
- }}>
565
- <Text
566
- style={{
567
- color: AppColors.purple,
568
- fontSize: 9.5,
569
- fontFamily: AppFonts.interBold,
570
- }}>
571
- {filteredSlices.length}
572
- </Text>
573
- </View>
574
- <Pressable
575
- accessible={true}
576
- accessibilityRole="button"
577
- accessibilityLabel="Clear search input"
578
- onPress={() => setReduxSearch('')}
579
- hitSlop={10}>
580
- <ClearIcon color={AppColors.grayTextWeak} size={14} />
581
- </Pressable>
582
- </View>
583
- )}
584
- </View>
585
-
586
- {/* Pause / Resume Live Updates Button */}
587
- <TouchableOpacity
588
- accessible={true}
589
- accessibilityRole="button"
590
- accessibilityLabel={
591
- isReduxPaused
592
- ? 'Resume live Redux updates'
593
- : 'Pause live Redux updates'
594
- }
595
- accessibilityHint="Toggles automatic recording of Redux state updates"
596
- style={[
597
- styles.toolbarBtn,
598
- isReduxPaused && {
599
- backgroundColor: `${AppColors.darkOrange}1F`,
600
- borderColor: AppColors.darkOrange,
601
- },
602
- ]}
603
- onPress={handleTogglePause}
604
- hitSlop={6}>
605
- <HeaderPauseIcon
606
- isPaused={isReduxPaused}
607
- color={
608
- isReduxPaused
609
- ? AppColors.darkOrange
610
- : AppColors.grayTextStrong
611
- }
612
- size={16}
613
- />
614
- </TouchableOpacity>
615
-
616
- {/* Sort Button */}
617
- <TouchableOpacity
618
- accessible={true}
619
- accessibilityRole="button"
620
- accessibilityLabel={`Sort order: ${
621
- sortMode === 'latest'
622
- ? 'Recently updated first'
623
- : 'Alphabetical A to Z'
624
- }`}
625
- accessibilityHint="Switches sorting between recently updated and alphabetical"
626
- style={[
627
- styles.toolbarBtn,
628
- sortMode === 'latest' && {backgroundColor: `${AppColors.brandPurple}1F`, borderColor: AppColors.brandPurple},
629
- ]}
630
- onPress={() => setSortMode(prev => (prev === 'latest' ? 'alpha' : 'latest'))}
631
- hitSlop={6}>
632
- <SortArrowIcon
633
- color={sortMode === 'latest' ? AppColors.brandPurple : AppColors.grayTextStrong}
634
- size={16}
635
- />
636
- </TouchableOpacity>
637
- </View>
638
-
639
- <View style={reduxTabStyles.headerSubRow}>
640
- <Text style={reduxTabStyles.resultCount}>
641
- Showing {filteredSlices.length} of {sliceItems.length} state slices
642
- </Text>
643
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 8}}>
644
- {isReduxPaused && (
645
- <View style={reduxTabStyles.pausedBannerPill}>
646
- <Text style={reduxTabStyles.pausedBannerText}>PAUSED</Text>
647
- </View>
648
- )}
649
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
650
- {sortMode === 'latest' ? (
651
- <BoltIcon color={AppColors.brandPurple} size={11} />
652
- ) : (
653
- <TextAaIcon color={AppColors.brandPurple} size={11} />
654
- )}
655
- <Text style={reduxTabStyles.sortLabel}>
656
- {sortMode === 'latest' ? 'Newest Updates First' : 'Alphabetical (A-Z)'}
657
- </Text>
658
- </View>
659
- </View>
660
- </View>
661
- </View>
662
-
663
- {/* ─── FlatList of Slices ─── */}
664
- <FlatList
665
- ref={listRef}
666
- data={filteredSlices}
667
- keyExtractor={item => item.id}
668
- renderItem={renderSliceItem}
669
- initialNumToRender={12}
670
- maxToRenderPerBatch={8}
671
- windowSize={5}
672
- removeClippedSubviews={Platform.OS === 'android'}
673
- renderToHardwareTextureAndroid={true}
674
- ListEmptyComponent={
675
- <EmptyState
676
- isSearch={reduxSearch.trim().length > 0}
677
- searchQuery={reduxSearch}
678
- onClearSearch={() => setReduxSearch('')}
679
- customTitle={reduxSearch.trim().length > 0 ? 'No Matching Slices' : 'No Redux State Detected'}
680
- customSub={
681
- reduxSearch.trim().length > 0
682
- ? `No Redux slices match "${reduxSearch}"`
683
- : 'Attach the Redux store or dispatch actions to see state slices.'
684
- }
685
- />
686
- }
687
- ListFooterComponent={
688
- filteredSlices.length > 0 ? (
689
- <EndOfListFooter
690
- count={filteredSlices.length}
691
- label="slices"
692
- />
693
- ) : null
694
- }
695
- contentContainerStyle={[
696
- reduxTabStyles.listContent,
697
- filteredSlices.length === 0 && {flexGrow: 1},
698
- ]}
699
- keyboardShouldPersistTaps="handled"
700
- />
701
- </View>
702
- );
703
- });
704
-
705
- const reduxTabStyles = StyleSheet.create({
706
- overviewCard: {
707
- flexDirection: 'row',
708
- alignItems: 'center',
709
- backgroundColor: AppColors.white,
710
- marginHorizontal: 12,
711
- marginTop: 10,
712
- borderRadius: 12,
713
- padding: 12,
714
- borderWidth: 1,
715
- borderColor: AppColors.dividerColor,
716
- shadowColor: AppColors.primaryBlack,
717
- shadowOffset: {width: 0, height: 1},
718
- shadowOpacity: 0.03,
719
- shadowRadius: 3,
720
- elevation: 1,
721
- },
722
- statCol: {
723
- flex: 1,
724
- },
725
- statDivider: {
726
- width: 1,
727
- height: 28,
728
- backgroundColor: AppColors.dividerColor,
729
- marginHorizontal: 8,
730
- },
731
- statHeading: {
732
- fontFamily: AppFonts.interBold,
733
- fontSize: 9,
734
- color: AppColors.grayTextWeak,
735
- letterSpacing: 0.5,
736
- },
737
- statBigVal: {
738
- fontFamily: AppFonts.interBold,
739
- fontSize: 14,
740
- color: AppColors.primaryBlack,
741
- marginTop: 2,
742
- },
743
- statLastAction: {
744
- fontFamily: AppFonts.interBold,
745
- fontSize: 11,
746
- color: AppColors.purple,
747
- marginTop: 2,
748
- },
749
- statLastTime: {
750
- fontFamily: AppFonts.interRegular,
751
- fontSize: 9.5,
752
- color: AppColors.grayTextWeak,
753
- },
754
- toolbarContainer: {
755
- backgroundColor: AppColors.white,
756
- borderBottomWidth: 1,
757
- borderBottomColor: AppColors.dividerColor,
758
- paddingHorizontal: 12,
759
- paddingTop: 8,
760
- paddingBottom: 6,
761
- marginTop: 8,
762
- },
763
- searchRow: {
764
- flexDirection: 'row',
765
- alignItems: 'center',
766
- gap: 8,
767
- },
768
- headerSubRow: {
769
- flexDirection: 'row',
770
- justifyContent: 'space-between',
771
- alignItems: 'center',
772
- marginTop: 6,
773
- paddingHorizontal: 2,
774
- },
775
- resultCount: {
776
- fontFamily: AppFonts.interMedium,
777
- fontSize: 11,
778
- color: AppColors.grayTextWeak,
779
- },
780
- sortLabel: {
781
- fontFamily: AppFonts.interMedium,
782
- fontSize: 10.5,
783
- color: AppColors.brandPurple,
784
- },
785
- listContent: {
786
- padding: 12,
787
- paddingBottom: 36,
788
- },
789
- card: {
790
- backgroundColor: AppColors.white,
791
- borderRadius: 12,
792
- padding: 12,
793
- marginBottom: 10,
794
- borderWidth: 1,
795
- borderColor: AppColors.dividerColor,
796
- shadowColor: AppColors.primaryBlack,
797
- shadowOffset: {width: 0, height: 1},
798
- shadowOpacity: 0.04,
799
- shadowRadius: 4,
800
- elevation: 2,
801
- },
802
- cardRecentlyUpdated: {
803
- borderColor: `${AppColors.brandPurple}66`,
804
- backgroundColor: AppColors.purpleTintBg,
805
- },
806
- cardHeader: {
807
- flexDirection: 'row',
808
- alignItems: 'center',
809
- gap: 8,
810
- marginBottom: 8,
811
- },
812
- sliceBadge: {
813
- backgroundColor: AppColors.violetSoftBg,
814
- paddingHorizontal: 6,
815
- paddingVertical: 3,
816
- borderRadius: 5,
817
- borderWidth: 1,
818
- borderColor: AppColors.violetSoftBorder,
819
- },
820
- sliceBadgeText: {
821
- fontFamily: AppFonts.interBold,
822
- fontSize: 9.5,
823
- color: AppColors.purple700,
824
- letterSpacing: 0.4,
825
- },
826
- sliceName: {
827
- flex: 1,
828
- fontFamily: AppFonts.interBold,
829
- fontSize: 13.5,
830
- color: AppColors.primaryBlack,
831
- },
832
- timePill: {
833
- flexDirection: 'row',
834
- alignItems: 'center',
835
- gap: 3,
836
- backgroundColor: `${AppColors.purple}14`,
837
- paddingHorizontal: 6,
838
- paddingVertical: 2,
839
- borderRadius: 4,
840
- borderWidth: 1,
841
- borderColor: `${AppColors.purple}2E`,
842
- },
843
- timeText: {
844
- fontFamily: AppFonts.interMedium,
845
- fontSize: 10,
846
- color: AppColors.purple,
847
- },
848
- statsRow: {
849
- flexDirection: 'row',
850
- alignItems: 'center',
851
- gap: 6,
852
- flexWrap: 'wrap',
853
- marginBottom: 6,
854
- },
855
- pill: {
856
- flexDirection: 'row',
857
- alignItems: 'center',
858
- gap: 4,
859
- backgroundColor: AppColors.grayBackground,
860
- paddingHorizontal: 7,
861
- paddingVertical: 3,
862
- borderRadius: 5,
863
- borderWidth: 1,
864
- borderColor: AppColors.dividerColor,
865
- },
866
- pillLabel: {
867
- fontFamily: AppFonts.interMedium,
868
- fontSize: 10.5,
869
- color: AppColors.grayTextWeak,
870
- },
871
- pillValue: {
872
- fontFamily: AppFonts.interBold,
873
- fontSize: 10.5,
874
- color: AppColors.primaryBlack,
875
- },
876
- livePill: {
877
- flexDirection: 'row',
878
- alignItems: 'center',
879
- gap: 4,
880
- backgroundColor: AppColors.emeraldBg,
881
- paddingHorizontal: 6,
882
- paddingVertical: 3,
883
- borderRadius: 5,
884
- borderWidth: 1,
885
- borderColor: AppColors.emeraldBorder,
886
- },
887
- liveDot: {
888
- width: 6,
889
- height: 6,
890
- borderRadius: 3,
891
- backgroundColor: AppColors.emerald500,
892
- },
893
- livePillText: {
894
- fontFamily: AppFonts.interBold,
895
- fontSize: 10,
896
- color: AppColors.emerald700,
897
- },
898
- loadingPill: {
899
- backgroundColor: AppColors.amber100,
900
- paddingHorizontal: 6,
901
- paddingVertical: 3,
902
- borderRadius: 5,
903
- borderWidth: 1,
904
- borderColor: AppColors.amber200,
905
- },
906
- loadingPillText: {
907
- fontFamily: AppFonts.interBold,
908
- fontSize: 9.5,
909
- color: AppColors.amber800Warm,
910
- },
911
- errorPill: {
912
- backgroundColor: AppColors.red100,
913
- paddingHorizontal: 6,
914
- paddingVertical: 3,
915
- borderRadius: 5,
916
- borderWidth: 1,
917
- borderColor: AppColors.errorBorder,
918
- },
919
- errorPillText: {
920
- fontFamily: AppFonts.interBold,
921
- fontSize: 9.5,
922
- color: AppColors.red600,
923
- },
924
- emptyPill: {
925
- backgroundColor: AppColors.grayBackground,
926
- paddingHorizontal: 6,
927
- paddingVertical: 3,
928
- borderRadius: 5,
929
- borderWidth: 1,
930
- borderColor: AppColors.dividerColor,
931
- },
932
- emptyPillText: {
933
- fontFamily: AppFonts.interMedium,
934
- fontSize: 9.5,
935
- color: AppColors.grayTextWeak,
936
- },
937
- lastActionRow: {
938
- flexDirection: 'row',
939
- alignItems: 'center',
940
- gap: 5,
941
- backgroundColor: AppColors.grayBackground,
942
- borderRadius: 6,
943
- paddingHorizontal: 8,
944
- paddingVertical: 5,
945
- marginTop: 4,
946
- borderWidth: 1,
947
- borderColor: AppColors.dividerColor,
948
- },
949
- lastActionLabel: {
950
- fontFamily: AppFonts.interMedium,
951
- fontSize: 10.5,
952
- color: AppColors.grayTextWeak,
953
- },
954
- lastActionValue: {
955
- fontFamily: AppFonts.interBold,
956
- fontSize: 11,
957
- color: AppColors.primaryBlack,
958
- },
959
- payloadPreviewText: {
960
- flex: 1,
961
- fontFamily: AppFonts.interRegular,
962
- fontSize: 10,
963
- color: AppColors.grayTextWeak,
964
- marginLeft: 4,
965
- },
966
- highlight: {
967
- backgroundColor: AppColors.yellow200,
968
- color: AppColors.yellow800,
969
- fontFamily: AppFonts.interBold,
970
- },
971
- pausedBannerPill: {
972
- backgroundColor: AppColors.amber100,
973
- paddingHorizontal: 6,
974
- paddingVertical: 2,
975
- borderRadius: 4,
976
- borderWidth: 1,
977
- borderColor: AppColors.amber200,
978
- },
979
- pausedBannerText: {
980
- fontFamily: AppFonts.interBold,
981
- fontSize: 9,
982
- color: AppColors.amber800Warm,
983
- letterSpacing: 0.5,
984
- },
985
- });
986
-
987
- export default ReduxTab;