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,239 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import {
3
- View,
4
- Text,
5
- StyleSheet,
6
- FlatList,
7
- TouchableOpacity,
8
- TextInput,
9
- Platform,
10
- } from 'react-native';
11
-
12
- const SubViewThirdPartyLibs = ({ libraries = [] }) => {
13
- const [expandedLibs, setExpandedLibs] = useState(new Set());
14
- const [actionParams, setActionParams] = useState({});
15
-
16
- // Set all libraries to expanded by default and set default product ID
17
- useEffect(() => {
18
- // Create a set of all library IDs to set them as expanded
19
- const allLibIds = new Set(libraries.map(lib => lib.id));
20
- setExpandedLibs(allLibIds);
21
-
22
- // Initialize default product ID for all actions that might need it
23
- const defaultParams = {};
24
- libraries.forEach(lib => {
25
- lib.actions.forEach(action => {
26
- if (action.hasParam) {
27
- defaultParams[`${lib.id}_${action.id}`] = 'default';
28
- }
29
- });
30
- });
31
- setActionParams(defaultParams);
32
- }, [libraries]);
33
-
34
- // Handle lib expansion/collapse
35
- const toggleLibExpand = (libId) => {
36
- setExpandedLibs(prev => {
37
- const newSet = new Set(prev);
38
- if (newSet.has(libId)) {
39
- newSet.delete(libId);
40
- } else {
41
- newSet.add(libId);
42
- }
43
- return newSet;
44
- });
45
- };
46
-
47
- // Execute library action
48
- const executeAction = (action, libId) => {
49
- try {
50
- if (action.hasParam) {
51
- // Get parameter value (if needed)
52
- const paramValue = actionParams[`${libId}_${action.id}`] || 'default';
53
- action.method(paramValue);
54
- } else {
55
- action.method();
56
- }
57
- // No alerts shown as per requirement
58
- } catch (error) {
59
- // Silent error handling as per requirement
60
- console.error(`Failed to execute ${action.label}:`, error);
61
- }
62
- };
63
-
64
- // Handle param input change
65
- const handleParamChange = (libId, actionId, value) => {
66
- setActionParams({
67
- ...actionParams,
68
- [`${libId}_${actionId}`]: value,
69
- });
70
- };
71
-
72
- // Render a single library card
73
- const renderLibraryItem = ({ item }) => {
74
- const isExpanded = expandedLibs.has(item.id);
75
- const isPlatformSupported = item.platform === 'both' ||
76
- item.platform === Platform.OS;
77
-
78
- if (!isPlatformSupported) return null;
79
-
80
- return (
81
- <View style={styles.libraryCard}>
82
- <TouchableOpacity
83
- style={styles.libraryHeader}
84
- onPress={() => toggleLibExpand(item.id)}>
85
- <View style={styles.libraryTitle}>
86
- <Text style={styles.libraryName}>{item.name}</Text>
87
- <Text style={styles.platformBadge}>
88
- {item.platform === 'both' ? 'iOS & Android' : item.platform}
89
- </Text>
90
- </View>
91
- <Text style={styles.expandIcon}>{isExpanded ? '▼' : '▶'}</Text>
92
- </TouchableOpacity>
93
-
94
- <Text style={styles.libraryDescription}>{item.description}</Text>
95
-
96
- {isExpanded && (
97
- <View style={styles.actionsContainer}>
98
- {item.actions.map((action) => (
99
- <View key={action.id} style={styles.actionItem}>
100
- {action.hasParam && (
101
- <TextInput
102
- style={styles.paramInput}
103
- placeholder={action.paramPlaceholder || 'Parameter'}
104
- value={actionParams[`${item.id}_${action.id}`] || 'default'}
105
- onChangeText={(text) =>
106
- handleParamChange(item.id, action.id, text)
107
- }
108
- />
109
- )}
110
- <TouchableOpacity
111
- style={styles.actionButton}
112
- onPress={() => executeAction(action, item.id)}>
113
- <Text style={styles.actionButtonText}>{action.label}</Text>
114
- </TouchableOpacity>
115
- </View>
116
- ))}
117
- </View>
118
- )}
119
- </View>
120
- );
121
- };
122
-
123
- // Filter platform-supported libraries
124
- const supportedLibraries = libraries.filter(
125
- lib => lib.platform === 'both' || lib.platform === Platform.OS
126
- );
127
-
128
- return (
129
- <View style={styles.container}>
130
- {supportedLibraries.length === 0 ? (
131
- <Text style={styles.emptyText}>
132
- No debug libraries available for this platform
133
- </Text>
134
- ) : (
135
- <FlatList
136
- data={supportedLibraries}
137
- renderItem={renderLibraryItem}
138
- keyExtractor={(item) => item.id}
139
- contentContainerStyle={styles.listContent}
140
- />
141
- )}
142
- </View>
143
- );
144
- };
145
-
146
- const styles = StyleSheet.create({
147
- container: {
148
- flex: 1,
149
- backgroundColor: '#fff',
150
- },
151
- listContent: {
152
- padding: 12,
153
- },
154
- emptyText: {
155
- textAlign: 'center',
156
- color: '#999',
157
- marginTop: 20,
158
- fontSize: 16,
159
- },
160
- libraryCard: {
161
- backgroundColor: '#f8f9fa',
162
- borderRadius: 8,
163
- borderWidth: 1,
164
- borderColor: '#e9ecef',
165
- marginBottom: 16,
166
- padding: 12,
167
- elevation: 1,
168
- shadowColor: '#000',
169
- shadowOffset: { width: 0, height: 1 },
170
- shadowOpacity: 0.1,
171
- shadowRadius: 1,
172
- },
173
- libraryHeader: {
174
- flexDirection: 'row',
175
- justifyContent: 'space-between',
176
- alignItems: 'center',
177
- },
178
- libraryTitle: {
179
- flexDirection: 'row',
180
- alignItems: 'center',
181
- flex: 1,
182
- },
183
- libraryName: {
184
- fontSize: 18,
185
- fontWeight: 'bold',
186
- color: '#333',
187
- marginRight: 8,
188
- },
189
- platformBadge: {
190
- fontSize: 12,
191
- color: '#666',
192
- backgroundColor: '#e9ecef',
193
- paddingHorizontal: 8,
194
- paddingVertical: 2,
195
- borderRadius: 12,
196
- overflow: 'hidden',
197
- },
198
- expandIcon: {
199
- fontSize: 14,
200
- color: '#666',
201
- },
202
- libraryDescription: {
203
- marginTop: 8,
204
- marginBottom: 12,
205
- color: '#666',
206
- fontSize: 14,
207
- lineHeight: 20,
208
- },
209
- actionsContainer: {
210
- marginTop: 8,
211
- borderTopWidth: 1,
212
- borderTopColor: '#eee',
213
- paddingTop: 12,
214
- },
215
- actionItem: {
216
- marginBottom: 8,
217
- },
218
- paramInput: {
219
- borderWidth: 1,
220
- borderColor: '#ddd',
221
- borderRadius: 4,
222
- padding: 8,
223
- marginBottom: 8,
224
- fontSize: 14,
225
- },
226
- actionButton: {
227
- backgroundColor: '#0D96F2',
228
- padding: 10,
229
- borderRadius: 4,
230
- alignItems: 'center',
231
- },
232
- actionButtonText: {
233
- color: '#fff',
234
- fontWeight: '500',
235
- fontSize: 14,
236
- },
237
- });
238
-
239
- export default SubViewThirdPartyLibs;
@@ -1,318 +0,0 @@
1
- import React, { useState } from 'react'
2
- import {
3
- View,
4
- Text,
5
- StyleSheet,
6
- FlatList,
7
- TouchableOpacity,
8
- } from 'react-native'
9
- import TrackLogDetails from './TrackLogDetails'
10
-
11
- const SubViewTrackLogs = ({ logs = [] }) => {
12
- const [selectedLog, setSelectedLog] = useState(null)
13
-
14
- const getEventColor = (eventName) => {
15
- if (eventName?.includes('error')) return '#ff4444'
16
- if (eventName?.includes('click')) return '#4CAF50'
17
- if (eventName?.includes('view')) return '#2196F3'
18
- if (eventName?.includes('search')) return '#FF9800'
19
- return '#9C27B0'
20
- }
21
-
22
- const getTimeAgo = (timestamp) => {
23
- const now = new Date()
24
- const eventTime = new Date(timestamp)
25
- const diffMs = now - eventTime
26
- const diffSeconds = Math.floor(diffMs / 1000)
27
- const diffMinutes = Math.floor(diffSeconds / 60)
28
- const diffHours = Math.floor(diffMinutes / 60)
29
-
30
- if (diffSeconds < 60) {
31
- return `${diffSeconds}s ago`
32
- } else if (diffMinutes < 60) {
33
- return `${diffMinutes}m ago`
34
- } else if (diffHours < 24) {
35
- return `${diffHours}h ago`
36
- } else {
37
- const diffDays = Math.floor(diffHours / 24)
38
- return `${diffDays}d ago`
39
- }
40
- }
41
-
42
- const renderLogItem = ({ item }) => {
43
- const eventColor = getEventColor(item.eventName)
44
-
45
- return (
46
- <TouchableOpacity
47
- style={styles.logItem}
48
- onPress={() => setSelectedLog(item)}>
49
- <View style={styles.logItemContainer}>
50
- <View
51
- style={[styles.eventIndicator, { backgroundColor: eventColor }]}
52
- />
53
-
54
- <View style={styles.logContent}>
55
- <View style={styles.eventRow}>
56
- <Text style={[styles.eventName, { color: eventColor }]}>
57
- {item.eventName || 'Unknown Event'}
58
- </Text>
59
- {item.entityType && (
60
- <Text style={styles.entityType}>
61
- {item.entityType}
62
- </Text>
63
- )}
64
- </View>
65
-
66
- {item.entityName && (
67
- <Text style={styles.entityName} numberOfLines={1}>
68
- {item.entityName}
69
- </Text>
70
- )}
71
-
72
- {item.frontOperation && (
73
- <Text style={styles.operation} numberOfLines={1}>
74
- Operation: {item.frontOperation}
75
- </Text>
76
- )}
77
-
78
- <View style={styles.logFooter}>
79
- <Text style={styles.time}>
80
- {item.timestamp
81
- ? getTimeAgo(item.timestamp)
82
- : 'Unknown time'}
83
- </Text>
84
-
85
- <View style={styles.additionalInfo}>
86
- {item.pageId && (
87
- <Text style={styles.pageId} numberOfLines={1}>
88
- Page: {item.pageId}
89
- </Text>
90
- )}
91
- {item.position && (
92
- <Text style={styles.position}>
93
- Pos: {item.position}
94
- </Text>
95
- )}
96
- </View>
97
- </View>
98
- </View>
99
- </View>
100
- </TouchableOpacity>
101
- )
102
- }
103
-
104
- // If a log is selected, show the details view with a back button
105
- if (selectedLog) {
106
- return (
107
- <View style={styles.container}>
108
- <View style={styles.detailsHeader}>
109
- <TouchableOpacity
110
- style={styles.backButton}
111
- onPress={() => setSelectedLog(null)}>
112
- <Text style={styles.backButtonText}>← Back</Text>
113
- </TouchableOpacity>
114
- <View style={styles.headerEventInfo}>
115
- <Text
116
- style={[
117
- styles.headerEvent,
118
- { color: getEventColor(selectedLog.eventName) },
119
- ]}>
120
- {selectedLog.eventName || 'Unknown Event'}
121
- </Text>
122
- {selectedLog.entityType && (
123
- <Text style={styles.headerEntityType}>
124
- {selectedLog.entityType}
125
- </Text>
126
- )}
127
- </View>
128
- </View>
129
- <TrackLogDetails log={selectedLog} />
130
- </View>
131
- )
132
- }
133
-
134
- // Otherwise show the list view
135
- return (
136
- <View style={styles.container}>
137
- {logs.length === 0 ? (
138
- <View style={styles.emptyContainer}>
139
- <Text style={styles.emptyText}>No track events logged yet</Text>
140
- <Text style={styles.emptySubtext}>
141
- Track events will appear here as they occur during development
142
- </Text>
143
- </View>
144
- ) : (
145
- <>
146
- <View style={styles.statsContainer}>
147
- <Text style={styles.statsText}>
148
- {logs.length} events logged
149
- </Text>
150
- </View>
151
- <FlatList
152
- data={[...logs].sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp))}
153
- renderItem={renderLogItem}
154
- keyExtractor={(item, index) => `${item.timestamp}-${index}`}
155
- style={styles.list}
156
- showsVerticalScrollIndicator={true}
157
- />
158
- </>
159
- )}
160
- </View>
161
- )
162
- }
163
-
164
- const styles = StyleSheet.create({
165
- container: {
166
- flex: 1,
167
- backgroundColor: '#fff',
168
- },
169
- list: {
170
- flex: 1,
171
- },
172
- emptyContainer: {
173
- flex: 1,
174
- justifyContent: 'center',
175
- alignItems: 'center',
176
- padding: 40,
177
- },
178
- emptyText: {
179
- textAlign: 'center',
180
- color: '#666',
181
- fontSize: 16,
182
- fontWeight: '500',
183
- marginBottom: 8,
184
- },
185
- emptySubtext: {
186
- textAlign: 'center',
187
- color: '#999',
188
- fontSize: 14,
189
- },
190
- statsContainer: {
191
- padding: 12,
192
- borderBottomWidth: 1,
193
- borderBottomColor: '#eee',
194
- backgroundColor: '#f8f9fa',
195
- },
196
- statsText: {
197
- fontSize: 12,
198
- color: '#666',
199
- fontWeight: '500',
200
- },
201
- logItem: {
202
- borderBottomWidth: 1,
203
- borderBottomColor: '#eee',
204
- },
205
- logItemContainer: {
206
- flexDirection: 'row',
207
- padding: 12,
208
- },
209
- eventIndicator: {
210
- width: 4,
211
- borderRadius: 2,
212
- marginRight: 12,
213
- },
214
- logContent: {
215
- flex: 1,
216
- },
217
- eventRow: {
218
- flexDirection: 'row',
219
- alignItems: 'center',
220
- marginBottom: 4,
221
- },
222
- eventName: {
223
- fontSize: 15,
224
- fontWeight: 'bold',
225
- marginRight: 8,
226
- },
227
- entityType: {
228
- fontSize: 11,
229
- backgroundColor: '#f0f0f0',
230
- color: '#666',
231
- paddingHorizontal: 6,
232
- paddingVertical: 2,
233
- borderRadius: 6,
234
- fontWeight: '500',
235
- },
236
- entityName: {
237
- fontSize: 14,
238
- color: '#333',
239
- marginBottom: 4,
240
- fontWeight: '500',
241
- },
242
- operation: {
243
- fontSize: 13,
244
- color: '#666',
245
- marginBottom: 6,
246
- fontStyle: 'italic',
247
- },
248
- logFooter: {
249
- flexDirection: 'row',
250
- justifyContent: 'space-between',
251
- alignItems: 'flex-end',
252
- },
253
- time: {
254
- fontSize: 12,
255
- color: '#999',
256
- },
257
- additionalInfo: {
258
- flexDirection: 'row',
259
- alignItems: 'center',
260
- gap: 8,
261
- },
262
- pageId: {
263
- fontSize: 11,
264
- color: '#666',
265
- backgroundColor: '#f8f9fa',
266
- paddingHorizontal: 4,
267
- paddingVertical: 1,
268
- borderRadius: 3,
269
- maxWidth: 80,
270
- },
271
- position: {
272
- fontSize: 11,
273
- color: '#666',
274
- backgroundColor: '#f8f9fa',
275
- paddingHorizontal: 4,
276
- paddingVertical: 1,
277
- borderRadius: 3,
278
- },
279
- detailsHeader: {
280
- flexDirection: 'row',
281
- alignItems: 'center',
282
- padding: 15,
283
- borderBottomWidth: 1,
284
- borderBottomColor: '#eee',
285
- backgroundColor: '#f8f9fa',
286
- },
287
- backButton: {
288
- paddingHorizontal: 10,
289
- paddingVertical: 5,
290
- borderRadius: 4,
291
- backgroundColor: '#eee',
292
- marginRight: 10,
293
- },
294
- backButtonText: {
295
- color: '#333',
296
- fontWeight: '500',
297
- },
298
- headerEventInfo: {
299
- flexDirection: 'row',
300
- alignItems: 'center',
301
- },
302
- headerEvent: {
303
- fontSize: 16,
304
- fontWeight: 'bold',
305
- marginRight: 10,
306
- },
307
- headerEntityType: {
308
- fontSize: 12,
309
- backgroundColor: '#f0f0f0',
310
- color: '#666',
311
- paddingHorizontal: 8,
312
- paddingVertical: 3,
313
- borderRadius: 8,
314
- fontWeight: '500',
315
- },
316
- })
317
-
318
- export default SubViewTrackLogs