react-native-inapp-inspector 2.3.18 → 2.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +57 -0
  2. package/dist/commonjs/analytics.js +1 -24
  3. package/dist/commonjs/bundle.js +1 -16
  4. package/dist/commonjs/capture.d.ts +2 -0
  5. package/dist/commonjs/capture.js +1 -32
  6. package/dist/commonjs/components/AnalyticsDetail.js +92 -623
  7. package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
  8. package/dist/commonjs/components/AnalyticsGraph.js +70 -370
  9. package/dist/commonjs/components/AnimatedEntrance.js +1 -11
  10. package/dist/commonjs/components/AppHeaderLogo.js +7 -134
  11. package/dist/commonjs/components/BrandCircleIcon.js +73 -118
  12. package/dist/commonjs/components/BrandSquareIcon.js +63 -108
  13. package/dist/commonjs/components/CodeSnippet.js +48 -623
  14. package/dist/commonjs/components/ConsoleLogCard.js +63 -537
  15. package/dist/commonjs/components/CopyButton.js +3 -89
  16. package/dist/commonjs/components/DiffViewer.js +19 -83
  17. package/dist/commonjs/components/DomainHeader.js +27 -127
  18. package/dist/commonjs/components/EmptyState.d.ts +1 -0
  19. package/dist/commonjs/components/EmptyState.js +10 -87
  20. package/dist/commonjs/components/EndOfListFooter.js +7 -81
  21. package/dist/commonjs/components/ErrorBoundary.js +72 -566
  22. package/dist/commonjs/components/HeadersSection.js +31 -110
  23. package/dist/commonjs/components/HighlightText.js +17 -58
  24. package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
  25. package/dist/commonjs/components/Inspector/AboutModal.js +351 -0
  26. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
  27. package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
  28. package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
  29. package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
  30. package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
  31. package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
  32. package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
  33. package/dist/commonjs/components/Inspector/DebuggingTab.js +64 -871
  34. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
  35. package/dist/commonjs/components/Inspector/FabLauncher.js +85 -54
  36. package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
  37. package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +9 -0
  38. package/dist/commonjs/components/Inspector/FeedbackModal.js +167 -521
  39. package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
  40. package/dist/commonjs/components/Inspector/InspectorHeader.js +219 -1093
  41. package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
  42. package/dist/commonjs/components/Inspector/MainScreen.js +60 -332
  43. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +136 -278
  44. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +134 -361
  45. package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
  46. package/dist/commonjs/components/Inspector/NetworkDetail.js +96 -432
  47. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
  48. package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
  49. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +17 -433
  50. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
  51. package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
  52. package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
  53. package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
  54. package/dist/commonjs/components/Inspector/SettingsPanel.js +431 -3431
  55. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
  56. package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
  57. package/dist/commonjs/components/Inspector/TabBar.js +47 -183
  58. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +34 -408
  59. package/dist/commonjs/components/JsonViewer.js +168 -380
  60. package/dist/commonjs/components/LogCard.js +57 -567
  61. package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
  62. package/dist/commonjs/components/MetaAccordion.js +69 -238
  63. package/dist/commonjs/components/MiniBarChart.js +3 -56
  64. package/dist/commonjs/components/MiniLineChart.js +3 -58
  65. package/dist/commonjs/components/NetworkIcons.d.ts +7 -0
  66. package/dist/commonjs/components/NetworkIcons.js +479 -997
  67. package/dist/commonjs/components/QRCodeView.js +5 -79
  68. package/dist/commonjs/components/SectionHeader.js +15 -37
  69. package/dist/commonjs/components/SegmentedTabs.js +7 -61
  70. package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
  71. package/dist/commonjs/components/Slider.js +15 -243
  72. package/dist/commonjs/components/SourcePageCard.js +30 -89
  73. package/dist/commonjs/components/Toast.js +5 -147
  74. package/dist/commonjs/components/TouchableScale.js +3 -24
  75. package/dist/commonjs/components/TreeNode.js +55 -130
  76. package/dist/commonjs/console.js +1 -16
  77. package/dist/commonjs/constants/index.js +1 -32
  78. package/dist/commonjs/constants/telemetryConfig.js +1 -6
  79. package/dist/commonjs/constants/version.d.ts +1 -1
  80. package/dist/commonjs/constants/version.js +1 -4
  81. package/dist/commonjs/crash.js +1 -23
  82. package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
  83. package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
  84. package/dist/commonjs/customHooks/consoleLogger.js +6 -445
  85. package/dist/commonjs/customHooks/crashHandler.js +7 -656
  86. package/dist/commonjs/customHooks/logFilters.js +1 -23
  87. package/dist/commonjs/customHooks/networkLogger.js +2 -536
  88. package/dist/commonjs/customHooks/performanceTracker.js +63 -750
  89. package/dist/commonjs/customHooks/reduxLogger.js +2 -313
  90. package/dist/commonjs/customHooks/storageInspector.js +1 -435
  91. package/dist/commonjs/customHooks/useAccordion.js +1 -18
  92. package/dist/commonjs/decorators/index.js +1 -100
  93. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
  94. package/dist/commonjs/helpers/index.js +8 -921
  95. package/dist/commonjs/helpers/memoryManager.js +1 -99
  96. package/dist/commonjs/helpers/qrGenerator.js +1 -367
  97. package/dist/commonjs/helpers/remoteConfig.js +1 -165
  98. package/dist/commonjs/helpers/searchQueryParser.js +1 -62
  99. package/dist/commonjs/helpers/settingsStore.js +1 -144
  100. package/dist/commonjs/helpers/telemetry.js +1 -501
  101. package/dist/commonjs/helpers/toast.js +1 -20
  102. package/dist/commonjs/i18n/index.js +1 -90
  103. package/dist/commonjs/i18n/locales/en.json +1 -1122
  104. package/dist/commonjs/index.js +5 -2153
  105. package/dist/commonjs/metro.js +6 -468
  106. package/dist/commonjs/native/NativeInspector.d.ts +3 -0
  107. package/dist/commonjs/native/NativeInspector.js +1 -402
  108. package/dist/commonjs/native/NativeNetworkInspector.d.ts +1 -0
  109. package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
  110. package/dist/commonjs/network.js +1 -13
  111. package/dist/commonjs/performance.js +1 -29
  112. package/dist/commonjs/redux.js +1 -20
  113. package/dist/commonjs/storage.js +1 -14
  114. package/dist/commonjs/styles/AppColors.js +1 -423
  115. package/dist/commonjs/styles/AppFonts.js +1 -17
  116. package/dist/commonjs/styles/common.js +1 -190
  117. package/dist/commonjs/styles/index.d.ts +6 -0
  118. package/dist/commonjs/styles/index.js +1 -1589
  119. package/dist/commonjs/types/enums.d.ts +2 -1
  120. package/dist/commonjs/types/enums.js +1 -150
  121. package/dist/commonjs/types/index.js +1 -18
  122. package/dist/commonjs/types/interfaces.d.ts +7 -0
  123. package/dist/commonjs/types/interfaces.js +1 -2
  124. package/dist/esm/analytics.js +1 -2
  125. package/dist/esm/bundle.js +1 -2
  126. package/dist/esm/capture.d.ts +2 -0
  127. package/dist/esm/capture.js +1 -29
  128. package/dist/esm/components/AnalyticsDetail.js +171 -664
  129. package/dist/esm/components/AnalyticsEventCard.js +77 -335
  130. package/dist/esm/components/AnalyticsGraph.js +95 -357
  131. package/dist/esm/components/AnimatedEntrance.js +1 -6
  132. package/dist/esm/components/AppHeaderLogo.js +7 -94
  133. package/dist/esm/components/BrandCircleIcon.js +114 -119
  134. package/dist/esm/components/BrandSquareIcon.js +73 -78
  135. package/dist/esm/components/CodeSnippet.js +58 -595
  136. package/dist/esm/components/ConsoleLogCard.js +91 -526
  137. package/dist/esm/components/CopyButton.js +3 -51
  138. package/dist/esm/components/DiffViewer.js +22 -48
  139. package/dist/esm/components/DomainHeader.js +43 -138
  140. package/dist/esm/components/EmptyState.d.ts +1 -0
  141. package/dist/esm/components/EmptyState.js +17 -56
  142. package/dist/esm/components/EndOfListFooter.js +15 -83
  143. package/dist/esm/components/ErrorBoundary.js +125 -582
  144. package/dist/esm/components/HeadersSection.js +52 -93
  145. package/dist/esm/components/HighlightText.js +17 -53
  146. package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
  147. package/dist/esm/components/Inspector/AboutModal.js +351 -0
  148. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
  149. package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
  150. package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
  151. package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
  152. package/dist/esm/components/Inspector/CrashDetail.js +236 -747
  153. package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
  154. package/dist/esm/components/Inspector/CrashTab.js +177 -711
  155. package/dist/esm/components/Inspector/DebuggingTab.js +156 -923
  156. package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
  157. package/dist/esm/components/Inspector/FabLauncher.js +85 -49
  158. package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
  159. package/dist/esm/components/Inspector/FeedbackModal.d.ts +9 -0
  160. package/dist/esm/components/Inspector/FeedbackModal.js +182 -499
  161. package/dist/esm/components/Inspector/InspectorContext.js +1 -12
  162. package/dist/esm/components/Inspector/InspectorHeader.js +309 -1145
  163. package/dist/esm/components/Inspector/LogDetail.js +235 -1023
  164. package/dist/esm/components/Inspector/MainScreen.js +86 -320
  165. package/dist/esm/components/Inspector/MediaGalleryTab.js +157 -259
  166. package/dist/esm/components/Inspector/MediaPreviewModal.js +153 -340
  167. package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
  168. package/dist/esm/components/Inspector/NetworkDetail.js +141 -472
  169. package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
  170. package/dist/esm/components/Inspector/NetworkTab.js +125 -517
  171. package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
  172. package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
  173. package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
  174. package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
  175. package/dist/esm/components/Inspector/ReduxTab.js +144 -722
  176. package/dist/esm/components/Inspector/SettingsPanel.js +647 -3609
  177. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
  178. package/dist/esm/components/Inspector/StorageTab.js +172 -866
  179. package/dist/esm/components/Inspector/TabBar.js +52 -183
  180. package/dist/esm/components/Inspector/UpdateAvailableModal.js +79 -416
  181. package/dist/esm/components/JsonViewer.js +179 -353
  182. package/dist/esm/components/LogCard.js +93 -565
  183. package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
  184. package/dist/esm/components/MetaAccordion.js +136 -267
  185. package/dist/esm/components/MiniBarChart.js +3 -18
  186. package/dist/esm/components/MiniLineChart.js +3 -20
  187. package/dist/esm/components/NetworkIcons.d.ts +7 -0
  188. package/dist/esm/components/NetworkIcons.js +481 -817
  189. package/dist/esm/components/QRCodeView.js +8 -45
  190. package/dist/esm/components/SectionHeader.js +22 -39
  191. package/dist/esm/components/SegmentedTabs.js +8 -57
  192. package/dist/esm/components/SkeletonPlaceholder.js +30 -163
  193. package/dist/esm/components/Slider.js +24 -213
  194. package/dist/esm/components/SourcePageCard.js +65 -86
  195. package/dist/esm/components/Toast.js +10 -117
  196. package/dist/esm/components/TouchableScale.js +3 -19
  197. package/dist/esm/components/TreeNode.js +58 -95
  198. package/dist/esm/console.js +1 -2
  199. package/dist/esm/constants/index.js +1 -28
  200. package/dist/esm/constants/telemetryConfig.js +1 -3
  201. package/dist/esm/constants/version.d.ts +1 -1
  202. package/dist/esm/constants/version.js +1 -1
  203. package/dist/esm/crash.js +1 -2
  204. package/dist/esm/customHooks/analyticsLogger.js +1 -230
  205. package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
  206. package/dist/esm/customHooks/consoleLogger.js +6 -432
  207. package/dist/esm/customHooks/crashHandler.js +7 -630
  208. package/dist/esm/customHooks/logFilters.js +1 -20
  209. package/dist/esm/customHooks/networkLogger.js +2 -519
  210. package/dist/esm/customHooks/performanceTracker.js +63 -723
  211. package/dist/esm/customHooks/reduxLogger.js +2 -293
  212. package/dist/esm/customHooks/storageInspector.js +1 -418
  213. package/dist/esm/customHooks/useAccordion.js +1 -16
  214. package/dist/esm/decorators/index.js +1 -95
  215. package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
  216. package/dist/esm/helpers/index.js +8 -861
  217. package/dist/esm/helpers/memoryManager.js +1 -91
  218. package/dist/esm/helpers/qrGenerator.js +1 -364
  219. package/dist/esm/helpers/remoteConfig.js +1 -160
  220. package/dist/esm/helpers/searchQueryParser.js +1 -59
  221. package/dist/esm/helpers/settingsStore.js +1 -134
  222. package/dist/esm/helpers/telemetry.js +1 -489
  223. package/dist/esm/helpers/toast.js +1 -15
  224. package/dist/esm/i18n/index.js +1 -78
  225. package/dist/esm/i18n/locales/en.json +1 -1122
  226. package/dist/esm/index.js +7 -1967
  227. package/dist/esm/metro.js +6 -459
  228. package/dist/esm/native/NativeInspector.d.ts +3 -0
  229. package/dist/esm/native/NativeInspector.js +1 -370
  230. package/dist/esm/native/NativeNetworkInspector.d.ts +1 -0
  231. package/dist/esm/native/NativeNetworkInspector.js +1 -2
  232. package/dist/esm/network.js +1 -1
  233. package/dist/esm/performance.js +1 -2
  234. package/dist/esm/redux.js +1 -1
  235. package/dist/esm/storage.js +1 -1
  236. package/dist/esm/styles/AppColors.js +1 -417
  237. package/dist/esm/styles/AppFonts.js +1 -13
  238. package/dist/esm/styles/common.js +1 -186
  239. package/dist/esm/styles/index.d.ts +6 -0
  240. package/dist/esm/styles/index.js +1 -1551
  241. package/dist/esm/types/enums.d.ts +2 -1
  242. package/dist/esm/types/enums.js +1 -147
  243. package/dist/esm/types/index.js +1 -2
  244. package/dist/esm/types/interfaces.d.ts +7 -0
  245. package/dist/esm/types/interfaces.js +1 -1
  246. package/ios/NetworkInspectorModule.mm +253 -136
  247. package/package.json +5 -3
  248. package/react-native-inapp-inspector.podspec +1 -1
  249. package/src/native/NativeInspector.ts +17 -0
  250. package/src/native/NativeNetworkInspector.ts +1 -0
  251. package/src/analytics.ts +0 -35
  252. package/src/bundle.ts +0 -25
  253. package/src/capture.ts +0 -101
  254. package/src/components/AnalyticsDetail.tsx +0 -870
  255. package/src/components/AnalyticsEventCard.tsx +0 -444
  256. package/src/components/AnalyticsGraph.tsx +0 -583
  257. package/src/components/AnimatedEntrance.tsx +0 -20
  258. package/src/components/AppHeaderLogo.tsx +0 -143
  259. package/src/components/BrandCircleIcon.tsx +0 -144
  260. package/src/components/BrandSquareIcon.tsx +0 -184
  261. package/src/components/CodeSnippet.tsx +0 -725
  262. package/src/components/ConsoleLogCard.tsx +0 -679
  263. package/src/components/CopyButton.tsx +0 -87
  264. package/src/components/DiffViewer.tsx +0 -82
  265. package/src/components/DomainHeader.tsx +0 -224
  266. package/src/components/EmptyState.tsx +0 -95
  267. package/src/components/EndOfListFooter.tsx +0 -100
  268. package/src/components/ErrorBoundary.tsx +0 -688
  269. package/src/components/HeadersSection.tsx +0 -172
  270. package/src/components/HighlightText.tsx +0 -100
  271. package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
  272. package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
  273. package/src/components/Inspector/BundleTab.tsx +0 -4768
  274. package/src/components/Inspector/ConsoleTab.tsx +0 -726
  275. package/src/components/Inspector/CrashDetail.tsx +0 -997
  276. package/src/components/Inspector/CrashFilterModal.tsx +0 -721
  277. package/src/components/Inspector/CrashTab.tsx +0 -933
  278. package/src/components/Inspector/DebuggingTab.tsx +0 -1103
  279. package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
  280. package/src/components/Inspector/FabLauncher.tsx +0 -80
  281. package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
  282. package/src/components/Inspector/FeedbackModal.tsx +0 -626
  283. package/src/components/Inspector/InspectorContext.tsx +0 -28
  284. package/src/components/Inspector/InspectorHeader.tsx +0 -1545
  285. package/src/components/Inspector/LogDetail.tsx +0 -1431
  286. package/src/components/Inspector/MainScreen.tsx +0 -459
  287. package/src/components/Inspector/MediaGalleryTab.tsx +0 -355
  288. package/src/components/Inspector/MediaPreviewModal.tsx +0 -435
  289. package/src/components/Inspector/NavigationTracker.tsx +0 -13
  290. package/src/components/Inspector/NetworkDetail.tsx +0 -795
  291. package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
  292. package/src/components/Inspector/NetworkTab.tsx +0 -820
  293. package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
  294. package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
  295. package/src/components/Inspector/PerformanceTab.tsx +0 -1967
  296. package/src/components/Inspector/ReduxDetail.tsx +0 -1651
  297. package/src/components/Inspector/ReduxTab.tsx +0 -987
  298. package/src/components/Inspector/SettingsPanel.tsx +0 -4580
  299. package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
  300. package/src/components/Inspector/StorageTab.tsx +0 -1159
  301. package/src/components/Inspector/TabBar.tsx +0 -263
  302. package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
  303. package/src/components/JsonViewer.tsx +0 -547
  304. package/src/components/LogCard.tsx +0 -694
  305. package/src/components/LogSyntaxHighlighter.tsx +0 -178
  306. package/src/components/MetaAccordion.tsx +0 -355
  307. package/src/components/MiniBarChart.tsx +0 -42
  308. package/src/components/MiniLineChart.tsx +0 -33
  309. package/src/components/NetworkIcons.tsx +0 -2599
  310. package/src/components/QRCodeView.tsx +0 -75
  311. package/src/components/SectionHeader.tsx +0 -101
  312. package/src/components/SegmentedTabs.tsx +0 -83
  313. package/src/components/SkeletonPlaceholder.tsx +0 -206
  314. package/src/components/Slider.tsx +0 -300
  315. package/src/components/SourcePageCard.tsx +0 -150
  316. package/src/components/Toast.tsx +0 -131
  317. package/src/components/TouchableScale.tsx +0 -61
  318. package/src/components/TreeNode.tsx +0 -171
  319. package/src/console.ts +0 -24
  320. package/src/constants/index.ts +0 -41
  321. package/src/constants/telemetryConfig.ts +0 -4
  322. package/src/constants/version.ts +0 -3
  323. package/src/crash.ts +0 -32
  324. package/src/customHooks/analyticsLogger.ts +0 -336
  325. package/src/customHooks/bundleAnalyzer.ts +0 -1256
  326. package/src/customHooks/consoleLogger.ts +0 -530
  327. package/src/customHooks/crashHandler.ts +0 -944
  328. package/src/customHooks/logFilters.ts +0 -32
  329. package/src/customHooks/networkLogger.ts +0 -624
  330. package/src/customHooks/performanceTracker.ts +0 -1014
  331. package/src/customHooks/reduxLogger.ts +0 -406
  332. package/src/customHooks/storageInspector.ts +0 -513
  333. package/src/customHooks/useAccordion.tsx +0 -27
  334. package/src/decorators/index.ts +0 -184
  335. package/src/helpers/gaAnalyticsRegistry.ts +0 -204
  336. package/src/helpers/index.ts +0 -1092
  337. package/src/helpers/memoryManager.ts +0 -138
  338. package/src/helpers/qrGenerator.ts +0 -430
  339. package/src/helpers/remoteConfig.ts +0 -212
  340. package/src/helpers/searchQueryParser.ts +0 -84
  341. package/src/helpers/settingsStore.ts +0 -171
  342. package/src/helpers/telemetry.ts +0 -568
  343. package/src/helpers/toast.ts +0 -17
  344. package/src/i18n/index.ts +0 -104
  345. package/src/i18n/locales/en.json +0 -1125
  346. package/src/index.tsx +0 -2635
  347. package/src/metro.ts +0 -598
  348. package/src/network.ts +0 -22
  349. package/src/performance.ts +0 -38
  350. package/src/redux.ts +0 -23
  351. package/src/storage.ts +0 -18
  352. package/src/styles/AppColors.ts +0 -455
  353. package/src/styles/AppFonts.ts +0 -26
  354. package/src/styles/common.ts +0 -209
  355. package/src/styles/index.ts +0 -1606
  356. package/src/types/enums.ts +0 -208
  357. package/src/types/index.ts +0 -34
  358. package/src/types/interfaces.ts +0 -530
@@ -1,45 +1,8 @@
1
- import React, { useMemo } from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
- import Svg, { Rect, G } from 'react-native-svg';
4
- import { generateQRMatrix } from '../helpers/qrGenerator';
5
- import { AppColors } from '../styles/AppColors';
6
- export const QRCodeView = ({ value, size = 200, color = '#000000', backgroundColor = '#FFFFFF', }) => {
7
- const matrix = useMemo(() => generateQRMatrix(value || 'http://localhost:8081'), [value]);
8
- const numCells = matrix.length || 21;
9
- const margin = 4;
10
- const totalCells = numCells + margin * 2;
11
- const cellSize = size / totalCells;
12
- return (<View style={[
13
- styles.container,
14
- {
15
- width: size + 20,
16
- height: size + 20,
17
- backgroundColor,
18
- },
19
- ]}>
20
- <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
21
- <Rect width={size} height={size} fill={backgroundColor}/>
22
- <G>
23
- {matrix.map((row, r) => row.map((cell, c) => {
24
- if (!cell)
25
- return null;
26
- return (<Rect key={`${r}-${c}`} x={(c + margin) * cellSize} y={(r + margin) * cellSize} width={cellSize + 0.3} height={cellSize + 0.3} fill={color}/>);
27
- }))}
28
- </G>
29
- </Svg>
30
- </View>);
31
- };
32
- const styles = StyleSheet.create({
33
- container: {
34
- padding: 10,
35
- borderRadius: 14,
36
- alignItems: 'center',
37
- justifyContent: 'center',
38
- shadowColor: AppColors.black,
39
- shadowOffset: { width: 0, height: 3 },
40
- shadowOpacity: 0.15,
41
- shadowRadius: 8,
42
- elevation: 4,
43
- },
44
- });
45
- export default QRCodeView;
1
+ import{useMemo as V}from"react";import{View as G,StyleSheet as M}from"react-native";import O,{Rect as F,G as Q}from"react-native-svg";import{generateQRMatrix as b}from"../helpers/qrGenerator";import{AppColors as j}from"../styles/AppColors";export const QRCodeView=({value:r,size:t=200,color:R="#000000",backgroundColor:i="#FFFFFF"})=>{const n=V(()=>b(r||"http://localhost:8081"),[r]),C=n.length||21,o=4,S=C+o*2,e=t/S;return<G style={[k.container,{width:t+20,height:t+20,backgroundColor:i}]}>
2
+ <O width={t}height={t}viewBox={`0 0 ${t} ${t}`}>
3
+ <F width={t}height={t}fill={i}/>
4
+ <Q>
5
+ {n.map(($,h)=>$.map((v,l)=>v?<F key={`${h}-${l}`}x={(l+o)*e}y={(h+o)*e}width={e+.3}height={e+.3}fill={R}/>:null))}
6
+ </Q>
7
+ </O>
8
+ </G>};const k=M.create({container:{padding:10,borderRadius:14,alignItems:"center",justifyContent:"center",shadowColor:j.black,shadowOffset:{width:0,height:3},shadowOpacity:.15,shadowRadius:8,elevation:4}});export default QRCodeView;
@@ -1,39 +1,22 @@
1
- import React from 'react';
2
- import { View, Pressable, Text } from 'react-native';
3
- import { AppColors } from '../styles/AppColors';
4
- import CopyButton from './CopyButton';
5
- import TouchableScale from './TouchableScale';
6
- import { RequestIcon, ResponseIcon, HeadersIcon, DiffIcon, ChevronIcon, SearchIcon, } from './NetworkIcons';
7
- import styles from '../styles';
8
- const SectionHeader = ({ title, value, expanded, onToggleExpand, showDiff, isDiffing, onToggleDiff, showSearch, isSearching, onToggleSearch, }) => {
9
- const isOpen = expanded === undefined ? false : !!expanded;
10
- return (<View style={styles.sectionHeaderGradient}>
11
- <View style={styles.sectionHeaderRow}>
12
- <Pressable style={styles.sectionTitleRow} onPress={onToggleExpand} hitSlop={12}>
13
- {title === 'Request' || title === 'API' ? (<RequestIcon color={AppColors.offerPurple}/>) : title === 'Response' ? (<ResponseIcon color={AppColors.greenColor}/>) : (<HeadersIcon color={AppColors.skyBlue}/>)}
14
- <Text style={styles.sectionTitle}>{title}</Text>
15
- </Pressable>
16
- <View style={styles.sectionHeaderActions}>
17
- {showSearch && (<TouchableScale onPress={onToggleSearch} hitSlop={12} style={[
18
- styles.iconSquareBtn,
19
- isSearching ? styles.iconSquareBtnActive : null,
20
- ]}>
21
- <SearchIcon color={isSearching ? AppColors.skyBlue : AppColors.grayTextWeak} size={14}/>
22
- </TouchableScale>)}
23
- {showDiff && (<TouchableScale onPress={onToggleDiff} hitSlop={12} style={[
24
- styles.iconSquareBtn,
25
- isDiffing ? styles.iconSquareBtnActive : null,
26
- ]}>
27
- <DiffIcon color={isDiffing ? AppColors.skyBlue : AppColors.grayTextWeak} size={14}/>
28
- </TouchableScale>)}
29
- <CopyButton value={value} label={title}/>
30
- <TouchableScale onPress={onToggleExpand} hitSlop={12} style={styles.iconSquareBtn}>
31
- <View style={{ transform: [{ rotate: isOpen ? '180deg' : '0deg' }] }}>
32
- <ChevronIcon color={AppColors.grayTextStrong} size={14}/>
33
- </View>
34
- </TouchableScale>
35
- </View>
36
- </View>
37
- </View>);
38
- };
39
- export default SectionHeader;
1
+ import"react";import{View as S,Pressable as A,Text as H}from"react-native";import{AppColors as o}from"../styles/AppColors";import V from"./CopyButton";import T from"./TouchableScale";import{RequestIcon as C,ResponseIcon as W,HeadersIcon as G,DiffIcon as O,ChevronIcon as D,SearchIcon as F}from"./NetworkIcons";import e from"../styles";const J=({title:r,value:b,expanded:h,onToggleExpand:B,showDiff:q,isDiffing:d,onToggleDiff:w,showSearch:I,isSearching:P,onToggleSearch:R})=>{const k=h===void 0?!1:!!h;return<S style={e.sectionHeaderGradient}>
2
+ <S style={e.sectionHeaderRow}>
3
+ <A style={e.sectionTitleRow}onPress={B}hitSlop={12}>
4
+ {r==="Request"||r==="API"?<C color={o.offerPurple}/>:r==="Response"?<W color={o.greenColor}/>:<G color={o.skyBlue}/>}
5
+ <H style={e.sectionTitle}>{r}</H>
6
+ </A>
7
+ <S style={e.sectionHeaderActions}>
8
+ {I&&<T onPress={R}hitSlop={12}style={[e.iconSquareBtn,P?e.iconSquareBtnActive:null]}>
9
+ <F color={P?o.skyBlue:o.grayTextWeak}size={14}/>
10
+ </T>}
11
+ {q&&<T onPress={w}hitSlop={12}style={[e.iconSquareBtn,d?e.iconSquareBtnActive:null]}>
12
+ <O color={d?o.skyBlue:o.grayTextWeak}size={14}/>
13
+ </T>}
14
+ <V value={b}label={r}/>
15
+ <T onPress={B}hitSlop={12}style={e.iconSquareBtn}>
16
+ <S style={{transform:[{rotate:k?"180deg":"0deg"}]}}>
17
+ <D color={o.grayTextStrong}size={14}/>
18
+ </S>
19
+ </T>
20
+ </S>
21
+ </S>
22
+ </S>};export default J;
@@ -1,57 +1,8 @@
1
- import React from 'react';
2
- import { Pressable, Text, View } from 'react-native';
3
- import { AppColors } from '../styles/AppColors';
4
- import { AppFonts } from '../styles/AppFonts';
5
- const SegmentedTabs = React.memo(({ tabs, activeKey, onChange, style }) => (<View style={[
6
- {
7
- flexDirection: 'row',
8
- borderRadius: 10,
9
- backgroundColor: `${AppColors.slate200}80`,
10
- padding: 3,
11
- borderWidth: 1,
12
- borderColor: AppColors.dividerColor,
13
- gap: 3,
14
- },
15
- style,
16
- ]}>
17
- {tabs.map((tab) => {
18
- const isActive = activeKey === tab.key;
19
- return (<Pressable key={tab.key} onPress={() => onChange(tab.key)} style={({ pressed }) => [
20
- {
21
- flex: 1,
22
- paddingVertical: 7,
23
- paddingHorizontal: 6,
24
- borderRadius: 7,
25
- backgroundColor: isActive
26
- ? AppColors.brandPurple
27
- : 'transparent',
28
- alignItems: 'center',
29
- justifyContent: 'center',
30
- gap: 4.5,
31
- flexDirection: 'row',
32
- opacity: pressed ? 0.8 : 1,
33
- },
34
- isActive && {
35
- shadowColor: AppColors.brandPurple,
36
- shadowOffset: { width: 0, height: 1 },
37
- shadowOpacity: 0.25,
38
- shadowRadius: 3,
39
- elevation: 2,
40
- },
41
- ]}>
42
- {tab.icon ? tab.icon(isActive) : null}
43
- <Text numberOfLines={1} ellipsizeMode="tail" style={{
44
- flexShrink: 1,
45
- fontFamily: AppFonts.interBold,
46
- fontSize: 10.5,
47
- color: isActive
48
- ? AppColors.white
49
- : AppColors.grayText,
50
- letterSpacing: 0.2,
51
- }}>
52
- {tab.label}
53
- </Text>
54
- </Pressable>);
55
- })}
56
- </View>));
57
- export default SegmentedTabs;
1
+ import d from"react";import{Pressable as C,Text as P,View as R}from"react-native";import{AppColors as o}from"../styles/AppColors";import{AppFonts as S}from"../styles/AppFonts";const T=d.memo(({tabs:i,activeKey:t,onChange:n,style:l})=><R style={[{flexDirection:"row",borderRadius:10,backgroundColor:`${o.slate200}80`,padding:3,borderWidth:1,borderColor:o.dividerColor,gap:3,minWidth:0},l]}>
2
+ {i.map(e=>{const r=t===e.key;return<C key={e.key}onPress={()=>n(e.key)}style={({pressed:a})=>[{flex:1,paddingVertical:7,paddingHorizontal:6,borderRadius:7,backgroundColor:r?o.brandPurple:"transparent",alignItems:"center",justifyContent:"center",gap:4.5,flexDirection:"row",opacity:a?.8:1},r&&{shadowColor:o.brandPurple,shadowOffset:{width:0,height:1},shadowOpacity:.25,shadowRadius:3,elevation:2}]}>
3
+ {e.icon?e.icon(r):null}
4
+ <P numberOfLines={1}ellipsizeMode="tail"style={{flexShrink:1,fontFamily:S.interBold,fontSize:10.5,color:r?o.white:o.grayText,letterSpacing:.2}}>
5
+ {e.label}
6
+ </P>
7
+ </C>})}
8
+ </R>);export default T;
@@ -1,173 +1,40 @@
1
- import React, { useEffect, useRef } from 'react';
2
- import { Animated, StyleSheet, View } from 'react-native';
3
- import { AppColors } from '../styles/AppColors';
4
- export const SkeletonPlaceholder = React.memo(function SkeletonPlaceholder({ cardCount = 4, }) {
5
- const shimmerAnim = useRef(new Animated.Value(0.35)).current;
6
- useEffect(() => {
7
- const animation = Animated.loop(Animated.sequence([
8
- Animated.timing(shimmerAnim, {
9
- toValue: 0.85,
10
- duration: 750,
11
- useNativeDriver: false,
12
- }),
13
- Animated.timing(shimmerAnim, {
14
- toValue: 0.35,
15
- duration: 750,
16
- useNativeDriver: false,
17
- }),
18
- ]));
19
- animation.start();
20
- return () => animation.stop();
21
- }, [shimmerAnim]);
22
- return (<View style={skeletonStyles.container}>
1
+ import B,{useEffect as R,useRef as x}from"react";import{Animated as k,StyleSheet as v,View as S}from"react-native";import{AppColors as w}from"../styles/AppColors";export const SkeletonPlaceholder=B.memo(function({cardCount:C=4}){const b=x(new k.Value(.35)).current;return R(()=>{const f=k.loop(k.sequence([k.timing(b,{toValue:.85,duration:750,useNativeDriver:!1}),k.timing(b,{toValue:.35,duration:750,useNativeDriver:!1})]));return f.start(),()=>f.stop()},[b]),<S style={e.container}>
23
2
 
24
- <View style={skeletonStyles.toolbarSkeleton}>
25
- <Animated.View style={[
26
- skeletonStyles.searchBarSkeleton,
27
- { opacity: shimmerAnim },
28
- ]}/>
29
- <View style={skeletonStyles.actionButtonsRow}>
30
- <Animated.View style={[skeletonStyles.iconButtonSkeleton, { opacity: shimmerAnim }]}/>
31
- <Animated.View style={[skeletonStyles.iconButtonSkeleton, { opacity: shimmerAnim }]}/>
32
- </View>
33
- </View>
3
+ <S style={e.toolbarSkeleton}>
4
+ <k.View style={[e.searchBarSkeleton,{opacity:b}]}/>
5
+ <S style={e.actionButtonsRow}>
6
+ <k.View style={[e.iconButtonSkeleton,{opacity:b}]}/>
7
+ <k.View style={[e.iconButtonSkeleton,{opacity:b}]}/>
8
+ </S>
9
+ </S>
34
10
 
35
11
 
36
- <View style={skeletonStyles.chipStripSkeleton}>
37
- <Animated.View style={[skeletonStyles.chipSkeleton, { width: 48, opacity: shimmerAnim }]}/>
38
- <Animated.View style={[skeletonStyles.chipSkeleton, { width: 68, opacity: shimmerAnim }]}/>
39
- <Animated.View style={[skeletonStyles.chipSkeleton, { width: 76, opacity: shimmerAnim }]}/>
40
- <Animated.View style={[skeletonStyles.chipSkeleton, { width: 58, opacity: shimmerAnim }]}/>
41
- </View>
12
+ <S style={e.chipStripSkeleton}>
13
+ <k.View style={[e.chipSkeleton,{width:48,opacity:b}]}/>
14
+ <k.View style={[e.chipSkeleton,{width:68,opacity:b}]}/>
15
+ <k.View style={[e.chipSkeleton,{width:76,opacity:b}]}/>
16
+ <k.View style={[e.chipSkeleton,{width:58,opacity:b}]}/>
17
+ </S>
42
18
 
43
19
 
44
- {Array.from({ length: cardCount }).map((_, i) => (<Animated.View key={`skeleton_card_${i}`} style={[skeletonStyles.cardSkeleton, { opacity: shimmerAnim }]}>
20
+ {Array.from({length:C}).map((f,V)=><k.View key={`skeleton_card_${V}`}style={[e.cardSkeleton,{opacity:b}]}>
45
21
 
46
- <View style={skeletonStyles.cardTopRow}>
47
- <View style={skeletonStyles.badgeGroup}>
48
- <View style={skeletonStyles.statusBadgeSkeleton}/>
49
- <View style={skeletonStyles.methodBadgeSkeleton}/>
50
- </View>
51
- <View style={skeletonStyles.timeSkeleton}/>
52
- </View>
22
+ <S style={e.cardTopRow}>
23
+ <S style={e.badgeGroup}>
24
+ <S style={e.statusBadgeSkeleton}/>
25
+ <S style={e.methodBadgeSkeleton}/>
26
+ </S>
27
+ <S style={e.timeSkeleton}/>
28
+ </S>
53
29
 
54
30
 
55
- <View style={skeletonStyles.urlLineLong}/>
56
- <View style={skeletonStyles.urlLineShort}/>
31
+ <S style={e.urlLineLong}/>
32
+ <S style={e.urlLineShort}/>
57
33
 
58
34
 
59
- <View style={skeletonStyles.cardBottomRow}>
60
- <View style={skeletonStyles.metaPillSkeleton}/>
61
- <View style={skeletonStyles.metaPillSkeleton}/>
62
- </View>
63
- </Animated.View>))}
64
- </View>);
65
- });
66
- const skeletonStyles = StyleSheet.create({
67
- container: {
68
- flex: 1,
69
- paddingHorizontal: 12,
70
- paddingTop: 8,
71
- },
72
- toolbarSkeleton: {
73
- flexDirection: 'row',
74
- alignItems: 'center',
75
- gap: 8,
76
- marginBottom: 8,
77
- },
78
- searchBarSkeleton: {
79
- flex: 1,
80
- height: 36,
81
- borderRadius: 8,
82
- backgroundColor: AppColors.graySurface,
83
- borderWidth: 1,
84
- borderColor: AppColors.dividerColor,
85
- },
86
- actionButtonsRow: {
87
- flexDirection: 'row',
88
- gap: 6,
89
- },
90
- iconButtonSkeleton: {
91
- width: 36,
92
- height: 36,
93
- borderRadius: 8,
94
- backgroundColor: AppColors.graySurface,
95
- borderWidth: 1,
96
- borderColor: AppColors.dividerColor,
97
- },
98
- chipStripSkeleton: {
99
- flexDirection: 'row',
100
- gap: 6,
101
- marginBottom: 10,
102
- },
103
- chipSkeleton: {
104
- height: 24,
105
- borderRadius: 6,
106
- backgroundColor: AppColors.graySurface,
107
- borderWidth: 1,
108
- borderColor: AppColors.dividerColor,
109
- },
110
- cardSkeleton: {
111
- backgroundColor: AppColors.primaryLight,
112
- borderRadius: 10,
113
- padding: 12,
114
- marginBottom: 8,
115
- borderWidth: 1,
116
- borderColor: AppColors.dividerColor,
117
- },
118
- cardTopRow: {
119
- flexDirection: 'row',
120
- justifyContent: 'space-between',
121
- alignItems: 'center',
122
- marginBottom: 8,
123
- },
124
- badgeGroup: {
125
- flexDirection: 'row',
126
- alignItems: 'center',
127
- gap: 6,
128
- },
129
- statusBadgeSkeleton: {
130
- width: 38,
131
- height: 18,
132
- borderRadius: 4,
133
- backgroundColor: AppColors.graySurface,
134
- },
135
- methodBadgeSkeleton: {
136
- width: 44,
137
- height: 18,
138
- borderRadius: 4,
139
- backgroundColor: AppColors.graySurface,
140
- },
141
- timeSkeleton: {
142
- width: 48,
143
- height: 12,
144
- borderRadius: 4,
145
- backgroundColor: AppColors.graySurface,
146
- },
147
- urlLineLong: {
148
- height: 13,
149
- borderRadius: 4,
150
- backgroundColor: AppColors.graySurface,
151
- marginBottom: 5,
152
- width: '90%',
153
- },
154
- urlLineShort: {
155
- height: 11,
156
- borderRadius: 4,
157
- backgroundColor: AppColors.graySurface,
158
- marginBottom: 8,
159
- width: '55%',
160
- },
161
- cardBottomRow: {
162
- flexDirection: 'row',
163
- gap: 8,
164
- marginTop: 2,
165
- },
166
- metaPillSkeleton: {
167
- width: 52,
168
- height: 14,
169
- borderRadius: 4,
170
- backgroundColor: AppColors.graySurface,
171
- },
172
- });
173
- export default SkeletonPlaceholder;
35
+ <S style={e.cardBottomRow}>
36
+ <S style={e.metaPillSkeleton}/>
37
+ <S style={e.metaPillSkeleton}/>
38
+ </S>
39
+ </k.View>)}
40
+ </S>});const e=v.create({container:{flex:1,paddingHorizontal:12,paddingTop:8},toolbarSkeleton:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},searchBarSkeleton:{flex:1,height:36,borderRadius:8,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},actionButtonsRow:{flexDirection:"row",gap:6},iconButtonSkeleton:{width:36,height:36,borderRadius:8,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},chipStripSkeleton:{flexDirection:"row",gap:6,marginBottom:10},chipSkeleton:{height:24,borderRadius:6,backgroundColor:w.graySurface,borderWidth:1,borderColor:w.dividerColor},cardSkeleton:{backgroundColor:w.primaryLight,borderRadius:10,padding:12,marginBottom:8,borderWidth:1,borderColor:w.dividerColor},cardTopRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},badgeGroup:{flexDirection:"row",alignItems:"center",gap:6},statusBadgeSkeleton:{width:38,height:18,borderRadius:4,backgroundColor:w.graySurface},methodBadgeSkeleton:{width:44,height:18,borderRadius:4,backgroundColor:w.graySurface},timeSkeleton:{width:48,height:12,borderRadius:4,backgroundColor:w.graySurface},urlLineLong:{height:13,borderRadius:4,backgroundColor:w.graySurface,marginBottom:5,width:"90%"},urlLineShort:{height:11,borderRadius:4,backgroundColor:w.graySurface,marginBottom:8,width:"55%"},cardBottomRow:{flexDirection:"row",gap:8,marginTop:2},metaPillSkeleton:{width:52,height:14,borderRadius:4,backgroundColor:w.graySurface}});export default SkeletonPlaceholder;
@@ -1,222 +1,33 @@
1
- import React, { useRef, useState, useCallback, useMemo } from 'react';
2
- import { View, Text, StyleSheet, PanResponder, } from 'react-native';
3
- import { AppColors } from '../styles/AppColors';
4
- import { AppFonts } from '../styles/AppFonts';
5
- import TouchableScale from './TouchableScale';
6
- export const Slider = React.memo(({ value, onValueChange, min = 50, max = 90, step = 5, formatLabel = val => `${Math.round(val)}%`, quickPresets = [50, 60, 70, 80, 90], disabled = false, }) => {
7
- const trackWidthRef = useRef(0);
8
- const [trackWidth, setTrackWidth] = useState(0);
9
- const [isDragging, setIsDragging] = useState(false);
10
- const clampedValue = Math.max(min, Math.min(max, value));
11
- const percentage = (clampedValue - min) / (max - min || 1);
12
- const updateValueFromPosition = useCallback((pageX, trackPageX) => {
13
- if (trackWidthRef.current <= 0)
14
- return;
15
- const relativeX = Math.max(0, Math.min(trackWidthRef.current, pageX - trackPageX));
16
- const rawRatio = relativeX / trackWidthRef.current;
17
- let newValue = min + rawRatio * (max - min);
18
- if (step > 0) {
19
- newValue = Math.round(newValue / step) * step;
20
- }
21
- newValue = Math.max(min, Math.min(max, newValue));
22
- onValueChange(newValue);
23
- }, [min, max, step, onValueChange]);
24
- const trackContainerRef = useRef(null);
25
- const trackPageXRef = useRef(0);
26
- const measureTrack = useCallback(() => {
27
- if (trackContainerRef.current) {
28
- trackContainerRef.current.measure((_x, _y, _width, _height, pageX) => {
29
- trackPageXRef.current = pageX;
30
- });
31
- }
32
- }, []);
33
- const panResponder = useMemo(() => PanResponder.create({
34
- onStartShouldSetPanResponder: () => !disabled,
35
- onMoveShouldSetPanResponder: () => !disabled,
36
- onPanResponderGrant: (evt) => {
37
- setIsDragging(true);
38
- measureTrack();
39
- updateValueFromPosition(evt.nativeEvent.pageX, trackPageXRef.current);
40
- },
41
- onPanResponderMove: (evt, _gestureState) => {
42
- updateValueFromPosition(evt.nativeEvent.pageX, trackPageXRef.current);
43
- },
44
- onPanResponderRelease: () => {
45
- setIsDragging(false);
46
- },
47
- onPanResponderTerminate: () => {
48
- setIsDragging(false);
49
- },
50
- }), [disabled, measureTrack, updateValueFromPosition]);
51
- const handleLayout = (e) => {
52
- const w = e.nativeEvent.layout.width;
53
- trackWidthRef.current = w;
54
- setTrackWidth(w);
55
- measureTrack();
56
- };
57
- const thumbPosition = percentage * (trackWidth || 0);
58
- return (<View style={styles.container}>
1
+ import Z,{useRef as I,useState as O,useCallback as L,useMemo as q}from"react";import{View as R,Text as M,StyleSheet as ee,PanResponder as te}from"react-native";import{AppColors as e}from"../styles/AppColors";import{AppFonts as X}from"../styles/AppFonts";import Re from"./TouchableScale";export const Slider=Z.memo(({value:G,onValueChange:S,min:v=50,max:T=90,step:V=5,formatLabel:J=x=>`${Math.round(x)}%`,quickPresets:B=[50,60,70,80,90],disabled:A=!1})=>{const x=I(0),[_,K]=O(0),[j,P]=O(!1),W=Math.max(v,Math.min(T,G)),E=(W-v)/(T-v||1),D=L((r,o)=>{if(x.current<=0)return;const H=Math.max(0,Math.min(x.current,r-o))/x.current;let C=v+H*(T-v);V>0&&(C=Math.round(C/V)*V),C=Math.max(v,Math.min(T,C)),S(C)},[v,T,V,S]),$=I(null),z=I(0),F=L(()=>{$.current&&$.current.measure((r,o,Y,H,C)=>{z.current=C})},[]),N=q(()=>te.create({onStartShouldSetPanResponder:()=>!A,onMoveShouldSetPanResponder:()=>!A,onPanResponderGrant:r=>{P(!0),F(),D(r.nativeEvent.pageX,z.current)},onPanResponderMove:(r,o)=>{D(r.nativeEvent.pageX,z.current)},onPanResponderRelease:()=>{P(!1)},onPanResponderTerminate:()=>{P(!1)}}),[A,F,D]),Q=r=>{const o=r.nativeEvent.layout.width;x.current=o,K(o),F()},U=E*(_||0);return<R style={t.container}>
59
2
 
60
- <View style={styles.valueRow}>
61
- <Text style={styles.rangeText}>{min}%</Text>
62
- <View style={[
63
- styles.currentValueBadge,
64
- isDragging && styles.currentValueBadgeActive,
65
- ]}>
66
- <Text style={styles.currentValueText}>{formatLabel(clampedValue)}</Text>
67
- </View>
68
- <Text style={styles.rangeText}>{max}%</Text>
69
- </View>
3
+ <R style={t.valueRow}>
4
+ <M style={t.rangeText}>{v}%</M>
5
+ <R style={[t.currentValueBadge,j&&t.currentValueBadgeActive]}>
6
+ <M style={t.currentValueText}>{J(W)}</M>
7
+ </R>
8
+ <M style={t.rangeText}>{T}%</M>
9
+ </R>
70
10
 
71
11
 
72
- <View ref={trackContainerRef} onLayout={handleLayout} {...panResponder.panHandlers} style={styles.touchArea}>
12
+ <R ref={$}onLayout={Q}{...N.panHandlers}style={t.touchArea}>
73
13
 
74
- <View style={styles.rail}>
14
+ <R style={t.rail}>
75
15
 
76
- <View style={[
77
- styles.fillBar,
78
- { width: `${Math.round(percentage * 100)}%` },
79
- ]}/>
80
- </View>
16
+ <R style={[t.fillBar,{width:`${Math.round(E*100)}%`}]}/>
17
+ </R>
81
18
 
82
19
 
83
- <View style={[
84
- styles.thumb,
85
- {
86
- left: Math.max(0, Math.min((trackWidth || 0) - 24, thumbPosition - 12)),
87
- },
88
- isDragging && styles.thumbActive,
89
- ]}>
90
- <View style={styles.thumbCenterDot}/>
91
- </View>
92
- </View>
20
+ <R style={[t.thumb,{left:Math.max(0,Math.min((_||0)-24,U-12))},j&&t.thumbActive]}>
21
+ <R style={t.thumbCenterDot}/>
22
+ </R>
23
+ </R>
93
24
 
94
25
 
95
- {quickPresets && quickPresets.length > 0 && (<View style={styles.presetRow}>
96
- {quickPresets.map(preset => {
97
- const isSelected = Math.round(clampedValue) === preset;
98
- return (<TouchableScale key={preset} onPress={() => onValueChange(preset)} style={[
99
- styles.presetButton,
100
- isSelected && styles.presetButtonActive,
101
- ]}>
102
- <Text style={[
103
- styles.presetText,
104
- isSelected && styles.presetTextActive,
105
- ]}>
106
- {preset}%
107
- </Text>
108
- </TouchableScale>);
109
- })}
110
- </View>)}
111
- </View>);
112
- });
113
- const styles = StyleSheet.create({
114
- container: {
115
- paddingVertical: 4,
116
- gap: 8,
117
- },
118
- valueRow: {
119
- flexDirection: 'row',
120
- alignItems: 'center',
121
- justifyContent: 'space-between',
122
- paddingHorizontal: 2,
123
- },
124
- rangeText: {
125
- fontFamily: AppFonts.interMedium,
126
- fontSize: 11,
127
- color: AppColors.grayText,
128
- },
129
- currentValueBadge: {
130
- backgroundColor: `${AppColors.purple}1A`,
131
- borderColor: `${AppColors.purple}33`,
132
- borderWidth: 1,
133
- borderRadius: 8,
134
- paddingHorizontal: 10,
135
- paddingVertical: 2.5,
136
- },
137
- currentValueBadgeActive: {
138
- backgroundColor: AppColors.purple,
139
- borderColor: AppColors.purple,
140
- transform: [{ scale: 1.05 }],
141
- },
142
- currentValueText: {
143
- fontFamily: AppFonts.interBold,
144
- fontSize: 12,
145
- color: AppColors.purple,
146
- },
147
- touchArea: {
148
- height: 36,
149
- justifyContent: 'center',
150
- position: 'relative',
151
- },
152
- rail: {
153
- height: 8,
154
- backgroundColor: `${AppColors.grayTextWeak}2B`,
155
- borderRadius: 4,
156
- overflow: 'hidden',
157
- position: 'relative',
158
- },
159
- fillBar: {
160
- height: '100%',
161
- backgroundColor: AppColors.purple,
162
- borderRadius: 4,
163
- },
164
- thumb: {
165
- position: 'absolute',
166
- width: 24,
167
- height: 24,
168
- borderRadius: 12,
169
- backgroundColor: AppColors.white,
170
- borderWidth: 2.5,
171
- borderColor: AppColors.purple,
172
- alignItems: 'center',
173
- justifyContent: 'center',
174
- shadowColor: AppColors.black,
175
- shadowOffset: { width: 0, height: 2 },
176
- shadowOpacity: 0.18,
177
- shadowRadius: 3.5,
178
- elevation: 4,
179
- },
180
- thumbActive: {
181
- transform: [{ scale: 1.15 }],
182
- shadowOpacity: 0.28,
183
- shadowRadius: 5,
184
- elevation: 6,
185
- borderColor: AppColors.purple,
186
- },
187
- thumbCenterDot: {
188
- width: 6,
189
- height: 6,
190
- borderRadius: 3,
191
- backgroundColor: AppColors.purple,
192
- },
193
- presetRow: {
194
- flexDirection: 'row',
195
- alignItems: 'center',
196
- justifyContent: 'space-between',
197
- gap: 8,
198
- marginTop: 2,
199
- },
200
- presetButton: {
201
- flex: 1,
202
- paddingVertical: 5,
203
- borderRadius: 7,
204
- alignItems: 'center',
205
- backgroundColor: AppColors.grayBackground,
206
- borderWidth: 1,
207
- borderColor: AppColors.dividerColor,
208
- },
209
- presetButtonActive: {
210
- backgroundColor: `${AppColors.purple}20`,
211
- borderColor: AppColors.purple,
212
- },
213
- presetText: {
214
- fontFamily: AppFonts.interBold,
215
- fontSize: 10.5,
216
- color: AppColors.grayText,
217
- },
218
- presetTextActive: {
219
- color: AppColors.purple,
220
- },
221
- });
222
- export default Slider;
26
+ {B&&B.length>0&&<R style={t.presetRow}>
27
+ {B.map(r=>{const o=Math.round(W)===r;return<Re key={r}onPress={()=>S(r)}style={[t.presetButton,o&&t.presetButtonActive]}>
28
+ <M style={[t.presetText,o&&t.presetTextActive]}>
29
+ {r}%
30
+ </M>
31
+ </Re>})}
32
+ </R>}
33
+ </R>});const t=ee.create({container:{paddingVertical:4,gap:8},valueRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:2},rangeText:{fontFamily:X.interMedium,fontSize:11,color:e.grayText},currentValueBadge:{backgroundColor:`${e.purple}1A`,borderColor:`${e.purple}33`,borderWidth:1,borderRadius:8,paddingHorizontal:10,paddingVertical:2.5},currentValueBadgeActive:{backgroundColor:e.purple,borderColor:e.purple,transform:[{scale:1.05}]},currentValueText:{fontFamily:X.interBold,fontSize:12,color:e.purple},touchArea:{height:36,justifyContent:"center",position:"relative"},rail:{height:8,backgroundColor:`${e.grayTextWeak}2B`,borderRadius:4,overflow:"hidden",position:"relative"},fillBar:{height:"100%",backgroundColor:e.purple,borderRadius:4},thumb:{position:"absolute",width:24,height:24,borderRadius:12,backgroundColor:e.white,borderWidth:2.5,borderColor:e.purple,alignItems:"center",justifyContent:"center",shadowColor:e.black,shadowOffset:{width:0,height:2},shadowOpacity:.18,shadowRadius:3.5,elevation:4},thumbActive:{transform:[{scale:1.15}],shadowOpacity:.28,shadowRadius:5,elevation:6,borderColor:e.purple},thumbCenterDot:{width:6,height:6,borderRadius:3,backgroundColor:e.purple},presetRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,marginTop:2},presetButton:{flex:1,paddingVertical:5,borderRadius:7,alignItems:"center",backgroundColor:e.grayBackground,borderWidth:1,borderColor:e.dividerColor},presetButtonActive:{backgroundColor:`${e.purple}20`,borderColor:e.purple},presetText:{fontFamily:X.interBold,fontSize:10.5,color:e.grayText},presetTextActive:{color:e.purple}});export default Slider;