@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,142 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
/**
|
|
8
|
+
* @author: yanxianliang
|
|
9
|
+
* @date: 2025-07-27 11:34
|
|
10
|
+
* @modified:2025/7/27 11:34 by yanxianliang
|
|
11
|
+
* @desc: 节点列表
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
import "./index.less";
|
|
16
|
+
import { setDragDataTransfer } from "../../utils/dragDataTransfer";
|
|
17
|
+
import CanvasLoading from "../CanvasLoading";
|
|
18
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
19
|
+
import groupBy from 'lodash/groupBy';
|
|
20
|
+
import { Input, List, Space } from "antd";
|
|
21
|
+
import React from "react";
|
|
22
|
+
import SearchOutlined from "@ant-design/icons/lib/icons/SearchOutlined";
|
|
23
|
+
import Highlighter from "react-highlight-words";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
export var Sider = function Sider(_ref) {
|
|
27
|
+
var loading = _ref.loading,
|
|
28
|
+
_ref$nodeTypes = _ref.nodeTypes,
|
|
29
|
+
nodeTypes = _ref$nodeTypes === void 0 ? [] : _ref$nodeTypes;
|
|
30
|
+
var _useState = useState(''),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
filter = _useState2[0],
|
|
33
|
+
setFilter = _useState2[1];
|
|
34
|
+
|
|
35
|
+
// 分组
|
|
36
|
+
var nodeCategoryList = useMemo(function () {
|
|
37
|
+
if (!nodeTypes || !nodeTypes.length) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
// 分组
|
|
41
|
+
var group = groupBy(nodeTypes.filter(function (type) {
|
|
42
|
+
return !type.hideInSider && type.label && type.label.indexOf(filter) > -1;
|
|
43
|
+
}), function (node) {
|
|
44
|
+
return node.group || '';
|
|
45
|
+
});
|
|
46
|
+
return Object.keys(group).map(function (category) {
|
|
47
|
+
return {
|
|
48
|
+
group: category,
|
|
49
|
+
list: group[category] || []
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}, [nodeTypes, filter]);
|
|
53
|
+
var onDragStart = useCallback(function (ev) {
|
|
54
|
+
var element = ev.target;
|
|
55
|
+
var nodeType = element.getAttribute("data-node-type");
|
|
56
|
+
var rect = element.getBoundingClientRect();
|
|
57
|
+
var offsetX = ev.clientX - rect.left; // 鼠标在元素内的X偏移[6]
|
|
58
|
+
var offsetY = ev.clientY - rect.top; // 鼠标在元素内的Y偏移[6]
|
|
59
|
+
ev.dataTransfer.effectAllowed = 'move';
|
|
60
|
+
ev.dataTransfer.setData('node@drag', nodeType);
|
|
61
|
+
setDragDataTransfer({
|
|
62
|
+
width: rect.width,
|
|
63
|
+
height: rect.height,
|
|
64
|
+
offsetX: offsetX,
|
|
65
|
+
offsetY: offsetY,
|
|
66
|
+
type: nodeType
|
|
67
|
+
});
|
|
68
|
+
}, []);
|
|
69
|
+
var onSearch = useCallback(function (e) {
|
|
70
|
+
setFilter(e.currentTarget.value);
|
|
71
|
+
}, []);
|
|
72
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
73
|
+
className: 'rxflow-sider',
|
|
74
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
75
|
+
className: 'rxflow-sider-search',
|
|
76
|
+
children: /*#__PURE__*/_jsx(Input, {
|
|
77
|
+
onChange: onSearch,
|
|
78
|
+
prefix: /*#__PURE__*/_jsx(SearchOutlined, {
|
|
79
|
+
style: {
|
|
80
|
+
color: 'rgba(32, 41, 69, 0.62)'
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
placeholder: '搜索节点'
|
|
84
|
+
})
|
|
85
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
86
|
+
className: 'rxflow-sider-scroll',
|
|
87
|
+
children: /*#__PURE__*/_jsx(CanvasLoading, {
|
|
88
|
+
loading: loading,
|
|
89
|
+
tip: '节点加载中...',
|
|
90
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
91
|
+
className: 'rxflow-sider-content',
|
|
92
|
+
children: /*#__PURE__*/_jsx(Space, {
|
|
93
|
+
size: 12,
|
|
94
|
+
direction: 'vertical',
|
|
95
|
+
style: {
|
|
96
|
+
width: '100%'
|
|
97
|
+
},
|
|
98
|
+
children: nodeCategoryList.map(function (categoryItem) {
|
|
99
|
+
var group = categoryItem.group,
|
|
100
|
+
list = categoryItem.list;
|
|
101
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
102
|
+
children: [group ? /*#__PURE__*/_jsx("div", {
|
|
103
|
+
className: 'rxflow-sider-group',
|
|
104
|
+
children: group
|
|
105
|
+
}) : null, /*#__PURE__*/_jsx(List, {
|
|
106
|
+
grid: {
|
|
107
|
+
gutter: 0,
|
|
108
|
+
column: 1
|
|
109
|
+
},
|
|
110
|
+
dataSource: list,
|
|
111
|
+
renderItem: function renderItem(item) {
|
|
112
|
+
var icon = item.icon,
|
|
113
|
+
label = item.label;
|
|
114
|
+
return /*#__PURE__*/_jsx(List.Item, {
|
|
115
|
+
className: 'rxflow-sider-item',
|
|
116
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
117
|
+
draggable: true,
|
|
118
|
+
className: 'rxflow-sider-card',
|
|
119
|
+
onDragStart: onDragStart,
|
|
120
|
+
"data-node-type": item.type,
|
|
121
|
+
children: [icon ? /*#__PURE__*/_jsx("span", {
|
|
122
|
+
className: 'rxflow-sider-icon',
|
|
123
|
+
children: icon
|
|
124
|
+
}) : null, /*#__PURE__*/_jsx("span", {
|
|
125
|
+
children: /*#__PURE__*/_jsx(Highlighter, {
|
|
126
|
+
highlightClassName: 'rxflow-sider-highlight',
|
|
127
|
+
textToHighlight: label || '',
|
|
128
|
+
searchWords: [filter]
|
|
129
|
+
})
|
|
130
|
+
})]
|
|
131
|
+
})
|
|
132
|
+
}, item.type);
|
|
133
|
+
}
|
|
134
|
+
})]
|
|
135
|
+
}, group);
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
})]
|
|
141
|
+
});
|
|
142
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.rxflow-sider{
|
|
2
|
+
width: 220px;
|
|
3
|
+
position: relative;
|
|
4
|
+
overflow: auto; // 显示滚动条
|
|
5
|
+
user-select: none;
|
|
6
|
+
background: #fff;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
|
|
10
|
+
&-search {
|
|
11
|
+
padding: 12px 10px 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-scroll {
|
|
15
|
+
flex: 1;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-highlight{
|
|
21
|
+
color: rgb(255, 115, 0);
|
|
22
|
+
background: transparent;
|
|
23
|
+
mark&{
|
|
24
|
+
padding: 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-group {
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
color: rgba(32, 41, 69, 0.62);
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
margin-bottom: 4px;
|
|
33
|
+
padding-left: 4px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-icon {
|
|
37
|
+
font-size: 20px;
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-card{
|
|
42
|
+
height: 32px;
|
|
43
|
+
display: flex;
|
|
44
|
+
border-radius: 8px;
|
|
45
|
+
padding: 0 6px;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
align-items: center;
|
|
48
|
+
cursor: grab;
|
|
49
|
+
gap: 6px;
|
|
50
|
+
background: #fff;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
-webkit-backface-visibility: hidden;
|
|
53
|
+
transform: translateZ(0);
|
|
54
|
+
&:hover {
|
|
55
|
+
background-color: rgba(87, 104, 161, 0.08);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&-content{
|
|
60
|
+
padding: 10px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-item{
|
|
64
|
+
.rxflow-list-grid .rxflow-col > &.rxflow-list-item{
|
|
65
|
+
margin-bottom: 10px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-23 12:46
|
|
4
|
+
* @modified:2025/8/23 12:46 by yanxianliang
|
|
5
|
+
* @desc: 运行状态枚举
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum RunningStatus {
|
|
10
|
+
running = "running",
|
|
11
|
+
success = "success",
|
|
12
|
+
error = "error"
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=RunningStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunningStatus.d.ts","sourceRoot":"","sources":["RunningStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-23 12:46
|
|
4
|
+
* @modified:2025/8/23 12:46 by yanxianliang
|
|
5
|
+
* @desc: 运行状态枚举
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export var RunningStatus = /*#__PURE__*/function (RunningStatus) {
|
|
11
|
+
RunningStatus["running"] = "running";
|
|
12
|
+
RunningStatus["success"] = "success";
|
|
13
|
+
RunningStatus["error"] = "error";
|
|
14
|
+
return RunningStatus;
|
|
15
|
+
}({});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-23 09:42
|
|
4
|
+
* @modified:2025/7/23 09:42 by yanxianliang
|
|
5
|
+
* @desc: Edge 是否高亮
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { EdgeProps } from "@xyflow/react";
|
|
10
|
+
/**
|
|
11
|
+
* 检测边是否高亮
|
|
12
|
+
* @param edge
|
|
13
|
+
*/
|
|
14
|
+
export declare function useActiveEdge(edge: Pick<EdgeProps, 'source' | 'target' | 'sourceHandleId' | 'targetHandleId'>): boolean;
|
|
15
|
+
//# sourceMappingURL=useActiveEdge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useActiveEdge.d.ts","sourceRoot":"","sources":["useActiveEdge.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAIxC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,WAY7G"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-23 09:42
|
|
4
|
+
* @modified:2025/7/23 09:42 by yanxianliang
|
|
5
|
+
* @desc: Edge 是否高亮
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useSelector } from "../state";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 检测边是否高亮
|
|
14
|
+
* @param edge
|
|
15
|
+
*/
|
|
16
|
+
export function useActiveEdge(edge) {
|
|
17
|
+
return useSelector(function (state) {
|
|
18
|
+
var _state$runState;
|
|
19
|
+
var edgeSet = (_state$runState = state.runState) === null || _state$runState === void 0 ? void 0 : _state$runState.activeEdges; // active Set
|
|
20
|
+
var source = edge.source,
|
|
21
|
+
sourceHandleId = edge.sourceHandleId,
|
|
22
|
+
targetHandleId = edge.targetHandleId,
|
|
23
|
+
target = edge.target;
|
|
24
|
+
if (!edgeSet) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
// 查找是否有对应的边
|
|
28
|
+
return edgeSet.has("".concat(source, ",").concat(sourceHandleId, ",").concat(target, ",").concat(targetHandleId)) || edgeSet.has("".concat(source, ",").concat(sourceHandleId, ",").concat(target)) || edgeSet.has("".concat(source, ",").concat(target));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves the setDebugStore function from the zustand store within the DebugContext.
|
|
3
|
+
* This function is intended to be used for setting the debug state in a React application.
|
|
4
|
+
* If the DebugContext provider is missing, it will log an error and throw an exception.
|
|
5
|
+
*
|
|
6
|
+
* @throws {Error} Throws an error if the DebugContext provider is not found.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useCleanRunState: () => () => void;
|
|
9
|
+
//# sourceMappingURL=useCleanRunState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCleanRunState.d.ts","sourceRoot":"","sources":["useCleanRunState.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,kBAO5B,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-23 18:15
|
|
4
|
+
* @modified:2025/8/23 18:15 by yanxianliang
|
|
5
|
+
* @desc:
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { useCallback } from "react";
|
|
10
|
+
import { useSetState } from "../state";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves the setDebugStore function from the zustand store within the DebugContext.
|
|
14
|
+
* This function is intended to be used for setting the debug state in a React application.
|
|
15
|
+
* If the DebugContext provider is missing, it will log an error and throw an exception.
|
|
16
|
+
*
|
|
17
|
+
* @throws {Error} Throws an error if the DebugContext provider is not found.
|
|
18
|
+
*/
|
|
19
|
+
export var useCleanRunState = function useCleanRunState() {
|
|
20
|
+
var setState = useSetState();
|
|
21
|
+
return useCallback(function () {
|
|
22
|
+
setState({
|
|
23
|
+
runState: undefined
|
|
24
|
+
});
|
|
25
|
+
}, []);
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom hook that retrieves the debug state for a specific node.
|
|
3
|
+
* It uses the `useNodeId` hook to get the node ID and the `DebugContext` context to access the debug store.
|
|
4
|
+
* If the `DebugContext` provider is missing, it throws an error.
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare const useNodeRunningState: (nodeId?: string) => import("../..").NodeRunState | undefined;
|
|
8
|
+
//# sourceMappingURL=useNodeRunningState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNodeRunningState.d.ts","sourceRoot":"","sources":["useNodeRunningState.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YAAa,MAAM,6CAIlD,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-19 17:21
|
|
4
|
+
* @modified:2025/7/19 17:21 by yanxianliang
|
|
5
|
+
* @desc: 获取节点运行/调试状态
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { useNodeId } from "@xyflow/react";
|
|
10
|
+
import { useShallow } from "zustand/react/shallow";
|
|
11
|
+
import { useSelector } from "../state";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A custom hook that retrieves the debug state for a specific node.
|
|
15
|
+
* It uses the `useNodeId` hook to get the node ID and the `DebugContext` context to access the debug store.
|
|
16
|
+
* If the `DebugContext` provider is missing, it throws an error.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export var useNodeRunningState = function useNodeRunningState(nodeId) {
|
|
20
|
+
var innerId = useNodeId();
|
|
21
|
+
var id = nodeId || innerId;
|
|
22
|
+
return useSelector(useShallow(function (state) {
|
|
23
|
+
var _state$runState;
|
|
24
|
+
return id ? (_state$runState = state.runState) === null || _state$runState === void 0 || (_state$runState = _state$runState.nodeRunMap) === null || _state$runState === void 0 ? void 0 : _state$runState[id] : undefined;
|
|
25
|
+
}));
|
|
26
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-24 09:33
|
|
4
|
+
* @modified:2025/7/24 09:33 by yanxianliang
|
|
5
|
+
* @desc: get/set run state
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* useNodeDebugState is a custom hook that provides access to the debug state and allows modification of the running state.
|
|
11
|
+
* It utilizes the DebugContext to retrieve the zustand store, which holds the debug state information.
|
|
12
|
+
* If the DebugContext provider is missing, it throws an error.
|
|
13
|
+
*
|
|
14
|
+
* @returns A tuple where the first element is a boolean indicating if the debug is running,
|
|
15
|
+
* and the second element is a function to set the running state.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useRunState: () => {
|
|
18
|
+
readonly runningStatus: import("../..").RunningStatus | undefined;
|
|
19
|
+
readonly timeSpent: number | undefined;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useRunState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRunState.d.ts","sourceRoot":"","sources":["useRunState.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;CAUvB,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-24 09:33
|
|
4
|
+
* @modified:2025/7/24 09:33 by yanxianliang
|
|
5
|
+
* @desc: get/set run state
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useShallow } from "zustand/react/shallow";
|
|
11
|
+
import { useSelector } from "../state";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* useNodeDebugState is a custom hook that provides access to the debug state and allows modification of the running state.
|
|
15
|
+
* It utilizes the DebugContext to retrieve the zustand store, which holds the debug state information.
|
|
16
|
+
* If the DebugContext provider is missing, it throws an error.
|
|
17
|
+
*
|
|
18
|
+
* @returns A tuple where the first element is a boolean indicating if the debug is running,
|
|
19
|
+
* and the second element is a function to set the running state.
|
|
20
|
+
*/
|
|
21
|
+
export var useRunState = function useRunState() {
|
|
22
|
+
var _useSelector = useSelector(useShallow(function (state) {
|
|
23
|
+
var _state$runState, _state$runState2;
|
|
24
|
+
return {
|
|
25
|
+
runningStatus: (_state$runState = state.runState) === null || _state$runState === void 0 ? void 0 : _state$runState.runningStatus,
|
|
26
|
+
timeSpent: (_state$runState2 = state.runState) === null || _state$runState2 === void 0 ? void 0 : _state$runState2.timeSpent
|
|
27
|
+
};
|
|
28
|
+
})),
|
|
29
|
+
runningStatus = _useSelector.runningStatus,
|
|
30
|
+
timeSpent = _useSelector.timeSpent;
|
|
31
|
+
return {
|
|
32
|
+
runningStatus: runningStatus,
|
|
33
|
+
timeSpent: timeSpent
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-07-19 19:55
|
|
4
|
+
* @modified:2025/7/19 19:55 by yanxianliang
|
|
5
|
+
* @desc: 设置运行/调试 状态
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { WorkflowRunState } from "../..";
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves the setDebugStore function from the zustand store within the DebugContext.
|
|
12
|
+
* This function is intended to be used for setting the debug state in a React application.
|
|
13
|
+
* If the DebugContext provider is missing, it will log an error and throw an exception.
|
|
14
|
+
*
|
|
15
|
+
* @throws {Error} Throws an error if the DebugContext provider is not found.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useSetRunState: () => (runState: Partial<WorkflowRunState>) => void;
|
|
18
|
+
//# sourceMappingURL=useSetRunState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSetRunState.d.ts","sourceRoot":"","sources":["useSetRunState.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,gBAAgB,EAAC,cAAyB;AAIlD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,mBAEK,QAAQ,gBAAgB,CAAC,SAWxD,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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-19 19:55
|
|
10
|
+
* @modified:2025/7/19 19:55 by yanxianliang
|
|
11
|
+
* @desc: 设置运行/调试 状态
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useCallback } from "react";
|
|
17
|
+
import { useSetState } from "../state";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the setDebugStore function from the zustand store within the DebugContext.
|
|
21
|
+
* This function is intended to be used for setting the debug state in a React application.
|
|
22
|
+
* If the DebugContext provider is missing, it will log an error and throw an exception.
|
|
23
|
+
*
|
|
24
|
+
* @throws {Error} Throws an error if the DebugContext provider is not found.
|
|
25
|
+
*/
|
|
26
|
+
export var useSetRunState = function useSetRunState() {
|
|
27
|
+
var setState = useSetState();
|
|
28
|
+
return useCallback(function (runState) {
|
|
29
|
+
setState(function (state) {
|
|
30
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
31
|
+
runState: _objectSpread(_objectSpread({}, state.runState), runState)
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}, []);
|
|
35
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WorkflowBaseState } from "..";
|
|
2
|
+
import { ExtractState } from "@rxflow/base";
|
|
3
|
+
import { StoreApi } from 'zustand';
|
|
4
|
+
export declare const useSetState: () => (partial: WorkflowBaseState | Partial<WorkflowBaseState> | ((state: WorkflowBaseState) => WorkflowBaseState | Partial<WorkflowBaseState>), replace?: boolean | undefined) => void;
|
|
5
|
+
export declare const useGetState: () => () => WorkflowBaseState;
|
|
6
|
+
export declare const useSelector: <U>(selector: (state: ExtractState<StoreApi<WorkflowBaseState>>) => U) => U;
|
|
7
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["state.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,WAAyB;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,WAAW,yLAAkC,CAAC;AAE3D,eAAO,MAAM,WAAW,+BAAkC,CAAC;AAG3D,eAAO,MAAM,WAAW,wBAAyB,aAAa,SAAS,iBAAiB,CAAC,CAAC,KAAK,CAAC,MAE/F,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useSetState as _useSetState, useGetState as _useGetState, useSelector as _useSelector } from '@rxflow/base';
|
|
2
|
+
export var useSetState = _useSetState;
|
|
3
|
+
export var useGetState = _useGetState;
|
|
4
|
+
export var useSelector = function useSelector(selector) {
|
|
5
|
+
return _useSelector(selector);
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteNode.d.ts","sourceRoot":"","sources":["useDeleteNode.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa,aAEM,MAAM,kBAQrC,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 _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; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
/**
|
|
6
|
+
* @author: yanxianliang
|
|
7
|
+
* @date: 2025-08-18 19:45
|
|
8
|
+
* @modified:2025/8/18 19:45 by yanxianliang
|
|
9
|
+
* @desc: 删除节点的 hook
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
12
|
+
*/
|
|
13
|
+
import { useReactFlow } from "@xyflow/react";
|
|
14
|
+
import { useCallback } from "react";
|
|
15
|
+
export var useDeleteNode = function useDeleteNode() {
|
|
16
|
+
var _useReactFlow = useReactFlow(),
|
|
17
|
+
deleteElements = _useReactFlow.deleteElements,
|
|
18
|
+
getNode = _useReactFlow.getNode;
|
|
19
|
+
return useCallback( /*#__PURE__*/function () {
|
|
20
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
|
|
21
|
+
var node;
|
|
22
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
23
|
+
while (1) switch (_context.prev = _context.next) {
|
|
24
|
+
case 0:
|
|
25
|
+
node = getNode(id);
|
|
26
|
+
if (!node) {
|
|
27
|
+
_context.next = 4;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
_context.next = 4;
|
|
31
|
+
return deleteElements({
|
|
32
|
+
nodes: [node]
|
|
33
|
+
});
|
|
34
|
+
case 4:
|
|
35
|
+
case "end":
|
|
36
|
+
return _context.stop();
|
|
37
|
+
}
|
|
38
|
+
}, _callee);
|
|
39
|
+
}));
|
|
40
|
+
return function (_x) {
|
|
41
|
+
return _ref.apply(this, arguments);
|
|
42
|
+
};
|
|
43
|
+
}(), []);
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEdgeIsHover.d.ts","sourceRoot":"","sources":["useEdgeIsHover.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,OAAQ,MAAM,YAExC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-15 22:06
|
|
4
|
+
* @modified:2025/8/15 22:06 by yanxianliang
|
|
5
|
+
* @desc: Edge Hover State
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
import { useSelector } from "./state";
|
|
10
|
+
export var useEdgeIsHover = function useEdgeIsHover(id) {
|
|
11
|
+
return useSelector(function (state) {
|
|
12
|
+
return state.hoveredEdge === id;
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author: yanxianliang
|
|
3
|
+
* @date: 2025-08-11 14:18
|
|
4
|
+
* @modified:2025/8/11 14:18 by yanxianliang
|
|
5
|
+
* @desc: 获取选中的节点和边列表
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useGetSelection: () => () => {
|
|
10
|
+
selectedNodes: string[] | undefined;
|
|
11
|
+
selectedEdges: string[] | undefined;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useGetSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetSelection.d.ts","sourceRoot":"","sources":["useGetSelection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,eAAO,MAAM,eAAe;;;CAS3B,CAAA"}
|