@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,190 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
/**
|
|
17
|
+
* @author: yanxianliang
|
|
18
|
+
* @date: 2025-09-06 09:52
|
|
19
|
+
* @modified:2025/9/6 09:52 by yanxianliang
|
|
20
|
+
* @desc: Handle 自定义
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import PlusOutlined from '@ant-design/icons/PlusOutlined';
|
|
26
|
+
import { getParentFlow } from "../..";
|
|
27
|
+
import { Handle as InnerHandle, Position, useNodeConnections, useNodeId, useStoreApi } from '@xyflow/react';
|
|
28
|
+
import { useMemoizedFn } from 'ahooks';
|
|
29
|
+
import { Popover, Tooltip, getNodeWidth, usePropsSelector, useNodeTypeMap } from '@rxflow/base';
|
|
30
|
+
import cat from 'classcat';
|
|
31
|
+
import { useState } from 'react';
|
|
32
|
+
import "./index.less";
|
|
33
|
+
import { useWorkFlow } from "../../hooks/useWorkFlow";
|
|
34
|
+
import { stopPropagation } from "../../utils/events";
|
|
35
|
+
import { NodePopover } from "./NodePopover";
|
|
36
|
+
import ExclamationOutlined from "@ant-design/icons/lib/icons/ExclamationOutlined";
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 链接桩组件
|
|
40
|
+
* @param props
|
|
41
|
+
* @constructor
|
|
42
|
+
*/
|
|
43
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
44
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
45
|
+
export var Handle = function Handle(props) {
|
|
46
|
+
var nodeId = useNodeId();
|
|
47
|
+
var _usePropsSelector = usePropsSelector(function (props) {
|
|
48
|
+
return {
|
|
49
|
+
quickAdd: !!props.quickAdd,
|
|
50
|
+
onNodeTypeDrop: props.onNodeTypeDrop
|
|
51
|
+
};
|
|
52
|
+
}),
|
|
53
|
+
quickAdd = _usePropsSelector.quickAdd,
|
|
54
|
+
onNodeTypeDrop = _usePropsSelector.onNodeTypeDrop;
|
|
55
|
+
var position = props.position,
|
|
56
|
+
style = props.style,
|
|
57
|
+
id = props.id,
|
|
58
|
+
type = props.type,
|
|
59
|
+
_props$readOnly = props.readOnly,
|
|
60
|
+
isReadonly = _props$readOnly === void 0 ? !onNodeTypeDrop : _props$readOnly,
|
|
61
|
+
_props$required = props.required,
|
|
62
|
+
required = _props$required === void 0 ? true : _props$required,
|
|
63
|
+
_props$errorMessage = props.errorMessage,
|
|
64
|
+
errorMessage = _props$errorMessage === void 0 ? '端口未连接' : _props$errorMessage;
|
|
65
|
+
var connections = useNodeConnections({
|
|
66
|
+
handleType: type,
|
|
67
|
+
id: nodeId || undefined,
|
|
68
|
+
handleId: id || undefined
|
|
69
|
+
});
|
|
70
|
+
var _useWorkFlow = useWorkFlow(),
|
|
71
|
+
getNode = _useWorkFlow.getNode,
|
|
72
|
+
connect = _useWorkFlow.connect;
|
|
73
|
+
var _useStoreApi = useStoreApi(),
|
|
74
|
+
getState = _useStoreApi.getState;
|
|
75
|
+
var _useState = useState(false),
|
|
76
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
77
|
+
open = _useState2[0],
|
|
78
|
+
setOpen = _useState2[1];
|
|
79
|
+
var nodeTypeMap = useNodeTypeMap();
|
|
80
|
+
/**
|
|
81
|
+
* 创建节点实例
|
|
82
|
+
*/
|
|
83
|
+
var onNodeCreate = useMemoizedFn( /*#__PURE__*/function () {
|
|
84
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(type) {
|
|
85
|
+
var _node$position, _node$position2, _node$position3;
|
|
86
|
+
var _getState, nodeLookup, node, parentFlow, positionInFlow, _node, copyNodeId, sourceHandle, targetHandle, autoLinkEdge;
|
|
87
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
88
|
+
while (1) switch (_context.prev = _context.next) {
|
|
89
|
+
case 0:
|
|
90
|
+
setOpen(false);
|
|
91
|
+
if (onNodeTypeDrop) {
|
|
92
|
+
_context.next = 3;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
return _context.abrupt("return");
|
|
96
|
+
case 3:
|
|
97
|
+
_getState = getState(), nodeLookup = _getState.nodeLookup;
|
|
98
|
+
node = getNode(nodeId);
|
|
99
|
+
parentFlow = getParentFlow(nodeLookup, nodeTypeMap, node === null || node === void 0 ? void 0 : node.parentId);
|
|
100
|
+
positionInFlow = {
|
|
101
|
+
x: position === Position.Left ? ((node === null || node === void 0 || (_node$position = node.position) === null || _node$position === void 0 ? void 0 : _node$position.x) || 0) - (getNodeWidth(node) + 50) : ((node === null || node === void 0 || (_node$position2 = node.position) === null || _node$position2 === void 0 ? void 0 : _node$position2.x) || 0) + (getNodeWidth(node) + 50),
|
|
102
|
+
y: (node === null || node === void 0 || (_node$position3 = node.position) === null || _node$position3 === void 0 ? void 0 : _node$position3.y) || 0
|
|
103
|
+
};
|
|
104
|
+
_context.prev = 7;
|
|
105
|
+
_context.next = 10;
|
|
106
|
+
return onNodeTypeDrop(parentFlow, positionInFlow, type);
|
|
107
|
+
case 10:
|
|
108
|
+
_node = _context.sent;
|
|
109
|
+
if (_node) {
|
|
110
|
+
copyNodeId = _node.id, sourceHandle = _node.connectSourceHandle, targetHandle = _node.connectTargetHandle;
|
|
111
|
+
autoLinkEdge = position === Position.Left ? {
|
|
112
|
+
source: copyNodeId,
|
|
113
|
+
target: nodeId,
|
|
114
|
+
sourceHandle: sourceHandle,
|
|
115
|
+
targetHandle: targetHandle // inputHandle 通过 create 返回,默认输出 sourceHandle 通过接口返回
|
|
116
|
+
} : {
|
|
117
|
+
source: nodeId,
|
|
118
|
+
target: copyNodeId,
|
|
119
|
+
sourceHandle: id,
|
|
120
|
+
targetHandle: targetHandle
|
|
121
|
+
};
|
|
122
|
+
connect(autoLinkEdge); // 自动连接
|
|
123
|
+
}
|
|
124
|
+
_context.next = 16;
|
|
125
|
+
break;
|
|
126
|
+
case 14:
|
|
127
|
+
_context.prev = 14;
|
|
128
|
+
_context.t0 = _context["catch"](7);
|
|
129
|
+
case 16:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context.stop();
|
|
132
|
+
}
|
|
133
|
+
}, _callee, null, [[7, 14]]);
|
|
134
|
+
}));
|
|
135
|
+
return function (_x) {
|
|
136
|
+
return _ref.apply(this, arguments);
|
|
137
|
+
};
|
|
138
|
+
}());
|
|
139
|
+
var connected = connections.length > 0;
|
|
140
|
+
var isError = !isReadonly && required && !connected; // 只读模式下不执行端口检测
|
|
141
|
+
|
|
142
|
+
var handle = /*#__PURE__*/_jsxs(InnerHandle, _objectSpread(_objectSpread({}, props), {}, {
|
|
143
|
+
className: cat(['rxflow-handle', props.className, {
|
|
144
|
+
'rxflow-handle-error': isError,
|
|
145
|
+
'rxflow-handle-linked': connected
|
|
146
|
+
}]),
|
|
147
|
+
style: _objectSpread(_defineProperty({}, position === Position.Left ? 'left' : 'right', 0), style),
|
|
148
|
+
onClick: stopPropagation,
|
|
149
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
150
|
+
className: 'rxflow-handle-circle'
|
|
151
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
152
|
+
className: 'rxflow-handle-bg',
|
|
153
|
+
children: isError ? /*#__PURE__*/_jsx(ExclamationOutlined, {
|
|
154
|
+
className: 'rxflow-handle-icon'
|
|
155
|
+
}) : /*#__PURE__*/_jsx(PlusOutlined, {
|
|
156
|
+
className: 'rxflow-handle-icon'
|
|
157
|
+
})
|
|
158
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
159
|
+
color: 'red',
|
|
160
|
+
title: isError ? errorMessage : null,
|
|
161
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
162
|
+
className: 'rxflow-handle-anchor'
|
|
163
|
+
})
|
|
164
|
+
})]
|
|
165
|
+
}));
|
|
166
|
+
if (!quickAdd || isReadonly) {
|
|
167
|
+
return handle;
|
|
168
|
+
}
|
|
169
|
+
return /*#__PURE__*/_jsx(Popover, {
|
|
170
|
+
arrow: false,
|
|
171
|
+
destroyOnHidden: true,
|
|
172
|
+
placement: position === Position.Left ? 'leftTop' : 'rightTop',
|
|
173
|
+
content: /*#__PURE__*/_jsx(NodePopover, {
|
|
174
|
+
nodeId: nodeId,
|
|
175
|
+
onNodeCreate: onNodeCreate
|
|
176
|
+
}),
|
|
177
|
+
trigger: 'click',
|
|
178
|
+
open: open,
|
|
179
|
+
onOpenChange: setOpen,
|
|
180
|
+
styles: {
|
|
181
|
+
root: {
|
|
182
|
+
paddingLeft: 0
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
classNames: {
|
|
186
|
+
root: 'rxflow-handle-dropdown'
|
|
187
|
+
},
|
|
188
|
+
children: handle
|
|
189
|
+
});
|
|
190
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.rxflow-handle {
|
|
2
|
+
&.react-flow__handle {
|
|
3
|
+
z-index: 1;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
width: 18px;
|
|
8
|
+
height: 18px;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
border: none;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-circle {
|
|
15
|
+
background-color: #fff;
|
|
16
|
+
position: absolute;
|
|
17
|
+
transform: scale(.5);
|
|
18
|
+
width: 18px;
|
|
19
|
+
height: 18px;
|
|
20
|
+
align-items: center;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
transition: all .2s linear 0s;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-bg{
|
|
28
|
+
align-items: center;
|
|
29
|
+
border-radius: 50%;
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
transition: all .2s linear 0s;
|
|
33
|
+
background: #9197f1;
|
|
34
|
+
height: 100%;
|
|
35
|
+
position: relative;
|
|
36
|
+
transform: scale(.4);
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-linked &-bg {
|
|
41
|
+
background: #4d53e8;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-anchor {
|
|
45
|
+
position: absolute;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
left: 0;
|
|
49
|
+
top: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&-dropdown {
|
|
53
|
+
.rxflow-popover-inner-content {
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&-content {
|
|
58
|
+
width: 360px;
|
|
59
|
+
padding: 12px 16px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
&.react-flow__handle {
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
border: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rxflow-handle-icon {
|
|
70
|
+
z-index: 2;
|
|
71
|
+
color: #fff;
|
|
72
|
+
font-size: 6px;
|
|
73
|
+
transition: all .2s linear 0s;
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
opacity: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
&.rxflow-handle-error > &-bg {
|
|
80
|
+
background: red!important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.react-flow__node:hover &-circle {
|
|
84
|
+
transform: scale(1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.react-flow__node:hover &-bg {
|
|
88
|
+
background: #4d53e8;
|
|
89
|
+
transform: scale(.7);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.react-flow__node:hover &:hover > &-circle {
|
|
93
|
+
transform: scale(0.5); // 还原
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.react-flow__node:hover &:hover > &-bg {
|
|
97
|
+
background: #4d53e8;
|
|
98
|
+
border: none;
|
|
99
|
+
cursor: crosshair;
|
|
100
|
+
transform: scale(1);
|
|
101
|
+
|
|
102
|
+
.rxflow-handle-icon {
|
|
103
|
+
opacity: 1;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&-dropdown {
|
|
109
|
+
width: 360px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-21 10:10
|
|
4
|
+
* @modified:2025/7/21 10:10 by yanxianliang
|
|
5
|
+
* @desc: 代码编辑器(行内模式)
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { InlineCodeEditorProps } from "./types";
|
|
10
|
+
export declare const InlineCodeEditor: ({ height, value, onChange, readOnly }: InlineCodeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,gBAAgB,0CAMxB,qBAAqB,4CAIzB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-21 10:10
|
|
4
|
+
* @modified:2025/7/21 10:10 by yanxianliang
|
|
5
|
+
* @desc: 代码编辑器(行内模式)
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { PythonEditor } from "../CodeEditor/editors/Python";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export var InlineCodeEditor = function InlineCodeEditor(_ref) {
|
|
13
|
+
var _ref$height = _ref.height,
|
|
14
|
+
height = _ref$height === void 0 ? 400 : _ref$height,
|
|
15
|
+
value = _ref.value,
|
|
16
|
+
onChange = _ref.onChange,
|
|
17
|
+
readOnly = _ref.readOnly;
|
|
18
|
+
return /*#__PURE__*/_jsx(PythonEditor, {
|
|
19
|
+
value: value,
|
|
20
|
+
height: height,
|
|
21
|
+
readOnly: readOnly,
|
|
22
|
+
onChange: onChange
|
|
23
|
+
});
|
|
24
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-21 10:26
|
|
4
|
+
* @modified:2025/7/21 10:26 by yanxianliang
|
|
5
|
+
* @desc: 类型定义
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type InlineCodeEditorProps = {
|
|
11
|
+
/**
|
|
12
|
+
* @description: 编辑区域高度
|
|
13
|
+
* @default: 400
|
|
14
|
+
*/
|
|
15
|
+
height?: number;
|
|
16
|
+
|
|
17
|
+
value?: string;
|
|
18
|
+
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
|
|
21
|
+
onChange?: (code?: string) => void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-27 12:11
|
|
4
|
+
* @modified:2025/7/27 12:11 by yanxianliang
|
|
5
|
+
* @desc: 布局组件
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { type IBaseFlowProps } from "@rxflow/base";
|
|
10
|
+
import { WorkflowExtendProps, WorkflowNode } from "../..";
|
|
11
|
+
import './index.less';
|
|
12
|
+
import { Edge } from "@xyflow/react";
|
|
13
|
+
export declare const WorkFlowLayout: <NodeType extends WorkflowNode = WorkflowNode, EdgeType extends Edge = Edge>(props: IBaseFlowProps<NodeType, EdgeType> & WorkflowExtendProps<NodeType>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAO,KAAK,cAAc,EAAC,MAAM,cAAc,CAAC;AACvD,OAAO,EAAC,mBAAmB,EAAE,YAAY,EAAC,cAAyB;AACnE,OAAO,cAAc,CAAC;AACtB,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AAInC,eAAO,MAAM,cAAc,sFAGlB,eAAe,QAAQ,EAAE,QAAQ,CAAC,GAAG,oBAAoB,QAAQ,CAAC,4CAkB1E,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-07-27 12:11
|
|
10
|
+
* @modified:2025/7/27 12:11 by yanxianliang
|
|
11
|
+
* @desc: 布局组件
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
import { Flow } from "@rxflow/base";
|
|
16
|
+
import "./index.less";
|
|
17
|
+
import CanvasLoading from "../CanvasLoading";
|
|
18
|
+
import { Sider } from "../Sider";
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
export var WorkFlowLayout = function WorkFlowLayout(props) {
|
|
22
|
+
var readOnly = props.readOnly,
|
|
23
|
+
sider = props.sider,
|
|
24
|
+
loading = props.loading,
|
|
25
|
+
children = props.children;
|
|
26
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
27
|
+
className: 'rxflow-workflow',
|
|
28
|
+
style: {
|
|
29
|
+
height: props.height
|
|
30
|
+
},
|
|
31
|
+
children: [readOnly ? null : /*#__PURE__*/_jsx(Sider, _objectSpread(_objectSpread({}, sider), {}, {
|
|
32
|
+
nodeTypes: props.nodeTypes
|
|
33
|
+
})), /*#__PURE__*/_jsx("div", {
|
|
34
|
+
className: 'rxflow-graph',
|
|
35
|
+
children: /*#__PURE__*/_jsx(CanvasLoading, {
|
|
36
|
+
loading: loading,
|
|
37
|
+
children: /*#__PURE__*/_jsx(Flow, _objectSpread(_objectSpread({}, props), {}, {
|
|
38
|
+
children: children
|
|
39
|
+
}))
|
|
40
|
+
})
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ButtonProps } from 'antd';
|
|
2
|
+
/**
|
|
3
|
+
* LoadingButton 组件
|
|
4
|
+
* - 支持 loading 状态受控/非受控
|
|
5
|
+
* - 支持点击防抖(防止重复点击)
|
|
6
|
+
* - 支持异步 onClick
|
|
7
|
+
*
|
|
8
|
+
* @param props
|
|
9
|
+
* onClick: 点击事件,支持返回 Promise
|
|
10
|
+
* throttle: 防抖间隔,默认 300ms
|
|
11
|
+
*/
|
|
12
|
+
export declare const LoadingButton: (props: Omit<ButtonProps, "onClick"> & {
|
|
13
|
+
onClick?: ((e: React.MouseEvent<HTMLButtonElement>) => Promise<void> | void) | undefined;
|
|
14
|
+
throttle?: number | undefined;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=LoadingButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingButton.d.ts","sourceRoot":"","sources":["LoadingButton.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAU,WAAW,EAAE,MAAM,MAAM,CAAC;AAG3C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;mBAER,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,QAAQ,IAAI,CAAC,GAAG,IAAI;;6CAuD7E,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
/*
|
|
17
|
+
* @author: yanxianliang
|
|
18
|
+
* @date: 2025-05-23 15:19
|
|
19
|
+
* @desc: Loading Button
|
|
20
|
+
*
|
|
21
|
+
* 支持业务防抖
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { useControllableValue, useMemoizedFn } from 'ahooks';
|
|
27
|
+
import { Button } from 'antd';
|
|
28
|
+
import { useRef } from 'react';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* LoadingButton 组件
|
|
32
|
+
* - 支持 loading 状态受控/非受控
|
|
33
|
+
* - 支持点击防抖(防止重复点击)
|
|
34
|
+
* - 支持异步 onClick
|
|
35
|
+
*
|
|
36
|
+
* @param props
|
|
37
|
+
* onClick: 点击事件,支持返回 Promise
|
|
38
|
+
* throttle: 防抖间隔,默认 300ms
|
|
39
|
+
*/
|
|
40
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
41
|
+
export var LoadingButton = function LoadingButton(props) {
|
|
42
|
+
var _props$throttle;
|
|
43
|
+
var lockRef = useRef(false); // 点击锁,loading 无法解决鼠标连击问题
|
|
44
|
+
var throttle = (_props$throttle = props.throttle) !== null && _props$throttle !== void 0 ? _props$throttle : 300;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* loading 状态受控/非受控
|
|
48
|
+
*/
|
|
49
|
+
var _useControllableValue = useControllableValue(props, {
|
|
50
|
+
valuePropName: 'loading',
|
|
51
|
+
trigger: 'onLoadingChange'
|
|
52
|
+
}),
|
|
53
|
+
_useControllableValue2 = _slicedToArray(_useControllableValue, 2),
|
|
54
|
+
loading = _useControllableValue2[0],
|
|
55
|
+
setLoading = _useControllableValue2[1];
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 包装点击事件,支持防抖和 loading
|
|
59
|
+
*/
|
|
60
|
+
var onButtonClick = useMemoizedFn(function (e) {
|
|
61
|
+
var _props$onClick;
|
|
62
|
+
if (lockRef.current) {
|
|
63
|
+
return; // 防抖拦截
|
|
64
|
+
}
|
|
65
|
+
lockRef.current = true;
|
|
66
|
+
var result = (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, e);
|
|
67
|
+
if (result && result instanceof Promise) {
|
|
68
|
+
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
69
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
70
|
+
while (1) switch (_context.prev = _context.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
setLoading(true);
|
|
73
|
+
_context.prev = 1;
|
|
74
|
+
_context.next = 4;
|
|
75
|
+
return result;
|
|
76
|
+
case 4:
|
|
77
|
+
_context.next = 8;
|
|
78
|
+
break;
|
|
79
|
+
case 6:
|
|
80
|
+
_context.prev = 6;
|
|
81
|
+
_context.t0 = _context["catch"](1);
|
|
82
|
+
case 8:
|
|
83
|
+
_context.prev = 8;
|
|
84
|
+
setLoading(false);
|
|
85
|
+
setTimeout(function () {
|
|
86
|
+
lockRef.current = false;
|
|
87
|
+
}, throttle);
|
|
88
|
+
return _context.finish(8);
|
|
89
|
+
case 12:
|
|
90
|
+
case "end":
|
|
91
|
+
return _context.stop();
|
|
92
|
+
}
|
|
93
|
+
}, _callee, null, [[1, 6, 8, 12]]);
|
|
94
|
+
}))();
|
|
95
|
+
} else {
|
|
96
|
+
setTimeout(function () {
|
|
97
|
+
/**
|
|
98
|
+
* 纯前端交互的,进行前端防抖
|
|
99
|
+
*/
|
|
100
|
+
lockRef.current = false;
|
|
101
|
+
}, throttle);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 渲染按钮
|
|
107
|
+
*/
|
|
108
|
+
return /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, props), {}, {
|
|
109
|
+
loading: loading,
|
|
110
|
+
onClick: onButtonClick
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-27 11:34
|
|
4
|
+
* @modified:2025/7/27 11:34 by yanxianliang
|
|
5
|
+
* @desc: 节点列表
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import './index.less';
|
|
10
|
+
import { WorkflowNode, WorkFlowNodeDefinition } from "../..";
|
|
11
|
+
export declare const Sider: <NodeType extends WorkflowNode = WorkflowNode>({ loading, nodeTypes, }: {
|
|
12
|
+
loading?: boolean | undefined;
|
|
13
|
+
nodeTypes?: WorkFlowNodeDefinition<NodeType["data"]>[] | undefined;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,cAAc,CAAC;AAGtB,OAAO,EAAC,YAAY,EAAE,sBAAsB,EAAC,cAAyB;AAQtE,eAAO,MAAM,KAAK;;;6CAqGjB,CAAA"}
|