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,672 +1,165 @@
1
- import React, { useState, useEffect, useMemo, useCallback } from 'react';
2
- import { Alert, Dimensions, FlatList, Image, RefreshControl, StyleSheet, Text, TouchableOpacity, View, } from 'react-native';
3
- import { AppColors } from '../../styles/AppColors';
4
- import { AppFonts } from '../../styles/AppFonts';
5
- import TouchableScale from '../TouchableScale';
6
- import EmptyState from '../EmptyState';
7
- import { CheckIcon, FilmIcon, GifIcon, GridIcon, ImageIcon, ListIcon, PlayIcon, ScreencastIcon, TrashIcon, } from '../NetworkIcons';
8
- import { MediaPreviewModal } from './MediaPreviewModal';
9
- import { ScreenCapture, } from '../../capture';
10
- import { formatBytes } from '../../helpers';
11
- import { showToast } from '../../helpers/toast';
12
- import { useTranslation } from '../../i18n';
13
- import { useInspector } from './InspectorContext';
14
- export const MediaGalleryTab = () => {
15
- const { t } = useTranslation();
16
- const { refreshMediaCount, switchActiveTab } = useInspector();
17
- const [mediaList, setMediaList] = useState([]);
18
- const [refreshing, setRefreshing] = useState(false);
19
- const [selectedFilter, setSelectedFilter] = useState('all');
20
- const [selectedItem, setSelectedItem] = useState(null);
21
- const [selectedIds, setSelectedIds] = useState(new Set());
22
- const [viewMode, setViewMode] = useState('grid');
23
- const loadMedia = useCallback(async () => {
24
- try {
25
- const items = await ScreenCapture.getMediaList();
26
- setMediaList(items);
27
- refreshMediaCount?.().catch(() => { });
28
- }
29
- catch {
30
- setMediaList([]);
31
- }
32
- }, [refreshMediaCount]);
33
- useEffect(() => {
34
- loadMedia();
35
- }, [loadMedia]);
36
- const onRefresh = async () => {
37
- setRefreshing(true);
38
- await loadMedia();
39
- setRefreshing(false);
40
- };
41
- const filteredMedia = useMemo(() => {
42
- if (selectedFilter === 'all')
43
- return mediaList;
44
- return mediaList.filter(item => item.type === selectedFilter);
45
- }, [mediaList, selectedFilter]);
46
- const totalStorageBytes = useMemo(() => {
47
- return mediaList.reduce((sum, item) => sum + (item.sizeBytes || 0), 0);
48
- }, [mediaList]);
49
- const toggleSelect = useCallback((id) => {
50
- setSelectedIds(prev => {
51
- const next = new Set(prev);
52
- if (next.has(id)) {
53
- next.delete(id);
54
- }
55
- else {
56
- next.add(id);
57
- }
58
- return next;
59
- });
60
- }, []);
61
- const handleDeleteItem = async (item) => {
62
- await ScreenCapture.deleteMedia(item.uri);
63
- setSelectedIds(prev => {
64
- const next = new Set(prev);
65
- next.delete(item.id);
66
- return next;
67
- });
68
- await loadMedia();
69
- const count = await refreshMediaCount?.();
70
- if (count === 0) {
71
- switchActiveTab('apis');
72
- }
73
- showToast(t('mediaGallery.deleted'));
74
- };
75
- const handleDeleteSelected = () => {
76
- const count = selectedIds.size;
77
- if (count === 0)
78
- return;
79
- Alert.alert(t('mediaGallery.deleteSelectedTitle'), t('mediaGallery.deleteSelectedMessage', { count }), [
80
- { text: t('common.cancel'), style: 'cancel' },
81
- {
82
- text: t('mediaGallery.delete'),
83
- style: 'destructive',
84
- onPress: async () => {
85
- const itemsToDelete = mediaList.filter(item => selectedIds.has(item.id));
86
- for (const item of itemsToDelete) {
87
- await ScreenCapture.deleteMedia(item.uri);
88
- }
89
- setSelectedIds(new Set());
90
- await loadMedia();
91
- const remainingCount = await refreshMediaCount?.();
92
- if (remainingCount === 0) {
93
- switchActiveTab('apis');
94
- }
95
- showToast(t('mediaGallery.deletedCount', { count: itemsToDelete.length }));
96
- },
97
- },
98
- ]);
99
- };
100
- const handleClearAll = () => {
101
- Alert.alert(t('mediaGallery.purgeTitle'), t('mediaGallery.purgeMessage', { count: mediaList.length, size: formatBytes(totalStorageBytes) }), [
102
- { text: t('common.cancel'), style: 'cancel' },
103
- {
104
- text: t('common.clearAll'),
105
- style: 'destructive',
106
- onPress: async () => {
107
- await ScreenCapture.clearAllMedia();
108
- setSelectedIds(new Set());
109
- await loadMedia();
110
- await refreshMediaCount?.();
111
- switchActiveTab('apis');
112
- showToast(t('mediaGallery.allPurged'));
113
- },
114
- },
115
- ]);
116
- };
117
- const handleConvertToGif = async (item) => {
118
- const gifResult = await ScreenCapture.convertToGif(item.uri, { fps: 12, width: 480 });
119
- if (gifResult) {
120
- await loadMedia();
121
- refreshMediaCount?.().catch(() => { });
122
- }
123
- };
124
- const renderFilterIcon = (filterKey, isActive) => {
125
- const iconColor = isActive ? AppColors.sky400 : AppColors.slate400;
126
- const iconSize = 12;
127
- switch (filterKey) {
128
- case 'all':
129
- return <ScreencastIcon size={iconSize} color={iconColor}/>;
130
- case 'image':
131
- return <ImageIcon size={iconSize} color={iconColor}/>;
132
- case 'video':
133
- return <FilmIcon size={iconSize} color={iconColor}/>;
134
- case 'gif':
135
- return <GifIcon size={iconSize} color={iconColor}/>;
136
- }
137
- };
138
- const renderGridItem = ({ item }) => {
139
- const isVideo = item.type === 'video';
140
- const isGif = item.type === 'gif';
141
- const thumbUri = isVideo ? item.thumbnailUri : item.uri;
142
- const isSelected = selectedIds.has(item.id);
143
- return (<TouchableScale onPress={() => setSelectedItem(item)} style={[galleryStyles.card, isSelected && galleryStyles.cardSelected]}>
144
- <View style={galleryStyles.thumbnailContainer}>
145
- {thumbUri ? (<Image source={{ uri: thumbUri }} style={galleryStyles.thumbnail} resizeMode="cover"/>) : (<View style={galleryStyles.thumbnailFallback}>
146
- {isVideo ? (<FilmIcon size={26} color={AppColors.sky400}/>) : (<ImageIcon size={26} color={AppColors.slate400}/>)}
147
- </View>)}
1
+ import{useState as W,useEffect as He,useMemo as te,useCallback as oe}from"react";import{Alert as ie,Dimensions as je,FlatList as Ee,Image as Ce,RefreshControl as _e,Share as Te,StyleSheet as Ne,Text as S,TouchableOpacity as I,View as C}from"react-native";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import Se from"../TouchableScale";import Je from"../EmptyState";import{CheckIcon as Ie,CopyIcon as E,FilmIcon as $,GifIcon as _,GridIcon as Qe,ImageIcon as F,ListIcon as Xe,PlayIcon as Be,ScreencastIcon as Ye,ShareIcon as Re,TrashIcon as N}from"../NetworkIcons";import{MediaPreviewModal as Ze}from"./MediaPreviewModal";import{ScreenCapture as P}from"../../capture";import{copyImageOrMediaToClipboard as Ke,copyToClipboard as et,formatBytes as U}from"../../helpers";import{showToast as A}from"../../helpers/toast";import{useTranslation as tt}from"../../i18n";import{useInspector as ot}from"./InspectorContext";export const MediaGalleryTab=()=>{const{t:r}=tt(),{refreshMediaCount:V,switchActiveTab:H}=ot(),[x,q]=W([]),[Ge,J]=W(!1),[O,Me]=W("all"),[Q,j]=W(null),[v,L]=W(new Set),[R,X]=W("grid"),M=oe(async()=>{try{const t=await P.getMediaList();q(t),V?.().catch(()=>{})}catch{q([])}},[V]);He(()=>{M()},[M]);const De=async()=>{J(!0),await M(),J(!1)},G=te(()=>O==="all"?x:x.filter(t=>t.type===O),[x,O]),Y=te(()=>x.reduce((t,i)=>t+(i.sizeBytes||0),0),[x]),Z=oe(t=>{L(i=>{const l=new Set(i);return l.has(t)?l.delete(t):l.add(t),l})},[]),K=async t=>{await P.deleteMedia(t.uri),L(l=>{const T=new Set(l);return T.delete(t.id),T}),await M(),await V?.()===0&&H("apis"),A(r("mediaGallery.deleted"))},ee=t=>{t?.uri&&Ke(t.uri,t.type==="image"?"Image":"Media")},Ve=()=>{const t=x.filter(l=>v.has(l.id));if(t.length===0)return;const i=t.map(l=>l.uri).join(`
2
+ `);et(i,`${t.length} Media URIs`),A(`${t.length} file URIs copied to clipboard`)},We=async t=>{try{const i=t.uri.startsWith("file://")||t.uri.startsWith("content://")||t.uri.startsWith("http")?t.uri:`file://${t.uri}`;await Te.share({url:i,title:t.filename,message:t.filename})}catch{A(r("mediaGallery.shareUnavailable","Sharing not available on this device"))}},Ae=async()=>{const t=x.filter(i=>v.has(i.id));if(t.length!==0)try{const i=t[0],l=i.uri.startsWith("file://")||i.uri.startsWith("content://")||i.uri.startsWith("http")?i.uri:`file://${i.uri}`;await Te.share({url:l,title:i.filename,message:t.length===1?i.filename:`${t.length} items: ${t.map(T=>T.filename).join(", ")}`})}catch{A(r("mediaGallery.shareUnavailable","Sharing not available on this device"))}},$e=()=>{const t=v.size;t!==0&&ie.alert(r("mediaGallery.deleteSelectedTitle"),r("mediaGallery.deleteSelectedMessage",{count:t}),[{text:r("common.cancel"),style:"cancel"},{text:r("mediaGallery.delete"),style:"destructive",onPress:async()=>{const i=x.filter(T=>v.has(T.id));for(const T of i)await P.deleteMedia(T.uri);L(new Set),await M(),await V?.()===0&&H("apis"),A(r("mediaGallery.deletedCount",{count:i.length}))}}])},Fe=()=>{ie.alert(r("mediaGallery.purgeTitle"),r("mediaGallery.purgeMessage",{count:x.length,size:U(Y)}),[{text:r("common.cancel"),style:"cancel"},{text:r("common.clearAll"),style:"destructive",onPress:async()=>{await P.clearAllMedia(),L(new Set),await M(),await V?.(),H("apis"),A(r("mediaGallery.allPurged"))}}])},Pe=async t=>{await P.convertToGif(t.uri,{fps:12,width:480})&&(await M(),V?.().catch(()=>{}))},Oe=(t,i)=>{const l=i?e.sky400:e.slate400,T=12;switch(t){case"all":return<Ye size={T}color={l}/>;case"image":return<F size={T}color={l}/>;case"video":return<$ size={T}color={l}/>;case"gif":return<_ size={T}color={l}/>}},Le=({item:t})=>{const i=t.type==="video",l=t.type==="gif",T=i?t.thumbnailUri:t.uri,D=v.has(t.id);return<Se onPress={()=>j(t)}style={[o.card,D&&o.cardSelected]}>
3
+ <C style={o.thumbnailContainer}>
4
+ {T?<Ce source={{uri:T}}style={o.thumbnail}resizeMode="cover"/>:<C style={o.thumbnailFallback}>
5
+ {i?<$ size={26}color={e.sky400}/>:<F size={26}color={e.slate400}/>}
6
+ </C>}
148
7
 
149
8
 
150
- <TouchableOpacity onPress={() => toggleSelect(item.id)} style={[
151
- galleryStyles.checkbox,
152
- isSelected && galleryStyles.checkboxSelected,
153
- ]} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}>
154
- {isSelected && <CheckIcon size={12} color={AppColors.white}/>}
155
- </TouchableOpacity>
9
+ <I onPress={()=>Z(t.id)}style={[o.checkbox,D&&o.checkboxSelected]}hitSlop={{top:8,bottom:8,left:8,right:8}}>
10
+ {D&&<Ie size={12}color={e.white}/>}
11
+ </I>
156
12
 
157
- {isVideo && (<View style={galleryStyles.miniPlayCircle}>
158
- <PlayIcon size={14} color={AppColors.white}/>
159
- </View>)}
160
- <View style={galleryStyles.typeBadge}>
161
- {isVideo ? (<FilmIcon size={11} color={AppColors.sky400}/>) : isGif ? (<GifIcon size={11} color={AppColors.warningAmber}/>) : (<ImageIcon size={11} color={AppColors.emerald500}/>)}
162
- <Text style={galleryStyles.typeBadgeText}>
163
- {item.format.toUpperCase()}
164
- </Text>
165
- </View>
166
- </View>
13
+ {i&&<C style={o.miniPlayCircle}>
14
+ <Be size={14}color={e.white}/>
15
+ </C>}
16
+ <C style={o.typeBadge}>
17
+ {i?<$ size={11}color={e.sky400}/>:l?<_ size={11}color={e.warningAmber}/>:<F size={11}color={e.emerald500}/>}
18
+ <S style={o.typeBadgeText}>
19
+ {t.format.toUpperCase()}
20
+ </S>
21
+ </C>
22
+ </C>
167
23
 
168
- <View style={galleryStyles.cardInfo}>
169
- <Text style={galleryStyles.cardTitle} numberOfLines={1}>
170
- {item.filename}
171
- </Text>
172
- <View style={galleryStyles.cardMetaRow}>
173
- <Text style={galleryStyles.cardMeta}>
174
- {formatBytes(item.sizeBytes)}
175
- </Text>
176
- <Text style={galleryStyles.cardMetaDot}>•</Text>
177
- <Text style={galleryStyles.cardMeta}>
178
- {new Date(item.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
179
- </Text>
180
- </View>
181
- </View>
182
- </TouchableScale>);
183
- };
184
- const renderListItem = ({ item }) => {
185
- const isVideo = item.type === 'video';
186
- const isGif = item.type === 'gif';
187
- const thumbUri = isVideo ? item.thumbnailUri : item.uri;
188
- const isSelected = selectedIds.has(item.id);
189
- return (<TouchableScale onPress={() => setSelectedItem(item)} style={[galleryStyles.listRow, isSelected && galleryStyles.listRowSelected]}>
24
+ <C style={o.cardInfo}>
25
+ <S style={o.cardTitle}numberOfLines={1}>
26
+ {t.filename}
27
+ </S>
28
+ <C style={o.cardMetaRow}>
29
+ <C style={{flexDirection:"row",alignItems:"center",gap:4,flex:1,minWidth:0}}>
30
+ <S style={o.cardMeta}numberOfLines={1}>
31
+ {U(t.sizeBytes)}
32
+ </S>
33
+ <S style={o.cardMetaDot}>•</S>
34
+ <S style={o.cardMeta}numberOfLines={1}>
35
+ {new Date(t.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}
36
+ </S>
37
+ </C>
38
+ <I onPress={()=>ee(t)}style={o.gridCopyBtn}hitSlop={{top:6,bottom:6,left:6,right:6}}>
39
+ <E size={11}color={e.slate400}/>
40
+ </I>
41
+ </C>
42
+ </C>
43
+ </Se>},Ue=({item:t})=>{const i=t.type==="video",l=t.type==="gif",T=i?t.thumbnailUri:t.uri,D=v.has(t.id);return<Se onPress={()=>j(t)}style={[o.listRow,D&&o.listRowSelected]}>
190
44
 
191
- <TouchableOpacity onPress={() => toggleSelect(item.id)} style={[
192
- galleryStyles.listCheckbox,
193
- isSelected && galleryStyles.checkboxSelected,
194
- ]} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}>
195
- {isSelected && <CheckIcon size={12} color={AppColors.white}/>}
196
- </TouchableOpacity>
45
+ <I onPress={()=>Z(t.id)}style={[o.listCheckbox,D&&o.checkboxSelected]}hitSlop={{top:8,bottom:8,left:8,right:8}}>
46
+ {D&&<Ie size={12}color={e.white}/>}
47
+ </I>
197
48
 
198
49
 
199
- <View style={galleryStyles.listThumbContainer}>
200
- {thumbUri ? (<Image source={{ uri: thumbUri }} style={galleryStyles.listThumb} resizeMode="cover"/>) : (<View style={galleryStyles.listThumbFallback}>
201
- {isVideo ? (<FilmIcon size={18} color={AppColors.sky400}/>) : (<ImageIcon size={18} color={AppColors.slate400}/>)}
202
- </View>)}
203
- {isVideo && (<View style={galleryStyles.listMiniPlay}>
204
- <PlayIcon size={10} color={AppColors.white}/>
205
- </View>)}
206
- </View>
50
+ <C style={o.listThumbContainer}>
51
+ {T?<Ce source={{uri:T}}style={o.listThumb}resizeMode="cover"/>:<C style={o.listThumbFallback}>
52
+ {i?<$ size={18}color={e.sky400}/>:<F size={18}color={e.slate400}/>}
53
+ </C>}
54
+ {i&&<C style={o.listMiniPlay}>
55
+ <Be size={10}color={e.white}/>
56
+ </C>}
57
+ </C>
207
58
 
208
59
 
209
- <View style={galleryStyles.listInfo}>
210
- <Text style={galleryStyles.listTitle} numberOfLines={1}>
211
- {item.filename}
212
- </Text>
213
- <View style={galleryStyles.listMetaRow}>
214
- <View style={galleryStyles.listBadge}>
215
- {isVideo ? (<FilmIcon size={10} color={AppColors.sky400}/>) : isGif ? (<GifIcon size={10} color={AppColors.warningAmber}/>) : (<ImageIcon size={10} color={AppColors.emerald500}/>)}
216
- <Text style={galleryStyles.listBadgeText}>
217
- {item.format.toUpperCase()}
218
- </Text>
219
- </View>
220
- <Text style={galleryStyles.cardMeta}>
221
- {formatBytes(item.sizeBytes)}
222
- </Text>
223
- <Text style={galleryStyles.cardMetaDot}>•</Text>
224
- <Text style={galleryStyles.cardMeta}>
225
- {new Date(item.timestamp).toLocaleDateString([], { month: 'short', day: 'numeric' })}{' '}
226
- {new Date(item.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
227
- </Text>
228
- </View>
229
- </View>
60
+ <C style={o.listInfo}>
61
+ <S style={o.listTitle}numberOfLines={1}>
62
+ {t.filename}
63
+ </S>
64
+ <C style={o.listMetaRow}>
65
+ <C style={o.listBadge}>
66
+ {i?<$ size={10}color={e.sky400}/>:l?<_ size={10}color={e.warningAmber}/>:<F size={10}color={e.emerald500}/>}
67
+ <S style={o.listBadgeText}>
68
+ {t.format.toUpperCase()}
69
+ </S>
70
+ </C>
71
+ <S style={o.cardMeta}>
72
+ {U(t.sizeBytes)}
73
+ </S>
74
+ <S style={o.cardMetaDot}>•</S>
75
+ <S style={o.cardMeta}>
76
+ {new Date(t.timestamp).toLocaleDateString([],{month:"short",day:"numeric"})}{" "}
77
+ {new Date(t.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}
78
+ </S>
79
+ </C>
80
+ </C>
230
81
 
231
82
 
232
- <TouchableOpacity onPress={() => handleDeleteItem(item)} style={galleryStyles.listDeleteBtn} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}>
233
- <TrashIcon size={14} color={AppColors.red500}/>
234
- </TouchableOpacity>
235
- </TouchableScale>);
236
- };
237
- return (<View style={galleryStyles.container}>
83
+ <C style={o.listActionsRow}>
84
+ <I onPress={()=>ee(t)}style={o.listCopyBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
85
+ <E size={13}color={e.slate200}/>
86
+ </I>
87
+
88
+ <I onPress={()=>We(t)}style={o.listShareBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
89
+ <Re size={13}color={e.sky400}/>
90
+ </I>
91
+
92
+ <I onPress={()=>K(t)}style={o.listDeleteBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
93
+ <N size={13}color={e.red500}/>
94
+ </I>
95
+ </C>
96
+ </Se>};return<C style={o.container}>
238
97
 
239
- <View style={galleryStyles.filterBar}>
240
- <View style={galleryStyles.chipGroup}>
241
- {['all', 'image', 'video', 'gif'].map(filterKey => {
242
- const isActive = selectedFilter === filterKey;
243
- const label = filterKey === 'all'
244
- ? t('mediaGallery.all', { count: mediaList.length })
245
- : filterKey === 'image'
246
- ? t('mediaGallery.photos')
247
- : filterKey === 'video'
248
- ? t('mediaGallery.videos')
249
- : t('mediaGallery.gifs');
250
- return (<TouchableOpacity key={filterKey} onPress={() => setSelectedFilter(filterKey)} style={[
251
- galleryStyles.chip,
252
- isActive && galleryStyles.chipActive,
253
- ]}>
254
- {renderFilterIcon(filterKey, isActive)}
255
- <Text style={[
256
- galleryStyles.chipText,
257
- isActive && galleryStyles.chipTextActive,
258
- ]}>
259
- {label}
260
- </Text>
261
- </TouchableOpacity>);
262
- })}
263
- </View>
98
+ <C style={o.filterBar}>
99
+ <C style={o.chipGroup}>
100
+ {["all","image","video","gif"].map(t=>{const i=O===t,l=t==="all"?r("mediaGallery.all",{count:x.length}):r(t==="image"?"mediaGallery.photos":t==="video"?"mediaGallery.videos":"mediaGallery.gifs");return<I key={t}onPress={()=>Me(t)}style={[o.chip,i&&o.chipActive]}>
101
+ {Oe(t,i)}
102
+ <S style={[o.chipText,i&&o.chipTextActive]}>
103
+ {l}
104
+ </S>
105
+ </I>})}
106
+ </C>
264
107
 
265
108
 
266
- <View style={galleryStyles.viewToggleContainer}>
267
- <TouchableOpacity onPress={() => setViewMode('grid')} style={[
268
- galleryStyles.viewToggleBtn,
269
- viewMode === 'grid' && galleryStyles.viewToggleBtnActive,
270
- ]}>
271
- <GridIcon size={13} color={viewMode === 'grid' ? AppColors.white : AppColors.slate400}/>
272
- </TouchableOpacity>
273
- <TouchableOpacity onPress={() => setViewMode('list')} style={[
274
- galleryStyles.viewToggleBtn,
275
- viewMode === 'list' && galleryStyles.viewToggleBtnActive,
276
- ]}>
277
- <ListIcon size={13} color={viewMode === 'list' ? AppColors.white : AppColors.slate400}/>
278
- </TouchableOpacity>
279
- </View>
280
- </View>
109
+ <C style={o.viewToggleContainer}>
110
+ <I onPress={()=>X("grid")}style={[o.viewToggleBtn,R==="grid"&&o.viewToggleBtnActive]}>
111
+ <Qe size={13}color={R==="grid"?e.white:e.slate400}/>
112
+ </I>
113
+ <I onPress={()=>X("list")}style={[o.viewToggleBtn,R==="list"&&o.viewToggleBtnActive]}>
114
+ <Xe size={13}color={R==="list"?e.white:e.slate400}/>
115
+ </I>
116
+ </C>
117
+ </C>
281
118
 
282
119
 
283
- {mediaList.length > 0 && (<View style={galleryStyles.subBar}>
284
- <View style={galleryStyles.resultCountWrapper}>
285
- <Text style={[
286
- galleryStyles.resultCountText,
287
- selectedIds.size > 0 && galleryStyles.resultCountTextSelected,
288
- ]}>
289
- {selectedIds.size > 0
290
- ? t('mediaGallery.selectedOfResults', {
291
- selected: selectedIds.size,
292
- total: filteredMedia.length,
293
- defaultValue: `Selected ${selectedIds.size} of ${filteredMedia.length} results`,
294
- })
295
- : filteredMedia.length !== mediaList.length
296
- ? t('mediaGallery.showingFilteredResults', {
297
- count: filteredMedia.length,
298
- total: mediaList.length,
299
- defaultValue: `Showing ${filteredMedia.length} of ${mediaList.length} results`,
300
- })
301
- : t('mediaGallery.showingResults', {
302
- count: filteredMedia.length,
303
- defaultValue: `Showing ${filteredMedia.length} results`,
304
- })}
305
- </Text>
306
- </View>
120
+ {x.length>0&&<C style={o.subBar}>
121
+ <C style={o.resultCountWrapper}>
122
+ <S style={[o.resultCountText,v.size>0&&o.resultCountTextSelected]}>
123
+ {v.size>0?r("mediaGallery.selectedOfResults",{selected:v.size,total:G.length,defaultValue:`Selected ${v.size} of ${G.length} results`}):G.length!==x.length?r("mediaGallery.showingFilteredResults",{count:G.length,total:x.length,defaultValue:`Showing ${G.length} of ${x.length} results`}):r("mediaGallery.showingResults",{count:G.length,defaultValue:`Showing ${G.length} results`})}
124
+ </S>
125
+ </C>
126
+
127
+ <C style={o.actionsGroup}>
128
+ {v.size>0&&<>
129
+ <I onPress={Ve}style={o.copySelectedBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
130
+ <E size={12}color={e.slate200}/>
131
+ <S style={o.copySelectedBtnText}>
132
+ {r("mediaGallery.copyUri","Copy URI")}
133
+ </S>
134
+ </I>
135
+
136
+ <I onPress={Ae}style={o.shareSelectedBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
137
+ <Re size={12}color={e.sky400}/>
138
+ <S style={o.shareSelectedBtnText}>
139
+ {r("mediaGallery.share","Share")}
140
+ </S>
141
+ </I>
307
142
 
308
- <View style={galleryStyles.actionsGroup}>
309
- {selectedIds.size > 0 && (<TouchableOpacity onPress={handleDeleteSelected} style={galleryStyles.deleteBtn} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}>
310
- <TrashIcon size={13} color={AppColors.red500}/>
311
- <Text style={galleryStyles.deleteBtnText}>
312
- {t('mediaGallery.deleteSelected', { count: selectedIds.size })}
313
- </Text>
314
- </TouchableOpacity>)}
143
+ <I onPress={$e}style={o.deleteBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
144
+ <N size={13}color={e.red500}/>
145
+ <S style={o.deleteBtnText}>
146
+ {r("mediaGallery.deleteSelected",{count:v.size})}
147
+ </S>
148
+ </I>
149
+ </>}
315
150
 
316
- <TouchableOpacity onPress={handleClearAll} style={galleryStyles.clearBtn} hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}>
317
- <TrashIcon size={13} color={AppColors.red500}/>
318
- <Text style={galleryStyles.clearBtnText}>
319
- {t('mediaGallery.purge', { size: formatBytes(totalStorageBytes) })}
320
- </Text>
321
- </TouchableOpacity>
322
- </View>
323
- </View>)}
151
+ <I onPress={Fe}style={o.clearBtn}hitSlop={{top:8,bottom:8,left:8,right:8}}>
152
+ <N size={13}color={e.red500}/>
153
+ <S style={o.clearBtnText}>
154
+ {r("mediaGallery.purge",{size:U(Y)})}
155
+ </S>
156
+ </I>
157
+ </C>
158
+ </C>}
324
159
 
325
160
 
326
- <FlatList key={viewMode} data={filteredMedia} keyExtractor={item => item.id} renderItem={viewMode === 'grid' ? renderGridItem : renderListItem} numColumns={viewMode === 'grid' ? 2 : 1} columnWrapperStyle={viewMode === 'grid' ? galleryStyles.columnWrapper : undefined} contentContainerStyle={galleryStyles.listContent} refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} tintColor={AppColors.sky400}/>} ListEmptyComponent={<EmptyState customTitle={t('mediaGallery.noMediaTitle')} customSub={t('mediaGallery.noMediaDesc')} showReload={false}/>}/>
161
+ <Ee key={R}data={G}keyExtractor={t=>t.id}renderItem={R==="grid"?Le:Ue}numColumns={R==="grid"?2:1}columnWrapperStyle={R==="grid"?o.columnWrapper:void 0}contentContainerStyle={o.listContent}refreshControl={<_e refreshing={Ge}onRefresh={De}tintColor={e.sky400}/>}ListEmptyComponent={<Je customTitle={r("mediaGallery.noMediaTitle")}customSub={r("mediaGallery.noMediaDesc")}showReload={!1}/>}/>
327
162
 
328
163
 
329
- <MediaPreviewModal item={selectedItem} visible={!!selectedItem} onClose={() => setSelectedItem(null)} onDelete={handleDeleteItem} onConvertToGif={handleConvertToGif}/>
330
- </View>);
331
- };
332
- const { width: WINDOW_WIDTH } = Dimensions.get('window');
333
- const CARD_WIDTH = (WINDOW_WIDTH - 36) / 2;
334
- const galleryStyles = StyleSheet.create({
335
- container: {
336
- flex: 1,
337
- backgroundColor: AppColors.slate850,
338
- },
339
- filterBar: {
340
- flexDirection: 'row',
341
- alignItems: 'center',
342
- justifyContent: 'space-between',
343
- paddingHorizontal: 12,
344
- paddingVertical: 9,
345
- borderBottomWidth: 1,
346
- borderBottomColor: AppColors.borderGlassLight,
347
- gap: 8,
348
- },
349
- chipGroup: {
350
- flexDirection: 'row',
351
- alignItems: 'center',
352
- gap: 6,
353
- flexShrink: 1,
354
- },
355
- chip: {
356
- flexDirection: 'row',
357
- alignItems: 'center',
358
- gap: 4.5,
359
- paddingHorizontal: 8,
360
- paddingVertical: 4.5,
361
- borderRadius: 6,
362
- backgroundColor: AppColors.whiteAlpha06,
363
- borderWidth: 1,
364
- borderColor: AppColors.whiteAlpha10,
365
- },
366
- chipActive: {
367
- backgroundColor: `${AppColors.sky400}2E`,
368
- borderColor: AppColors.sky400,
369
- },
370
- chipText: {
371
- fontFamily: AppFonts.interMedium,
372
- fontSize: 11,
373
- color: AppColors.slate400,
374
- },
375
- chipTextActive: {
376
- fontFamily: AppFonts.interBold,
377
- color: AppColors.sky400,
378
- },
379
- subBar: {
380
- flexDirection: 'row',
381
- alignItems: 'center',
382
- justifyContent: 'space-between',
383
- paddingHorizontal: 12,
384
- paddingVertical: 7,
385
- backgroundColor: `${AppColors.slate900}99`,
386
- borderBottomWidth: 1,
387
- borderBottomColor: AppColors.borderGlassLight,
388
- gap: 8,
389
- },
390
- resultCountWrapper: {
391
- flexDirection: 'row',
392
- alignItems: 'center',
393
- flexShrink: 1,
394
- },
395
- resultCountText: {
396
- fontFamily: AppFonts.interMedium,
397
- fontSize: 11,
398
- color: AppColors.slate400,
399
- },
400
- resultCountTextSelected: {
401
- fontFamily: AppFonts.interSemiBold,
402
- color: AppColors.sky400,
403
- },
404
- actionsGroup: {
405
- flexDirection: 'row',
406
- alignItems: 'center',
407
- gap: 6,
408
- },
409
- viewToggleContainer: {
410
- flexDirection: 'row',
411
- alignItems: 'center',
412
- backgroundColor: AppColors.whiteAlpha06,
413
- borderRadius: 6,
414
- padding: 2,
415
- borderWidth: 1,
416
- borderColor: AppColors.whiteAlpha10,
417
- },
418
- viewToggleBtn: {
419
- paddingHorizontal: 7,
420
- paddingVertical: 4,
421
- borderRadius: 4,
422
- alignItems: 'center',
423
- justifyContent: 'center',
424
- },
425
- viewToggleBtnActive: {
426
- backgroundColor: `${AppColors.violet600}80`,
427
- },
428
- deleteBtn: {
429
- flexDirection: 'row',
430
- alignItems: 'center',
431
- gap: 4,
432
- paddingHorizontal: 8,
433
- paddingVertical: 4,
434
- borderRadius: 6,
435
- backgroundColor: `${AppColors.red500}26`,
436
- borderWidth: 1,
437
- borderColor: `${AppColors.red500}80`,
438
- },
439
- deleteBtnText: {
440
- fontFamily: AppFonts.interBold,
441
- fontSize: 10.5,
442
- color: AppColors.red500,
443
- },
444
- clearBtn: {
445
- flexDirection: 'row',
446
- alignItems: 'center',
447
- gap: 4,
448
- paddingHorizontal: 8,
449
- paddingVertical: 4,
450
- borderRadius: 6,
451
- backgroundColor: `${AppColors.red500}1F`,
452
- borderWidth: 1,
453
- borderColor: `${AppColors.red500}4D`,
454
- },
455
- clearBtnText: {
456
- fontFamily: AppFonts.interMedium,
457
- fontSize: 10.5,
458
- color: AppColors.red500,
459
- },
460
- listContent: {
461
- padding: 12,
462
- gap: 10,
463
- },
464
- columnWrapper: {
465
- gap: 12,
466
- },
467
- card: {
468
- width: CARD_WIDTH,
469
- backgroundColor: AppColors.slate800,
470
- borderRadius: 8,
471
- borderWidth: 1,
472
- borderColor: AppColors.borderGlassLight,
473
- overflow: 'hidden',
474
- },
475
- cardSelected: {
476
- borderColor: AppColors.violet600,
477
- borderWidth: 1.5,
478
- },
479
- thumbnailContainer: {
480
- width: '100%',
481
- height: 110,
482
- backgroundColor: AppColors.slate850,
483
- position: 'relative',
484
- },
485
- thumbnail: {
486
- width: '100%',
487
- height: '100%',
488
- },
489
- thumbnailFallback: {
490
- width: '100%',
491
- height: '100%',
492
- alignItems: 'center',
493
- justifyContent: 'center',
494
- backgroundColor: AppColors.slate900,
495
- },
496
- checkbox: {
497
- position: 'absolute',
498
- top: 6,
499
- left: 6,
500
- width: 22,
501
- height: 22,
502
- borderRadius: 5,
503
- borderWidth: 1.5,
504
- borderColor: 'rgba(255, 255, 255, 0.65)',
505
- backgroundColor: 'rgba(15, 23, 42, 0.65)',
506
- alignItems: 'center',
507
- justifyContent: 'center',
508
- zIndex: 10,
509
- },
510
- checkboxSelected: {
511
- backgroundColor: AppColors.violet600,
512
- borderColor: AppColors.violet600,
513
- },
514
- miniPlayCircle: {
515
- position: 'absolute',
516
- top: '50%',
517
- left: '50%',
518
- width: 32,
519
- height: 32,
520
- marginTop: -16,
521
- marginLeft: -16,
522
- borderRadius: 16,
523
- backgroundColor: `${AppColors.sky400}D9`,
524
- alignItems: 'center',
525
- justifyContent: 'center',
526
- paddingLeft: 2,
527
- shadowColor: '#000',
528
- shadowOffset: { width: 0, height: 2 },
529
- shadowOpacity: 0.4,
530
- shadowRadius: 4,
531
- elevation: 4,
532
- },
533
- typeBadge: {
534
- position: 'absolute',
535
- top: 6,
536
- right: 6,
537
- flexDirection: 'row',
538
- alignItems: 'center',
539
- gap: 3,
540
- backgroundColor: AppColors.badgeGlassDark,
541
- paddingHorizontal: 5,
542
- paddingVertical: 2,
543
- borderRadius: 4,
544
- borderWidth: 1,
545
- borderColor: AppColors.borderGlassMedium,
546
- },
547
- typeBadgeText: {
548
- fontFamily: AppFonts.interBold,
549
- fontSize: 9,
550
- color: AppColors.slate200,
551
- },
552
- cardInfo: {
553
- padding: 8,
554
- gap: 3,
555
- },
556
- cardTitle: {
557
- fontFamily: AppFonts.interMedium,
558
- fontSize: 11.5,
559
- color: AppColors.white,
560
- },
561
- cardMetaRow: {
562
- flexDirection: 'row',
563
- alignItems: 'center',
564
- gap: 4,
565
- },
566
- cardMeta: {
567
- fontFamily: AppFonts.interRegular,
568
- fontSize: 10,
569
- color: AppColors.slate400,
570
- },
571
- cardMetaDot: {
572
- fontSize: 10,
573
- color: AppColors.whiteAlpha30,
574
- },
575
- listRow: {
576
- flexDirection: 'row',
577
- alignItems: 'center',
578
- backgroundColor: AppColors.slate800,
579
- borderRadius: 8,
580
- borderWidth: 1,
581
- borderColor: AppColors.borderGlassLight,
582
- padding: 8,
583
- gap: 10,
584
- },
585
- listRowSelected: {
586
- borderColor: AppColors.violet600,
587
- borderWidth: 1.5,
588
- backgroundColor: `${AppColors.violet600}14`,
589
- },
590
- listCheckbox: {
591
- width: 20,
592
- height: 20,
593
- borderRadius: 4,
594
- borderWidth: 1.5,
595
- borderColor: 'rgba(255, 255, 255, 0.65)',
596
- backgroundColor: 'rgba(15, 23, 42, 0.65)',
597
- alignItems: 'center',
598
- justifyContent: 'center',
599
- },
600
- listThumbContainer: {
601
- width: 46,
602
- height: 46,
603
- borderRadius: 6,
604
- backgroundColor: AppColors.slate850,
605
- overflow: 'hidden',
606
- position: 'relative',
607
- },
608
- listThumb: {
609
- width: '100%',
610
- height: '100%',
611
- },
612
- listThumbFallback: {
613
- width: '100%',
614
- height: '100%',
615
- alignItems: 'center',
616
- justifyContent: 'center',
617
- backgroundColor: AppColors.slate900,
618
- },
619
- listMiniPlay: {
620
- position: 'absolute',
621
- top: '50%',
622
- left: '50%',
623
- width: 20,
624
- height: 20,
625
- marginTop: -10,
626
- marginLeft: -10,
627
- borderRadius: 10,
628
- backgroundColor: `${AppColors.sky400}D9`,
629
- alignItems: 'center',
630
- justifyContent: 'center',
631
- paddingLeft: 1,
632
- },
633
- listInfo: {
634
- flex: 1,
635
- gap: 4,
636
- minWidth: 0,
637
- },
638
- listTitle: {
639
- fontFamily: AppFonts.interMedium,
640
- fontSize: 12,
641
- color: AppColors.white,
642
- },
643
- listMetaRow: {
644
- flexDirection: 'row',
645
- alignItems: 'center',
646
- gap: 6,
647
- flexWrap: 'wrap',
648
- },
649
- listBadge: {
650
- flexDirection: 'row',
651
- alignItems: 'center',
652
- gap: 3,
653
- backgroundColor: AppColors.badgeGlassDark,
654
- paddingHorizontal: 4,
655
- paddingVertical: 1.5,
656
- borderRadius: 4,
657
- borderWidth: 1,
658
- borderColor: AppColors.borderGlassMedium,
659
- },
660
- listBadgeText: {
661
- fontFamily: AppFonts.interBold,
662
- fontSize: 8.5,
663
- color: AppColors.slate200,
664
- },
665
- listDeleteBtn: {
666
- padding: 6,
667
- borderRadius: 6,
668
- backgroundColor: `${AppColors.red500}14`,
669
- borderWidth: 1,
670
- borderColor: `${AppColors.red500}33`,
671
- },
672
- });
164
+ <Ze item={Q}visible={!!Q}onClose={()=>j(null)}onDelete={K}onConvertToGif={Pe}/>
165
+ </C>};const{width:it}=je.get("window"),rt=(it-36)/2,o=Ne.create({container:{flex:1,backgroundColor:e.slate850},filterBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:9,borderBottomWidth:1,borderBottomColor:e.borderGlassLight,gap:8},chipGroup:{flexDirection:"row",alignItems:"center",gap:6,flexShrink:1},chip:{flexDirection:"row",alignItems:"center",gap:4.5,paddingHorizontal:8,paddingVertical:4.5,borderRadius:6,backgroundColor:e.whiteAlpha06,borderWidth:1,borderColor:e.whiteAlpha10},chipActive:{backgroundColor:`${e.sky400}2E`,borderColor:e.sky400},chipText:{fontFamily:B.interMedium,fontSize:11,color:e.slate400},chipTextActive:{fontFamily:B.interBold,color:e.sky400},subBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:7,backgroundColor:`${e.slate900}99`,borderBottomWidth:1,borderBottomColor:e.borderGlassLight,gap:8},resultCountWrapper:{flexDirection:"row",alignItems:"center",flexShrink:1},resultCountText:{fontFamily:B.interMedium,fontSize:11,color:e.slate400},resultCountTextSelected:{fontFamily:B.interSemiBold,color:e.sky400},actionsGroup:{flexDirection:"row",alignItems:"center",gap:6},viewToggleContainer:{flexDirection:"row",alignItems:"center",backgroundColor:e.whiteAlpha06,borderRadius:6,padding:2,borderWidth:1,borderColor:e.whiteAlpha10},viewToggleBtn:{paddingHorizontal:7,paddingVertical:4,borderRadius:4,alignItems:"center",justifyContent:"center"},viewToggleBtnActive:{backgroundColor:`${e.violet600}80`},deleteBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:`${e.red500}26`,borderWidth:1,borderColor:`${e.red500}80`},deleteBtnText:{fontFamily:B.interBold,fontSize:10.5,color:e.red500},clearBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:`${e.red500}1F`,borderWidth:1,borderColor:`${e.red500}4D`},clearBtnText:{fontFamily:B.interMedium,fontSize:10.5,color:e.red500},listContent:{padding:12,gap:10},columnWrapper:{gap:12},card:{width:rt,backgroundColor:e.slate800,borderRadius:8,borderWidth:1,borderColor:e.borderGlassLight,overflow:"hidden"},cardSelected:{borderColor:e.violet600,borderWidth:1.5},thumbnailContainer:{width:"100%",height:110,backgroundColor:e.slate850,position:"relative"},thumbnail:{width:"100%",height:"100%"},thumbnailFallback:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",backgroundColor:e.slate900},checkbox:{position:"absolute",top:6,left:6,width:22,height:22,borderRadius:5,borderWidth:1.5,borderColor:"rgba(255, 255, 255, 0.65)",backgroundColor:"rgba(15, 23, 42, 0.65)",alignItems:"center",justifyContent:"center",zIndex:10},checkboxSelected:{backgroundColor:e.violet600,borderColor:e.violet600},miniPlayCircle:{position:"absolute",top:"50%",left:"50%",width:32,height:32,marginTop:-16,marginLeft:-16,borderRadius:16,backgroundColor:`${e.sky400}D9`,alignItems:"center",justifyContent:"center",paddingLeft:2,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.4,shadowRadius:4,elevation:4},typeBadge:{position:"absolute",top:6,right:6,flexDirection:"row",alignItems:"center",gap:3,backgroundColor:e.badgeGlassDark,paddingHorizontal:5,paddingVertical:2,borderRadius:4,borderWidth:1,borderColor:e.borderGlassMedium},typeBadgeText:{fontFamily:B.interBold,fontSize:9,color:e.slate200},cardInfo:{padding:8,gap:3},cardTitle:{fontFamily:B.interMedium,fontSize:11.5,color:e.white},cardMetaRow:{flexDirection:"row",alignItems:"center",gap:4},cardMeta:{fontFamily:B.interRegular,fontSize:10,color:e.slate400},cardMetaDot:{fontSize:10,color:e.whiteAlpha30},listRow:{flexDirection:"row",alignItems:"center",backgroundColor:e.slate800,borderRadius:8,borderWidth:1,borderColor:e.borderGlassLight,padding:8,gap:10},listRowSelected:{borderColor:e.violet600,borderWidth:1.5,backgroundColor:`${e.violet600}14`},listCheckbox:{width:20,height:20,borderRadius:4,borderWidth:1.5,borderColor:"rgba(255, 255, 255, 0.65)",backgroundColor:"rgba(15, 23, 42, 0.65)",alignItems:"center",justifyContent:"center"},listThumbContainer:{width:46,height:46,borderRadius:6,backgroundColor:e.slate850,overflow:"hidden",position:"relative"},listThumb:{width:"100%",height:"100%"},listThumbFallback:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",backgroundColor:e.slate900},listMiniPlay:{position:"absolute",top:"50%",left:"50%",width:20,height:20,marginTop:-10,marginLeft:-10,borderRadius:10,backgroundColor:`${e.sky400}D9`,alignItems:"center",justifyContent:"center",paddingLeft:1},listInfo:{flex:1,gap:4,minWidth:0},listTitle:{fontFamily:B.interMedium,fontSize:12,color:e.white},listMetaRow:{flexDirection:"row",alignItems:"center",gap:6,flexWrap:"wrap"},listBadge:{flexDirection:"row",alignItems:"center",gap:3,backgroundColor:e.badgeGlassDark,paddingHorizontal:4,paddingVertical:1.5,borderRadius:4,borderWidth:1,borderColor:e.borderGlassMedium},listBadgeText:{fontFamily:B.interBold,fontSize:8.5,color:e.slate200},gridCopyBtn:{padding:3,borderRadius:4,backgroundColor:e.whiteAlpha08},listActionsRow:{flexDirection:"row",alignItems:"center",gap:6},listCopyBtn:{padding:6,borderRadius:6,backgroundColor:e.whiteAlpha10,borderWidth:1,borderColor:e.whiteAlpha15},listShareBtn:{padding:6,borderRadius:6,backgroundColor:`${e.sky400}18`,borderWidth:1,borderColor:`${e.sky400}40`},listDeleteBtn:{padding:6,borderRadius:6,backgroundColor:`${e.red500}14`,borderWidth:1,borderColor:`${e.red500}33`},copySelectedBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:e.whiteAlpha10,borderWidth:1,borderColor:e.whiteAlpha20},copySelectedBtnText:{fontFamily:B.interSemiBold,fontSize:10.5,color:e.slate200},shareSelectedBtn:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:4,borderRadius:6,backgroundColor:`${e.sky400}20`,borderWidth:1,borderColor:`${e.sky400}60`},shareSelectedBtnText:{fontFamily:B.interBold,fontSize:10.5,color:e.sky400}});