react-native-debug-toolkit 2.1.0 → 2.3.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 (419) hide show
  1. package/README.md +52 -93
  2. package/README.zh-CN.md +48 -89
  3. package/lib/commonjs/core/DebugToolkit.js +33 -11
  4. package/lib/commonjs/core/DebugToolkit.js.map +1 -1
  5. package/lib/commonjs/core/DebugToolkitProvider.js +18 -12
  6. package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -1
  7. package/lib/commonjs/{initialize.js → core/initialize.js} +17 -17
  8. package/lib/commonjs/core/initialize.js.map +1 -0
  9. package/lib/commonjs/{components → features/clipboard}/ClipboardTab.js +2 -2
  10. package/lib/commonjs/features/clipboard/ClipboardTab.js.map +1 -0
  11. package/lib/commonjs/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
  12. package/lib/commonjs/features/clipboard/index.js.map +1 -0
  13. package/lib/commonjs/{components → features/console}/ConsoleLogTab.js +9 -9
  14. package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -0
  15. package/lib/commonjs/features/{ConsoleLogFeature.js → console/index.js} +10 -7
  16. package/lib/commonjs/features/console/index.js.map +1 -0
  17. package/lib/commonjs/{components → features/environment}/EnvironmentTab.js +3 -3
  18. package/lib/commonjs/features/environment/EnvironmentTab.js.map +1 -0
  19. package/lib/commonjs/features/{EnvironmentFeature.js → environment/index.js} +18 -13
  20. package/lib/commonjs/features/environment/index.js.map +1 -0
  21. package/lib/commonjs/{components → features/navigation}/NavigationLogTab.js +4 -3
  22. package/lib/commonjs/features/navigation/NavigationLogTab.js.map +1 -0
  23. package/lib/commonjs/features/{NavigationLogFeature.js → navigation/index.js} +4 -4
  24. package/lib/commonjs/features/navigation/index.js.map +1 -0
  25. package/lib/commonjs/{hooks → features/navigation}/useNavigationLogger.js +3 -3
  26. package/lib/commonjs/features/navigation/useNavigationLogger.js.map +1 -0
  27. package/lib/commonjs/{components → features/network}/NetworkLogTab.js +8 -7
  28. package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -0
  29. package/lib/commonjs/features/{NetworkFeature.js → network/index.js} +18 -35
  30. package/lib/commonjs/features/network/index.js.map +1 -0
  31. package/lib/commonjs/features/network/networkInterceptor.js +216 -0
  32. package/lib/commonjs/features/network/networkInterceptor.js.map +1 -0
  33. package/lib/commonjs/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
  34. package/lib/commonjs/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
  35. package/lib/commonjs/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +8 -8
  36. package/lib/commonjs/features/thirdPartyLibs/index.js.map +1 -0
  37. package/lib/commonjs/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
  38. package/lib/commonjs/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
  39. package/lib/commonjs/{components → features/track}/TrackLogTab.js +8 -8
  40. package/lib/commonjs/features/track/TrackLogTab.js.map +1 -0
  41. package/lib/commonjs/features/{TrackFeature.js → track/index.js} +10 -5
  42. package/lib/commonjs/features/track/index.js.map +1 -0
  43. package/lib/commonjs/{components → features/zustand}/ZustandLogTab.js +8 -8
  44. package/lib/commonjs/features/zustand/ZustandLogTab.js.map +1 -0
  45. package/lib/commonjs/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
  46. package/lib/commonjs/features/zustand/index.js.map +1 -0
  47. package/lib/commonjs/index.js +21 -21
  48. package/lib/commonjs/index.js.map +1 -1
  49. package/lib/commonjs/types/environment.js +2 -0
  50. package/lib/commonjs/types/environment.js.map +1 -0
  51. package/lib/commonjs/types/feature.js +6 -0
  52. package/lib/commonjs/types/feature.js.map +1 -0
  53. package/lib/commonjs/types/index.js +0 -4
  54. package/lib/commonjs/types/logs.js +2 -0
  55. package/lib/commonjs/types/logs.js.map +1 -0
  56. package/lib/commonjs/types/navigation.js +2 -0
  57. package/lib/commonjs/types/navigation.js.map +1 -0
  58. package/lib/commonjs/types/thirdPartyLibs.js +2 -0
  59. package/lib/commonjs/types/thirdPartyLibs.js.map +1 -0
  60. package/lib/commonjs/{components → ui}/DebugView.js +2 -2
  61. package/lib/commonjs/ui/DebugView.js.map +1 -0
  62. package/lib/commonjs/{components → ui/floating}/FloatIcon.js +65 -12
  63. package/lib/commonjs/ui/floating/FloatIcon.js.map +1 -0
  64. package/lib/commonjs/{components → ui/panel}/DebugPanel.js +4 -4
  65. package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -0
  66. package/lib/commonjs/{components → ui/panel}/FeatureTabBar.js +1 -1
  67. package/lib/commonjs/ui/panel/FeatureTabBar.js.map +1 -0
  68. package/lib/commonjs/{components → ui/panel}/FloatPanelView.js +36 -12
  69. package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -0
  70. package/lib/commonjs/{components → ui}/shared/CollapsibleSection.js +1 -1
  71. package/lib/commonjs/ui/shared/CollapsibleSection.js.map +1 -0
  72. package/lib/commonjs/{components → ui}/shared/CopyButton.js +1 -1
  73. package/lib/commonjs/ui/shared/CopyButton.js.map +1 -0
  74. package/lib/commonjs/ui/shared/JsonView.js.map +1 -0
  75. package/lib/commonjs/{components → ui}/shared/LogListScreen.js +2 -2
  76. package/lib/commonjs/ui/shared/LogListScreen.js.map +1 -0
  77. package/lib/commonjs/ui/shared/useSlideDetailAnimation.js.map +1 -0
  78. package/lib/commonjs/{utils → ui/theme}/colors.js +0 -5
  79. package/lib/commonjs/ui/theme/colors.js.map +1 -0
  80. package/lib/commonjs/ui/theme/layout.js.map +1 -0
  81. package/lib/commonjs/utils/createChannelFeature.js +18 -4
  82. package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
  83. package/lib/commonjs/utils/createObservableStore.js +5 -0
  84. package/lib/commonjs/utils/createObservableStore.js.map +1 -1
  85. package/lib/commonjs/utils/createPersistedObservableStore.js +71 -0
  86. package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -0
  87. package/lib/commonjs/utils/debugPreferences.js +52 -0
  88. package/lib/commonjs/utils/debugPreferences.js.map +1 -0
  89. package/lib/module/core/DebugToolkit.js +33 -11
  90. package/lib/module/core/DebugToolkit.js.map +1 -1
  91. package/lib/module/core/DebugToolkitProvider.js +18 -12
  92. package/lib/module/core/DebugToolkitProvider.js.map +1 -1
  93. package/lib/module/{initialize.js → core/initialize.js} +10 -10
  94. package/lib/module/core/initialize.js.map +1 -0
  95. package/lib/module/{components → features/clipboard}/ClipboardTab.js +2 -2
  96. package/lib/module/features/clipboard/ClipboardTab.js.map +1 -0
  97. package/lib/module/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
  98. package/lib/module/features/clipboard/index.js.map +1 -0
  99. package/lib/module/{components → features/console}/ConsoleLogTab.js +9 -9
  100. package/lib/module/features/console/ConsoleLogTab.js.map +1 -0
  101. package/lib/module/features/{ConsoleLogFeature.js → console/index.js} +10 -7
  102. package/lib/module/features/console/index.js.map +1 -0
  103. package/lib/module/{components → features/environment}/EnvironmentTab.js +3 -3
  104. package/lib/module/features/environment/EnvironmentTab.js.map +1 -0
  105. package/lib/module/features/{EnvironmentFeature.js → environment/index.js} +18 -13
  106. package/lib/module/features/environment/index.js.map +1 -0
  107. package/lib/module/{components → features/navigation}/NavigationLogTab.js +4 -3
  108. package/lib/module/features/navigation/NavigationLogTab.js.map +1 -0
  109. package/lib/module/features/{NavigationLogFeature.js → navigation/index.js} +4 -4
  110. package/lib/module/features/navigation/index.js.map +1 -0
  111. package/lib/module/{hooks → features/navigation}/useNavigationLogger.js +2 -2
  112. package/lib/module/features/navigation/useNavigationLogger.js.map +1 -0
  113. package/lib/module/{components → features/network}/NetworkLogTab.js +8 -7
  114. package/lib/module/features/network/NetworkLogTab.js.map +1 -0
  115. package/lib/module/features/{NetworkFeature.js → network/index.js} +18 -35
  116. package/lib/module/features/network/index.js.map +1 -0
  117. package/lib/module/features/network/networkInterceptor.js +211 -0
  118. package/lib/module/features/network/networkInterceptor.js.map +1 -0
  119. package/lib/module/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
  120. package/lib/module/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
  121. package/lib/module/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +4 -4
  122. package/lib/module/features/thirdPartyLibs/index.js.map +1 -0
  123. package/lib/module/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
  124. package/lib/module/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
  125. package/lib/module/{components → features/track}/TrackLogTab.js +8 -8
  126. package/lib/module/features/track/TrackLogTab.js.map +1 -0
  127. package/lib/module/features/{TrackFeature.js → track/index.js} +10 -5
  128. package/lib/module/features/track/index.js.map +1 -0
  129. package/lib/module/{components → features/zustand}/ZustandLogTab.js +8 -8
  130. package/lib/module/features/zustand/ZustandLogTab.js.map +1 -0
  131. package/lib/module/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
  132. package/lib/module/features/zustand/index.js.map +1 -0
  133. package/lib/module/index.js +11 -11
  134. package/lib/module/index.js.map +1 -1
  135. package/lib/module/types/environment.js +2 -0
  136. package/lib/module/types/environment.js.map +1 -0
  137. package/lib/module/types/feature.js +4 -0
  138. package/lib/module/types/feature.js.map +1 -0
  139. package/lib/module/types/index.js +0 -2
  140. package/lib/module/types/logs.js +2 -0
  141. package/lib/module/types/logs.js.map +1 -0
  142. package/lib/module/types/navigation.js +2 -0
  143. package/lib/module/types/navigation.js.map +1 -0
  144. package/lib/module/types/thirdPartyLibs.js +2 -0
  145. package/lib/module/types/thirdPartyLibs.js.map +1 -0
  146. package/lib/module/{components → ui}/DebugView.js +2 -2
  147. package/lib/module/ui/DebugView.js.map +1 -0
  148. package/lib/module/{components → ui/floating}/FloatIcon.js +66 -13
  149. package/lib/module/ui/floating/FloatIcon.js.map +1 -0
  150. package/lib/module/{components → ui/panel}/DebugPanel.js +4 -4
  151. package/lib/module/ui/panel/DebugPanel.js.map +1 -0
  152. package/lib/module/{components → ui/panel}/FeatureTabBar.js +1 -1
  153. package/lib/module/ui/panel/FeatureTabBar.js.map +1 -0
  154. package/lib/module/{components → ui/panel}/FloatPanelView.js +36 -12
  155. package/lib/module/ui/panel/FloatPanelView.js.map +1 -0
  156. package/lib/module/{components → ui}/shared/CollapsibleSection.js +1 -1
  157. package/lib/module/ui/shared/CollapsibleSection.js.map +1 -0
  158. package/lib/module/{components → ui}/shared/CopyButton.js +1 -1
  159. package/lib/module/ui/shared/CopyButton.js.map +1 -0
  160. package/lib/module/ui/shared/JsonView.js.map +1 -0
  161. package/lib/module/{components → ui}/shared/LogListScreen.js +2 -2
  162. package/lib/module/ui/shared/LogListScreen.js.map +1 -0
  163. package/lib/module/ui/shared/useSlideDetailAnimation.js.map +1 -0
  164. package/lib/module/{utils → ui/theme}/colors.js +0 -5
  165. package/lib/module/ui/theme/colors.js.map +1 -0
  166. package/lib/module/ui/theme/layout.js.map +1 -0
  167. package/lib/module/utils/createChannelFeature.js +18 -4
  168. package/lib/module/utils/createChannelFeature.js.map +1 -1
  169. package/lib/module/utils/createObservableStore.js +5 -0
  170. package/lib/module/utils/createObservableStore.js.map +1 -1
  171. package/lib/module/utils/createPersistedObservableStore.js +67 -0
  172. package/lib/module/utils/createPersistedObservableStore.js.map +1 -0
  173. package/lib/module/utils/debugPreferences.js +46 -0
  174. package/lib/module/utils/debugPreferences.js.map +1 -0
  175. package/lib/typescript/src/core/DebugToolkit.d.ts +7 -3
  176. package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -1
  177. package/lib/typescript/src/core/DebugToolkitProvider.d.ts +2 -2
  178. package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -1
  179. package/lib/typescript/src/{initialize.d.ts → core/initialize.d.ts} +7 -7
  180. package/lib/typescript/src/core/initialize.d.ts.map +1 -0
  181. package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts +4 -0
  182. package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts.map +1 -0
  183. package/lib/typescript/src/features/{ClipboardFeature.d.ts → clipboard/index.d.ts} +3 -3
  184. package/lib/typescript/src/features/clipboard/index.d.ts.map +1 -0
  185. package/lib/typescript/src/{components → features/console}/ConsoleLogTab.d.ts +2 -2
  186. package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -0
  187. package/lib/typescript/src/features/{ConsoleLogFeature.d.ts → console/index.d.ts} +3 -3
  188. package/lib/typescript/src/features/console/index.d.ts.map +1 -0
  189. package/lib/typescript/src/{components → features/environment}/EnvironmentTab.d.ts +1 -1
  190. package/lib/typescript/src/features/environment/EnvironmentTab.d.ts.map +1 -0
  191. package/lib/typescript/src/features/{EnvironmentFeature.d.ts → environment/index.d.ts} +2 -2
  192. package/lib/typescript/src/features/environment/index.d.ts.map +1 -0
  193. package/lib/typescript/src/{components → features/navigation}/NavigationLogTab.d.ts +2 -2
  194. package/lib/typescript/src/features/navigation/NavigationLogTab.d.ts.map +1 -0
  195. package/lib/typescript/src/features/{NavigationLogFeature.d.ts → navigation/index.d.ts} +3 -3
  196. package/lib/typescript/src/features/navigation/index.d.ts.map +1 -0
  197. package/lib/typescript/src/{hooks → features/navigation}/useNavigationLogger.d.ts +1 -1
  198. package/lib/typescript/src/features/navigation/useNavigationLogger.d.ts.map +1 -0
  199. package/lib/typescript/src/{components → features/network}/NetworkLogTab.d.ts +2 -2
  200. package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -0
  201. package/lib/typescript/src/features/{NetworkFeature.d.ts → network/index.d.ts} +3 -7
  202. package/lib/typescript/src/features/network/index.d.ts.map +1 -0
  203. package/lib/typescript/src/features/network/networkInterceptor.d.ts +6 -0
  204. package/lib/typescript/src/features/network/networkInterceptor.d.ts.map +1 -0
  205. package/lib/typescript/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.d.ts +2 -2
  206. package/lib/typescript/src/features/thirdPartyLibs/ThirdPartyLibsTab.d.ts.map +1 -0
  207. package/lib/typescript/src/features/thirdPartyLibs/index.d.ts +3 -0
  208. package/lib/typescript/src/features/thirdPartyLibs/index.d.ts.map +1 -0
  209. package/lib/typescript/src/{native/NativeDebugLibs.d.ts → features/thirdPartyLibs/nativeDebugLibs.d.ts} +1 -1
  210. package/lib/typescript/src/features/thirdPartyLibs/nativeDebugLibs.d.ts.map +1 -0
  211. package/lib/typescript/src/{components → features/track}/TrackLogTab.d.ts +2 -2
  212. package/lib/typescript/src/features/track/TrackLogTab.d.ts.map +1 -0
  213. package/lib/typescript/src/features/{TrackFeature.d.ts → track/index.d.ts} +3 -3
  214. package/lib/typescript/src/features/track/index.d.ts.map +1 -0
  215. package/lib/typescript/src/{components → features/zustand}/ZustandLogTab.d.ts +2 -2
  216. package/lib/typescript/src/features/zustand/ZustandLogTab.d.ts.map +1 -0
  217. package/lib/typescript/src/features/{ZustandLogFeature.d.ts → zustand/index.d.ts} +3 -3
  218. package/lib/typescript/src/features/zustand/index.d.ts.map +1 -0
  219. package/lib/typescript/src/index.d.ts +19 -19
  220. package/lib/typescript/src/index.d.ts.map +1 -1
  221. package/lib/typescript/src/types/environment.d.ts +11 -0
  222. package/lib/typescript/src/types/environment.d.ts.map +1 -0
  223. package/lib/typescript/src/types/feature.d.ts +23 -0
  224. package/lib/typescript/src/types/feature.d.ts.map +1 -0
  225. package/lib/typescript/src/types/index.d.ts +5 -108
  226. package/lib/typescript/src/types/index.d.ts.map +1 -1
  227. package/lib/typescript/src/types/logs.d.ts +51 -0
  228. package/lib/typescript/src/types/logs.d.ts.map +1 -0
  229. package/lib/typescript/src/types/navigation.d.ts +8 -0
  230. package/lib/typescript/src/types/navigation.d.ts.map +1 -0
  231. package/lib/typescript/src/types/thirdPartyLibs.d.ts +13 -0
  232. package/lib/typescript/src/types/thirdPartyLibs.d.ts.map +1 -0
  233. package/lib/typescript/src/{components → ui}/DebugView.d.ts +1 -1
  234. package/lib/typescript/src/ui/DebugView.d.ts.map +1 -0
  235. package/lib/typescript/src/ui/floating/FloatIcon.d.ts.map +1 -0
  236. package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -0
  237. package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +1 -0
  238. package/lib/typescript/src/ui/panel/FloatPanelView.d.ts +12 -0
  239. package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -0
  240. package/lib/typescript/src/ui/shared/CollapsibleSection.d.ts.map +1 -0
  241. package/lib/typescript/src/ui/shared/CopyButton.d.ts.map +1 -0
  242. package/lib/typescript/src/ui/shared/JsonView.d.ts.map +1 -0
  243. package/lib/typescript/src/ui/shared/LogListScreen.d.ts.map +1 -0
  244. package/lib/typescript/src/ui/shared/useSlideDetailAnimation.d.ts.map +1 -0
  245. package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -0
  246. package/lib/typescript/src/ui/theme/layout.d.ts.map +1 -0
  247. package/lib/typescript/src/utils/createChannelFeature.d.ts +12 -3
  248. package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
  249. package/lib/typescript/src/utils/createObservableStore.d.ts +1 -0
  250. package/lib/typescript/src/utils/createObservableStore.d.ts.map +1 -1
  251. package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +15 -0
  252. package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -0
  253. package/lib/typescript/src/utils/debugPreferences.d.ts +10 -0
  254. package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -0
  255. package/package.json +4 -4
  256. package/src/core/DebugToolkit.tsx +37 -11
  257. package/src/core/DebugToolkitProvider.tsx +20 -13
  258. package/src/{initialize.ts → core/initialize.ts} +16 -16
  259. package/src/{components → features/clipboard}/ClipboardTab.tsx +4 -4
  260. package/src/features/{ClipboardFeature.ts → clipboard/index.ts} +4 -4
  261. package/src/{components → features/console}/ConsoleLogTab.tsx +10 -10
  262. package/src/features/{ConsoleLogFeature.ts → console/index.ts} +11 -8
  263. package/src/{components → features/environment}/EnvironmentTab.tsx +5 -5
  264. package/src/features/{EnvironmentFeature.ts → environment/index.ts} +23 -13
  265. package/src/{components → features/navigation}/NavigationLogTab.tsx +6 -5
  266. package/src/features/{NavigationLogFeature.ts → navigation/index.ts} +5 -5
  267. package/src/{hooks → features/navigation}/useNavigationLogger.ts +3 -3
  268. package/src/{components → features/network}/NetworkLogTab.tsx +10 -9
  269. package/src/features/{NetworkFeature.ts → network/index.ts} +19 -43
  270. package/src/features/network/networkInterceptor.ts +286 -0
  271. package/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.tsx +5 -4
  272. package/src/features/{ThirdPartyLibsFeature.ts → thirdPartyLibs/index.ts} +5 -5
  273. package/src/{components → features/track}/TrackLogTab.tsx +9 -9
  274. package/src/features/{TrackFeature.ts → track/index.ts} +13 -6
  275. package/src/{components → features/zustand}/ZustandLogTab.tsx +10 -10
  276. package/src/features/{ZustandLogFeature.ts → zustand/index.ts} +5 -5
  277. package/src/index.ts +19 -19
  278. package/src/types/environment.ts +11 -0
  279. package/src/types/feature.ts +32 -0
  280. package/src/types/index.ts +29 -127
  281. package/src/types/logs.ts +54 -0
  282. package/src/types/navigation.ts +5 -0
  283. package/src/types/thirdPartyLibs.ts +13 -0
  284. package/src/{components → ui}/DebugView.tsx +3 -3
  285. package/src/{components → ui/floating}/FloatIcon.tsx +60 -29
  286. package/src/{components → ui/panel}/DebugPanel.tsx +4 -4
  287. package/src/{components → ui/panel}/FeatureTabBar.tsx +1 -1
  288. package/src/{components → ui/panel}/FloatPanelView.tsx +38 -13
  289. package/src/{components → ui}/shared/CollapsibleSection.tsx +1 -1
  290. package/src/{components → ui}/shared/CopyButton.tsx +1 -1
  291. package/src/{components → ui}/shared/LogListScreen.tsx +2 -2
  292. package/src/{utils → ui/theme}/colors.ts +0 -5
  293. package/src/utils/createChannelFeature.ts +32 -7
  294. package/src/utils/createObservableStore.ts +6 -0
  295. package/src/utils/createPersistedObservableStore.ts +76 -0
  296. package/src/utils/debugPreferences.ts +48 -0
  297. package/lib/commonjs/components/ClipboardTab.js.map +0 -1
  298. package/lib/commonjs/components/ConsoleLogTab.js.map +0 -1
  299. package/lib/commonjs/components/DebugPanel.js.map +0 -1
  300. package/lib/commonjs/components/DebugView.js.map +0 -1
  301. package/lib/commonjs/components/EnvironmentTab.js.map +0 -1
  302. package/lib/commonjs/components/FeatureTabBar.js.map +0 -1
  303. package/lib/commonjs/components/FloatIcon.js.map +0 -1
  304. package/lib/commonjs/components/FloatPanelView.js.map +0 -1
  305. package/lib/commonjs/components/NavigationLogTab.js.map +0 -1
  306. package/lib/commonjs/components/NetworkLogTab.js.map +0 -1
  307. package/lib/commonjs/components/ThirdPartyLibsTab.js.map +0 -1
  308. package/lib/commonjs/components/TrackLogTab.js.map +0 -1
  309. package/lib/commonjs/components/ZustandLogTab.js.map +0 -1
  310. package/lib/commonjs/components/shared/CollapsibleSection.js.map +0 -1
  311. package/lib/commonjs/components/shared/CopyButton.js.map +0 -1
  312. package/lib/commonjs/components/shared/JsonView.js.map +0 -1
  313. package/lib/commonjs/components/shared/LogListScreen.js.map +0 -1
  314. package/lib/commonjs/features/ClipboardFeature.js.map +0 -1
  315. package/lib/commonjs/features/ConsoleLogFeature.js.map +0 -1
  316. package/lib/commonjs/features/EnvironmentFeature.js.map +0 -1
  317. package/lib/commonjs/features/NavigationLogFeature.js.map +0 -1
  318. package/lib/commonjs/features/NetworkFeature.js.map +0 -1
  319. package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +0 -1
  320. package/lib/commonjs/features/TrackFeature.js.map +0 -1
  321. package/lib/commonjs/features/ZustandLogFeature.js.map +0 -1
  322. package/lib/commonjs/hooks/useNavigationLogger.js.map +0 -1
  323. package/lib/commonjs/hooks/useSlideDetailAnimation.js.map +0 -1
  324. package/lib/commonjs/initialize.js.map +0 -1
  325. package/lib/commonjs/interceptors/networkInterceptor.js +0 -466
  326. package/lib/commonjs/interceptors/networkInterceptor.js.map +0 -1
  327. package/lib/commonjs/native/NativeDebugLibs.js.map +0 -1
  328. package/lib/commonjs/utils/colors.js.map +0 -1
  329. package/lib/commonjs/utils/layout.js.map +0 -1
  330. package/lib/module/components/ClipboardTab.js.map +0 -1
  331. package/lib/module/components/ConsoleLogTab.js.map +0 -1
  332. package/lib/module/components/DebugPanel.js.map +0 -1
  333. package/lib/module/components/DebugView.js.map +0 -1
  334. package/lib/module/components/EnvironmentTab.js.map +0 -1
  335. package/lib/module/components/FeatureTabBar.js.map +0 -1
  336. package/lib/module/components/FloatIcon.js.map +0 -1
  337. package/lib/module/components/FloatPanelView.js.map +0 -1
  338. package/lib/module/components/NavigationLogTab.js.map +0 -1
  339. package/lib/module/components/NetworkLogTab.js.map +0 -1
  340. package/lib/module/components/ThirdPartyLibsTab.js.map +0 -1
  341. package/lib/module/components/TrackLogTab.js.map +0 -1
  342. package/lib/module/components/ZustandLogTab.js.map +0 -1
  343. package/lib/module/components/shared/CollapsibleSection.js.map +0 -1
  344. package/lib/module/components/shared/CopyButton.js.map +0 -1
  345. package/lib/module/components/shared/JsonView.js.map +0 -1
  346. package/lib/module/components/shared/LogListScreen.js.map +0 -1
  347. package/lib/module/features/ClipboardFeature.js.map +0 -1
  348. package/lib/module/features/ConsoleLogFeature.js.map +0 -1
  349. package/lib/module/features/EnvironmentFeature.js.map +0 -1
  350. package/lib/module/features/NavigationLogFeature.js.map +0 -1
  351. package/lib/module/features/NetworkFeature.js.map +0 -1
  352. package/lib/module/features/ThirdPartyLibsFeature.js.map +0 -1
  353. package/lib/module/features/TrackFeature.js.map +0 -1
  354. package/lib/module/features/ZustandLogFeature.js.map +0 -1
  355. package/lib/module/hooks/useNavigationLogger.js.map +0 -1
  356. package/lib/module/hooks/useSlideDetailAnimation.js.map +0 -1
  357. package/lib/module/initialize.js.map +0 -1
  358. package/lib/module/interceptors/networkInterceptor.js +0 -460
  359. package/lib/module/interceptors/networkInterceptor.js.map +0 -1
  360. package/lib/module/native/NativeDebugLibs.js.map +0 -1
  361. package/lib/module/utils/colors.js.map +0 -1
  362. package/lib/module/utils/layout.js.map +0 -1
  363. package/lib/typescript/src/components/ClipboardTab.d.ts +0 -4
  364. package/lib/typescript/src/components/ClipboardTab.d.ts.map +0 -1
  365. package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +0 -1
  366. package/lib/typescript/src/components/DebugPanel.d.ts.map +0 -1
  367. package/lib/typescript/src/components/DebugView.d.ts.map +0 -1
  368. package/lib/typescript/src/components/EnvironmentTab.d.ts.map +0 -1
  369. package/lib/typescript/src/components/FeatureTabBar.d.ts.map +0 -1
  370. package/lib/typescript/src/components/FloatIcon.d.ts.map +0 -1
  371. package/lib/typescript/src/components/FloatPanelView.d.ts +0 -9
  372. package/lib/typescript/src/components/FloatPanelView.d.ts.map +0 -1
  373. package/lib/typescript/src/components/NavigationLogTab.d.ts.map +0 -1
  374. package/lib/typescript/src/components/NetworkLogTab.d.ts.map +0 -1
  375. package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +0 -1
  376. package/lib/typescript/src/components/TrackLogTab.d.ts.map +0 -1
  377. package/lib/typescript/src/components/ZustandLogTab.d.ts.map +0 -1
  378. package/lib/typescript/src/components/shared/CollapsibleSection.d.ts.map +0 -1
  379. package/lib/typescript/src/components/shared/CopyButton.d.ts.map +0 -1
  380. package/lib/typescript/src/components/shared/JsonView.d.ts.map +0 -1
  381. package/lib/typescript/src/components/shared/LogListScreen.d.ts.map +0 -1
  382. package/lib/typescript/src/features/ClipboardFeature.d.ts.map +0 -1
  383. package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +0 -1
  384. package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +0 -1
  385. package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +0 -1
  386. package/lib/typescript/src/features/NetworkFeature.d.ts.map +0 -1
  387. package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts +0 -3
  388. package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts.map +0 -1
  389. package/lib/typescript/src/features/TrackFeature.d.ts.map +0 -1
  390. package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +0 -1
  391. package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +0 -1
  392. package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts.map +0 -1
  393. package/lib/typescript/src/initialize.d.ts.map +0 -1
  394. package/lib/typescript/src/interceptors/networkInterceptor.d.ts +0 -18
  395. package/lib/typescript/src/interceptors/networkInterceptor.d.ts.map +0 -1
  396. package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +0 -1
  397. package/lib/typescript/src/utils/colors.d.ts.map +0 -1
  398. package/lib/typescript/src/utils/layout.d.ts.map +0 -1
  399. package/src/interceptors/networkInterceptor.ts +0 -646
  400. /package/lib/commonjs/{components → ui}/shared/JsonView.js +0 -0
  401. /package/lib/commonjs/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
  402. /package/lib/commonjs/{utils → ui/theme}/layout.js +0 -0
  403. /package/lib/module/{components → ui}/shared/JsonView.js +0 -0
  404. /package/lib/module/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
  405. /package/lib/module/{utils → ui/theme}/layout.js +0 -0
  406. /package/lib/typescript/src/{components → ui/floating}/FloatIcon.d.ts +0 -0
  407. /package/lib/typescript/src/{components → ui/panel}/DebugPanel.d.ts +0 -0
  408. /package/lib/typescript/src/{components → ui/panel}/FeatureTabBar.d.ts +0 -0
  409. /package/lib/typescript/src/{components → ui}/shared/CollapsibleSection.d.ts +0 -0
  410. /package/lib/typescript/src/{components → ui}/shared/CopyButton.d.ts +0 -0
  411. /package/lib/typescript/src/{components → ui}/shared/JsonView.d.ts +0 -0
  412. /package/lib/typescript/src/{components → ui}/shared/LogListScreen.d.ts +0 -0
  413. /package/lib/typescript/src/{hooks → ui/shared}/useSlideDetailAnimation.d.ts +0 -0
  414. /package/lib/typescript/src/{utils → ui/theme}/colors.d.ts +0 -0
  415. /package/lib/typescript/src/{utils → ui/theme}/layout.d.ts +0 -0
  416. /package/src/{native/NativeDebugLibs.ts → features/thirdPartyLibs/nativeDebugLibs.ts} +0 -0
  417. /package/src/{components → ui}/shared/JsonView.tsx +0 -0
  418. /package/src/{hooks → ui/shared}/useSlideDetailAnimation.ts +0 -0
  419. /package/src/{utils → ui/theme}/layout.ts +0 -0
@@ -0,0 +1,286 @@
1
+ import type { NetworkLogEntry } from '../../types';
2
+ import { urlRewriter } from '../../utils/urlRewriterRegistry';
3
+
4
+ type NetworkLogPayload = Omit<NetworkLogEntry, 'id'>;
5
+
6
+ // Intercepts React Native's XMLHttpRequest transport layer.
7
+ // RN fetch and axios (default adapter) both go through XHR — one hook captures everything.
8
+
9
+ // ─── Shared helpers ────────────────────────────────────
10
+
11
+ function rewriteUrl(url: string): string {
12
+ const rewriter = urlRewriter.get();
13
+ if (!rewriter) {
14
+ return url;
15
+ }
16
+ try {
17
+ return rewriter(url);
18
+ } catch {
19
+ return url;
20
+ }
21
+ }
22
+
23
+ function parseRawHeaders(rawHeaders: string | null | undefined): Record<string, string> | undefined {
24
+ if (!rawHeaders) {
25
+ return undefined;
26
+ }
27
+
28
+ const headers: Record<string, string> = {};
29
+ rawHeaders
30
+ .trim()
31
+ .split(/[\r\n]+/)
32
+ .forEach((line) => {
33
+ const separatorIndex = line.indexOf(':');
34
+ if (separatorIndex <= 0) {
35
+ return;
36
+ }
37
+ const key = line.slice(0, separatorIndex).trim();
38
+ const value = line.slice(separatorIndex + 1).trim();
39
+ if (key) {
40
+ headers[key] = value;
41
+ }
42
+ });
43
+ return Object.keys(headers).length > 0 ? headers : undefined;
44
+ }
45
+
46
+ function parseBodyText(raw: string): unknown {
47
+ if (!raw) return undefined;
48
+ try {
49
+ return JSON.parse(raw);
50
+ } catch {
51
+ return raw;
52
+ }
53
+ }
54
+
55
+ function normalizeXhrResponseBody(xhr: XMLHttpRequestLike): unknown {
56
+ const text = safeRead(() => xhr.responseText);
57
+ if (typeof text === 'string' && text) {
58
+ return parseBodyText(text);
59
+ }
60
+
61
+ const response = safeRead(() => xhr.response);
62
+ if (response != null) {
63
+ return response;
64
+ }
65
+
66
+ return undefined;
67
+ }
68
+
69
+ // ─── XMLHttpRequest interceptor ───────────────────────
70
+
71
+ interface XMLHttpRequestLike {
72
+ readyState: number;
73
+ DONE?: number;
74
+ status: number;
75
+ statusText?: string;
76
+ responseHeaders?: Record<string, string> | null;
77
+ responseType?: string;
78
+ response?: unknown;
79
+ responseText?: string;
80
+ responseURL?: string;
81
+ open(method: string, url: string, ...args: unknown[]): void;
82
+ send(body?: unknown): void;
83
+ setRequestHeader(header: string, value: string): void;
84
+ getAllResponseHeaders?(): string | null;
85
+ addEventListener(type: string, listener: () => void): void;
86
+ removeEventListener(type: string, listener: () => void): void;
87
+ }
88
+
89
+ type XMLHttpRequestConstructorLike = new () => XMLHttpRequestLike;
90
+
91
+ type XhrState = {
92
+ method: string;
93
+ url: string;
94
+ headers: Record<string, string>;
95
+ body?: unknown;
96
+ timestamp: number;
97
+ error?: string;
98
+ completed?: boolean;
99
+ };
100
+
101
+ let originalXMLHttpRequest: XMLHttpRequestConstructorLike | null = null;
102
+ let originalXhrOpen: XMLHttpRequestLike['open'] | null = null;
103
+ let originalXhrSend: XMLHttpRequestLike['send'] | null = null;
104
+ let originalXhrSetRequestHeader: XMLHttpRequestLike['setRequestHeader'] | null = null;
105
+ let xhrRefCount = 0;
106
+ const pendingXhrRequests = new WeakMap<XMLHttpRequestLike, XhrState>();
107
+
108
+ function safeRead<T>(read: () => T): T | undefined {
109
+ try {
110
+ return read();
111
+ } catch {
112
+ return undefined;
113
+ }
114
+ }
115
+
116
+ function getGlobalXMLHttpRequest(): XMLHttpRequestConstructorLike | undefined {
117
+ return (globalThis as { XMLHttpRequest?: XMLHttpRequestConstructorLike }).XMLHttpRequest;
118
+ }
119
+
120
+ function getXhrResponseHeaders(xhr: XMLHttpRequestLike): Record<string, string> | undefined {
121
+ const rawHeaders = safeRead(() => xhr.getAllResponseHeaders?.());
122
+ const parsedHeaders = parseRawHeaders(rawHeaders);
123
+ if (parsedHeaders) {
124
+ return parsedHeaders;
125
+ }
126
+
127
+ const headers = xhr.responseHeaders;
128
+ if (!headers) {
129
+ return undefined;
130
+ }
131
+ return Object.keys(headers).length > 0 ? headers : undefined;
132
+ }
133
+
134
+ function stopXMLHttpRequest(): void {
135
+ xhrRefCount = Math.max(0, xhrRefCount - 1);
136
+ if (xhrRefCount > 0 || !originalXMLHttpRequest) {
137
+ return;
138
+ }
139
+
140
+ const CurrentXMLHttpRequest = getGlobalXMLHttpRequest();
141
+ if (CurrentXMLHttpRequest) {
142
+ if (originalXhrOpen) {
143
+ CurrentXMLHttpRequest.prototype.open = originalXhrOpen;
144
+ }
145
+ if (originalXhrSend) {
146
+ CurrentXMLHttpRequest.prototype.send = originalXhrSend;
147
+ }
148
+ if (originalXhrSetRequestHeader) {
149
+ CurrentXMLHttpRequest.prototype.setRequestHeader = originalXhrSetRequestHeader;
150
+ }
151
+ }
152
+
153
+ originalXMLHttpRequest = null;
154
+ originalXhrOpen = null;
155
+ originalXhrSend = null;
156
+ originalXhrSetRequestHeader = null;
157
+ }
158
+
159
+ export function startXMLHttpRequest(
160
+ emit: (entry: NetworkLogPayload) => void,
161
+ ): () => void {
162
+ const CurrentXMLHttpRequest = getGlobalXMLHttpRequest();
163
+ if (!CurrentXMLHttpRequest) {
164
+ return () => {};
165
+ }
166
+
167
+ xhrRefCount += 1;
168
+ if (originalXMLHttpRequest) {
169
+ return () => {
170
+ stopXMLHttpRequest();
171
+ };
172
+ }
173
+
174
+ originalXMLHttpRequest = CurrentXMLHttpRequest;
175
+ originalXhrOpen = CurrentXMLHttpRequest.prototype.open;
176
+ originalXhrSend = CurrentXMLHttpRequest.prototype.send;
177
+ originalXhrSetRequestHeader = CurrentXMLHttpRequest.prototype.setRequestHeader;
178
+
179
+ CurrentXMLHttpRequest.prototype.open = function interceptedOpen(
180
+ this: XMLHttpRequestLike,
181
+ method: string,
182
+ url: string,
183
+ ...args: unknown[]
184
+ ) {
185
+ const rewrittenUrl = urlRewriter.get() ? rewriteUrl(url) : url;
186
+ pendingXhrRequests.set(this, {
187
+ method: (method || 'GET').toUpperCase(),
188
+ url: rewrittenUrl,
189
+ headers: {},
190
+ timestamp: Date.now(),
191
+ });
192
+ return originalXhrOpen!.call(this, method, rewrittenUrl, ...args);
193
+ };
194
+
195
+ CurrentXMLHttpRequest.prototype.setRequestHeader = function interceptedSetRequestHeader(
196
+ this: XMLHttpRequestLike,
197
+ header: string,
198
+ value: string,
199
+ ) {
200
+ const state = pendingXhrRequests.get(this);
201
+ if (state) {
202
+ state.headers[header] = value;
203
+ }
204
+ return originalXhrSetRequestHeader!.call(this, header, value);
205
+ };
206
+
207
+ CurrentXMLHttpRequest.prototype.send = function interceptedSend(
208
+ this: XMLHttpRequestLike,
209
+ body?: unknown,
210
+ ) {
211
+ const that = this;
212
+ const state = pendingXhrRequests.get(that) ?? {
213
+ method: 'GET',
214
+ url: '',
215
+ headers: {},
216
+ timestamp: Date.now(),
217
+ };
218
+ state.body = body;
219
+ state.timestamp = Date.now();
220
+ pendingXhrRequests.set(that, state);
221
+
222
+ const complete = () => {
223
+ const currentState = pendingXhrRequests.get(that);
224
+ if (!currentState || currentState.completed) {
225
+ return;
226
+ }
227
+ currentState.completed = true;
228
+
229
+ const headers = getXhrResponseHeaders(that);
230
+ emit({
231
+ timestamp: currentState.timestamp,
232
+ duration: Date.now() - currentState.timestamp,
233
+ request: {
234
+ url: currentState.url,
235
+ method: currentState.method,
236
+ headers: Object.keys(currentState.headers).length > 0
237
+ ? currentState.headers
238
+ : undefined,
239
+ body: currentState.body,
240
+ },
241
+ response: {
242
+ status: that.status,
243
+ statusText: that.statusText,
244
+ headers,
245
+ data: normalizeXhrResponseBody(that),
246
+ success: that.status >= 200 && that.status < 300,
247
+ },
248
+ error: currentState.error,
249
+ });
250
+ };
251
+
252
+ const markError = (message: string) => {
253
+ const currentState = pendingXhrRequests.get(that);
254
+ if (currentState) {
255
+ currentState.error = message;
256
+ }
257
+ };
258
+
259
+ that.addEventListener('error', () => {
260
+ markError('Network Error');
261
+ });
262
+ that.addEventListener('timeout', () => {
263
+ markError('Timeout');
264
+ });
265
+ that.addEventListener('abort', () => {
266
+ markError('Aborted');
267
+ });
268
+ that.addEventListener('loadend', complete);
269
+
270
+ return originalXhrSend!.call(that, body);
271
+ };
272
+
273
+ return () => {
274
+ stopXMLHttpRequest();
275
+ };
276
+ }
277
+
278
+ // ─── Cleanup ───────────────────────────────────────────
279
+
280
+ export function resetInterceptors(): void {
281
+ if (originalXMLHttpRequest) {
282
+ xhrRefCount = 1;
283
+ stopXMLHttpRequest();
284
+ }
285
+ xhrRefCount = 0;
286
+ }
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
3
- import { Colors } from '../utils/colors';
4
- import type { DebugFeatureRenderProps, ThirdPartyLib, ThirdPartyLibAction } from '../types';
3
+ import { Colors } from '../../ui/theme/colors';
4
+ import type { DebugFeatureRenderProps, ThirdPartyLib, ThirdPartyLibAction } from '../../types';
5
5
 
6
- export const ThirdPartyLibsTab: React.FC<DebugFeatureRenderProps<ThirdPartyLib>> = ({
7
- data,
6
+ export const ThirdPartyLibsTab: React.FC<DebugFeatureRenderProps<ThirdPartyLib[]>> = ({
7
+ snapshot,
8
8
  }) => {
9
+ const data = snapshot;
9
10
  if (data.length === 0) {
10
11
  return (
11
12
  <View style={styles.container}>
@@ -1,7 +1,7 @@
1
1
  import { Platform } from 'react-native';
2
- import { ThirdPartyLibsTab } from '../components/ThirdPartyLibsTab';
3
- import { NativeDebugLibs } from '../native/NativeDebugLibs';
4
- import type { DebugFeature, ThirdPartyLib } from '../types';
2
+ import { ThirdPartyLibsTab } from './ThirdPartyLibsTab';
3
+ import { NativeDebugLibs } from './nativeDebugLibs';
4
+ import type { DebugFeature, ThirdPartyLib } from '../../types';
5
5
 
6
6
  const availableLibs: ThirdPartyLib[] = [
7
7
  {
@@ -32,11 +32,11 @@ function getPlatformLibs(): ThirdPartyLib[] {
32
32
  );
33
33
  }
34
34
 
35
- export const createThirdPartyLibsFeature = (): DebugFeature<ThirdPartyLib> => ({
35
+ export const createThirdPartyLibsFeature = (): DebugFeature<ThirdPartyLib[]> => ({
36
36
  name: 'thirdPartyLibs',
37
37
  label: 'Debug Libraries',
38
38
  renderContent: ThirdPartyLibsTab,
39
39
  setup: () => {},
40
- getData: () => getPlatformLibs(),
40
+ getSnapshot: () => getPlatformLibs(),
41
41
  cleanup: () => {},
42
42
  });
@@ -1,16 +1,16 @@
1
1
  import React from 'react';
2
2
  import { View, Text, StyleSheet, ScrollView } from 'react-native';
3
- import { Colors } from '../utils/colors';
4
- import { safeStringify } from '../utils/safeStringify';
5
- import { CollapsibleSection } from './shared/CollapsibleSection';
6
- import { JsonView } from './shared/JsonView';
7
- import { CopyButton } from './shared/CopyButton';
8
- import { LogListScreen } from './shared/LogListScreen';
9
- import type { DebugFeatureRenderProps, TrackLogEntry } from '../types';
3
+ import { Colors } from '../../ui/theme/colors';
4
+ import { safeStringify } from '../../utils/safeStringify';
5
+ import { CollapsibleSection } from '../../ui/shared/CollapsibleSection';
6
+ import { JsonView } from '../../ui/shared/JsonView';
7
+ import { CopyButton } from '../../ui/shared/CopyButton';
8
+ import { LogListScreen } from '../../ui/shared/LogListScreen';
9
+ import type { DebugFeatureRenderProps, TrackLogEntry } from '../../types';
10
10
 
11
- export const TrackLogTab: React.FC<DebugFeatureRenderProps<TrackLogEntry>> = React.memo(({ data }) => (
11
+ export const TrackLogTab: React.FC<DebugFeatureRenderProps<TrackLogEntry[]>> = React.memo(({ snapshot }) => (
12
12
  <LogListScreen
13
- data={data}
13
+ data={snapshot}
14
14
  emptyText="No track events"
15
15
  renderRow={(item) => (
16
16
  <View style={s.cardRow}>
@@ -1,7 +1,8 @@
1
- import { TrackLogTab } from '../components/TrackLogTab';
2
- import type { DebugFeature, TrackLogEntry } from '../types';
3
- import { createEventChannel } from '../utils/createEventChannel';
4
- import { createChannelFeature } from '../utils/createChannelFeature';
1
+ import { TrackLogTab } from './TrackLogTab';
2
+ import type { DebugFeature, TrackLogEntry } from '../../types';
3
+ import { createEventChannel } from '../../utils/createEventChannel';
4
+ import { createChannelFeature } from '../../utils/createChannelFeature';
5
+ import { KEYS } from '../../utils/debugPreferences';
5
6
 
6
7
  export interface TrackEventData {
7
8
  eventName: string;
@@ -21,11 +22,17 @@ export interface TrackFeatureConfig {
21
22
  maxLogs?: number;
22
23
  }
23
24
 
24
- export const createTrackFeature = (config?: TrackFeatureConfig): DebugFeature<TrackLogEntry> =>
25
+ export const createTrackFeature = (config?: TrackFeatureConfig): DebugFeature<TrackLogEntry[]> =>
25
26
  createChannelFeature(
26
27
  () => trackChannel,
27
28
  (payload, id) => ({ ...payload, id }),
28
- { name: 'track', label: 'Track', renderContent: TrackLogTab, maxLogs: config?.maxLogs },
29
+ {
30
+ name: 'track',
31
+ label: 'Track',
32
+ renderContent: TrackLogTab,
33
+ maxLogs: config?.maxLogs,
34
+ persist: { storageKey: KEYS.trackLogs, maxPersist: 50 },
35
+ },
29
36
  );
30
37
 
31
38
  /** Reset module-level state for testing */
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { View, Text, StyleSheet, ScrollView } from 'react-native';
3
- import { Colors } from '../utils/colors';
4
- import { safeStringify } from '../utils/safeStringify';
5
- import { CollapsibleSection } from './shared/CollapsibleSection';
6
- import { JsonView } from './shared/JsonView';
7
- import { CopyButton } from './shared/CopyButton';
8
- import { LogListScreen } from './shared/LogListScreen';
9
- import type { DebugFeatureRenderProps, ZustandLogEntry } from '../types';
3
+ import { Colors } from '../../ui/theme/colors';
4
+ import { safeStringify } from '../../utils/safeStringify';
5
+ import { CollapsibleSection } from '../../ui/shared/CollapsibleSection';
6
+ import { JsonView } from '../../ui/shared/JsonView';
7
+ import { CopyButton } from '../../ui/shared/CopyButton';
8
+ import { LogListScreen } from '../../ui/shared/LogListScreen';
9
+ import type { DebugFeatureRenderProps, ZustandLogEntry } from '../../types';
10
10
 
11
11
  const getActionColor = (action: string): string => {
12
12
  if (action.includes('add') || action.includes('create')) return '#34C759';
@@ -34,11 +34,11 @@ function findChanges(prev: unknown, next: unknown): string[] {
34
34
  return changed;
35
35
  }
36
36
 
37
- export const ZustandLogTab: React.FC<DebugFeatureRenderProps<ZustandLogEntry>> = React.memo(({
38
- data,
37
+ export const ZustandLogTab: React.FC<DebugFeatureRenderProps<ZustandLogEntry[]>> = React.memo(({
38
+ snapshot,
39
39
  }) => (
40
40
  <LogListScreen
41
- data={data}
41
+ data={snapshot}
42
42
  emptyText="No Zustand state changes"
43
43
  renderRow={(item) => (
44
44
  <View style={s.cardRow}>
@@ -1,7 +1,7 @@
1
- import { ZustandLogTab } from '../components/ZustandLogTab';
2
- import type { DebugFeature, ZustandLogEntry } from '../types';
3
- import { createEventChannel } from '../utils/createEventChannel';
4
- import { createChannelFeature } from '../utils/createChannelFeature';
1
+ import { ZustandLogTab } from './ZustandLogTab';
2
+ import type { DebugFeature, ZustandLogEntry } from '../../types';
3
+ import { createEventChannel } from '../../utils/createEventChannel';
4
+ import { createChannelFeature } from '../../utils/createChannelFeature';
5
5
 
6
6
  type ZustandLogPayload = Omit<ZustandLogEntry, 'id'>;
7
7
 
@@ -88,7 +88,7 @@ export interface ZustandFeatureConfig {
88
88
  maxLogs?: number;
89
89
  }
90
90
 
91
- export const createZustandLogFeature = (config?: ZustandFeatureConfig): DebugFeature<ZustandLogEntry> =>
91
+ export const createZustandLogFeature = (config?: ZustandFeatureConfig): DebugFeature<ZustandLogEntry[]> =>
92
92
  createChannelFeature(
93
93
  () => zustandChannel,
94
94
  (payload, id) => ({ ...payload, id }),
package/src/index.ts CHANGED
@@ -1,28 +1,28 @@
1
1
  // Core
2
2
  export { DebugToolkit } from './core/DebugToolkit';
3
3
  export { DebugToolkitProvider, useDebugToolkit } from './core/DebugToolkitProvider';
4
- export { DebugView } from './components/DebugView';
5
- export type { DebugViewProps } from './components/DebugView';
6
- export { initializeDebugToolkit } from './initialize';
7
- export type { InitializeOptions, FeatureConfigs } from './initialize';
4
+ export { DebugView } from './ui/DebugView';
5
+ export type { DebugViewProps } from './ui/DebugView';
6
+ export { initializeDebugToolkit } from './core/initialize';
7
+ export type { InitializeOptions, FeatureConfigs } from './core/initialize';
8
8
 
9
9
  // Feature factories
10
- export { createNetworkFeature } from './features/NetworkFeature';
11
- export type { NetworkFeatureConfig, AxiosInstanceLike } from './features/NetworkFeature';
12
- export { createConsoleLogFeature } from './features/ConsoleLogFeature';
13
- export type { ConsoleFeatureConfig } from './features/ConsoleLogFeature';
14
- export { createZustandLogFeature, zustandLogMiddleware, addZustandLog } from './features/ZustandLogFeature';
15
- export type { ZustandFeatureConfig } from './features/ZustandLogFeature';
16
- export { createNavigationLogFeature, addNavigationLog } from './features/NavigationLogFeature';
17
- export type { NavigationFeatureConfig } from './features/NavigationLogFeature';
18
- export { createTrackFeature, addTrackLog } from './features/TrackFeature';
19
- export type { TrackFeatureConfig, TrackEventData } from './features/TrackFeature';
20
- export { createEnvironmentFeature } from './features/EnvironmentFeature';
21
- export type { EnvironmentFeatureAPI } from './features/EnvironmentFeature';
22
- export { createClipboardFeature } from './features/ClipboardFeature';
10
+ export { createNetworkFeature } from './features/network';
11
+ export type { NetworkFeatureConfig } from './features/network';
12
+ export { createConsoleLogFeature } from './features/console';
13
+ export type { ConsoleFeatureConfig } from './features/console';
14
+ export { createZustandLogFeature, zustandLogMiddleware, addZustandLog } from './features/zustand';
15
+ export type { ZustandFeatureConfig } from './features/zustand';
16
+ export { createNavigationLogFeature, addNavigationLog } from './features/navigation';
17
+ export type { NavigationFeatureConfig } from './features/navigation';
18
+ export { createTrackFeature, addTrackLog } from './features/track';
19
+ export type { TrackFeatureConfig, TrackEventData } from './features/track';
20
+ export { createEnvironmentFeature } from './features/environment';
21
+ export type { EnvironmentFeatureAPI } from './features/environment';
22
+ export { createClipboardFeature } from './features/clipboard';
23
23
 
24
24
  // Hooks
25
- export { useNavigationLogger } from './hooks/useNavigationLogger';
25
+ export { useNavigationLogger } from './features/navigation/useNavigationLogger';
26
26
 
27
27
  // Utilities
28
28
  export { safeStringify } from './utils/safeStringify';
@@ -45,4 +45,4 @@ export type {
45
45
  } from './types';
46
46
 
47
47
  // Default export for convenience
48
- export { initializeDebugToolkit as default } from './initialize';
48
+ export { initializeDebugToolkit as default } from './core/initialize';
@@ -0,0 +1,11 @@
1
+ export interface EnvironmentConfig {
2
+ id: string;
3
+ label: string;
4
+ host: string;
5
+ color?: string;
6
+ }
7
+
8
+ export interface EnvironmentState {
9
+ environments: EnvironmentConfig[];
10
+ currentEnvironmentId: string | null;
11
+ }
@@ -0,0 +1,32 @@
1
+ import type { ComponentType } from 'react';
2
+
3
+ export type DebugFeatureListener = () => void;
4
+
5
+ export type BuiltInFeatureName =
6
+ | 'network'
7
+ | 'console'
8
+ | 'zustand'
9
+ | 'navigation'
10
+ | 'track'
11
+ | 'environment'
12
+ | 'clipboard';
13
+
14
+ export interface DebugFeatureRenderProps<TSnapshot = unknown> {
15
+ snapshot: TSnapshot;
16
+ feature: DebugFeature<TSnapshot>;
17
+ }
18
+
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ export type AnyDebugFeature = DebugFeature<any>;
21
+
22
+ export interface DebugFeature<TSnapshot = unknown> {
23
+ name: string;
24
+ label: string;
25
+ setup: () => void;
26
+ getSnapshot: () => TSnapshot;
27
+ clear?: () => void;
28
+ cleanup: () => void;
29
+ subscribe?: (listener: DebugFeatureListener) => () => void;
30
+ renderContent?: ComponentType<DebugFeatureRenderProps<TSnapshot>>;
31
+ badge?: () => { label: string; color: string } | null;
32
+ }