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.
- package/README.md +52 -93
- package/README.zh-CN.md +48 -89
- package/lib/commonjs/core/DebugToolkit.js +33 -11
- package/lib/commonjs/core/DebugToolkit.js.map +1 -1
- package/lib/commonjs/core/DebugToolkitProvider.js +18 -12
- package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -1
- package/lib/commonjs/{initialize.js → core/initialize.js} +17 -17
- package/lib/commonjs/core/initialize.js.map +1 -0
- package/lib/commonjs/{components → features/clipboard}/ClipboardTab.js +2 -2
- package/lib/commonjs/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/commonjs/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
- package/lib/commonjs/features/clipboard/index.js.map +1 -0
- package/lib/commonjs/{components → features/console}/ConsoleLogTab.js +9 -9
- package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/commonjs/features/{ConsoleLogFeature.js → console/index.js} +10 -7
- package/lib/commonjs/features/console/index.js.map +1 -0
- package/lib/commonjs/{components → features/environment}/EnvironmentTab.js +3 -3
- package/lib/commonjs/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/commonjs/features/{EnvironmentFeature.js → environment/index.js} +18 -13
- package/lib/commonjs/features/environment/index.js.map +1 -0
- package/lib/commonjs/{components → features/navigation}/NavigationLogTab.js +4 -3
- package/lib/commonjs/features/navigation/NavigationLogTab.js.map +1 -0
- package/lib/commonjs/features/{NavigationLogFeature.js → navigation/index.js} +4 -4
- 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/{components → features/network}/NetworkLogTab.js +8 -7
- package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -0
- package/lib/commonjs/features/{NetworkFeature.js → network/index.js} +18 -35
- package/lib/commonjs/features/network/index.js.map +1 -0
- package/lib/commonjs/features/network/networkInterceptor.js +216 -0
- package/lib/commonjs/features/network/networkInterceptor.js.map +1 -0
- package/lib/commonjs/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
- 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/{components → features/track}/TrackLogTab.js +8 -8
- package/lib/commonjs/features/track/TrackLogTab.js.map +1 -0
- package/lib/commonjs/features/{TrackFeature.js → track/index.js} +10 -5
- package/lib/commonjs/features/track/index.js.map +1 -0
- package/lib/commonjs/{components → features/zustand}/ZustandLogTab.js +8 -8
- package/lib/commonjs/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/commonjs/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
- package/lib/commonjs/features/zustand/index.js.map +1 -0
- package/lib/commonjs/index.js +21 -21
- 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/{components → ui}/DebugView.js +2 -2
- package/lib/commonjs/ui/DebugView.js.map +1 -0
- package/lib/commonjs/{components → ui/floating}/FloatIcon.js +65 -12
- package/lib/commonjs/ui/floating/FloatIcon.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/DebugPanel.js +4 -4
- package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/FeatureTabBar.js +1 -1
- package/lib/commonjs/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/FloatPanelView.js +36 -12
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CollapsibleSection.js +1 -1
- package/lib/commonjs/ui/shared/CollapsibleSection.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CopyButton.js +1 -1
- package/lib/commonjs/ui/shared/CopyButton.js.map +1 -0
- package/lib/commonjs/ui/shared/JsonView.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/LogListScreen.js +2 -2
- package/lib/commonjs/ui/shared/LogListScreen.js.map +1 -0
- package/lib/commonjs/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/commonjs/{utils → ui/theme}/colors.js +0 -5
- package/lib/commonjs/ui/theme/colors.js.map +1 -0
- package/lib/commonjs/ui/theme/layout.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +18 -4
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
- 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/module/core/DebugToolkit.js +33 -11
- package/lib/module/core/DebugToolkit.js.map +1 -1
- package/lib/module/core/DebugToolkitProvider.js +18 -12
- package/lib/module/core/DebugToolkitProvider.js.map +1 -1
- package/lib/module/{initialize.js → core/initialize.js} +10 -10
- package/lib/module/core/initialize.js.map +1 -0
- package/lib/module/{components → features/clipboard}/ClipboardTab.js +2 -2
- package/lib/module/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/module/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
- package/lib/module/features/clipboard/index.js.map +1 -0
- package/lib/module/{components → features/console}/ConsoleLogTab.js +9 -9
- package/lib/module/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/module/features/{ConsoleLogFeature.js → console/index.js} +10 -7
- package/lib/module/features/console/index.js.map +1 -0
- package/lib/module/{components → features/environment}/EnvironmentTab.js +3 -3
- package/lib/module/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/module/features/{EnvironmentFeature.js → environment/index.js} +18 -13
- 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/{NavigationLogFeature.js → navigation/index.js} +4 -4
- 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/{components → features/network}/NetworkLogTab.js +8 -7
- package/lib/module/features/network/NetworkLogTab.js.map +1 -0
- package/lib/module/features/{NetworkFeature.js → network/index.js} +18 -35
- package/lib/module/features/network/index.js.map +1 -0
- package/lib/module/features/network/networkInterceptor.js +211 -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/{components → features/track}/TrackLogTab.js +8 -8
- package/lib/module/features/track/TrackLogTab.js.map +1 -0
- package/lib/module/features/{TrackFeature.js → track/index.js} +10 -5
- package/lib/module/features/track/index.js.map +1 -0
- package/lib/module/{components → features/zustand}/ZustandLogTab.js +8 -8
- package/lib/module/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/module/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
- package/lib/module/features/zustand/index.js.map +1 -0
- package/lib/module/index.js +11 -11
- 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/{components → ui}/DebugView.js +2 -2
- package/lib/module/ui/DebugView.js.map +1 -0
- package/lib/module/{components → ui/floating}/FloatIcon.js +66 -13
- package/lib/module/ui/floating/FloatIcon.js.map +1 -0
- package/lib/module/{components → ui/panel}/DebugPanel.js +4 -4
- package/lib/module/ui/panel/DebugPanel.js.map +1 -0
- package/lib/module/{components → ui/panel}/FeatureTabBar.js +1 -1
- package/lib/module/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/module/{components → ui/panel}/FloatPanelView.js +36 -12
- 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/{components → ui}/shared/LogListScreen.js +2 -2
- package/lib/module/ui/shared/LogListScreen.js.map +1 -0
- package/lib/module/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/module/{utils → ui/theme}/colors.js +0 -5
- package/lib/module/ui/theme/colors.js.map +1 -0
- package/lib/module/ui/theme/layout.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +18 -4
- package/lib/module/utils/createChannelFeature.js.map +1 -1
- 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/typescript/src/core/DebugToolkit.d.ts +7 -3
- package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -1
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts +2 -2
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -1
- package/lib/typescript/src/{initialize.d.ts → core/initialize.d.ts} +7 -7
- 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/{ClipboardFeature.d.ts → clipboard/index.d.ts} +3 -3
- 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/{ConsoleLogFeature.d.ts → console/index.d.ts} +3 -3
- 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} +3 -3
- package/lib/typescript/src/features/navigation/index.d.ts.map +1 -0
- package/lib/typescript/src/{hooks → features/navigation}/useNavigationLogger.d.ts +1 -1
- 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/{NetworkFeature.d.ts → network/index.d.ts} +3 -7
- package/lib/typescript/src/features/network/index.d.ts.map +1 -0
- package/lib/typescript/src/features/network/networkInterceptor.d.ts +6 -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} +3 -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} +3 -3
- package/lib/typescript/src/features/zustand/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +19 -19
- 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 -108
- 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/{components → ui}/DebugView.d.ts +1 -1
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -0
- package/lib/typescript/src/ui/floating/FloatIcon.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -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.map +1 -0
- package/lib/typescript/src/ui/shared/useSlideDetailAnimation.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/layout.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +12 -3
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
- 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/package.json +4 -4
- package/src/core/DebugToolkit.tsx +37 -11
- package/src/core/DebugToolkitProvider.tsx +20 -13
- package/src/{initialize.ts → core/initialize.ts} +16 -16
- package/src/{components → features/clipboard}/ClipboardTab.tsx +4 -4
- package/src/features/{ClipboardFeature.ts → clipboard/index.ts} +4 -4
- package/src/{components → features/console}/ConsoleLogTab.tsx +10 -10
- package/src/features/{ConsoleLogFeature.ts → console/index.ts} +11 -8
- package/src/{components → features/environment}/EnvironmentTab.tsx +5 -5
- package/src/features/{EnvironmentFeature.ts → environment/index.ts} +23 -13
- package/src/{components → features/navigation}/NavigationLogTab.tsx +6 -5
- package/src/features/{NavigationLogFeature.ts → navigation/index.ts} +5 -5
- package/src/{hooks → features/navigation}/useNavigationLogger.ts +3 -3
- package/src/{components → features/network}/NetworkLogTab.tsx +10 -9
- package/src/features/{NetworkFeature.ts → network/index.ts} +19 -43
- package/src/features/network/networkInterceptor.ts +286 -0
- package/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.tsx +5 -4
- package/src/features/{ThirdPartyLibsFeature.ts → thirdPartyLibs/index.ts} +5 -5
- package/src/{components → features/track}/TrackLogTab.tsx +9 -9
- package/src/features/{TrackFeature.ts → track/index.ts} +13 -6
- package/src/{components → features/zustand}/ZustandLogTab.tsx +10 -10
- package/src/features/{ZustandLogFeature.ts → zustand/index.ts} +5 -5
- package/src/index.ts +19 -19
- package/src/types/environment.ts +11 -0
- package/src/types/feature.ts +32 -0
- package/src/types/index.ts +29 -127
- package/src/types/logs.ts +54 -0
- package/src/types/navigation.ts +5 -0
- package/src/types/thirdPartyLibs.ts +13 -0
- package/src/{components → ui}/DebugView.tsx +3 -3
- package/src/{components → ui/floating}/FloatIcon.tsx +60 -29
- package/src/{components → ui/panel}/DebugPanel.tsx +4 -4
- package/src/{components → ui/panel}/FeatureTabBar.tsx +1 -1
- package/src/{components → ui/panel}/FloatPanelView.tsx +38 -13
- package/src/{components → ui}/shared/CollapsibleSection.tsx +1 -1
- package/src/{components → ui}/shared/CopyButton.tsx +1 -1
- package/src/{components → ui}/shared/LogListScreen.tsx +2 -2
- package/src/{utils → ui/theme}/colors.ts +0 -5
- package/src/utils/createChannelFeature.ts +32 -7
- package/src/utils/createObservableStore.ts +6 -0
- package/src/utils/createPersistedObservableStore.ts +76 -0
- package/src/utils/debugPreferences.ts +48 -0
- package/lib/commonjs/components/ClipboardTab.js.map +0 -1
- package/lib/commonjs/components/ConsoleLogTab.js.map +0 -1
- package/lib/commonjs/components/DebugPanel.js.map +0 -1
- package/lib/commonjs/components/DebugView.js.map +0 -1
- package/lib/commonjs/components/EnvironmentTab.js.map +0 -1
- package/lib/commonjs/components/FeatureTabBar.js.map +0 -1
- package/lib/commonjs/components/FloatIcon.js.map +0 -1
- package/lib/commonjs/components/FloatPanelView.js.map +0 -1
- package/lib/commonjs/components/NavigationLogTab.js.map +0 -1
- package/lib/commonjs/components/NetworkLogTab.js.map +0 -1
- package/lib/commonjs/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/commonjs/components/TrackLogTab.js.map +0 -1
- 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/components/shared/LogListScreen.js.map +0 -1
- package/lib/commonjs/features/ClipboardFeature.js.map +0 -1
- package/lib/commonjs/features/ConsoleLogFeature.js.map +0 -1
- package/lib/commonjs/features/EnvironmentFeature.js.map +0 -1
- package/lib/commonjs/features/NavigationLogFeature.js.map +0 -1
- package/lib/commonjs/features/NetworkFeature.js.map +0 -1
- package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/commonjs/features/TrackFeature.js.map +0 -1
- 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.map +0 -1
- package/lib/commonjs/interceptors/networkInterceptor.js +0 -466
- package/lib/commonjs/interceptors/networkInterceptor.js.map +0 -1
- package/lib/commonjs/native/NativeDebugLibs.js.map +0 -1
- package/lib/commonjs/utils/colors.js.map +0 -1
- package/lib/commonjs/utils/layout.js.map +0 -1
- package/lib/module/components/ClipboardTab.js.map +0 -1
- package/lib/module/components/ConsoleLogTab.js.map +0 -1
- package/lib/module/components/DebugPanel.js.map +0 -1
- package/lib/module/components/DebugView.js.map +0 -1
- package/lib/module/components/EnvironmentTab.js.map +0 -1
- package/lib/module/components/FeatureTabBar.js.map +0 -1
- package/lib/module/components/FloatIcon.js.map +0 -1
- package/lib/module/components/FloatPanelView.js.map +0 -1
- package/lib/module/components/NavigationLogTab.js.map +0 -1
- package/lib/module/components/NetworkLogTab.js.map +0 -1
- package/lib/module/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/module/components/TrackLogTab.js.map +0 -1
- 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/components/shared/LogListScreen.js.map +0 -1
- package/lib/module/features/ClipboardFeature.js.map +0 -1
- package/lib/module/features/ConsoleLogFeature.js.map +0 -1
- package/lib/module/features/EnvironmentFeature.js.map +0 -1
- package/lib/module/features/NavigationLogFeature.js.map +0 -1
- package/lib/module/features/NetworkFeature.js.map +0 -1
- package/lib/module/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/module/features/TrackFeature.js.map +0 -1
- 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.map +0 -1
- package/lib/module/interceptors/networkInterceptor.js +0 -460
- package/lib/module/interceptors/networkInterceptor.js.map +0 -1
- package/lib/module/native/NativeDebugLibs.js.map +0 -1
- package/lib/module/utils/colors.js.map +0 -1
- package/lib/module/utils/layout.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/DebugPanel.d.ts.map +0 -1
- package/lib/typescript/src/components/DebugView.d.ts.map +0 -1
- package/lib/typescript/src/components/EnvironmentTab.d.ts.map +0 -1
- package/lib/typescript/src/components/FeatureTabBar.d.ts.map +0 -1
- package/lib/typescript/src/components/FloatIcon.d.ts.map +0 -1
- package/lib/typescript/src/components/FloatPanelView.d.ts +0 -9
- 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/components/shared/LogListScreen.d.ts.map +0 -1
- package/lib/typescript/src/features/ClipboardFeature.d.ts.map +0 -1
- 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.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.map +0 -1
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts +0 -18
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts.map +0 -1
- package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +0 -1
- package/lib/typescript/src/utils/colors.d.ts.map +0 -1
- package/lib/typescript/src/utils/layout.d.ts.map +0 -1
- package/src/interceptors/networkInterceptor.ts +0 -646
- /package/lib/commonjs/{components → ui}/shared/JsonView.js +0 -0
- /package/lib/commonjs/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
- /package/lib/commonjs/{utils → ui/theme}/layout.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/module/{utils → ui/theme}/layout.js +0 -0
- /package/lib/typescript/src/{components → ui/floating}/FloatIcon.d.ts +0 -0
- /package/lib/typescript/src/{components → ui/panel}/DebugPanel.d.ts +0 -0
- /package/lib/typescript/src/{components → ui/panel}/FeatureTabBar.d.ts +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/{components → ui}/shared/LogListScreen.d.ts +0 -0
- /package/lib/typescript/src/{hooks → ui/shared}/useSlideDetailAnimation.d.ts +0 -0
- /package/lib/typescript/src/{utils → ui/theme}/colors.d.ts +0 -0
- /package/lib/typescript/src/{utils → ui/theme}/layout.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
- /package/src/{utils → ui/theme}/layout.ts +0 -0
package/src/types/index.ts
CHANGED
|
@@ -1,127 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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,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 '../
|
|
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 '../
|
|
12
|
-
import { ICON_SIZE } from '../
|
|
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
|
|
23
|
-
const
|
|
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:
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
73
|
-
x
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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 '../
|
|
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:
|
|
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:
|
|
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:
|
|
194
|
+
backgroundColor: `${Colors.error}0F`,
|
|
195
195
|
},
|
|
196
196
|
clearButtonText: {
|
|
197
197
|
color: Colors.error,
|
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
PanResponder,
|
|
8
8
|
Easing,
|
|
9
9
|
} from 'react-native';
|
|
10
|
-
import type { AnyDebugFeature } from '
|
|
11
|
-
import {
|
|
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
|
-
//
|
|
117
|
+
// Clamp activeTab if features shrink
|
|
100
118
|
useEffect(() => {
|
|
101
|
-
if (activeTab >= features.length)
|
|
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
|
|
173
|
+
const snapshot = feature.getSnapshot();
|
|
152
174
|
const TabComponent = feature.renderContent;
|
|
153
|
-
if (TabComponent) return <TabComponent
|
|
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(
|
|
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={
|
|
184
|
+
<DebugErrorBoundary onError={onClosePanel}>
|
|
163
185
|
<View style={styles.container} pointerEvents="box-none">
|
|
164
|
-
<FloatIcon visible={!
|
|
165
|
-
{
|
|
166
|
-
<DebugPanel
|
|
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, { useCallback, useState } from 'react';
|
|
2
2
|
import { TouchableOpacity, Text, StyleSheet } from 'react-native';
|
|
3
|
-
import { Colors } from '
|
|
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 '
|
|
11
|
-
import { useSlideDetailAnimation } from '
|
|
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,
|
|
64
|
+
logStore.push(toEntry(payload, getId()), maxLogs);
|
|
40
65
|
});
|
|
41
66
|
initialized = true;
|
|
42
67
|
},
|
|
43
|
-
|
|
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;
|