react-native-xenon 0.2.1 → 0.4.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 +21 -3
- package/lib/commonjs/assets/icons/bug.png +0 -0
- package/lib/commonjs/contexts/MainContext.js.map +1 -1
- package/lib/commonjs/contexts/index.js +1 -1
- package/lib/commonjs/core/constants.js.map +1 -0
- package/lib/commonjs/core/data.js +10 -0
- package/lib/commonjs/core/data.js.map +1 -0
- package/lib/commonjs/core/global.d.js.map +1 -0
- package/lib/commonjs/{utils.js → core/utils.js} +24 -1
- package/lib/commonjs/core/utils.js.map +1 -0
- package/lib/commonjs/hooks/index.js +2 -9
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useConsoleInterceptor.js +9 -6
- package/lib/commonjs/hooks/useConsoleInterceptor.js.map +1 -1
- package/lib/commonjs/hooks/useNetworkInterceptor.js +21 -16
- package/lib/commonjs/hooks/useNetworkInterceptor.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/interceptors/ConsoleInterceptor.js +12 -17
- package/lib/commonjs/interceptors/ConsoleInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/FetchInterceptor.js +15 -20
- package/lib/commonjs/interceptors/FetchInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/HttpInterceptor.js +8 -47
- package/lib/commonjs/interceptors/HttpInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/Interceptor.js +9 -3
- package/lib/commonjs/interceptors/Interceptor.js.map +1 -1
- package/lib/commonjs/interceptors/NetworkInterceptor.js +15 -2
- package/lib/commonjs/interceptors/NetworkInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/WebSocketInterceptor.js +28 -77
- package/lib/commonjs/interceptors/WebSocketInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/XHRInterceptor.js +13 -18
- package/lib/commonjs/interceptors/XHRInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/index.js +4 -4
- package/lib/commonjs/theme/colors.js.map +1 -0
- package/lib/commonjs/theme/icons.js +15 -0
- package/lib/commonjs/theme/icons.js.map +1 -0
- package/lib/commonjs/types/common.js.map +1 -1
- package/lib/commonjs/types/index.js +4 -4
- package/lib/commonjs/ui/Xenon.js +78 -64
- package/lib/commonjs/ui/Xenon.js.map +1 -1
- package/lib/commonjs/ui/components/bubble/Bubble.js +89 -57
- package/lib/commonjs/ui/components/bubble/Bubble.js.map +1 -1
- package/lib/commonjs/ui/components/details/DetailsViewer.js +9 -14
- package/lib/commonjs/ui/components/details/DetailsViewer.js.map +1 -1
- package/lib/commonjs/ui/components/details/LogMessageDetails.js +2 -2
- package/lib/commonjs/ui/components/details/LogMessageDetails.js.map +1 -1
- package/lib/commonjs/ui/components/details/NetworkRequestDetails.js +26 -11
- package/lib/commonjs/ui/components/details/NetworkRequestDetails.js.map +1 -1
- package/lib/commonjs/ui/components/headers/DebuggerHeader.js +42 -22
- package/lib/commonjs/ui/components/headers/DebuggerHeader.js.map +1 -1
- package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js +2 -2
- package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js.map +1 -1
- package/lib/commonjs/ui/components/headers/NetworkRequestDetailsHeader.js +1 -2
- package/lib/commonjs/ui/components/headers/NetworkRequestDetailsHeader.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +5 -5
- package/lib/commonjs/ui/components/items/ConsolePanelItem.js +2 -2
- package/lib/commonjs/ui/components/items/ConsolePanelItem.js.map +1 -1
- package/lib/commonjs/ui/components/items/DebuggerHeaderItem.js +4 -2
- package/lib/commonjs/ui/components/items/DebuggerHeaderItem.js.map +1 -1
- package/lib/commonjs/ui/components/items/NetworkPanelItem.js +2 -2
- package/lib/commonjs/ui/components/items/NetworkPanelItem.js.map +1 -1
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsHeaderItem.js +2 -3
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsHeaderItem.js.map +1 -1
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsItem.js +7 -6
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsItem.js.map +1 -1
- package/lib/commonjs/ui/components/panels/ConsolePanel.js +21 -23
- package/lib/commonjs/ui/components/panels/ConsolePanel.js.map +1 -1
- package/lib/commonjs/ui/components/panels/NetworkPanel.js +30 -33
- package/lib/commonjs/ui/components/panels/NetworkPanel.js.map +1 -1
- package/lib/module/assets/icons/bug.png +0 -0
- package/lib/module/contexts/MainContext.js +7 -3
- package/lib/module/contexts/MainContext.js.map +1 -1
- package/lib/module/contexts/index.js +11 -1
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/core/constants.js +8 -0
- package/lib/module/core/constants.js.map +1 -0
- package/lib/module/core/data.js +10 -0
- package/lib/module/core/data.js.map +1 -0
- package/lib/module/core/global.d.js.map +1 -0
- package/lib/module/core/utils.js +71 -0
- package/lib/module/core/utils.js.map +1 -0
- package/lib/module/hooks/index.js +18 -3
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useConsoleInterceptor.js +21 -14
- package/lib/module/hooks/useConsoleInterceptor.js.map +1 -1
- package/lib/module/hooks/useNetworkInterceptor.js +38 -29
- package/lib/module/hooks/useNetworkInterceptor.js.map +1 -1
- package/lib/module/index.js +11 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/interceptors/ConsoleInterceptor.js +16 -14
- package/lib/module/interceptors/ConsoleInterceptor.js.map +1 -1
- package/lib/module/interceptors/FetchInterceptor.js +23 -22
- package/lib/module/interceptors/FetchInterceptor.js.map +1 -1
- package/lib/module/interceptors/HttpInterceptor.js +14 -48
- package/lib/module/interceptors/HttpInterceptor.js.map +1 -1
- package/lib/module/interceptors/Interceptor.js +13 -2
- package/lib/module/interceptors/Interceptor.js.map +1 -1
- package/lib/module/interceptors/NetworkInterceptor.js +21 -2
- package/lib/module/interceptors/NetworkInterceptor.js.map +1 -1
- package/lib/module/interceptors/WebSocketInterceptor.js +48 -91
- package/lib/module/interceptors/WebSocketInterceptor.js.map +1 -1
- package/lib/module/interceptors/XHRInterceptor.js +19 -18
- package/lib/module/interceptors/XHRInterceptor.js.map +1 -1
- package/lib/module/interceptors/index.js +32 -4
- package/lib/module/interceptors/index.js.map +1 -1
- package/lib/module/theme/colors.js +14 -0
- package/lib/module/theme/colors.js.map +1 -0
- package/lib/module/theme/icons.js +15 -0
- package/lib/module/theme/icons.js.map +1 -0
- package/lib/module/types/common.js +6 -2
- package/lib/module/types/common.js.map +1 -1
- package/lib/module/types/http.js +3 -1
- package/lib/module/types/index.js +47 -4
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/websocket.js +3 -1
- package/lib/module/ui/Xenon.js +97 -78
- package/lib/module/ui/Xenon.js.map +1 -1
- package/lib/module/ui/components/bubble/Bubble.js +100 -63
- package/lib/module/ui/components/bubble/Bubble.js.map +1 -1
- package/lib/module/ui/components/details/DetailsViewer.js +18 -18
- package/lib/module/ui/components/details/DetailsViewer.js.map +1 -1
- package/lib/module/ui/components/details/LogMessageDetails.js +15 -10
- package/lib/module/ui/components/details/LogMessageDetails.js.map +1 -1
- package/lib/module/ui/components/details/NetworkRequestDetails.js +66 -46
- package/lib/module/ui/components/details/NetworkRequestDetails.js.map +1 -1
- package/lib/module/ui/components/headers/DebuggerHeader.js +68 -43
- package/lib/module/ui/components/headers/DebuggerHeader.js.map +1 -1
- package/lib/module/ui/components/headers/NetworkPanelHeader.js +26 -21
- package/lib/module/ui/components/headers/NetworkPanelHeader.js.map +1 -1
- package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js +14 -10
- package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js.map +1 -1
- package/lib/module/ui/components/index.js +39 -5
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/items/ConsolePanelItem.js +15 -10
- package/lib/module/ui/components/items/ConsolePanelItem.js.map +1 -1
- package/lib/module/ui/components/items/DebuggerHeaderItem.js +20 -13
- package/lib/module/ui/components/items/DebuggerHeaderItem.js.map +1 -1
- package/lib/module/ui/components/items/NetworkPanelItem.js +28 -23
- package/lib/module/ui/components/items/NetworkPanelItem.js.map +1 -1
- package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js +15 -11
- package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js.map +1 -1
- package/lib/module/ui/components/items/NetworkRequestDetailsItem.js +21 -15
- package/lib/module/ui/components/items/NetworkRequestDetailsItem.js.map +1 -1
- package/lib/module/ui/components/panels/ConsolePanel.js +35 -32
- package/lib/module/ui/components/panels/ConsolePanel.js.map +1 -1
- package/lib/module/ui/components/panels/NetworkPanel.js +43 -41
- package/lib/module/ui/components/panels/NetworkPanel.js.map +1 -1
- package/lib/typescript/commonjs/src/contexts/MainContext.d.ts +5 -17
- package/lib/typescript/commonjs/src/contexts/MainContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/core/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/data.d.ts +10 -0
- package/lib/typescript/commonjs/src/core/data.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/{utils.d.ts → core/utils.d.ts} +10 -1
- package/lib/typescript/commonjs/src/core/utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/index.d.ts +0 -1
- package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useConsoleInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useNetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/ConsoleInterceptor.d.ts +3 -5
- package/lib/typescript/commonjs/src/interceptors/ConsoleInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/FetchInterceptor.d.ts +0 -2
- package/lib/typescript/commonjs/src/interceptors/FetchInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/HttpInterceptor.d.ts +3 -20
- package/lib/typescript/commonjs/src/interceptors/HttpInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/Interceptor.d.ts +3 -1
- package/lib/typescript/commonjs/src/interceptors/Interceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/NetworkInterceptor.d.ts +7 -3
- package/lib/typescript/commonjs/src/interceptors/NetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/WebSocketInterceptor.d.ts +4 -25
- package/lib/typescript/commonjs/src/interceptors/WebSocketInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/XHRInterceptor.d.ts +0 -2
- package/lib/typescript/commonjs/src/interceptors/XHRInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/theme/colors.d.ts.map +1 -0
- package/lib/typescript/{module/src → commonjs/src/theme}/icons.d.ts +1 -1
- package/lib/typescript/commonjs/src/theme/icons.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/common.d.ts +6 -4
- package/lib/typescript/commonjs/src/types/common.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/console.d.ts +3 -0
- package/lib/typescript/commonjs/src/types/console.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/http.d.ts +7 -5
- package/lib/typescript/commonjs/src/types/http.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/websocket.d.ts +9 -7
- package/lib/typescript/commonjs/src/types/websocket.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/Xenon.d.ts +2 -0
- package/lib/typescript/commonjs/src/ui/Xenon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/bubble/Bubble.d.ts +4 -1
- package/lib/typescript/commonjs/src/ui/components/bubble/Bubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/details/DetailsViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/headers/DebuggerHeader.d.ts +5 -1
- package/lib/typescript/commonjs/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts +1 -3
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsItem.d.ts +3 -3
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
- package/lib/typescript/module/src/contexts/MainContext.d.ts +5 -17
- package/lib/typescript/module/src/contexts/MainContext.d.ts.map +1 -1
- package/lib/typescript/module/src/core/constants.d.ts.map +1 -0
- package/lib/typescript/module/src/core/data.d.ts +10 -0
- package/lib/typescript/module/src/core/data.d.ts.map +1 -0
- package/lib/typescript/module/src/{utils.d.ts → core/utils.d.ts} +10 -1
- package/lib/typescript/module/src/core/utils.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/index.d.ts +0 -1
- package/lib/typescript/module/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useConsoleInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useNetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/ConsoleInterceptor.d.ts +3 -5
- package/lib/typescript/module/src/interceptors/ConsoleInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/FetchInterceptor.d.ts +0 -2
- package/lib/typescript/module/src/interceptors/FetchInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/HttpInterceptor.d.ts +3 -20
- package/lib/typescript/module/src/interceptors/HttpInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/Interceptor.d.ts +3 -1
- package/lib/typescript/module/src/interceptors/Interceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/NetworkInterceptor.d.ts +7 -3
- package/lib/typescript/module/src/interceptors/NetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/WebSocketInterceptor.d.ts +4 -25
- package/lib/typescript/module/src/interceptors/WebSocketInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/XHRInterceptor.d.ts +0 -2
- package/lib/typescript/module/src/interceptors/XHRInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/theme/colors.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → module/src/theme}/icons.d.ts +1 -1
- package/lib/typescript/module/src/theme/icons.d.ts.map +1 -0
- package/lib/typescript/module/src/types/common.d.ts +6 -4
- package/lib/typescript/module/src/types/common.d.ts.map +1 -1
- package/lib/typescript/module/src/types/console.d.ts +3 -0
- package/lib/typescript/module/src/types/console.d.ts.map +1 -1
- package/lib/typescript/module/src/types/http.d.ts +7 -5
- package/lib/typescript/module/src/types/http.d.ts.map +1 -1
- package/lib/typescript/module/src/types/websocket.d.ts +9 -7
- package/lib/typescript/module/src/types/websocket.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/Xenon.d.ts +2 -0
- package/lib/typescript/module/src/ui/Xenon.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/bubble/Bubble.d.ts +4 -1
- package/lib/typescript/module/src/ui/components/bubble/Bubble.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/details/DetailsViewer.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/headers/DebuggerHeader.d.ts +5 -1
- package/lib/typescript/module/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts +1 -3
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsItem.d.ts +3 -3
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsItem.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
- package/package.json +12 -6
- package/src/assets/icons/bug.png +0 -0
- package/src/contexts/MainContext.ts +6 -25
- package/src/core/data.ts +12 -0
- package/src/{utils.ts → core/utils.ts} +27 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useConsoleInterceptor.ts +10 -7
- package/src/hooks/useNetworkInterceptor.ts +52 -55
- package/src/interceptors/ConsoleInterceptor.ts +11 -15
- package/src/interceptors/FetchInterceptor.ts +17 -18
- package/src/interceptors/HttpInterceptor.ts +9 -62
- package/src/interceptors/Interceptor.ts +11 -1
- package/src/interceptors/NetworkInterceptor.ts +18 -3
- package/src/interceptors/WebSocketInterceptor.ts +28 -95
- package/src/interceptors/XHRInterceptor.ts +11 -15
- package/src/theme/icons.ts +9 -0
- package/src/types/common.ts +8 -8
- package/src/types/console.ts +4 -0
- package/src/types/http.ts +24 -28
- package/src/types/websocket.ts +16 -26
- package/src/ui/Xenon.tsx +89 -78
- package/src/ui/components/bubble/Bubble.tsx +98 -62
- package/src/ui/components/details/DetailsViewer.tsx +6 -9
- package/src/ui/components/details/LogMessageDetails.tsx +2 -2
- package/src/ui/components/details/NetworkRequestDetails.tsx +26 -9
- package/src/ui/components/headers/DebuggerHeader.tsx +46 -24
- package/src/ui/components/headers/NetworkPanelHeader.tsx +2 -2
- package/src/ui/components/headers/NetworkRequestDetailsHeader.tsx +0 -1
- package/src/ui/components/items/ConsolePanelItem.tsx +2 -2
- package/src/ui/components/items/DebuggerHeaderItem.tsx +3 -1
- package/src/ui/components/items/NetworkPanelItem.tsx +2 -2
- package/src/ui/components/items/NetworkRequestDetailsHeaderItem.tsx +1 -5
- package/src/ui/components/items/NetworkRequestDetailsItem.tsx +7 -7
- package/src/ui/components/panels/ConsolePanel.tsx +19 -22
- package/src/ui/components/panels/NetworkPanel.tsx +31 -35
- package/lib/commonjs/assets/icons/code.png +0 -0
- package/lib/commonjs/colors.js.map +0 -1
- package/lib/commonjs/constants.js.map +0 -1
- package/lib/commonjs/global.d.js.map +0 -1
- package/lib/commonjs/hooks/useScrollToBottom.js +0 -23
- package/lib/commonjs/hooks/useScrollToBottom.js.map +0 -1
- package/lib/commonjs/icons.js +0 -15
- package/lib/commonjs/icons.js.map +0 -1
- package/lib/commonjs/utils.js.map +0 -1
- package/lib/module/assets/icons/code.png +0 -0
- package/lib/module/colors.js +0 -10
- package/lib/module/colors.js.map +0 -1
- package/lib/module/constants.js +0 -4
- package/lib/module/constants.js.map +0 -1
- package/lib/module/global.d.js.map +0 -1
- package/lib/module/hooks/useScrollToBottom.js +0 -19
- package/lib/module/hooks/useScrollToBottom.js.map +0 -1
- package/lib/module/icons.js +0 -11
- package/lib/module/icons.js.map +0 -1
- package/lib/module/utils.js +0 -36
- package/lib/module/utils.js.map +0 -1
- package/lib/typescript/commonjs/src/colors.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useScrollToBottom.d.ts +0 -3
- package/lib/typescript/commonjs/src/hooks/useScrollToBottom.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/icons.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/utils.d.ts.map +0 -1
- package/lib/typescript/module/src/colors.d.ts.map +0 -1
- package/lib/typescript/module/src/constants.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useScrollToBottom.d.ts +0 -3
- package/lib/typescript/module/src/hooks/useScrollToBottom.d.ts.map +0 -1
- package/lib/typescript/module/src/icons.d.ts.map +0 -1
- package/lib/typescript/module/src/utils.d.ts.map +0 -1
- package/src/assets/icons/code.png +0 -0
- package/src/hooks/useScrollToBottom.ts +0 -23
- package/src/icons.ts +0 -9
- /package/lib/commonjs/{constants.js → core/constants.js} +0 -0
- /package/lib/commonjs/{global.d.js → core/global.d.js} +0 -0
- /package/lib/commonjs/{colors.js → theme/colors.js} +0 -0
- /package/lib/module/{global.d.js → core/global.d.js} +0 -0
- /package/lib/typescript/commonjs/src/{constants.d.ts → core/constants.d.ts} +0 -0
- /package/lib/typescript/commonjs/src/{colors.d.ts → theme/colors.d.ts} +0 -0
- /package/lib/typescript/module/src/{constants.d.ts → core/constants.d.ts} +0 -0
- /package/lib/typescript/module/src/{colors.d.ts → theme/colors.d.ts} +0 -0
- /package/src/{constants.ts → core/constants.ts} +0 -0
- /package/src/{global.d.ts → core/global.d.ts} +0 -0
- /package/src/{colors.ts → theme/colors.ts} +0 -0
@@ -1,14 +1,7 @@
|
|
1
1
|
import { NativeEventEmitter, type EmitterSubscription } from 'react-native';
|
2
2
|
import NativeWebSocketModule from 'react-native/Libraries/WebSocket/NativeWebSocketModule';
|
3
|
-
import
|
4
|
-
|
5
|
-
WebSocketConnectCallback,
|
6
|
-
WebSocketOnCloseCallback,
|
7
|
-
WebSocketOnErrorCallback,
|
8
|
-
WebSocketOnMessageCallback,
|
9
|
-
WebSocketOnOpenCallback,
|
10
|
-
WebSocketSendCallback,
|
11
|
-
} from '../types';
|
3
|
+
import { frozen, singleton } from '../core/utils';
|
4
|
+
import type { WebSocketHandlers } from '../types';
|
12
5
|
import { NetworkInterceptor } from './NetworkInterceptor';
|
13
6
|
|
14
7
|
const originalWebSocketConnect = NativeWebSocketModule.connect;
|
@@ -16,83 +9,21 @@ const originalWebSocketSend = NativeWebSocketModule.send;
|
|
16
9
|
const originalWebSocketSendBinary = NativeWebSocketModule.sendBinary;
|
17
10
|
const originalWebSocketClose = NativeWebSocketModule.close;
|
18
11
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
private onMessageCallback: WebSocketOnMessageCallback = null;
|
31
|
-
private onErrorCallback: WebSocketOnErrorCallback = null;
|
32
|
-
private onCloseCallback: WebSocketOnCloseCallback = null;
|
33
|
-
|
34
|
-
setConnectCallback(callback: typeof this.connectCallback) {
|
35
|
-
this.connectCallback = callback;
|
36
|
-
return this;
|
37
|
-
}
|
38
|
-
|
39
|
-
setSendCallback(callback: typeof this.sendCallback) {
|
40
|
-
this.sendCallback = callback;
|
41
|
-
return this;
|
42
|
-
}
|
43
|
-
|
44
|
-
setCloseCallback(callback: typeof this.closeCallback) {
|
45
|
-
this.closeCallback = callback;
|
46
|
-
return this;
|
47
|
-
}
|
48
|
-
|
49
|
-
setOnOpenCallback(callback: typeof this.onOpenCallback) {
|
50
|
-
this.onOpenCallback = callback;
|
51
|
-
return this;
|
52
|
-
}
|
53
|
-
|
54
|
-
setOnMessageCallback(callback: typeof this.onMessageCallback) {
|
55
|
-
this.onMessageCallback = callback;
|
56
|
-
return this;
|
57
|
-
}
|
58
|
-
|
59
|
-
setOnErrorCallback(callback: typeof this.onErrorCallback) {
|
60
|
-
this.onErrorCallback = callback;
|
61
|
-
return this;
|
62
|
-
}
|
63
|
-
|
64
|
-
setOnCloseCallback(callback: typeof this.onCloseCallback) {
|
65
|
-
this.onCloseCallback = callback;
|
66
|
-
return this;
|
67
|
-
}
|
68
|
-
|
69
|
-
protected getCallbacks() {
|
70
|
-
const connectCallback = this.connectCallback?.bind(this);
|
71
|
-
const sendCallback = this.sendCallback?.bind(this);
|
72
|
-
const closeCallback = this.closeCallback?.bind(this);
|
73
|
-
const arrayBufferToString = this.arrayBufferToString?.bind(this);
|
74
|
-
|
75
|
-
return {
|
76
|
-
connectCallback,
|
77
|
-
sendCallback,
|
78
|
-
closeCallback,
|
79
|
-
arrayBufferToString,
|
80
|
-
};
|
81
|
-
}
|
82
|
-
|
83
|
-
protected clearCallbacks(): void {
|
84
|
-
this.connectCallback = null;
|
85
|
-
this.sendCallback = null;
|
86
|
-
this.closeCallback = null;
|
87
|
-
this.onOpenCallback = null;
|
88
|
-
this.onMessageCallback = null;
|
89
|
-
this.onErrorCallback = null;
|
90
|
-
this.onCloseCallback = null;
|
91
|
-
}
|
12
|
+
@singleton
|
13
|
+
export default class WebSocketInterceptor extends NetworkInterceptor<WebSocketHandlers> {
|
14
|
+
protected handlers: WebSocketHandlers = {
|
15
|
+
connect: null,
|
16
|
+
send: null,
|
17
|
+
close: null,
|
18
|
+
onOpen: null,
|
19
|
+
onMessage: null,
|
20
|
+
onError: null,
|
21
|
+
onClose: null,
|
22
|
+
};
|
92
23
|
|
93
24
|
private eventEmitter: NativeEventEmitter | null = null;
|
94
25
|
private subscriptions: EmitterSubscription[] = [];
|
95
|
-
private readonly
|
26
|
+
private readonly startTimes: Map<number, number> = new Map();
|
96
27
|
|
97
28
|
private arrayBufferToString(data?: string) {
|
98
29
|
try {
|
@@ -113,24 +44,24 @@ export default class WebSocketInterceptor extends NetworkInterceptor {
|
|
113
44
|
|
114
45
|
this.subscriptions = [
|
115
46
|
this.eventEmitter.addListener('websocketOpen', ev => {
|
116
|
-
const
|
117
|
-
const
|
118
|
-
const duration =
|
119
|
-
this.
|
47
|
+
const startTime = this.startTimes.get(ev.id);
|
48
|
+
const endTime = Date.now();
|
49
|
+
const duration = endTime - (startTime ?? 0);
|
50
|
+
this.startTimes.delete(ev.id);
|
120
51
|
|
121
|
-
this.
|
52
|
+
this.handlers.onOpen?.(ev.id, duration);
|
122
53
|
}),
|
123
54
|
this.eventEmitter.addListener('websocketMessage', ev => {
|
124
|
-
this.
|
55
|
+
this.handlers.onMessage?.(
|
125
56
|
ev.id,
|
126
57
|
ev.type === 'binary' ? this.arrayBufferToString(ev.data) : ev.data,
|
127
58
|
);
|
128
59
|
}),
|
129
60
|
this.eventEmitter.addListener('websocketClosed', ev => {
|
130
|
-
this.
|
61
|
+
this.handlers.onClose?.(ev.id, { code: ev.code, reason: ev.reason });
|
131
62
|
}),
|
132
63
|
this.eventEmitter.addListener('websocketFailed', ev => {
|
133
|
-
this.
|
64
|
+
this.handlers.onError?.(ev.id, { message: ev.message });
|
134
65
|
}),
|
135
66
|
];
|
136
67
|
}
|
@@ -141,6 +72,7 @@ export default class WebSocketInterceptor extends NetworkInterceptor {
|
|
141
72
|
this.eventEmitter = null;
|
142
73
|
}
|
143
74
|
|
75
|
+
@frozen
|
144
76
|
enableInterception(): void {
|
145
77
|
if (this.isInterceptorEnabled) return;
|
146
78
|
|
@@ -148,14 +80,13 @@ export default class WebSocketInterceptor extends NetworkInterceptor {
|
|
148
80
|
|
149
81
|
this.registerEvents();
|
150
82
|
|
151
|
-
const { connectCallback, sendCallback, closeCallback
|
152
|
-
this.getCallbacks();
|
83
|
+
const { connectCallback, sendCallback, closeCallback } = this.getCallbacks();
|
153
84
|
|
154
|
-
const
|
85
|
+
const startTimes = this.startTimes;
|
155
86
|
NativeWebSocketModule.connect = function (...args) {
|
156
87
|
connectCallback?.(...args);
|
157
88
|
|
158
|
-
|
89
|
+
startTimes.set(args[3], Date.now());
|
159
90
|
|
160
91
|
originalWebSocketConnect.call(this, ...args);
|
161
92
|
};
|
@@ -166,6 +97,7 @@ export default class WebSocketInterceptor extends NetworkInterceptor {
|
|
166
97
|
originalWebSocketSend.call(this, ...args);
|
167
98
|
};
|
168
99
|
|
100
|
+
const arrayBufferToString = this.arrayBufferToString;
|
169
101
|
NativeWebSocketModule.sendBinary = function (base64String, socketId) {
|
170
102
|
sendCallback?.(arrayBufferToString(base64String), socketId);
|
171
103
|
|
@@ -181,6 +113,7 @@ export default class WebSocketInterceptor extends NetworkInterceptor {
|
|
181
113
|
this.isInterceptorEnabled = true;
|
182
114
|
}
|
183
115
|
|
116
|
+
@frozen
|
184
117
|
disableInterception(): void {
|
185
118
|
if (!this.isInterceptorEnabled) return;
|
186
119
|
|
@@ -1,18 +1,14 @@
|
|
1
|
+
import { frozen, getHttpInterceptorId, singleton } from '../core/utils';
|
1
2
|
import { NetworkType } from '../types';
|
2
|
-
import { getHttpInterceptorId } from '../utils';
|
3
3
|
import HttpInterceptor from './HttpInterceptor';
|
4
4
|
|
5
5
|
const originalXHROpen = XMLHttpRequest.prototype.open;
|
6
6
|
const originalXHRSend = XMLHttpRequest.prototype.send;
|
7
7
|
const originalXHRSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader;
|
8
8
|
|
9
|
+
@singleton
|
9
10
|
export default class XHRInterceptor extends HttpInterceptor {
|
10
|
-
|
11
|
-
|
12
|
-
private constructor() {
|
13
|
-
super();
|
14
|
-
}
|
15
|
-
|
11
|
+
@frozen
|
16
12
|
enableInterception() {
|
17
13
|
if (this.isInterceptorEnabled) return;
|
18
14
|
|
@@ -43,7 +39,7 @@ export default class XHRInterceptor extends HttpInterceptor {
|
|
43
39
|
XMLHttpRequest.prototype.send = function (data) {
|
44
40
|
sendCallback?.(this._interceptionId, data);
|
45
41
|
|
46
|
-
const
|
42
|
+
const startTime = Date.now();
|
47
43
|
|
48
44
|
this.addEventListener?.('readystatechange', () => {
|
49
45
|
if (!isInterceptorEnabled()) return;
|
@@ -52,12 +48,11 @@ export default class XHRInterceptor extends HttpInterceptor {
|
|
52
48
|
const contentTypeString = this.getResponseHeader('Content-Type');
|
53
49
|
const contentLengthString = this.getResponseHeader('Content-Length');
|
54
50
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
if (contentTypeString) responseContentType = contentTypeString.split(';')[0];
|
51
|
+
const responseContentType = contentTypeString
|
52
|
+
? contentTypeString.split(';')[0]
|
53
|
+
: undefined;
|
59
54
|
|
60
|
-
|
55
|
+
const responseSize = contentLengthString ? parseInt(contentLengthString, 10) : undefined;
|
61
56
|
|
62
57
|
headerReceivedCallback?.(
|
63
58
|
this._interceptionId,
|
@@ -68,8 +63,8 @@ export default class XHRInterceptor extends HttpInterceptor {
|
|
68
63
|
}
|
69
64
|
|
70
65
|
if (this.readyState === this.DONE) {
|
71
|
-
const
|
72
|
-
const duration =
|
66
|
+
const endTime = Date.now();
|
67
|
+
const duration = endTime - startTime;
|
73
68
|
|
74
69
|
responseCallback?.(
|
75
70
|
this._interceptionId,
|
@@ -89,6 +84,7 @@ export default class XHRInterceptor extends HttpInterceptor {
|
|
89
84
|
this.isInterceptorEnabled = true;
|
90
85
|
}
|
91
86
|
|
87
|
+
@frozen
|
92
88
|
disableInterception() {
|
93
89
|
if (!this.isInterceptorEnabled) return;
|
94
90
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
const icons = Object.freeze({
|
2
|
+
bug: require('../assets/icons/bug.png'),
|
3
|
+
delete: require('../assets/icons/delete.png'),
|
4
|
+
hide: require('../assets/icons/hide.png'),
|
5
|
+
move: require('../assets/icons/move.png'),
|
6
|
+
record: require('../assets/icons/record.png'),
|
7
|
+
});
|
8
|
+
|
9
|
+
export default icons;
|
package/src/types/common.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import type { Dispatch, SetStateAction } from 'react';
|
2
|
-
|
3
1
|
export enum NetworkType {
|
4
2
|
XHR = 'xhr',
|
5
3
|
Fetch = 'fetch',
|
@@ -11,6 +9,8 @@ export enum DebuggerPanel {
|
|
11
9
|
Console = 'console',
|
12
10
|
}
|
13
11
|
|
12
|
+
export type AnyFunction = (...args: any[]) => any;
|
13
|
+
|
14
14
|
export type ID = string | undefined;
|
15
15
|
|
16
16
|
export interface NetworkRequest {
|
@@ -19,10 +19,10 @@ export interface NetworkRequest {
|
|
19
19
|
duration?: number;
|
20
20
|
}
|
21
21
|
|
22
|
-
export type DebuggerVisibility = 'hidden' | 'bubble' | 'panel';
|
23
|
-
|
24
|
-
export type DebuggerPosition = 'top' | 'bottom';
|
25
|
-
|
26
|
-
export type SetState<T> = Dispatch<SetStateAction<T>>;
|
27
|
-
|
28
22
|
export type NetworkTab = 'headers' | 'queryStringParameters' | 'body' | 'response' | 'messages';
|
23
|
+
|
24
|
+
export interface DebuggerState {
|
25
|
+
visibility: 'hidden' | 'bubble' | 'panel';
|
26
|
+
position: 'top' | 'bottom';
|
27
|
+
selectedPanel: DebuggerPanel | null;
|
28
|
+
}
|
package/src/types/console.ts
CHANGED
package/src/types/http.ts
CHANGED
@@ -14,31 +14,27 @@ export interface HttpRequest extends NetworkRequest {
|
|
14
14
|
responseType?: string;
|
15
15
|
}
|
16
16
|
|
17
|
-
export
|
18
|
-
|
19
|
-
| null;
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
responseURL: string | undefined,
|
42
|
-
responseType: string | undefined,
|
43
|
-
) => void)
|
44
|
-
| null;
|
17
|
+
export interface HttpHandlers {
|
18
|
+
open: ((id: ID, type: HttpRequest['type'], method: string, url: string) => void) | null;
|
19
|
+
requestHeader: ((id: ID, header: string, value: string) => void) | null;
|
20
|
+
send: ((id: ID, data?: any) => void) | null;
|
21
|
+
headerReceived:
|
22
|
+
| ((
|
23
|
+
id: ID,
|
24
|
+
responseContentType: string | undefined,
|
25
|
+
responseSize: number | undefined,
|
26
|
+
responseHeaders: string,
|
27
|
+
) => void)
|
28
|
+
| null;
|
29
|
+
response:
|
30
|
+
| ((
|
31
|
+
id: ID,
|
32
|
+
status: number | undefined,
|
33
|
+
timeout: number | undefined,
|
34
|
+
duration: number,
|
35
|
+
response: any,
|
36
|
+
responseURL: string | undefined,
|
37
|
+
responseType: string | undefined,
|
38
|
+
) => void)
|
39
|
+
| null;
|
40
|
+
}
|
package/src/types/websocket.ts
CHANGED
@@ -13,29 +13,19 @@ export interface WebSocketRequest extends NetworkRequest {
|
|
13
13
|
serverClose?: { code?: number; reason?: string };
|
14
14
|
}
|
15
15
|
|
16
|
-
export
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
| null;
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
export type WebSocketOnMessageCallback = ((socketId: number, message: any) => void) | null;
|
34
|
-
|
35
|
-
export type WebSocketOnErrorCallback =
|
36
|
-
| ((socketId: number, error: WebSocketRequest['serverError']) => void)
|
37
|
-
| null;
|
38
|
-
|
39
|
-
export type WebSocketOnCloseCallback =
|
40
|
-
| ((socketId: number, data: WebSocketRequest['serverClose']) => void)
|
41
|
-
| null;
|
16
|
+
export interface WebSocketHandlers {
|
17
|
+
connect:
|
18
|
+
| ((
|
19
|
+
url: string,
|
20
|
+
protocols?: WebSocketRequest['protocols'],
|
21
|
+
options?: WebSocketRequest['options'],
|
22
|
+
socketId?: number,
|
23
|
+
) => void)
|
24
|
+
| null;
|
25
|
+
send: ((data: string, socketId: number) => void) | null;
|
26
|
+
close: ((code: number, reason: string, socketId: number) => void) | null;
|
27
|
+
onOpen: ((socketId: number, duration: number) => void) | null;
|
28
|
+
onMessage: ((socketId: number, message: any) => void) | null;
|
29
|
+
onError: ((socketId: number, error: WebSocketRequest['serverError']) => void) | null;
|
30
|
+
onClose: ((socketId: number, data: WebSocketRequest['serverClose']) => void) | null;
|
31
|
+
}
|
package/src/ui/Xenon.tsx
CHANGED
@@ -3,18 +3,23 @@ import {
|
|
3
3
|
createRef,
|
4
4
|
memo,
|
5
5
|
useImperativeHandle,
|
6
|
+
useMemo,
|
6
7
|
useRef,
|
7
|
-
useState,
|
8
8
|
type NamedExoticComponent,
|
9
9
|
} from 'react';
|
10
|
-
import { Animated,
|
11
|
-
import
|
12
|
-
import
|
10
|
+
import { Animated, StyleSheet, useWindowDimensions } from 'react-native';
|
11
|
+
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
12
|
+
import { useImmer } from 'use-immer';
|
13
|
+
import MainContext from '../contexts/MainContext';
|
14
|
+
import { detailsData } from '../core/data';
|
15
|
+
import { getVerticalSafeMargin } from '../core/utils';
|
13
16
|
import { useConsoleInterceptor, useNetworkInterceptor } from '../hooks';
|
14
|
-
import
|
17
|
+
import colors from '../theme/colors';
|
18
|
+
import { DebuggerPanel, type DebuggerState } from '../types';
|
15
19
|
import { Bubble, ConsolePanel, DebuggerHeader, DetailsViewer, NetworkPanel } from './components';
|
16
20
|
|
17
21
|
interface XenonComponentMethods {
|
22
|
+
isVisible(): boolean;
|
18
23
|
show(): void;
|
19
24
|
hide(): void;
|
20
25
|
}
|
@@ -23,6 +28,7 @@ interface XenonComponentProps {
|
|
23
28
|
autoInspectNetworkEnabled?: boolean;
|
24
29
|
autoInspectConsoleEnabled?: boolean;
|
25
30
|
bubbleSize?: number;
|
31
|
+
idleBubbleOpacity?: number;
|
26
32
|
}
|
27
33
|
|
28
34
|
interface ReactNativeXenon extends XenonComponentMethods {
|
@@ -34,19 +40,25 @@ enableMapSet();
|
|
34
40
|
const rootRef = createRef<XenonComponentMethods>();
|
35
41
|
|
36
42
|
const XenonComponent = memo<XenonComponentProps>(
|
37
|
-
({
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
const
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
({
|
44
|
+
autoInspectNetworkEnabled = true,
|
45
|
+
autoInspectConsoleEnabled = true,
|
46
|
+
bubbleSize = 40,
|
47
|
+
idleBubbleOpacity = 0.5,
|
48
|
+
}) => {
|
49
|
+
const { width, height } = useWindowDimensions();
|
50
|
+
const pan = useRef(new Animated.ValueXY({ x: 0, y: getVerticalSafeMargin(height) }));
|
51
|
+
|
52
|
+
const [debuggerState, setDebuggerState] = useImmer<DebuggerState>({
|
53
|
+
visibility: 'hidden',
|
54
|
+
position: 'bottom',
|
55
|
+
selectedPanel: DebuggerPanel.Network,
|
56
|
+
});
|
48
57
|
|
49
|
-
const
|
58
|
+
const detailsShown = useMemo(
|
59
|
+
() => !debuggerState.selectedPanel && !!detailsData.value,
|
60
|
+
[debuggerState.selectedPanel],
|
61
|
+
);
|
50
62
|
|
51
63
|
const networkInterceptor = useNetworkInterceptor({
|
52
64
|
autoEnabled: autoInspectNetworkEnabled,
|
@@ -56,72 +68,70 @@ const XenonComponent = memo<XenonComponentProps>(
|
|
56
68
|
autoEnabled: autoInspectConsoleEnabled,
|
57
69
|
});
|
58
70
|
|
59
|
-
useImperativeHandle(
|
60
|
-
|
61
|
-
|
71
|
+
useImperativeHandle(rootRef, () => {
|
72
|
+
const changeVisibility = (condition: boolean, value: DebuggerState['visibility']) => {
|
73
|
+
if (!condition) return;
|
74
|
+
|
75
|
+
setDebuggerState(draft => {
|
76
|
+
draft.visibility = value;
|
77
|
+
});
|
78
|
+
};
|
79
|
+
|
80
|
+
return {
|
81
|
+
isVisible() {
|
82
|
+
return debuggerState.visibility !== 'hidden';
|
83
|
+
},
|
62
84
|
show() {
|
63
|
-
|
85
|
+
changeVisibility(!this.isVisible(), 'bubble');
|
64
86
|
},
|
65
87
|
hide() {
|
66
|
-
|
88
|
+
changeVisibility(this.isVisible(), 'hidden');
|
67
89
|
},
|
68
|
-
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
90
|
+
};
|
91
|
+
}, [debuggerState.visibility, setDebuggerState]);
|
92
|
+
|
93
|
+
const renderContent = () => {
|
94
|
+
switch (debuggerState.visibility) {
|
95
|
+
case 'bubble':
|
96
|
+
return (
|
97
|
+
<Bubble
|
98
|
+
bubbleSize={bubbleSize}
|
99
|
+
idleBubbleOpacity={idleBubbleOpacity}
|
100
|
+
pan={pan}
|
101
|
+
screenWidth={width}
|
102
|
+
screenHeight={height}
|
103
|
+
/>
|
104
|
+
);
|
105
|
+
case 'panel':
|
106
|
+
return (
|
107
|
+
<SafeAreaProvider
|
108
|
+
style={[
|
109
|
+
styles.container,
|
110
|
+
// eslint-disable-next-line react-native/no-inline-styles
|
111
|
+
{
|
112
|
+
[debuggerState.position]: 0,
|
113
|
+
height: Math.min(width, height) * 0.75,
|
114
|
+
},
|
115
|
+
]}
|
116
|
+
>
|
117
|
+
<SafeAreaView style={styles.safeArea}>
|
118
|
+
<DebuggerHeader detailsShown={detailsShown} />
|
119
|
+
{debuggerState.selectedPanel === DebuggerPanel.Network && <NetworkPanel />}
|
120
|
+
{debuggerState.selectedPanel === DebuggerPanel.Console && <ConsolePanel />}
|
121
|
+
{detailsShown && <DetailsViewer />}
|
122
|
+
</SafeAreaView>
|
123
|
+
</SafeAreaProvider>
|
124
|
+
);
|
125
|
+
default:
|
126
|
+
return null;
|
127
|
+
}
|
128
|
+
};
|
106
129
|
|
107
130
|
return (
|
108
131
|
<MainContext.Provider
|
109
|
-
value={{
|
110
|
-
debuggerVisibility,
|
111
|
-
setDebuggerVisibility,
|
112
|
-
debuggerPosition,
|
113
|
-
setDebuggerPosition,
|
114
|
-
panelSelected,
|
115
|
-
setPanelSelected,
|
116
|
-
networkInterceptor,
|
117
|
-
logInterceptor,
|
118
|
-
detailsData,
|
119
|
-
screenWidth,
|
120
|
-
screenHeight,
|
121
|
-
verticalSafeMargin,
|
122
|
-
}}
|
132
|
+
value={{ debuggerState, setDebuggerState, networkInterceptor, logInterceptor }}
|
123
133
|
>
|
124
|
-
{
|
134
|
+
{renderContent()}
|
125
135
|
</MainContext.Provider>
|
126
136
|
);
|
127
137
|
},
|
@@ -136,16 +146,17 @@ const styles = StyleSheet.create({
|
|
136
146
|
zIndex: 9999,
|
137
147
|
backgroundColor: colors.lightGray,
|
138
148
|
},
|
139
|
-
|
149
|
+
safeArea: {
|
140
150
|
flex: 1,
|
141
|
-
...StyleSheet.absoluteFillObject,
|
142
|
-
pointerEvents: 'box-none',
|
143
151
|
},
|
144
152
|
});
|
145
153
|
|
146
154
|
XenonComponent.displayName = 'Xenon';
|
147
155
|
|
148
156
|
const Xenon: ReactNativeXenon = {
|
157
|
+
isVisible() {
|
158
|
+
return rootRef.current?.isVisible() ?? false;
|
159
|
+
},
|
149
160
|
show() {
|
150
161
|
rootRef.current?.show();
|
151
162
|
},
|