@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,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CodeEditor = CodeEditor;
|
|
7
|
+
var _FileTree = require("./FileTree");
|
|
8
|
+
var _Python = require("./editors/Python");
|
|
9
|
+
var _DebugPanel = _interopRequireDefault(require("./DebugPanel"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
var _rcDialog = _interopRequireDefault(require("rc-dialog"));
|
|
13
|
+
require("./style.less");
|
|
14
|
+
var _Header = require("./Header");
|
|
15
|
+
var _classcat = _interopRequireDefault(require("classcat"));
|
|
16
|
+
var _Terminal = require("./Terminal");
|
|
17
|
+
var _ahooks = require("ahooks");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
/**
|
|
21
|
+
* @author: yanxianliang
|
|
22
|
+
* @date: 2025-07-21 10:11
|
|
23
|
+
* @modified:2025/7/21 10:11 by yanxianliang
|
|
24
|
+
* @desc: 代码编辑器(全屏)
|
|
25
|
+
*
|
|
26
|
+
* 左右 Split 布局,使用三方组件实现
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
function CodeEditor({
|
|
32
|
+
onClose,
|
|
33
|
+
files,
|
|
34
|
+
activeFileKey,
|
|
35
|
+
value,
|
|
36
|
+
onChange,
|
|
37
|
+
onActiveFileChange,
|
|
38
|
+
libraries,
|
|
39
|
+
onExecute,
|
|
40
|
+
onSyncSchema,
|
|
41
|
+
defaultInputValue
|
|
42
|
+
}) {
|
|
43
|
+
const [sizes, setSizes] = (0, _react.useState)({
|
|
44
|
+
left: 280,
|
|
45
|
+
// 左侧默认 260,
|
|
46
|
+
main: 0,
|
|
47
|
+
// 中间自动计算剩余部分
|
|
48
|
+
right: 600,
|
|
49
|
+
// 右侧默认 600
|
|
50
|
+
top: 0,
|
|
51
|
+
// 代码区域高度自动计算
|
|
52
|
+
bottom: 200 // 控制台默认 200
|
|
53
|
+
});
|
|
54
|
+
const rightSizeCache = (0, _react.useRef)(sizes.right);
|
|
55
|
+
const containerRef = (0, _react.useRef)(null);
|
|
56
|
+
const containerSizes = (0, _ahooks.useSize)(containerRef);
|
|
57
|
+
(0, _react.useEffect)(() => {
|
|
58
|
+
if (containerSizes) {
|
|
59
|
+
const {
|
|
60
|
+
width,
|
|
61
|
+
height
|
|
62
|
+
} = containerSizes;
|
|
63
|
+
setSizes(beforeSizes => {
|
|
64
|
+
const {
|
|
65
|
+
left,
|
|
66
|
+
right,
|
|
67
|
+
bottom
|
|
68
|
+
} = beforeSizes;
|
|
69
|
+
return {
|
|
70
|
+
left,
|
|
71
|
+
right,
|
|
72
|
+
main: width - left - right,
|
|
73
|
+
bottom,
|
|
74
|
+
top: height - bottom
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}, [containerSizes]);
|
|
79
|
+
const [debug, setDebug] = (0, _react.useState)(true);
|
|
80
|
+
const terminalRef = (0, _react.useRef)(null);
|
|
81
|
+
const toggleDebug = (0, _ahooks.useMemoizedFn)(() => {
|
|
82
|
+
setDebug(debug => !debug);
|
|
83
|
+
const {
|
|
84
|
+
width
|
|
85
|
+
} = containerSizes;
|
|
86
|
+
setSizes(beforeSizes => {
|
|
87
|
+
const {
|
|
88
|
+
left
|
|
89
|
+
} = beforeSizes;
|
|
90
|
+
const right = debug ? 0 : rightSizeCache.current;
|
|
91
|
+
return {
|
|
92
|
+
...beforeSizes,
|
|
93
|
+
right: right,
|
|
94
|
+
main: width - right - left
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
const onResize = (0, _ahooks.useMemoizedFn)(sizes => {
|
|
99
|
+
// 更新到 sizes中
|
|
100
|
+
rightSizeCache.current = sizes[2];
|
|
101
|
+
setSizes(beforeSizes => {
|
|
102
|
+
return {
|
|
103
|
+
...beforeSizes,
|
|
104
|
+
left: sizes[0],
|
|
105
|
+
main: sizes[1],
|
|
106
|
+
right: sizes[2]
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
const onMainResize = (0, _ahooks.useMemoizedFn)(sizes => {
|
|
111
|
+
setSizes(beforeSizes => {
|
|
112
|
+
return {
|
|
113
|
+
...beforeSizes,
|
|
114
|
+
top: sizes[0],
|
|
115
|
+
bottom: sizes[1]
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
const writeToTerminal = (0, _ahooks.useMemoizedFn)(data => {
|
|
120
|
+
terminalRef.current?.clear();
|
|
121
|
+
terminalRef.current?.writeIn(data);
|
|
122
|
+
});
|
|
123
|
+
const hasDebugAction = !!onExecute;
|
|
124
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ConfigProvider, {
|
|
125
|
+
theme: {
|
|
126
|
+
algorithm: _antd.theme.darkAlgorithm,
|
|
127
|
+
components: {
|
|
128
|
+
Tree: {
|
|
129
|
+
indentSize: 12
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
prefixCls: 'rxflow',
|
|
134
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
135
|
+
className: (0, _classcat.default)(['rxflow-editor-dark', 'rxflow-editor']),
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Header.Header, {
|
|
137
|
+
debug: debug,
|
|
138
|
+
onClose: onClose,
|
|
139
|
+
onDebug: hasDebugAction ? toggleDebug : undefined
|
|
140
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
141
|
+
ref: containerRef,
|
|
142
|
+
className: 'rxflow-editor-body',
|
|
143
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Splitter, {
|
|
144
|
+
className: 'rxflow-editor-content',
|
|
145
|
+
onResize: onResize,
|
|
146
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Splitter.Panel, {
|
|
147
|
+
size: sizes.left,
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
149
|
+
className: 'rxflow-editor-left',
|
|
150
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FileTree.FileTree, {
|
|
151
|
+
libraries: libraries,
|
|
152
|
+
files: files,
|
|
153
|
+
value: activeFileKey,
|
|
154
|
+
onChange: onActiveFileChange
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Splitter.Panel, {
|
|
158
|
+
size: sizes.main,
|
|
159
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Splitter, {
|
|
160
|
+
layout: "vertical",
|
|
161
|
+
onResize: onMainResize,
|
|
162
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Splitter.Panel, {
|
|
163
|
+
size: sizes.top,
|
|
164
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Python.PythonEditor, {
|
|
165
|
+
value: value,
|
|
166
|
+
onChange: onChange
|
|
167
|
+
})
|
|
168
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Splitter.Panel, {
|
|
169
|
+
size: sizes.bottom,
|
|
170
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Terminal.Terminal, {
|
|
171
|
+
xTermRef: terminalRef
|
|
172
|
+
})
|
|
173
|
+
})]
|
|
174
|
+
})
|
|
175
|
+
}), hasDebugAction ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Splitter.Panel, {
|
|
176
|
+
size: sizes.right,
|
|
177
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DebugPanel.default, {
|
|
178
|
+
onSyncSchema: onSyncSchema,
|
|
179
|
+
onExecute: onExecute,
|
|
180
|
+
closeModal: onClose,
|
|
181
|
+
writeToTerminal: writeToTerminal,
|
|
182
|
+
defaultInputValue: defaultInputValue
|
|
183
|
+
})
|
|
184
|
+
}) : null]
|
|
185
|
+
})
|
|
186
|
+
})]
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
CodeEditor.Modal = function ({
|
|
191
|
+
onClose,
|
|
192
|
+
open,
|
|
193
|
+
files,
|
|
194
|
+
value,
|
|
195
|
+
onChange,
|
|
196
|
+
zIndex = 100,
|
|
197
|
+
activeFileKey,
|
|
198
|
+
onActiveFileChange,
|
|
199
|
+
libraries,
|
|
200
|
+
onExecute,
|
|
201
|
+
onSyncSchema,
|
|
202
|
+
defaultInputValue
|
|
203
|
+
}) {
|
|
204
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rcDialog.default, {
|
|
205
|
+
classNames: {
|
|
206
|
+
mask: 'rxflow-editor-mask',
|
|
207
|
+
wrapper: 'rxflow-editor-dialog'
|
|
208
|
+
},
|
|
209
|
+
zIndex: zIndex,
|
|
210
|
+
closable: false,
|
|
211
|
+
footer: null,
|
|
212
|
+
visible: open,
|
|
213
|
+
title: null,
|
|
214
|
+
height: '100vh',
|
|
215
|
+
width: '100vw',
|
|
216
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CodeEditor, {
|
|
217
|
+
zIndex: zIndex,
|
|
218
|
+
libraries: libraries,
|
|
219
|
+
activeFileKey: activeFileKey,
|
|
220
|
+
onActiveFileChange: onActiveFileChange,
|
|
221
|
+
value: value,
|
|
222
|
+
onChange: onChange,
|
|
223
|
+
files: files,
|
|
224
|
+
onClose: onClose,
|
|
225
|
+
onExecute: onExecute,
|
|
226
|
+
onSyncSchema: onSyncSchema,
|
|
227
|
+
defaultInputValue: defaultInputValue
|
|
228
|
+
})
|
|
229
|
+
});
|
|
230
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.rxflow {
|
|
2
|
+
&-editor {
|
|
3
|
+
height: 100vh;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
|
|
7
|
+
&-dark {
|
|
8
|
+
background-color: #2d2f32;
|
|
9
|
+
|
|
10
|
+
.cm-theme-dark .cm-editor {
|
|
11
|
+
background-color: #202124;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-body {
|
|
16
|
+
flex: 1;
|
|
17
|
+
height: 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&-content {
|
|
23
|
+
flex: 1;
|
|
24
|
+
height: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-left {
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
overflow: auto;
|
|
31
|
+
scrollbar-width: thin;
|
|
32
|
+
scrollbar-color: #4c4d4f transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&-dialog{
|
|
36
|
+
position: fixed;
|
|
37
|
+
left: 0;
|
|
38
|
+
top: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-mask{
|
|
42
|
+
position: fixed;
|
|
43
|
+
left: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
right: 0;
|
|
46
|
+
top: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-22 16:03
|
|
4
|
+
* @modified:2025/7/22 16:03 by yanxianliang
|
|
5
|
+
* @desc: 类型定义
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
type FileType = {
|
|
11
|
+
title: string;
|
|
12
|
+
key: string;
|
|
13
|
+
isLeaf?: boolean; // 是否是文件
|
|
14
|
+
children?: FileType[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type CodeEditorProps = {
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
files?: FileType[];
|
|
21
|
+
zIndex?: number;
|
|
22
|
+
value?: string;
|
|
23
|
+
onChange?: (code?: string)=>void;
|
|
24
|
+
activeFileKey?: string;
|
|
25
|
+
onActiveFileChange?:(key?: string)=>void;
|
|
26
|
+
libraries?: Library;
|
|
27
|
+
onExecute: (input: Record<string, any>) => Promise<{
|
|
28
|
+
result: any;
|
|
29
|
+
stdout?: string;
|
|
30
|
+
stderr?: string;
|
|
31
|
+
}>;
|
|
32
|
+
onSyncSchema?: (output?: Record<string, any>) => void; // 结果同步到配置中
|
|
33
|
+
defaultInputValue?: Record<string, any>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export type Package = {
|
|
38
|
+
title: string;
|
|
39
|
+
version: string;
|
|
40
|
+
key: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type Library = {
|
|
44
|
+
title: string;
|
|
45
|
+
children: Array<Package>
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { WorkflowNode } from "../..";
|
|
2
|
+
import { Edge } from "@xyflow/react";
|
|
3
|
+
import '../Sider/index.less';
|
|
4
|
+
/**
|
|
5
|
+
* 快速新增节点 Popover
|
|
6
|
+
* @param onNodeCreate
|
|
7
|
+
* @param isPreview
|
|
8
|
+
* @param nodeId
|
|
9
|
+
* @constructor
|
|
10
|
+
*/
|
|
11
|
+
export declare const NodePopover: <NodeType extends WorkflowNode = WorkflowNode, EdgeType extends Edge = Edge>({ onNodeCreate, nodeId, }: {
|
|
12
|
+
nodeId: string;
|
|
13
|
+
onNodeCreate: (type: string) => void;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=NodePopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodePopover.d.ts","sourceRoot":"","sources":["NodePopover.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAiB,YAAY,EAAE,cAAyB;AAC/D,OAAO,EAAC,IAAI,EAAc,MAAM,eAAe,CAAC;AAMhD,OAAO,qBAAqB,CAAC;AAY7B;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;YAKZ,MAAM;yBACO,MAAM,KAAK,IAAI;6CAkGvC,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.NodePopover = void 0;
|
|
7
|
+
var _SearchOutlined = _interopRequireDefault(require("@ant-design/icons/lib/icons/SearchOutlined"));
|
|
8
|
+
var _base = require("@rxflow/base");
|
|
9
|
+
var _react = require("@xyflow/react");
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _groupBy = _interopRequireDefault(require("lodash/groupBy"));
|
|
12
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _reactHighlightWords = _interopRequireDefault(require("react-highlight-words"));
|
|
14
|
+
var _useWorkFlow = require("../../hooks/useWorkFlow");
|
|
15
|
+
require("../Sider/index.less");
|
|
16
|
+
var _dropTargetsCheck = require("../../utils/dropTargetsCheck");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
/*
|
|
22
|
+
* @author: yanxianliang
|
|
23
|
+
* @date: 2025-04-22 10:30
|
|
24
|
+
* @desc: 节点快速创建
|
|
25
|
+
*
|
|
26
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 不拦截,会触发 flow 的 PointerDown 事件,导致向 body 派发 mousedown事件,自动关闭浮层
|
|
31
|
+
* @param e
|
|
32
|
+
*/const onPointerDown = e => {
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 快速新增节点 Popover
|
|
38
|
+
* @param onNodeCreate
|
|
39
|
+
* @param isPreview
|
|
40
|
+
* @param nodeId
|
|
41
|
+
* @constructor
|
|
42
|
+
*/
|
|
43
|
+
const NodePopover = ({
|
|
44
|
+
onNodeCreate,
|
|
45
|
+
nodeId
|
|
46
|
+
}) => {
|
|
47
|
+
const {
|
|
48
|
+
getNode
|
|
49
|
+
} = (0, _useWorkFlow.useWorkFlow)();
|
|
50
|
+
const {
|
|
51
|
+
nodeTypes: nodeTypeList = []
|
|
52
|
+
} = (0, _base.usePropsSelector)();
|
|
53
|
+
const [filter, setFilter] = (0, _react2.useState)('');
|
|
54
|
+
const nodeTypeMap = (0, _base.useNodeTypeMap)();
|
|
55
|
+
const {
|
|
56
|
+
getState
|
|
57
|
+
} = (0, _react.useStoreApi)();
|
|
58
|
+
/**
|
|
59
|
+
* 分组节点类型列表
|
|
60
|
+
*/
|
|
61
|
+
const nodeCategoryList = (0, _react2.useMemo)(() => {
|
|
62
|
+
if (!nodeTypeList || !nodeTypeList.length) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 在循环体中不支持再创建循环节点
|
|
67
|
+
const handleNode = getNode(nodeId);
|
|
68
|
+
|
|
69
|
+
// 分组
|
|
70
|
+
const groups = (0, _groupBy.default)(nodeTypeList.filter(definition => {
|
|
71
|
+
if (definition.hideInSider || definition.label && definition.label.indexOf(filter) === -1) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
const {
|
|
75
|
+
nodeLookup
|
|
76
|
+
} = getState();
|
|
77
|
+
// 检测当前节点所处环境是否支持,例如父节点等等
|
|
78
|
+
const parentId = handleNode?.parentId;
|
|
79
|
+
if (!(0, _dropTargetsCheck.canAddInNode)(nodeLookup, parentId, [definition.type], nodeTypeMap)) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
return true;
|
|
83
|
+
}), node => node.group || '');
|
|
84
|
+
return Object.keys(groups).map(group => {
|
|
85
|
+
return {
|
|
86
|
+
group,
|
|
87
|
+
list: groups[group] || []
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}, [nodeTypeList, filter]);
|
|
91
|
+
const onSearch = (0, _react2.useCallback)(e => {
|
|
92
|
+
setFilter(e.currentTarget.value);
|
|
93
|
+
}, []);
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
95
|
+
className: 'handle-dropdown-content',
|
|
96
|
+
onPointerDown: onPointerDown,
|
|
97
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
98
|
+
className: 'rxflow-sider-search',
|
|
99
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
|
|
100
|
+
onChange: onSearch,
|
|
101
|
+
prefix: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchOutlined.default, {
|
|
102
|
+
style: {
|
|
103
|
+
color: 'rgba(32, 41, 69, 0.62)'
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
placeholder: '搜索节点'
|
|
107
|
+
})
|
|
108
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
109
|
+
className: 'rxflow-sider-scroll',
|
|
110
|
+
style: {
|
|
111
|
+
height: 400
|
|
112
|
+
},
|
|
113
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
114
|
+
className: 'rxflow-sider-content',
|
|
115
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
116
|
+
size: 12,
|
|
117
|
+
direction: 'vertical',
|
|
118
|
+
style: {
|
|
119
|
+
width: '100%'
|
|
120
|
+
},
|
|
121
|
+
children: nodeCategoryList.map(categoryItem => {
|
|
122
|
+
const {
|
|
123
|
+
group,
|
|
124
|
+
list
|
|
125
|
+
} = categoryItem;
|
|
126
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
127
|
+
children: [group ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
128
|
+
className: 'rxflow-sider-group',
|
|
129
|
+
children: group
|
|
130
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List, {
|
|
131
|
+
grid: {
|
|
132
|
+
gutter: 0,
|
|
133
|
+
column: 2
|
|
134
|
+
},
|
|
135
|
+
dataSource: list,
|
|
136
|
+
renderItem: item => {
|
|
137
|
+
const {
|
|
138
|
+
icon,
|
|
139
|
+
label
|
|
140
|
+
} = item;
|
|
141
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List.Item, {
|
|
142
|
+
className: 'rxflow-sider-item',
|
|
143
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
144
|
+
className: 'rxflow-sider-card',
|
|
145
|
+
onClick: () => {
|
|
146
|
+
onNodeCreate(item.type);
|
|
147
|
+
},
|
|
148
|
+
children: [icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
149
|
+
className: 'rxflow-sider-icon',
|
|
150
|
+
children: icon
|
|
151
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
152
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHighlightWords.default, {
|
|
153
|
+
highlightClassName: 'rxflow-sider-highlight',
|
|
154
|
+
textToHighlight: label || '',
|
|
155
|
+
searchWords: [filter]
|
|
156
|
+
})
|
|
157
|
+
})]
|
|
158
|
+
})
|
|
159
|
+
}, item.type);
|
|
160
|
+
}
|
|
161
|
+
})]
|
|
162
|
+
}, group);
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
})]
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
exports.NodePopover = NodePopover;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-09-06 09:52
|
|
4
|
+
* @modified:2025/9/6 09:52 by yanxianliang
|
|
5
|
+
* @desc: Handle 自定义
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { WorkflowNode } from "../..";
|
|
10
|
+
import { Edge } from '@xyflow/react';
|
|
11
|
+
import type { HandleProps } from '@xyflow/system';
|
|
12
|
+
import { HTMLAttributes } from 'react';
|
|
13
|
+
import './index.less';
|
|
14
|
+
/**
|
|
15
|
+
* 链接桩组件
|
|
16
|
+
* @param props
|
|
17
|
+
* @constructor
|
|
18
|
+
*/
|
|
19
|
+
export declare const Handle: <NodeType extends WorkflowNode = WorkflowNode, EdgeType extends Edge = Edge>(props: HandleProps & Omit<HTMLAttributes<HTMLDivElement>, 'id'> & {
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
errorMessage?: string;
|
|
23
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAGL,YAAY,EACb,cAAyB;AAC1B,OAAO,EACL,IAAI,EAML,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAIhD,OAAO,EAAC,cAAc,EAAW,MAAM,OAAO,CAAC;AAC/C,OAAO,cAAc,CAAC;AAMtB;;;;GAIG;AACH,eAAO,MAAM,MAAM,sFACV,WAAW,GAChB,KAAK,eAAe,cAAc,CAAC,EAAE,IAAI,CAAC,GAAG;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,4CAiIF,CAAC"}
|