react-native-debug-toolkit 2.0.0 → 2.2.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.
- package/README.md +82 -120
- package/README.zh-CN.md +171 -0
- package/lib/commonjs/core/DebugToolkit.js +117 -115
- package/lib/commonjs/core/DebugToolkit.js.map +1 -1
- package/lib/commonjs/core/DebugToolkitProvider.js +38 -30
- package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -1
- package/lib/commonjs/core/initialize.js +84 -0
- package/lib/commonjs/core/initialize.js.map +1 -0
- package/lib/commonjs/{components → features/clipboard}/ClipboardTab.js +16 -17
- package/lib/commonjs/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/commonjs/features/{ClipboardFeature.js → clipboard/index.js} +9 -5
- package/lib/commonjs/features/clipboard/index.js.map +1 -0
- package/lib/commonjs/features/console/ConsoleLogTab.js +162 -0
- package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/commonjs/features/console/index.js +118 -0
- package/lib/commonjs/features/console/index.js.map +1 -0
- package/lib/commonjs/{components → features/environment}/EnvironmentTab.js +24 -25
- package/lib/commonjs/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/commonjs/features/{EnvironmentFeature.js → environment/index.js} +22 -25
- package/lib/commonjs/features/environment/index.js.map +1 -0
- package/lib/commonjs/{components → features/navigation}/NavigationLogTab.js +11 -10
- package/lib/commonjs/features/navigation/NavigationLogTab.js.map +1 -0
- package/lib/commonjs/features/navigation/index.js +39 -0
- package/lib/commonjs/features/navigation/index.js.map +1 -0
- package/lib/commonjs/{hooks → features/navigation}/useNavigationLogger.js +3 -3
- package/lib/commonjs/features/navigation/useNavigationLogger.js.map +1 -0
- package/lib/commonjs/features/network/NetworkLogTab.js +405 -0
- package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -0
- package/lib/commonjs/features/network/index.js +96 -0
- package/lib/commonjs/features/network/index.js.map +1 -0
- package/lib/commonjs/features/network/networkInterceptor.js +261 -0
- package/lib/commonjs/features/network/networkInterceptor.js.map +1 -0
- package/lib/commonjs/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +10 -9
- package/lib/commonjs/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
- package/lib/commonjs/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +8 -8
- package/lib/commonjs/features/thirdPartyLibs/index.js.map +1 -0
- package/lib/commonjs/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
- package/lib/commonjs/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
- package/lib/commonjs/features/track/TrackLogTab.js +230 -0
- package/lib/commonjs/features/track/TrackLogTab.js.map +1 -0
- package/lib/commonjs/features/track/index.js +39 -0
- package/lib/commonjs/features/track/index.js.map +1 -0
- package/lib/commonjs/features/zustand/ZustandLogTab.js +311 -0
- package/lib/commonjs/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/commonjs/features/zustand/index.js +59 -0
- package/lib/commonjs/features/zustand/index.js.map +1 -0
- package/lib/commonjs/index.js +27 -40
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/environment.js +2 -0
- package/lib/commonjs/types/environment.js.map +1 -0
- package/lib/commonjs/types/feature.js +6 -0
- package/lib/commonjs/types/feature.js.map +1 -0
- package/lib/commonjs/types/index.js +0 -4
- package/lib/commonjs/types/logs.js +2 -0
- package/lib/commonjs/types/logs.js.map +1 -0
- package/lib/commonjs/types/navigation.js +2 -0
- package/lib/commonjs/types/navigation.js.map +1 -0
- package/lib/commonjs/types/thirdPartyLibs.js +2 -0
- package/lib/commonjs/types/thirdPartyLibs.js.map +1 -0
- package/lib/commonjs/ui/DebugView.js +66 -0
- package/lib/commonjs/ui/DebugView.js.map +1 -0
- package/lib/commonjs/ui/floating/FloatIcon.js +240 -0
- package/lib/commonjs/ui/floating/FloatIcon.js.map +1 -0
- package/lib/commonjs/ui/panel/DebugPanel.js +230 -0
- package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -0
- package/lib/commonjs/ui/panel/FeatureTabBar.js +182 -0
- package/lib/commonjs/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/commonjs/ui/panel/FloatPanelView.js +238 -0
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CollapsibleSection.js +4 -4
- package/lib/commonjs/ui/shared/CollapsibleSection.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CopyButton.js +3 -3
- package/lib/commonjs/ui/shared/CopyButton.js.map +1 -0
- package/lib/commonjs/ui/shared/JsonView.js.map +1 -0
- package/lib/commonjs/ui/shared/LogListScreen.js +174 -0
- package/lib/commonjs/ui/shared/LogListScreen.js.map +1 -0
- package/lib/commonjs/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/commonjs/ui/theme/colors.js +43 -0
- package/lib/commonjs/ui/theme/colors.js.map +1 -0
- package/lib/commonjs/ui/theme/layout.js +8 -0
- package/lib/commonjs/ui/theme/layout.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +62 -0
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -0
- package/lib/commonjs/utils/createObservableStore.js +5 -0
- package/lib/commonjs/utils/createObservableStore.js.map +1 -1
- package/lib/commonjs/utils/createPersistedObservableStore.js +71 -0
- package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -0
- package/lib/commonjs/utils/debugPreferences.js +52 -0
- package/lib/commonjs/utils/debugPreferences.js.map +1 -0
- package/lib/commonjs/utils/urlRewriterRegistry.js +14 -0
- package/lib/commonjs/utils/urlRewriterRegistry.js.map +1 -0
- package/lib/module/core/DebugToolkit.js +117 -114
- package/lib/module/core/DebugToolkit.js.map +1 -1
- package/lib/module/core/DebugToolkitProvider.js +39 -31
- package/lib/module/core/DebugToolkitProvider.js.map +1 -1
- package/lib/module/core/initialize.js +80 -0
- package/lib/module/core/initialize.js.map +1 -0
- package/lib/module/{components → features/clipboard}/ClipboardTab.js +9 -9
- package/lib/module/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/module/features/clipboard/index.js +16 -0
- package/lib/module/features/clipboard/index.js.map +1 -0
- package/lib/module/features/console/ConsoleLogTab.js +157 -0
- package/lib/module/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/module/features/console/index.js +112 -0
- package/lib/module/features/console/index.js.map +1 -0
- package/lib/module/{components → features/environment}/EnvironmentTab.js +5 -5
- package/lib/module/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/module/features/{EnvironmentFeature.js → environment/index.js} +22 -25
- package/lib/module/features/environment/index.js.map +1 -0
- package/lib/module/{components → features/navigation}/NavigationLogTab.js +4 -3
- package/lib/module/features/navigation/NavigationLogTab.js.map +1 -0
- package/lib/module/features/navigation/index.js +32 -0
- package/lib/module/features/navigation/index.js.map +1 -0
- package/lib/module/{hooks → features/navigation}/useNavigationLogger.js +2 -2
- package/lib/module/features/navigation/useNavigationLogger.js.map +1 -0
- package/lib/module/features/network/NetworkLogTab.js +400 -0
- package/lib/module/features/network/NetworkLogTab.js.map +1 -0
- package/lib/module/features/network/index.js +90 -0
- package/lib/module/features/network/index.js.map +1 -0
- package/lib/module/features/network/networkInterceptor.js +256 -0
- package/lib/module/features/network/networkInterceptor.js.map +1 -0
- package/lib/module/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
- package/lib/module/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
- package/lib/module/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +4 -4
- package/lib/module/features/thirdPartyLibs/index.js.map +1 -0
- package/lib/module/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
- package/lib/module/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
- package/lib/module/features/track/TrackLogTab.js +225 -0
- package/lib/module/features/track/TrackLogTab.js.map +1 -0
- package/lib/module/features/track/index.js +32 -0
- package/lib/module/features/track/index.js.map +1 -0
- package/lib/module/features/zustand/ZustandLogTab.js +306 -0
- package/lib/module/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/module/features/zustand/index.js +53 -0
- package/lib/module/features/zustand/index.js.map +1 -0
- package/lib/module/index.js +11 -12
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/environment.js +2 -0
- package/lib/module/types/environment.js.map +1 -0
- package/lib/module/types/feature.js +4 -0
- package/lib/module/types/feature.js.map +1 -0
- package/lib/module/types/index.js +0 -2
- package/lib/module/types/logs.js +2 -0
- package/lib/module/types/logs.js.map +1 -0
- package/lib/module/types/navigation.js +2 -0
- package/lib/module/types/navigation.js.map +1 -0
- package/lib/module/types/thirdPartyLibs.js +2 -0
- package/lib/module/types/thirdPartyLibs.js.map +1 -0
- package/lib/module/ui/DebugView.js +61 -0
- package/lib/module/ui/DebugView.js.map +1 -0
- package/lib/module/ui/floating/FloatIcon.js +235 -0
- package/lib/module/ui/floating/FloatIcon.js.map +1 -0
- package/lib/module/ui/panel/DebugPanel.js +225 -0
- package/lib/module/ui/panel/DebugPanel.js.map +1 -0
- package/lib/module/ui/panel/FeatureTabBar.js +177 -0
- package/lib/module/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/module/ui/panel/FloatPanelView.js +233 -0
- package/lib/module/ui/panel/FloatPanelView.js.map +1 -0
- package/lib/module/{components → ui}/shared/CollapsibleSection.js +1 -1
- package/lib/module/ui/shared/CollapsibleSection.js.map +1 -0
- package/lib/module/{components → ui}/shared/CopyButton.js +1 -1
- package/lib/module/ui/shared/CopyButton.js.map +1 -0
- package/lib/module/ui/shared/JsonView.js.map +1 -0
- package/lib/module/ui/shared/LogListScreen.js +169 -0
- package/lib/module/ui/shared/LogListScreen.js.map +1 -0
- package/lib/module/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/module/ui/theme/colors.js +38 -0
- package/lib/module/ui/theme/colors.js.map +1 -0
- package/lib/module/ui/theme/layout.js +4 -0
- package/lib/module/ui/theme/layout.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +58 -0
- package/lib/module/utils/createChannelFeature.js.map +1 -0
- package/lib/module/utils/createObservableStore.js +5 -0
- package/lib/module/utils/createObservableStore.js.map +1 -1
- package/lib/module/utils/createPersistedObservableStore.js +67 -0
- package/lib/module/utils/createPersistedObservableStore.js.map +1 -0
- package/lib/module/utils/debugPreferences.js +46 -0
- package/lib/module/utils/debugPreferences.js.map +1 -0
- package/lib/module/utils/urlRewriterRegistry.js +10 -0
- package/lib/module/utils/urlRewriterRegistry.js.map +1 -0
- package/lib/typescript/src/core/DebugToolkit.d.ts +17 -20
- package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -1
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts +4 -7
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -1
- package/lib/typescript/src/core/initialize.d.ts +32 -0
- package/lib/typescript/src/core/initialize.d.ts.map +1 -0
- package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts +4 -0
- package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts.map +1 -0
- package/lib/typescript/src/features/clipboard/index.d.ts +7 -0
- package/lib/typescript/src/features/clipboard/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/console}/ConsoleLogTab.d.ts +2 -2
- package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/console/index.d.ts +9 -0
- package/lib/typescript/src/features/console/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/environment}/EnvironmentTab.d.ts +1 -1
- package/lib/typescript/src/features/environment/EnvironmentTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{EnvironmentFeature.d.ts → environment/index.d.ts} +2 -2
- package/lib/typescript/src/features/environment/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/navigation}/NavigationLogTab.d.ts +2 -2
- package/lib/typescript/src/features/navigation/NavigationLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{NavigationLogFeature.d.ts → navigation/index.d.ts} +5 -3
- package/lib/typescript/src/features/navigation/index.d.ts.map +1 -0
- package/lib/typescript/src/{hooks → features/navigation}/useNavigationLogger.d.ts +1 -8
- package/lib/typescript/src/features/navigation/useNavigationLogger.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/network}/NetworkLogTab.d.ts +2 -2
- package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/network/index.d.ts +15 -0
- package/lib/typescript/src/features/network/index.d.ts.map +1 -0
- package/lib/typescript/src/features/network/networkInterceptor.d.ts +19 -0
- package/lib/typescript/src/features/network/networkInterceptor.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.d.ts +2 -2
- package/lib/typescript/src/features/thirdPartyLibs/ThirdPartyLibsTab.d.ts.map +1 -0
- package/lib/typescript/src/features/thirdPartyLibs/index.d.ts +3 -0
- package/lib/typescript/src/features/thirdPartyLibs/index.d.ts.map +1 -0
- package/lib/typescript/src/{native/NativeDebugLibs.d.ts → features/thirdPartyLibs/nativeDebugLibs.d.ts} +1 -1
- package/lib/typescript/src/features/thirdPartyLibs/nativeDebugLibs.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/track}/TrackLogTab.d.ts +2 -2
- package/lib/typescript/src/features/track/TrackLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{TrackFeature.d.ts → track/index.d.ts} +5 -3
- package/lib/typescript/src/features/track/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/zustand}/ZustandLogTab.d.ts +2 -2
- package/lib/typescript/src/features/zustand/ZustandLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{ZustandLogFeature.d.ts → zustand/index.d.ts} +5 -3
- package/lib/typescript/src/features/zustand/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +20 -20
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/environment.d.ts +11 -0
- package/lib/typescript/src/types/environment.d.ts.map +1 -0
- package/lib/typescript/src/types/feature.d.ts +23 -0
- package/lib/typescript/src/types/feature.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +5 -111
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/logs.d.ts +51 -0
- package/lib/typescript/src/types/logs.d.ts.map +1 -0
- package/lib/typescript/src/types/navigation.d.ts +8 -0
- package/lib/typescript/src/types/navigation.d.ts.map +1 -0
- package/lib/typescript/src/types/thirdPartyLibs.d.ts +13 -0
- package/lib/typescript/src/types/thirdPartyLibs.d.ts.map +1 -0
- package/lib/typescript/src/ui/DebugView.d.ts +19 -0
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -0
- package/lib/typescript/src/ui/floating/FloatIcon.d.ts +12 -0
- package/lib/typescript/src/ui/floating/FloatIcon.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts +9 -0
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts +13 -0
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts +12 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/CollapsibleSection.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/CopyButton.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/JsonView.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/LogListScreen.d.ts +21 -0
- package/lib/typescript/src/ui/shared/LogListScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/useSlideDetailAnimation.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/colors.d.ts +21 -0
- package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/layout.d.ts +2 -0
- package/lib/typescript/src/ui/theme/layout.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +27 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -0
- package/lib/typescript/src/utils/createObservableStore.d.ts +1 -0
- package/lib/typescript/src/utils/createObservableStore.d.ts.map +1 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +15 -0
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts +10 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -0
- package/lib/typescript/src/utils/urlRewriterRegistry.d.ts +7 -0
- package/lib/typescript/src/utils/urlRewriterRegistry.d.ts.map +1 -0
- package/package.json +5 -1
- package/src/core/DebugToolkit.tsx +144 -142
- package/src/core/DebugToolkitProvider.tsx +44 -43
- package/src/core/initialize.ts +122 -0
- package/src/{components → features/clipboard}/ClipboardTab.tsx +10 -10
- package/src/features/clipboard/index.ts +15 -0
- package/src/features/console/ConsoleLogTab.tsx +95 -0
- package/src/features/console/index.ts +119 -0
- package/src/{components → features/environment}/EnvironmentTab.tsx +7 -7
- package/src/features/{EnvironmentFeature.ts → environment/index.ts} +27 -25
- package/src/{components → features/navigation}/NavigationLogTab.tsx +6 -5
- package/src/features/navigation/index.ts +44 -0
- package/src/{hooks → features/navigation}/useNavigationLogger.ts +3 -8
- package/src/features/network/NetworkLogTab.tsx +271 -0
- package/src/features/network/index.ts +113 -0
- package/src/features/network/networkInterceptor.ts +311 -0
- package/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.tsx +6 -5
- package/src/features/{ThirdPartyLibsFeature.ts → thirdPartyLibs/index.ts} +5 -5
- package/src/features/track/TrackLogTab.tsx +110 -0
- package/src/features/track/index.ts +41 -0
- package/src/features/zustand/ZustandLogTab.tsx +203 -0
- package/src/features/{ZustandLogFeature.ts → zustand/index.ts} +19 -45
- package/src/index.ts +20 -24
- package/src/types/environment.ts +11 -0
- package/src/types/feature.ts +32 -0
- package/src/types/index.ts +29 -138
- package/src/types/logs.ts +54 -0
- package/src/types/navigation.ts +5 -0
- package/src/types/thirdPartyLibs.ts +13 -0
- package/src/ui/DebugView.tsx +80 -0
- package/src/ui/floating/FloatIcon.tsx +202 -0
- package/src/ui/panel/DebugPanel.tsx +215 -0
- package/src/ui/panel/FeatureTabBar.tsx +204 -0
- package/src/ui/panel/FloatPanelView.tsx +227 -0
- package/src/{components → ui}/shared/CollapsibleSection.tsx +1 -1
- package/src/{components → ui}/shared/CopyButton.tsx +1 -1
- package/src/ui/shared/LogListScreen.tsx +164 -0
- package/src/ui/theme/colors.ts +33 -0
- package/src/ui/theme/layout.ts +1 -0
- package/src/utils/createChannelFeature.ts +80 -0
- package/src/utils/createObservableStore.ts +6 -0
- package/src/utils/createPersistedObservableStore.ts +76 -0
- package/src/utils/debugPreferences.ts +48 -0
- package/src/utils/urlRewriterRegistry.ts +10 -0
- package/lib/commonjs/components/ClipboardTab.js.map +0 -1
- package/lib/commonjs/components/ConsoleLogTab.js +0 -295
- package/lib/commonjs/components/ConsoleLogTab.js.map +0 -1
- package/lib/commonjs/components/EnvironmentTab.js.map +0 -1
- package/lib/commonjs/components/FloatPanelView.js +0 -797
- package/lib/commonjs/components/FloatPanelView.js.map +0 -1
- package/lib/commonjs/components/NavigationLogTab.js.map +0 -1
- package/lib/commonjs/components/NetworkLogTab.js +0 -575
- package/lib/commonjs/components/NetworkLogTab.js.map +0 -1
- package/lib/commonjs/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/commonjs/components/TrackLogTab.js +0 -372
- package/lib/commonjs/components/TrackLogTab.js.map +0 -1
- package/lib/commonjs/components/ZustandLogTab.js +0 -451
- package/lib/commonjs/components/ZustandLogTab.js.map +0 -1
- package/lib/commonjs/components/shared/CollapsibleSection.js.map +0 -1
- package/lib/commonjs/components/shared/CopyButton.js.map +0 -1
- package/lib/commonjs/components/shared/JsonView.js.map +0 -1
- package/lib/commonjs/features/ClipboardFeature.js.map +0 -1
- package/lib/commonjs/features/ConsoleLogFeature.js +0 -98
- package/lib/commonjs/features/ConsoleLogFeature.js.map +0 -1
- package/lib/commonjs/features/EnvironmentFeature.js.map +0 -1
- package/lib/commonjs/features/NavigationLogFeature.js +0 -60
- package/lib/commonjs/features/NavigationLogFeature.js.map +0 -1
- package/lib/commonjs/features/NetworkFeature.js +0 -328
- package/lib/commonjs/features/NetworkFeature.js.map +0 -1
- package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/commonjs/features/TrackFeature.js +0 -55
- package/lib/commonjs/features/TrackFeature.js.map +0 -1
- package/lib/commonjs/features/ZustandLogFeature.js +0 -76
- package/lib/commonjs/features/ZustandLogFeature.js.map +0 -1
- package/lib/commonjs/hooks/useNavigationLogger.js.map +0 -1
- package/lib/commonjs/hooks/useSlideDetailAnimation.js.map +0 -1
- package/lib/commonjs/initialize.js +0 -161
- package/lib/commonjs/initialize.js.map +0 -1
- package/lib/commonjs/native/NativeDebugLibs.js.map +0 -1
- package/lib/commonjs/utils/constants.js +0 -135
- package/lib/commonjs/utils/constants.js.map +0 -1
- package/lib/module/components/ClipboardTab.js.map +0 -1
- package/lib/module/components/ConsoleLogTab.js +0 -290
- package/lib/module/components/ConsoleLogTab.js.map +0 -1
- package/lib/module/components/EnvironmentTab.js.map +0 -1
- package/lib/module/components/FloatPanelView.js +0 -791
- package/lib/module/components/FloatPanelView.js.map +0 -1
- package/lib/module/components/NavigationLogTab.js.map +0 -1
- package/lib/module/components/NetworkLogTab.js +0 -570
- package/lib/module/components/NetworkLogTab.js.map +0 -1
- package/lib/module/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/module/components/TrackLogTab.js +0 -367
- package/lib/module/components/TrackLogTab.js.map +0 -1
- package/lib/module/components/ZustandLogTab.js +0 -446
- package/lib/module/components/ZustandLogTab.js.map +0 -1
- package/lib/module/components/shared/CollapsibleSection.js.map +0 -1
- package/lib/module/components/shared/CopyButton.js.map +0 -1
- package/lib/module/components/shared/JsonView.js.map +0 -1
- package/lib/module/features/ClipboardFeature.js +0 -12
- package/lib/module/features/ClipboardFeature.js.map +0 -1
- package/lib/module/features/ConsoleLogFeature.js +0 -93
- package/lib/module/features/ConsoleLogFeature.js.map +0 -1
- package/lib/module/features/EnvironmentFeature.js.map +0 -1
- package/lib/module/features/NavigationLogFeature.js +0 -54
- package/lib/module/features/NavigationLogFeature.js.map +0 -1
- package/lib/module/features/NetworkFeature.js +0 -322
- package/lib/module/features/NetworkFeature.js.map +0 -1
- package/lib/module/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/module/features/TrackFeature.js +0 -49
- package/lib/module/features/TrackFeature.js.map +0 -1
- package/lib/module/features/ZustandLogFeature.js +0 -69
- package/lib/module/features/ZustandLogFeature.js.map +0 -1
- package/lib/module/hooks/useNavigationLogger.js.map +0 -1
- package/lib/module/hooks/useSlideDetailAnimation.js.map +0 -1
- package/lib/module/initialize.js +0 -156
- package/lib/module/initialize.js.map +0 -1
- package/lib/module/native/NativeDebugLibs.js.map +0 -1
- package/lib/module/utils/constants.js +0 -130
- package/lib/module/utils/constants.js.map +0 -1
- package/lib/typescript/src/components/ClipboardTab.d.ts +0 -4
- package/lib/typescript/src/components/ClipboardTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/EnvironmentTab.d.ts.map +0 -1
- package/lib/typescript/src/components/FloatPanelView.d.ts +0 -64
- package/lib/typescript/src/components/FloatPanelView.d.ts.map +0 -1
- package/lib/typescript/src/components/NavigationLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/NetworkLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +0 -1
- package/lib/typescript/src/components/TrackLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ZustandLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/CollapsibleSection.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/CopyButton.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/JsonView.d.ts.map +0 -1
- package/lib/typescript/src/features/ClipboardFeature.d.ts +0 -3
- package/lib/typescript/src/features/ClipboardFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts +0 -7
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/NetworkFeature.d.ts +0 -28
- package/lib/typescript/src/features/NetworkFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts +0 -3
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/TrackFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts.map +0 -1
- package/lib/typescript/src/initialize.d.ts +0 -51
- package/lib/typescript/src/initialize.d.ts.map +0 -1
- package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +0 -1
- package/lib/typescript/src/utils/constants.d.ts +0 -96
- package/lib/typescript/src/utils/constants.d.ts.map +0 -1
- package/src/components/ConsoleLogTab.tsx +0 -209
- package/src/components/FloatPanelView.tsx +0 -714
- package/src/components/NetworkLogTab.tsx +0 -411
- package/src/components/TrackLogTab.tsx +0 -245
- package/src/components/ZustandLogTab.tsx +0 -305
- package/src/features/ClipboardFeature.ts +0 -11
- package/src/features/ConsoleLogFeature.ts +0 -118
- package/src/features/NavigationLogFeature.ts +0 -74
- package/src/features/NetworkFeature.ts +0 -488
- package/src/features/TrackFeature.ts +0 -69
- package/src/initialize.ts +0 -214
- package/src/utils/constants.ts +0 -91
- /package/lib/commonjs/{components → ui}/shared/JsonView.js +0 -0
- /package/lib/commonjs/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
- /package/lib/module/{components → ui}/shared/JsonView.js +0 -0
- /package/lib/module/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
- /package/lib/typescript/src/{components → ui}/shared/CollapsibleSection.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/CopyButton.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/JsonView.d.ts +0 -0
- /package/lib/typescript/src/{hooks → ui/shared}/useSlideDetailAnimation.d.ts +0 -0
- /package/src/{native/NativeDebugLibs.ts → features/thirdPartyLibs/nativeDebugLibs.ts} +0 -0
- /package/src/{components → ui}/shared/JsonView.tsx +0 -0
- /package/src/{hooks → ui/shared}/useSlideDetailAnimation.ts +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
-
import { Colors } from '
|
|
4
|
-
import type { DebugFeatureRenderProps, ThirdPartyLib } from '
|
|
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
|
-
|
|
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}>
|
|
@@ -21,7 +22,7 @@ export const ThirdPartyLibsTab: React.FC<DebugFeatureRenderProps<ThirdPartyLib>>
|
|
|
21
22
|
<Text style={styles.libName}>{lib.name}</Text>
|
|
22
23
|
<Text style={styles.libDesc}>{lib.description}</Text>
|
|
23
24
|
<View style={styles.actions}>
|
|
24
|
-
{lib.actions.map((action) => (
|
|
25
|
+
{lib.actions.map((action: ThirdPartyLibAction) => (
|
|
25
26
|
<TouchableOpacity
|
|
26
27
|
key={action.id}
|
|
27
28
|
style={styles.actionButton}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
|
-
import { ThirdPartyLibsTab } from '
|
|
3
|
-
import { NativeDebugLibs } from '
|
|
4
|
-
import type { DebugFeature, ThirdPartyLib } from '
|
|
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
|
-
|
|
40
|
+
getSnapshot: () => getPlatformLibs(),
|
|
41
41
|
cleanup: () => {},
|
|
42
42
|
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
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
|
+
|
|
11
|
+
export const TrackLogTab: React.FC<DebugFeatureRenderProps<TrackLogEntry[]>> = React.memo(({ snapshot }) => (
|
|
12
|
+
<LogListScreen
|
|
13
|
+
data={snapshot}
|
|
14
|
+
emptyText="No track events"
|
|
15
|
+
renderRow={(item) => (
|
|
16
|
+
<View style={s.cardRow}>
|
|
17
|
+
<View style={s.eventIcon}><Text style={s.eventIconText}>●</Text></View>
|
|
18
|
+
<View style={s.cardContent}>
|
|
19
|
+
<View style={s.cardHeader}>
|
|
20
|
+
<Text style={s.eventName}>{item.eventName}</Text>
|
|
21
|
+
<Text style={s.time}>{new Date(item.timestamp).toLocaleTimeString()}</Text>
|
|
22
|
+
</View>
|
|
23
|
+
<View style={s.previewRow}>
|
|
24
|
+
{Object.entries(item)
|
|
25
|
+
.filter(([k]) => k !== 'id' && k !== 'eventName' && k !== 'timestamp')
|
|
26
|
+
.slice(0, 2)
|
|
27
|
+
.map(([key, value]) => (
|
|
28
|
+
<View key={key} style={s.previewChip}>
|
|
29
|
+
<Text style={s.previewText} numberOfLines={1}>
|
|
30
|
+
<Text style={s.previewKey}>{key}</Text> {String(value ?? '').slice(0, 25)}
|
|
31
|
+
</Text>
|
|
32
|
+
</View>
|
|
33
|
+
))}
|
|
34
|
+
</View>
|
|
35
|
+
</View>
|
|
36
|
+
</View>
|
|
37
|
+
)}
|
|
38
|
+
renderDetailHeader={(item) => (
|
|
39
|
+
<View style={s.eventBadge}><Text style={s.eventBadgeText}>{item.eventName}</Text></View>
|
|
40
|
+
)}
|
|
41
|
+
renderDetailBody={(item) => {
|
|
42
|
+
const extraProps = Object.entries(item).filter(
|
|
43
|
+
([k, v]) => k !== 'id' && k !== 'eventName' && k !== 'timestamp' && v !== undefined && v !== null,
|
|
44
|
+
);
|
|
45
|
+
return (
|
|
46
|
+
<ScrollView style={s.detailBody} contentContainerStyle={s.detailBodyContent}>
|
|
47
|
+
<CollapsibleSection title="Properties" initiallyExpanded>
|
|
48
|
+
<View style={s.sectionWithCopy}>
|
|
49
|
+
<CopyButton text={safeStringify(Object.fromEntries(extraProps), 2)} label="Track Properties" />
|
|
50
|
+
<View style={s.propsGrid}>
|
|
51
|
+
{extraProps.map(([key, value]) => (
|
|
52
|
+
<View key={key} style={s.propRow}>
|
|
53
|
+
<Text style={s.propKey}>{key}</Text>
|
|
54
|
+
<Text style={s.propValue} selectable>
|
|
55
|
+
{typeof value === 'object' ? safeStringify(value) : String(value ?? '')}
|
|
56
|
+
</Text>
|
|
57
|
+
</View>
|
|
58
|
+
))}
|
|
59
|
+
</View>
|
|
60
|
+
</View>
|
|
61
|
+
</CollapsibleSection>
|
|
62
|
+
<CollapsibleSection title="Full Event Data">
|
|
63
|
+
<View style={s.sectionWithCopy}>
|
|
64
|
+
<CopyButton text={safeStringify(item, 2)} label="Track Event" />
|
|
65
|
+
<JsonView data={item} maxHeight={300} />
|
|
66
|
+
</View>
|
|
67
|
+
</CollapsibleSection>
|
|
68
|
+
<View style={s.timingCard}>
|
|
69
|
+
<Text style={s.timingLabel}>Time</Text>
|
|
70
|
+
<Text style={s.timingValue}>{new Date(item.timestamp).toLocaleString()}</Text>
|
|
71
|
+
</View>
|
|
72
|
+
</ScrollView>
|
|
73
|
+
);
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
));
|
|
77
|
+
|
|
78
|
+
const s = StyleSheet.create({
|
|
79
|
+
cardRow: { flexDirection: 'row', padding: 14, alignItems: 'flex-start' },
|
|
80
|
+
eventIcon: {
|
|
81
|
+
width: 28, height: 28, borderRadius: 8,
|
|
82
|
+
backgroundColor: 'rgba(175,82,222,0.1)',
|
|
83
|
+
alignItems: 'center', justifyContent: 'center',
|
|
84
|
+
marginRight: 12, marginTop: 1,
|
|
85
|
+
},
|
|
86
|
+
eventIconText: { color: Colors.purple, fontSize: 10 },
|
|
87
|
+
cardContent: { flex: 1 },
|
|
88
|
+
cardHeader: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 6 },
|
|
89
|
+
eventName: { fontSize: 15, fontWeight: '600', color: Colors.text },
|
|
90
|
+
time: { fontSize: 12, color: Colors.textSecondary },
|
|
91
|
+
previewRow: { flexDirection: 'row', flexWrap: 'wrap', gap: 4 },
|
|
92
|
+
previewChip: { backgroundColor: Colors.background, borderRadius: 6, paddingHorizontal: 8, paddingVertical: 3 },
|
|
93
|
+
previewText: { fontSize: 12, color: Colors.textSecondary, lineHeight: 16 },
|
|
94
|
+
previewKey: { fontWeight: '600', color: Colors.text },
|
|
95
|
+
eventBadge: { backgroundColor: Colors.purple, paddingHorizontal: 12, paddingVertical: 5, borderRadius: 8 },
|
|
96
|
+
eventBadgeText: { color: '#FFF', fontSize: 14, fontWeight: '700' },
|
|
97
|
+
detailBody: { flex: 1 },
|
|
98
|
+
detailBodyContent: { padding: 12, paddingBottom: 40 },
|
|
99
|
+
sectionWithCopy: { gap: 8 },
|
|
100
|
+
propsGrid: { gap: 12 },
|
|
101
|
+
propRow: {},
|
|
102
|
+
propKey: { fontSize: 13, fontWeight: '600', color: Colors.textSecondary, marginBottom: 3 },
|
|
103
|
+
propValue: { fontSize: 14, color: Colors.text, lineHeight: 20 },
|
|
104
|
+
timingCard: {
|
|
105
|
+
backgroundColor: Colors.surface, borderRadius: 12, padding: 14,
|
|
106
|
+
flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 4,
|
|
107
|
+
},
|
|
108
|
+
timingLabel: { fontSize: 13, color: Colors.textSecondary, fontWeight: '500' },
|
|
109
|
+
timingValue: { fontSize: 13, color: Colors.text },
|
|
110
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
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';
|
|
6
|
+
|
|
7
|
+
export interface TrackEventData {
|
|
8
|
+
eventName: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type TrackLogPayload = TrackEventData & { timestamp: number };
|
|
13
|
+
|
|
14
|
+
let trackChannel = createEventChannel<TrackLogPayload>();
|
|
15
|
+
|
|
16
|
+
export const addTrackLog = (eventData: TrackEventData): void => {
|
|
17
|
+
trackChannel.emit({ timestamp: Date.now(), ...eventData });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export interface TrackFeatureConfig {
|
|
21
|
+
/** Maximum number of track events to keep (default: 200) */
|
|
22
|
+
maxLogs?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const createTrackFeature = (config?: TrackFeatureConfig): DebugFeature<TrackLogEntry[]> =>
|
|
26
|
+
createChannelFeature(
|
|
27
|
+
() => trackChannel,
|
|
28
|
+
(payload, id) => ({ ...payload, id }),
|
|
29
|
+
{
|
|
30
|
+
name: 'track',
|
|
31
|
+
label: 'Track',
|
|
32
|
+
renderContent: TrackLogTab,
|
|
33
|
+
maxLogs: config?.maxLogs,
|
|
34
|
+
persist: { storageKey: KEYS.trackLogs, maxPersist: 50 },
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
/** Reset module-level state for testing */
|
|
39
|
+
export function _resetTrackForTesting(): void {
|
|
40
|
+
trackChannel = createEventChannel<TrackLogPayload>();
|
|
41
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
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
|
+
|
|
11
|
+
const getActionColor = (action: string): string => {
|
|
12
|
+
if (action.includes('add') || action.includes('create')) return '#34C759';
|
|
13
|
+
if (action.includes('remove') || action.includes('delete')) return '#FF3B30';
|
|
14
|
+
if (action.includes('update') || action.includes('set')) return '#007AFF';
|
|
15
|
+
return '#AF52DE';
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const getActionBgColor = (action: string): string => {
|
|
19
|
+
if (action.includes('add') || action.includes('create')) return 'rgba(52,199,89,0.1)';
|
|
20
|
+
if (action.includes('remove') || action.includes('delete')) return 'rgba(255,59,48,0.1)';
|
|
21
|
+
if (action.includes('update') || action.includes('set')) return 'rgba(0,122,255,0.1)';
|
|
22
|
+
return 'rgba(175,82,222,0.1)';
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function findChanges(prev: unknown, next: unknown): string[] {
|
|
26
|
+
if (typeof prev !== 'object' || typeof next !== 'object' || !prev || !next) return [];
|
|
27
|
+
const allKeys = new Set([...Object.keys(prev as object), ...Object.keys(next as object)]);
|
|
28
|
+
const changed: string[] = [];
|
|
29
|
+
allKeys.forEach((key) => {
|
|
30
|
+
const pv = (prev as Record<string, unknown>)[key];
|
|
31
|
+
const nv = (next as Record<string, unknown>)[key];
|
|
32
|
+
if (safeStringify(pv) !== safeStringify(nv)) changed.push(key);
|
|
33
|
+
});
|
|
34
|
+
return changed;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ZustandLogTab: React.FC<DebugFeatureRenderProps<ZustandLogEntry[]>> = React.memo(({
|
|
38
|
+
snapshot,
|
|
39
|
+
}) => (
|
|
40
|
+
<LogListScreen
|
|
41
|
+
data={snapshot}
|
|
42
|
+
emptyText="No Zustand state changes"
|
|
43
|
+
renderRow={(item) => (
|
|
44
|
+
<View style={s.cardRow}>
|
|
45
|
+
<View style={[s.actionIcon, { backgroundColor: getActionBgColor(item.action) }]}>
|
|
46
|
+
<View style={[s.actionDot, { backgroundColor: getActionColor(item.action) }]} />
|
|
47
|
+
</View>
|
|
48
|
+
<View style={s.cardContent}>
|
|
49
|
+
<View style={s.cardMeta}>
|
|
50
|
+
<Text style={s.action}>{item.action}</Text>
|
|
51
|
+
{item.storeName && (
|
|
52
|
+
<View style={s.storeBadge}>
|
|
53
|
+
<Text style={s.storeBadgeText}>{item.storeName}</Text>
|
|
54
|
+
</View>
|
|
55
|
+
)}
|
|
56
|
+
</View>
|
|
57
|
+
<Text style={s.time}>{new Date(item.timestamp).toLocaleTimeString()}</Text>
|
|
58
|
+
</View>
|
|
59
|
+
{item.actionCompleteTime != null && (
|
|
60
|
+
<View style={s.durationBadge}>
|
|
61
|
+
<Text style={s.durationText}>{item.actionCompleteTime}ms</Text>
|
|
62
|
+
</View>
|
|
63
|
+
)}
|
|
64
|
+
</View>
|
|
65
|
+
)}
|
|
66
|
+
renderDetailHeader={(item) => (
|
|
67
|
+
<View style={s.detailHeaderCenter}>
|
|
68
|
+
<Text style={[s.detailAction, { color: getActionColor(item.action) }]}>
|
|
69
|
+
{item.action}
|
|
70
|
+
</Text>
|
|
71
|
+
{item.storeName && (
|
|
72
|
+
<View style={s.storeBadge}>
|
|
73
|
+
<Text style={s.storeBadgeText}>{item.storeName}</Text>
|
|
74
|
+
</View>
|
|
75
|
+
)}
|
|
76
|
+
</View>
|
|
77
|
+
)}
|
|
78
|
+
renderDetailBody={(item) => {
|
|
79
|
+
const changes = findChanges(item.prevState, item.nextState);
|
|
80
|
+
return (
|
|
81
|
+
<ScrollView style={s.detailBody} contentContainerStyle={s.detailBodyContent}>
|
|
82
|
+
<View style={s.metaCard}>
|
|
83
|
+
<View style={s.metaItem}>
|
|
84
|
+
<Text style={s.metaLabel}>Time</Text>
|
|
85
|
+
<Text style={s.metaValue}>{new Date(item.timestamp).toLocaleString()}</Text>
|
|
86
|
+
</View>
|
|
87
|
+
{item.actionCompleteTime != null && <View style={s.metaDivider} />}
|
|
88
|
+
{item.actionCompleteTime != null && (
|
|
89
|
+
<View style={s.metaItem}>
|
|
90
|
+
<Text style={s.metaLabel}>Duration</Text>
|
|
91
|
+
<Text style={s.metaValue}>{item.actionCompleteTime}ms</Text>
|
|
92
|
+
</View>
|
|
93
|
+
)}
|
|
94
|
+
</View>
|
|
95
|
+
|
|
96
|
+
{changes.length > 0 && (
|
|
97
|
+
<View style={s.changesCard}>
|
|
98
|
+
<Text style={s.changesTitle}>Changed Keys</Text>
|
|
99
|
+
<View style={s.changesTags}>
|
|
100
|
+
{changes.map((key) => (
|
|
101
|
+
<View key={key} style={s.changeTag}>
|
|
102
|
+
<Text style={s.changeTagText}>{key}</Text>
|
|
103
|
+
</View>
|
|
104
|
+
))}
|
|
105
|
+
</View>
|
|
106
|
+
</View>
|
|
107
|
+
)}
|
|
108
|
+
|
|
109
|
+
<CollapsibleSection title="Previous State">
|
|
110
|
+
<View style={s.sectionWithCopy}>
|
|
111
|
+
<CopyButton text={safeStringify(item.prevState, 2)} label="Previous State" />
|
|
112
|
+
<JsonView data={item.prevState} maxHeight={250} />
|
|
113
|
+
</View>
|
|
114
|
+
</CollapsibleSection>
|
|
115
|
+
|
|
116
|
+
<CollapsibleSection title="Next State" initiallyExpanded>
|
|
117
|
+
<View style={s.sectionWithCopy}>
|
|
118
|
+
<CopyButton text={safeStringify(item.nextState, 2)} label="Next State" />
|
|
119
|
+
<JsonView data={item.nextState} maxHeight={250} />
|
|
120
|
+
</View>
|
|
121
|
+
</CollapsibleSection>
|
|
122
|
+
</ScrollView>
|
|
123
|
+
);
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
));
|
|
127
|
+
|
|
128
|
+
const s = StyleSheet.create({
|
|
129
|
+
// Row
|
|
130
|
+
cardRow: { flexDirection: 'row', padding: 14, alignItems: 'center' },
|
|
131
|
+
actionIcon: {
|
|
132
|
+
width: 28,
|
|
133
|
+
height: 28,
|
|
134
|
+
borderRadius: 8,
|
|
135
|
+
alignItems: 'center',
|
|
136
|
+
justifyContent: 'center',
|
|
137
|
+
marginRight: 12,
|
|
138
|
+
},
|
|
139
|
+
actionDot: { width: 8, height: 8, borderRadius: 4 },
|
|
140
|
+
cardContent: { flex: 1 },
|
|
141
|
+
cardMeta: { flexDirection: 'row', alignItems: 'center', gap: 8, marginBottom: 3 },
|
|
142
|
+
action: { fontSize: 15, fontWeight: '600', color: Colors.text },
|
|
143
|
+
storeBadge: {
|
|
144
|
+
backgroundColor: 'rgba(0,122,255,0.08)',
|
|
145
|
+
paddingHorizontal: 8,
|
|
146
|
+
paddingVertical: 2,
|
|
147
|
+
borderRadius: 4,
|
|
148
|
+
},
|
|
149
|
+
storeBadgeText: { fontSize: 11, color: Colors.primary, fontWeight: '600' },
|
|
150
|
+
time: { fontSize: 12, color: Colors.textSecondary },
|
|
151
|
+
durationBadge: {
|
|
152
|
+
backgroundColor: Colors.background,
|
|
153
|
+
borderRadius: 8,
|
|
154
|
+
paddingHorizontal: 8,
|
|
155
|
+
paddingVertical: 4,
|
|
156
|
+
},
|
|
157
|
+
durationText: { fontSize: 12, color: Colors.textSecondary, fontWeight: '500' },
|
|
158
|
+
|
|
159
|
+
// Detail header
|
|
160
|
+
detailHeaderCenter: {
|
|
161
|
+
flexDirection: 'row',
|
|
162
|
+
alignItems: 'center',
|
|
163
|
+
gap: 10,
|
|
164
|
+
flex: 1,
|
|
165
|
+
},
|
|
166
|
+
detailAction: { fontSize: 17, fontWeight: '700' },
|
|
167
|
+
|
|
168
|
+
// Detail body
|
|
169
|
+
detailBody: { flex: 1 },
|
|
170
|
+
detailBodyContent: { padding: 12, paddingBottom: 40 },
|
|
171
|
+
sectionWithCopy: { gap: 8 },
|
|
172
|
+
|
|
173
|
+
// Meta
|
|
174
|
+
metaCard: {
|
|
175
|
+
backgroundColor: Colors.surface,
|
|
176
|
+
borderRadius: 12,
|
|
177
|
+
padding: 14,
|
|
178
|
+
marginBottom: 8,
|
|
179
|
+
flexDirection: 'row',
|
|
180
|
+
alignItems: 'center',
|
|
181
|
+
},
|
|
182
|
+
metaItem: { flex: 1 },
|
|
183
|
+
metaDivider: { width: 1, height: 28, backgroundColor: Colors.border, marginHorizontal: 12 },
|
|
184
|
+
metaLabel: { fontSize: 11, color: Colors.textSecondary, fontWeight: '600', textTransform: 'uppercase', marginBottom: 2 },
|
|
185
|
+
metaValue: { fontSize: 14, color: Colors.text, fontWeight: '500' },
|
|
186
|
+
|
|
187
|
+
// Changes
|
|
188
|
+
changesCard: {
|
|
189
|
+
backgroundColor: Colors.surface,
|
|
190
|
+
borderRadius: 12,
|
|
191
|
+
padding: 14,
|
|
192
|
+
marginBottom: 8,
|
|
193
|
+
},
|
|
194
|
+
changesTitle: { fontSize: 13, fontWeight: '600', color: Colors.textSecondary, marginBottom: 10 },
|
|
195
|
+
changesTags: { flexDirection: 'row', flexWrap: 'wrap', gap: 6 },
|
|
196
|
+
changeTag: {
|
|
197
|
+
backgroundColor: 'rgba(0,122,255,0.08)',
|
|
198
|
+
paddingHorizontal: 10,
|
|
199
|
+
paddingVertical: 4,
|
|
200
|
+
borderRadius: 6,
|
|
201
|
+
},
|
|
202
|
+
changeTagText: { fontSize: 12, color: Colors.primary, fontWeight: '600' },
|
|
203
|
+
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ZustandLogTab } from '
|
|
2
|
-
import type { DebugFeature, ZustandLogEntry } from '
|
|
3
|
-
import { createEventChannel } from '
|
|
4
|
-
import {
|
|
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
|
|
|
8
|
-
|
|
9
|
-
const zustandChannel = createEventChannel<ZustandLogPayload>();
|
|
8
|
+
let zustandChannel = createEventChannel<ZustandLogPayload>();
|
|
10
9
|
|
|
11
10
|
export const addZustandLog = (
|
|
12
11
|
action: string,
|
|
@@ -25,6 +24,8 @@ export const addZustandLog = (
|
|
|
25
24
|
});
|
|
26
25
|
};
|
|
27
26
|
|
|
27
|
+
// ─── Zustand middleware (remains here — it's user-facing API) ──────────
|
|
28
|
+
|
|
28
29
|
type ZustandSetState<T> = (
|
|
29
30
|
partial: T | Partial<T> | ((state: T) => Partial<T> | T),
|
|
30
31
|
replace?: boolean | undefined,
|
|
@@ -80,48 +81,21 @@ export const zustandLogMiddleware = <T>(config: ZustandConfig<T>) => (
|
|
|
80
81
|
api,
|
|
81
82
|
);
|
|
82
83
|
|
|
84
|
+
// ─── Feature factory ──────────────────────────────────────────────────
|
|
85
|
+
|
|
83
86
|
export interface ZustandFeatureConfig {
|
|
84
87
|
/** Maximum number of zustand state changes to keep (default: 200) */
|
|
85
88
|
maxLogs?: number;
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
export const createZustandLogFeature = (config?: ZustandFeatureConfig): DebugFeature<ZustandLogEntry> =>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
name: 'zustand',
|
|
97
|
-
label: 'Zustand',
|
|
98
|
-
renderContent: ZustandLogTab,
|
|
99
|
-
setup: () => {
|
|
100
|
-
if (initialized) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
91
|
+
export const createZustandLogFeature = (config?: ZustandFeatureConfig): DebugFeature<ZustandLogEntry[]> =>
|
|
92
|
+
createChannelFeature(
|
|
93
|
+
() => zustandChannel,
|
|
94
|
+
(payload, id) => ({ ...payload, id }),
|
|
95
|
+
{ name: 'zustand', label: 'Zustand', renderContent: ZustandLogTab, maxLogs: config?.maxLogs },
|
|
96
|
+
);
|
|
103
97
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
id: String(nextId++),
|
|
109
|
-
},
|
|
110
|
-
maxLogs,
|
|
111
|
-
);
|
|
112
|
-
});
|
|
113
|
-
initialized = true;
|
|
114
|
-
},
|
|
115
|
-
getData: () => logStore.getData(),
|
|
116
|
-
clear: () => {
|
|
117
|
-
logStore.clear();
|
|
118
|
-
},
|
|
119
|
-
cleanup: () => {
|
|
120
|
-
unsubscribeLogs?.();
|
|
121
|
-
unsubscribeLogs = null;
|
|
122
|
-
logStore.clear();
|
|
123
|
-
initialized = false;
|
|
124
|
-
},
|
|
125
|
-
subscribe: (listener) => logStore.subscribe(listener),
|
|
126
|
-
};
|
|
127
|
-
};
|
|
98
|
+
/** Reset module-level state for testing */
|
|
99
|
+
export function _resetZustandForTesting(): void {
|
|
100
|
+
zustandChannel = createEventChannel<ZustandLogPayload>();
|
|
101
|
+
}
|
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 {
|
|
5
|
-
export type {
|
|
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';
|
|
6
8
|
|
|
7
9
|
// Feature factories
|
|
8
|
-
export { createNetworkFeature } from './features/
|
|
9
|
-
export type {
|
|
10
|
-
export { createConsoleLogFeature } from './features/
|
|
11
|
-
export type { ConsoleFeatureConfig } from './features/
|
|
12
|
-
export { createZustandLogFeature, zustandLogMiddleware, addZustandLog } from './features/
|
|
13
|
-
export type { ZustandFeatureConfig } from './features/
|
|
14
|
-
export { createNavigationLogFeature, addNavigationLog } from './features/
|
|
15
|
-
export type { NavigationFeatureConfig } from './features/
|
|
16
|
-
export { createTrackFeature, addTrackLog } from './features/
|
|
17
|
-
export type { TrackFeatureConfig, TrackEventData } from './features/
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export
|
|
21
|
-
export { createClipboardFeature } from './features/ClipboardFeature';
|
|
10
|
+
export { createNetworkFeature } from './features/network';
|
|
11
|
+
export type { NetworkFeatureConfig, AxiosInstanceLike } 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';
|
|
22
23
|
|
|
23
24
|
// Hooks
|
|
24
|
-
export { useNavigationLogger } from './
|
|
25
|
-
export { useSlideDetailAnimation } from './hooks/useSlideDetailAnimation';
|
|
25
|
+
export { useNavigationLogger } from './features/navigation/useNavigationLogger';
|
|
26
26
|
|
|
27
27
|
// Utilities
|
|
28
28
|
export { safeStringify } from './utils/safeStringify';
|
|
@@ -31,22 +31,18 @@ export type { CopyResult, CopyOptions, CopyMethod } from './utils/copyToComputer
|
|
|
31
31
|
|
|
32
32
|
// Types
|
|
33
33
|
export type {
|
|
34
|
+
AnyDebugFeature,
|
|
34
35
|
BuiltInFeatureName,
|
|
35
36
|
DebugFeature,
|
|
36
|
-
DebugFeatureFactory,
|
|
37
|
-
DebugFeatureInput,
|
|
38
37
|
DebugFeatureRenderProps,
|
|
39
|
-
DebugToolkitConfig,
|
|
40
|
-
DebugToolkitAPI,
|
|
41
38
|
NetworkLogEntry,
|
|
42
39
|
ConsoleLogEntry,
|
|
43
40
|
ZustandLogEntry,
|
|
44
41
|
NavigationLogEntry,
|
|
45
42
|
TrackLogEntry,
|
|
46
|
-
ThirdPartyLib,
|
|
47
43
|
EnvironmentConfig,
|
|
48
44
|
EnvironmentState,
|
|
49
45
|
} from './types';
|
|
50
46
|
|
|
51
47
|
// Default export for convenience
|
|
52
|
-
export { initializeDebugToolkit as default } from './initialize';
|
|
48
|
+
export { initializeDebugToolkit as default } from './core/initialize';
|
|
@@ -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
|
+
}
|