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
@@ -1,127 +1,29 @@
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
- /** Props passed to a feature's renderContent component */
15
- export interface DebugFeatureRenderProps<TData = unknown> {
16
- data: TData[];
17
- feature: DebugFeature<TData>;
18
- }
19
-
20
- /**
21
- * Type-erased feature for heterogeneous collections.
22
- * Individual features should use `DebugFeature<TData>` with their specific data type.
23
- * This alias is only for places that hold features of multiple types.
24
- */
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
- export type AnyDebugFeature = DebugFeature<any>;
27
-
28
-
29
- /** Base interface all debug features must implement */
30
- export interface DebugFeature<TData = unknown> {
31
- name: string;
32
- label: string;
33
- setup: () => void;
34
- getData: () => TData[];
35
- clear?: () => void;
36
- cleanup: () => void;
37
- subscribe?: (listener: DebugFeatureListener) => () => void;
38
- renderContent?: ComponentType<DebugFeatureRenderProps<TData>>;
39
- badge?: () => { label: string; color: string } | null;
40
- }
41
-
42
- export interface NetworkLogEntry {
43
- id: string;
44
- timestamp: number;
45
- duration?: number;
46
- request: {
47
- url: string;
48
- method: string;
49
- headers?: Record<string, string>;
50
- body?: unknown;
51
- };
52
- response?: {
53
- status: number;
54
- statusText?: string;
55
- headers?: Record<string, string>;
56
- data?: unknown;
57
- success?: boolean;
58
- };
59
- error?: string;
60
- }
61
-
62
- export interface ConsoleLogEntry {
63
- id: string;
64
- timestamp: number;
65
- level: 'log' | 'info' | 'warn' | 'error';
66
- data: unknown[];
67
- }
68
-
69
- export interface ZustandLogEntry {
70
- id: string;
71
- timestamp: number;
72
- action: string;
73
- prevState: unknown;
74
- nextState: unknown;
75
- actionCompleteTime?: number;
76
- storeName?: string;
77
- }
78
-
79
- export interface NavigationLogEntry {
80
- id: string;
81
- timestamp: number;
82
- action: string;
83
- from: string;
84
- to: string;
85
- startTime?: number;
86
- duration?: number;
87
- debugLog?: string;
88
- }
89
-
90
- export interface TrackLogEntry {
91
- id: string;
92
- timestamp: number;
93
- eventName: string;
94
- [key: string]: unknown;
95
- }
96
-
97
- export interface EnvironmentConfig {
98
- id: string;
99
- label: string;
100
- host: string;
101
- color?: string;
102
- }
103
-
104
- export interface EnvironmentState {
105
- environments: EnvironmentConfig[];
106
- currentEnvironmentId: string | null;
107
- }
108
-
109
- export interface NavigationContainerRef {
110
- getCurrentRoute?: () => { name?: string } | undefined;
111
- getRootState?: () => unknown;
112
- addListener: (event: string, callback: () => void) => () => void;
113
- }
114
-
115
- export interface ThirdPartyLibAction {
116
- id: string;
117
- label: string;
118
- onPress: () => void;
119
- }
120
-
121
- export interface ThirdPartyLib {
122
- id: string;
123
- name: string;
124
- description: string;
125
- platform: 'ios' | 'android' | 'both';
126
- actions: ThirdPartyLibAction[];
127
- }
1
+ export type {
2
+ AnyDebugFeature,
3
+ BuiltInFeatureName,
4
+ DebugFeature,
5
+ DebugFeatureListener,
6
+ DebugFeatureRenderProps,
7
+ } from './feature';
8
+
9
+ export type {
10
+ ConsoleLogEntry,
11
+ NavigationLogEntry,
12
+ NetworkLogEntry,
13
+ TrackLogEntry,
14
+ ZustandLogEntry,
15
+ } from './logs';
16
+
17
+ export type {
18
+ EnvironmentConfig,
19
+ EnvironmentState,
20
+ } from './environment';
21
+
22
+ export type {
23
+ NavigationContainerRef,
24
+ } from './navigation';
25
+
26
+ export type {
27
+ ThirdPartyLib,
28
+ ThirdPartyLibAction,
29
+ } from './thirdPartyLibs';
@@ -0,0 +1,54 @@
1
+ export interface NetworkLogEntry {
2
+ id: string;
3
+ timestamp: number;
4
+ duration?: number;
5
+ request: {
6
+ url: string;
7
+ method: string;
8
+ headers?: Record<string, string>;
9
+ body?: unknown;
10
+ };
11
+ response?: {
12
+ status: number;
13
+ statusText?: string;
14
+ headers?: Record<string, string>;
15
+ data?: unknown;
16
+ success?: boolean;
17
+ };
18
+ error?: string;
19
+ }
20
+
21
+ export interface ConsoleLogEntry {
22
+ id: string;
23
+ timestamp: number;
24
+ level: 'log' | 'info' | 'warn' | 'error';
25
+ data: unknown[];
26
+ }
27
+
28
+ export interface ZustandLogEntry {
29
+ id: string;
30
+ timestamp: number;
31
+ action: string;
32
+ prevState: unknown;
33
+ nextState: unknown;
34
+ actionCompleteTime?: number;
35
+ storeName?: string;
36
+ }
37
+
38
+ export interface NavigationLogEntry {
39
+ id: string;
40
+ timestamp: number;
41
+ action: string;
42
+ from: string;
43
+ to: string;
44
+ startTime?: number;
45
+ duration?: number;
46
+ debugLog?: string;
47
+ }
48
+
49
+ export interface TrackLogEntry {
50
+ id: string;
51
+ timestamp: number;
52
+ eventName: string;
53
+ [key: string]: unknown;
54
+ }
@@ -0,0 +1,5 @@
1
+ export interface NavigationContainerRef {
2
+ getCurrentRoute?: () => { name?: string } | undefined;
3
+ getRootState?: () => unknown;
4
+ addListener: (event: string, callback: () => void) => () => void;
5
+ }
@@ -0,0 +1,13 @@
1
+ export interface ThirdPartyLibAction {
2
+ id: string;
3
+ label: string;
4
+ onPress: () => void;
5
+ }
6
+
7
+ export interface ThirdPartyLib {
8
+ id: string;
9
+ name: string;
10
+ description: string;
11
+ platform: 'ios' | 'android' | 'both';
12
+ actions: ThirdPartyLibAction[];
13
+ }
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect } from 'react';
2
2
  import { DebugToolkitProvider } from '../core/DebugToolkitProvider';
3
- import { initializeDebugToolkit } from '../initialize';
4
- import type { FeatureConfigs } from '../initialize';
5
- import { useNavigationLogger } from '../hooks/useNavigationLogger';
3
+ import { initializeDebugToolkit } from '../core/initialize';
4
+ import type { FeatureConfigs } from '../core/initialize';
5
+ import { useNavigationLogger } from '../features/navigation/useNavigationLogger';
6
6
  import type { EnvironmentConfig, NavigationContainerRef } from '../types';
7
7
 
8
8
  // --- Types ---
@@ -1,4 +1,4 @@
1
- import React, { useRef } from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import {
3
3
  View,
4
4
  Text,
@@ -8,8 +8,11 @@ import {
8
8
  Pressable,
9
9
  useWindowDimensions,
10
10
  } from 'react-native';
11
- import { Colors } from '../utils/colors';
12
- import { ICON_SIZE } from '../utils/layout';
11
+ import { Colors } from '../theme/colors';
12
+ import { ICON_SIZE } from '../theme/layout';
13
+ import { getPreference, setPreference, KEYS } from '../../utils/debugPreferences';
14
+
15
+ const EDGE_MARGIN = 16;
13
16
 
14
17
  interface FloatIconProps {
15
18
  visible: boolean;
@@ -19,14 +22,32 @@ interface FloatIconProps {
19
22
 
20
23
  export function FloatIcon({ visible, onPress, badge }: FloatIconProps) {
21
24
  const { width: screenWidth, height: screenHeight } = useWindowDimensions();
22
- const initialX = screenWidth - ICON_SIZE - 16;
23
- const initialY = screenHeight / 2 - ICON_SIZE / 2;
25
+ const defaultX = screenWidth - ICON_SIZE - EDGE_MARGIN;
26
+ const defaultY = screenHeight / 2 - ICON_SIZE / 2;
24
27
 
25
- const pan = useRef(
26
- new Animated.ValueXY({ x: initialX, y: initialY }),
27
- ).current;
28
+ const pan = useRef(new Animated.ValueXY({ x: defaultX, y: defaultY })).current;
28
29
  const scale = useRef(new Animated.Value(1)).current;
29
- const lastPosition = useRef({ x: initialX, y: initialY });
30
+ const lastPosition = useRef({ x: defaultX, y: defaultY });
31
+ const positionLoaded = useRef(false);
32
+
33
+ // Restore saved position
34
+ useEffect(() => {
35
+ let mounted = true;
36
+ getPreference(KEYS.fabPosition).then((saved) => {
37
+ if (!mounted || !saved) return;
38
+ try {
39
+ const pos = JSON.parse(saved) as { x: number; y: number };
40
+ const x = Math.max(0, Math.min(pos.x, screenWidth - ICON_SIZE));
41
+ const y = Math.max(0, Math.min(pos.y, screenHeight - ICON_SIZE));
42
+ lastPosition.current = { x, y };
43
+ pan.setValue({ x, y });
44
+ positionLoaded.current = true;
45
+ } catch {
46
+ // ignore bad data
47
+ }
48
+ });
49
+ return () => { mounted = false; };
50
+ }, [screenWidth, screenHeight, pan]);
30
51
 
31
52
  const panResponder = useRef(
32
53
  PanResponder.create({
@@ -57,28 +78,38 @@ export function FloatIcon({ visible, onPress, badge }: FloatIconProps) {
57
78
  return;
58
79
  }
59
80
  Animated.spring(scale, { toValue: 1, friction: 5, useNativeDriver: true }).start();
60
- lastPosition.current = {
61
- x: Math.max(
62
- 0,
63
- Math.min(lastPosition.current.x + gs.dx, screenWidth - ICON_SIZE),
64
- ),
65
- y: Math.max(
66
- 0,
67
- Math.min(lastPosition.current.y + gs.dy, screenHeight - ICON_SIZE),
68
- ),
69
- };
81
+
82
+ // Snap to nearest edge
83
+ const rawX = lastPosition.current.x + gs.dx;
84
+ const midX = screenWidth / 2 - ICON_SIZE / 2;
85
+ const snappedX = rawX < midX ? EDGE_MARGIN : screenWidth - ICON_SIZE - EDGE_MARGIN;
86
+
87
+ const finalY = Math.max(
88
+ 0,
89
+ Math.min(lastPosition.current.y + gs.dy, screenHeight - ICON_SIZE),
90
+ );
91
+
92
+ lastPosition.current = { x: snappedX, y: finalY };
93
+ Animated.spring(pan, {
94
+ toValue: { x: snappedX, y: finalY },
95
+ friction: 7,
96
+ tension: 40,
97
+ useNativeDriver: true,
98
+ }).start();
99
+
100
+ // Persist
101
+ setPreference(KEYS.fabPosition, JSON.stringify({ x: snappedX, y: finalY }));
70
102
  },
71
103
  onPanResponderTerminate: (_: unknown, gs: { dx: number; dy: number }) => {
72
- lastPosition.current = {
73
- x: Math.max(
74
- 0,
75
- Math.min(lastPosition.current.x + gs.dx, screenWidth - ICON_SIZE),
76
- ),
77
- y: Math.max(
78
- 0,
79
- Math.min(lastPosition.current.y + gs.dy, screenHeight - ICON_SIZE),
80
- ),
81
- };
104
+ const snappedX =
105
+ lastPosition.current.x + gs.dx < screenWidth / 2 - ICON_SIZE / 2
106
+ ? EDGE_MARGIN
107
+ : screenWidth - ICON_SIZE - EDGE_MARGIN;
108
+ const finalY = Math.max(
109
+ 0,
110
+ Math.min(lastPosition.current.y + gs.dy, screenHeight - ICON_SIZE),
111
+ );
112
+ lastPosition.current = { x: snappedX, y: finalY };
82
113
  },
83
114
  }),
84
115
  ).current;
@@ -9,7 +9,7 @@ import {
9
9
  TouchableOpacity,
10
10
  useWindowDimensions,
11
11
  } from 'react-native';
12
- import { Colors } from '../utils/colors';
12
+ import { Colors } from '../theme/colors';
13
13
 
14
14
  interface DebugPanelProps {
15
15
  onClose: () => void;
@@ -156,7 +156,7 @@ const styles = StyleSheet.create({
156
156
  },
157
157
  dragHandle: {
158
158
  width: '100%',
159
- height: 20,
159
+ height: 28,
160
160
  alignItems: 'center',
161
161
  justifyContent: 'center',
162
162
  backgroundColor: Colors.surface,
@@ -165,7 +165,7 @@ const styles = StyleSheet.create({
165
165
  width: 40,
166
166
  height: 4,
167
167
  borderRadius: 2,
168
- backgroundColor: '#D1D1D6',
168
+ backgroundColor: Colors.textLight,
169
169
  },
170
170
  panelContent: { flex: 1 },
171
171
  header: {
@@ -191,7 +191,7 @@ const styles = StyleSheet.create({
191
191
  paddingHorizontal: 12,
192
192
  paddingVertical: 6,
193
193
  borderRadius: 8,
194
- backgroundColor: 'rgba(255,59,48,0.06)',
194
+ backgroundColor: `${Colors.error}0F`,
195
195
  },
196
196
  clearButtonText: {
197
197
  color: Colors.error,
@@ -7,7 +7,7 @@ import {
7
7
  ScrollView,
8
8
  TouchableOpacity,
9
9
  } from 'react-native';
10
- import { Colors } from '../utils/colors';
10
+ import { Colors } from '../theme/colors';
11
11
 
12
12
  export interface TabItem {
13
13
  id: string;
@@ -7,8 +7,9 @@ import {
7
7
  PanResponder,
8
8
  Easing,
9
9
  } from 'react-native';
10
- import type { AnyDebugFeature } from '../types';
11
- import { FloatIcon } from './FloatIcon';
10
+ import type { AnyDebugFeature } from '../../types';
11
+ import { getPreference, setPreference, KEYS } from '../../utils/debugPreferences';
12
+ import { FloatIcon } from '../floating/FloatIcon';
12
13
  import { DebugPanel } from './DebugPanel';
13
14
  import { FeatureTabBar } from './FeatureTabBar';
14
15
  import type { TabItem } from './FeatureTabBar';
@@ -41,12 +42,29 @@ class DebugErrorBoundary extends Component<
41
42
 
42
43
  interface FloatPanelViewProps {
43
44
  features: AnyDebugFeature[];
45
+ panelOpen: boolean;
46
+ onOpenPanel: () => void;
47
+ onClosePanel: () => void;
44
48
  onClearAll: () => void;
45
49
  }
46
50
 
47
- export function FloatPanelView({ features, onClearAll }: FloatPanelViewProps) {
48
- const [isOpen, setIsOpen] = useState(false);
51
+ export function FloatPanelView({ features, panelOpen, onOpenPanel, onClosePanel, onClearAll }: FloatPanelViewProps) {
49
52
  const [activeTab, setActiveTab] = useState(0);
53
+ const tabLoaded = useRef(false);
54
+
55
+ // Restore last tab on mount
56
+ useEffect(() => {
57
+ let mounted = true;
58
+ getPreference(KEYS.lastTab).then((val) => {
59
+ if (!mounted || !val) return;
60
+ const idx = parseInt(val, 10);
61
+ if (!isNaN(idx) && idx >= 0) {
62
+ setActiveTab(idx);
63
+ tabLoaded.current = true;
64
+ }
65
+ });
66
+ return () => { mounted = false; };
67
+ }, []);
50
68
 
51
69
  // Content slide animation
52
70
  const contentOpacity = useRef(new Animated.Value(1)).current;
@@ -96,9 +114,12 @@ export function FloatPanelView({ features, onClearAll }: FloatPanelViewProps) {
96
114
  return () => unsubs.forEach((u) => u());
97
115
  }, [features, scheduleRefresh]);
98
116
 
99
- // Reset activeTab if features shrink
117
+ // Clamp activeTab if features shrink
100
118
  useEffect(() => {
101
- if (activeTab >= features.length) setActiveTab(0);
119
+ if (features.length > 0 && activeTab >= features.length) {
120
+ setActiveTab(0);
121
+ setPreference(KEYS.lastTab, '0');
122
+ }
102
123
  }, [features.length, activeTab]);
103
124
 
104
125
  // Tab switching with content animation
@@ -117,6 +138,7 @@ export function FloatPanelView({ features, onClearAll }: FloatPanelViewProps) {
117
138
  }),
118
139
  ]).start(() => {
119
140
  setActiveTab(index);
141
+ setPreference(KEYS.lastTab, String(index));
120
142
  contentTranslateX.setValue(direction * 40);
121
143
  Animated.parallel([
122
144
  Animated.timing(contentOpacity, { toValue: 1, duration: 150, useNativeDriver: true }),
@@ -148,22 +170,25 @@ export function FloatPanelView({ features, onClearAll }: FloatPanelViewProps) {
148
170
  }
149
171
  const feature = features[activeTab];
150
172
  if (!feature) return <Text style={styles.emptyText}>Feature not found</Text>;
151
- const data = feature.getData();
173
+ const snapshot = feature.getSnapshot();
152
174
  const TabComponent = feature.renderContent;
153
- if (TabComponent) return <TabComponent data={data} feature={feature} />;
175
+ if (TabComponent) return <TabComponent snapshot={snapshot} feature={feature} />;
154
176
  return (
155
177
  <View style={styles.genericContent}>
156
- <Text style={styles.jsonContent}>{JSON.stringify(data, null, 2)}</Text>
178
+ <Text style={styles.jsonContent}>{JSON.stringify(snapshot, null, 2)}</Text>
157
179
  </View>
158
180
  );
159
181
  };
160
182
 
161
183
  return (
162
- <DebugErrorBoundary onError={() => setIsOpen(false)}>
184
+ <DebugErrorBoundary onError={onClosePanel}>
163
185
  <View style={styles.container} pointerEvents="box-none">
164
- <FloatIcon visible={!isOpen} onPress={() => setIsOpen(true)} badge={envBadge} />
165
- {isOpen && (
166
- <DebugPanel onClose={() => setIsOpen(false)} onClearAll={onClearAll}>
186
+ <FloatIcon visible={!panelOpen} onPress={onOpenPanel} badge={envBadge} />
187
+ {panelOpen && (
188
+ <DebugPanel
189
+ onClose={onClosePanel}
190
+ onClearAll={onClearAll}
191
+ >
167
192
  <FeatureTabBar tabs={tabs} activeIndex={activeTab} onSelectTab={switchTab} />
168
193
  <Animated.View
169
194
  style={[
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { View, Text, Pressable, StyleSheet, Animated } from 'react-native';
3
- import { Colors } from '../../utils/colors';
3
+ import { Colors } from '../theme/colors';
4
4
 
5
5
  interface Props {
6
6
  title: string;
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useState } from 'react';
2
2
  import { TouchableOpacity, Text, StyleSheet } from 'react-native';
3
- import { Colors } from '../../utils/colors';
3
+ import { Colors } from '../theme/colors';
4
4
  import { copyToComputer } from '../../utils/copyToComputer';
5
5
 
6
6
  interface CopyButtonProps {
@@ -7,8 +7,8 @@ import {
7
7
  StyleSheet,
8
8
  Animated,
9
9
  } from 'react-native';
10
- import { Colors } from '../../utils/colors';
11
- import { useSlideDetailAnimation } from '../../hooks/useSlideDetailAnimation';
10
+ import { Colors } from '../theme/colors';
11
+ import { useSlideDetailAnimation } from './useSlideDetailAnimation';
12
12
 
13
13
  interface LogListItem {
14
14
  id: string;
@@ -1,6 +1,4 @@
1
- // Apple iOS System Color Palette
2
1
  export const Colors = {
3
- // System
4
2
  primary: '#007AFF',
5
3
  text: '#1C1C1E',
6
4
  textSecondary: '#8E8E93',
@@ -9,16 +7,13 @@ export const Colors = {
9
7
  background: '#F2F2F7',
10
8
  surface: '#FFFFFF',
11
9
 
12
- // Semantic
13
10
  success: '#34C759',
14
11
  error: '#FF3B30',
15
12
  warning: '#FF9500',
16
13
  info: '#5AC8FA',
17
14
 
18
- // Accent
19
15
  purple: '#AF52DE',
20
16
 
21
- // HTTP Method Colors
22
17
  get: '#007AFF',
23
18
  post: '#34C759',
24
19
  put: '#FF9500',
@@ -1,10 +1,18 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type { DebugFeature, DebugFeatureListener, DebugFeatureRenderProps } from '../types';
3
3
  import type { EventChannel } from './createEventChannel';
4
- import { createObservableStore } from './createObservableStore';
4
+ import { createObservableStore, type ObservableStore } from './createObservableStore';
5
+ import { createPersistedObservableStore } from './createPersistedObservableStore';
5
6
 
6
7
  const DEFAULT_MAX_LOGS = 200;
7
8
 
9
+ export interface ChannelFeaturePersistConfig<TEntry> {
10
+ storageKey: string;
11
+ maxPersist: number;
12
+ debounceMs?: number;
13
+ serialize?: (entry: TEntry) => unknown;
14
+ }
15
+
8
16
  /**
9
17
  * Generic factory for features that subscribe to an event channel.
10
18
  * Eliminates boilerplate across channel-based features (Track, Navigation, Zustand).
@@ -13,19 +21,36 @@ const DEFAULT_MAX_LOGS = 200;
13
21
  * @param toEntry - Maps a payload + auto-generated id to a typed log entry
14
22
  * @param options - Feature name, label, render component, and optional maxLogs
15
23
  */
16
- export function createChannelFeature<TPayload, TEntry>(
24
+ export function createChannelFeature<TPayload, TEntry extends { id?: string }>(
17
25
  getChannel: () => EventChannel<TPayload>,
18
26
  toEntry: (payload: TPayload, id: string) => TEntry,
19
27
  options: {
20
28
  name: string;
21
29
  label: string;
22
- renderContent?: ComponentType<DebugFeatureRenderProps<TEntry>>;
30
+ renderContent?: ComponentType<DebugFeatureRenderProps<TEntry[]>>;
23
31
  maxLogs?: number;
32
+ persist?: ChannelFeaturePersistConfig<TEntry>;
24
33
  },
25
- ): DebugFeature<TEntry> {
34
+ ): DebugFeature<TEntry[]> {
26
35
  const maxLogs = options.maxLogs ?? DEFAULT_MAX_LOGS;
27
- const logStore = createObservableStore<TEntry>();
28
36
  let nextId = 0;
37
+ let logStore: ObservableStore<TEntry>;
38
+ let getId: () => string;
39
+
40
+ if (options.persist) {
41
+ const persisted = createPersistedObservableStore<TEntry>({
42
+ storageKey: options.persist.storageKey,
43
+ maxPersist: options.persist.maxPersist,
44
+ debounceMs: options.persist.debounceMs,
45
+ serialize: options.persist.serialize,
46
+ });
47
+ logStore = persisted;
48
+ getId = () => persisted.nextId();
49
+ } else {
50
+ logStore = createObservableStore<TEntry>();
51
+ getId = () => String(nextId++);
52
+ }
53
+
29
54
  let initialized = false;
30
55
  let unsubscribe: (() => void) | null = null;
31
56
 
@@ -36,11 +61,11 @@ export function createChannelFeature<TPayload, TEntry>(
36
61
  setup: () => {
37
62
  if (initialized) return;
38
63
  unsubscribe = getChannel().subscribe((payload) => {
39
- logStore.push(toEntry(payload, String(nextId++)), maxLogs);
64
+ logStore.push(toEntry(payload, getId()), maxLogs);
40
65
  });
41
66
  initialized = true;
42
67
  },
43
- getData: () => logStore.getData(),
68
+ getSnapshot: () => logStore.getData(),
44
69
  clear: () => {
45
70
  logStore.clear();
46
71
  },
@@ -3,6 +3,7 @@ export type StoreListener = () => void;
3
3
  export interface ObservableStore<T> {
4
4
  getData: () => T[];
5
5
  push: (item: T, maxEntries?: number) => void;
6
+ pushBatch: (items: T[]) => void;
6
7
  clear: () => void;
7
8
  subscribe: (listener: StoreListener) => () => void;
8
9
  }
@@ -25,6 +26,11 @@ export function createObservableStore<T>(): ObservableStore<T> {
25
26
  }
26
27
  notify();
27
28
  },
29
+ pushBatch: (items) => {
30
+ if (items.length === 0) return;
31
+ data = [...data, ...items];
32
+ notify();
33
+ },
28
34
  clear: () => {
29
35
  if (data.length === 0) {
30
36
  return;