@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
package/cjs/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
require("@xyflow/react/dist/style.css");
|
|
9
|
+
var _base = require("@rxflow/base");
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
var _Layout = require("./components/Layout");
|
|
13
|
+
var _useWorkFlowProps = require("./hooks/useWorkFlowProps");
|
|
14
|
+
var _types = require("./types");
|
|
15
|
+
Object.keys(_types).forEach(function (key) {
|
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
19
|
+
Object.defineProperty(exports, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _types[key];
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
var _utils = require("./utils");
|
|
27
|
+
Object.keys(_utils).forEach(function (key) {
|
|
28
|
+
if (key === "default" || key === "__esModule") return;
|
|
29
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
30
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
31
|
+
Object.defineProperty(exports, key, {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _utils[key];
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
var _RunningStatus = require("./constants/RunningStatus");
|
|
39
|
+
Object.keys(_RunningStatus).forEach(function (key) {
|
|
40
|
+
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
|
+
if (key in exports && exports[key] === _RunningStatus[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _RunningStatus[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _Handle = require("./components/Handle");
|
|
51
|
+
Object.keys(_Handle).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
54
|
+
if (key in exports && exports[key] === _Handle[key]) return;
|
|
55
|
+
Object.defineProperty(exports, key, {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return _Handle[key];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* @author: yanxianliang
|
|
64
|
+
* @date: 2025-06-27 09:32
|
|
65
|
+
* @desc: 工作流组件
|
|
66
|
+
*
|
|
67
|
+
* 支持工作流编排能力,支持节点自定义
|
|
68
|
+
*
|
|
69
|
+
* 支持nodes 外部传递
|
|
70
|
+
* 支持x6数据结构转换
|
|
71
|
+
*
|
|
72
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
// 怎么把 nodeType 和 EdgeType 传递进去
|
|
76
|
+
const WorkFlow = (0, _base.createFlow)(_Layout.WorkFlowLayout, _useWorkFlowProps.useWorkFlowProps);
|
|
77
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(WorkFlow, (prevProps, nextProps) => (0, _lodash.isEqual)(prevProps, nextProps));
|
package/cjs/types.d.ts
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { BaseStateType, IBaseFlowProps, InnerFlowType, INodeDefinition, NodeRoleType, SelectionStrategy } from "@rxflow/base";
|
|
2
|
+
import { Edge, InternalNode, Node, XYPosition } from '@xyflow/react';
|
|
3
|
+
import { CoordinateExtent } from "@xyflow/system";
|
|
4
|
+
import type { HandleProps as InnerHandleProps } from '@xyflow/system';
|
|
5
|
+
import { HTMLAttributes } from "react";
|
|
6
|
+
import { RunningStatus } from "./constants/RunningStatus";
|
|
7
|
+
export type WorkflowNode = Node & {
|
|
8
|
+
subFlowKey?: string;
|
|
9
|
+
};
|
|
10
|
+
export interface WorkFlowBaseNodeDefinition<DataType extends Record<string, unknown> = Record<string, unknown>> extends INodeDefinition<DataType> {
|
|
11
|
+
nodeRoleType?: Exclude<NodeRoleType, NodeRoleType.SubFlow>;
|
|
12
|
+
allowInFlowTypes?: Array<InnerFlowType | string>;
|
|
13
|
+
forbiddenInFlowTypes?: Array<InnerFlowType | string>;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkFlowSubFlowNodeDefinition<DataType extends Record<string, unknown> = Record<string, unknown>> extends INodeDefinition<DataType> {
|
|
16
|
+
nodeRoleType: NodeRoleType.SubFlow;
|
|
17
|
+
subFlowViewPort?: {
|
|
18
|
+
top?: number;
|
|
19
|
+
bottom?: number;
|
|
20
|
+
left?: number;
|
|
21
|
+
right?: number;
|
|
22
|
+
minWidth?: number;
|
|
23
|
+
minHeight?: number;
|
|
24
|
+
};
|
|
25
|
+
childrenExtent?: CoordinateExtent;
|
|
26
|
+
allowInFlowTypes?: Array<InnerFlowType | string>;
|
|
27
|
+
forbiddenInFlowTypes?: Array<InnerFlowType | string>;
|
|
28
|
+
allowNodeTypes?: string[];
|
|
29
|
+
forbiddenNodeTypes?: string[];
|
|
30
|
+
allowContentSelection?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export type WorkFlowNodeDefinition<DataType extends Record<string, unknown> = Record<string, unknown>> = WorkFlowSubFlowNodeDefinition<DataType> | WorkFlowBaseNodeDefinition<DataType>;
|
|
33
|
+
export type WorkflowExtendProps<NodeType extends WorkflowNode = WorkflowNode> = {
|
|
34
|
+
nodeTypes?: WorkFlowNodeDefinition<NodeType['data']>[];
|
|
35
|
+
readOnly?: boolean;
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
quickAdd?: boolean;
|
|
38
|
+
renderNodeIcon?: (nodeDefinition: WorkFlowNodeDefinition<NodeType['data']>) => React.ReactNode;
|
|
39
|
+
sider?: {
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* @description 限制链接规则,配合 connectionMode 和 isValidConnection一起使用,可以实现复杂的链接限制逻辑
|
|
44
|
+
*/
|
|
45
|
+
connectionLimit?: {
|
|
46
|
+
/**
|
|
47
|
+
* @description 是否禁止循环链
|
|
48
|
+
*/
|
|
49
|
+
preventCycle?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @description 是否禁止并发,一个 handle 链接多个目标节点,通常根据工作流是否支持并发来配置
|
|
52
|
+
*/
|
|
53
|
+
preventConcurrency?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @description 禁止跨层级,比如从主工作流连接子工作流节点,或不同子工作流之间连接
|
|
56
|
+
*/
|
|
57
|
+
preventCrossSubFlow?: boolean;
|
|
58
|
+
};
|
|
59
|
+
selectionStrategy?: SelectionStrategy;
|
|
60
|
+
/**
|
|
61
|
+
* @description 侧边拖动节点到画布中,触发对应的新增回调
|
|
62
|
+
*/
|
|
63
|
+
onNodeTypeDrop?: (parentFlow: InternalNode<NodeType> | undefined, positionInParent: XYPosition, nodeType: string) => Promise<{
|
|
64
|
+
id: string;
|
|
65
|
+
connectSourceHandle: string;
|
|
66
|
+
connectTargetHandle: string;
|
|
67
|
+
} | undefined>;
|
|
68
|
+
};
|
|
69
|
+
export type IWorkflowProps<NodeType extends WorkflowNode = WorkflowNode, EdgeType extends Edge = Edge> = Omit<IBaseFlowProps<NodeType, EdgeType>, 'nodeTypes'> & WorkflowExtendProps<NodeType>;
|
|
70
|
+
export type NodeRunningStatus = 'running' | 'success' | 'failed';
|
|
71
|
+
export type NodeRunState = {
|
|
72
|
+
status?: NodeRunningStatus;
|
|
73
|
+
timeSpent?: number;
|
|
74
|
+
input?: any;
|
|
75
|
+
output?: any;
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
};
|
|
78
|
+
export type WorkflowRunState = {
|
|
79
|
+
runningStatus?: RunningStatus;
|
|
80
|
+
timeSpent?: number;
|
|
81
|
+
activeEdges?: Set<string>;
|
|
82
|
+
nodeRunMap?: Record<string, NodeRunState>;
|
|
83
|
+
nodePageIndexMap?: Record<string, number>;
|
|
84
|
+
runLogs?: any[];
|
|
85
|
+
};
|
|
86
|
+
export type WorkflowBaseState<NodeType extends WorkflowNode = WorkflowNode, EdgeType extends Edge = Edge> = BaseStateType & {
|
|
87
|
+
nodes: NodeType[];
|
|
88
|
+
edges: EdgeType[];
|
|
89
|
+
selectedNodes?: Array<string>;
|
|
90
|
+
selectedEdges?: Array<string>;
|
|
91
|
+
hoveredEdge?: string;
|
|
92
|
+
dropTargetIds?: string[];
|
|
93
|
+
runState?: WorkflowRunState;
|
|
94
|
+
};
|
|
95
|
+
export type WorkflowState<ExtraState extends Record<string, any> = Record<string, any>, NodeType extends WorkflowNode = WorkflowNode, EdgeType extends Edge = Edge> = ValidityState & WorkflowBaseState<NodeType, EdgeType> & ExtraState;
|
|
96
|
+
export type WorkflowStateApi<ExtraState extends Record<string, any> = Record<string, any>> = {};
|
|
97
|
+
export type NodeErrors = Array<string | [string, any]>;
|
|
98
|
+
export type ValidityState = {
|
|
99
|
+
errors?: Record<string, NodeErrors | undefined>;
|
|
100
|
+
};
|
|
101
|
+
export type NodeTypeLookup = Map<string, WorkFlowNodeDefinition>;
|
|
102
|
+
export type HandleProps = InnerHandleProps & Omit<HTMLAttributes<HTMLDivElement>, 'id'> & {};
|
|
103
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"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"}
|
package/cjs/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrayUtils.d.ts","sourceRoot":"","sources":["arrayUtils.ts"],"names":[],"mappings":"AAUA,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,WAMhE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.stringArrayIsEqual = stringArrayIsEqual;
|
|
7
|
+
var _lodash = require("lodash");
|
|
8
|
+
/**
|
|
9
|
+
* @author: yanxianliang
|
|
10
|
+
* @date: 2025-08-24 23:33
|
|
11
|
+
* @modified:2025/8/24 23:33 by yanxianliang
|
|
12
|
+
* @desc: 数组处理工具
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function stringArrayIsEqual(arr1, arr2) {
|
|
18
|
+
// 1. 检查长度是否相同
|
|
19
|
+
if (arr1.length !== arr2.length) return false;
|
|
20
|
+
|
|
21
|
+
// 2. 使用 Lodash 排序并比较
|
|
22
|
+
return (0, _lodash.isEqual)((0, _lodash.sortBy)(arr1), (0, _lodash.sortBy)(arr2));
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-19 14:20
|
|
4
|
+
* @modified:2025/8/19 14:20 by yanxianliang
|
|
5
|
+
* @desc: 检测是否允许作为子节点
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { WorkFlowNodeDefinition } from "..";
|
|
10
|
+
export declare const checkChildren: (groupDefinition: WorkFlowNodeDefinition, childDefinition: WorkFlowNodeDefinition) => boolean;
|
|
11
|
+
//# sourceMappingURL=checkChildren.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkChildren.d.ts","sourceRoot":"","sources":["checkChildren.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,sBAAsB,EAAC,WAAyB;AAExD,eAAO,MAAM,aAAa,oBAAqB,sBAAsB,mBAAmB,sBAAsB,YAU7G,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.checkChildren = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-08-19 14:20
|
|
10
|
+
* @modified:2025/8/19 14:20 by yanxianliang
|
|
11
|
+
* @desc: 检测是否允许作为子节点
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const checkChildren = (groupDefinition, childDefinition) => {
|
|
17
|
+
const {
|
|
18
|
+
allowNodeTypes,
|
|
19
|
+
forbiddenNodeTypes
|
|
20
|
+
} = groupDefinition;
|
|
21
|
+
const {
|
|
22
|
+
allowInGroupTypes,
|
|
23
|
+
forbiddenInGroupTypes
|
|
24
|
+
} = childDefinition;
|
|
25
|
+
return !(allowNodeTypes && !new Set(allowNodeTypes).has(childDefinition.type) || forbiddenNodeTypes && new Set(forbiddenNodeTypes).has(childDefinition.type) || allowInGroupTypes && !new Set(allowInGroupTypes).has(groupDefinition.type) || forbiddenInGroupTypes && new Set(forbiddenInGroupTypes).has(groupDefinition.type));
|
|
26
|
+
};
|
|
27
|
+
exports.checkChildren = checkChildren;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-18 21:26
|
|
4
|
+
* @modified:2025/8/18 21:26 by yanxianliang
|
|
5
|
+
* @desc: 获取节点尺寸
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { Node } from "@xyflow/react";
|
|
10
|
+
export declare const getNodeWidth: (node: Node) => number;
|
|
11
|
+
export declare const getNodeHeight: (node: Node) => number;
|
|
12
|
+
//# sourceMappingURL=dimensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["dimensions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AAEnC,eAAO,MAAM,YAAY,SAAQ,IAAI,WAEpC,CAAA;AAED,eAAO,MAAM,aAAa,SAAQ,IAAI,WAErC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getNodeWidth = exports.getNodeHeight = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-08-18 21:26
|
|
10
|
+
* @modified:2025/8/18 21:26 by yanxianliang
|
|
11
|
+
* @desc: 获取节点尺寸
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const getNodeWidth = node => {
|
|
17
|
+
return node.measured?.width ?? node.width ?? 0;
|
|
18
|
+
};
|
|
19
|
+
exports.getNodeWidth = getNodeWidth;
|
|
20
|
+
const getNodeHeight = node => {
|
|
21
|
+
return node.measured?.height ?? node.height ?? 0;
|
|
22
|
+
};
|
|
23
|
+
exports.getNodeHeight = getNodeHeight;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-19 18:13
|
|
4
|
+
* @modified:2025/8/19 18:13 by yanxianliang
|
|
5
|
+
* @desc: 拖动数据传递
|
|
6
|
+
*
|
|
7
|
+
* dragOver 事件中不支持读取 dataTransfer,需要用其来传递
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
10
|
+
*/
|
|
11
|
+
export declare const setDragDataTransfer: (dataTransfer: Record<string, any>) => void;
|
|
12
|
+
export declare const getDragDataTransfer: () => {
|
|
13
|
+
width?: number | undefined;
|
|
14
|
+
height?: number | undefined;
|
|
15
|
+
offsetX?: number | undefined;
|
|
16
|
+
offsetY?: number | undefined;
|
|
17
|
+
type?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=dragDataTransfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragDataTransfer.d.ts","sourceRoot":"","sources":["dragDataTransfer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH,eAAO,MAAM,mBAAmB,iBAAiB,OAAO,MAAM,EAAE,GAAG,CAAC,SAEnE,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;CAE/B,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setDragDataTransfer = exports.getDragDataTransfer = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-08-19 18:13
|
|
10
|
+
* @modified:2025/8/19 18:13 by yanxianliang
|
|
11
|
+
* @desc: 拖动数据传递
|
|
12
|
+
*
|
|
13
|
+
* dragOver 事件中不支持读取 dataTransfer,需要用其来传递
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
let dragDataTransfer = {};
|
|
19
|
+
document.addEventListener('dragend', () => {
|
|
20
|
+
dragDataTransfer = {};
|
|
21
|
+
});
|
|
22
|
+
const setDragDataTransfer = dataTransfer => {
|
|
23
|
+
dragDataTransfer = dataTransfer;
|
|
24
|
+
};
|
|
25
|
+
exports.setDragDataTransfer = setDragDataTransfer;
|
|
26
|
+
const getDragDataTransfer = () => {
|
|
27
|
+
return dragDataTransfer;
|
|
28
|
+
};
|
|
29
|
+
exports.getDragDataTransfer = getDragDataTransfer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NodeTypeLookup, WorkflowNode } from "..";
|
|
2
|
+
import { InternalNode } from "@xyflow/react";
|
|
3
|
+
import { NodeLookup } from "@xyflow/system";
|
|
4
|
+
/**
|
|
5
|
+
* 检测,节点是否支持添加到对应节点类型下
|
|
6
|
+
* @param parentType
|
|
7
|
+
* @param sources
|
|
8
|
+
* @param nodeTypeLookup
|
|
9
|
+
*/
|
|
10
|
+
export declare const canAddToParentType: <NodeType extends WorkflowNode = WorkflowNode>(parentType: string, sources: NodeType[] | string[], nodeTypeLookup: NodeTypeLookup) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 检测,节点是否支持添加到对应节点下
|
|
13
|
+
* @param nodeLookup
|
|
14
|
+
* @param parentId
|
|
15
|
+
* @param sources
|
|
16
|
+
* @param nodeTypeLookup
|
|
17
|
+
*/
|
|
18
|
+
export declare const canAddInNode: <NodeType extends WorkflowNode = WorkflowNode>(nodeLookup: NodeLookup<InternalNode<NodeType>>, parentId: string | null | undefined, sources: NodeType[] | string[], nodeTypeLookup: NodeTypeLookup) => boolean;
|
|
19
|
+
export declare const getAllowedIntersections: <NodeType extends WorkflowNode = WorkflowNode>(nodeLookup: NodeLookup<InternalNode<NodeType>>, intersections: NodeType[], sources: NodeType[] | string[] | undefined, nodeTypeLookup: NodeTypeLookup) => string[];
|
|
20
|
+
//# sourceMappingURL=dropTargetsCheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropTargetsCheck.d.ts","sourceRoot":"","sources":["dropTargetsCheck.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,cAAc,EAAE,YAAY,EAAyB,WAAyB;AACtF,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AA0C1C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,6DACjB,MAAM,WACT,QAAQ,EAAE,GAAG,MAAM,EAAE,4CAe/B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,2GAEb,MAAM,GAAG,IAAI,GAAG,SAAS,WAC1B,QAAQ,EAAE,GAAG,MAAM,EAAE,4CAiB/B,CAAA;AAED,eAAO,MAAM,uBAAuB,gHAEnB,QAAQ,EAAE,WAChB,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,6CAU3C,CAAA"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAllowedIntersections = exports.canAddToParentType = exports.canAddInNode = void 0;
|
|
7
|
+
var _base = require("@rxflow/base");
|
|
8
|
+
/**
|
|
9
|
+
* @author: yanxianliang
|
|
10
|
+
* @date: 2025-08-30 16:17
|
|
11
|
+
* @modified:2025/8/30 16:17 by yanxianliang
|
|
12
|
+
* @desc: dropTargets 校验
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const checkTargetIsAllow = (sourceDefinition, targetDefinition, inGlobal) => {
|
|
18
|
+
if (!targetDefinition) {
|
|
19
|
+
if (inGlobal) {
|
|
20
|
+
// 全局检测
|
|
21
|
+
if (sourceDefinition.allowInFlowTypes && !new Set(sourceDefinition.allowInFlowTypes).has(_base.InnerFlowType.Global)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (sourceDefinition.forbiddenInFlowTypes && new Set(sourceDefinition.forbiddenInFlowTypes).has(_base.InnerFlowType.Global)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (targetDefinition.nodeRoleType !== _base.NodeRoleType.SubFlow) {
|
|
32
|
+
// 非子工作流不允许添加
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
if (sourceDefinition.allowInFlowTypes && !new Set(sourceDefinition.allowInFlowTypes).has(targetDefinition.type)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (sourceDefinition.forbiddenInFlowTypes && new Set(sourceDefinition.forbiddenInFlowTypes).has(targetDefinition.type)) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (targetDefinition.allowNodeTypes && !new Set(targetDefinition.allowNodeTypes).has(sourceDefinition.type)) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (targetDefinition.forbiddenNodeTypes && new Set(targetDefinition.forbiddenNodeTypes).has(sourceDefinition.type)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 检测,节点是否支持添加到对应节点类型下
|
|
52
|
+
* @param parentType
|
|
53
|
+
* @param sources
|
|
54
|
+
* @param nodeTypeLookup
|
|
55
|
+
*/
|
|
56
|
+
const canAddToParentType = (parentType, sources, nodeTypeLookup) => {
|
|
57
|
+
const targetIsGlobal = parentType === _base.InnerFlowType.Global;
|
|
58
|
+
const targetDefinition = nodeTypeLookup.get(parentType);
|
|
59
|
+
if (!targetDefinition && !targetIsGlobal) {
|
|
60
|
+
// 全局的需要特殊处理
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
for (const source of sources) {
|
|
64
|
+
const sourceTarget = nodeTypeLookup.get(typeof source === 'string' ? source : source.type);
|
|
65
|
+
if (sourceTarget && !checkTargetIsAllow(sourceTarget, targetDefinition, targetIsGlobal)) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 检测,节点是否支持添加到对应节点下
|
|
74
|
+
* @param nodeLookup
|
|
75
|
+
* @param parentId
|
|
76
|
+
* @param sources
|
|
77
|
+
* @param nodeTypeLookup
|
|
78
|
+
*/
|
|
79
|
+
exports.canAddToParentType = canAddToParentType;
|
|
80
|
+
const canAddInNode = (nodeLookup, parentId, sources, nodeTypeLookup) => {
|
|
81
|
+
let parentNode = parentId ? nodeLookup.get(parentId) : undefined;
|
|
82
|
+
while (parentNode) {
|
|
83
|
+
const parentType = parentNode.type;
|
|
84
|
+
if (parentType) {
|
|
85
|
+
const parentDefinition = nodeTypeLookup.get(parentType);
|
|
86
|
+
if (parentDefinition && parentDefinition.nodeRoleType === _base.NodeRoleType.SubFlow) {
|
|
87
|
+
return canAddToParentType(parentType, sources, nodeTypeLookup);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// 有些情况不需要往上检测
|
|
91
|
+
parentNode = parentNode.parentId ? nodeLookup.get(parentNode.parentId) : undefined;
|
|
92
|
+
}
|
|
93
|
+
return canAddToParentType(_base.InnerFlowType.Global, sources, nodeTypeLookup);
|
|
94
|
+
};
|
|
95
|
+
exports.canAddInNode = canAddInNode;
|
|
96
|
+
const getAllowedIntersections = (nodeLookup, intersections, sources, nodeTypeLookup) => {
|
|
97
|
+
let targets = [];
|
|
98
|
+
for (const intersection of intersections) {
|
|
99
|
+
if (!sources || canAddInNode(nodeLookup, intersection.id, sources, nodeTypeLookup)) {
|
|
100
|
+
targets.push(intersection.id);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return targets;
|
|
104
|
+
};
|
|
105
|
+
exports.getAllowedIntersections = getAllowedIntersections;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-16 17:27
|
|
4
|
+
* @modified:2025/8/16 17:27 by yanxianliang
|
|
5
|
+
* @desc: 获取除当前连接外的边
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { Connection, Edge } from "@xyflow/react";
|
|
10
|
+
export declare const edgeEqualConnect: <EdgeType extends Edge = Edge>(edge: EdgeType | Connection, connection: Connection | EdgeType) => boolean;
|
|
11
|
+
//# sourceMappingURL=edgeEqualConnect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edgeEqualConnect.d.ts","sourceRoot":"","sources":["edgeEqualConnect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,gBAAgB,uCAAwC,QAAQ,GAAG,UAAU,cAAc,UAAU,GAAG,QAAQ,YAK5H,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.edgeEqualConnect = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-08-16 17:27
|
|
10
|
+
* @modified:2025/8/16 17:27 by yanxianliang
|
|
11
|
+
* @desc: 获取除当前连接外的边
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const edgeEqualConnect = (edge, connection) => {
|
|
17
|
+
return edge.source === connection.source && edge.target === connection.target && (edge.sourceHandle === connection.sourceHandle || !edge.sourceHandle && !connection.sourceHandle) && (edge.targetHandle === connection.targetHandle || !edge.targetHandle && !connection.targetHandle);
|
|
18
|
+
};
|
|
19
|
+
exports.edgeEqualConnect = edgeEqualConnect;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-09-07 12:47
|
|
4
|
+
* @modified:2025/9/7 12:47 by yanxianliang
|
|
5
|
+
* @desc: events default utils
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import React from "react";
|
|
10
|
+
export declare const stopPropagation: (e: React.MouseEvent) => void;
|
|
11
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["events.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,eAAe,MAAO,gBAAgB,SAElD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.stopPropagation = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-09-07 12:47
|
|
10
|
+
* @modified:2025/9/7 12:47 by yanxianliang
|
|
11
|
+
* @desc: events default utils
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const stopPropagation = e => {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
};
|
|
19
|
+
exports.stopPropagation = stopPropagation;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-16 17:17
|
|
4
|
+
* @modified:2025/8/16 17:17 by yanxianliang
|
|
5
|
+
* @desc: 生成边 id
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { Connection } from "@xyflow/react";
|
|
10
|
+
import { EdgeBase } from "@xyflow/system";
|
|
11
|
+
export declare const getEdgeId: ({ source, sourceHandle, target, targetHandle }: Connection | EdgeBase) => string;
|
|
12
|
+
//# sourceMappingURL=getEdgeId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEdgeId.d.ts","sourceRoot":"","sources":["getEdgeId.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAExC,eAAO,MAAM,SAAS,mDAAoD,UAAU,GAAG,QAAQ,KAAG,MACxB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getEdgeId = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-08-16 17:17
|
|
10
|
+
* @modified:2025/8/16 17:17 by yanxianliang
|
|
11
|
+
* @desc: 生成边 id
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const getEdgeId = ({
|
|
17
|
+
source,
|
|
18
|
+
sourceHandle,
|
|
19
|
+
target,
|
|
20
|
+
targetHandle
|
|
21
|
+
}) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`;
|
|
22
|
+
exports.getEdgeId = getEdgeId;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NodeTypeLookup } from "..";
|
|
2
|
+
import { InternalNode, Node } from "@xyflow/react";
|
|
3
|
+
import { NodeLookup } from "@xyflow/system";
|
|
4
|
+
export declare const getParentFlow: <NodeType extends Node = Node>(nodeLookup: NodeLookup<InternalNode<NodeType>>, nodeTypeLookup: NodeTypeLookup, targetNodeId?: string) => InternalNode<NodeType> | undefined;
|
|
5
|
+
//# sourceMappingURL=getParentFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getParentFlow.d.ts","sourceRoot":"","sources":["getParentFlow.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,cAAc,EAAC,WAAyB;AAChD,OAAO,EAAC,YAAY,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE1C,eAAO,MAAM,aAAa,gIAGT,MAAM,KACpB,aAAa,QAAQ,CAAC,GAAG,SAiB3B,CAAA"}
|