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,1431 +0,0 @@
1
- import React, {useMemo, useState} from 'react';
2
- import {useTranslation} from '../../i18n';
3
- import {
4
- Pressable,
5
- ScrollView,
6
- StyleSheet,
7
- Text,
8
- TextInput,
9
- View,
10
- } from 'react-native';
11
- import {useInspector} from './InspectorContext';
12
- import HighlightText from '../HighlightText';
13
- import JsonViewer from '../JsonViewer';
14
- import CopyButton from '../CopyButton';
15
- import SegmentedTabs from '../SegmentedTabs';
16
- import {
17
- ClearIcon,
18
- SearchIcon,
19
- PrettyIcon,
20
- RawIcon,
21
- TableIcon,
22
- HeadersIcon,
23
- LayersIcon,
24
- TerminalIcon,
25
- RequestIcon,
26
- InfoCircleIcon,
27
- DocIcon,
28
- ExternalLinkIcon,
29
- FolderIcon,
30
- } from '../NetworkIcons';
31
- import {AppColors} from '../../styles/AppColors';
32
- import {AppFonts} from '../../styles/AppFonts';
33
- import styles from '../../styles';
34
- import {
35
- getJsonContent,
36
- getSize,
37
- formatDateTime,
38
- parseStackLine,
39
- ParsedStackFrame,
40
- openInVSCode,
41
- } from '../../helpers';
42
-
43
- type DetailSubTab = 'output' | 'arguments' | 'stack' | 'metadata';
44
-
45
- const getRelativeTime = (timestamp: number): string => {
46
- const now = Date.now();
47
- const diff = now - timestamp;
48
- const seconds = Math.floor(diff / 1000);
49
- const minutes = Math.floor(seconds / 60);
50
- const hours = Math.floor(minutes / 60);
51
- const days = Math.floor(hours / 24);
52
-
53
- if (seconds < 60) return `${seconds}s ago`;
54
- if (minutes < 60) return `${minutes}m ago`;
55
- if (hours < 24) return `${hours}h ago`;
56
- return `${days}d ago`;
57
- };
58
-
59
- const LogDetail = React.memo(() => {
60
- const {t} = useTranslation();
61
- const {selectedLog} = useInspector();
62
- const [activeTab, setActiveTab] = useState<DetailSubTab>('output');
63
- const [detailSearch, setDetailSearch] = useState('');
64
- const [viewMode, setViewMode] = useState<'pretty' | 'raw' | 'table'>('pretty');
65
-
66
- const jsonContent = useMemo(
67
- () => (selectedLog ? getJsonContent(selectedLog.message) : null),
68
- [selectedLog],
69
- );
70
-
71
- const [stackViewMode, setStackViewMode] = useState<'structured' | 'raw'>('structured');
72
- const [stackSource, setStackSource] = useState<'caller' | 'error'>('caller');
73
- const [stackFilter, setStackFilter] = useState<'app' | 'all'>('app');
74
-
75
- const activeStackString = useMemo(() => {
76
- if (!selectedLog) return '';
77
- if (stackSource === 'error' && selectedLog.errorStack) {
78
- return selectedLog.errorStack;
79
- }
80
- return selectedLog.stack || selectedLog.caller || '';
81
- }, [selectedLog, stackSource]);
82
-
83
- const parsedStackFrames: ParsedStackFrame[] = useMemo(() => {
84
- if (!activeStackString) return [];
85
- return activeStackString
86
- .split('\n')
87
- .map(l => l.trim())
88
- .filter(l => l.length > 0)
89
- .map((line, idx) => parseStackLine(line, idx === 0));
90
- }, [activeStackString]);
91
-
92
- const appStackFrames = useMemo(() => {
93
- return parsedStackFrames.filter(f => f.frameType === 'app' || !f.isRuntimeNoise);
94
- }, [parsedStackFrames]);
95
-
96
- const displayedFrames = useMemo(() => {
97
- if (stackFilter === 'app' && appStackFrames.length > 0) {
98
- return appStackFrames;
99
- }
100
- return parsedStackFrames;
101
- }, [stackFilter, appStackFrames, parsedStackFrames]);
102
-
103
- const originFrame: ParsedStackFrame | null = useMemo(() => {
104
- if (!selectedLog) return null;
105
- if (appStackFrames.length > 0) {
106
- return appStackFrames[0];
107
- }
108
- if (selectedLog.caller && selectedLog.caller !== 'Unknown') {
109
- return parseStackLine(selectedLog.caller, true);
110
- }
111
- if (parsedStackFrames.length > 0) {
112
- return parsedStackFrames[0];
113
- }
114
- return null;
115
- }, [selectedLog, appStackFrames, parsedStackFrames]);
116
-
117
- if (!selectedLog) return null;
118
-
119
- const isDark = AppColors.primaryLight !== AppColors.white;
120
- const getTypeColors = () => {
121
- const type = (selectedLog.type || 'log').toLowerCase();
122
- const method = ((selectedLog as any).sourceMethod || type).toLowerCase();
123
-
124
- if (type === 'error' || method === 'error') {
125
- return {
126
- border: AppColors.red500,
127
- badgeBg: AppColors.red100,
128
- badgeText: AppColors.redErrorText,
129
- label: 'ERROR',
130
- methodBorder: AppColors.errorBorder,
131
- methodBg: AppColors.red100,
132
- methodText: AppColors.redErrorText,
133
- };
134
- }
135
- if (type === 'warn' || method === 'warn') {
136
- return {
137
- border: AppColors.amber500,
138
- badgeBg: AppColors.amber100,
139
- badgeText: AppColors.amber800Warm,
140
- label: 'WARN',
141
- methodBorder: AppColors.amber200,
142
- methodBg: AppColors.amber100,
143
- methodText: AppColors.amber800Warm,
144
- };
145
- }
146
- if (type === 'debug' || method === 'debug') {
147
- return {
148
- border: AppColors.violet500,
149
- badgeBg: AppColors.purple100,
150
- badgeText: AppColors.violet600,
151
- label: 'DEBUG',
152
- methodBorder: AppColors.purple200,
153
- methodBg: AppColors.purple100,
154
- methodText: AppColors.violet600,
155
- };
156
- }
157
- if (type === 'info' || method === 'info') {
158
- return {
159
- border: AppColors.sky500,
160
- badgeBg: AppColors.sky100,
161
- badgeText: AppColors.sky600,
162
- label: 'INFO',
163
- methodBorder: AppColors.sky400,
164
- methodBg: AppColors.sky100,
165
- methodText: AppColors.sky600,
166
- };
167
- }
168
- return {
169
- border: AppColors.indigo500,
170
- badgeBg: AppColors.indigo50,
171
- badgeText: AppColors.indigo600Alt,
172
- label: 'LOG',
173
- methodBorder: AppColors.indigo400,
174
- methodBg: AppColors.indigo50,
175
- methodText: AppColors.indigo600Alt,
176
- };
177
- };
178
-
179
- const typeColors = getTypeColors();
180
- const hasMultipleArgs =
181
- selectedLog.rawArgs != null && selectedLog.rawArgs.length > 1;
182
- const hasStack = Boolean(
183
- selectedLog.stack && selectedLog.stack.trim().length > 0,
184
- );
185
-
186
- const subTabs = [
187
- {
188
- key: 'output',
189
- label: t('console.tabOutput'),
190
- icon: (isActive: boolean) => (
191
- <TerminalIcon
192
- color={isActive ? AppColors.white : AppColors.grayTextWeak}
193
- size={12}
194
- />
195
- ),
196
- },
197
- ...(hasMultipleArgs
198
- ? [
199
- {
200
- key: 'arguments',
201
- label: t('console.tabArgs', {count: selectedLog.rawArgs?.length}),
202
- icon: (isActive: boolean) => (
203
- <RequestIcon
204
- color={isActive ? AppColors.white : AppColors.grayTextWeak}
205
- size={12}
206
- />
207
- ),
208
- },
209
- ]
210
- : []),
211
- ...(hasStack
212
- ? [
213
- {
214
- key: 'stack',
215
- label: t('console.tabStack'),
216
- icon: (isActive: boolean) => (
217
- <LayersIcon
218
- color={isActive ? AppColors.white : AppColors.grayTextWeak}
219
- size={12}
220
- />
221
- ),
222
- },
223
- ]
224
- : []),
225
- {
226
- key: 'metadata',
227
- label: t('console.tabMetadata'),
228
- icon: (isActive: boolean) => (
229
- <InfoCircleIcon
230
- color={isActive ? AppColors.white : AppColors.grayTextWeak}
231
- size={12}
232
- />
233
- ),
234
- },
235
- ];
236
-
237
- return (
238
- <View style={{flex: 1}}>
239
- {/* Enhanced details header bar */}
240
- <View style={styles.detailInfoBar}>
241
- <View style={{flexDirection: 'column', gap: 10}}>
242
- {/* Top Row: Type badge, method, content pill & Copy button */}
243
- <View
244
- style={{
245
- flexDirection: 'row',
246
- alignItems: 'center',
247
- justifyContent: 'space-between',
248
- gap: 8,
249
- }}>
250
- <View
251
- style={{
252
- flexDirection: 'row',
253
- alignItems: 'center',
254
- gap: 6,
255
- flex: 1,
256
- flexWrap: 'wrap',
257
- }}>
258
- {/* Type Badge */}
259
- <View
260
- style={[
261
- styles.typeChip,
262
- {
263
- backgroundColor: typeColors.badgeBg,
264
- borderWidth: 1,
265
- borderColor: `${typeColors.border}40`,
266
- paddingHorizontal: 8,
267
- paddingVertical: 3,
268
- },
269
- ]}>
270
- <View
271
- style={[
272
- styles.typeDot,
273
- {backgroundColor: typeColors.badgeText},
274
- ]}
275
- />
276
- <Text
277
- style={[
278
- styles.typeChipText,
279
- {color: typeColors.badgeText, fontSize: 10},
280
- ]}>
281
- {typeColors.label}
282
- </Text>
283
- </View>
284
-
285
- {/* Method chip */}
286
- <View
287
- style={[
288
- styles.metaChip,
289
- {
290
- backgroundColor: `${AppColors.brandPurple}12`,
291
- borderColor: `${AppColors.brandPurple}30`,
292
- },
293
- ]}>
294
- <Text
295
- style={[
296
- styles.metaChipText,
297
- {color: AppColors.brandPurple, fontSize: 10},
298
- ]}>
299
- console.
300
- {selectedLog.sourceMethod || selectedLog.type || 'log'}
301
- </Text>
302
- </View>
303
-
304
- {/* JSON content type chip */}
305
- {jsonContent && (
306
- <View
307
- style={[
308
- styles.metaChip,
309
- {
310
- backgroundColor: `${AppColors.teal600}12`,
311
- borderColor: `${AppColors.teal600}2B`,
312
- },
313
- ]}>
314
- <Text
315
- style={[
316
- styles.metaChipText,
317
- {color: AppColors.teal600, fontSize: 10},
318
- ]}>
319
- {Array.isArray(jsonContent.data)
320
- ? `Array[${jsonContent.data.length}]`
321
- : `Object{${Object.keys(jsonContent.data).length}}`}
322
- </Text>
323
- </View>
324
- )}
325
-
326
- {/* Duplicate count chip */}
327
- {selectedLog.duplicateCount != null &&
328
- selectedLog.duplicateCount > 1 && (
329
- <View
330
- style={[
331
- styles.metaChip,
332
- {
333
- backgroundColor: `${AppColors.purple}1A`,
334
- borderColor: `${AppColors.purple}3D`,
335
- },
336
- ]}>
337
- <Text
338
- style={[
339
- styles.metaChipText,
340
- {color: AppColors.purple, fontWeight: '700'},
341
- ]}>
342
- {t('console.duplicates', {
343
- count: selectedLog.duplicateCount,
344
- })}
345
- </Text>
346
- </View>
347
- )}
348
- </View>
349
-
350
- {/* Quick Copy button */}
351
- <CopyButton
352
- value={selectedLog.message}
353
- label={t('console.logMessage')}
354
- />
355
- </View>
356
-
357
- {/* Caller & Trace origin info */}
358
- <View style={{gap: 4}}>
359
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 6, flexWrap: 'wrap'}}>
360
- {originFrame?.fileExt && originFrame.fileExt !== 'other' && (
361
- <View
362
- style={{
363
- backgroundColor:
364
- originFrame.fileExt === 'tsx' || originFrame.fileExt === 'ts'
365
- ? AppColors.brandPurple
366
- : AppColors.teal600,
367
- borderRadius: 4,
368
- paddingHorizontal: 5,
369
- paddingVertical: 1.5,
370
- }}>
371
- <Text
372
- style={{
373
- fontFamily: AppFonts.interBold,
374
- fontSize: 9.5,
375
- color: AppColors.white,
376
- letterSpacing: 0.5,
377
- }}>
378
- {originFrame.fileExt.toUpperCase()}
379
- </Text>
380
- </View>
381
- )}
382
-
383
- <Text
384
- selectable
385
- style={{
386
- fontFamily: AppFonts.interBold,
387
- fontSize: 13,
388
- color: AppColors.primaryBlack,
389
- lineHeight: 18,
390
- flexShrink: 1,
391
- }}>
392
- {originFrame?.functionName && originFrame.functionName !== '<anonymous>'
393
- ? `${originFrame.functionName}()`
394
- : originFrame?.fileName || t('console.consoleLog')}
395
- </Text>
396
-
397
- {originFrame?.fileName && (
398
- <Pressable
399
- onPress={() =>
400
- openInVSCode(
401
- originFrame.rawFilePath ||
402
- originFrame.fullPath ||
403
- originFrame.fileName,
404
- originFrame.lineNumber,
405
- originFrame.columnNumber,
406
- )
407
- }
408
- hitSlop={8}
409
- style={[
410
- styles.metaChip,
411
- {
412
- backgroundColor: `${AppColors.brandPurple}15`,
413
- borderColor: `${AppColors.brandPurple}40`,
414
- paddingHorizontal: 7,
415
- paddingVertical: 2,
416
- },
417
- ]}>
418
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4, flexShrink: 1}}>
419
- <DocIcon color={AppColors.brandPurple} size={10} />
420
- <Text
421
- style={[
422
- styles.metaChipText,
423
- {color: AppColors.brandPurple, fontSize: 10, fontFamily: AppFonts.interBold, flexShrink: 1},
424
- ]}>
425
- {originFrame.fileName}
426
- {originFrame.lineNumber ? `:${originFrame.lineNumber}` : ''}
427
- {originFrame.columnNumber ? `:${originFrame.columnNumber}` : ''}
428
- </Text>
429
- <ExternalLinkIcon color={AppColors.brandPurple} size={9} />
430
- </View>
431
- </Pressable>
432
- )}
433
- </View>
434
-
435
- {/* Enhanced metadata metrics row */}
436
- <View
437
- style={{
438
- flexDirection: 'row',
439
- alignItems: 'center',
440
- gap: 8,
441
- flexWrap: 'wrap',
442
- }}>
443
- <Text
444
- style={{
445
- fontFamily: AppFonts.interBold,
446
- fontSize: 10,
447
- color: AppColors.grayTextWeak,
448
- }}>
449
- #{selectedLog.id + 1}
450
- </Text>
451
- <Text style={detailStyles.metaDot}>•</Text>
452
- <Text
453
- style={{
454
- fontFamily: AppFonts.interRegular,
455
- fontSize: 10,
456
- color: AppColors.grayTextWeak,
457
- }}>
458
- {formatDateTime(selectedLog.timestamp)} ({getRelativeTime(selectedLog.timestamp)})
459
- </Text>
460
- <Text style={detailStyles.metaDot}>•</Text>
461
- <Text
462
- style={{
463
- fontFamily: AppFonts.interRegular,
464
- fontSize: 10,
465
- color: AppColors.grayTextWeak,
466
- }}>
467
- {getSize(selectedLog.message)}
468
- </Text>
469
- </View>
470
- </View>
471
- </View>
472
- </View>
473
-
474
- {/* Sub-tabs header */}
475
- <View style={detailStyles.tabsHeaderWrap}>
476
- <SegmentedTabs
477
- tabs={subTabs}
478
- activeKey={activeTab}
479
- onChange={key => setActiveTab(key as DetailSubTab)}
480
- />
481
- </View>
482
-
483
- {/* Search row (only for output/arguments/stack tabs) */}
484
- {activeTab !== 'metadata' && (
485
- <View style={{paddingHorizontal: 12, paddingTop: 6, paddingBottom: 4}}>
486
- <View style={[styles.detailSearchRow, {marginBottom: 0}]}>
487
- <View
488
- style={[
489
- styles.detailSearchBox,
490
- {
491
- backgroundColor: isDark
492
- ? `${AppColors.brandPurple}10`
493
- : AppColors.purpleShade50,
494
- borderWidth: 1,
495
- borderColor: AppColors.dividerColor,
496
- },
497
- ]}>
498
- <SearchIcon color={AppColors.grayTextWeak} size={15} />
499
- <TextInput
500
- placeholder="Search in log details..."
501
- placeholderTextColor={AppColors.grayTextWeak}
502
- value={detailSearch}
503
- onChangeText={setDetailSearch}
504
- style={styles.detailSearchInput}
505
- autoCorrect={false}
506
- autoCapitalize="none"
507
- />
508
- {detailSearch.length > 0 && (
509
- <Pressable
510
- onPress={() => setDetailSearch('')}
511
- hitSlop={10}
512
- style={{padding: 6}}>
513
- <ClearIcon color={AppColors.grayTextWeak} size={13} />
514
- </Pressable>
515
- )}
516
- </View>
517
- </View>
518
- </View>
519
- )}
520
-
521
- {/* Tab Content Container */}
522
- <ScrollView
523
- style={{flex: 1}}
524
- contentContainerStyle={{
525
- paddingHorizontal: 12,
526
- paddingTop: 6,
527
- paddingBottom: 28,
528
- flexGrow: 1,
529
- }}
530
- showsVerticalScrollIndicator={true}
531
- keyboardShouldPersistTaps="handled">
532
- {/* Tab 1: Output / Message */}
533
- {activeTab === 'output' && (
534
- <View
535
- style={[
536
- styles.sectionContainer,
537
- {
538
- backgroundColor: isDark
539
- ? `${AppColors.purple}12`
540
- : AppColors.purpleShade50,
541
- borderWidth: 1,
542
- borderColor: AppColors.dividerColor,
543
- borderRadius: 12,
544
- overflow: 'hidden',
545
- flex: 1,
546
- },
547
- ]}>
548
- {/* Section Header with View Modes */}
549
- <View
550
- style={{
551
- flexDirection: 'column',
552
- gap: 8,
553
- paddingHorizontal: 12,
554
- paddingVertical: 10,
555
- borderBottomWidth: 1,
556
- borderBottomColor: AppColors.dividerColor,
557
- backgroundColor: isDark
558
- ? AppColors.primaryLight
559
- : AppColors.grayBackground,
560
- }}>
561
- <View
562
- style={{
563
- flexDirection: 'row',
564
- justifyContent: 'space-between',
565
- alignItems: 'center',
566
- }}>
567
- <Text
568
- style={{
569
- fontFamily: AppFonts.interBold,
570
- fontSize: 11.5,
571
- color: AppColors.purple,
572
- letterSpacing: 0.4,
573
- textTransform: 'uppercase',
574
- }}>
575
- {jsonContent
576
- ? t('console.jsonTitle')
577
- : t('console.messageTitle')}
578
- </Text>
579
- <CopyButton
580
- value={selectedLog.message}
581
- label={t('console.logMessage')}
582
- />
583
- </View>
584
-
585
- {jsonContent && (
586
- <SegmentedTabs
587
- tabs={[
588
- {
589
- key: 'pretty',
590
- label: t('network.jsonViewer.pretty'),
591
- icon: (isActive: boolean) => (
592
- <PrettyIcon
593
- color={
594
- isActive
595
- ? AppColors.white
596
- : AppColors.grayTextWeak
597
- }
598
- size={12}
599
- />
600
- ),
601
- },
602
- {
603
- key: 'raw',
604
- label: t('network.jsonViewer.raw'),
605
- icon: (isActive: boolean) => (
606
- <RawIcon
607
- color={
608
- isActive
609
- ? AppColors.white
610
- : AppColors.grayTextWeak
611
- }
612
- size={12}
613
- />
614
- ),
615
- },
616
- {
617
- key: 'table',
618
- label: t('network.jsonViewer.table'),
619
- icon: (isActive: boolean) => (
620
- <TableIcon
621
- color={
622
- isActive
623
- ? AppColors.white
624
- : AppColors.grayTextWeak
625
- }
626
- size={12}
627
- />
628
- ),
629
- },
630
- ]}
631
- activeKey={viewMode}
632
- onChange={key =>
633
- setViewMode(key as 'pretty' | 'raw' | 'table')
634
- }
635
- />
636
- )}
637
- </View>
638
-
639
- {/* Content Body */}
640
- <View style={{padding: 12, flex: 1}}>
641
- {jsonContent ? (
642
- <>
643
- {jsonContent.header ? (
644
- <View
645
- style={{
646
- backgroundColor: AppColors.primaryLight,
647
- borderRadius: 8,
648
- borderWidth: 1,
649
- borderColor: AppColors.dividerColor,
650
- padding: 10,
651
- marginBottom: 8,
652
- }}>
653
- <Text
654
- selectable
655
- style={{
656
- fontFamily: AppFonts.interRegular,
657
- fontSize: 12,
658
- color: AppColors.primaryBlack,
659
- lineHeight: 17,
660
- }}>
661
- {jsonContent.header}
662
- </Text>
663
- </View>
664
- ) : null}
665
- <JsonViewer
666
- data={jsonContent.data}
667
- search={detailSearch}
668
- wrap
669
- forceOpen
670
- hideTabs
671
- fullHeight
672
- mode={viewMode}
673
- defaultExpandDepth={
674
- jsonContent.data &&
675
- typeof jsonContent.data === 'object' &&
676
- Object.keys(jsonContent.data).length > 10
677
- ? 1
678
- : 2
679
- }
680
- />
681
- </>
682
- ) : (
683
- <View
684
- style={{
685
- backgroundColor: AppColors.primaryLight,
686
- borderRadius: 8,
687
- borderWidth: 1,
688
- borderColor: AppColors.dividerColor,
689
- padding: 10,
690
- }}>
691
- <HighlightText
692
- text={selectedLog.message}
693
- search={detailSearch}
694
- style={{
695
- fontFamily: AppFonts.interRegular,
696
- fontSize: 12,
697
- color: AppColors.primaryBlack,
698
- lineHeight: 18,
699
- }}
700
- highlightStyle={{
701
- backgroundColor: AppColors.yellowHighlight,
702
- color: AppColors.primaryBlack,
703
- borderRadius: 3,
704
- paddingHorizontal: 2,
705
- }}
706
- detectLinks={true}
707
- />
708
- </View>
709
- )}
710
- </View>
711
- </View>
712
- )}
713
-
714
- {/* Tab 2: Individual Arguments */}
715
- {activeTab === 'arguments' && selectedLog.rawArgs && (
716
- <View style={{gap: 10}}>
717
- {selectedLog.rawArgs.map((arg, idx) => {
718
- const argType =
719
- arg === null
720
- ? 'null'
721
- : Array.isArray(arg)
722
- ? `Array[${arg.length}]`
723
- : typeof arg === 'object'
724
- ? `Object{${Object.keys(arg).length}}`
725
- : typeof arg;
726
- const isObj =
727
- arg != null &&
728
- (typeof arg === 'object' || Array.isArray(arg));
729
- const argStr = isObj
730
- ? JSON.stringify(arg, null, 2)
731
- : String(arg);
732
-
733
- return (
734
- <View
735
- key={idx}
736
- style={[
737
- styles.sectionContainer,
738
- {
739
- backgroundColor: AppColors.primaryLight,
740
- borderRadius: 10,
741
- borderWidth: 1,
742
- borderColor: AppColors.dividerColor,
743
- overflow: 'hidden',
744
- },
745
- ]}>
746
- <View
747
- style={{
748
- flexDirection: 'row',
749
- alignItems: 'center',
750
- justifyContent: 'space-between',
751
- paddingHorizontal: 12,
752
- paddingVertical: 8,
753
- backgroundColor: AppColors.grayBackground,
754
- borderBottomWidth: 1,
755
- borderBottomColor: AppColors.dividerColor,
756
- }}>
757
- <View
758
- style={{
759
- flexDirection: 'row',
760
- alignItems: 'center',
761
- gap: 6,
762
- }}>
763
- <Text
764
- style={{
765
- fontFamily: AppFonts.interBold,
766
- fontSize: 11,
767
- color: AppColors.purple,
768
- }}>
769
- Arg #{idx + 1}
770
- </Text>
771
- <View
772
- style={[
773
- styles.metaChip,
774
- {
775
- backgroundColor: `${AppColors.teal600}12`,
776
- borderColor: `${AppColors.teal600}2B`,
777
- paddingHorizontal: 5,
778
- paddingVertical: 1.5,
779
- },
780
- ]}>
781
- <Text
782
- style={[
783
- styles.metaChipText,
784
- {color: AppColors.teal600, fontSize: 9},
785
- ]}>
786
- {argType}
787
- </Text>
788
- </View>
789
- </View>
790
- <CopyButton value={argStr} label={`Arg #${idx + 1}`} />
791
- </View>
792
-
793
- <View style={{padding: 10}}>
794
- {isObj ? (
795
- <JsonViewer
796
- data={arg}
797
- search={detailSearch}
798
- wrap
799
- forceOpen
800
- hideTabs
801
- defaultExpandDepth={2}
802
- />
803
- ) : (
804
- <HighlightText
805
- text={argStr}
806
- search={detailSearch}
807
- style={{
808
- fontFamily: AppFonts.interRegular,
809
- fontSize: 12,
810
- color: AppColors.primaryBlack,
811
- lineHeight: 17,
812
- }}
813
- highlightStyle={{
814
- backgroundColor: AppColors.yellowHighlight,
815
- color: AppColors.primaryBlack,
816
- }}
817
- />
818
- )}
819
- </View>
820
- </View>
821
- );
822
- })}
823
- </View>
824
- )}
825
-
826
- {/* Tab 3: Call Stack Trace */}
827
- {activeTab === 'stack' && (
828
- <View
829
- style={[
830
- styles.sectionContainer,
831
- {
832
- backgroundColor: isDark
833
- ? `${AppColors.purple}12`
834
- : AppColors.purpleShade50,
835
- borderWidth: 1,
836
- borderColor: AppColors.dividerColor,
837
- borderRadius: 12,
838
- overflow: 'hidden',
839
- },
840
- ]}>
841
- {/* Section Header with Mode Switch */}
842
- <View
843
- style={{
844
- flexDirection: 'column',
845
- gap: 8,
846
- paddingHorizontal: 12,
847
- paddingVertical: 10,
848
- borderBottomWidth: 1,
849
- borderBottomColor: AppColors.dividerColor,
850
- backgroundColor: isDark
851
- ? AppColors.primaryLight
852
- : AppColors.grayBackground,
853
- }}>
854
- {/* Header Top Row: Title, Mode switcher & Full copy */}
855
- <View
856
- style={{
857
- flexDirection: 'row',
858
- alignItems: 'center',
859
- justifyContent: 'space-between',
860
- gap: 8,
861
- }}>
862
- <Text
863
- style={{
864
- fontFamily: AppFonts.interBold,
865
- fontSize: 11.5,
866
- color: AppColors.purple,
867
- textTransform: 'uppercase',
868
- letterSpacing: 0.4,
869
- }}>
870
- {stackSource === 'error'
871
- ? t('console.errorStack', {count: parsedStackFrames.length})
872
- : t('console.callStack', {count: parsedStackFrames.length})}
873
- </Text>
874
-
875
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 5}}>
876
- <View
877
- style={{
878
- flexDirection: 'row',
879
- backgroundColor: isDark ? AppColors.primaryLight : AppColors.white,
880
- borderRadius: 7,
881
- padding: 2,
882
- borderWidth: 1,
883
- borderColor: AppColors.dividerColor,
884
- }}>
885
- <Pressable
886
- onPress={() => setStackViewMode('structured')}
887
- style={{
888
- flexDirection: 'row',
889
- alignItems: 'center',
890
- gap: 3,
891
- paddingVertical: 3.5,
892
- paddingHorizontal: 7,
893
- borderRadius: 5,
894
- backgroundColor:
895
- stackViewMode === 'structured'
896
- ? AppColors.brandPurple
897
- : 'transparent',
898
- }}>
899
- <LayersIcon
900
- color={
901
- stackViewMode === 'structured'
902
- ? AppColors.white
903
- : AppColors.grayTextWeak
904
- }
905
- size={11}
906
- />
907
- <Text
908
- style={{
909
- fontFamily: AppFonts.interBold,
910
- fontSize: 10,
911
- color:
912
- stackViewMode === 'structured'
913
- ? AppColors.white
914
- : AppColors.grayTextStrong,
915
- }}>
916
- {t('console.cardsView')}
917
- </Text>
918
- </Pressable>
919
-
920
- <Pressable
921
- onPress={() => setStackViewMode('raw')}
922
- style={{
923
- flexDirection: 'row',
924
- alignItems: 'center',
925
- gap: 3,
926
- paddingVertical: 3.5,
927
- paddingHorizontal: 7,
928
- borderRadius: 5,
929
- backgroundColor:
930
- stackViewMode === 'raw'
931
- ? AppColors.brandPurple
932
- : 'transparent',
933
- }}>
934
- <RawIcon
935
- color={
936
- stackViewMode === 'raw'
937
- ? AppColors.white
938
- : AppColors.grayTextWeak
939
- }
940
- size={11}
941
- />
942
- <Text
943
- style={{
944
- fontFamily: AppFonts.interBold,
945
- fontSize: 10,
946
- color:
947
- stackViewMode === 'raw'
948
- ? AppColors.white
949
- : AppColors.grayTextStrong,
950
- }}>
951
- {t('console.rawTraceView')}
952
- </Text>
953
- </Pressable>
954
- </View>
955
-
956
- <CopyButton
957
- value={activeStackString}
958
- label={t('console.fullStackTrace')}
959
- />
960
- </View>
961
- </View>
962
-
963
- {/* Source Switcher if Error Stack exists */}
964
- {selectedLog.errorStack && (
965
- <SegmentedTabs
966
- tabs={[
967
- {
968
- key: 'caller',
969
- label: t('console.callOriginStack'),
970
- },
971
- {
972
- key: 'error',
973
- label: t('console.errorThrownStack'),
974
- },
975
- ]}
976
- activeKey={stackSource}
977
- onChange={key => setStackSource(key as 'caller' | 'error')}
978
- />
979
- )}
980
-
981
- {/* Scope Filter Tabs (Full Width) */}
982
- <SegmentedTabs
983
- tabs={[
984
- {
985
- key: 'app',
986
- label: t('console.appCodeScope', {count: appStackFrames.length}),
987
- },
988
- {
989
- key: 'all',
990
- label: t('console.allFramesScope', {count: parsedStackFrames.length}),
991
- },
992
- ]}
993
- activeKey={stackFilter}
994
- onChange={key => setStackFilter(key as 'app' | 'all')}
995
- />
996
- </View>
997
-
998
- {/* Stack Content: Structured Cards or Raw Full Trace */}
999
- {stackViewMode === 'structured' ? (
1000
- <View style={{padding: 12, gap: 10}}>
1001
- {displayedFrames.length > 0 ? (
1002
- displayedFrames.map((frame, frameIdx) => {
1003
- const isTopFrame = frameIdx === 0;
1004
-
1005
- const frameBadgeBg =
1006
- frame.frameType === 'app'
1007
- ? `${AppColors.brandPurple}15`
1008
- : frame.frameType === 'dependency'
1009
- ? `${AppColors.amber500}18`
1010
- : frame.frameType === 'native'
1011
- ? `${AppColors.sky500}18`
1012
- : AppColors.grayBorderSecondary;
1013
-
1014
- const frameBadgeText =
1015
- frame.frameType === 'app'
1016
- ? AppColors.brandPurple
1017
- : frame.frameType === 'dependency'
1018
- ? AppColors.amber700
1019
- : frame.frameType === 'native'
1020
- ? AppColors.sky500
1021
- : AppColors.grayTextWeak;
1022
-
1023
- return (
1024
- <View
1025
- key={frameIdx}
1026
- style={{
1027
- backgroundColor: isTopFrame
1028
- ? `${AppColors.brandPurple}0A`
1029
- : AppColors.primaryLight,
1030
- borderRadius: 10,
1031
- borderWidth: 1,
1032
- borderColor: isTopFrame
1033
- ? `${AppColors.brandPurple}35`
1034
- : AppColors.dividerColor,
1035
- padding: 11,
1036
- gap: 6,
1037
- }}>
1038
- {/* Frame Top Row: Origin / Category, File, Line badge, Copy */}
1039
- <View
1040
- style={{
1041
- flexDirection: 'row',
1042
- alignItems: 'center',
1043
- justifyContent: 'space-between',
1044
- gap: 6,
1045
- }}>
1046
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 5, flex: 1, flexWrap: 'wrap'}}>
1047
- {isTopFrame && (
1048
- <View
1049
- style={{
1050
- backgroundColor: AppColors.brandPurple,
1051
- borderRadius: 4,
1052
- paddingHorizontal: 5,
1053
- paddingVertical: 1.5,
1054
- }}>
1055
- <Text
1056
- style={{
1057
- fontFamily: AppFonts.interBold,
1058
- fontSize: 8.5,
1059
- color: AppColors.white,
1060
- }}>
1061
- {t('console.originBadge')}
1062
- </Text>
1063
- </View>
1064
- )}
1065
-
1066
- {frame.fileExt && frame.fileExt !== 'other' && (
1067
- <View
1068
- style={{
1069
- backgroundColor:
1070
- frame.fileExt === 'tsx' || frame.fileExt === 'ts'
1071
- ? `${AppColors.brandPurple}18`
1072
- : `${AppColors.teal600}18`,
1073
- borderRadius: 4,
1074
- paddingHorizontal: 4.5,
1075
- paddingVertical: 1.5,
1076
- }}>
1077
- <Text
1078
- style={{
1079
- fontFamily: AppFonts.interBold,
1080
- fontSize: 8.5,
1081
- color:
1082
- frame.fileExt === 'tsx' || frame.fileExt === 'ts'
1083
- ? AppColors.brandPurple
1084
- : AppColors.teal600,
1085
- }}>
1086
- {frame.fileExt.toUpperCase()}
1087
- </Text>
1088
- </View>
1089
- )}
1090
-
1091
- <Text
1092
- style={{
1093
- fontFamily: AppFonts.interBold,
1094
- fontSize: 11.5,
1095
- color: isTopFrame
1096
- ? AppColors.brandPurple
1097
- : AppColors.primaryBlack,
1098
- }}>
1099
- {frame.fileName}
1100
- </Text>
1101
- </View>
1102
-
1103
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
1104
- {frame.lineNumber && (
1105
- <View
1106
- style={{
1107
- backgroundColor: `${AppColors.teal600}15`,
1108
- borderColor: `${AppColors.teal600}30`,
1109
- borderWidth: 1,
1110
- borderRadius: 4,
1111
- paddingHorizontal: 5,
1112
- paddingVertical: 1.5,
1113
- }}>
1114
- <Text
1115
- style={{
1116
- fontFamily: AppFonts.interBold,
1117
- fontSize: 9.5,
1118
- color: AppColors.teal600,
1119
- }}>
1120
- L{frame.lineNumber}{frame.columnNumber ? `:C${frame.columnNumber}` : ''}
1121
- </Text>
1122
- </View>
1123
- )}
1124
- <CopyButton
1125
- value={frame.copyableLocation}
1126
- label={frame.fileName}
1127
- />
1128
- </View>
1129
- </View>
1130
-
1131
- {/* Middle Row: Function / Symbol Invocation */}
1132
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 5}}>
1133
- <HighlightText
1134
- text={frame.functionName !== '<anonymous>' ? `${frame.functionName}()` : '<anonymous>'}
1135
- search={detailSearch}
1136
- style={{
1137
- fontFamily: AppFonts.interBold,
1138
- fontSize: 12.5,
1139
- color: AppColors.primaryBlack,
1140
- }}
1141
- highlightStyle={{
1142
- backgroundColor: AppColors.yellowHighlight,
1143
- color: AppColors.primaryBlack,
1144
- }}
1145
- />
1146
- </View>
1147
-
1148
- {/* Bottom Row: Clean Relative Path & Execution Scope Tag */}
1149
- <View
1150
- style={{
1151
- flexDirection: 'row',
1152
- alignItems: 'center',
1153
- justifyContent: 'space-between',
1154
- backgroundColor: isDark ? `${AppColors.primaryBlack}25` : AppColors.grayBackground,
1155
- borderRadius: 6,
1156
- paddingHorizontal: 8,
1157
- paddingVertical: 4.5,
1158
- gap: 6,
1159
- }}>
1160
- <View style={{flexDirection: 'row', alignItems: 'center', gap: 5, flex: 1}}>
1161
- <FolderIcon size={12} color={AppColors.grayTextWeak} />
1162
- <Text
1163
- selectable
1164
- style={{
1165
- fontFamily: AppFonts.interRegular,
1166
- fontSize: 9.5,
1167
- color: AppColors.grayTextStrong,
1168
- flex: 1,
1169
- }}
1170
- numberOfLines={1}>
1171
- {frame.fullPath}
1172
- </Text>
1173
- </View>
1174
-
1175
- <View
1176
- style={{
1177
- backgroundColor: frameBadgeBg,
1178
- borderRadius: 4,
1179
- paddingHorizontal: 5,
1180
- paddingVertical: 1.5,
1181
- }}>
1182
- <Text
1183
- style={{
1184
- fontFamily: AppFonts.interBold,
1185
- fontSize: 8.5,
1186
- color: frameBadgeText,
1187
- }}>
1188
- {frame.frameType === 'app'
1189
- ? t('console.appCodeBadge')
1190
- : frame.frameType === 'dependency'
1191
- ? t('console.dependencyBadge')
1192
- : frame.frameType === 'native'
1193
- ? t('console.nativeBadge')
1194
- : t('console.hermesVmBadge')}
1195
- </Text>
1196
- </View>
1197
- </View>
1198
- </View>
1199
- );
1200
- })
1201
- ) : (
1202
- <Text
1203
- style={{
1204
- fontFamily: AppFonts.interRegular,
1205
- fontSize: 11.5,
1206
- color: AppColors.grayTextWeak,
1207
- textAlign: 'center',
1208
- paddingVertical: 16,
1209
- }}>
1210
- {t('console.noStackAvailable')}
1211
- </Text>
1212
- )}
1213
- </View>
1214
- ) : (
1215
- /* Raw Full Trace Monospace Block */
1216
- <View
1217
- style={{
1218
- backgroundColor: AppColors.primaryLight,
1219
- padding: 12,
1220
- }}>
1221
- {activeStackString.split('\n').filter(l => l.trim().length > 0).map((line, lineIdx) => (
1222
- <View
1223
- key={lineIdx}
1224
- style={{
1225
- flexDirection: 'row',
1226
- alignItems: 'flex-start',
1227
- paddingVertical: 2,
1228
- }}>
1229
- <Text
1230
- style={{
1231
- width: 28,
1232
- textAlign: 'right',
1233
- paddingRight: 8,
1234
- fontFamily: AppFonts.interRegular,
1235
- fontSize: 11,
1236
- color: AppColors.grayTextWeak,
1237
- lineHeight: 17,
1238
- }}>
1239
- {lineIdx + 1}
1240
- </Text>
1241
- <HighlightText
1242
- text={line.trim()}
1243
- search={detailSearch}
1244
- style={{
1245
- flex: 1,
1246
- fontFamily: AppFonts.interRegular,
1247
- fontSize: 12,
1248
- color: AppColors.primaryBlack,
1249
- lineHeight: 17,
1250
- }}
1251
- highlightStyle={{
1252
- backgroundColor: AppColors.yellowHighlight,
1253
- color: AppColors.primaryBlack,
1254
- }}
1255
- />
1256
- </View>
1257
- ))}
1258
- </View>
1259
- )}
1260
- </View>
1261
- )}
1262
-
1263
- {/* Tab 4: Structured Metadata */}
1264
- {activeTab === 'metadata' && (
1265
- <View
1266
- style={[
1267
- styles.sectionContainer,
1268
- {
1269
- backgroundColor: AppColors.primaryLight,
1270
- borderRadius: 10,
1271
- borderWidth: 1,
1272
- borderColor: AppColors.dividerColor,
1273
- overflow: 'hidden',
1274
- },
1275
- ]}>
1276
- <View
1277
- style={{
1278
- flexDirection: 'row',
1279
- alignItems: 'center',
1280
- justifyContent: 'space-between',
1281
- paddingHorizontal: 12,
1282
- paddingVertical: 9,
1283
- backgroundColor: AppColors.grayBackground,
1284
- borderBottomWidth: 1,
1285
- borderBottomColor: AppColors.dividerColor,
1286
- }}>
1287
- <Text
1288
- style={{
1289
- fontFamily: AppFonts.interBold,
1290
- fontSize: 11.5,
1291
- color: AppColors.purple,
1292
- textTransform: 'uppercase',
1293
- letterSpacing: 0.4,
1294
- }}>
1295
- Log Properties
1296
- </Text>
1297
- <CopyButton
1298
- value={JSON.stringify(
1299
- {
1300
- id: selectedLog.id + 1,
1301
- type: selectedLog.type,
1302
- sourceMethod: selectedLog.sourceMethod || 'log',
1303
- timestamp: selectedLog.timestamp,
1304
- dateTime: formatDateTime(selectedLog.timestamp),
1305
- caller: selectedLog.caller,
1306
- triggerFile: originFrame?.fileName,
1307
- triggerLine: originFrame?.lineNumber,
1308
- triggerFunction: originFrame?.functionName,
1309
- charCount: selectedLog.message.length,
1310
- size: getSize(selectedLog.message),
1311
- duplicates: selectedLog.duplicateCount || 1,
1312
- },
1313
- null,
1314
- 2,
1315
- )}
1316
- label="Metadata JSON"
1317
- />
1318
- </View>
1319
-
1320
- <View style={{paddingHorizontal: 12, paddingVertical: 4}}>
1321
- {[
1322
- {label: 'Log ID', value: `#${selectedLog.id + 1}`},
1323
- {label: 'Level', value: selectedLog.type.toUpperCase()},
1324
- {
1325
- label: 'Source Method',
1326
- value: `console.${selectedLog.sourceMethod || selectedLog.type || 'log'}`,
1327
- },
1328
- {
1329
- label: 'Triggered At',
1330
- value: `${formatDateTime(selectedLog.timestamp)} (${getRelativeTime(selectedLog.timestamp)})`,
1331
- },
1332
- {label: 'Timestamp (ms)', value: String(selectedLog.timestamp)},
1333
- {
1334
- label: 'Trigger File',
1335
- value: originFrame?.fileName || 'Unknown',
1336
- },
1337
- ...(originFrame?.lineNumber
1338
- ? [
1339
- {
1340
- label: 'Trigger Location',
1341
- value: `Line ${originFrame.lineNumber}, Col ${originFrame.columnNumber || 0}`,
1342
- },
1343
- ]
1344
- : []),
1345
- ...(originFrame?.functionName && originFrame.functionName !== '<anonymous>'
1346
- ? [
1347
- {
1348
- label: 'Trigger Function',
1349
- value: `${originFrame.functionName}()`,
1350
- },
1351
- ]
1352
- : []),
1353
- {
1354
- label: 'Full Location',
1355
- value: selectedLog.caller || 'Unknown',
1356
- },
1357
- {
1358
- label: 'Character Length',
1359
- value: `${selectedLog.message.length} chars`,
1360
- },
1361
- {
1362
- label: 'Approx. Size',
1363
- value: getSize(selectedLog.message),
1364
- },
1365
- {
1366
- label: 'Duplicate Count',
1367
- value: String(selectedLog.duplicateCount || 1),
1368
- },
1369
- ...(hasMultipleArgs
1370
- ? [
1371
- {
1372
- label: 'Arguments Count',
1373
- value: `${selectedLog.rawArgs?.length} arguments`,
1374
- },
1375
- ]
1376
- : []),
1377
- ].map((row, rIdx, arr) => (
1378
- <View
1379
- key={rIdx}
1380
- style={{
1381
- flexDirection: 'row',
1382
- justifyContent: 'space-between',
1383
- alignItems: 'center',
1384
- paddingVertical: 8,
1385
- borderBottomWidth: rIdx < arr.length - 1 ? 1 : 0,
1386
- borderBottomColor: AppColors.grayBorderSecondary,
1387
- }}>
1388
- <Text
1389
- style={{
1390
- fontFamily: AppFonts.interMedium,
1391
- fontSize: 11.5,
1392
- color: AppColors.grayTextWeak,
1393
- }}>
1394
- {row.label}
1395
- </Text>
1396
- <Text
1397
- selectable
1398
- style={{
1399
- fontFamily: AppFonts.interBold,
1400
- fontSize: 11.5,
1401
- color: AppColors.primaryBlack,
1402
- maxWidth: '60%',
1403
- textAlign: 'right',
1404
- }}
1405
- numberOfLines={2}>
1406
- {row.value}
1407
- </Text>
1408
- </View>
1409
- ))}
1410
- </View>
1411
- </View>
1412
- )}
1413
- </ScrollView>
1414
- </View>
1415
- );
1416
- });
1417
-
1418
- const detailStyles = StyleSheet.create({
1419
- metaDot: {
1420
- fontSize: 10,
1421
- color: AppColors.grayTextWeak,
1422
- opacity: 0.7,
1423
- },
1424
- tabsHeaderWrap: {
1425
- paddingHorizontal: 12,
1426
- paddingTop: 8,
1427
- paddingBottom: 4,
1428
- },
1429
- });
1430
-
1431
- export default LogDetail;