react-native-inapp-inspector 2.3.19 → 2.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/README.md +14 -14
  2. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +67 -0
  3. package/dist/commonjs/analytics.js +1 -24
  4. package/dist/commonjs/bundle.js +1 -16
  5. package/dist/commonjs/capture.js +1 -35
  6. package/dist/commonjs/components/AnalyticsDetail.js +92 -623
  7. package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
  8. package/dist/commonjs/components/AnalyticsGraph.js +70 -370
  9. package/dist/commonjs/components/AnimatedEntrance.js +1 -11
  10. package/dist/commonjs/components/AppHeaderLogo.js +7 -134
  11. package/dist/commonjs/components/BrandCircleIcon.js +73 -118
  12. package/dist/commonjs/components/BrandSquareIcon.js +63 -108
  13. package/dist/commonjs/components/CodeSnippet.js +48 -623
  14. package/dist/commonjs/components/ConsoleLogCard.js +63 -537
  15. package/dist/commonjs/components/CopyButton.js +3 -89
  16. package/dist/commonjs/components/DiffViewer.js +19 -83
  17. package/dist/commonjs/components/DomainHeader.js +27 -127
  18. package/dist/commonjs/components/EmptyState.js +10 -87
  19. package/dist/commonjs/components/EndOfListFooter.js +7 -81
  20. package/dist/commonjs/components/ErrorBoundary.js +72 -566
  21. package/dist/commonjs/components/HeadersSection.js +31 -110
  22. package/dist/commonjs/components/HighlightText.js +17 -58
  23. package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
  24. package/dist/commonjs/components/Inspector/AboutModal.js +243 -0
  25. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
  26. package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
  27. package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
  28. package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
  29. package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
  30. package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
  31. package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
  32. package/dist/commonjs/components/Inspector/DebuggingTab.js +74 -875
  33. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
  34. package/dist/commonjs/components/Inspector/FabLauncher.js +42 -466
  35. package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
  36. package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
  37. package/dist/commonjs/components/Inspector/InspectorHeader.js +191 -1110
  38. package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
  39. package/dist/commonjs/components/Inspector/MainScreen.js +52 -335
  40. package/dist/commonjs/components/Inspector/MediaGalleryTab.js +97 -644
  41. package/dist/commonjs/components/Inspector/MediaPreviewModal.js +90 -605
  42. package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
  43. package/dist/commonjs/components/Inspector/NetworkDetail.js +89 -411
  44. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
  45. package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
  46. package/dist/commonjs/components/Inspector/NpmStarPrompt.js +18 -434
  47. package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
  48. package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
  49. package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
  50. package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
  51. package/dist/commonjs/components/Inspector/SettingsPanel.js +427 -3807
  52. package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
  53. package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
  54. package/dist/commonjs/components/Inspector/TabBar.js +36 -334
  55. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +37 -412
  56. package/dist/commonjs/components/JsonViewer.js +168 -381
  57. package/dist/commonjs/components/LogCard.js +57 -567
  58. package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
  59. package/dist/commonjs/components/MetaAccordion.js +69 -238
  60. package/dist/commonjs/components/MiniBarChart.js +3 -56
  61. package/dist/commonjs/components/MiniLineChart.js +3 -58
  62. package/dist/commonjs/components/NetworkIcons.d.ts +13 -0
  63. package/dist/commonjs/components/NetworkIcons.js +521 -1022
  64. package/dist/commonjs/components/QRCodeView.js +5 -79
  65. package/dist/commonjs/components/SectionHeader.js +15 -37
  66. package/dist/commonjs/components/SegmentedTabs.js +7 -62
  67. package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
  68. package/dist/commonjs/components/Slider.js +15 -243
  69. package/dist/commonjs/components/SourcePageCard.js +30 -89
  70. package/dist/commonjs/components/Toast.js +5 -147
  71. package/dist/commonjs/components/TouchableScale.js +3 -24
  72. package/dist/commonjs/components/TreeNode.js +55 -130
  73. package/dist/commonjs/console.js +1 -16
  74. package/dist/commonjs/constants/index.js +1 -32
  75. package/dist/commonjs/constants/telemetryConfig.js +1 -6
  76. package/dist/commonjs/constants/version.d.ts +1 -1
  77. package/dist/commonjs/constants/version.js +1 -4
  78. package/dist/commonjs/crash.js +1 -23
  79. package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
  80. package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
  81. package/dist/commonjs/customHooks/consoleLogger.js +6 -445
  82. package/dist/commonjs/customHooks/crashHandler.js +7 -656
  83. package/dist/commonjs/customHooks/logFilters.js +1 -23
  84. package/dist/commonjs/customHooks/networkLogger.js +2 -536
  85. package/dist/commonjs/customHooks/performanceTracker.js +63 -750
  86. package/dist/commonjs/customHooks/reduxLogger.js +2 -313
  87. package/dist/commonjs/customHooks/storageInspector.js +1 -435
  88. package/dist/commonjs/customHooks/useAccordion.js +1 -18
  89. package/dist/commonjs/decorators/index.js +1 -100
  90. package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
  91. package/dist/commonjs/helpers/index.d.ts +1 -0
  92. package/dist/commonjs/helpers/index.js +8 -921
  93. package/dist/commonjs/helpers/memoryManager.js +1 -99
  94. package/dist/commonjs/helpers/qrGenerator.js +1 -367
  95. package/dist/commonjs/helpers/remoteConfig.js +1 -165
  96. package/dist/commonjs/helpers/searchQueryParser.js +1 -62
  97. package/dist/commonjs/helpers/settingsStore.js +1 -144
  98. package/dist/commonjs/helpers/telemetry.js +1 -501
  99. package/dist/commonjs/helpers/toast.js +1 -20
  100. package/dist/commonjs/i18n/index.js +1 -90
  101. package/dist/commonjs/i18n/locales/en.json +1 -1140
  102. package/dist/commonjs/index.js +5 -2168
  103. package/dist/commonjs/metro.js +6 -468
  104. package/dist/commonjs/native/NativeInspector.d.ts +1 -0
  105. package/dist/commonjs/native/NativeInspector.js +1 -415
  106. package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
  107. package/dist/commonjs/network.js +1 -13
  108. package/dist/commonjs/performance.js +1 -29
  109. package/dist/commonjs/redux.js +1 -20
  110. package/dist/commonjs/storage.js +1 -14
  111. package/dist/commonjs/styles/AppColors.js +1 -423
  112. package/dist/commonjs/styles/AppFonts.js +1 -17
  113. package/dist/commonjs/styles/common.js +1 -190
  114. package/dist/commonjs/styles/index.d.ts +6 -0
  115. package/dist/commonjs/styles/index.js +1 -1589
  116. package/dist/commonjs/types/enums.d.ts +0 -1
  117. package/dist/commonjs/types/enums.js +1 -152
  118. package/dist/commonjs/types/index.js +1 -18
  119. package/dist/commonjs/types/interfaces.d.ts +2 -2
  120. package/dist/commonjs/types/interfaces.js +1 -2
  121. package/dist/esm/analytics.js +1 -2
  122. package/dist/esm/bundle.js +1 -2
  123. package/dist/esm/capture.js +1 -32
  124. package/dist/esm/components/AnalyticsDetail.js +171 -664
  125. package/dist/esm/components/AnalyticsEventCard.js +77 -335
  126. package/dist/esm/components/AnalyticsGraph.js +95 -357
  127. package/dist/esm/components/AnimatedEntrance.js +1 -6
  128. package/dist/esm/components/AppHeaderLogo.js +7 -94
  129. package/dist/esm/components/BrandCircleIcon.js +114 -119
  130. package/dist/esm/components/BrandSquareIcon.js +73 -78
  131. package/dist/esm/components/CodeSnippet.js +58 -595
  132. package/dist/esm/components/ConsoleLogCard.js +91 -526
  133. package/dist/esm/components/CopyButton.js +3 -51
  134. package/dist/esm/components/DiffViewer.js +22 -48
  135. package/dist/esm/components/DomainHeader.js +43 -138
  136. package/dist/esm/components/EmptyState.js +17 -56
  137. package/dist/esm/components/EndOfListFooter.js +15 -83
  138. package/dist/esm/components/ErrorBoundary.js +125 -582
  139. package/dist/esm/components/HeadersSection.js +52 -93
  140. package/dist/esm/components/HighlightText.js +17 -53
  141. package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
  142. package/dist/esm/components/Inspector/AboutModal.js +243 -0
  143. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
  144. package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
  145. package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
  146. package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
  147. package/dist/esm/components/Inspector/CrashDetail.js +236 -747
  148. package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
  149. package/dist/esm/components/Inspector/CrashTab.js +177 -711
  150. package/dist/esm/components/Inspector/DebuggingTab.js +164 -925
  151. package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
  152. package/dist/esm/components/Inspector/FabLauncher.js +68 -454
  153. package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
  154. package/dist/esm/components/Inspector/InspectorContext.js +1 -12
  155. package/dist/esm/components/Inspector/InspectorHeader.js +282 -1163
  156. package/dist/esm/components/Inspector/LogDetail.js +235 -1023
  157. package/dist/esm/components/Inspector/MainScreen.js +78 -323
  158. package/dist/esm/components/Inspector/MediaGalleryTab.js +143 -650
  159. package/dist/esm/components/Inspector/MediaPreviewModal.js +138 -613
  160. package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
  161. package/dist/esm/components/Inspector/NetworkDetail.js +138 -455
  162. package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
  163. package/dist/esm/components/Inspector/NetworkTab.js +125 -517
  164. package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
  165. package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
  166. package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
  167. package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
  168. package/dist/esm/components/Inspector/ReduxTab.js +144 -722
  169. package/dist/esm/components/Inspector/SettingsPanel.js +643 -3985
  170. package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
  171. package/dist/esm/components/Inspector/StorageTab.js +172 -866
  172. package/dist/esm/components/Inspector/TabBar.js +45 -305
  173. package/dist/esm/components/Inspector/UpdateAvailableModal.js +80 -418
  174. package/dist/esm/components/JsonViewer.js +179 -354
  175. package/dist/esm/components/LogCard.js +93 -565
  176. package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
  177. package/dist/esm/components/MetaAccordion.js +136 -267
  178. package/dist/esm/components/MiniBarChart.js +3 -18
  179. package/dist/esm/components/MiniLineChart.js +3 -20
  180. package/dist/esm/components/NetworkIcons.d.ts +13 -0
  181. package/dist/esm/components/NetworkIcons.js +523 -838
  182. package/dist/esm/components/QRCodeView.js +8 -45
  183. package/dist/esm/components/SectionHeader.js +22 -39
  184. package/dist/esm/components/SegmentedTabs.js +8 -58
  185. package/dist/esm/components/SkeletonPlaceholder.js +30 -163
  186. package/dist/esm/components/Slider.js +24 -213
  187. package/dist/esm/components/SourcePageCard.js +65 -86
  188. package/dist/esm/components/Toast.js +10 -117
  189. package/dist/esm/components/TouchableScale.js +3 -19
  190. package/dist/esm/components/TreeNode.js +58 -95
  191. package/dist/esm/console.js +1 -2
  192. package/dist/esm/constants/index.js +1 -28
  193. package/dist/esm/constants/telemetryConfig.js +1 -3
  194. package/dist/esm/constants/version.d.ts +1 -1
  195. package/dist/esm/constants/version.js +1 -1
  196. package/dist/esm/crash.js +1 -2
  197. package/dist/esm/customHooks/analyticsLogger.js +1 -230
  198. package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
  199. package/dist/esm/customHooks/consoleLogger.js +6 -432
  200. package/dist/esm/customHooks/crashHandler.js +7 -630
  201. package/dist/esm/customHooks/logFilters.js +1 -20
  202. package/dist/esm/customHooks/networkLogger.js +2 -519
  203. package/dist/esm/customHooks/performanceTracker.js +63 -723
  204. package/dist/esm/customHooks/reduxLogger.js +2 -293
  205. package/dist/esm/customHooks/storageInspector.js +1 -418
  206. package/dist/esm/customHooks/useAccordion.js +1 -16
  207. package/dist/esm/decorators/index.js +1 -95
  208. package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
  209. package/dist/esm/helpers/index.d.ts +1 -0
  210. package/dist/esm/helpers/index.js +8 -861
  211. package/dist/esm/helpers/memoryManager.js +1 -91
  212. package/dist/esm/helpers/qrGenerator.js +1 -364
  213. package/dist/esm/helpers/remoteConfig.js +1 -160
  214. package/dist/esm/helpers/searchQueryParser.js +1 -59
  215. package/dist/esm/helpers/settingsStore.js +1 -134
  216. package/dist/esm/helpers/telemetry.js +1 -489
  217. package/dist/esm/helpers/toast.js +1 -15
  218. package/dist/esm/i18n/index.js +1 -78
  219. package/dist/esm/i18n/locales/en.json +1 -1140
  220. package/dist/esm/index.js +7 -1982
  221. package/dist/esm/metro.js +6 -459
  222. package/dist/esm/native/NativeInspector.d.ts +1 -0
  223. package/dist/esm/native/NativeInspector.js +1 -382
  224. package/dist/esm/native/NativeNetworkInspector.js +1 -2
  225. package/dist/esm/network.js +1 -1
  226. package/dist/esm/performance.js +1 -2
  227. package/dist/esm/redux.js +1 -1
  228. package/dist/esm/storage.js +1 -1
  229. package/dist/esm/styles/AppColors.js +1 -417
  230. package/dist/esm/styles/AppFonts.js +1 -13
  231. package/dist/esm/styles/common.js +1 -186
  232. package/dist/esm/styles/index.d.ts +6 -0
  233. package/dist/esm/styles/index.js +1 -1551
  234. package/dist/esm/types/enums.d.ts +0 -1
  235. package/dist/esm/types/enums.js +1 -149
  236. package/dist/esm/types/index.js +1 -2
  237. package/dist/esm/types/interfaces.d.ts +2 -2
  238. package/dist/esm/types/interfaces.js +1 -1
  239. package/ios/NetworkInspectorModule.mm +60 -12
  240. package/package.json +5 -3
  241. package/src/native/NativeInspector.ts +18 -0
  242. package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +0 -7
  243. package/dist/commonjs/components/Inspector/FeedbackModal.js +0 -552
  244. package/dist/esm/components/Inspector/FeedbackModal.d.ts +0 -7
  245. package/dist/esm/components/Inspector/FeedbackModal.js +0 -515
  246. package/src/analytics.ts +0 -35
  247. package/src/bundle.ts +0 -25
  248. package/src/capture.ts +0 -109
  249. package/src/components/AnalyticsDetail.tsx +0 -870
  250. package/src/components/AnalyticsEventCard.tsx +0 -444
  251. package/src/components/AnalyticsGraph.tsx +0 -583
  252. package/src/components/AnimatedEntrance.tsx +0 -20
  253. package/src/components/AppHeaderLogo.tsx +0 -143
  254. package/src/components/BrandCircleIcon.tsx +0 -144
  255. package/src/components/BrandSquareIcon.tsx +0 -184
  256. package/src/components/CodeSnippet.tsx +0 -725
  257. package/src/components/ConsoleLogCard.tsx +0 -679
  258. package/src/components/CopyButton.tsx +0 -87
  259. package/src/components/DiffViewer.tsx +0 -82
  260. package/src/components/DomainHeader.tsx +0 -224
  261. package/src/components/EmptyState.tsx +0 -97
  262. package/src/components/EndOfListFooter.tsx +0 -100
  263. package/src/components/ErrorBoundary.tsx +0 -688
  264. package/src/components/HeadersSection.tsx +0 -172
  265. package/src/components/HighlightText.tsx +0 -100
  266. package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
  267. package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
  268. package/src/components/Inspector/BundleTab.tsx +0 -4768
  269. package/src/components/Inspector/ConsoleTab.tsx +0 -726
  270. package/src/components/Inspector/CrashDetail.tsx +0 -997
  271. package/src/components/Inspector/CrashFilterModal.tsx +0 -721
  272. package/src/components/Inspector/CrashTab.tsx +0 -933
  273. package/src/components/Inspector/DebuggingTab.tsx +0 -1103
  274. package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
  275. package/src/components/Inspector/FabLauncher.tsx +0 -590
  276. package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
  277. package/src/components/Inspector/FeedbackModal.tsx +0 -626
  278. package/src/components/Inspector/InspectorContext.tsx +0 -28
  279. package/src/components/Inspector/InspectorHeader.tsx +0 -1583
  280. package/src/components/Inspector/LogDetail.tsx +0 -1431
  281. package/src/components/Inspector/MainScreen.tsx +0 -460
  282. package/src/components/Inspector/MediaGalleryTab.tsx +0 -829
  283. package/src/components/Inspector/MediaPreviewModal.tsx +0 -783
  284. package/src/components/Inspector/NavigationTracker.tsx +0 -13
  285. package/src/components/Inspector/NetworkDetail.tsx +0 -778
  286. package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
  287. package/src/components/Inspector/NetworkTab.tsx +0 -820
  288. package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
  289. package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
  290. package/src/components/Inspector/PerformanceTab.tsx +0 -1967
  291. package/src/components/Inspector/ReduxDetail.tsx +0 -1651
  292. package/src/components/Inspector/ReduxTab.tsx +0 -987
  293. package/src/components/Inspector/SettingsPanel.tsx +0 -5136
  294. package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
  295. package/src/components/Inspector/StorageTab.tsx +0 -1159
  296. package/src/components/Inspector/TabBar.tsx +0 -431
  297. package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
  298. package/src/components/JsonViewer.tsx +0 -549
  299. package/src/components/LogCard.tsx +0 -694
  300. package/src/components/LogSyntaxHighlighter.tsx +0 -178
  301. package/src/components/MetaAccordion.tsx +0 -355
  302. package/src/components/MiniBarChart.tsx +0 -42
  303. package/src/components/MiniLineChart.tsx +0 -33
  304. package/src/components/NetworkIcons.tsx +0 -2655
  305. package/src/components/QRCodeView.tsx +0 -75
  306. package/src/components/SectionHeader.tsx +0 -101
  307. package/src/components/SegmentedTabs.tsx +0 -84
  308. package/src/components/SkeletonPlaceholder.tsx +0 -206
  309. package/src/components/Slider.tsx +0 -300
  310. package/src/components/SourcePageCard.tsx +0 -150
  311. package/src/components/Toast.tsx +0 -131
  312. package/src/components/TouchableScale.tsx +0 -61
  313. package/src/components/TreeNode.tsx +0 -171
  314. package/src/console.ts +0 -24
  315. package/src/constants/index.ts +0 -41
  316. package/src/constants/telemetryConfig.ts +0 -4
  317. package/src/constants/version.ts +0 -3
  318. package/src/crash.ts +0 -32
  319. package/src/customHooks/analyticsLogger.ts +0 -336
  320. package/src/customHooks/bundleAnalyzer.ts +0 -1256
  321. package/src/customHooks/consoleLogger.ts +0 -530
  322. package/src/customHooks/crashHandler.ts +0 -944
  323. package/src/customHooks/logFilters.ts +0 -32
  324. package/src/customHooks/networkLogger.ts +0 -624
  325. package/src/customHooks/performanceTracker.ts +0 -1014
  326. package/src/customHooks/reduxLogger.ts +0 -406
  327. package/src/customHooks/storageInspector.ts +0 -513
  328. package/src/customHooks/useAccordion.tsx +0 -27
  329. package/src/decorators/index.ts +0 -184
  330. package/src/helpers/gaAnalyticsRegistry.ts +0 -204
  331. package/src/helpers/index.ts +0 -1092
  332. package/src/helpers/memoryManager.ts +0 -138
  333. package/src/helpers/qrGenerator.ts +0 -430
  334. package/src/helpers/remoteConfig.ts +0 -212
  335. package/src/helpers/searchQueryParser.ts +0 -84
  336. package/src/helpers/settingsStore.ts +0 -171
  337. package/src/helpers/telemetry.ts +0 -568
  338. package/src/helpers/toast.ts +0 -17
  339. package/src/i18n/index.ts +0 -104
  340. package/src/i18n/locales/en.json +0 -1141
  341. package/src/index.tsx +0 -2650
  342. package/src/metro.ts +0 -598
  343. package/src/network.ts +0 -22
  344. package/src/performance.ts +0 -38
  345. package/src/redux.ts +0 -23
  346. package/src/storage.ts +0 -18
  347. package/src/styles/AppColors.ts +0 -455
  348. package/src/styles/AppFonts.ts +0 -26
  349. package/src/styles/common.ts +0 -209
  350. package/src/styles/index.ts +0 -1606
  351. package/src/types/enums.ts +0 -210
  352. package/src/types/index.ts +0 -34
  353. package/src/types/interfaces.ts +0 -535
@@ -1,725 +0,0 @@
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
- import {CodeSnippetProps} from '../types';
10
-
11
- const escapeRegExp = (string: string) => {
12
- return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
13
- };
14
-
15
- // HTML pretty printer
16
- const formatHTML = (html: string): string => {
17
- if (!html) return '';
18
- let indent = 0;
19
- const cleaned = html
20
- .replace(/<([a-zA-Z0-9:-]+)([^>]*)>\s*<\/([a-zA-Z0-9:-]+)>/g, '<$1$2></$3>')
21
- .replace(/(<[^>]+>)/g, '\n$1\n')
22
- .replace(/\n+/g, '\n');
23
-
24
- const lines = cleaned.split('\n');
25
- const formatted: string[] = [];
26
- const selfClosingTags =
27
- /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i;
28
-
29
- for (let i = 0; i < lines.length; i++) {
30
- const line = lines[i].trim();
31
- if (!line) continue;
32
-
33
- if (line.startsWith('</')) {
34
- indent = Math.max(0, indent - 1);
35
- }
36
-
37
- formatted.push(' '.repeat(indent) + line);
38
-
39
- if (
40
- line.startsWith('<') &&
41
- !line.startsWith('</') &&
42
- !line.startsWith('<!') &&
43
- !line.endsWith('/>')
44
- ) {
45
- const tagNameMatch = line.match(/^<([a-zA-Z0-9:-]+)/);
46
- if (tagNameMatch) {
47
- const tagName = tagNameMatch[1];
48
- if (!selfClosingTags.test(tagName)) {
49
- const closeTagRegex = new RegExp(`</${escapeRegExp(tagName)}>`);
50
- if (!closeTagRegex.test(line)) {
51
- indent++;
52
- }
53
- }
54
- }
55
- }
56
- }
57
- return formatted.join('\n');
58
- };
59
-
60
- // CSS pretty printer
61
- const formatCSS = (css: string): string => {
62
- if (!css) return '';
63
- const cleaned = css
64
- .replace(/\s*\{\s*/g, ' {\n')
65
- .replace(/\s*;\s*/g, ';\n')
66
- .replace(/\s*\}\s*/g, '\n}\n')
67
- .replace(/\n+/g, '\n');
68
-
69
- const lines = cleaned.split('\n');
70
- let indent = 0;
71
- const formatted: string[] = [];
72
-
73
- for (let i = 0; i < lines.length; i++) {
74
- const line = lines[i].trim();
75
- if (!line) continue;
76
-
77
- if (line.startsWith('}')) {
78
- indent = Math.max(0, indent - 1);
79
- }
80
-
81
- formatted.push(' '.repeat(indent) + line);
82
-
83
- if (line.endsWith('{')) {
84
- indent++;
85
- }
86
- }
87
- return formatted.join('\n');
88
- };
89
-
90
- // JS pretty printer
91
- const formatJS = (js: string): string => {
92
- if (!js) return '';
93
- const lines = js.split(/\r?\n/);
94
- let indent = 0;
95
- const formatted: string[] = [];
96
-
97
- for (let i = 0; i < lines.length; i++) {
98
- const line = lines[i].trim();
99
- if (!line) continue;
100
-
101
- let openCount = (line.match(/\{|\[/g) || []).length;
102
- let closeCount = (line.match(/\}|\]/g) || []).length;
103
-
104
- if (line.startsWith('}') || line.startsWith(']')) {
105
- indent = Math.max(0, indent - 1);
106
- } else if (closeCount > openCount) {
107
- indent = Math.max(0, indent - (closeCount - openCount));
108
- }
109
-
110
- formatted.push(' '.repeat(indent) + line);
111
-
112
- if (
113
- openCount > closeCount &&
114
- !line.startsWith('}') &&
115
- !line.startsWith(']')
116
- ) {
117
- indent += openCount - closeCount;
118
- } else if (line.endsWith('{') || line.endsWith('[')) {
119
- indent++;
120
- }
121
- }
122
- return formatted.join('\n');
123
- };
124
-
125
- const tokenizeJS = (text: string) => {
126
- const tokens: {text: string; type: string}[] = [];
127
- const regex =
128
- /(\/\/.*|\/\*[\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;
129
-
130
- let lastIndex = 0;
131
- let match;
132
- while ((match = regex.exec(text)) !== null) {
133
- if (regex.lastIndex === match.index) {
134
- regex.lastIndex++;
135
- }
136
- if (match.index > lastIndex) {
137
- tokens.push({
138
- text: text.substring(lastIndex, match.index),
139
- type: 'plain',
140
- });
141
- }
142
- const matchedText = match[0];
143
- if (match[1]) tokens.push({text: matchedText, type: 'comment'});
144
- else if (match[2]) tokens.push({text: matchedText, type: 'string'});
145
- else if (match[3]) tokens.push({text: matchedText, type: 'keyword'});
146
- else if (match[4]) tokens.push({text: matchedText, type: 'builtin'});
147
- else if (match[5]) tokens.push({text: matchedText, type: 'number'});
148
-
149
- lastIndex = regex.lastIndex;
150
- }
151
- if (lastIndex < text.length) {
152
- tokens.push({text: text.substring(lastIndex), type: 'plain'});
153
- }
154
- return tokens;
155
- };
156
-
157
- const tokenizeCSS = (text: string) => {
158
- const tokens: {text: string; type: string}[] = [];
159
- const regex =
160
- /(\/\*[\s\S]*?\*\/)|(\.[a-zA-Z0-9_-]+|#[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?=\s*\{))|([a-zA-Z0-9_-]+(?=\s*:))|(:[^;]+;)/g;
161
-
162
- let lastIndex = 0;
163
- let match;
164
- while ((match = regex.exec(text)) !== null) {
165
- if (regex.lastIndex === match.index) {
166
- regex.lastIndex++;
167
- }
168
- if (match.index > lastIndex) {
169
- tokens.push({
170
- text: text.substring(lastIndex, match.index),
171
- type: 'plain',
172
- });
173
- }
174
- const matchedText = match[0];
175
- if (match[1]) tokens.push({text: matchedText, type: 'comment'});
176
- else if (match[2]) tokens.push({text: matchedText, type: 'selector'});
177
- else if (match[3]) tokens.push({text: matchedText, type: 'property'});
178
- else if (match[4]) {
179
- tokens.push({text: ':', type: 'plain'});
180
- tokens.push({text: matchedText.substring(1), type: 'value'});
181
- }
182
-
183
- lastIndex = regex.lastIndex;
184
- }
185
- if (lastIndex < text.length) {
186
- tokens.push({text: text.substring(lastIndex), type: 'plain'});
187
- }
188
- return tokens;
189
- };
190
-
191
- const tokenizeHTML = (text: string) => {
192
- const tokens: {text: string; type: string}[] = [];
193
- const regex =
194
- /(<!--[\s\S]*?-->)|(<\/?[a-zA-Z0-9:-]+>?)|(\"(?:\\.|[^\"\\])*\"|\'(?:\\.|[^\'\\])*\')|([a-zA-Z0-9:-]+(?=\s*=))/g;
195
-
196
- let lastIndex = 0;
197
- let match;
198
- while ((match = regex.exec(text)) !== null) {
199
- if (regex.lastIndex === match.index) {
200
- regex.lastIndex++;
201
- }
202
- if (match.index > lastIndex) {
203
- tokens.push({
204
- text: text.substring(lastIndex, match.index),
205
- type: 'plain',
206
- });
207
- }
208
- const matchedText = match[0];
209
- if (match[1]) tokens.push({text: matchedText, type: 'comment'});
210
- else if (match[2]) tokens.push({text: matchedText, type: 'tag'});
211
- else if (match[3]) tokens.push({text: matchedText, type: 'string'});
212
- else if (match[4]) tokens.push({text: matchedText, type: 'attribute'});
213
-
214
- lastIndex = regex.lastIndex;
215
- }
216
- if (lastIndex < text.length) {
217
- tokens.push({text: text.substring(lastIndex), type: 'plain'});
218
- }
219
- return tokens;
220
- };
221
-
222
- const getStyleForType = (type: string) => {
223
- switch (type) {
224
- case 'comment':
225
- return styles.comment;
226
- case 'string':
227
- return styles.string;
228
- case 'keyword':
229
- return styles.keyword;
230
- case 'builtin':
231
- return styles.builtin;
232
- case 'number':
233
- return styles.number;
234
- case 'tag':
235
- return styles.tag;
236
- case 'attribute':
237
- return styles.attribute;
238
- case 'selector':
239
- return styles.selector;
240
- case 'property':
241
- return styles.property;
242
- case 'value':
243
- return styles.value;
244
- default:
245
- return [styles.plain, {color: AppColors.primaryBlack}];
246
- }
247
- };
248
-
249
- const ArrowUpIcon = ({color = AppColors.slate500, size = 16}: {color?: string; size?: number}) => (
250
- <Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
251
- <Path d="M18 15l-6-6-6 6" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" />
252
- </Svg>
253
- );
254
-
255
- const ArrowDownIcon = ({color = AppColors.slate500, size = 16}: {color?: string; size?: number}) => (
256
- <Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
257
- <Path d="M6 9l6 6 6-6" stroke={color} strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" />
258
- </Svg>
259
- );
260
-
261
- const CodeSnippetLine = React.memo(
262
- ({
263
- line,
264
- lineIndex,
265
- language,
266
- search,
267
- isActiveMatch,
268
- }: {
269
- line: string;
270
- lineIndex: number;
271
- language: 'html' | 'css' | 'javascript';
272
- search: string;
273
- isActiveMatch: boolean;
274
- }) => {
275
- const tokens = useMemo(() => {
276
- if (language === 'html') return tokenizeHTML(line);
277
- if (language === 'css') return tokenizeCSS(line);
278
- return tokenizeJS(line);
279
- }, [line, language]);
280
-
281
- const renderTokenText = (text: string, type: string) => {
282
- const baseStyle = getStyleForType(type);
283
- if (!search) {
284
- return <Text style={baseStyle}>{text}</Text>;
285
- }
286
-
287
- const parts = text.split(new RegExp(`(${escapeRegExp(search)})`, 'gi'));
288
- return (
289
- <Text style={baseStyle}>
290
- {parts.map((part, index) => {
291
- const isMatch = part.toLowerCase() === search.toLowerCase();
292
- return isMatch ? (
293
- <Text key={index} style={styles.highlight}>
294
- {part}
295
- </Text>
296
- ) : (
297
- part
298
- );
299
- })}
300
- </Text>
301
- );
302
- };
303
-
304
- return (
305
- <View style={[styles.lineRow, isActiveMatch && styles.activeMatchRow]}>
306
- {/* Gutter Line Number */}
307
- <View style={[styles.gutter, {backgroundColor: AppColors.grayBackground, borderRightColor: AppColors.grayBorderSecondary}, isActiveMatch && styles.activeMatchGutter]}>
308
- <Text style={[styles.lineNumber, {color: AppColors.grayTextWeak}, isActiveMatch && styles.activeMatchLineNumber]}>{lineIndex + 1}</Text>
309
- </View>
310
-
311
- {/* Highlighted Code Line */}
312
- <View style={styles.codeLine}>
313
- <Text style={[styles.codeLineText, {color: AppColors.primaryBlack}]}>
314
- {tokens.length === 0 ? (
315
- <Text style={[styles.plain, {color: AppColors.primaryBlack}]}> </Text>
316
- ) : (
317
- tokens.map((token, tokenIdx) => (
318
- <React.Fragment key={tokenIdx}>
319
- {renderTokenText(token.text, token.type)}
320
- </React.Fragment>
321
- ))
322
- )}
323
- </Text>
324
- </View>
325
- </View>
326
- );
327
- },
328
- );
329
-
330
- const CodeSnippet: React.FC<CodeSnippetProps> = ({
331
- code,
332
- language,
333
- search,
334
- }) => {
335
- const [searchQuery, setSearchQuery] = useState('');
336
- const [debouncedQuery, setDebouncedQuery] = useState('');
337
- const [currentMatchIdx, setCurrentMatchIdx] = useState(-1);
338
- const [visibleLinesCount, setVisibleLinesCount] = useState(200);
339
-
340
- const flatListRef = useRef<FlatList>(null);
341
-
342
- // Sync prop search to searchQuery
343
- useEffect(() => {
344
- if (search !== undefined) {
345
- setSearchQuery(search);
346
- }
347
- }, [search]);
348
-
349
- // Debounce search query updates
350
- useEffect(() => {
351
- const timer = setTimeout(() => {
352
- setDebouncedQuery(searchQuery);
353
- }, 300);
354
- return () => clearTimeout(timer);
355
- }, [searchQuery]);
356
-
357
- // If code is extremely large (e.g. > 150KB), skip the pretty printers
358
- // to avoid blocking the single JS thread.
359
- const formattedCode = useMemo(() => {
360
- if (!code) return '';
361
- if (code.length > 150000) {
362
- return code;
363
- }
364
- if (language === 'html') return formatHTML(code);
365
- if (language === 'css') return formatCSS(code);
366
- if (language === 'javascript') return formatJS(code);
367
- return code;
368
- }, [code, language]);
369
-
370
- const lines = useMemo(() => {
371
- if (!formattedCode) return [];
372
- return formattedCode.split(/\r?\n/);
373
- }, [formattedCode]);
374
-
375
- // Find all line indices matching the search query
376
- const matches = useMemo(() => {
377
- if (!debouncedQuery.trim() || debouncedQuery.length < 2) return [];
378
- const query = debouncedQuery.toLowerCase();
379
- const indices: number[] = [];
380
- for (let i = 0; i < lines.length; i++) {
381
- if (lines[i].toLowerCase().includes(query)) {
382
- indices.push(i);
383
- }
384
- }
385
- return indices;
386
- }, [debouncedQuery, lines]);
387
-
388
- // Reset scroll and states on code/language changes
389
- useEffect(() => {
390
- setVisibleLinesCount(200);
391
- setSearchQuery(search || '');
392
- setCurrentMatchIdx(-1);
393
- }, [code, language]);
394
-
395
- // Auto-scroll to the first match when search query returns matches
396
- useEffect(() => {
397
- if (matches.length > 0) {
398
- setCurrentMatchIdx(0);
399
- scrollToMatch(0);
400
- } else {
401
- setCurrentMatchIdx(-1);
402
- }
403
- }, [matches]);
404
-
405
- const scrollToMatch = (matchIdx: number) => {
406
- if (matches.length === 0 || matchIdx < 0 || matchIdx >= matches.length) return;
407
- const lineIdx = matches[matchIdx];
408
-
409
- // Ensure the targeted index is loaded in FlatList
410
- if (lineIdx >= visibleLinesCount) {
411
- setVisibleLinesCount(lineIdx + 100);
412
- }
413
-
414
- // Schedule scroll after state has applied
415
- setTimeout(() => {
416
- try {
417
- flatListRef.current?.scrollToIndex({
418
- index: lineIdx,
419
- animated: false,
420
- viewPosition: 0.3,
421
- });
422
- } catch (e) {
423
- // Fallback recovery is handled by onScrollToIndexFailed
424
- }
425
- }, 50);
426
- };
427
-
428
- const onScrollToIndexFailed = (error: any) => {
429
- flatListRef.current?.scrollToOffset({
430
- offset: error.averageItemLength * error.index,
431
- animated: false,
432
- });
433
- setTimeout(() => {
434
- try {
435
- flatListRef.current?.scrollToIndex({
436
- index: error.index,
437
- animated: false,
438
- viewPosition: 0.3,
439
- });
440
- } catch (err) {
441
- console.warn('Scroll to line index failed after fallback retry:', err);
442
- }
443
- }, 60);
444
- };
445
-
446
- const handleNextMatch = () => {
447
- if (matches.length === 0) return;
448
- const nextIdx = (currentMatchIdx + 1) % matches.length;
449
- setCurrentMatchIdx(nextIdx);
450
- scrollToMatch(nextIdx);
451
- };
452
-
453
- const handlePrevMatch = () => {
454
- if (matches.length === 0) return;
455
- const prevIdx = (currentMatchIdx - 1 + matches.length) % matches.length;
456
- setCurrentMatchIdx(prevIdx);
457
- scrollToMatch(prevIdx);
458
- };
459
-
460
- const visibleLines = useMemo(() => {
461
- return lines.slice(0, visibleLinesCount);
462
- }, [lines, visibleLinesCount]);
463
-
464
- const handleEndReached = () => {
465
- if (visibleLinesCount < lines.length) {
466
- setVisibleLinesCount(prev => Math.min(prev + 150, lines.length));
467
- }
468
- };
469
-
470
- const renderLine = ({item, index}: {item: string; index: number}) => {
471
- const isActiveMatch = matches.length > 0 && currentMatchIdx >= 0 && index === matches[currentMatchIdx];
472
- return (
473
- <CodeSnippetLine
474
- line={item}
475
- lineIndex={index}
476
- language={language}
477
- search={debouncedQuery}
478
- isActiveMatch={isActiveMatch}
479
- />
480
- );
481
- };
482
-
483
- return (
484
- <View style={{flex: 1}}>
485
- {/* Search Header Row */}
486
- <View style={styles.searchRow}>
487
- <View style={[styles.searchBar, {backgroundColor: AppColors.primaryLight, borderColor: AppColors.grayBorderSecondary}]}>
488
- <SearchIcon color={AppColors.grayTextWeak} size={15} />
489
- <TextInput
490
- placeholder={`Search ${language.toUpperCase()}...`}
491
- placeholderTextColor={AppColors.grayTextWeak}
492
- value={searchQuery}
493
- onChangeText={setSearchQuery}
494
- style={[styles.searchInput, {color: AppColors.primaryBlack}]}
495
- autoCorrect={false}
496
- autoCapitalize="none"
497
- />
498
-
499
- {/* Matches Info */}
500
- {debouncedQuery.length >= 2 && (
501
- <Text style={[styles.matchCountText, {backgroundColor: AppColors.grayBackground, color: AppColors.grayTextWeak}]}>
502
- {matches.length > 0 ? `${currentMatchIdx + 1}/${matches.length}` : '0/0'}
503
- </Text>
504
- )}
505
-
506
- {searchQuery.length > 0 && (
507
- <Pressable onPress={() => setSearchQuery('')} hitSlop={8} style={styles.clearBtn}>
508
- <ClearIcon color={AppColors.grayTextWeak} size={12} />
509
- </Pressable>
510
- )}
511
- </View>
512
-
513
- {/* Up / Down Arrow Navigation Buttons */}
514
- {matches.length > 0 && (
515
- <View style={[styles.navArrowsGroup, {backgroundColor: AppColors.primaryLight, borderColor: AppColors.grayBorderSecondary}]}>
516
- <TouchableScale onPress={handlePrevMatch} hitSlop={8} style={styles.navArrowBtn}>
517
- <ArrowUpIcon color={AppColors.grayTextStrong} size={14} />
518
- </TouchableScale>
519
- <TouchableScale onPress={handleNextMatch} hitSlop={8} style={styles.navArrowBtn}>
520
- <ArrowDownIcon color={AppColors.grayTextStrong} size={14} />
521
- </TouchableScale>
522
- </View>
523
- )}
524
-
525
- <CopyButton value={code} label={`${language.toUpperCase()} Source`} />
526
- </View>
527
-
528
- {/* Code Snippet list container */}
529
- <View style={[styles.container, {backgroundColor: AppColors.grayBackground, borderColor: AppColors.grayBorderSecondary}]}>
530
- <FlatList
531
- ref={flatListRef}
532
- data={visibleLines}
533
- renderItem={renderLine}
534
- keyExtractor={(_, index) => String(index)}
535
- maxToRenderPerBatch={30}
536
- windowSize={5}
537
- initialNumToRender={50}
538
- removeClippedSubviews={Platform.OS === 'android'}
539
- onEndReached={handleEndReached}
540
- onEndReachedThreshold={0.5}
541
- onScrollToIndexFailed={onScrollToIndexFailed}
542
- />
543
- </View>
544
- </View>
545
- );
546
- };
547
-
548
- const monoFont = AppFonts.interRegular;
549
-
550
- const styles = StyleSheet.create({
551
- container: {
552
- flex: 1,
553
- backgroundColor: AppColors.slate50,
554
- borderRadius: 8,
555
- borderWidth: 1,
556
- borderColor: AppColors.slate200,
557
- overflow: 'hidden',
558
- },
559
- searchRow: {
560
- flexDirection: 'row',
561
- alignItems: 'center',
562
- marginBottom: 6,
563
- gap: 8,
564
- },
565
- searchBar: {
566
- flex: 1,
567
- flexDirection: 'row',
568
- alignItems: 'center',
569
- backgroundColor: AppColors.white,
570
- borderRadius: 8,
571
- borderWidth: 1,
572
- borderColor: AppColors.slate200,
573
- paddingHorizontal: 8,
574
- height: 32,
575
- },
576
- searchInput: {
577
- flex: 1,
578
- fontFamily: AppFonts.interRegular,
579
- fontSize: 12,
580
- color: AppColors.slate900,
581
- marginLeft: 6,
582
- paddingVertical: 0,
583
- },
584
- matchCountText: {
585
- fontFamily: AppFonts.interMedium,
586
- fontSize: 10,
587
- color: AppColors.slate500,
588
- marginHorizontal: 6,
589
- backgroundColor: AppColors.slate100,
590
- paddingHorizontal: 6,
591
- paddingVertical: 2,
592
- borderRadius: 4,
593
- },
594
- clearBtn: {
595
- padding: 4,
596
- },
597
- navArrowsGroup: {
598
- flexDirection: 'row',
599
- alignItems: 'center',
600
- backgroundColor: AppColors.white,
601
- borderRadius: 8,
602
- borderWidth: 1,
603
- borderColor: AppColors.slate200,
604
- height: 32,
605
- paddingHorizontal: 2,
606
- },
607
- navArrowBtn: {
608
- padding: 5,
609
- borderRadius: 6,
610
- alignItems: 'center',
611
- justifyContent: 'center',
612
- },
613
- lineRow: {
614
- flexDirection: 'row',
615
- alignItems: 'stretch',
616
- minHeight: 20,
617
- paddingVertical: 1,
618
- },
619
- activeMatchRow: {
620
- backgroundColor: `${AppColors.amber600}38`,
621
- borderLeftWidth: 4,
622
- borderLeftColor: AppColors.amber600,
623
- },
624
- gutter: {
625
- width: 40,
626
- backgroundColor: AppColors.slate100,
627
- borderRightWidth: 1,
628
- borderRightColor: AppColors.slate200,
629
- justifyContent: 'flex-start',
630
- alignItems: 'flex-end',
631
- paddingRight: 6,
632
- paddingTop: 1,
633
- },
634
- activeMatchGutter: {
635
- backgroundColor: `${AppColors.amber600}59`,
636
- borderRightColor: `${AppColors.amber600}80`,
637
- },
638
- lineNumber: {
639
- fontFamily: monoFont,
640
- fontSize: 9,
641
- color: AppColors.slate400,
642
- },
643
- activeMatchLineNumber: {
644
- color: AppColors.amber800,
645
- fontWeight: 'bold',
646
- },
647
- codeLine: {
648
- flex: 1,
649
- paddingLeft: 10,
650
- paddingRight: 12,
651
- justifyContent: 'center',
652
- },
653
- codeLineText: {
654
- fontFamily: monoFont,
655
- fontSize: 10.5,
656
- color: AppColors.slate700,
657
- flexWrap: 'wrap',
658
- },
659
- plain: {
660
- fontFamily: monoFont,
661
- fontSize: 10.5,
662
- color: AppColors.slate700,
663
- },
664
- comment: {
665
- fontFamily: monoFont,
666
- fontSize: 10.5,
667
- color: AppColors.slate500,
668
- fontStyle: 'italic',
669
- },
670
- string: {
671
- fontFamily: monoFont,
672
- fontSize: 10.5,
673
- color: AppColors.amber700,
674
- },
675
- keyword: {
676
- fontFamily: monoFont,
677
- fontSize: 10.5,
678
- color: AppColors.violet600,
679
- fontWeight: 'bold',
680
- },
681
- builtin: {
682
- fontFamily: monoFont,
683
- fontSize: 10.5,
684
- color: AppColors.teal600,
685
- },
686
- number: {
687
- fontFamily: monoFont,
688
- fontSize: 10.5,
689
- color: AppColors.blue600,
690
- },
691
- tag: {
692
- fontFamily: monoFont,
693
- fontSize: 10.5,
694
- color: AppColors.indigo600,
695
- fontWeight: 'bold',
696
- },
697
- attribute: {
698
- fontFamily: monoFont,
699
- fontSize: 10.5,
700
- color: AppColors.teal600,
701
- },
702
- selector: {
703
- fontFamily: monoFont,
704
- fontSize: 10.5,
705
- color: AppColors.violet600,
706
- fontWeight: 'bold',
707
- },
708
- property: {
709
- fontFamily: monoFont,
710
- fontSize: 10.5,
711
- color: AppColors.teal600,
712
- },
713
- value: {
714
- fontFamily: monoFont,
715
- fontSize: 10.5,
716
- color: AppColors.orange600,
717
- },
718
- highlight: {
719
- backgroundColor: AppColors.highlightYellow,
720
- color: AppColors.black,
721
- },
722
- });
723
-
724
- export default CodeSnippet;
725
-