react-native-debug-toolkit 0.6.4 → 2.1.0

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 (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +149 -211
  3. package/README.zh-CN.md +150 -171
  4. package/lib/commonjs/components/ClipboardTab.js +91 -0
  5. package/lib/commonjs/components/ClipboardTab.js.map +1 -0
  6. package/lib/commonjs/components/ConsoleLogTab.js +162 -0
  7. package/lib/commonjs/components/ConsoleLogTab.js.map +1 -0
  8. package/lib/commonjs/components/DebugPanel.js +230 -0
  9. package/lib/commonjs/components/DebugPanel.js.map +1 -0
  10. package/lib/commonjs/components/DebugView.js +66 -0
  11. package/lib/commonjs/components/DebugView.js.map +1 -0
  12. package/lib/commonjs/components/EnvironmentTab.js +287 -0
  13. package/lib/commonjs/components/EnvironmentTab.js.map +1 -0
  14. package/lib/commonjs/components/FeatureTabBar.js +182 -0
  15. package/lib/commonjs/components/FeatureTabBar.js.map +1 -0
  16. package/lib/commonjs/components/FloatIcon.js +187 -0
  17. package/lib/commonjs/components/FloatIcon.js.map +1 -0
  18. package/lib/commonjs/components/FloatPanelView.js +214 -0
  19. package/lib/commonjs/components/FloatPanelView.js.map +1 -0
  20. package/lib/commonjs/components/NavigationLogTab.js +131 -0
  21. package/lib/commonjs/components/NavigationLogTab.js.map +1 -0
  22. package/lib/commonjs/components/NetworkLogTab.js +404 -0
  23. package/lib/commonjs/components/NetworkLogTab.js.map +1 -0
  24. package/lib/commonjs/components/ThirdPartyLibsTab.js +97 -0
  25. package/lib/commonjs/components/ThirdPartyLibsTab.js.map +1 -0
  26. package/lib/commonjs/components/TrackLogTab.js +230 -0
  27. package/lib/commonjs/components/TrackLogTab.js.map +1 -0
  28. package/lib/commonjs/components/ZustandLogTab.js +311 -0
  29. package/lib/commonjs/components/ZustandLogTab.js.map +1 -0
  30. package/lib/commonjs/components/shared/CollapsibleSection.js +84 -0
  31. package/lib/commonjs/components/shared/CollapsibleSection.js.map +1 -0
  32. package/lib/commonjs/components/shared/CopyButton.js +64 -0
  33. package/lib/commonjs/components/shared/CopyButton.js.map +1 -0
  34. package/lib/commonjs/components/shared/JsonView.js +157 -0
  35. package/lib/commonjs/components/shared/JsonView.js.map +1 -0
  36. package/lib/commonjs/components/shared/LogListScreen.js +174 -0
  37. package/lib/commonjs/components/shared/LogListScreen.js.map +1 -0
  38. package/lib/commonjs/core/DebugToolkit.js +122 -0
  39. package/lib/commonjs/core/DebugToolkit.js.map +1 -0
  40. package/lib/commonjs/core/DebugToolkitProvider.js +66 -0
  41. package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -0
  42. package/lib/commonjs/features/ClipboardFeature.js +21 -0
  43. package/lib/commonjs/features/ClipboardFeature.js.map +1 -0
  44. package/lib/commonjs/features/ConsoleLogFeature.js +115 -0
  45. package/lib/commonjs/features/ConsoleLogFeature.js.map +1 -0
  46. package/lib/commonjs/features/EnvironmentFeature.js +160 -0
  47. package/lib/commonjs/features/EnvironmentFeature.js.map +1 -0
  48. package/lib/commonjs/features/NavigationLogFeature.js +39 -0
  49. package/lib/commonjs/features/NavigationLogFeature.js.map +1 -0
  50. package/lib/commonjs/features/NetworkFeature.js +107 -0
  51. package/lib/commonjs/features/NetworkFeature.js.map +1 -0
  52. package/lib/commonjs/features/ThirdPartyLibsFeature.js +51 -0
  53. package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +1 -0
  54. package/lib/commonjs/features/TrackFeature.js +34 -0
  55. package/lib/commonjs/features/TrackFeature.js.map +1 -0
  56. package/lib/commonjs/features/ZustandLogFeature.js +59 -0
  57. package/lib/commonjs/features/ZustandLogFeature.js.map +1 -0
  58. package/lib/commonjs/hooks/useNavigationLogger.js +78 -0
  59. package/lib/commonjs/hooks/useNavigationLogger.js.map +1 -0
  60. package/lib/commonjs/hooks/useSlideDetailAnimation.js +53 -0
  61. package/lib/commonjs/hooks/useSlideDetailAnimation.js.map +1 -0
  62. package/lib/commonjs/index.js +152 -0
  63. package/lib/commonjs/index.js.map +1 -0
  64. package/lib/commonjs/initialize.js +84 -0
  65. package/lib/commonjs/initialize.js.map +1 -0
  66. package/lib/commonjs/interceptors/networkInterceptor.js +466 -0
  67. package/lib/commonjs/interceptors/networkInterceptor.js.map +1 -0
  68. package/lib/commonjs/native/NativeDebugLibs.js +58 -0
  69. package/lib/commonjs/native/NativeDebugLibs.js.map +1 -0
  70. package/lib/commonjs/package.json +1 -0
  71. package/lib/commonjs/types/index.js +6 -0
  72. package/lib/commonjs/types/index.js.map +1 -0
  73. package/lib/commonjs/utils/colors.js +48 -0
  74. package/lib/commonjs/utils/colors.js.map +1 -0
  75. package/lib/commonjs/utils/copyToComputer.js +97 -0
  76. package/lib/commonjs/utils/copyToComputer.js.map +1 -0
  77. package/lib/commonjs/utils/createChannelFeature.js +48 -0
  78. package/lib/commonjs/utils/createChannelFeature.js.map +1 -0
  79. package/lib/commonjs/utils/createEventChannel.js +21 -0
  80. package/lib/commonjs/utils/createEventChannel.js.map +1 -0
  81. package/lib/commonjs/utils/createObservableStore.js +38 -0
  82. package/lib/commonjs/utils/createObservableStore.js.map +1 -0
  83. package/lib/commonjs/utils/layout.js +8 -0
  84. package/lib/commonjs/utils/layout.js.map +1 -0
  85. package/lib/commonjs/utils/safeStringify.js +27 -0
  86. package/lib/commonjs/utils/safeStringify.js.map +1 -0
  87. package/lib/commonjs/utils/urlRewriterRegistry.js +14 -0
  88. package/lib/commonjs/utils/urlRewriterRegistry.js.map +1 -0
  89. package/lib/module/components/ClipboardTab.js +86 -0
  90. package/lib/module/components/ClipboardTab.js.map +1 -0
  91. package/lib/module/components/ConsoleLogTab.js +157 -0
  92. package/lib/module/components/ConsoleLogTab.js.map +1 -0
  93. package/lib/module/components/DebugPanel.js +225 -0
  94. package/lib/module/components/DebugPanel.js.map +1 -0
  95. package/lib/module/components/DebugView.js +61 -0
  96. package/lib/module/components/DebugView.js.map +1 -0
  97. package/lib/module/components/EnvironmentTab.js +282 -0
  98. package/lib/module/components/EnvironmentTab.js.map +1 -0
  99. package/lib/module/components/FeatureTabBar.js +177 -0
  100. package/lib/module/components/FeatureTabBar.js.map +1 -0
  101. package/lib/module/components/FloatIcon.js +182 -0
  102. package/lib/module/components/FloatIcon.js.map +1 -0
  103. package/lib/module/components/FloatPanelView.js +209 -0
  104. package/lib/module/components/FloatPanelView.js.map +1 -0
  105. package/lib/module/components/NavigationLogTab.js +126 -0
  106. package/lib/module/components/NavigationLogTab.js.map +1 -0
  107. package/lib/module/components/NetworkLogTab.js +399 -0
  108. package/lib/module/components/NetworkLogTab.js.map +1 -0
  109. package/lib/module/components/ThirdPartyLibsTab.js +91 -0
  110. package/lib/module/components/ThirdPartyLibsTab.js.map +1 -0
  111. package/lib/module/components/TrackLogTab.js +225 -0
  112. package/lib/module/components/TrackLogTab.js.map +1 -0
  113. package/lib/module/components/ZustandLogTab.js +306 -0
  114. package/lib/module/components/ZustandLogTab.js.map +1 -0
  115. package/lib/module/components/shared/CollapsibleSection.js +78 -0
  116. package/lib/module/components/shared/CollapsibleSection.js.map +1 -0
  117. package/lib/module/components/shared/CopyButton.js +58 -0
  118. package/lib/module/components/shared/CopyButton.js.map +1 -0
  119. package/lib/module/components/shared/JsonView.js +152 -0
  120. package/lib/module/components/shared/JsonView.js.map +1 -0
  121. package/lib/module/components/shared/LogListScreen.js +169 -0
  122. package/lib/module/components/shared/LogListScreen.js.map +1 -0
  123. package/lib/module/core/DebugToolkit.js +118 -0
  124. package/lib/module/core/DebugToolkit.js.map +1 -0
  125. package/lib/module/core/DebugToolkitProvider.js +60 -0
  126. package/lib/module/core/DebugToolkitProvider.js.map +1 -0
  127. package/lib/module/features/ClipboardFeature.js +16 -0
  128. package/lib/module/features/ClipboardFeature.js.map +1 -0
  129. package/lib/module/features/ConsoleLogFeature.js +109 -0
  130. package/lib/module/features/ConsoleLogFeature.js.map +1 -0
  131. package/lib/module/features/EnvironmentFeature.js +156 -0
  132. package/lib/module/features/EnvironmentFeature.js.map +1 -0
  133. package/lib/module/features/NavigationLogFeature.js +32 -0
  134. package/lib/module/features/NavigationLogFeature.js.map +1 -0
  135. package/lib/module/features/NetworkFeature.js +101 -0
  136. package/lib/module/features/NetworkFeature.js.map +1 -0
  137. package/lib/module/features/ThirdPartyLibsFeature.js +46 -0
  138. package/lib/module/features/ThirdPartyLibsFeature.js.map +1 -0
  139. package/lib/module/features/TrackFeature.js +27 -0
  140. package/lib/module/features/TrackFeature.js.map +1 -0
  141. package/lib/module/features/ZustandLogFeature.js +53 -0
  142. package/lib/module/features/ZustandLogFeature.js.map +1 -0
  143. package/lib/module/hooks/useNavigationLogger.js +74 -0
  144. package/lib/module/hooks/useNavigationLogger.js.map +1 -0
  145. package/lib/module/hooks/useSlideDetailAnimation.js +50 -0
  146. package/lib/module/hooks/useSlideDetailAnimation.js.map +1 -0
  147. package/lib/module/index.js +28 -0
  148. package/lib/module/index.js.map +1 -0
  149. package/lib/module/initialize.js +80 -0
  150. package/lib/module/initialize.js.map +1 -0
  151. package/lib/module/interceptors/networkInterceptor.js +460 -0
  152. package/lib/module/interceptors/networkInterceptor.js.map +1 -0
  153. package/lib/module/native/NativeDebugLibs.js +54 -0
  154. package/lib/module/native/NativeDebugLibs.js.map +1 -0
  155. package/lib/module/package.json +1 -0
  156. package/lib/module/types/index.js +4 -0
  157. package/lib/module/types/index.js.map +1 -0
  158. package/lib/module/utils/colors.js +43 -0
  159. package/lib/module/utils/colors.js.map +1 -0
  160. package/lib/module/utils/copyToComputer.js +91 -0
  161. package/lib/module/utils/copyToComputer.js.map +1 -0
  162. package/lib/module/utils/createChannelFeature.js +44 -0
  163. package/lib/module/utils/createChannelFeature.js.map +1 -0
  164. package/lib/module/utils/createEventChannel.js +17 -0
  165. package/lib/module/utils/createEventChannel.js.map +1 -0
  166. package/lib/module/utils/createObservableStore.js +34 -0
  167. package/lib/module/utils/createObservableStore.js.map +1 -0
  168. package/lib/module/utils/layout.js +4 -0
  169. package/lib/module/utils/layout.js.map +1 -0
  170. package/lib/module/utils/safeStringify.js +23 -0
  171. package/lib/module/utils/safeStringify.js.map +1 -0
  172. package/lib/module/utils/urlRewriterRegistry.js +10 -0
  173. package/lib/module/utils/urlRewriterRegistry.js.map +1 -0
  174. package/lib/typescript/src/components/ClipboardTab.d.ts +4 -0
  175. package/lib/typescript/src/components/ClipboardTab.d.ts.map +1 -0
  176. package/lib/typescript/src/components/ConsoleLogTab.d.ts +4 -0
  177. package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +1 -0
  178. package/lib/typescript/src/components/DebugPanel.d.ts +9 -0
  179. package/lib/typescript/src/components/DebugPanel.d.ts.map +1 -0
  180. package/lib/typescript/src/components/DebugView.d.ts +19 -0
  181. package/lib/typescript/src/components/DebugView.d.ts.map +1 -0
  182. package/lib/typescript/src/components/EnvironmentTab.d.ts +4 -0
  183. package/lib/typescript/src/components/EnvironmentTab.d.ts.map +1 -0
  184. package/lib/typescript/src/components/FeatureTabBar.d.ts +13 -0
  185. package/lib/typescript/src/components/FeatureTabBar.d.ts.map +1 -0
  186. package/lib/typescript/src/components/FloatIcon.d.ts +12 -0
  187. package/lib/typescript/src/components/FloatIcon.d.ts.map +1 -0
  188. package/lib/typescript/src/components/FloatPanelView.d.ts +9 -0
  189. package/lib/typescript/src/components/FloatPanelView.d.ts.map +1 -0
  190. package/lib/typescript/src/components/NavigationLogTab.d.ts +4 -0
  191. package/lib/typescript/src/components/NavigationLogTab.d.ts.map +1 -0
  192. package/lib/typescript/src/components/NetworkLogTab.d.ts +4 -0
  193. package/lib/typescript/src/components/NetworkLogTab.d.ts.map +1 -0
  194. package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts +4 -0
  195. package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +1 -0
  196. package/lib/typescript/src/components/TrackLogTab.d.ts +4 -0
  197. package/lib/typescript/src/components/TrackLogTab.d.ts.map +1 -0
  198. package/lib/typescript/src/components/ZustandLogTab.d.ts +4 -0
  199. package/lib/typescript/src/components/ZustandLogTab.d.ts.map +1 -0
  200. package/lib/typescript/src/components/shared/CollapsibleSection.d.ts +9 -0
  201. package/lib/typescript/src/components/shared/CollapsibleSection.d.ts.map +1 -0
  202. package/lib/typescript/src/components/shared/CopyButton.d.ts +12 -0
  203. package/lib/typescript/src/components/shared/CopyButton.d.ts.map +1 -0
  204. package/lib/typescript/src/components/shared/JsonView.d.ts +6 -0
  205. package/lib/typescript/src/components/shared/JsonView.d.ts.map +1 -0
  206. package/lib/typescript/src/components/shared/LogListScreen.d.ts +21 -0
  207. package/lib/typescript/src/components/shared/LogListScreen.d.ts.map +1 -0
  208. package/lib/typescript/src/core/DebugToolkit.d.ts +20 -0
  209. package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -0
  210. package/lib/typescript/src/core/DebugToolkitProvider.d.ts +15 -0
  211. package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -0
  212. package/lib/typescript/src/features/ClipboardFeature.d.ts +7 -0
  213. package/lib/typescript/src/features/ClipboardFeature.d.ts.map +1 -0
  214. package/lib/typescript/src/features/ConsoleLogFeature.d.ts +9 -0
  215. package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +1 -0
  216. package/lib/typescript/src/features/EnvironmentFeature.d.ts +8 -0
  217. package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +1 -0
  218. package/lib/typescript/src/features/NavigationLogFeature.d.ts +10 -0
  219. package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +1 -0
  220. package/lib/typescript/src/features/NetworkFeature.d.ts +15 -0
  221. package/lib/typescript/src/features/NetworkFeature.d.ts.map +1 -0
  222. package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts +3 -0
  223. package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts.map +1 -0
  224. package/lib/typescript/src/features/TrackFeature.d.ts +14 -0
  225. package/lib/typescript/src/features/TrackFeature.d.ts.map +1 -0
  226. package/lib/typescript/src/features/ZustandLogFeature.d.ts +31 -0
  227. package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +1 -0
  228. package/lib/typescript/src/hooks/useNavigationLogger.d.ts +13 -0
  229. package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +1 -0
  230. package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts +11 -0
  231. package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts.map +1 -0
  232. package/lib/typescript/src/index.d.ts +26 -0
  233. package/lib/typescript/src/index.d.ts.map +1 -0
  234. package/lib/typescript/src/initialize.d.ts +32 -0
  235. package/lib/typescript/src/initialize.d.ts.map +1 -0
  236. package/lib/typescript/src/interceptors/networkInterceptor.d.ts +18 -0
  237. package/lib/typescript/src/interceptors/networkInterceptor.d.ts.map +1 -0
  238. package/lib/typescript/src/native/NativeDebugLibs.d.ts +11 -0
  239. package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +1 -0
  240. package/lib/typescript/src/types/index.d.ts +109 -0
  241. package/lib/typescript/src/types/index.d.ts.map +1 -0
  242. package/lib/typescript/src/utils/colors.d.ts +21 -0
  243. package/lib/typescript/src/utils/colors.d.ts.map +1 -0
  244. package/lib/typescript/src/utils/copyToComputer.d.ts +30 -0
  245. package/lib/typescript/src/utils/copyToComputer.d.ts.map +1 -0
  246. package/lib/typescript/src/utils/createChannelFeature.d.ts +18 -0
  247. package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -0
  248. package/lib/typescript/src/utils/createEventChannel.d.ts +7 -0
  249. package/lib/typescript/src/utils/createEventChannel.d.ts.map +1 -0
  250. package/lib/typescript/src/utils/createObservableStore.d.ts +9 -0
  251. package/lib/typescript/src/utils/createObservableStore.d.ts.map +1 -0
  252. package/lib/typescript/src/utils/layout.d.ts +2 -0
  253. package/lib/typescript/src/utils/layout.d.ts.map +1 -0
  254. package/lib/typescript/src/utils/safeStringify.d.ts +6 -0
  255. package/lib/typescript/src/utils/safeStringify.d.ts.map +1 -0
  256. package/lib/typescript/src/utils/urlRewriterRegistry.d.ts +7 -0
  257. package/lib/typescript/src/utils/urlRewriterRegistry.d.ts.map +1 -0
  258. package/package.json +67 -24
  259. package/src/components/ClipboardTab.tsx +81 -0
  260. package/src/components/ConsoleLogTab.tsx +95 -0
  261. package/src/components/DebugPanel.tsx +215 -0
  262. package/src/components/DebugView.tsx +80 -0
  263. package/src/components/EnvironmentTab.tsx +276 -0
  264. package/src/components/FeatureTabBar.tsx +204 -0
  265. package/src/components/FloatIcon.tsx +171 -0
  266. package/src/components/FloatPanelView.tsx +202 -0
  267. package/src/components/NavigationLogTab.tsx +66 -0
  268. package/src/components/NetworkLogTab.tsx +270 -0
  269. package/src/components/ThirdPartyLibsTab.tsx +63 -0
  270. package/src/components/TrackLogTab.tsx +110 -0
  271. package/src/components/ZustandLogTab.tsx +203 -0
  272. package/src/components/shared/CollapsibleSection.tsx +78 -0
  273. package/src/components/shared/CopyButton.tsx +68 -0
  274. package/src/components/shared/JsonView.tsx +125 -0
  275. package/src/components/shared/LogListScreen.tsx +164 -0
  276. package/src/core/DebugToolkit.tsx +150 -0
  277. package/src/core/DebugToolkitProvider.tsx +83 -0
  278. package/src/features/ClipboardFeature.ts +15 -0
  279. package/src/features/ConsoleLogFeature.ts +116 -0
  280. package/src/features/EnvironmentFeature.ts +186 -0
  281. package/src/features/NavigationLogFeature.ts +44 -0
  282. package/src/features/NetworkFeature.ts +126 -0
  283. package/src/features/ThirdPartyLibsFeature.ts +42 -0
  284. package/src/features/TrackFeature.ts +34 -0
  285. package/src/features/ZustandLogFeature.ts +101 -0
  286. package/src/hooks/useNavigationLogger.ts +102 -0
  287. package/src/hooks/useSlideDetailAnimation.ts +45 -0
  288. package/src/index.ts +48 -0
  289. package/src/initialize.ts +122 -0
  290. package/src/interceptors/networkInterceptor.ts +646 -0
  291. package/src/native/NativeDebugLibs.ts +74 -0
  292. package/src/types/index.ts +127 -0
  293. package/src/utils/colors.ts +38 -0
  294. package/src/utils/copyToComputer.ts +104 -0
  295. package/src/utils/createChannelFeature.ts +55 -0
  296. package/src/utils/createEventChannel.ts +22 -0
  297. package/src/utils/createObservableStore.ts +42 -0
  298. package/src/utils/layout.ts +1 -0
  299. package/src/utils/safeStringify.ts +25 -0
  300. package/src/utils/urlRewriterRegistry.ts +10 -0
  301. package/.cursor/rules/react-native.mdc +0 -41
  302. package/index.js +0 -41
  303. package/ios/BuildTypeModule.h +0 -9
  304. package/ios/BuildTypeModule.m +0 -42
  305. package/ios/RNDebugLibs.h +0 -10
  306. package/ios/RNDebugLibs.m +0 -79
  307. package/lib/DebugToolKit.js +0 -126
  308. package/lib/EnvironmentManager.ts +0 -80
  309. package/lib/NativeDebugLibs.js +0 -67
  310. package/lib/features/ConsoleLogFeature.js +0 -70
  311. package/lib/features/NavigationLogFeature.js +0 -45
  312. package/lib/features/NetworkFeature.js +0 -389
  313. package/lib/features/PerformanceFeature.js +0 -390
  314. package/lib/features/ThirdPartyLibsFeature.js +0 -63
  315. package/lib/features/TrackFeature.js +0 -94
  316. package/lib/features/ZustandLogFeature.js +0 -44
  317. package/lib/hooks/useNavigationLogger.js +0 -92
  318. package/lib/index.js +0 -114
  319. package/lib/navigation/NavigationLogger.js +0 -1
  320. package/lib/types/TrackTypes.ts +0 -92
  321. package/lib/utils/DebugConst.js +0 -67
  322. package/lib/utils/StorageUtils.js +0 -80
  323. package/lib/views/ConsoleLogDetails.js +0 -314
  324. package/lib/views/FloatPanelView.js +0 -697
  325. package/lib/views/HttpLogDetails.js +0 -648
  326. package/lib/views/NavigationLogDetails.js +0 -302
  327. package/lib/views/RestartModal.js +0 -75
  328. package/lib/views/SubViewConsoleLogs.js +0 -209
  329. package/lib/views/SubViewEnvironment.js +0 -73
  330. package/lib/views/SubViewHTTPLogs.js +0 -235
  331. package/lib/views/SubViewNavigationLogs.js +0 -199
  332. package/lib/views/SubViewPerformance.js +0 -515
  333. package/lib/views/SubViewThirdPartyLibs.js +0 -239
  334. package/lib/views/SubViewTrackLogs.js +0 -318
  335. package/lib/views/SubViewZustandLogs.js +0 -279
  336. package/lib/views/TabView.js +0 -66
  337. package/lib/views/TrackLogDetails.js +0 -481
  338. package/lib/views/ZustandLogDetails.js +0 -355
  339. package/react-native-debug-toolkit.podspec +0 -25
  340. package/react-native.config.js +0 -18
@@ -1,302 +0,0 @@
1
- import React from 'react'
2
- import { View, Text, StyleSheet, Clipboard } from 'react-native'
3
- import { ScrollView, Pressable } from 'react-native'
4
- import JSONTree from 'react-native-json-tree'
5
- import { getNavigationActionColor } from '../utils/DebugConst'
6
-
7
- // Re-using the theme from ConsoleLogDetails for consistency
8
- const theme = {
9
- scheme: 'monokai',
10
- author: 'wimer hazenberg (http://www.monokai.nl)',
11
- base00: '#272822',
12
- base01: '#383830',
13
- base02: '#49483e',
14
- base03: '#75715e',
15
- base04: '#a59f85',
16
- base05: '#f8f8f2',
17
- base06: '#f5f4f1',
18
- base07: '#f9f8f5',
19
- base08: '#f92672',
20
- base09: '#fd971f',
21
- base0A: '#f4bf75',
22
- base0B: '#a6e22e',
23
- base0C: '#a1efe4',
24
- base0D: '#66d9ef',
25
- base0E: '#ae81ff',
26
- base0F: '#cc6633'
27
- };
28
-
29
- const CopyButton = ({ text, style }) => {
30
- const [copied, setCopied] = React.useState(false)
31
-
32
- const handleCopy = async () => {
33
- await Clipboard.setString(text)
34
- setCopied(true)
35
- setTimeout(() => setCopied(false), 2000)
36
- }
37
-
38
- return (
39
- <Pressable style={[styles.copyButton, style]} onPress={handleCopy}>
40
- <Text style={styles.copyButtonText}>{copied ? 'Copied!' : 'Copy'}</Text>
41
- </Pressable>
42
- )
43
- }
44
-
45
- const CollapsibleSection = ({ title, children, initiallyExpanded = false }) => {
46
- const [expanded, setExpanded] = React.useState(initiallyExpanded)
47
-
48
- return (
49
- <View style={styles.collapsibleSection}>
50
- <Pressable
51
- style={styles.sectionHeader}
52
- onPress={() => setExpanded(!expanded)}>
53
- <Text style={styles.sectionTitle}>{title}</Text>
54
- <Text style={styles.expandIcon}>{expanded ? '▼' : '▶'}</Text>
55
- </Pressable>
56
- {expanded && children}
57
- </View>
58
- )
59
- }
60
-
61
- // Basic JSONValue renderer
62
- const JSONValue = ({ value }) => {
63
- if (value === null) {
64
- return <Text style={styles.jsonNull}>null</Text>
65
- }
66
-
67
- if (value === undefined) {
68
- return <Text style={styles.jsonNull}>undefined</Text>
69
- }
70
-
71
- if (typeof value === 'boolean') {
72
- return <Text style={styles.jsonBoolean}>{value.toString()}</Text>
73
- }
74
-
75
- if (typeof value === 'number') {
76
- return <Text style={styles.jsonNumber}>{value}</Text>
77
- }
78
-
79
- if (typeof value === 'string') {
80
- return (
81
- <Text style={styles.jsonString} selectable={true}>
82
- "{value}"
83
- </Text>
84
- )
85
- }
86
-
87
- if (typeof value === 'object') {
88
- return (
89
- <JSONTree
90
- data={value}
91
- theme={theme}
92
- invertTheme={true}
93
- hideRoot={true}
94
- shouldExpandNode={(keyPath, nodeData, currentLevel) => currentLevel < 1}
95
- />
96
- )
97
- }
98
-
99
- return <Text style={styles.jsonOther}>{String(value)}</Text>
100
- }
101
-
102
- const NavigationLogDetails = ({ log }) => {
103
- if (!log) {
104
- return (
105
- <View style={styles.errorContainer}>
106
- <Text style={styles.errorText}>Navigation log data is missing</Text>
107
- </View>
108
- )
109
- }
110
-
111
- const { action, from, to, timestamp, startTime, duration, debugLog } = log
112
- const actionColor = getNavigationActionColor(action)
113
-
114
- // Format the log data for text display and copying
115
- const formatLogForCopy = () => {
116
- try {
117
- return `Navigation: ${action}
118
- From: ${JSON.stringify(from, null, 2)}
119
- To: ${JSON.stringify(to, null, 2)}
120
- Time: ${timestamp ? new Date(timestamp).toLocaleString() : 'Unknown'}
121
- Duration: ${duration || 'N/A'} ms`;
122
- } catch (e) {
123
- return 'Failed to format navigation log';
124
- }
125
- };
126
-
127
- return (
128
- <ScrollView
129
- style={styles.container}
130
- contentContainerStyle={styles.contentContainer}
131
- showsVerticalScrollIndicator={true}
132
- scrollEventThrottle={16}
133
- keyboardShouldPersistTaps='handled'>
134
-
135
- <View style={styles.header}>
136
- <View style={styles.headerInfo}>
137
- <Text style={[styles.actionIndicator, { color: actionColor }]}>
138
- {action?.toUpperCase() || 'UNKNOWN'}
139
- </Text>
140
- <Text style={styles.timestamp}>
141
- {timestamp
142
- ? new Date(timestamp).toLocaleString()
143
- : 'Unknown time'}
144
- </Text>
145
- {duration && (
146
- <Text style={styles.duration}>
147
- {`${duration} ms`}
148
- </Text>
149
- )}
150
- </View>
151
- <CopyButton text={formatLogForCopy()} />
152
- </View>
153
-
154
- <CollapsibleSection title='From Route' initiallyExpanded={true}>
155
- <View style={styles.dataContentWrapper}>
156
- <View style={styles.dataContent}>
157
- <JSONValue value={from} />
158
- </View>
159
- </View>
160
- </CollapsibleSection>
161
-
162
- <CollapsibleSection title='To Route' initiallyExpanded={true}>
163
- <View style={styles.dataContentWrapper}>
164
- <View style={styles.dataContent}>
165
- <JSONValue value={to} />
166
- </View>
167
- </View>
168
- </CollapsibleSection>
169
-
170
- <CollapsibleSection title='Debug Log' initiallyExpanded={true}>
171
- <View style={styles.dataContentWrapper}>
172
- <View style={styles.dataContent}>
173
- <JSONValue value={debugLog} />
174
- </View>
175
- </View>
176
- </CollapsibleSection>
177
-
178
- </ScrollView>
179
- )
180
- }
181
-
182
- // Styles adapted from ConsoleLogDetails
183
- const styles = StyleSheet.create({
184
- container: {
185
- flex: 1,
186
- backgroundColor: '#fff',
187
- },
188
- contentContainer: {
189
- paddingBottom: 20,
190
- },
191
- header: {
192
- flexDirection: 'row',
193
- padding: 15,
194
- borderBottomWidth: 1,
195
- borderBottomColor: '#eee',
196
- alignItems: 'center',
197
- justifyContent: 'space-between',
198
- },
199
- headerInfo: {
200
- flexShrink: 1,
201
- marginRight: 10,
202
- },
203
- actionIndicator: {
204
- fontSize: 14,
205
- fontWeight: 'bold',
206
- marginBottom: 4,
207
- },
208
- timestamp: {
209
- fontSize: 13,
210
- color: '#666',
211
- marginBottom: 2,
212
- },
213
- duration: {
214
- fontSize: 12,
215
- color: '#888',
216
- },
217
- collapsibleSection: {
218
- marginBottom: 1,
219
- backgroundColor: '#fff',
220
- },
221
- sectionHeader: {
222
- flexDirection: 'row',
223
- justifyContent: 'space-between',
224
- alignItems: 'center',
225
- padding: 15,
226
- backgroundColor: '#f5f5f5',
227
- },
228
- sectionTitle: {
229
- fontSize: 15,
230
- fontWeight: 'bold',
231
- color: '#333',
232
- },
233
- expandIcon: {
234
- fontSize: 14,
235
- color: '#666',
236
- },
237
- content: {
238
- padding: 15,
239
- },
240
- dataContentWrapper: {
241
- flex: 1,
242
- padding: 10,
243
- },
244
- dataContent: {
245
- backgroundColor: '#f8f9fa',
246
- padding: 10,
247
- borderRadius: 4,
248
- borderWidth: 1,
249
- borderColor: '#e9ecef',
250
- },
251
- errorContainer: {
252
- flex: 1,
253
- justifyContent: 'center',
254
- alignItems: 'center',
255
- padding: 20,
256
- },
257
- errorText: {
258
- color: '#ff4444',
259
- fontSize: 16,
260
- },
261
- copyButton: {
262
- backgroundColor: '#e9ecef',
263
- paddingHorizontal: 10,
264
- paddingVertical: 5,
265
- borderRadius: 4,
266
- flexShrink: 0,
267
- },
268
- copyButtonText: {
269
- fontSize: 12,
270
- color: '#666',
271
- },
272
- // JSON Value Styles (reused from ConsoleLogDetails)
273
- jsonString: {
274
- color: '#CB772F',
275
- fontFamily: 'monospace',
276
- fontSize: 13,
277
- },
278
- jsonNumber: {
279
- color: '#AE81FF',
280
- fontFamily: 'monospace',
281
- fontSize: 13,
282
- },
283
- jsonBoolean: {
284
- color: '#66D9EF',
285
- fontWeight: 'bold',
286
- fontFamily: 'monospace',
287
- fontSize: 13,
288
- },
289
- jsonNull: {
290
- color: '#F92672',
291
- fontStyle: 'italic',
292
- fontFamily: 'monospace',
293
- fontSize: 13,
294
- },
295
- jsonOther: {
296
- color: '#75715e',
297
- fontFamily: 'monospace',
298
- fontSize: 13,
299
- },
300
- });
301
-
302
- export default NavigationLogDetails
@@ -1,75 +0,0 @@
1
- import React from 'react';
2
- import {
3
- View,
4
- Text,
5
- Modal,
6
- StyleSheet,
7
- Dimensions
8
- } from 'react-native';
9
- import { DebugColors } from '../utils/DebugConst';
10
-
11
- const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
12
-
13
- const RestartModal = () => {
14
- return (
15
- <Modal
16
- visible={true}
17
- transparent={true}
18
- animationType="fade"
19
- onRequestClose={() => {}}
20
- >
21
- <View style={styles.overlay}>
22
- <View style={styles.modalContent}>
23
- <Text style={styles.title}>Environment Changed</Text>
24
- <Text style={styles.message}>
25
- The app needs to restart to apply the new environment settings.{'\n\n'}
26
- Please manually kill the app and restart it.
27
- </Text>
28
- </View>
29
- </View>
30
- </Modal>
31
- );
32
- };
33
-
34
- const styles = StyleSheet.create({
35
- overlay: {
36
- position: 'absolute',
37
- top: 0,
38
- left: 0,
39
- right: 0,
40
- bottom: 0,
41
- backgroundColor: 'rgba(0, 0, 0, 0.5)',
42
- justifyContent: 'center',
43
- alignItems: 'center',
44
- width: screenWidth,
45
- height: screenHeight,
46
- zIndex: 9999,
47
- },
48
- modalContent: {
49
- backgroundColor: 'white',
50
- borderRadius: 10,
51
- padding: 20,
52
- width: screenWidth * 0.8,
53
- alignItems: 'center',
54
- elevation: 5,
55
- shadowColor: '#000',
56
- shadowOffset: { width: 0, height: 2 },
57
- shadowOpacity: 0.25,
58
- shadowRadius: 3.84,
59
- },
60
- title: {
61
- fontSize: 18,
62
- fontWeight: 'bold',
63
- color: DebugColors.text,
64
- marginBottom: 15,
65
- textAlign: 'center'
66
- },
67
- message: {
68
- fontSize: 16,
69
- color: DebugColors.text,
70
- textAlign: 'center',
71
- lineHeight: 22
72
- }
73
- });
74
-
75
- export default RestartModal;
@@ -1,209 +0,0 @@
1
- import React, { useState, useMemo } from 'react'
2
- import {
3
- View,
4
- Text,
5
- StyleSheet,
6
- FlatList,
7
- TouchableOpacity,
8
- } from 'react-native'
9
- import ConsoleLogDetails from './ConsoleLogDetails' // Import the new details component
10
- import { getLogLevelColor } from '../utils/DebugConst' // Assuming you move color logic
11
-
12
- const SubViewConsoleLogs = ({ logs = [] }) => {
13
- const [selectedLog, setSelectedLog] = useState(null)
14
-
15
- // Memoize the sorted logs
16
- const sortedLogs = useMemo(() => {
17
- // Create a stable copy before sorting if FlatList relies on reference equality
18
- return [...logs].sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0));
19
- }, [logs]);
20
-
21
- // Helper to format log data for preview
22
- const formatLogPreview = (dataArray = []) => {
23
- if (!Array.isArray(dataArray)) return ''; // Handle cases where data might not be an array
24
- return dataArray.map(item => {
25
- if (typeof item === 'string') return item;
26
- if (typeof item === 'number' || typeof item === 'boolean') return String(item);
27
- if (item === null) return 'null';
28
- if (item === undefined) return 'undefined';
29
- if (typeof item === 'object' && item !== null) {
30
- try {
31
- // Attempt a brief JSON stringification, handle potential circular refs?
32
- const preview = JSON.stringify(item);
33
- return preview.length > 50 ? preview.substring(0, 47) + '...' : preview;
34
- } catch (e) {
35
- return '{...}'; // Fallback for complex/circular objects
36
- }
37
- }
38
- return String(item); // Fallback
39
- }).join(' ');
40
- };
41
-
42
-
43
- const renderLogItem = ({ item }) => {
44
- const level = item.level || 'log';
45
- const levelColor = getLogLevelColor(level);
46
- const previewText = formatLogPreview(item.data);
47
- const timestamp = item.timestamp
48
- ? new Date(item.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false })
49
- : '';
50
-
51
- return (
52
- <TouchableOpacity
53
- style={styles.logItem}
54
- onPress={() => setSelectedLog(item)}>
55
- <View style={styles.logItemContainer}>
56
- <View
57
- style={[styles.levelIndicator, { backgroundColor: levelColor }]}
58
- />
59
-
60
- <View style={styles.logContent}>
61
- <View style={styles.logHeader}>
62
- <Text style={[styles.levelText, { color: levelColor }]}>
63
- {level.toUpperCase()}
64
- </Text>
65
- <Text style={styles.time}>{timestamp}</Text>
66
- </View>
67
-
68
- <Text style={styles.logMessage} numberOfLines={3}>
69
- {previewText}
70
- </Text>
71
-
72
- </View>
73
- </View>
74
- </TouchableOpacity>
75
- )
76
- }
77
-
78
- // If a log is selected, show the details view
79
- if (selectedLog) {
80
- const selectedLevel = selectedLog.level || 'log';
81
- const timestamp = selectedLog.timestamp
82
- ? new Date(selectedLog.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false })
83
- : '';
84
- return (
85
- <View style={styles.container}>
86
- <View style={styles.detailsHeader}>
87
- <TouchableOpacity
88
- style={styles.backButton}
89
- onPress={() => setSelectedLog(null)}>
90
- <Text style={styles.backButtonText}>← Back</Text>
91
- </TouchableOpacity>
92
- <View style={styles.headerLevelTime}>
93
- <Text style={[styles.headerLevel, { color: getLogLevelColor(selectedLevel) }]}>
94
- {selectedLevel.toUpperCase()}
95
- </Text>
96
- <Text style={styles.headerTimestamp}>{timestamp}</Text>
97
- </View>
98
- </View>
99
- <ConsoleLogDetails log={selectedLog} />
100
- </View>
101
- )
102
- }
103
-
104
- // Otherwise show the list view
105
- return (
106
- <View style={styles.container}>
107
- {sortedLogs.length === 0 ? (
108
- <Text style={styles.emptyText}>No console messages logged yet</Text>
109
- ) : (
110
- <FlatList
111
- data={sortedLogs} // Use the memoized sorted list
112
- renderItem={renderLogItem}
113
- keyExtractor={(item, index) => `${item.timestamp}-${index}`} // Use timestamp and index for key
114
- style={styles.list}
115
- />
116
- )}
117
- </View>
118
- )
119
- }
120
-
121
- // Adapted styles from SubViewHTTPLogs
122
- const styles = StyleSheet.create({
123
- container: {
124
- flex: 1,
125
- backgroundColor: '#fff',
126
- },
127
- list: {
128
- flex: 1,
129
- },
130
- emptyText: {
131
- textAlign: 'center',
132
- color: '#999',
133
- marginTop: 20,
134
- },
135
- logItem: {
136
- borderBottomWidth: 1,
137
- borderBottomColor: '#eee',
138
- },
139
- logItemContainer: {
140
- flexDirection: 'row',
141
- paddingVertical: 10,
142
- paddingHorizontal: 12,
143
- },
144
- levelIndicator: {
145
- width: 4,
146
- borderRadius: 2,
147
- marginRight: 10,
148
- },
149
- logContent: {
150
- flex: 1,
151
- },
152
- logHeader: {
153
- flexDirection: 'row',
154
- justifyContent: 'space-between',
155
- alignItems: 'center',
156
- marginBottom: 5,
157
- },
158
- levelText: {
159
- fontSize: 13,
160
- fontWeight: 'bold',
161
- },
162
- time: {
163
- fontSize: 12,
164
- color: '#888',
165
- },
166
- logMessage: {
167
- fontSize: 14,
168
- color: '#333',
169
- lineHeight: 18,
170
- fontFamily: 'monospace', // Use monospace for log messages
171
- },
172
- // Details Header Styles
173
- detailsHeader: {
174
- flexDirection: 'row',
175
- alignItems: 'center',
176
- paddingVertical: 10,
177
- paddingHorizontal: 15,
178
- borderBottomWidth: 1,
179
- borderBottomColor: '#eee',
180
- backgroundColor: '#f8f9fa',
181
- },
182
- backButton: {
183
- paddingHorizontal: 10,
184
- paddingVertical: 5,
185
- borderRadius: 4,
186
- backgroundColor: '#eee',
187
- marginRight: 15, // More space after back button
188
- },
189
- backButtonText: {
190
- color: '#333',
191
- fontWeight: '500',
192
- fontSize: 14,
193
- },
194
- headerLevelTime: {
195
- flexDirection: 'row',
196
- alignItems: 'baseline', // Align baseline of text
197
- },
198
- headerLevel: {
199
- fontSize: 15,
200
- fontWeight: 'bold',
201
- marginRight: 8,
202
- },
203
- headerTimestamp: {
204
- fontSize: 13,
205
- color: '#666',
206
- },
207
- })
208
-
209
- export default SubViewConsoleLogs
@@ -1,73 +0,0 @@
1
- import React from 'react';
2
- import {
3
- View,
4
- Text,
5
- TouchableOpacity,
6
- StyleSheet,
7
- ScrollView
8
- } from 'react-native';
9
- import { DebugColors } from '../utils/DebugConst';
10
-
11
- const SubViewEnvironment = ({ options, currentValue, onChange }) => {
12
- return (
13
- <View style={styles.container}>
14
- <Text style={styles.title}>Environment</Text>
15
- <ScrollView style={styles.scrollView}>
16
- {options.map((option, index) => (
17
- <TouchableOpacity
18
- key={index}
19
- style={[
20
- styles.option,
21
- option.value === currentValue && styles.selectedOption
22
- ]}
23
- onPress={() => onChange(option.value)}
24
- >
25
- <Text style={[
26
- styles.optionText,
27
- option.value === currentValue && styles.selectedOptionText
28
- ]}>
29
- {option.label}
30
- </Text>
31
- </TouchableOpacity>
32
- ))}
33
- </ScrollView>
34
- </View>
35
- );
36
- };
37
-
38
- const styles = StyleSheet.create({
39
- container: {
40
- flex: 1,
41
- padding: 15
42
- },
43
- title: {
44
- fontSize: 18,
45
- fontWeight: 'bold',
46
- marginBottom: 15,
47
- color: DebugColors.text
48
- },
49
- scrollView: {
50
- flex: 1
51
- },
52
- option: {
53
- padding: 12,
54
- borderRadius: 8,
55
- marginBottom: 8,
56
- backgroundColor: DebugColors.background,
57
- borderWidth: 1,
58
- borderColor: DebugColors.border
59
- },
60
- selectedOption: {
61
- backgroundColor: DebugColors.blue,
62
- borderColor: DebugColors.blue
63
- },
64
- optionText: {
65
- fontSize: 16,
66
- color: DebugColors.text
67
- },
68
- selectedOptionText: {
69
- color: DebugColors.white
70
- }
71
- });
72
-
73
- export default SubViewEnvironment;