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,607 +1,70 @@
1
- import React, { useMemo, useState, useRef, useEffect } from 'react';
2
- import { StyleSheet, Text, View, Platform, FlatList, TextInput, Pressable } from 'react-native';
3
- import Svg, { Path } from 'react-native-svg';
4
- import { SearchIcon, ClearIcon } from './NetworkIcons';
5
- import CopyButton from './CopyButton';
6
- import TouchableScale from './TouchableScale';
7
- import { AppColors } from '../styles/AppColors';
8
- import { AppFonts } from '../styles/AppFonts';
9
- const escapeRegExp = (string) => {
10
- return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
11
- };
12
- const formatHTML = (html) => {
13
- if (!html)
14
- return '';
15
- let indent = 0;
16
- const cleaned = html
17
- .replace(/<([a-zA-Z0-9:-]+)([^>]*)>\s*<\/([a-zA-Z0-9:-]+)>/g, '<$1$2></$3>')
18
- .replace(/(<[^>]+>)/g, '\n$1\n')
19
- .replace(/\n+/g, '\n');
20
- const lines = cleaned.split('\n');
21
- const formatted = [];
22
- const selfClosingTags = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i;
23
- for (let i = 0; i < lines.length; i++) {
24
- const line = lines[i].trim();
25
- if (!line)
26
- continue;
27
- if (line.startsWith('</')) {
28
- indent = Math.max(0, indent - 1);
29
- }
30
- formatted.push(' '.repeat(indent) + line);
31
- if (line.startsWith('<') &&
32
- !line.startsWith('</') &&
33
- !line.startsWith('<!') &&
34
- !line.endsWith('/>')) {
35
- const tagNameMatch = line.match(/^<([a-zA-Z0-9:-]+)/);
36
- if (tagNameMatch) {
37
- const tagName = tagNameMatch[1];
38
- if (!selfClosingTags.test(tagName)) {
39
- const closeTagRegex = new RegExp(`</${escapeRegExp(tagName)}>`);
40
- if (!closeTagRegex.test(line)) {
41
- indent++;
42
- }
43
- }
44
- }
45
- }
46
- }
47
- return formatted.join('\n');
48
- };
49
- const formatCSS = (css) => {
50
- if (!css)
51
- return '';
52
- const cleaned = css
53
- .replace(/\s*\{\s*/g, ' {\n')
54
- .replace(/\s*;\s*/g, ';\n')
55
- .replace(/\s*\}\s*/g, '\n}\n')
56
- .replace(/\n+/g, '\n');
57
- const lines = cleaned.split('\n');
58
- let indent = 0;
59
- const formatted = [];
60
- for (let i = 0; i < lines.length; i++) {
61
- const line = lines[i].trim();
62
- if (!line)
63
- continue;
64
- if (line.startsWith('}')) {
65
- indent = Math.max(0, indent - 1);
66
- }
67
- formatted.push(' '.repeat(indent) + line);
68
- if (line.endsWith('{')) {
69
- indent++;
70
- }
71
- }
72
- return formatted.join('\n');
73
- };
74
- const formatJS = (js) => {
75
- if (!js)
76
- return '';
77
- const lines = js.split(/\r?\n/);
78
- let indent = 0;
79
- const formatted = [];
80
- for (let i = 0; i < lines.length; i++) {
81
- const line = lines[i].trim();
82
- if (!line)
83
- continue;
84
- let openCount = (line.match(/\{|\[/g) || []).length;
85
- let closeCount = (line.match(/\}|\]/g) || []).length;
86
- if (line.startsWith('}') || line.startsWith(']')) {
87
- indent = Math.max(0, indent - 1);
88
- }
89
- else if (closeCount > openCount) {
90
- indent = Math.max(0, indent - (closeCount - openCount));
91
- }
92
- formatted.push(' '.repeat(indent) + line);
93
- if (openCount > closeCount &&
94
- !line.startsWith('}') &&
95
- !line.startsWith(']')) {
96
- indent += openCount - closeCount;
97
- }
98
- else if (line.endsWith('{') || line.endsWith('[')) {
99
- indent++;
100
- }
101
- }
102
- return formatted.join('\n');
103
- };
104
- const tokenizeJS = (text) => {
105
- const tokens = [];
106
- const regex = /(\/\/.*|\/\*[\s\S]*?\*\/)|(\"(?:\\.|[^\"\\])*\"|\'(?:\\.|[^\'\\])*\'|\`(?:\\.|[^\`\\])*\`)|(\b(const|let|var|function|return|if|else|for|while|import|export|class|try|catch|new|this|async|await|break|continue|switch|case|default|throw|typeof|yield)\b)|(\b(console|window|document|fetch|global|require|module|exports|Promise|Map|Set|Array|Object|String|Number|Boolean)\b)|(\b\d+(?:\.\d+)?\b)/g;
107
- let lastIndex = 0;
108
- let match;
109
- while ((match = regex.exec(text)) !== null) {
110
- if (regex.lastIndex === match.index) {
111
- regex.lastIndex++;
112
- }
113
- if (match.index > lastIndex) {
114
- tokens.push({
115
- text: text.substring(lastIndex, match.index),
116
- type: 'plain',
117
- });
118
- }
119
- const matchedText = match[0];
120
- if (match[1])
121
- tokens.push({ text: matchedText, type: 'comment' });
122
- else if (match[2])
123
- tokens.push({ text: matchedText, type: 'string' });
124
- else if (match[3])
125
- tokens.push({ text: matchedText, type: 'keyword' });
126
- else if (match[4])
127
- tokens.push({ text: matchedText, type: 'builtin' });
128
- else if (match[5])
129
- tokens.push({ text: matchedText, type: 'number' });
130
- lastIndex = regex.lastIndex;
131
- }
132
- if (lastIndex < text.length) {
133
- tokens.push({ text: text.substring(lastIndex), type: 'plain' });
134
- }
135
- return tokens;
136
- };
137
- const tokenizeCSS = (text) => {
138
- const tokens = [];
139
- const regex = /(\/\*[\s\S]*?\*\/)|(\.[a-zA-Z0-9_-]+|#[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?=\s*\{))|([a-zA-Z0-9_-]+(?=\s*:))|(:[^;]+;)/g;
140
- let lastIndex = 0;
141
- let match;
142
- while ((match = regex.exec(text)) !== null) {
143
- if (regex.lastIndex === match.index) {
144
- regex.lastIndex++;
145
- }
146
- if (match.index > lastIndex) {
147
- tokens.push({
148
- text: text.substring(lastIndex, match.index),
149
- type: 'plain',
150
- });
151
- }
152
- const matchedText = match[0];
153
- if (match[1])
154
- tokens.push({ text: matchedText, type: 'comment' });
155
- else if (match[2])
156
- tokens.push({ text: matchedText, type: 'selector' });
157
- else if (match[3])
158
- tokens.push({ text: matchedText, type: 'property' });
159
- else if (match[4]) {
160
- tokens.push({ text: ':', type: 'plain' });
161
- tokens.push({ text: matchedText.substring(1), type: 'value' });
162
- }
163
- lastIndex = regex.lastIndex;
164
- }
165
- if (lastIndex < text.length) {
166
- tokens.push({ text: text.substring(lastIndex), type: 'plain' });
167
- }
168
- return tokens;
169
- };
170
- const tokenizeHTML = (text) => {
171
- const tokens = [];
172
- const regex = /(<!--[\s\S]*?-->)|(<\/?[a-zA-Z0-9:-]+>?)|(\"(?:\\.|[^\"\\])*\"|\'(?:\\.|[^\'\\])*\')|([a-zA-Z0-9:-]+(?=\s*=))/g;
173
- let lastIndex = 0;
174
- let match;
175
- while ((match = regex.exec(text)) !== null) {
176
- if (regex.lastIndex === match.index) {
177
- regex.lastIndex++;
178
- }
179
- if (match.index > lastIndex) {
180
- tokens.push({
181
- text: text.substring(lastIndex, match.index),
182
- type: 'plain',
183
- });
184
- }
185
- const matchedText = match[0];
186
- if (match[1])
187
- tokens.push({ text: matchedText, type: 'comment' });
188
- else if (match[2])
189
- tokens.push({ text: matchedText, type: 'tag' });
190
- else if (match[3])
191
- tokens.push({ text: matchedText, type: 'string' });
192
- else if (match[4])
193
- tokens.push({ text: matchedText, type: 'attribute' });
194
- lastIndex = regex.lastIndex;
195
- }
196
- if (lastIndex < text.length) {
197
- tokens.push({ text: text.substring(lastIndex), type: 'plain' });
198
- }
199
- return tokens;
200
- };
201
- const getStyleForType = (type) => {
202
- switch (type) {
203
- case 'comment':
204
- return styles.comment;
205
- case 'string':
206
- return styles.string;
207
- case 'keyword':
208
- return styles.keyword;
209
- case 'builtin':
210
- return styles.builtin;
211
- case 'number':
212
- return styles.number;
213
- case 'tag':
214
- return styles.tag;
215
- case 'attribute':
216
- return styles.attribute;
217
- case 'selector':
218
- return styles.selector;
219
- case 'property':
220
- return styles.property;
221
- case 'value':
222
- return styles.value;
223
- default:
224
- return [styles.plain, { color: AppColors.primaryBlack }];
225
- }
226
- };
227
- const ArrowUpIcon = ({ color = AppColors.slate500, size = 16 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
228
- <Path d="M18 15l-6-6-6 6" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
229
- </Svg>);
230
- const ArrowDownIcon = ({ color = AppColors.slate500, size = 16 }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
231
- <Path d="M6 9l6 6 6-6" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"/>
232
- </Svg>);
233
- const CodeSnippetLine = React.memo(({ line, lineIndex, language, search, isActiveMatch, }) => {
234
- const tokens = useMemo(() => {
235
- if (language === 'html')
236
- return tokenizeHTML(line);
237
- if (language === 'css')
238
- return tokenizeCSS(line);
239
- return tokenizeJS(line);
240
- }, [line, language]);
241
- const renderTokenText = (text, type) => {
242
- const baseStyle = getStyleForType(type);
243
- if (!search) {
244
- return <Text style={baseStyle}>{text}</Text>;
245
- }
246
- const parts = text.split(new RegExp(`(${escapeRegExp(search)})`, 'gi'));
247
- return (<Text style={baseStyle}>
248
- {parts.map((part, index) => {
249
- const isMatch = part.toLowerCase() === search.toLowerCase();
250
- return isMatch ? (<Text key={index} style={styles.highlight}>
251
- {part}
252
- </Text>) : (part);
253
- })}
254
- </Text>);
255
- };
256
- return (<View style={[styles.lineRow, isActiveMatch && styles.activeMatchRow]}>
1
+ import B,{useMemo as I,useState as R,useRef as D,useEffect as L}from"react";import{StyleSheet as _,Text as T,View as S,Platform as G,FlatList as Q,TextInput as O,Pressable as U}from"react-native";import F,{Path as A}from"react-native-svg";import{SearchIcon as J,ClearIcon as Y}from"./NetworkIcons";import K from"./CopyButton";import $ from"./TouchableScale";import{AppColors as e}from"../styles/AppColors";import{AppFonts as M}from"../styles/AppFonts";const V=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),X=n=>{if(!n)return"";let t=0;const i=n.replace(/<([a-zA-Z0-9:-]+)([^>]*)>\s*<\/([a-zA-Z0-9:-]+)>/g,"<$1$2></$3>").replace(/(<[^>]+>)/g,`
2
+ $1
3
+ `).replace(/\n+/g,`
4
+ `).split(`
5
+ `),r=[],o=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i;for(let d=0;d<i.length;d++){const s=i[d].trim();if(s&&(s.startsWith("</")&&(t=Math.max(0,t-1)),r.push(" ".repeat(t)+s),s.startsWith("<")&&!s.startsWith("</")&&!s.startsWith("<!")&&!s.endsWith("/>"))){const p=s.match(/^<([a-zA-Z0-9:-]+)/);if(p){const g=p[1];o.test(g)||new RegExp(`</${V(g)}>`).test(s)||t++}}}return r.join(`
6
+ `)},ee=n=>{if(!n)return"";const l=n.replace(/\s*\{\s*/g,` {
7
+ `).replace(/\s*;\s*/g,`;
8
+ `).replace(/\s*\}\s*/g,`
9
+ }
10
+ `).replace(/\n+/g,`
11
+ `).split(`
12
+ `);let i=0;const r=[];for(let o=0;o<l.length;o++){const d=l[o].trim();d&&(d.startsWith("}")&&(i=Math.max(0,i-1)),r.push(" ".repeat(i)+d),d.endsWith("{")&&i++)}return r.join(`
13
+ `)},te=n=>{if(!n)return"";const t=n.split(/\r?\n/);let l=0;const i=[];for(let r=0;r<t.length;r++){const o=t[r].trim();if(!o)continue;let d=(o.match(/\{|\[/g)||[]).length,s=(o.match(/\}|\]/g)||[]).length;o.startsWith("}")||o.startsWith("]")?l=Math.max(0,l-1):s>d&&(l=Math.max(0,l-(s-d))),i.push(" ".repeat(l)+o),d>s&&!o.startsWith("}")&&!o.startsWith("]")?l+=d-s:(o.endsWith("{")||o.endsWith("["))&&l++}return i.join(`
14
+ `)},re=n=>{const t=[],l=/(\/\/.*|\/\*[\s\S]*?\*\/)|(\"(?:\\.|[^\"\\])*\"|\'(?:\\.|[^\'\\])*\'|\`(?:\\.|[^\`\\])*\`)|(\b(const|let|var|function|return|if|else|for|while|import|export|class|try|catch|new|this|async|await|break|continue|switch|case|default|throw|typeof|yield)\b)|(\b(console|window|document|fetch|global|require|module|exports|Promise|Map|Set|Array|Object|String|Number|Boolean)\b)|(\b\d+(?:\.\d+)?\b)/g;let i=0,r;for(;(r=l.exec(n))!==null;){l.lastIndex===r.index&&l.lastIndex++,r.index>i&&t.push({text:n.substring(i,r.index),type:"plain"});const o=r[0];r[1]?t.push({text:o,type:"comment"}):r[2]?t.push({text:o,type:"string"}):r[3]?t.push({text:o,type:"keyword"}):r[4]?t.push({text:o,type:"builtin"}):r[5]&&t.push({text:o,type:"number"}),i=l.lastIndex}return i<n.length&&t.push({text:n.substring(i),type:"plain"}),t},ne=n=>{const t=[],l=/(\/\*[\s\S]*?\*\/)|(\.[a-zA-Z0-9_-]+|#[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?=\s*\{))|([a-zA-Z0-9_-]+(?=\s*:))|(:[^;]+;)/g;let i=0,r;for(;(r=l.exec(n))!==null;){l.lastIndex===r.index&&l.lastIndex++,r.index>i&&t.push({text:n.substring(i,r.index),type:"plain"});const o=r[0];r[1]?t.push({text:o,type:"comment"}):r[2]?t.push({text:o,type:"selector"}):r[3]?t.push({text:o,type:"property"}):r[4]&&(t.push({text:":",type:"plain"}),t.push({text:o.substring(1),type:"value"})),i=l.lastIndex}return i<n.length&&t.push({text:n.substring(i),type:"plain"}),t},oe=n=>{const t=[],l=/(<!--[\s\S]*?-->)|(<\/?[a-zA-Z0-9:-]+>?)|(\"(?:\\.|[^\"\\])*\"|\'(?:\\.|[^\'\\])*\')|([a-zA-Z0-9:-]+(?=\s*=))/g;let i=0,r;for(;(r=l.exec(n))!==null;){l.lastIndex===r.index&&l.lastIndex++,r.index>i&&t.push({text:n.substring(i,r.index),type:"plain"});const o=r[0];r[1]?t.push({text:o,type:"comment"}):r[2]?t.push({text:o,type:"tag"}):r[3]?t.push({text:o,type:"string"}):r[4]&&t.push({text:o,type:"attribute"}),i=l.lastIndex}return i<n.length&&t.push({text:n.substring(i),type:"plain"}),t},ie=n=>{switch(n){case"comment":return a.comment;case"string":return a.string;case"keyword":return a.keyword;case"builtin":return a.builtin;case"number":return a.number;case"tag":return a.tag;case"attribute":return a.attribute;case"selector":return a.selector;case"property":return a.property;case"value":return a.value;default:return[a.plain,{color:e.primaryBlack}]}},Se=({color:n=e.slate500,size:t=16})=><F width={t}height={t}viewBox="0 0 24 24"fill="none">
15
+ <A d="M18 15l-6-6-6 6"stroke={n}strokeWidth="2.5"strokeLinecap="round"strokeLinejoin="round"/>
16
+ </F>,Ce=({color:n=e.slate500,size:t=16})=><F width={t}height={t}viewBox="0 0 24 24"fill="none">
17
+ <A d="M6 9l6 6 6-6"stroke={n}strokeWidth="2.5"strokeLinecap="round"strokeLinejoin="round"/>
18
+ </F>,Te=B.memo(({line:n,lineIndex:t,language:l,search:i,isActiveMatch:r})=>{const o=I(()=>l==="html"?oe(n):l==="css"?ne(n):re(n),[n,l]),d=(s,p)=>{const g=ie(p);if(!i)return<T style={g}>{s}</T>;const v=s.split(new RegExp(`(${V(i)})`,"gi"));return<T style={g}>
19
+ {v.map((m,z)=>m.toLowerCase()===i.toLowerCase()?<T key={z}style={a.highlight}>
20
+ {m}
21
+ </T>:m)}
22
+ </T>};return<S style={[a.lineRow,r&&a.activeMatchRow]}>
257
23
 
258
- <View style={[styles.gutter, { backgroundColor: AppColors.grayBackground, borderRightColor: AppColors.grayBorderSecondary }, isActiveMatch && styles.activeMatchGutter]}>
259
- <Text style={[styles.lineNumber, { color: AppColors.grayTextWeak }, isActiveMatch && styles.activeMatchLineNumber]}>{lineIndex + 1}</Text>
260
- </View>
24
+ <S style={[a.gutter,{backgroundColor:e.grayBackground,borderRightColor:e.grayBorderSecondary},r&&a.activeMatchGutter]}>
25
+ <T style={[a.lineNumber,{color:e.grayTextWeak},r&&a.activeMatchLineNumber]}>{t+1}</T>
26
+ </S>
261
27
 
262
28
 
263
- <View style={styles.codeLine}>
264
- <Text style={[styles.codeLineText, { color: AppColors.primaryBlack }]}>
265
- {tokens.length === 0 ? (<Text style={[styles.plain, { color: AppColors.primaryBlack }]}> </Text>) : (tokens.map((token, tokenIdx) => (<React.Fragment key={tokenIdx}>
266
- {renderTokenText(token.text, token.type)}
267
- </React.Fragment>)))}
268
- </Text>
269
- </View>
270
- </View>);
271
- });
272
- const CodeSnippet = ({ code, language, search, }) => {
273
- const [searchQuery, setSearchQuery] = useState('');
274
- const [debouncedQuery, setDebouncedQuery] = useState('');
275
- const [currentMatchIdx, setCurrentMatchIdx] = useState(-1);
276
- const [visibleLinesCount, setVisibleLinesCount] = useState(200);
277
- const flatListRef = useRef(null);
278
- useEffect(() => {
279
- if (search !== undefined) {
280
- setSearchQuery(search);
281
- }
282
- }, [search]);
283
- useEffect(() => {
284
- const timer = setTimeout(() => {
285
- setDebouncedQuery(searchQuery);
286
- }, 300);
287
- return () => clearTimeout(timer);
288
- }, [searchQuery]);
289
- const formattedCode = useMemo(() => {
290
- if (!code)
291
- return '';
292
- if (code.length > 150000) {
293
- return code;
294
- }
295
- if (language === 'html')
296
- return formatHTML(code);
297
- if (language === 'css')
298
- return formatCSS(code);
299
- if (language === 'javascript')
300
- return formatJS(code);
301
- return code;
302
- }, [code, language]);
303
- const lines = useMemo(() => {
304
- if (!formattedCode)
305
- return [];
306
- return formattedCode.split(/\r?\n/);
307
- }, [formattedCode]);
308
- const matches = useMemo(() => {
309
- if (!debouncedQuery.trim() || debouncedQuery.length < 2)
310
- return [];
311
- const query = debouncedQuery.toLowerCase();
312
- const indices = [];
313
- for (let i = 0; i < lines.length; i++) {
314
- if (lines[i].toLowerCase().includes(query)) {
315
- indices.push(i);
316
- }
317
- }
318
- return indices;
319
- }, [debouncedQuery, lines]);
320
- useEffect(() => {
321
- setVisibleLinesCount(200);
322
- setSearchQuery(search || '');
323
- setCurrentMatchIdx(-1);
324
- }, [code, language]);
325
- useEffect(() => {
326
- if (matches.length > 0) {
327
- setCurrentMatchIdx(0);
328
- scrollToMatch(0);
329
- }
330
- else {
331
- setCurrentMatchIdx(-1);
332
- }
333
- }, [matches]);
334
- const scrollToMatch = (matchIdx) => {
335
- if (matches.length === 0 || matchIdx < 0 || matchIdx >= matches.length)
336
- return;
337
- const lineIdx = matches[matchIdx];
338
- if (lineIdx >= visibleLinesCount) {
339
- setVisibleLinesCount(lineIdx + 100);
340
- }
341
- setTimeout(() => {
342
- try {
343
- flatListRef.current?.scrollToIndex({
344
- index: lineIdx,
345
- animated: false,
346
- viewPosition: 0.3,
347
- });
348
- }
349
- catch (e) {
350
- }
351
- }, 50);
352
- };
353
- const onScrollToIndexFailed = (error) => {
354
- flatListRef.current?.scrollToOffset({
355
- offset: error.averageItemLength * error.index,
356
- animated: false,
357
- });
358
- setTimeout(() => {
359
- try {
360
- flatListRef.current?.scrollToIndex({
361
- index: error.index,
362
- animated: false,
363
- viewPosition: 0.3,
364
- });
365
- }
366
- catch (err) {
367
- console.warn('Scroll to line index failed after fallback retry:', err);
368
- }
369
- }, 60);
370
- };
371
- const handleNextMatch = () => {
372
- if (matches.length === 0)
373
- return;
374
- const nextIdx = (currentMatchIdx + 1) % matches.length;
375
- setCurrentMatchIdx(nextIdx);
376
- scrollToMatch(nextIdx);
377
- };
378
- const handlePrevMatch = () => {
379
- if (matches.length === 0)
380
- return;
381
- const prevIdx = (currentMatchIdx - 1 + matches.length) % matches.length;
382
- setCurrentMatchIdx(prevIdx);
383
- scrollToMatch(prevIdx);
384
- };
385
- const visibleLines = useMemo(() => {
386
- return lines.slice(0, visibleLinesCount);
387
- }, [lines, visibleLinesCount]);
388
- const handleEndReached = () => {
389
- if (visibleLinesCount < lines.length) {
390
- setVisibleLinesCount(prev => Math.min(prev + 150, lines.length));
391
- }
392
- };
393
- const renderLine = ({ item, index }) => {
394
- const isActiveMatch = matches.length > 0 && currentMatchIdx >= 0 && index === matches[currentMatchIdx];
395
- return (<CodeSnippetLine line={item} lineIndex={index} language={language} search={debouncedQuery} isActiveMatch={isActiveMatch}/>);
396
- };
397
- return (<View style={{ flex: 1 }}>
29
+ <S style={a.codeLine}>
30
+ <T style={[a.codeLineText,{color:e.primaryBlack}]}>
31
+ {o.length===0?<T style={[a.plain,{color:e.primaryBlack}]}> </T>:o.map((s,p)=><B.Fragment key={p}>
32
+ {d(s.text,s.type)}
33
+ </B.Fragment>)}
34
+ </T>
35
+ </S>
36
+ </S>}),ve=({code:n,language:t,search:l})=>{const[i,r]=R(""),[o,d]=R(""),[s,p]=R(-1),[g,v]=R(200),m=D(null);L(()=>{l!==void 0&&r(l)},[l]),L(()=>{const c=setTimeout(()=>{d(i)},300);return()=>clearTimeout(c)},[i]);const z=I(()=>n?n.length>15e4?n:t==="html"?X(n):t==="css"?ee(n):t==="javascript"?te(n):n:"",[n,t]),y=I(()=>z?z.split(/\r?\n/):[],[z]),u=I(()=>{if(!o.trim()||o.length<2)return[];const c=o.toLowerCase(),h=[];for(let C=0;C<y.length;C++)y[C].toLowerCase().includes(c)&&h.push(C);return h},[o,y]);L(()=>{v(200),r(l||""),p(-1)},[n,t]),L(()=>{u.length>0?(p(0),W(0)):p(-1)},[u]);const W=c=>{if(u.length===0||c<0||c>=u.length)return;const h=u[c];h>=g&&v(h+100),setTimeout(()=>{try{m.current?.scrollToIndex({index:h,animated:!1,viewPosition:.3})}catch{}},50)},P=c=>{m.current?.scrollToOffset({offset:c.averageItemLength*c.index,animated:!1}),setTimeout(()=>{try{m.current?.scrollToIndex({index:c.index,animated:!1,viewPosition:.3})}catch(h){console.warn("Scroll to line index failed after fallback retry:",h)}},60)},j=()=>{if(u.length===0)return;const c=(s+1)%u.length;p(c),W(c)},N=()=>{if(u.length===0)return;const c=(s-1+u.length)%u.length;p(c),W(c)},Z=I(()=>y.slice(0,g),[y,g]),E=()=>{g<y.length&&v(c=>Math.min(c+150,y.length))},H=({item:c,index:h})=>{const C=u.length>0&&s>=0&&h===u[s];return<Te line={c}lineIndex={h}language={t}search={o}isActiveMatch={C}/>};return<S style={{flex:1}}>
398
37
 
399
- <View style={styles.searchRow}>
400
- <View style={[styles.searchBar, { backgroundColor: AppColors.primaryLight, borderColor: AppColors.grayBorderSecondary }]}>
401
- <SearchIcon color={AppColors.grayTextWeak} size={15}/>
402
- <TextInput placeholder={`Search ${language.toUpperCase()}...`} placeholderTextColor={AppColors.grayTextWeak} value={searchQuery} onChangeText={setSearchQuery} style={[styles.searchInput, { color: AppColors.primaryBlack }]} autoCorrect={false} autoCapitalize="none"/>
38
+ <S style={a.searchRow}>
39
+ <S style={[a.searchBar,{backgroundColor:e.primaryLight,borderColor:e.grayBorderSecondary}]}>
40
+ <J color={e.grayTextWeak}size={15}/>
41
+ <O placeholder={`Search ${t.toUpperCase()}...`}placeholderTextColor={e.grayTextWeak}value={i}onChangeText={r}style={[a.searchInput,{color:e.primaryBlack}]}autoCorrect={!1}autoCapitalize="none"/>
403
42
 
404
43
 
405
- {debouncedQuery.length >= 2 && (<Text style={[styles.matchCountText, { backgroundColor: AppColors.grayBackground, color: AppColors.grayTextWeak }]}>
406
- {matches.length > 0 ? `${currentMatchIdx + 1}/${matches.length}` : '0/0'}
407
- </Text>)}
44
+ {o.length>=2&&<T style={[a.matchCountText,{backgroundColor:e.grayBackground,color:e.grayTextWeak}]}>
45
+ {u.length>0?`${s+1}/${u.length}`:"0/0"}
46
+ </T>}
408
47
 
409
- {searchQuery.length > 0 && (<Pressable onPress={() => setSearchQuery('')} hitSlop={8} style={styles.clearBtn}>
410
- <ClearIcon color={AppColors.grayTextWeak} size={12}/>
411
- </Pressable>)}
412
- </View>
48
+ {i.length>0&&<U onPress={()=>r("")}hitSlop={8}style={a.clearBtn}>
49
+ <Y color={e.grayTextWeak}size={12}/>
50
+ </U>}
51
+ </S>
413
52
 
414
53
 
415
- {matches.length > 0 && (<View style={[styles.navArrowsGroup, { backgroundColor: AppColors.primaryLight, borderColor: AppColors.grayBorderSecondary }]}>
416
- <TouchableScale onPress={handlePrevMatch} hitSlop={8} style={styles.navArrowBtn}>
417
- <ArrowUpIcon color={AppColors.grayTextStrong} size={14}/>
418
- </TouchableScale>
419
- <TouchableScale onPress={handleNextMatch} hitSlop={8} style={styles.navArrowBtn}>
420
- <ArrowDownIcon color={AppColors.grayTextStrong} size={14}/>
421
- </TouchableScale>
422
- </View>)}
54
+ {u.length>0&&<S style={[a.navArrowsGroup,{backgroundColor:e.primaryLight,borderColor:e.grayBorderSecondary}]}>
55
+ <$ onPress={N}hitSlop={8}style={a.navArrowBtn}>
56
+ <Se color={e.grayTextStrong}size={14}/>
57
+ </$>
58
+ <$ onPress={j}hitSlop={8}style={a.navArrowBtn}>
59
+ <Ce color={e.grayTextStrong}size={14}/>
60
+ </$>
61
+ </S>}
423
62
 
424
- <CopyButton value={code} label={`${language.toUpperCase()} Source`}/>
425
- </View>
63
+ <K value={n}label={`${t.toUpperCase()} Source`}/>
64
+ </S>
426
65
 
427
66
 
428
- <View style={[styles.container, { backgroundColor: AppColors.grayBackground, borderColor: AppColors.grayBorderSecondary }]}>
429
- <FlatList ref={flatListRef} data={visibleLines} renderItem={renderLine} keyExtractor={(_, index) => String(index)} maxToRenderPerBatch={30} windowSize={5} initialNumToRender={50} removeClippedSubviews={Platform.OS === 'android'} onEndReached={handleEndReached} onEndReachedThreshold={0.5} onScrollToIndexFailed={onScrollToIndexFailed}/>
430
- </View>
431
- </View>);
432
- };
433
- const monoFont = AppFonts.interRegular;
434
- const styles = StyleSheet.create({
435
- container: {
436
- flex: 1,
437
- backgroundColor: AppColors.slate50,
438
- borderRadius: 8,
439
- borderWidth: 1,
440
- borderColor: AppColors.slate200,
441
- overflow: 'hidden',
442
- },
443
- searchRow: {
444
- flexDirection: 'row',
445
- alignItems: 'center',
446
- marginBottom: 6,
447
- gap: 8,
448
- },
449
- searchBar: {
450
- flex: 1,
451
- flexDirection: 'row',
452
- alignItems: 'center',
453
- backgroundColor: AppColors.white,
454
- borderRadius: 8,
455
- borderWidth: 1,
456
- borderColor: AppColors.slate200,
457
- paddingHorizontal: 8,
458
- height: 32,
459
- },
460
- searchInput: {
461
- flex: 1,
462
- fontFamily: AppFonts.interRegular,
463
- fontSize: 12,
464
- color: AppColors.slate900,
465
- marginLeft: 6,
466
- paddingVertical: 0,
467
- },
468
- matchCountText: {
469
- fontFamily: AppFonts.interMedium,
470
- fontSize: 10,
471
- color: AppColors.slate500,
472
- marginHorizontal: 6,
473
- backgroundColor: AppColors.slate100,
474
- paddingHorizontal: 6,
475
- paddingVertical: 2,
476
- borderRadius: 4,
477
- },
478
- clearBtn: {
479
- padding: 4,
480
- },
481
- navArrowsGroup: {
482
- flexDirection: 'row',
483
- alignItems: 'center',
484
- backgroundColor: AppColors.white,
485
- borderRadius: 8,
486
- borderWidth: 1,
487
- borderColor: AppColors.slate200,
488
- height: 32,
489
- paddingHorizontal: 2,
490
- },
491
- navArrowBtn: {
492
- padding: 5,
493
- borderRadius: 6,
494
- alignItems: 'center',
495
- justifyContent: 'center',
496
- },
497
- lineRow: {
498
- flexDirection: 'row',
499
- alignItems: 'stretch',
500
- minHeight: 20,
501
- paddingVertical: 1,
502
- },
503
- activeMatchRow: {
504
- backgroundColor: `${AppColors.amber600}38`,
505
- borderLeftWidth: 4,
506
- borderLeftColor: AppColors.amber600,
507
- },
508
- gutter: {
509
- width: 40,
510
- backgroundColor: AppColors.slate100,
511
- borderRightWidth: 1,
512
- borderRightColor: AppColors.slate200,
513
- justifyContent: 'flex-start',
514
- alignItems: 'flex-end',
515
- paddingRight: 6,
516
- paddingTop: 1,
517
- },
518
- activeMatchGutter: {
519
- backgroundColor: `${AppColors.amber600}59`,
520
- borderRightColor: `${AppColors.amber600}80`,
521
- },
522
- lineNumber: {
523
- fontFamily: monoFont,
524
- fontSize: 9,
525
- color: AppColors.slate400,
526
- },
527
- activeMatchLineNumber: {
528
- color: AppColors.amber800,
529
- fontWeight: 'bold',
530
- },
531
- codeLine: {
532
- flex: 1,
533
- paddingLeft: 10,
534
- paddingRight: 12,
535
- justifyContent: 'center',
536
- },
537
- codeLineText: {
538
- fontFamily: monoFont,
539
- fontSize: 10.5,
540
- color: AppColors.slate700,
541
- flexWrap: 'wrap',
542
- },
543
- plain: {
544
- fontFamily: monoFont,
545
- fontSize: 10.5,
546
- color: AppColors.slate700,
547
- },
548
- comment: {
549
- fontFamily: monoFont,
550
- fontSize: 10.5,
551
- color: AppColors.slate500,
552
- fontStyle: 'italic',
553
- },
554
- string: {
555
- fontFamily: monoFont,
556
- fontSize: 10.5,
557
- color: AppColors.amber700,
558
- },
559
- keyword: {
560
- fontFamily: monoFont,
561
- fontSize: 10.5,
562
- color: AppColors.violet600,
563
- fontWeight: 'bold',
564
- },
565
- builtin: {
566
- fontFamily: monoFont,
567
- fontSize: 10.5,
568
- color: AppColors.teal600,
569
- },
570
- number: {
571
- fontFamily: monoFont,
572
- fontSize: 10.5,
573
- color: AppColors.blue600,
574
- },
575
- tag: {
576
- fontFamily: monoFont,
577
- fontSize: 10.5,
578
- color: AppColors.indigo600,
579
- fontWeight: 'bold',
580
- },
581
- attribute: {
582
- fontFamily: monoFont,
583
- fontSize: 10.5,
584
- color: AppColors.teal600,
585
- },
586
- selector: {
587
- fontFamily: monoFont,
588
- fontSize: 10.5,
589
- color: AppColors.violet600,
590
- fontWeight: 'bold',
591
- },
592
- property: {
593
- fontFamily: monoFont,
594
- fontSize: 10.5,
595
- color: AppColors.teal600,
596
- },
597
- value: {
598
- fontFamily: monoFont,
599
- fontSize: 10.5,
600
- color: AppColors.orange600,
601
- },
602
- highlight: {
603
- backgroundColor: AppColors.highlightYellow,
604
- color: AppColors.black,
605
- },
606
- });
607
- export default CodeSnippet;
67
+ <S style={[a.container,{backgroundColor:e.grayBackground,borderColor:e.grayBorderSecondary}]}>
68
+ <Q ref={m}data={Z}renderItem={H}keyExtractor={(c,h)=>String(h)}maxToRenderPerBatch={30}windowSize={5}initialNumToRender={50}removeClippedSubviews={G.OS==="android"}onEndReached={E}onEndReachedThreshold={.5}onScrollToIndexFailed={P}/>
69
+ </S>
70
+ </S>},f=M.interRegular,a=_.create({container:{flex:1,backgroundColor:e.slate50,borderRadius:8,borderWidth:1,borderColor:e.slate200,overflow:"hidden"},searchRow:{flexDirection:"row",alignItems:"center",marginBottom:6,gap:8},searchBar:{flex:1,flexDirection:"row",alignItems:"center",backgroundColor:e.white,borderRadius:8,borderWidth:1,borderColor:e.slate200,paddingHorizontal:8,height:32},searchInput:{flex:1,fontFamily:M.interRegular,fontSize:12,color:e.slate900,marginLeft:6,paddingVertical:0},matchCountText:{fontFamily:M.interMedium,fontSize:10,color:e.slate500,marginHorizontal:6,backgroundColor:e.slate100,paddingHorizontal:6,paddingVertical:2,borderRadius:4},clearBtn:{padding:4},navArrowsGroup:{flexDirection:"row",alignItems:"center",backgroundColor:e.white,borderRadius:8,borderWidth:1,borderColor:e.slate200,height:32,paddingHorizontal:2},navArrowBtn:{padding:5,borderRadius:6,alignItems:"center",justifyContent:"center"},lineRow:{flexDirection:"row",alignItems:"stretch",minHeight:20,paddingVertical:1},activeMatchRow:{backgroundColor:`${e.amber600}38`,borderLeftWidth:4,borderLeftColor:e.amber600},gutter:{width:40,backgroundColor:e.slate100,borderRightWidth:1,borderRightColor:e.slate200,justifyContent:"flex-start",alignItems:"flex-end",paddingRight:6,paddingTop:1},activeMatchGutter:{backgroundColor:`${e.amber600}59`,borderRightColor:`${e.amber600}80`},lineNumber:{fontFamily:f,fontSize:9,color:e.slate400},activeMatchLineNumber:{color:e.amber800,fontWeight:"bold"},codeLine:{flex:1,paddingLeft:10,paddingRight:12,justifyContent:"center"},codeLineText:{fontFamily:f,fontSize:10.5,color:e.slate700,flexWrap:"wrap"},plain:{fontFamily:f,fontSize:10.5,color:e.slate700},comment:{fontFamily:f,fontSize:10.5,color:e.slate500,fontStyle:"italic"},string:{fontFamily:f,fontSize:10.5,color:e.amber700},keyword:{fontFamily:f,fontSize:10.5,color:e.violet600,fontWeight:"bold"},builtin:{fontFamily:f,fontSize:10.5,color:e.teal600},number:{fontFamily:f,fontSize:10.5,color:e.blue600},tag:{fontFamily:f,fontSize:10.5,color:e.indigo600,fontWeight:"bold"},attribute:{fontFamily:f,fontSize:10.5,color:e.teal600},selector:{fontFamily:f,fontSize:10.5,color:e.violet600,fontWeight:"bold"},property:{fontFamily:f,fontSize:10.5,color:e.teal600},value:{fontFamily:f,fontSize:10.5,color:e.orange600},highlight:{backgroundColor:e.highlightYellow,color:e.black}});export default ve;