@rxflow/workflow 0.0.1-alpha.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 +43 -0
- package/cjs/components/CanvasLoading/index.d.ts +14 -0
- package/cjs/components/CanvasLoading/index.d.ts.map +1 -0
- package/cjs/components/CanvasLoading/index.js +51 -0
- package/cjs/components/CanvasLoading/index.less +69 -0
- package/cjs/components/CodeEditor/DebugPanel/index.d.ts +16 -0
- package/cjs/components/CodeEditor/DebugPanel/index.d.ts.map +1 -0
- package/cjs/components/CodeEditor/DebugPanel/index.js +156 -0
- package/cjs/components/CodeEditor/DebugPanel/index.less +56 -0
- package/cjs/components/CodeEditor/FileTree/LibraryIcon.d.ts +11 -0
- package/cjs/components/CodeEditor/FileTree/LibraryIcon.d.ts.map +1 -0
- package/cjs/components/CodeEditor/FileTree/LibraryIcon.js +33 -0
- package/cjs/components/CodeEditor/FileTree/icons/Javascript.d.ts +11 -0
- package/cjs/components/CodeEditor/FileTree/icons/Javascript.d.ts.map +1 -0
- package/cjs/components/CodeEditor/FileTree/icons/Javascript.js +37 -0
- package/cjs/components/CodeEditor/FileTree/icons/Python.d.ts +11 -0
- package/cjs/components/CodeEditor/FileTree/icons/Python.d.ts.map +1 -0
- package/cjs/components/CodeEditor/FileTree/icons/Python.js +37 -0
- package/cjs/components/CodeEditor/FileTree/index.d.ts +9 -0
- package/cjs/components/CodeEditor/FileTree/index.d.ts.map +1 -0
- package/cjs/components/CodeEditor/FileTree/index.js +73 -0
- package/cjs/components/CodeEditor/FileTree/index.less +83 -0
- package/cjs/components/CodeEditor/FileTree/useFileIcon.d.ts +11 -0
- package/cjs/components/CodeEditor/FileTree/useFileIcon.d.ts.map +1 -0
- package/cjs/components/CodeEditor/FileTree/useFileIcon.js +44 -0
- package/cjs/components/CodeEditor/Header/index.d.ts +15 -0
- package/cjs/components/CodeEditor/Header/index.d.ts.map +1 -0
- package/cjs/components/CodeEditor/Header/index.js +51 -0
- package/cjs/components/CodeEditor/Header/style.less +23 -0
- package/cjs/components/CodeEditor/Terminal/XTerm.d.ts +5 -0
- package/cjs/components/CodeEditor/Terminal/XTerm.d.ts.map +1 -0
- package/cjs/components/CodeEditor/Terminal/XTerm.js +54 -0
- package/cjs/components/CodeEditor/Terminal/index.d.ts +15 -0
- package/cjs/components/CodeEditor/Terminal/index.d.ts.map +1 -0
- package/cjs/components/CodeEditor/Terminal/index.js +30 -0
- package/cjs/components/CodeEditor/Terminal/index.less +28 -0
- package/cjs/components/CodeEditor/Terminal/types.d.ts +13 -0
- package/cjs/components/CodeEditor/editors/JSON.d.ts +12 -0
- package/cjs/components/CodeEditor/editors/JSON.d.ts.map +1 -0
- package/cjs/components/CodeEditor/editors/JSON.js +43 -0
- package/cjs/components/CodeEditor/editors/Python.d.ts +4 -0
- package/cjs/components/CodeEditor/editors/Python.d.ts.map +1 -0
- package/cjs/components/CodeEditor/editors/Python.js +43 -0
- package/cjs/components/CodeEditor/editors/index.less +11 -0
- package/cjs/components/CodeEditor/editors/types.d.ts +24 -0
- package/cjs/components/CodeEditor/index.d.ts +7 -0
- package/cjs/components/CodeEditor/index.d.ts.map +1 -0
- package/cjs/components/CodeEditor/index.js +230 -0
- package/cjs/components/CodeEditor/style.less +49 -0
- package/cjs/components/CodeEditor/types.d.ts +46 -0
- package/cjs/components/Handle/NodePopover.d.ts +15 -0
- package/cjs/components/Handle/NodePopover.d.ts.map +1 -0
- package/cjs/components/Handle/NodePopover.js +169 -0
- package/cjs/components/Handle/index.d.ts +24 -0
- package/cjs/components/Handle/index.d.ts.map +1 -0
- package/cjs/components/Handle/index.js +165 -0
- package/cjs/components/Handle/index.less +111 -0
- package/cjs/components/InlineCodeEditor/index.d.ts +11 -0
- package/cjs/components/InlineCodeEditor/index.d.ts.map +1 -0
- package/cjs/components/InlineCodeEditor/index.js +31 -0
- package/cjs/components/InlineCodeEditor/index.module.less +0 -0
- package/cjs/components/InlineCodeEditor/types.d.ts +22 -0
- package/cjs/components/Layout/index.d.ts +14 -0
- package/cjs/components/Layout/index.d.ts.map +1 -0
- package/cjs/components/Layout/index.js +49 -0
- package/cjs/components/Layout/index.less +14 -0
- package/cjs/components/LoadingButton.d.ts +16 -0
- package/cjs/components/LoadingButton.d.ts.map +1 -0
- package/cjs/components/LoadingButton.js +86 -0
- package/cjs/components/Sider/index.d.ts +15 -0
- package/cjs/components/Sider/index.d.ts.map +1 -0
- package/cjs/components/Sider/index.js +142 -0
- package/cjs/components/Sider/index.less +68 -0
- package/cjs/constants/RunningStatus.d.ts +14 -0
- package/cjs/constants/RunningStatus.d.ts.map +1 -0
- package/cjs/constants/RunningStatus.js +20 -0
- package/cjs/hooks/run/useActiveEdge.d.ts +15 -0
- package/cjs/hooks/run/useActiveEdge.d.ts.map +1 -0
- package/cjs/hooks/run/useActiveEdge.js +36 -0
- package/cjs/hooks/run/useCleanRunState.d.ts +9 -0
- package/cjs/hooks/run/useCleanRunState.d.ts.map +1 -0
- package/cjs/hooks/run/useCleanRunState.js +33 -0
- package/cjs/hooks/run/useNodeRunningState.d.ts +8 -0
- package/cjs/hooks/run/useNodeRunningState.d.ts.map +1 -0
- package/cjs/hooks/run/useNodeRunningState.js +30 -0
- package/cjs/hooks/run/useRunState.d.ts +21 -0
- package/cjs/hooks/run/useRunState.d.ts.map +1 -0
- package/cjs/hooks/run/useRunState.js +39 -0
- package/cjs/hooks/run/useSetRunState.d.ts +18 -0
- package/cjs/hooks/run/useSetRunState.d.ts.map +1 -0
- package/cjs/hooks/run/useSetRunState.js +39 -0
- package/cjs/hooks/state.d.ts +7 -0
- package/cjs/hooks/state.d.ts.map +1 -0
- package/cjs/hooks/state.js +13 -0
- package/cjs/hooks/useDeleteNode.d.ts +2 -0
- package/cjs/hooks/useDeleteNode.d.ts.map +1 -0
- package/cjs/hooks/useDeleteNode.js +32 -0
- package/cjs/hooks/useEdgeIsHover.d.ts +2 -0
- package/cjs/hooks/useEdgeIsHover.d.ts.map +1 -0
- package/cjs/hooks/useEdgeIsHover.js +20 -0
- package/cjs/hooks/useGetSelection.d.ts +13 -0
- package/cjs/hooks/useGetSelection.d.ts.map +1 -0
- package/cjs/hooks/useGetSelection.js +28 -0
- package/cjs/hooks/useGetUpstreamNodes.d.ts +14 -0
- package/cjs/hooks/useGetUpstreamNodes.d.ts.map +1 -0
- package/cjs/hooks/useGetUpstreamNodes.js +81 -0
- package/cjs/hooks/useGetWillDropTarget.d.ts +5 -0
- package/cjs/hooks/useGetWillDropTarget.d.ts.map +1 -0
- package/cjs/hooks/useGetWillDropTarget.js +27 -0
- package/cjs/hooks/useGroupIsWillDrop.d.ts +2 -0
- package/cjs/hooks/useGroupIsWillDrop.d.ts.map +1 -0
- package/cjs/hooks/useGroupIsWillDrop.js +20 -0
- package/cjs/hooks/useIsValidConnection.d.ts +12 -0
- package/cjs/hooks/useIsValidConnection.d.ts.map +1 -0
- package/cjs/hooks/useIsValidConnection.js +83 -0
- package/cjs/hooks/useMouseEvents.d.ts +19 -0
- package/cjs/hooks/useMouseEvents.d.ts.map +1 -0
- package/cjs/hooks/useMouseEvents.js +49 -0
- package/cjs/hooks/useNodeDragHandles.d.ts +10 -0
- package/cjs/hooks/useNodeDragHandles.d.ts.map +1 -0
- package/cjs/hooks/useNodeDragHandles.js +273 -0
- package/cjs/hooks/useNodes.d.ts +9 -0
- package/cjs/hooks/useNodes.d.ts.map +1 -0
- package/cjs/hooks/useNodes.js +19 -0
- package/cjs/hooks/useOnBeforeDelete.d.ts +19 -0
- package/cjs/hooks/useOnBeforeDelete.d.ts.map +1 -0
- package/cjs/hooks/useOnBeforeDelete.js +104 -0
- package/cjs/hooks/useOnConnect.d.ts +12 -0
- package/cjs/hooks/useOnConnect.d.ts.map +1 -0
- package/cjs/hooks/useOnConnect.js +36 -0
- package/cjs/hooks/useOnEdgeMouseEnter.d.ts +13 -0
- package/cjs/hooks/useOnEdgeMouseEnter.d.ts.map +1 -0
- package/cjs/hooks/useOnEdgeMouseEnter.js +27 -0
- package/cjs/hooks/useOnEdgeMouseLeave.d.ts +13 -0
- package/cjs/hooks/useOnEdgeMouseLeave.d.ts.map +1 -0
- package/cjs/hooks/useOnEdgeMouseLeave.js +27 -0
- package/cjs/hooks/useOnNodesChange.d.ts +4 -0
- package/cjs/hooks/useOnNodesChange.d.ts.map +1 -0
- package/cjs/hooks/useOnNodesChange.js +102 -0
- package/cjs/hooks/useOnSelectionChange.d.ts +13 -0
- package/cjs/hooks/useOnSelectionChange.d.ts.map +1 -0
- package/cjs/hooks/useOnSelectionChange.js +130 -0
- package/cjs/hooks/useSetEdges.d.ts +12 -0
- package/cjs/hooks/useSetEdges.d.ts.map +1 -0
- package/cjs/hooks/useSetEdges.js +29 -0
- package/cjs/hooks/useSetSelection.d.ts +3 -0
- package/cjs/hooks/useSetSelection.d.ts.map +1 -0
- package/cjs/hooks/useSetSelection.js +40 -0
- package/cjs/hooks/useSetWillDropTargets.d.ts +2 -0
- package/cjs/hooks/useSetWillDropTargets.d.ts.map +1 -0
- package/cjs/hooks/useSetWillDropTargets.js +26 -0
- package/cjs/hooks/useUpstream.d.ts +3 -0
- package/cjs/hooks/useUpstream.d.ts.map +1 -0
- package/cjs/hooks/useUpstream.js +105 -0
- package/cjs/hooks/useWatchSelectionNodes.d.ts +2 -0
- package/cjs/hooks/useWatchSelectionNodes.d.ts.map +1 -0
- package/cjs/hooks/useWatchSelectionNodes.js +22 -0
- package/cjs/hooks/useWorkFlow.d.ts +12 -0
- package/cjs/hooks/useWorkFlow.d.ts.map +1 -0
- package/cjs/hooks/useWorkFlow.js +93 -0
- package/cjs/hooks/useWorkFlowProps.d.ts +485 -0
- package/cjs/hooks/useWorkFlowProps.d.ts.map +1 -0
- package/cjs/hooks/useWorkFlowProps.js +98 -0
- package/cjs/index.d.ts +23 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js +77 -0
- package/cjs/types.d.ts +103 -0
- package/cjs/types.d.ts.map +1 -0
- package/cjs/types.js +8 -0
- package/cjs/utils/arrayUtils.d.ts +2 -0
- package/cjs/utils/arrayUtils.d.ts.map +1 -0
- package/cjs/utils/arrayUtils.js +23 -0
- package/cjs/utils/checkChildren.d.ts +11 -0
- package/cjs/utils/checkChildren.d.ts.map +1 -0
- package/cjs/utils/checkChildren.js +27 -0
- package/cjs/utils/dimensions.d.ts +12 -0
- package/cjs/utils/dimensions.d.ts.map +1 -0
- package/cjs/utils/dimensions.js +23 -0
- package/cjs/utils/dragDataTransfer.d.ts +19 -0
- package/cjs/utils/dragDataTransfer.d.ts.map +1 -0
- package/cjs/utils/dragDataTransfer.js +29 -0
- package/cjs/utils/dropTargetsCheck.d.ts +20 -0
- package/cjs/utils/dropTargetsCheck.d.ts.map +1 -0
- package/cjs/utils/dropTargetsCheck.js +105 -0
- package/cjs/utils/edgeEqualConnect.d.ts +11 -0
- package/cjs/utils/edgeEqualConnect.d.ts.map +1 -0
- package/cjs/utils/edgeEqualConnect.js +19 -0
- package/cjs/utils/events.d.ts +11 -0
- package/cjs/utils/events.d.ts.map +1 -0
- package/cjs/utils/events.js +19 -0
- package/cjs/utils/getEdgeId.d.ts +12 -0
- package/cjs/utils/getEdgeId.d.ts.map +1 -0
- package/cjs/utils/getEdgeId.js +22 -0
- package/cjs/utils/getParentFlow.d.ts +5 -0
- package/cjs/utils/getParentFlow.d.ts.map +1 -0
- package/cjs/utils/getParentFlow.js +36 -0
- package/cjs/utils/graph.d.ts +12 -0
- package/cjs/utils/graph.d.ts.map +1 -0
- package/cjs/utils/graph.js +55 -0
- package/cjs/utils/index.d.ts +18 -0
- package/cjs/utils/index.d.ts.map +1 -0
- package/cjs/utils/index.js +104 -0
- package/cjs/utils/isInSameParent.d.ts +11 -0
- package/cjs/utils/isInSameParent.d.ts.map +1 -0
- package/cjs/utils/isInSameParent.js +19 -0
- package/cjs/utils/parent.d.ts +23 -0
- package/cjs/utils/parent.d.ts.map +1 -0
- package/cjs/utils/parent.js +166 -0
- package/cjs/utils/position.d.ts +29 -0
- package/cjs/utils/position.d.ts.map +1 -0
- package/cjs/utils/position.js +67 -0
- package/cjs/utils/prepareInnerLookup.d.ts +16 -0
- package/cjs/utils/prepareInnerLookup.d.ts.map +1 -0
- package/cjs/utils/prepareInnerLookup.js +93 -0
- package/cjs/utils/scheduleCallback.d.ts +2 -0
- package/cjs/utils/scheduleCallback.d.ts.map +1 -0
- package/cjs/utils/scheduleCallback.js +38 -0
- package/cjs/utils/serialize.d.ts +31 -0
- package/cjs/utils/serialize.d.ts.map +1 -0
- package/cjs/utils/serialize.js +60 -0
- package/cjs/utils/triggerConnect.d.ts +12 -0
- package/cjs/utils/triggerConnect.d.ts.map +1 -0
- package/cjs/utils/triggerConnect.js +50 -0
- package/esm/components/CanvasLoading/index.d.ts +14 -0
- package/esm/components/CanvasLoading/index.d.ts.map +1 -0
- package/esm/components/CanvasLoading/index.js +45 -0
- package/esm/components/CanvasLoading/index.less +69 -0
- package/esm/components/CodeEditor/DebugPanel/index.d.ts +16 -0
- package/esm/components/CodeEditor/DebugPanel/index.d.ts.map +1 -0
- package/esm/components/CodeEditor/DebugPanel/index.js +199 -0
- package/esm/components/CodeEditor/DebugPanel/index.less +56 -0
- package/esm/components/CodeEditor/FileTree/LibraryIcon.d.ts +11 -0
- package/esm/components/CodeEditor/FileTree/LibraryIcon.d.ts.map +1 -0
- package/esm/components/CodeEditor/FileTree/LibraryIcon.js +27 -0
- package/esm/components/CodeEditor/FileTree/icons/Javascript.d.ts +11 -0
- package/esm/components/CodeEditor/FileTree/icons/Javascript.d.ts.map +1 -0
- package/esm/components/CodeEditor/FileTree/icons/Javascript.js +32 -0
- package/esm/components/CodeEditor/FileTree/icons/Python.d.ts +11 -0
- package/esm/components/CodeEditor/FileTree/icons/Python.d.ts.map +1 -0
- package/esm/components/CodeEditor/FileTree/icons/Python.js +32 -0
- package/esm/components/CodeEditor/FileTree/index.d.ts +9 -0
- package/esm/components/CodeEditor/FileTree/index.d.ts.map +1 -0
- package/esm/components/CodeEditor/FileTree/index.js +62 -0
- package/esm/components/CodeEditor/FileTree/index.less +83 -0
- package/esm/components/CodeEditor/FileTree/useFileIcon.d.ts +11 -0
- package/esm/components/CodeEditor/FileTree/useFileIcon.d.ts.map +1 -0
- package/esm/components/CodeEditor/FileTree/useFileIcon.js +39 -0
- package/esm/components/CodeEditor/Header/index.d.ts +15 -0
- package/esm/components/CodeEditor/Header/index.d.ts.map +1 -0
- package/esm/components/CodeEditor/Header/index.js +43 -0
- package/esm/components/CodeEditor/Header/style.less +23 -0
- package/esm/components/CodeEditor/Terminal/XTerm.d.ts +5 -0
- package/esm/components/CodeEditor/Terminal/XTerm.d.ts.map +1 -0
- package/esm/components/CodeEditor/Terminal/XTerm.js +59 -0
- package/esm/components/CodeEditor/Terminal/index.d.ts +15 -0
- package/esm/components/CodeEditor/Terminal/index.d.ts.map +1 -0
- package/esm/components/CodeEditor/Terminal/index.js +23 -0
- package/esm/components/CodeEditor/Terminal/index.less +28 -0
- package/esm/components/CodeEditor/Terminal/types.d.ts +13 -0
- package/esm/components/CodeEditor/editors/JSON.d.ts +12 -0
- package/esm/components/CodeEditor/editors/JSON.d.ts.map +1 -0
- package/esm/components/CodeEditor/editors/JSON.js +35 -0
- package/esm/components/CodeEditor/editors/Python.d.ts +4 -0
- package/esm/components/CodeEditor/editors/Python.d.ts.map +1 -0
- package/esm/components/CodeEditor/editors/Python.js +34 -0
- package/esm/components/CodeEditor/editors/index.less +11 -0
- package/esm/components/CodeEditor/editors/types.d.ts +24 -0
- package/esm/components/CodeEditor/index.d.ts +7 -0
- package/esm/components/CodeEditor/index.d.ts.map +1 -0
- package/esm/components/CodeEditor/index.js +233 -0
- package/esm/components/CodeEditor/style.less +49 -0
- package/esm/components/CodeEditor/types.d.ts +46 -0
- package/esm/components/Handle/NodePopover.d.ts +15 -0
- package/esm/components/Handle/NodePopover.d.ts.map +1 -0
- package/esm/components/Handle/NodePopover.js +165 -0
- package/esm/components/Handle/index.d.ts +24 -0
- package/esm/components/Handle/index.d.ts.map +1 -0
- package/esm/components/Handle/index.js +190 -0
- package/esm/components/Handle/index.less +111 -0
- package/esm/components/InlineCodeEditor/index.d.ts +11 -0
- package/esm/components/InlineCodeEditor/index.d.ts.map +1 -0
- package/esm/components/InlineCodeEditor/index.js +24 -0
- package/esm/components/InlineCodeEditor/index.module.less +0 -0
- package/esm/components/InlineCodeEditor/types.d.ts +22 -0
- package/esm/components/Layout/index.d.ts +14 -0
- package/esm/components/Layout/index.d.ts.map +1 -0
- package/esm/components/Layout/index.js +43 -0
- package/esm/components/Layout/index.less +14 -0
- package/esm/components/LoadingButton.d.ts +16 -0
- package/esm/components/LoadingButton.d.ts.map +1 -0
- package/esm/components/LoadingButton.js +112 -0
- package/esm/components/Sider/index.d.ts +15 -0
- package/esm/components/Sider/index.d.ts.map +1 -0
- package/esm/components/Sider/index.js +142 -0
- package/esm/components/Sider/index.less +68 -0
- package/esm/constants/RunningStatus.d.ts +14 -0
- package/esm/constants/RunningStatus.d.ts.map +1 -0
- package/esm/constants/RunningStatus.js +15 -0
- package/esm/hooks/run/useActiveEdge.d.ts +15 -0
- package/esm/hooks/run/useActiveEdge.d.ts.map +1 -0
- package/esm/hooks/run/useActiveEdge.js +30 -0
- package/esm/hooks/run/useCleanRunState.d.ts +9 -0
- package/esm/hooks/run/useCleanRunState.d.ts.map +1 -0
- package/esm/hooks/run/useCleanRunState.js +26 -0
- package/esm/hooks/run/useNodeRunningState.d.ts +8 -0
- package/esm/hooks/run/useNodeRunningState.d.ts.map +1 -0
- package/esm/hooks/run/useNodeRunningState.js +26 -0
- package/esm/hooks/run/useRunState.d.ts +21 -0
- package/esm/hooks/run/useRunState.d.ts.map +1 -0
- package/esm/hooks/run/useRunState.js +35 -0
- package/esm/hooks/run/useSetRunState.d.ts +18 -0
- package/esm/hooks/run/useSetRunState.d.ts.map +1 -0
- package/esm/hooks/run/useSetRunState.js +35 -0
- package/esm/hooks/state.d.ts +7 -0
- package/esm/hooks/state.d.ts.map +1 -0
- package/esm/hooks/state.js +6 -0
- package/esm/hooks/useDeleteNode.d.ts +2 -0
- package/esm/hooks/useDeleteNode.d.ts.map +1 -0
- package/esm/hooks/useDeleteNode.js +44 -0
- package/esm/hooks/useEdgeIsHover.d.ts +2 -0
- package/esm/hooks/useEdgeIsHover.d.ts.map +1 -0
- package/esm/hooks/useEdgeIsHover.js +14 -0
- package/esm/hooks/useGetSelection.d.ts +13 -0
- package/esm/hooks/useGetSelection.d.ts.map +1 -0
- package/esm/hooks/useGetSelection.js +21 -0
- package/esm/hooks/useGetUpstreamNodes.d.ts +14 -0
- package/esm/hooks/useGetUpstreamNodes.d.ts.map +1 -0
- package/esm/hooks/useGetUpstreamNodes.js +71 -0
- package/esm/hooks/useGetWillDropTarget.d.ts +5 -0
- package/esm/hooks/useGetWillDropTarget.d.ts.map +1 -0
- package/esm/hooks/useGetWillDropTarget.js +21 -0
- package/esm/hooks/useGroupIsWillDrop.d.ts +2 -0
- package/esm/hooks/useGroupIsWillDrop.d.ts.map +1 -0
- package/esm/hooks/useGroupIsWillDrop.js +14 -0
- package/esm/hooks/useIsValidConnection.d.ts +12 -0
- package/esm/hooks/useIsValidConnection.d.ts.map +1 -0
- package/esm/hooks/useIsValidConnection.js +82 -0
- package/esm/hooks/useMouseEvents.d.ts +19 -0
- package/esm/hooks/useMouseEvents.d.ts.map +1 -0
- package/esm/hooks/useMouseEvents.js +40 -0
- package/esm/hooks/useNodeDragHandles.d.ts +10 -0
- package/esm/hooks/useNodeDragHandles.d.ts.map +1 -0
- package/esm/hooks/useNodeDragHandles.js +311 -0
- package/esm/hooks/useNodes.d.ts +9 -0
- package/esm/hooks/useNodes.d.ts.map +1 -0
- package/esm/hooks/useNodes.js +14 -0
- package/esm/hooks/useOnBeforeDelete.d.ts +19 -0
- package/esm/hooks/useOnBeforeDelete.d.ts.map +1 -0
- package/esm/hooks/useOnBeforeDelete.js +138 -0
- package/esm/hooks/useOnConnect.d.ts +12 -0
- package/esm/hooks/useOnConnect.d.ts.map +1 -0
- package/esm/hooks/useOnConnect.js +26 -0
- package/esm/hooks/useOnEdgeMouseEnter.d.ts +13 -0
- package/esm/hooks/useOnEdgeMouseEnter.d.ts.map +1 -0
- package/esm/hooks/useOnEdgeMouseEnter.js +20 -0
- package/esm/hooks/useOnEdgeMouseLeave.d.ts +13 -0
- package/esm/hooks/useOnEdgeMouseLeave.d.ts.map +1 -0
- package/esm/hooks/useOnEdgeMouseLeave.js +20 -0
- package/esm/hooks/useOnNodesChange.d.ts +4 -0
- package/esm/hooks/useOnNodesChange.d.ts.map +1 -0
- package/esm/hooks/useOnNodesChange.js +107 -0
- package/esm/hooks/useOnSelectionChange.d.ts +13 -0
- package/esm/hooks/useOnSelectionChange.d.ts.map +1 -0
- package/esm/hooks/useOnSelectionChange.js +171 -0
- package/esm/hooks/useSetEdges.d.ts +12 -0
- package/esm/hooks/useSetEdges.d.ts.map +1 -0
- package/esm/hooks/useSetEdges.js +22 -0
- package/esm/hooks/useSetSelection.d.ts +3 -0
- package/esm/hooks/useSetSelection.d.ts.map +1 -0
- package/esm/hooks/useSetSelection.js +33 -0
- package/esm/hooks/useSetWillDropTargets.d.ts +2 -0
- package/esm/hooks/useSetWillDropTargets.d.ts.map +1 -0
- package/esm/hooks/useSetWillDropTargets.js +18 -0
- package/esm/hooks/useUpstream.d.ts +3 -0
- package/esm/hooks/useUpstream.d.ts.map +1 -0
- package/esm/hooks/useUpstream.js +101 -0
- package/esm/hooks/useWatchSelectionNodes.d.ts +2 -0
- package/esm/hooks/useWatchSelectionNodes.d.ts.map +1 -0
- package/esm/hooks/useWatchSelectionNodes.js +14 -0
- package/esm/hooks/useWorkFlow.d.ts +12 -0
- package/esm/hooks/useWorkFlow.d.ts.map +1 -0
- package/esm/hooks/useWorkFlow.js +92 -0
- package/esm/hooks/useWorkFlowProps.d.ts +485 -0
- package/esm/hooks/useWorkFlowProps.d.ts.map +1 -0
- package/esm/hooks/useWorkFlowProps.js +102 -0
- package/esm/index.d.ts +23 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +28 -0
- package/esm/types.d.ts +103 -0
- package/esm/types.d.ts.map +1 -0
- package/esm/types.js +4 -0
- package/esm/utils/arrayUtils.d.ts +2 -0
- package/esm/utils/arrayUtils.d.ts.map +1 -0
- package/esm/utils/arrayUtils.js +16 -0
- package/esm/utils/checkChildren.d.ts +11 -0
- package/esm/utils/checkChildren.d.ts.map +1 -0
- package/esm/utils/checkChildren.js +16 -0
- package/esm/utils/dimensions.d.ts +12 -0
- package/esm/utils/dimensions.d.ts.map +1 -0
- package/esm/utils/dimensions.js +17 -0
- package/esm/utils/dragDataTransfer.d.ts +19 -0
- package/esm/utils/dragDataTransfer.d.ts.map +1 -0
- package/esm/utils/dragDataTransfer.js +21 -0
- package/esm/utils/dropTargetsCheck.d.ts +20 -0
- package/esm/utils/dropTargetsCheck.d.ts.map +1 -0
- package/esm/utils/dropTargetsCheck.js +116 -0
- package/esm/utils/edgeEqualConnect.d.ts +11 -0
- package/esm/utils/edgeEqualConnect.d.ts.map +1 -0
- package/esm/utils/edgeEqualConnect.js +12 -0
- package/esm/utils/events.d.ts +11 -0
- package/esm/utils/events.d.ts.map +1 -0
- package/esm/utils/events.js +12 -0
- package/esm/utils/getEdgeId.d.ts +12 -0
- package/esm/utils/getEdgeId.d.ts.map +1 -0
- package/esm/utils/getEdgeId.js +16 -0
- package/esm/utils/getParentFlow.d.ts +5 -0
- package/esm/utils/getParentFlow.d.ts.map +1 -0
- package/esm/utils/getParentFlow.js +28 -0
- package/esm/utils/graph.d.ts +12 -0
- package/esm/utils/graph.d.ts.map +1 -0
- package/esm/utils/graph.js +51 -0
- package/esm/utils/index.d.ts +18 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/index.js +18 -0
- package/esm/utils/isInSameParent.d.ts +11 -0
- package/esm/utils/isInSameParent.d.ts.map +1 -0
- package/esm/utils/isInSameParent.js +12 -0
- package/esm/utils/parent.d.ts +23 -0
- package/esm/utils/parent.d.ts.map +1 -0
- package/esm/utils/parent.js +186 -0
- package/esm/utils/position.d.ts +29 -0
- package/esm/utils/position.d.ts.map +1 -0
- package/esm/utils/position.js +61 -0
- package/esm/utils/prepareInnerLookup.d.ts +16 -0
- package/esm/utils/prepareInnerLookup.d.ts.map +1 -0
- package/esm/utils/prepareInnerLookup.js +79 -0
- package/esm/utils/scheduleCallback.d.ts +2 -0
- package/esm/utils/scheduleCallback.d.ts.map +1 -0
- package/esm/utils/scheduleCallback.js +36 -0
- package/esm/utils/serialize.d.ts +31 -0
- package/esm/utils/serialize.d.ts.map +1 -0
- package/esm/utils/serialize.js +64 -0
- package/esm/utils/triggerConnect.d.ts +12 -0
- package/esm/utils/triggerConnect.d.ts.map +1 -0
- package/esm/utils/triggerConnect.js +59 -0
- package/package.json +70 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleCallback.d.ts","sourceRoot":"","sources":["scheduleCallback.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _scheduler = require("scheduler");
|
|
4
|
+
/**
|
|
5
|
+
* @author: yanxianliang
|
|
6
|
+
* @date: 2025-08-22 20:55
|
|
7
|
+
* @desc: 延迟优化执行
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// 定义低优先级任务
|
|
13
|
+
const task = () => {
|
|
14
|
+
if ((0, _scheduler.unstable_shouldYield)()) {
|
|
15
|
+
// 检查当前帧是否有剩余时间
|
|
16
|
+
return task; // 无时间则中断,等待下次调度
|
|
17
|
+
}
|
|
18
|
+
console.log("执行非关键任务");
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// function processList(taskQueue) {
|
|
22
|
+
// let index = 0;
|
|
23
|
+
// return function process() {
|
|
24
|
+
// while (index < taskQueue.length) {
|
|
25
|
+
// processItem(taskQueue[index]); // 处理单个项
|
|
26
|
+
// index++;
|
|
27
|
+
// if (unstable_shouldYield()) {
|
|
28
|
+
// return process; // 返回续延函数
|
|
29
|
+
// }
|
|
30
|
+
// }
|
|
31
|
+
// };
|
|
32
|
+
// }
|
|
33
|
+
//
|
|
34
|
+
// // 调度任务
|
|
35
|
+
// const task = processList(data);
|
|
36
|
+
|
|
37
|
+
// 调度任务(优先级为 Idle)
|
|
38
|
+
(0, _scheduler.unstable_scheduleCallback)(_scheduler.unstable_IdlePriority, task); // 最低优先级执行
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-10-08 17:21
|
|
4
|
+
* @modified:2025/10/8 17:21 by yanxianliang
|
|
5
|
+
* @desc: 序列化
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { Edge, InternalNode, Node } from "@xyflow/react";
|
|
10
|
+
import { NodeHandle, NodeLookup, NodeHandleBounds } from "@xyflow/system";
|
|
11
|
+
/**
|
|
12
|
+
* 转换成 存储的结构 并保存
|
|
13
|
+
*/
|
|
14
|
+
export declare const serialize: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(nodeLookup: NodeLookup<InternalNode<NodeType>>, nodes: NodeType[]) => {
|
|
15
|
+
nodes: (NodeType & {
|
|
16
|
+
handles: NodeHandle[] | undefined;
|
|
17
|
+
})[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 转换成内部的 结构 进行初始化
|
|
21
|
+
*/
|
|
22
|
+
export declare const deserialize: <NodeType extends Node = Node, EdgeType extends Edge = Edge>(nodes: Array<Omit<NodeType, 'handles'> & {
|
|
23
|
+
handles?: NodeHandle[] | NodeHandleBounds;
|
|
24
|
+
}>, transform?: (node: Omit<NodeType, 'handles'> & {
|
|
25
|
+
handles?: NodeHandle[] | NodeHandleBounds;
|
|
26
|
+
}) => Omit<NodeType, "handles"> & {
|
|
27
|
+
handles?: NodeHandleBounds | NodeHandle[] | undefined;
|
|
28
|
+
}) => {
|
|
29
|
+
nodes: NodeType[];
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AACvD,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,SAAS,sHAEb,QAAQ,EAAE;;;;CAWlB,CAAA;AAcD;;GAEG;AACH,eAAO,MAAM,WAAW,sEAAuE,MAAM,KAAK,QAAQ,EAAE,SAAS,CAAC,GAAG;IAC/H,OAAO,CAAC,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAC;CAC3C,CAAC,qBAAqB,KAAK,QAAQ,EAAE,SAAS,CAAC,GAAG;IACjD,OAAO,CAAC,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAC;CAC3C;;;;CAWA,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.serialize = exports.deserialize = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-10-08 17:21
|
|
10
|
+
* @modified:2025/10/8 17:21 by yanxianliang
|
|
11
|
+
* @desc: 序列化
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 转换成 存储的结构 并保存
|
|
18
|
+
*/
|
|
19
|
+
const serialize = (nodeLookup, nodes) => {
|
|
20
|
+
return {
|
|
21
|
+
nodes: nodes.map(node => {
|
|
22
|
+
const handleBounds = nodeLookup.get(node.id)?.internals?.handleBounds;
|
|
23
|
+
return {
|
|
24
|
+
...node,
|
|
25
|
+
handles: parseHandles(handleBounds) // 转换成数组格式存储
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.serialize = serialize;
|
|
31
|
+
const parseHandles = handles => {
|
|
32
|
+
if (!handles) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
if (Array.isArray(handles)) {
|
|
36
|
+
return handles;
|
|
37
|
+
}
|
|
38
|
+
const {
|
|
39
|
+
source,
|
|
40
|
+
target
|
|
41
|
+
} = handles;
|
|
42
|
+
return [...(source || []), ...(target || [])];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 转换成内部的 结构 进行初始化
|
|
47
|
+
*/
|
|
48
|
+
const deserialize = (nodes, transform = node => node) => {
|
|
49
|
+
return {
|
|
50
|
+
nodes: nodes.map(node => {
|
|
51
|
+
const _node = transform(node);
|
|
52
|
+
const handles = _node.handles;
|
|
53
|
+
return {
|
|
54
|
+
..._node,
|
|
55
|
+
handles: parseHandles(handles)
|
|
56
|
+
};
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
exports.deserialize = deserialize;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-24 17:27
|
|
4
|
+
* @modified:2025/8/24 17:27 by yanxianliang
|
|
5
|
+
* @desc: 触发 connect 逻辑
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { IWorkflowProps } from "..";
|
|
10
|
+
import { Connection, Edge, EdgeChange } from "@xyflow/react";
|
|
11
|
+
export declare const triggerConnect: <EdgeType extends Edge = Edge>(connection: Connection, hasDefaultEdges: boolean, edges: EdgeType[], triggerEdgeChanges: (changes: EdgeChange<EdgeType>[]) => void, connectionLimit: IWorkflowProps['connectionLimit'], onConnect: IWorkflowProps['onConnect']) => void;
|
|
12
|
+
//# sourceMappingURL=triggerConnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggerConnect.d.ts","sourceRoot":"","sources":["triggerConnect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAA8B,cAAc,EAAC,WAAyB;AAC7E,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAE3D,eAAO,MAAM,cAAc,6CACb,UAAU,mBACL,OAAO,SACjB,QAAQ,EAAE,gCACa,WAAW,QAAQ,CAAC,EAAE,KAAK,IAAI,mBAC5C,cAAc,CAAC,iBAAiB,CAAC,aACvC,cAAc,CAAC,WAAW,CAAC,SAyCvC,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.triggerConnect = void 0;
|
|
7
|
+
var _ = require("./..");
|
|
8
|
+
/**
|
|
9
|
+
* @author: yanxianliang
|
|
10
|
+
* @date: 2025-08-24 17:27
|
|
11
|
+
* @modified:2025/8/24 17:27 by yanxianliang
|
|
12
|
+
* @desc: 触发 connect 逻辑
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const triggerConnect = (connection, hasDefaultEdges, edges, triggerEdgeChanges, connectionLimit, onConnect) => {
|
|
18
|
+
let changes = [];
|
|
19
|
+
const preventConcurrency = connectionLimit?.preventConcurrency;
|
|
20
|
+
// 获取当前 handle 连接的其他线
|
|
21
|
+
if (preventConcurrency) {
|
|
22
|
+
for (const edge of edges) {
|
|
23
|
+
// 当前 handle 上的线
|
|
24
|
+
if (edge.source === connection.source && (edge.sourceHandle === connection.sourceHandle || !edge.sourceHandle && !connection.sourceHandle) && !(0, _.edgeEqualConnect)(edge, connection)) {
|
|
25
|
+
changes.push({
|
|
26
|
+
type: 'remove',
|
|
27
|
+
id: edge.id
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (hasDefaultEdges) {
|
|
33
|
+
if (preventConcurrency) {
|
|
34
|
+
// 内置的状态管理,需要删除之前的边
|
|
35
|
+
triggerEdgeChanges(changes);
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
// 外部状态管理,需要触发新增边 和 删除边操作
|
|
39
|
+
changes.push({
|
|
40
|
+
type: 'add',
|
|
41
|
+
item: {
|
|
42
|
+
...connection,
|
|
43
|
+
id: (0, _.getEdgeId)(connection)
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
triggerEdgeChanges(changes);
|
|
47
|
+
}
|
|
48
|
+
onConnect?.(connection);
|
|
49
|
+
};
|
|
50
|
+
exports.triggerConnect = triggerConnect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface CanvasLoadingProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
tip?: string | null;
|
|
7
|
+
size?: 'small';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 画布加载组件
|
|
11
|
+
*/
|
|
12
|
+
declare const CanvasLoading: import("react").NamedExoticComponent<CanvasLoadingProps>;
|
|
13
|
+
export default CanvasLoading;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAOA,OAAO,cAAc,CAAC;AAItB,OAAO,EAAO,SAAS,EAAC,MAAM,OAAO,CAAC;AAEtC,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,QAAA,MAAM,aAAa,0DAoClB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-05-07 12:35
|
|
4
|
+
* @desc: CanvasLoading
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
7
|
+
*/
|
|
8
|
+
import "./index.less";
|
|
9
|
+
import cat from 'classcat';
|
|
10
|
+
import { isNull } from 'lodash';
|
|
11
|
+
import { memo } from 'react';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* 画布加载组件
|
|
17
|
+
*/
|
|
18
|
+
var CanvasLoading = /*#__PURE__*/memo(function (_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
loading = _ref.loading,
|
|
21
|
+
_ref$tip = _ref.tip,
|
|
22
|
+
tip = _ref$tip === void 0 ? '工作流加载中...' : _ref$tip,
|
|
23
|
+
size = _ref.size;
|
|
24
|
+
var content = /*#__PURE__*/_jsxs("div", {
|
|
25
|
+
className: cat(['flow-canvas-loading-container', 'flow-canvas-loading-center', {
|
|
26
|
+
'flow-canvas-loading-small': size === 'small'
|
|
27
|
+
}]),
|
|
28
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
29
|
+
className: cat(['flow-canvas-loading-center', 'flow-canvas-loading-box']),
|
|
30
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
31
|
+
className: 'flow-canvas-loading-loader'
|
|
32
|
+
})
|
|
33
|
+
}), !isNull(tip) && /*#__PURE__*/_jsx("div", {
|
|
34
|
+
className: 'flow-canvas-loading-tip',
|
|
35
|
+
children: tip
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// 空状态
|
|
40
|
+
if (!children) return content;
|
|
41
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
42
|
+
children: [loading ? content : null, children]
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
export default CanvasLoading;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.flow-canvas-loading {
|
|
2
|
+
&-container {
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
z-index: 100;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
background: rgba(255, 255, 255, 0.5);
|
|
10
|
+
backdrop-filter: blur(20px);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&-center {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-box {
|
|
21
|
+
width: 100px;
|
|
22
|
+
height: 100px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-small &-box {
|
|
26
|
+
width: 20px;
|
|
27
|
+
height: 20px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-small &-loader {
|
|
31
|
+
width: 10px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-loader {
|
|
35
|
+
position: relative;
|
|
36
|
+
width: 20px;
|
|
37
|
+
background: rgba(0, 0, 0, 0.85);
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
|
|
40
|
+
animation: l2 1.5s infinite linear;
|
|
41
|
+
aspect-ratio: 1;
|
|
42
|
+
|
|
43
|
+
&::before,
|
|
44
|
+
&::after {
|
|
45
|
+
position: absolute;
|
|
46
|
+
border-radius: inherit;
|
|
47
|
+
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.2);
|
|
48
|
+
animation: inherit;
|
|
49
|
+
animation-delay: -0.5s;
|
|
50
|
+
content: '';
|
|
51
|
+
inset: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&::after {
|
|
55
|
+
animation-delay: -1s;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@keyframes l2 {
|
|
59
|
+
100% {
|
|
60
|
+
box-shadow: 0 0 0 40px rgba(0, 0, 0, 0);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&-tip {
|
|
66
|
+
margin-top: 12px;
|
|
67
|
+
color: rgba(0, 0, 0, 0.75);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface DebugPanelProps {
|
|
4
|
+
onExecute: (input: Record<string, any>) => Promise<{
|
|
5
|
+
result: any;
|
|
6
|
+
stdout?: string;
|
|
7
|
+
stderr?: string;
|
|
8
|
+
}>;
|
|
9
|
+
onSyncSchema?: (output?: Record<string, any>) => void;
|
|
10
|
+
closeModal?: () => void;
|
|
11
|
+
writeToTerminal?: (data: string) => void;
|
|
12
|
+
defaultInputValue?: Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
export declare const DebugPanel: React.FC<DebugPanelProps>;
|
|
15
|
+
export default DebugPanel;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,OAAO,cAAc,CAAC;AAKtB,UAAU,eAAe;IACvB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC;QACjD,MAAM,EAAE,GAAG,CAAC;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IACtD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACzC;AAID,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6IhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
2
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
12
|
+
import { Button, Space, message, Divider } from 'antd';
|
|
13
|
+
import { PlayCircleOutlined, BugOutlined } from '@ant-design/icons';
|
|
14
|
+
import { JsonEditor } from "../editors/JSON";
|
|
15
|
+
import "./index.less";
|
|
16
|
+
import { useMemoizedFn } from "ahooks";
|
|
17
|
+
import { LoadingButton } from "../../LoadingButton";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
var prefixCls = 'rxflow-debug-panel';
|
|
21
|
+
export var DebugPanel = function DebugPanel(_ref) {
|
|
22
|
+
var onExecute = _ref.onExecute,
|
|
23
|
+
onSyncSchema = _ref.onSyncSchema,
|
|
24
|
+
closeModal = _ref.closeModal,
|
|
25
|
+
writeToTerminal = _ref.writeToTerminal,
|
|
26
|
+
defaultInputValue = _ref.defaultInputValue;
|
|
27
|
+
var _useState = useState(function () {
|
|
28
|
+
return defaultInputValue ? JSON.stringify(defaultInputValue, null, 2) : '{}';
|
|
29
|
+
}),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
inputJson = _useState2[0],
|
|
32
|
+
setInputJson = _useState2[1];
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
setInputJson(defaultInputValue ? JSON.stringify(defaultInputValue, null, 2) : '{}');
|
|
35
|
+
}, [defaultInputValue]);
|
|
36
|
+
var _useState3 = useState(''),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
outputJson = _useState4[0],
|
|
39
|
+
setOutputJson = _useState4[1];
|
|
40
|
+
var _message$useMessage = message.useMessage(),
|
|
41
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
42
|
+
api = _message$useMessage2[0],
|
|
43
|
+
contextHolder = _message$useMessage2[1];
|
|
44
|
+
var handleRun = useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
45
|
+
var parsedInput, _yield$onExecute, result, stdout, stderr, msg;
|
|
46
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
47
|
+
while (1) switch (_context.prev = _context.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
_context.prev = 0;
|
|
50
|
+
_context.prev = 1;
|
|
51
|
+
parsedInput = JSON.parse(inputJson || '');
|
|
52
|
+
_context.next = 9;
|
|
53
|
+
break;
|
|
54
|
+
case 5:
|
|
55
|
+
_context.prev = 5;
|
|
56
|
+
_context.t0 = _context["catch"](1);
|
|
57
|
+
api.error('输入的 JSON 格式不正确');
|
|
58
|
+
return _context.abrupt("return");
|
|
59
|
+
case 9:
|
|
60
|
+
_context.next = 11;
|
|
61
|
+
return onExecute(parsedInput);
|
|
62
|
+
case 11:
|
|
63
|
+
_yield$onExecute = _context.sent;
|
|
64
|
+
result = _yield$onExecute.result;
|
|
65
|
+
stdout = _yield$onExecute.stdout;
|
|
66
|
+
stderr = _yield$onExecute.stderr;
|
|
67
|
+
// 格式化输出结果
|
|
68
|
+
setOutputJson(JSON.stringify(result, null, 2));
|
|
69
|
+
api.success('运行成功, 执行结果请查看终端信息');
|
|
70
|
+
|
|
71
|
+
// stdout 需要输出到终端
|
|
72
|
+
writeToTerminal === null || writeToTerminal === void 0 || writeToTerminal((stdout || stderr || '').replace(/\n/g, '\r\n')); // 对于
|
|
73
|
+
_context.next = 25;
|
|
74
|
+
break;
|
|
75
|
+
case 20:
|
|
76
|
+
_context.prev = 20;
|
|
77
|
+
_context.t1 = _context["catch"](0);
|
|
78
|
+
msg = _typeof(_context.t1) === 'object' && _context.t1 && 'message' in _context.t1 ? _context.t1.message : '未知错误';
|
|
79
|
+
setOutputJson('');
|
|
80
|
+
api.error(msg || '执行失败');
|
|
81
|
+
case 25:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context.stop();
|
|
84
|
+
}
|
|
85
|
+
}, _callee, null, [[0, 20], [1, 5]]);
|
|
86
|
+
})));
|
|
87
|
+
var handleClearOutput = useCallback(function () {
|
|
88
|
+
setOutputJson('');
|
|
89
|
+
}, []);
|
|
90
|
+
var handleFormatInput = useMemoizedFn(function () {
|
|
91
|
+
try {
|
|
92
|
+
var parsed = JSON.parse(inputJson || '');
|
|
93
|
+
setInputJson(JSON.stringify(parsed, null, 2));
|
|
94
|
+
api.success('JSON 格式化完成');
|
|
95
|
+
} catch (error) {
|
|
96
|
+
api.error('JSON 格式不正确,无法格式化');
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
var onSync = useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
100
|
+
var parsedOutput, msg;
|
|
101
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
102
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
_context2.prev = 0;
|
|
105
|
+
parsedOutput = JSON.parse(outputJson || '');
|
|
106
|
+
_context2.next = 8;
|
|
107
|
+
break;
|
|
108
|
+
case 4:
|
|
109
|
+
_context2.prev = 4;
|
|
110
|
+
_context2.t0 = _context2["catch"](0);
|
|
111
|
+
api.error('输出的 JSON 格式不正确');
|
|
112
|
+
return _context2.abrupt("return");
|
|
113
|
+
case 8:
|
|
114
|
+
_context2.prev = 8;
|
|
115
|
+
_context2.next = 11;
|
|
116
|
+
return onSyncSchema === null || onSyncSchema === void 0 ? void 0 : onSyncSchema(parsedOutput);
|
|
117
|
+
case 11:
|
|
118
|
+
closeModal === null || closeModal === void 0 || closeModal();
|
|
119
|
+
_context2.next = 18;
|
|
120
|
+
break;
|
|
121
|
+
case 14:
|
|
122
|
+
_context2.prev = 14;
|
|
123
|
+
_context2.t1 = _context2["catch"](8);
|
|
124
|
+
msg = _typeof(_context2.t1) === 'object' && _context2.t1 && 'message' in _context2.t1 ? _context2.t1.message : '未知错误';
|
|
125
|
+
api.error(msg || '执行失败');
|
|
126
|
+
case 18:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context2.stop();
|
|
129
|
+
}
|
|
130
|
+
}, _callee2, null, [[0, 4], [8, 14]]);
|
|
131
|
+
})));
|
|
132
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
133
|
+
className: prefixCls,
|
|
134
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
135
|
+
className: "".concat(prefixCls, "-header-bar"),
|
|
136
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
137
|
+
children: [/*#__PURE__*/_jsx(BugOutlined, {}), /*#__PURE__*/_jsx("span", {
|
|
138
|
+
children: "\u8C03\u8BD5\u9762\u677F"
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
}), contextHolder, /*#__PURE__*/_jsx("div", {
|
|
142
|
+
className: "".concat(prefixCls, "-body"),
|
|
143
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
144
|
+
direction: 'vertical',
|
|
145
|
+
size: 16,
|
|
146
|
+
className: "".concat(prefixCls, "-content"),
|
|
147
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
148
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
149
|
+
className: "".concat(prefixCls, "-header"),
|
|
150
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
151
|
+
className: "".concat(prefixCls, "-title"),
|
|
152
|
+
children: "\u8F93\u5165 JSON"
|
|
153
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
154
|
+
size: "small",
|
|
155
|
+
onClick: handleFormatInput,
|
|
156
|
+
children: "\u683C\u5F0F\u5316"
|
|
157
|
+
})]
|
|
158
|
+
}), /*#__PURE__*/_jsx(JsonEditor, {
|
|
159
|
+
height: 200,
|
|
160
|
+
value: inputJson,
|
|
161
|
+
onChange: function onChange(value) {
|
|
162
|
+
return setInputJson(value);
|
|
163
|
+
},
|
|
164
|
+
placeholder: "\u8BF7\u8F93\u5165 JSON \u6570\u636E"
|
|
165
|
+
})]
|
|
166
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
167
|
+
children: /*#__PURE__*/_jsxs(Space, {
|
|
168
|
+
children: [/*#__PURE__*/_jsx(LoadingButton, {
|
|
169
|
+
type: "primary",
|
|
170
|
+
icon: /*#__PURE__*/_jsx(PlayCircleOutlined, {}),
|
|
171
|
+
onClick: handleRun,
|
|
172
|
+
children: "\u8FD0\u884C"
|
|
173
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
174
|
+
onClick: handleClearOutput,
|
|
175
|
+
children: "\u6E05\u7A7A\u8F93\u51FA"
|
|
176
|
+
})]
|
|
177
|
+
})
|
|
178
|
+
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsxs("div", {
|
|
179
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
180
|
+
className: "".concat(prefixCls, "-header"),
|
|
181
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
182
|
+
className: "".concat(prefixCls, "-title"),
|
|
183
|
+
children: "\u8F93\u51FA\u7ED3\u679C"
|
|
184
|
+
}), /*#__PURE__*/_jsx(LoadingButton, {
|
|
185
|
+
onClick: onSync,
|
|
186
|
+
children: "\u540C\u6B65\u8F93\u51FA\u5230\u914D\u7F6E"
|
|
187
|
+
})]
|
|
188
|
+
}), /*#__PURE__*/_jsx(JsonEditor, {
|
|
189
|
+
readOnly: true,
|
|
190
|
+
height: 200,
|
|
191
|
+
value: outputJson,
|
|
192
|
+
placeholder: "\u8FD0\u884C\u7ED3\u679C\u5C06\u5728\u8FD9\u91CC\u663E\u793A"
|
|
193
|
+
})]
|
|
194
|
+
})]
|
|
195
|
+
})
|
|
196
|
+
})]
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
export default DebugPanel;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.rxflow-debug {
|
|
2
|
+
&-panel{
|
|
3
|
+
display: flex;
|
|
4
|
+
flex: 1;
|
|
5
|
+
height: 100%;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
color: rgba(255,255,255,0.85);
|
|
8
|
+
background-color: #1f1f1f;
|
|
9
|
+
&-header-bar {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex: 0;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding: 8px 12px;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
border-bottom: 1px solid rgba(253, 253, 253, 0.12);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-body {
|
|
20
|
+
flex: 1;
|
|
21
|
+
min-width: 0;
|
|
22
|
+
min-height: 0;
|
|
23
|
+
padding: 24px;
|
|
24
|
+
overflow: auto;
|
|
25
|
+
scrollbar-width: thin;
|
|
26
|
+
scrollbar-color: #4c4d4f transparent;
|
|
27
|
+
}
|
|
28
|
+
&-content{
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-header {
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
align-items: center;
|
|
36
|
+
margin-bottom: 8px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-title {
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
font-size: 16px;
|
|
42
|
+
margin-bottom: 2px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-24 21:29
|
|
4
|
+
* @modified:2025/7/24 21:29 by yanxianliang
|
|
5
|
+
* @desc: LibraryIcon
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import './index.less';
|
|
10
|
+
export declare const LibraryIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=LibraryIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryIcon.d.ts","sourceRoot":"","sources":["LibraryIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,cAAc,CAAC;AAItB,eAAO,MAAM,WAAW,+CAMhB,CAAA"}
|