react-native-xenon 0.1.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/LICENSE +20 -0
- package/README.md +62 -0
- package/lib/commonjs/assets/code.png +0 -0
- package/lib/commonjs/assets/delete.png +0 -0
- package/lib/commonjs/assets/hide.png +0 -0
- package/lib/commonjs/assets/move.png +0 -0
- package/lib/commonjs/assets/record.png +0 -0
- package/lib/commonjs/constants.js +8 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/contexts/MainContext.js +10 -0
- package/lib/commonjs/contexts/MainContext.js.map +1 -0
- package/lib/commonjs/contexts/index.js +14 -0
- package/lib/commonjs/contexts/index.js.map +1 -0
- package/lib/commonjs/global.d.js +2 -0
- package/lib/commonjs/global.d.js.map +1 -0
- package/lib/commonjs/hooks/index.js +28 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useConsoleInterceptor.js +49 -0
- package/lib/commonjs/hooks/useConsoleInterceptor.js.map +1 -0
- package/lib/commonjs/hooks/useNetworkInterceptor.js +162 -0
- package/lib/commonjs/hooks/useNetworkInterceptor.js.map +1 -0
- package/lib/commonjs/hooks/useScrollToBottom.js +23 -0
- package/lib/commonjs/hooks/useScrollToBottom.js.map +1 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/interceptors/ConsoleInterceptor.js +93 -0
- package/lib/commonjs/interceptors/ConsoleInterceptor.js.map +1 -0
- package/lib/commonjs/interceptors/FetchInterceptor.js +114 -0
- package/lib/commonjs/interceptors/FetchInterceptor.js.map +1 -0
- package/lib/commonjs/interceptors/HttpInterceptor.js +57 -0
- package/lib/commonjs/interceptors/HttpInterceptor.js.map +1 -0
- package/lib/commonjs/interceptors/Interceptor.js +11 -0
- package/lib/commonjs/interceptors/Interceptor.js.map +1 -0
- package/lib/commonjs/interceptors/NetworkInterceptor.js +11 -0
- package/lib/commonjs/interceptors/NetworkInterceptor.js.map +1 -0
- package/lib/commonjs/interceptors/WebSocketInterceptor.js +150 -0
- package/lib/commonjs/interceptors/WebSocketInterceptor.js.map +1 -0
- package/lib/commonjs/interceptors/XHRInterceptor.js +69 -0
- package/lib/commonjs/interceptors/XHRInterceptor.js.map +1 -0
- package/lib/commonjs/interceptors/index.js +35 -0
- package/lib/commonjs/interceptors/index.js.map +1 -0
- package/lib/commonjs/types/common.js +18 -0
- package/lib/commonjs/types/common.js.map +1 -0
- package/lib/commonjs/types/console.js +2 -0
- package/lib/commonjs/types/console.js.map +1 -0
- package/lib/commonjs/types/http.js +6 -0
- package/lib/commonjs/types/http.js.map +1 -0
- package/lib/commonjs/types/index.js +50 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/websocket.js +6 -0
- package/lib/commonjs/types/websocket.js.map +1 -0
- package/lib/commonjs/ui/Xenon.js +117 -0
- package/lib/commonjs/ui/Xenon.js.map +1 -0
- package/lib/commonjs/ui/components/bubble/Bubble.js +82 -0
- package/lib/commonjs/ui/components/bubble/Bubble.js.map +1 -0
- package/lib/commonjs/ui/components/details/DetailsViewer.js +33 -0
- package/lib/commonjs/ui/components/details/DetailsViewer.js.map +1 -0
- package/lib/commonjs/ui/components/details/LogMessageDetails.js +30 -0
- package/lib/commonjs/ui/components/details/LogMessageDetails.js.map +1 -0
- package/lib/commonjs/ui/components/details/NetworkRequestDetails.js +130 -0
- package/lib/commonjs/ui/components/details/NetworkRequestDetails.js.map +1 -0
- package/lib/commonjs/ui/components/headers/DebuggerHeader.js +94 -0
- package/lib/commonjs/ui/components/headers/DebuggerHeader.js.map +1 -0
- package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js +68 -0
- package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js.map +1 -0
- package/lib/commonjs/ui/components/headers/NetworkRequestDetailsHeader.js +65 -0
- package/lib/commonjs/ui/components/headers/NetworkRequestDetailsHeader.js.map +1 -0
- package/lib/commonjs/ui/components/index.js +42 -0
- package/lib/commonjs/ui/components/index.js.map +1 -0
- package/lib/commonjs/ui/components/items/ConsolePanelItem.js +35 -0
- package/lib/commonjs/ui/components/items/ConsolePanelItem.js.map +1 -0
- package/lib/commonjs/ui/components/items/DebuggerHeaderItem.js +54 -0
- package/lib/commonjs/ui/components/items/DebuggerHeaderItem.js.map +1 -0
- package/lib/commonjs/ui/components/items/NetworkPanelItem.js +76 -0
- package/lib/commonjs/ui/components/items/NetworkPanelItem.js.map +1 -0
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsHeaderItem.js +47 -0
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsHeaderItem.js.map +1 -0
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsItem.js +41 -0
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsItem.js.map +1 -0
- package/lib/commonjs/ui/components/panels/ConsolePanel.js +58 -0
- package/lib/commonjs/ui/components/panels/ConsolePanel.js.map +1 -0
- package/lib/commonjs/ui/components/panels/NetworkPanel.js +66 -0
- package/lib/commonjs/ui/components/panels/NetworkPanel.js.map +1 -0
- package/lib/commonjs/utils.js +46 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/module/assets/code.png +0 -0
- package/lib/module/assets/delete.png +0 -0
- package/lib/module/assets/hide.png +0 -0
- package/lib/module/assets/move.png +0 -0
- package/lib/module/assets/record.png +0 -0
- package/lib/module/constants.js +4 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/contexts/MainContext.js +6 -0
- package/lib/module/contexts/MainContext.js.map +1 -0
- package/lib/module/contexts/index.js +4 -0
- package/lib/module/contexts/index.js.map +1 -0
- package/lib/module/global.d.js +2 -0
- package/lib/module/global.d.js.map +1 -0
- package/lib/module/hooks/index.js +6 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useConsoleInterceptor.js +45 -0
- package/lib/module/hooks/useConsoleInterceptor.js.map +1 -0
- package/lib/module/hooks/useNetworkInterceptor.js +158 -0
- package/lib/module/hooks/useNetworkInterceptor.js.map +1 -0
- package/lib/module/hooks/useScrollToBottom.js +19 -0
- package/lib/module/hooks/useScrollToBottom.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/interceptors/ConsoleInterceptor.js +86 -0
- package/lib/module/interceptors/ConsoleInterceptor.js.map +1 -0
- package/lib/module/interceptors/FetchInterceptor.js +108 -0
- package/lib/module/interceptors/FetchInterceptor.js.map +1 -0
- package/lib/module/interceptors/HttpInterceptor.js +52 -0
- package/lib/module/interceptors/HttpInterceptor.js.map +1 -0
- package/lib/module/interceptors/Interceptor.js +6 -0
- package/lib/module/interceptors/Interceptor.js.map +1 -0
- package/lib/module/interceptors/NetworkInterceptor.js +5 -0
- package/lib/module/interceptors/NetworkInterceptor.js.map +1 -0
- package/lib/module/interceptors/WebSocketInterceptor.js +144 -0
- package/lib/module/interceptors/WebSocketInterceptor.js.map +1 -0
- package/lib/module/interceptors/XHRInterceptor.js +63 -0
- package/lib/module/interceptors/XHRInterceptor.js.map +1 -0
- package/lib/module/interceptors/index.js +7 -0
- package/lib/module/interceptors/index.js.map +1 -0
- package/lib/module/types/common.js +14 -0
- package/lib/module/types/common.js.map +1 -0
- package/lib/module/types/console.js +2 -0
- package/lib/module/types/console.js.map +1 -0
- package/lib/module/types/http.js +4 -0
- package/lib/module/types/http.js.map +1 -0
- package/lib/module/types/index.js +7 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/websocket.js +4 -0
- package/lib/module/types/websocket.js.map +1 -0
- package/lib/module/ui/Xenon.js +112 -0
- package/lib/module/ui/Xenon.js.map +1 -0
- package/lib/module/ui/components/bubble/Bubble.js +78 -0
- package/lib/module/ui/components/bubble/Bubble.js.map +1 -0
- package/lib/module/ui/components/details/DetailsViewer.js +28 -0
- package/lib/module/ui/components/details/DetailsViewer.js.map +1 -0
- package/lib/module/ui/components/details/LogMessageDetails.js +26 -0
- package/lib/module/ui/components/details/LogMessageDetails.js.map +1 -0
- package/lib/module/ui/components/details/NetworkRequestDetails.js +125 -0
- package/lib/module/ui/components/details/NetworkRequestDetails.js.map +1 -0
- package/lib/module/ui/components/headers/DebuggerHeader.js +89 -0
- package/lib/module/ui/components/headers/DebuggerHeader.js.map +1 -0
- package/lib/module/ui/components/headers/NetworkPanelHeader.js +64 -0
- package/lib/module/ui/components/headers/NetworkPanelHeader.js.map +1 -0
- package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js +60 -0
- package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js.map +1 -0
- package/lib/module/ui/components/index.js +8 -0
- package/lib/module/ui/components/index.js.map +1 -0
- package/lib/module/ui/components/items/ConsolePanelItem.js +31 -0
- package/lib/module/ui/components/items/ConsolePanelItem.js.map +1 -0
- package/lib/module/ui/components/items/DebuggerHeaderItem.js +50 -0
- package/lib/module/ui/components/items/DebuggerHeaderItem.js.map +1 -0
- package/lib/module/ui/components/items/NetworkPanelItem.js +72 -0
- package/lib/module/ui/components/items/NetworkPanelItem.js.map +1 -0
- package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js +43 -0
- package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js.map +1 -0
- package/lib/module/ui/components/items/NetworkRequestDetailsItem.js +37 -0
- package/lib/module/ui/components/items/NetworkRequestDetailsItem.js.map +1 -0
- package/lib/module/ui/components/panels/ConsolePanel.js +53 -0
- package/lib/module/ui/components/panels/ConsolePanel.js.map +1 -0
- package/lib/module/ui/components/panels/NetworkPanel.js +61 -0
- package/lib/module/ui/components/panels/NetworkPanel.js.map +1 -0
- package/lib/module/utils.js +35 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/constants.d.ts +2 -0
- package/lib/typescript/commonjs/src/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/contexts/MainContext.d.ts +24 -0
- package/lib/typescript/commonjs/src/contexts/MainContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/contexts/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/contexts/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useConsoleInterceptor.d.ts +13 -0
- package/lib/typescript/commonjs/src/hooks/useConsoleInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useNetworkInterceptor.d.ts +12 -0
- package/lib/typescript/commonjs/src/hooks/useNetworkInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useScrollToBottom.d.ts +3 -0
- package/lib/typescript/commonjs/src/hooks/useScrollToBottom.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/ConsoleInterceptor.d.ts +10 -0
- package/lib/typescript/commonjs/src/interceptors/ConsoleInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/FetchInterceptor.d.ts +8 -0
- package/lib/typescript/commonjs/src/interceptors/FetchInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/HttpInterceptor.d.ts +23 -0
- package/lib/typescript/commonjs/src/interceptors/HttpInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/Interceptor.d.ts +6 -0
- package/lib/typescript/commonjs/src/interceptors/Interceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/NetworkInterceptor.d.ts +6 -0
- package/lib/typescript/commonjs/src/interceptors/NetworkInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/WebSocketInterceptor.d.ts +34 -0
- package/lib/typescript/commonjs/src/interceptors/WebSocketInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/XHRInterceptor.d.ts +8 -0
- package/lib/typescript/commonjs/src/interceptors/XHRInterceptor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/interceptors/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/interceptors/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/common.d.ts +19 -0
- package/lib/typescript/commonjs/src/types/common.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/console.d.ts +5 -0
- package/lib/typescript/commonjs/src/types/console.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/http.d.ts +21 -0
- package/lib/typescript/commonjs/src/types/http.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/websocket.d.ts +29 -0
- package/lib/typescript/commonjs/src/types/websocket.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/Xenon.d.ts +16 -0
- package/lib/typescript/commonjs/src/ui/Xenon.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/bubble/Bubble.d.ts +9 -0
- package/lib/typescript/commonjs/src/ui/components/bubble/Bubble.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/details/DetailsViewer.d.ts +2 -0
- package/lib/typescript/commonjs/src/ui/components/details/DetailsViewer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/details/LogMessageDetails.d.ts +7 -0
- package/lib/typescript/commonjs/src/ui/components/details/LogMessageDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/details/NetworkRequestDetails.d.ts +7 -0
- package/lib/typescript/commonjs/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/headers/DebuggerHeader.d.ts +2 -0
- package/lib/typescript/commonjs/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/headers/NetworkPanelHeader.d.ts +2 -0
- package/lib/typescript/commonjs/src/ui/components/headers/NetworkPanelHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts +13 -0
- package/lib/typescript/commonjs/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/index.d.ts +6 -0
- package/lib/typescript/commonjs/src/ui/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/items/ConsolePanelItem.d.ts +7 -0
- package/lib/typescript/commonjs/src/ui/components/items/ConsolePanelItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/items/DebuggerHeaderItem.d.ts +10 -0
- package/lib/typescript/commonjs/src/ui/components/items/DebuggerHeaderItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/items/NetworkPanelItem.d.ts +10 -0
- package/lib/typescript/commonjs/src/ui/components/items/NetworkPanelItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts +11 -0
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsItem.d.ts +8 -0
- package/lib/typescript/commonjs/src/ui/components/items/NetworkRequestDetailsItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/panels/ConsolePanel.d.ts +2 -0
- package/lib/typescript/commonjs/src/ui/components/panels/ConsolePanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ui/components/panels/NetworkPanel.d.ts +2 -0
- package/lib/typescript/commonjs/src/ui/components/panels/NetworkPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils.d.ts +9 -0
- package/lib/typescript/commonjs/src/utils.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/constants.d.ts +2 -0
- package/lib/typescript/module/src/constants.d.ts.map +1 -0
- package/lib/typescript/module/src/contexts/MainContext.d.ts +24 -0
- package/lib/typescript/module/src/contexts/MainContext.d.ts.map +1 -0
- package/lib/typescript/module/src/contexts/index.d.ts +2 -0
- package/lib/typescript/module/src/contexts/index.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/index.d.ts +4 -0
- package/lib/typescript/module/src/hooks/index.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useConsoleInterceptor.d.ts +13 -0
- package/lib/typescript/module/src/hooks/useConsoleInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useNetworkInterceptor.d.ts +12 -0
- package/lib/typescript/module/src/hooks/useNetworkInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useScrollToBottom.d.ts +3 -0
- package/lib/typescript/module/src/hooks/useScrollToBottom.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +2 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/ConsoleInterceptor.d.ts +10 -0
- package/lib/typescript/module/src/interceptors/ConsoleInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/FetchInterceptor.d.ts +8 -0
- package/lib/typescript/module/src/interceptors/FetchInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/HttpInterceptor.d.ts +23 -0
- package/lib/typescript/module/src/interceptors/HttpInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/Interceptor.d.ts +6 -0
- package/lib/typescript/module/src/interceptors/Interceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/NetworkInterceptor.d.ts +6 -0
- package/lib/typescript/module/src/interceptors/NetworkInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/WebSocketInterceptor.d.ts +34 -0
- package/lib/typescript/module/src/interceptors/WebSocketInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/XHRInterceptor.d.ts +8 -0
- package/lib/typescript/module/src/interceptors/XHRInterceptor.d.ts.map +1 -0
- package/lib/typescript/module/src/interceptors/index.d.ts +5 -0
- package/lib/typescript/module/src/interceptors/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types/common.d.ts +19 -0
- package/lib/typescript/module/src/types/common.d.ts.map +1 -0
- package/lib/typescript/module/src/types/console.d.ts +5 -0
- package/lib/typescript/module/src/types/console.d.ts.map +1 -0
- package/lib/typescript/module/src/types/http.d.ts +21 -0
- package/lib/typescript/module/src/types/http.d.ts.map +1 -0
- package/lib/typescript/module/src/types/index.d.ts +5 -0
- package/lib/typescript/module/src/types/index.d.ts.map +1 -0
- package/lib/typescript/module/src/types/websocket.d.ts +29 -0
- package/lib/typescript/module/src/types/websocket.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/Xenon.d.ts +16 -0
- package/lib/typescript/module/src/ui/Xenon.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/bubble/Bubble.d.ts +9 -0
- package/lib/typescript/module/src/ui/components/bubble/Bubble.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/details/DetailsViewer.d.ts +2 -0
- package/lib/typescript/module/src/ui/components/details/DetailsViewer.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/details/LogMessageDetails.d.ts +7 -0
- package/lib/typescript/module/src/ui/components/details/LogMessageDetails.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/details/NetworkRequestDetails.d.ts +7 -0
- package/lib/typescript/module/src/ui/components/details/NetworkRequestDetails.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/headers/DebuggerHeader.d.ts +2 -0
- package/lib/typescript/module/src/ui/components/headers/DebuggerHeader.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/headers/NetworkPanelHeader.d.ts +2 -0
- package/lib/typescript/module/src/ui/components/headers/NetworkPanelHeader.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts +13 -0
- package/lib/typescript/module/src/ui/components/headers/NetworkRequestDetailsHeader.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/index.d.ts +6 -0
- package/lib/typescript/module/src/ui/components/index.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/items/ConsolePanelItem.d.ts +7 -0
- package/lib/typescript/module/src/ui/components/items/ConsolePanelItem.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/items/DebuggerHeaderItem.d.ts +10 -0
- package/lib/typescript/module/src/ui/components/items/DebuggerHeaderItem.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/items/NetworkPanelItem.d.ts +10 -0
- package/lib/typescript/module/src/ui/components/items/NetworkPanelItem.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts +11 -0
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsHeaderItem.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsItem.d.ts +8 -0
- package/lib/typescript/module/src/ui/components/items/NetworkRequestDetailsItem.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/panels/ConsolePanel.d.ts +2 -0
- package/lib/typescript/module/src/ui/components/panels/ConsolePanel.d.ts.map +1 -0
- package/lib/typescript/module/src/ui/components/panels/NetworkPanel.d.ts +2 -0
- package/lib/typescript/module/src/ui/components/panels/NetworkPanel.d.ts.map +1 -0
- package/lib/typescript/module/src/utils.d.ts +9 -0
- package/lib/typescript/module/src/utils.d.ts.map +1 -0
- package/package.json +219 -0
- package/src/assets/code.png +0 -0
- package/src/assets/delete.png +0 -0
- package/src/assets/hide.png +0 -0
- package/src/assets/move.png +0 -0
- package/src/assets/record.png +0 -0
- package/src/constants.ts +1 -0
- package/src/contexts/MainContext.ts +34 -0
- package/src/contexts/index.ts +1 -0
- package/src/global.d.ts +29 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useConsoleInterceptor.ts +58 -0
- package/src/hooks/useNetworkInterceptor.ts +263 -0
- package/src/hooks/useScrollToBottom.ts +23 -0
- package/src/index.ts +1 -0
- package/src/interceptors/ConsoleInterceptor.ts +115 -0
- package/src/interceptors/FetchInterceptor.ts +134 -0
- package/src/interceptors/HttpInterceptor.ts +65 -0
- package/src/interceptors/Interceptor.ts +6 -0
- package/src/interceptors/NetworkInterceptor.ts +6 -0
- package/src/interceptors/WebSocketInterceptor.ts +189 -0
- package/src/interceptors/XHRInterceptor.ts +97 -0
- package/src/interceptors/index.ts +4 -0
- package/src/types/common.ts +26 -0
- package/src/types/console.ts +4 -0
- package/src/types/http.ts +44 -0
- package/src/types/index.ts +4 -0
- package/src/types/websocket.ts +46 -0
- package/src/ui/Xenon.tsx +149 -0
- package/src/ui/components/bubble/Bubble.tsx +93 -0
- package/src/ui/components/details/DetailsViewer.tsx +20 -0
- package/src/ui/components/details/LogMessageDetails.tsx +26 -0
- package/src/ui/components/details/NetworkRequestDetails.tsx +140 -0
- package/src/ui/components/headers/DebuggerHeader.tsx +112 -0
- package/src/ui/components/headers/NetworkPanelHeader.tsx +58 -0
- package/src/ui/components/headers/NetworkRequestDetailsHeader.tsx +91 -0
- package/src/ui/components/index.ts +5 -0
- package/src/ui/components/items/ConsolePanelItem.tsx +28 -0
- package/src/ui/components/items/DebuggerHeaderItem.tsx +65 -0
- package/src/ui/components/items/NetworkPanelItem.tsx +71 -0
- package/src/ui/components/items/NetworkRequestDetailsHeaderItem.tsx +52 -0
- package/src/ui/components/items/NetworkRequestDetailsItem.tsx +43 -0
- package/src/ui/components/panels/ConsolePanel.tsx +55 -0
- package/src/ui/components/panels/NetworkPanel.tsx +64 -0
- package/src/utils.ts +54 -0
@@ -0,0 +1,144 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { NativeEventEmitter } from 'react-native';
|
4
|
+
import NativeWebSocketModule from 'react-native/Libraries/WebSocket/NativeWebSocketModule';
|
5
|
+
import { NetworkInterceptor } from "./NetworkInterceptor.js";
|
6
|
+
const originalWebSocketConnect = NativeWebSocketModule.connect;
|
7
|
+
const originalWebSocketSend = NativeWebSocketModule.send;
|
8
|
+
const originalWebSocketSendBinary = NativeWebSocketModule.sendBinary;
|
9
|
+
const originalWebSocketClose = NativeWebSocketModule.close;
|
10
|
+
export default class WebSocketInterceptor extends NetworkInterceptor {
|
11
|
+
static instance = new WebSocketInterceptor();
|
12
|
+
constructor() {
|
13
|
+
super();
|
14
|
+
}
|
15
|
+
connectCallback = null;
|
16
|
+
sendCallback = null;
|
17
|
+
closeCallback = null;
|
18
|
+
onOpenCallback = null;
|
19
|
+
onMessageCallback = null;
|
20
|
+
onErrorCallback = null;
|
21
|
+
onCloseCallback = null;
|
22
|
+
setConnectCallback(callback) {
|
23
|
+
this.connectCallback = callback;
|
24
|
+
return this;
|
25
|
+
}
|
26
|
+
setSendCallback(callback) {
|
27
|
+
this.sendCallback = callback;
|
28
|
+
return this;
|
29
|
+
}
|
30
|
+
setCloseCallback(callback) {
|
31
|
+
this.closeCallback = callback;
|
32
|
+
return this;
|
33
|
+
}
|
34
|
+
setOnOpenCallback(callback) {
|
35
|
+
this.onOpenCallback = callback;
|
36
|
+
return this;
|
37
|
+
}
|
38
|
+
setOnMessageCallback(callback) {
|
39
|
+
this.onMessageCallback = callback;
|
40
|
+
return this;
|
41
|
+
}
|
42
|
+
setOnErrorCallback(callback) {
|
43
|
+
this.onErrorCallback = callback;
|
44
|
+
return this;
|
45
|
+
}
|
46
|
+
setOnCloseCallback(callback) {
|
47
|
+
this.onCloseCallback = callback;
|
48
|
+
return this;
|
49
|
+
}
|
50
|
+
getCallbacks() {
|
51
|
+
const connectCallback = this.connectCallback?.bind(this);
|
52
|
+
const sendCallback = this.sendCallback?.bind(this);
|
53
|
+
const closeCallback = this.closeCallback?.bind(this);
|
54
|
+
const arrayBufferToString = this.arrayBufferToString?.bind(this);
|
55
|
+
return {
|
56
|
+
connectCallback,
|
57
|
+
sendCallback,
|
58
|
+
closeCallback,
|
59
|
+
arrayBufferToString
|
60
|
+
};
|
61
|
+
}
|
62
|
+
clearCallbacks() {
|
63
|
+
this.connectCallback = null;
|
64
|
+
this.sendCallback = null;
|
65
|
+
this.closeCallback = null;
|
66
|
+
this.onOpenCallback = null;
|
67
|
+
this.onMessageCallback = null;
|
68
|
+
this.onErrorCallback = null;
|
69
|
+
this.onCloseCallback = null;
|
70
|
+
}
|
71
|
+
eventEmitter = null;
|
72
|
+
subscriptions = [];
|
73
|
+
arrayBufferToString(data) {
|
74
|
+
try {
|
75
|
+
if (!data) return '(no input)';
|
76
|
+
const byteArray = Buffer.from(data, 'base64');
|
77
|
+
if (byteArray.length === 0) return '(empty array)';
|
78
|
+
return `ArrayBuffer { length: ${byteArray.length}, values: [${byteArray.join(', ')}] }`;
|
79
|
+
} catch (error) {
|
80
|
+
return `(invalid data: ${error instanceof Error ? error.message : error})`;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
registerEvents() {
|
84
|
+
if (!this.eventEmitter) return;
|
85
|
+
this.subscriptions = [this.eventEmitter.addListener('websocketOpen', ev => {
|
86
|
+
this.onOpenCallback?.(ev.id);
|
87
|
+
}), this.eventEmitter.addListener('websocketMessage', ev => {
|
88
|
+
this.onMessageCallback?.(ev.id, ev.type === 'binary' ? this.arrayBufferToString(ev.data) : ev.data);
|
89
|
+
}), this.eventEmitter.addListener('websocketClosed', ev => {
|
90
|
+
this.onCloseCallback?.(ev.id, {
|
91
|
+
code: ev.code,
|
92
|
+
reason: ev.reason
|
93
|
+
});
|
94
|
+
}), this.eventEmitter.addListener('websocketFailed', ev => {
|
95
|
+
this.onErrorCallback?.(ev.id, {
|
96
|
+
message: ev.message
|
97
|
+
});
|
98
|
+
})];
|
99
|
+
}
|
100
|
+
unregisterEvents() {
|
101
|
+
this.subscriptions.forEach(e => e.remove());
|
102
|
+
this.subscriptions = [];
|
103
|
+
this.eventEmitter = null;
|
104
|
+
}
|
105
|
+
enableInterception() {
|
106
|
+
if (this.isInterceptorEnabled) return;
|
107
|
+
this.eventEmitter = new NativeEventEmitter(NativeWebSocketModule);
|
108
|
+
this.registerEvents();
|
109
|
+
const {
|
110
|
+
connectCallback,
|
111
|
+
sendCallback,
|
112
|
+
closeCallback,
|
113
|
+
arrayBufferToString
|
114
|
+
} = this.getCallbacks();
|
115
|
+
NativeWebSocketModule.connect = function (...args) {
|
116
|
+
connectCallback?.(...args);
|
117
|
+
originalWebSocketConnect.call(this, ...args);
|
118
|
+
};
|
119
|
+
NativeWebSocketModule.send = function (...args) {
|
120
|
+
sendCallback?.(...args);
|
121
|
+
originalWebSocketSend.call(this, ...args);
|
122
|
+
};
|
123
|
+
NativeWebSocketModule.sendBinary = function (data, socketId) {
|
124
|
+
sendCallback?.(arrayBufferToString(data), socketId);
|
125
|
+
originalWebSocketSendBinary.call(this, data, socketId);
|
126
|
+
};
|
127
|
+
NativeWebSocketModule.close = function (code, reason, socketId) {
|
128
|
+
closeCallback?.(code, reason, socketId);
|
129
|
+
originalWebSocketClose.call(this, code, reason, socketId);
|
130
|
+
};
|
131
|
+
this.isInterceptorEnabled = true;
|
132
|
+
}
|
133
|
+
disableInterception() {
|
134
|
+
if (!this.isInterceptorEnabled) return;
|
135
|
+
this.isInterceptorEnabled = false;
|
136
|
+
NativeWebSocketModule.connect = originalWebSocketConnect;
|
137
|
+
NativeWebSocketModule.send = originalWebSocketSend;
|
138
|
+
NativeWebSocketModule.sendBinary = originalWebSocketSendBinary;
|
139
|
+
NativeWebSocketModule.close = originalWebSocketClose;
|
140
|
+
this.clearCallbacks();
|
141
|
+
this.unregisterEvents();
|
142
|
+
}
|
143
|
+
}
|
144
|
+
//# sourceMappingURL=WebSocketInterceptor.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","NativeWebSocketModule","NetworkInterceptor","originalWebSocketConnect","connect","originalWebSocketSend","send","originalWebSocketSendBinary","sendBinary","originalWebSocketClose","close","WebSocketInterceptor","instance","constructor","connectCallback","sendCallback","closeCallback","onOpenCallback","onMessageCallback","onErrorCallback","onCloseCallback","setConnectCallback","callback","setSendCallback","setCloseCallback","setOnOpenCallback","setOnMessageCallback","setOnErrorCallback","setOnCloseCallback","getCallbacks","bind","arrayBufferToString","clearCallbacks","eventEmitter","subscriptions","data","byteArray","Buffer","from","length","join","error","Error","message","registerEvents","addListener","ev","id","type","code","reason","unregisterEvents","forEach","e","remove","enableInterception","isInterceptorEnabled","args","call","socketId","disableInterception"],"sourceRoot":"../../../src","sources":["interceptors/WebSocketInterceptor.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAkC,cAAc;AAC3E,OAAOC,qBAAqB,MAAM,wDAAwD;AAU1F,SAASC,kBAAkB,QAAQ,yBAAsB;AAEzD,MAAMC,wBAAwB,GAAGF,qBAAqB,CAACG,OAAO;AAC9D,MAAMC,qBAAqB,GAAGJ,qBAAqB,CAACK,IAAI;AACxD,MAAMC,2BAA2B,GAAGN,qBAAqB,CAACO,UAAU;AACpE,MAAMC,sBAAsB,GAAGR,qBAAqB,CAACS,KAAK;AAE1D,eAAe,MAAMC,oBAAoB,SAAST,kBAAkB,CAAC;EACnE,OAAOU,QAAQ,GAAG,IAAID,oBAAoB,CAAC,CAAC;EAEpCE,WAAWA,CAAA,EAAG;IACpB,KAAK,CAAC,CAAC;EACT;EAEQC,eAAe,GAA6B,IAAI;EAChDC,YAAY,GAA0B,IAAI;EAC1CC,aAAa,GAA2B,IAAI;EAC5CC,cAAc,GAA4B,IAAI;EAC9CC,iBAAiB,GAA+B,IAAI;EACpDC,eAAe,GAA6B,IAAI;EAChDC,eAAe,GAA6B,IAAI;EAExDC,kBAAkBA,CAACC,QAAqC,EAAE;IACxD,IAAI,CAACR,eAAe,GAAGQ,QAAQ;IAC/B,OAAO,IAAI;EACb;EAEAC,eAAeA,CAACD,QAAkC,EAAE;IAClD,IAAI,CAACP,YAAY,GAAGO,QAAQ;IAC5B,OAAO,IAAI;EACb;EAEAE,gBAAgBA,CAACF,QAAmC,EAAE;IACpD,IAAI,CAACN,aAAa,GAAGM,QAAQ;IAC7B,OAAO,IAAI;EACb;EAEAG,iBAAiBA,CAACH,QAAoC,EAAE;IACtD,IAAI,CAACL,cAAc,GAAGK,QAAQ;IAC9B,OAAO,IAAI;EACb;EAEAI,oBAAoBA,CAAC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B,CAACiD,IAAI,CAAC,IAAI,EAAET,IAAI,EAAEC,MAAM,EAAES,QAAQ,CAAC;IAC3D,CAAC;IAED,IAAI,CAACH,oBAAoB,GAAG,IAAI;EAClC;EAEAI,mBAAmBA,CAAA,EAAS;IAC1B,IAAI,CAAC,IAAI,CAACJ,oBAAoB,EAAE;IAEhC,IAAI,CAACA,oBAAoB,GAAG,KAAK;IAEjCvD,qBAAqB,CAACG,OAAO,GAAGD,wBAAwB;IACxDF,qBAAqB,CAACK,IAAI,GAAGD,qBAAqB;IAClDJ,qBAAqB,CAACO,UAAU,GAAGD,2BAA2B;IAC9DN,qBAAqB,CAACS,KAAK,GAAGD,sBAAsB;IAEpD,IAAI,CAACuB,cAAc,CAAC,CAAC;IAErB,IAAI,CAACmB,gBAAgB,CAAC,CAAC;EACzB;AACF","ignoreList":[]}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { NetworkType } from "../types/index.js";
|
4
|
+
import { getHttpInterceptorId } from "../utils.js";
|
5
|
+
import HttpInterceptor from "./HttpInterceptor.js";
|
6
|
+
const originalXHROpen = XMLHttpRequest.prototype.open;
|
7
|
+
const originalXHRSend = XMLHttpRequest.prototype.send;
|
8
|
+
const originalXHRSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader;
|
9
|
+
export default class XHRInterceptor extends HttpInterceptor {
|
10
|
+
static instance = new XHRInterceptor();
|
11
|
+
constructor() {
|
12
|
+
super();
|
13
|
+
}
|
14
|
+
enableInterception() {
|
15
|
+
if (this.isInterceptorEnabled) return;
|
16
|
+
const {
|
17
|
+
openCallback,
|
18
|
+
requestHeaderCallback,
|
19
|
+
sendCallback,
|
20
|
+
headerReceivedCallback,
|
21
|
+
responseCallback
|
22
|
+
} = this.getCallbacks();
|
23
|
+
const isInterceptorEnabled = () => this.isInterceptorEnabled;
|
24
|
+
XMLHttpRequest.prototype.open = function (method, url, ...args) {
|
25
|
+
this._interceptionId = getHttpInterceptorId();
|
26
|
+
openCallback?.(this._interceptionId, NetworkType.XHR, method, url);
|
27
|
+
originalXHROpen.call(this, method, url, ...args);
|
28
|
+
};
|
29
|
+
XMLHttpRequest.prototype.setRequestHeader = function (header, value) {
|
30
|
+
requestHeaderCallback?.(this._interceptionId, header, value);
|
31
|
+
originalXHRSetRequestHeader.call(this, header, value);
|
32
|
+
};
|
33
|
+
XMLHttpRequest.prototype.send = function (data) {
|
34
|
+
sendCallback?.(this._interceptionId, data);
|
35
|
+
this.addEventListener?.('readystatechange', () => {
|
36
|
+
if (!isInterceptorEnabled()) return;
|
37
|
+
if (this.readyState === this.HEADERS_RECEIVED) {
|
38
|
+
const contentTypeString = this.getResponseHeader('Content-Type');
|
39
|
+
const contentLengthString = this.getResponseHeader('Content-Length');
|
40
|
+
let responseContentType;
|
41
|
+
let responseSize;
|
42
|
+
if (contentTypeString) responseContentType = contentTypeString.split(';')[0];
|
43
|
+
if (contentLengthString) responseSize = parseInt(contentLengthString, 10);
|
44
|
+
headerReceivedCallback?.(this._interceptionId, responseContentType, responseSize, this.getAllResponseHeaders());
|
45
|
+
}
|
46
|
+
if (this.readyState === this.DONE) {
|
47
|
+
responseCallback?.(this._interceptionId, this.status, this.timeout, this.response, this.responseURL, this.responseType);
|
48
|
+
}
|
49
|
+
});
|
50
|
+
originalXHRSend.call(this, data);
|
51
|
+
};
|
52
|
+
this.isInterceptorEnabled = true;
|
53
|
+
}
|
54
|
+
disableInterception() {
|
55
|
+
if (!this.isInterceptorEnabled) return;
|
56
|
+
this.isInterceptorEnabled = false;
|
57
|
+
XMLHttpRequest.prototype.send = originalXHRSend;
|
58
|
+
XMLHttpRequest.prototype.open = originalXHROpen;
|
59
|
+
XMLHttpRequest.prototype.setRequestHeader = originalXHRSetRequestHeader;
|
60
|
+
this.clearCallbacks();
|
61
|
+
}
|
62
|
+
}
|
63
|
+
//# sourceMappingURL=XHRInterceptor.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["NetworkType","getHttpInterceptorId","HttpInterceptor","originalXHROpen","XMLHttpRequest","prototype","open","originalXHRSend","send","originalXHRSetRequestHeader","setRequestHeader","XHRInterceptor","instance","constructor","enableInterception","isInterceptorEnabled","openCallback","requestHeaderCallback","sendCallback","headerReceivedCallback","responseCallback","getCallbacks","method","url","args","_interceptionId","XHR","call","header","value","data","addEventListener","readyState","HEADERS_RECEIVED","contentTypeString","getResponseHeader","contentLengthString","responseContentType","responseSize","split","parseInt","getAllResponseHeaders","DONE","status","timeout","response","responseURL","responseType","disableInterception","clearCallbacks"],"sourceRoot":"../../../src","sources":["interceptors/XHRInterceptor.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,mBAAU;AACtC,SAASC,oBAAoB,QAAQ,aAAU;AAC/C,OAAOC,eAAe,MAAM,sBAAmB;AAE/C,MAAMC,eAAe,GAAGC,cAAc,CAACC,SAAS,CAACC,IAAI;AACrD,MAAMC,eAAe,GAAGH,cAAc,CAACC,SAAS,CAACG,IAAI;AACrD,MAAMC,2BAA2B,GAAGL,cAAc,CAACC,SAAS,CAACK,gBAAgB;AAE7E,eAAe,MAAMC,cAAc,SAAST,eAAe,CAAC;EAC1D,OAAOU,QAAQ,GAAG,IAAID,cAAc,CAAC,CAAC;EAE9BE,WAAWA,CAAA,EAAG;IACpB,KAAK,CAAC,CAAC;EACT;EAEAC,kBAAkBA,CAAA,EAAG;IACnB,IAAI,IAAI,CAACC,oBAAoB,EAAE;IAE/B,MAAM;MACJC,YAAY;MACZC,qBAAqB;MACrBC,YAAY;MACZC,sBAAsB;MACtBC;IACF,CAAC,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;IAEvB,MAAMN,oBAAoB,GAAGA,CAAA,KAAM,IAAI,CAACA,oBAAoB;IAE5DX,cAAc,CAACC,SAAS,CAACC,IAAI,GAAG,UAAUgB,MAAM,EAAEC,GAAG,EAAE,GAAGC,IAAI,EAAE;MAC9D,IAAI,CAACC,eAAe,GAAGxB,oBAAoB,CAAC,CAAC;MAE7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I,IAAI,CAACT,UAAU,KAAK,IAAI,CAACU,IAAI,EAAE;UACjCtB,gBAAgB,GACd,IAAI,CAACK,eAAe,EACpB,IAAI,CAACkB,MAAM,EACX,IAAI,CAACC,OAAO,EACZ,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,WAAW,EAChB,IAAI,CAACC,YACP,CAAC;QACH;MACF,CAAC,CAAC;MAEFxC,eAAe,CAACoB,IAAI,CAAC,IAAI,EAAEG,IAAI,CAAC;IAClC,CAAC;IAED,IAAI,CAACf,oBAAoB,GAAG,IAAI;EAClC;EAEAiC,mBAAmBA,CAAA,EAAG;IACpB,IAAI,CAAC,IAAI,CAACjC,oBAAoB,EAAE;IAEhC,IAAI,CAACA,oBAAoB,GAAG,KAAK;IAEjCX,cAAc,CAACC,SAAS,CAACG,IAAI,GAAGD,eAAe;IAC/CH,cAAc,CAACC,SAAS,CAACC,IAAI,GAAGH,eAAe;IAC/CC,cAAc,CAACC,SAAS,CAACK,gBAAgB,GAAGD,2BAA2B;IAEvE,IAAI,CAACwC,cAAc,CAAC,CAAC;EACvB;AACF","ignoreList":[]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export { default as ConsoleInterceptor } from "./ConsoleInterceptor.js";
|
4
|
+
export { default as FetchInterceptor } from "./FetchInterceptor.js";
|
5
|
+
export { default as WebSocketInterceptor } from "./WebSocketInterceptor.js";
|
6
|
+
export { default as XHRInterceptor } from "./XHRInterceptor.js";
|
7
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["default","ConsoleInterceptor","FetchInterceptor","WebSocketInterceptor","XHRInterceptor"],"sourceRoot":"../../../src","sources":["interceptors/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,kBAAkB,QAAQ,yBAAsB;AACpE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,uBAAoB;AAChE,SAASF,OAAO,IAAIG,oBAAoB,QAAQ,2BAAwB;AACxE,SAASH,OAAO,IAAII,cAAc,QAAQ,qBAAkB","ignoreList":[]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
export let NetworkType = /*#__PURE__*/function (NetworkType) {
|
4
|
+
NetworkType["XHR"] = "xhr";
|
5
|
+
NetworkType["Fetch"] = "fetch";
|
6
|
+
NetworkType["WS"] = "ws";
|
7
|
+
return NetworkType;
|
8
|
+
}({});
|
9
|
+
export let DebuggerPanel = /*#__PURE__*/function (DebuggerPanel) {
|
10
|
+
DebuggerPanel["Network"] = "network";
|
11
|
+
DebuggerPanel["Console"] = "console";
|
12
|
+
return DebuggerPanel;
|
13
|
+
}({});
|
14
|
+
//# sourceMappingURL=common.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["NetworkType","DebuggerPanel"],"sourceRoot":"../../../src","sources":["types/common.ts"],"mappings":";;AAEA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAMvB,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/console.ts"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/http.ts"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA,cAAc,aAAU;AACxB,cAAc,WAAQ;AACtB,cAAc,cAAW;AACzB,cAAc,gBAAa","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/websocket.ts"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { createRef, useImperativeHandle, useRef, useState } from 'react';
|
4
|
+
import { Animated, SafeAreaView, StyleSheet, useWindowDimensions, View } from 'react-native';
|
5
|
+
import { useConsoleInterceptor, useNetworkInterceptor } from "../hooks/index.js";
|
6
|
+
import { DebuggerPanel } from "../types/index.js";
|
7
|
+
import { Bubble, ConsolePanel, DebuggerHeader, DetailsViewer, NetworkPanel } from "./components/index.js";
|
8
|
+
import MainContext from "../contexts/MainContext.js";
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
+
const rootRef = /*#__PURE__*/createRef();
|
11
|
+
function XenonComponent({
|
12
|
+
autoInspectNetwork = true,
|
13
|
+
autoInspectConsole = true,
|
14
|
+
bubbleSize = 40
|
15
|
+
}) {
|
16
|
+
const {
|
17
|
+
width: screenWidth,
|
18
|
+
height: screenHeight
|
19
|
+
} = useWindowDimensions();
|
20
|
+
const verticalSafeMargin = screenHeight / 8;
|
21
|
+
const pan = useRef(new Animated.ValueXY({
|
22
|
+
x: 0,
|
23
|
+
y: verticalSafeMargin
|
24
|
+
}));
|
25
|
+
const detailsData = useRef(null);
|
26
|
+
const [debuggerVisibility, setDebuggerVisibility] = useState('hidden');
|
27
|
+
const [debuggerPosition, setDebuggerPosition] = useState('bottom');
|
28
|
+
const [panelSelected, setPanelSelected] = useState(DebuggerPanel.Network);
|
29
|
+
const networkInterceptor = useNetworkInterceptor({
|
30
|
+
autoEnabled: autoInspectNetwork
|
31
|
+
});
|
32
|
+
const logInterceptor = useConsoleInterceptor({
|
33
|
+
autoEnabled: autoInspectConsole
|
34
|
+
});
|
35
|
+
useImperativeHandle(rootRef, () => ({
|
36
|
+
show() {
|
37
|
+
setDebuggerVisibility('bubble');
|
38
|
+
},
|
39
|
+
hide() {
|
40
|
+
setDebuggerVisibility('hidden');
|
41
|
+
}
|
42
|
+
}), []);
|
43
|
+
let content;
|
44
|
+
switch (debuggerVisibility) {
|
45
|
+
case 'bubble':
|
46
|
+
content = /*#__PURE__*/_jsx(View, {
|
47
|
+
style: styles.bubbleBackdrop,
|
48
|
+
children: /*#__PURE__*/_jsx(Bubble, {
|
49
|
+
bubbleSize: bubbleSize,
|
50
|
+
pan: pan
|
51
|
+
})
|
52
|
+
});
|
53
|
+
break;
|
54
|
+
case 'panel':
|
55
|
+
content = /*#__PURE__*/_jsxs(SafeAreaView, {
|
56
|
+
style: [styles.container,
|
57
|
+
// eslint-disable-next-line react-native/no-inline-styles
|
58
|
+
{
|
59
|
+
[debuggerPosition]: 0,
|
60
|
+
height: Math.min(screenWidth, screenHeight) * 0.75
|
61
|
+
}],
|
62
|
+
children: [/*#__PURE__*/_jsx(DebuggerHeader, {}), panelSelected === DebuggerPanel.Network && /*#__PURE__*/_jsx(NetworkPanel, {}), panelSelected === DebuggerPanel.Console && /*#__PURE__*/_jsx(ConsolePanel, {}), !panelSelected && !!detailsData.current && /*#__PURE__*/_jsx(DetailsViewer, {})]
|
63
|
+
});
|
64
|
+
break;
|
65
|
+
default:
|
66
|
+
content = null;
|
67
|
+
}
|
68
|
+
return /*#__PURE__*/_jsx(MainContext.Provider, {
|
69
|
+
value: {
|
70
|
+
debuggerVisibility,
|
71
|
+
setDebuggerVisibility,
|
72
|
+
debuggerPosition,
|
73
|
+
setDebuggerPosition,
|
74
|
+
panelSelected,
|
75
|
+
setPanelSelected,
|
76
|
+
networkInterceptor,
|
77
|
+
logInterceptor,
|
78
|
+
detailsData,
|
79
|
+
screenWidth,
|
80
|
+
screenHeight,
|
81
|
+
verticalSafeMargin
|
82
|
+
},
|
83
|
+
children: content
|
84
|
+
});
|
85
|
+
}
|
86
|
+
const styles = StyleSheet.create({
|
87
|
+
container: {
|
88
|
+
flex: 1,
|
89
|
+
...StyleSheet.absoluteFillObject,
|
90
|
+
top: undefined,
|
91
|
+
bottom: undefined,
|
92
|
+
zIndex: 9999,
|
93
|
+
backgroundColor: '#AAAAAA'
|
94
|
+
},
|
95
|
+
bubbleBackdrop: {
|
96
|
+
flex: 1,
|
97
|
+
...StyleSheet.absoluteFillObject,
|
98
|
+
pointerEvents: 'box-none'
|
99
|
+
}
|
100
|
+
});
|
101
|
+
XenonComponent.displayName = 'Xenon';
|
102
|
+
const Xenon = {
|
103
|
+
show() {
|
104
|
+
rootRef.current?.show();
|
105
|
+
},
|
106
|
+
hide() {
|
107
|
+
rootRef.current?.hide();
|
108
|
+
},
|
109
|
+
Component: XenonComponent
|
110
|
+
};
|
111
|
+
export default Xenon;
|
112
|
+
//# sourceMappingURL=Xenon.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createRef","useImperativeHandle","useRef","useState","Animated","SafeAreaView","StyleSheet","useWindowDimensions","View","useConsoleInterceptor","useNetworkInterceptor","DebuggerPanel","Bubble","ConsolePanel","DebuggerHeader","DetailsViewer","NetworkPanel","MainContext","jsx","_jsx","jsxs","_jsxs","rootRef","XenonComponent","autoInspectNetwork","autoInspectConsole","bubbleSize","width","screenWidth","height","screenHeight","verticalSafeMargin","pan","ValueXY","x","y","detailsData","debuggerVisibility","setDebuggerVisibility","debuggerPosition","setDebuggerPosition","panelSelected","setPanelSelected","Network","networkInterceptor","autoEnabled","logInterceptor","show","hide","content","style","styles","bubbleBackdrop","children","container","Math","min","Console","current","Provider","value","create","flex","absoluteFillObject","top","undefined","bottom","zIndex","backgroundColor","pointerEvents","displayName","Xenon","Component"],"sourceRoot":"../../../src","sources":["ui/Xenon.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,mBAAmB,EAAEC,MAAM,EAAEC,QAAQ,QAAkB,OAAO;AAClF,SAASC,QAAQ,EAAEC,YAAY,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAC5F,SAASC,qBAAqB,EAAEC,qBAAqB,QAAQ,mBAAU;AACvE,SAASC,aAAa,QAAwD,mBAAU;AACxF,SAASC,MAAM,EAAEC,YAAY,EAAEC,cAA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B;AAEA,MAAME,MAAM,GAAG7C,UAAU,CAACuD,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,IAAI,EAAE,CAAC;IACP,GAAGxD,UAAU,CAACyD,kBAAkB;IAChCC,GAAG,EAAEC,SAAS;IACdC,MAAM,EAAED,SAAS;IACjBE,MAAM,EAAE,IAAI;IACZC,eAAe,EAAE;EACnB,CAAC;EACDhB,cAAc,EAAE;IACdU,IAAI,EAAE,CAAC;IACP,GAAGxD,UAAU,CAACyD,kBAAkB;IAChCM,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAEF9C,cAAc,CAAC+C,WAAW,GAAG,OAAO;AAEpC,MAAMC,KAAuB,GAAG;EAC9BxB,IAAIA,CAAA,EAAG;IACLzB,OAAO,CAACoC,OAAO,EAAEX,IAAI,CAAC,CAAC;EACzB,CAAC;EACDC,IAAIA,CAAA,EAAG;IACL1B,OAAO,CAACoC,OAAO,EAAEV,IAAI,CAAC,CAAC;EACzB,CAAC;EACDwB,SAAS,EAAEjD;AACb,CAAC;AAED,eAAegD,KAAK","ignoreList":[]}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { useContext, useMemo } from 'react';
|
4
|
+
import { Animated, Image, PanResponder, StyleSheet } from 'react-native';
|
5
|
+
import { MainContext } from "../../../contexts/index.js";
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
export default function Bubble({
|
8
|
+
bubbleSize,
|
9
|
+
pan
|
10
|
+
}) {
|
11
|
+
const {
|
12
|
+
setDebuggerVisibility,
|
13
|
+
screenWidth,
|
14
|
+
screenHeight,
|
15
|
+
verticalSafeMargin
|
16
|
+
} = useContext(MainContext);
|
17
|
+
const panResponder = useMemo(() => PanResponder.create({
|
18
|
+
onStartShouldSetPanResponder: () => true,
|
19
|
+
onMoveShouldSetPanResponder: () => true,
|
20
|
+
onPanResponderGrant: () => {
|
21
|
+
pan.current.setOffset({
|
22
|
+
// @ts-ignore
|
23
|
+
x: pan.current.x._value,
|
24
|
+
// @ts-ignore
|
25
|
+
y: pan.current.y._value
|
26
|
+
});
|
27
|
+
pan.current.setValue({
|
28
|
+
x: 0,
|
29
|
+
y: 0
|
30
|
+
});
|
31
|
+
},
|
32
|
+
onPanResponderMove: Animated.event([null, {
|
33
|
+
dx: pan.current.x,
|
34
|
+
dy: pan.current.y
|
35
|
+
}], {
|
36
|
+
useNativeDriver: false
|
37
|
+
}),
|
38
|
+
onPanResponderRelease: (_, gesture) => {
|
39
|
+
const isTapGesture = gesture.dx > -10 && gesture.dx < 10 && gesture.dy > -10 && gesture.dy < 10;
|
40
|
+
if (isTapGesture) setDebuggerVisibility('panel');
|
41
|
+
pan.current.flattenOffset();
|
42
|
+
const finalX = gesture.moveX < (screenWidth - bubbleSize) / 2 ? 0 : screenWidth - bubbleSize;
|
43
|
+
const finalY = Math.min(Math.max(verticalSafeMargin, gesture.moveY), screenHeight - verticalSafeMargin - bubbleSize);
|
44
|
+
Animated.spring(pan.current, {
|
45
|
+
toValue: {
|
46
|
+
x: finalX,
|
47
|
+
y: finalY
|
48
|
+
},
|
49
|
+
useNativeDriver: false
|
50
|
+
}).start();
|
51
|
+
}
|
52
|
+
}), [bubbleSize, pan, screenHeight, screenWidth, setDebuggerVisibility, verticalSafeMargin]);
|
53
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
54
|
+
...panResponder.panHandlers,
|
55
|
+
style: [styles.bubble, {
|
56
|
+
width: bubbleSize,
|
57
|
+
height: bubbleSize,
|
58
|
+
borderRadius: bubbleSize / 2,
|
59
|
+
transform: pan.current.getTranslateTransform()
|
60
|
+
}],
|
61
|
+
children: /*#__PURE__*/_jsx(Image, {
|
62
|
+
source: require('../../../assets/code.png'),
|
63
|
+
style: {
|
64
|
+
width: bubbleSize * 0.75,
|
65
|
+
height: bubbleSize * 0.75
|
66
|
+
}
|
67
|
+
})
|
68
|
+
});
|
69
|
+
}
|
70
|
+
const styles = StyleSheet.create({
|
71
|
+
bubble: {
|
72
|
+
backgroundColor: '#AAAAAA',
|
73
|
+
position: 'absolute',
|
74
|
+
justifyContent: 'center',
|
75
|
+
alignItems: 'center'
|
76
|
+
}
|
77
|
+
});
|
78
|
+
//# sourceMappingURL=Bubble.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useContext","useMemo","Animated","Image","PanResponder","StyleSheet","MainContext","jsx","_jsx","Bubble","bubbleSize","pan","setDebuggerVisibility","screenWidth","screenHeight","verticalSafeMargin","panResponder","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","onPanResponderGrant","current","setOffset","x","_value","y","setValue","onPanResponderMove","event","dx","dy","useNativeDriver","onPanResponderRelease","_","gesture","isTapGesture","flattenOffset","finalX","moveX","finalY","Math","min","max","moveY","spring","toValue","start","View","panHandlers","style","styles","bubble","width","height","borderRadius","transform","getTranslateTransform","children","source","require","backgroundColor","position","justifyContent","alignItems"],"sourceRoot":"../../../../../src","sources":["ui/components/bubble/Bubble.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,OAAO,QAA+B,OAAO;AAClE,SACEC,QAAQ,EACRC,KAAK,EACLC,YAAY,EACZC,UAAU,QAEL,cAAc;AACrB,SAASC,WAAW,QAAQ,4BAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOhD,eAAe,SAASC,MAAMA,CAAC;EAAEC,UAAU;EAAEC;AAAiB,CAAC,EAAE;EAC/D,MAAM;IAAEC,qBAAqB;IAAEC,WAAW;IAAEC,YAAY;IAAEC;EAAmB,CAAC,GAC5Ef,UAAU,CAACM,WAAW,CAAE;EAE1B,MAAMU,YAAY,GAAGf,OAAO,CAC1B,MACEG,YAAY,CAACa,MAAM,CAAC;IAClBC,4BAA4B,EAAEA,CAAA,KAAM,IAAI;IACxCC,2BAA2B,EAAEA,CAAA,KAAM,IAAI;IACvCC,mBAAmB,EAAEA,CAAA,KAAM;MACzBT,GAAG,CAACU,OAAO,CAACC,SAAS,CAAC;QACpB;QACAC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;UAAEZ,CAAC,EAAEc;QAAO,CAAC;QACjCR,eAAe,EAAE;MACnB,CAAC,CAAC,CAACe,KAAK,CAAC,CAAC;IACZ;EACF,CAAC,CAAC,EACJ,CAACpC,UAAU,EAAEC,GAAG,EAAEG,YAAY,EAAED,WAAW,EAAED,qBAAqB,EAAEG,kBAAkB,CACxF,CAAC;EAED,oBACEP,IAAA,CAACN,QAAQ,CAAC6C,IAAI;IAAA,GACR/B,YAAY,CAACgC,WAAW;IAC5BC,KAAK,EAAE,CACLC,MAAM,CAACC,MAAM,EACb;MACEC,KAAK,EAAE1C,UAAU;MACjB2C,MAAM,EAAE3C,UAAU;MAClB4C,YAAY,EAAE5C,UAAU,GAAG,CAAC;MAC5B6C,SAAS,EAAE5C,GAAG,CAACU,OAAO,CAACmC,qBAAqB,CAAC;IAC/C,CAAC,CACD;IAAAC,QAAA,eAEFjD,IAAA,CAACL,KAAK;MACJuD,MAAM,EAAEC,OAAO,CAAC,0BAA0B,CAAE;MAC5CV,KAAK,EAAE;QACLG,KAAK,EAAE1C,UAAU,GAAG,IAAI;QACxB2C,MAAM,EAAE3C,UAAU,GAAG;MACvB;IAAE,CACH;EAAC,CACW,CAAC;AAEpB;AAEA,MAAMwC,MAAM,GAAG7C,UAAU,CAACY,MAAM,CAAC;EAC/BkC,MAAM,EAAE;IACNS,eAAe,EAAE,SAAS;IAC1BC,QAAQ,EAAE,UAAU;IACpBC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { useContext } from 'react';
|
4
|
+
import { MainContext } from "../../../contexts/index.js";
|
5
|
+
import { DebuggerPanel } from "../../../types/index.js";
|
6
|
+
import LogMessageDetails from "./LogMessageDetails.js";
|
7
|
+
import NetworkRequestDetails from "./NetworkRequestDetails.js";
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
+
export default function DetailsViewer() {
|
10
|
+
const {
|
11
|
+
detailsData
|
12
|
+
} = useContext(MainContext);
|
13
|
+
switch (true) {
|
14
|
+
case !detailsData.current:
|
15
|
+
return null;
|
16
|
+
case DebuggerPanel.Network in detailsData.current:
|
17
|
+
return /*#__PURE__*/_jsx(NetworkRequestDetails, {
|
18
|
+
item: detailsData.current.network
|
19
|
+
});
|
20
|
+
case DebuggerPanel.Console in detailsData.current:
|
21
|
+
return /*#__PURE__*/_jsx(LogMessageDetails, {
|
22
|
+
item: detailsData.current.console
|
23
|
+
});
|
24
|
+
default:
|
25
|
+
return null;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
//# sourceMappingURL=DetailsViewer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["useContext","MainContext","DebuggerPanel","LogMessageDetails","NetworkRequestDetails","jsx","_jsx","DetailsViewer","detailsData","current","Network","item","network","Console","console"],"sourceRoot":"../../../../../src","sources":["ui/components/details/DetailsViewer.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,WAAW,QAAQ,4BAAmB;AAC/C,SAASC,aAAa,QAAQ,yBAAgB;AAC9C,OAAOC,iBAAiB,MAAM,wBAAqB;AACnD,OAAOC,qBAAqB,MAAM,4BAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,eAAe,SAASC,aAAaA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAY,CAAC,GAAGR,UAAU,CAACC,WAAW,CAAE;EAEhD,QAAQ,IAAI;IACV,KAAK,CAACO,WAAW,CAACC,OAAO;MACvB,OAAO,IAAI;IACb,KAAKP,aAAa,CAACQ,OAAO,IAAIF,WAAW,CAACC,OAAQ;MAChD,oBAAOH,IAAA,CAACF,qBAAqB;QAACO,IAAI,EAAEH,WAAW,CAACC,OAAO,CAACG;MAAQ,CAAE,CAAC;IACrE,KAAKV,aAAa,CAACW,OAAO,IAAIL,WAAW,CAACC,OAAQ;MAChD,oBAAOH,IAAA,CAACH,iBAAiB;QAACQ,IAAI,EAAEH,WAAW,CAACC,OAAO,CAACK;MAAQ,CAAE,CAAC;IACjE;MACE,OAAO,IAAI;EACf;AACF","ignoreList":[]}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { ScrollView, StyleSheet, Text } from 'react-native';
|
4
|
+
import { formatLogMessage } from "../../../utils.js";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
export default function LogMessageDetails({
|
7
|
+
item
|
8
|
+
}) {
|
9
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
10
|
+
style: styles.container,
|
11
|
+
children: /*#__PURE__*/_jsx(Text, {
|
12
|
+
children: formatLogMessage(item.type, item.values)
|
13
|
+
})
|
14
|
+
});
|
15
|
+
}
|
16
|
+
const styles = StyleSheet.create({
|
17
|
+
container: {
|
18
|
+
flex: 1,
|
19
|
+
paddingHorizontal: 8
|
20
|
+
},
|
21
|
+
divider: {
|
22
|
+
height: 1,
|
23
|
+
backgroundColor: '#888888'
|
24
|
+
}
|
25
|
+
});
|
26
|
+
//# sourceMappingURL=LogMessageDetails.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["ScrollView","StyleSheet","Text","formatLogMessage","jsx","_jsx","LogMessageDetails","item","style","styles","container","children","type","values","create","flex","paddingHorizontal","divider","height","backgroundColor"],"sourceRoot":"../../../../../src","sources":["ui/components/details/LogMessageDetails.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE3D,SAASC,gBAAgB,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMlD,eAAe,SAASC,iBAAiBA,CAAC;EAAEC;AAA6B,CAAC,EAAE;EAC1E,oBACEF,IAAA,CAACL,UAAU;IAACQ,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,eAClCN,IAAA,CAACH,IAAI;MAAAS,QAAA,EAAER,gBAAgB,CAACI,IAAI,CAACK,IAAI,EAAEL,IAAI,CAACM,MAAM;IAAC,CAAO;EAAC,CAC7C,CAAC;AAEjB;AAEA,MAAMJ,MAAM,GAAGR,UAAU,CAACa,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,IAAI,EAAE,CAAC;IACPC,iBAAiB,EAAE;EACrB,CAAC;EACDC,OAAO,EAAE;IACPC,MAAM,EAAE,CAAC;IACTC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|