@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.
Files changed (446) hide show
  1. package/README.md +43 -0
  2. package/cjs/components/CanvasLoading/index.d.ts +14 -0
  3. package/cjs/components/CanvasLoading/index.d.ts.map +1 -0
  4. package/cjs/components/CanvasLoading/index.js +51 -0
  5. package/cjs/components/CanvasLoading/index.less +69 -0
  6. package/cjs/components/CodeEditor/DebugPanel/index.d.ts +16 -0
  7. package/cjs/components/CodeEditor/DebugPanel/index.d.ts.map +1 -0
  8. package/cjs/components/CodeEditor/DebugPanel/index.js +156 -0
  9. package/cjs/components/CodeEditor/DebugPanel/index.less +56 -0
  10. package/cjs/components/CodeEditor/FileTree/LibraryIcon.d.ts +11 -0
  11. package/cjs/components/CodeEditor/FileTree/LibraryIcon.d.ts.map +1 -0
  12. package/cjs/components/CodeEditor/FileTree/LibraryIcon.js +33 -0
  13. package/cjs/components/CodeEditor/FileTree/icons/Javascript.d.ts +11 -0
  14. package/cjs/components/CodeEditor/FileTree/icons/Javascript.d.ts.map +1 -0
  15. package/cjs/components/CodeEditor/FileTree/icons/Javascript.js +37 -0
  16. package/cjs/components/CodeEditor/FileTree/icons/Python.d.ts +11 -0
  17. package/cjs/components/CodeEditor/FileTree/icons/Python.d.ts.map +1 -0
  18. package/cjs/components/CodeEditor/FileTree/icons/Python.js +37 -0
  19. package/cjs/components/CodeEditor/FileTree/index.d.ts +9 -0
  20. package/cjs/components/CodeEditor/FileTree/index.d.ts.map +1 -0
  21. package/cjs/components/CodeEditor/FileTree/index.js +73 -0
  22. package/cjs/components/CodeEditor/FileTree/index.less +83 -0
  23. package/cjs/components/CodeEditor/FileTree/useFileIcon.d.ts +11 -0
  24. package/cjs/components/CodeEditor/FileTree/useFileIcon.d.ts.map +1 -0
  25. package/cjs/components/CodeEditor/FileTree/useFileIcon.js +44 -0
  26. package/cjs/components/CodeEditor/Header/index.d.ts +15 -0
  27. package/cjs/components/CodeEditor/Header/index.d.ts.map +1 -0
  28. package/cjs/components/CodeEditor/Header/index.js +51 -0
  29. package/cjs/components/CodeEditor/Header/style.less +23 -0
  30. package/cjs/components/CodeEditor/Terminal/XTerm.d.ts +5 -0
  31. package/cjs/components/CodeEditor/Terminal/XTerm.d.ts.map +1 -0
  32. package/cjs/components/CodeEditor/Terminal/XTerm.js +54 -0
  33. package/cjs/components/CodeEditor/Terminal/index.d.ts +15 -0
  34. package/cjs/components/CodeEditor/Terminal/index.d.ts.map +1 -0
  35. package/cjs/components/CodeEditor/Terminal/index.js +30 -0
  36. package/cjs/components/CodeEditor/Terminal/index.less +28 -0
  37. package/cjs/components/CodeEditor/Terminal/types.d.ts +13 -0
  38. package/cjs/components/CodeEditor/editors/JSON.d.ts +12 -0
  39. package/cjs/components/CodeEditor/editors/JSON.d.ts.map +1 -0
  40. package/cjs/components/CodeEditor/editors/JSON.js +43 -0
  41. package/cjs/components/CodeEditor/editors/Python.d.ts +4 -0
  42. package/cjs/components/CodeEditor/editors/Python.d.ts.map +1 -0
  43. package/cjs/components/CodeEditor/editors/Python.js +43 -0
  44. package/cjs/components/CodeEditor/editors/index.less +11 -0
  45. package/cjs/components/CodeEditor/editors/types.d.ts +24 -0
  46. package/cjs/components/CodeEditor/index.d.ts +7 -0
  47. package/cjs/components/CodeEditor/index.d.ts.map +1 -0
  48. package/cjs/components/CodeEditor/index.js +230 -0
  49. package/cjs/components/CodeEditor/style.less +49 -0
  50. package/cjs/components/CodeEditor/types.d.ts +46 -0
  51. package/cjs/components/Handle/NodePopover.d.ts +15 -0
  52. package/cjs/components/Handle/NodePopover.d.ts.map +1 -0
  53. package/cjs/components/Handle/NodePopover.js +169 -0
  54. package/cjs/components/Handle/index.d.ts +24 -0
  55. package/cjs/components/Handle/index.d.ts.map +1 -0
  56. package/cjs/components/Handle/index.js +165 -0
  57. package/cjs/components/Handle/index.less +111 -0
  58. package/cjs/components/InlineCodeEditor/index.d.ts +11 -0
  59. package/cjs/components/InlineCodeEditor/index.d.ts.map +1 -0
  60. package/cjs/components/InlineCodeEditor/index.js +31 -0
  61. package/cjs/components/InlineCodeEditor/index.module.less +0 -0
  62. package/cjs/components/InlineCodeEditor/types.d.ts +22 -0
  63. package/cjs/components/Layout/index.d.ts +14 -0
  64. package/cjs/components/Layout/index.d.ts.map +1 -0
  65. package/cjs/components/Layout/index.js +49 -0
  66. package/cjs/components/Layout/index.less +14 -0
  67. package/cjs/components/LoadingButton.d.ts +16 -0
  68. package/cjs/components/LoadingButton.d.ts.map +1 -0
  69. package/cjs/components/LoadingButton.js +86 -0
  70. package/cjs/components/Sider/index.d.ts +15 -0
  71. package/cjs/components/Sider/index.d.ts.map +1 -0
  72. package/cjs/components/Sider/index.js +142 -0
  73. package/cjs/components/Sider/index.less +68 -0
  74. package/cjs/constants/RunningStatus.d.ts +14 -0
  75. package/cjs/constants/RunningStatus.d.ts.map +1 -0
  76. package/cjs/constants/RunningStatus.js +20 -0
  77. package/cjs/hooks/run/useActiveEdge.d.ts +15 -0
  78. package/cjs/hooks/run/useActiveEdge.d.ts.map +1 -0
  79. package/cjs/hooks/run/useActiveEdge.js +36 -0
  80. package/cjs/hooks/run/useCleanRunState.d.ts +9 -0
  81. package/cjs/hooks/run/useCleanRunState.d.ts.map +1 -0
  82. package/cjs/hooks/run/useCleanRunState.js +33 -0
  83. package/cjs/hooks/run/useNodeRunningState.d.ts +8 -0
  84. package/cjs/hooks/run/useNodeRunningState.d.ts.map +1 -0
  85. package/cjs/hooks/run/useNodeRunningState.js +30 -0
  86. package/cjs/hooks/run/useRunState.d.ts +21 -0
  87. package/cjs/hooks/run/useRunState.d.ts.map +1 -0
  88. package/cjs/hooks/run/useRunState.js +39 -0
  89. package/cjs/hooks/run/useSetRunState.d.ts +18 -0
  90. package/cjs/hooks/run/useSetRunState.d.ts.map +1 -0
  91. package/cjs/hooks/run/useSetRunState.js +39 -0
  92. package/cjs/hooks/state.d.ts +7 -0
  93. package/cjs/hooks/state.d.ts.map +1 -0
  94. package/cjs/hooks/state.js +13 -0
  95. package/cjs/hooks/useDeleteNode.d.ts +2 -0
  96. package/cjs/hooks/useDeleteNode.d.ts.map +1 -0
  97. package/cjs/hooks/useDeleteNode.js +32 -0
  98. package/cjs/hooks/useEdgeIsHover.d.ts +2 -0
  99. package/cjs/hooks/useEdgeIsHover.d.ts.map +1 -0
  100. package/cjs/hooks/useEdgeIsHover.js +20 -0
  101. package/cjs/hooks/useGetSelection.d.ts +13 -0
  102. package/cjs/hooks/useGetSelection.d.ts.map +1 -0
  103. package/cjs/hooks/useGetSelection.js +28 -0
  104. package/cjs/hooks/useGetUpstreamNodes.d.ts +14 -0
  105. package/cjs/hooks/useGetUpstreamNodes.d.ts.map +1 -0
  106. package/cjs/hooks/useGetUpstreamNodes.js +81 -0
  107. package/cjs/hooks/useGetWillDropTarget.d.ts +5 -0
  108. package/cjs/hooks/useGetWillDropTarget.d.ts.map +1 -0
  109. package/cjs/hooks/useGetWillDropTarget.js +27 -0
  110. package/cjs/hooks/useGroupIsWillDrop.d.ts +2 -0
  111. package/cjs/hooks/useGroupIsWillDrop.d.ts.map +1 -0
  112. package/cjs/hooks/useGroupIsWillDrop.js +20 -0
  113. package/cjs/hooks/useIsValidConnection.d.ts +12 -0
  114. package/cjs/hooks/useIsValidConnection.d.ts.map +1 -0
  115. package/cjs/hooks/useIsValidConnection.js +83 -0
  116. package/cjs/hooks/useMouseEvents.d.ts +19 -0
  117. package/cjs/hooks/useMouseEvents.d.ts.map +1 -0
  118. package/cjs/hooks/useMouseEvents.js +49 -0
  119. package/cjs/hooks/useNodeDragHandles.d.ts +10 -0
  120. package/cjs/hooks/useNodeDragHandles.d.ts.map +1 -0
  121. package/cjs/hooks/useNodeDragHandles.js +273 -0
  122. package/cjs/hooks/useNodes.d.ts +9 -0
  123. package/cjs/hooks/useNodes.d.ts.map +1 -0
  124. package/cjs/hooks/useNodes.js +19 -0
  125. package/cjs/hooks/useOnBeforeDelete.d.ts +19 -0
  126. package/cjs/hooks/useOnBeforeDelete.d.ts.map +1 -0
  127. package/cjs/hooks/useOnBeforeDelete.js +104 -0
  128. package/cjs/hooks/useOnConnect.d.ts +12 -0
  129. package/cjs/hooks/useOnConnect.d.ts.map +1 -0
  130. package/cjs/hooks/useOnConnect.js +36 -0
  131. package/cjs/hooks/useOnEdgeMouseEnter.d.ts +13 -0
  132. package/cjs/hooks/useOnEdgeMouseEnter.d.ts.map +1 -0
  133. package/cjs/hooks/useOnEdgeMouseEnter.js +27 -0
  134. package/cjs/hooks/useOnEdgeMouseLeave.d.ts +13 -0
  135. package/cjs/hooks/useOnEdgeMouseLeave.d.ts.map +1 -0
  136. package/cjs/hooks/useOnEdgeMouseLeave.js +27 -0
  137. package/cjs/hooks/useOnNodesChange.d.ts +4 -0
  138. package/cjs/hooks/useOnNodesChange.d.ts.map +1 -0
  139. package/cjs/hooks/useOnNodesChange.js +102 -0
  140. package/cjs/hooks/useOnSelectionChange.d.ts +13 -0
  141. package/cjs/hooks/useOnSelectionChange.d.ts.map +1 -0
  142. package/cjs/hooks/useOnSelectionChange.js +130 -0
  143. package/cjs/hooks/useSetEdges.d.ts +12 -0
  144. package/cjs/hooks/useSetEdges.d.ts.map +1 -0
  145. package/cjs/hooks/useSetEdges.js +29 -0
  146. package/cjs/hooks/useSetSelection.d.ts +3 -0
  147. package/cjs/hooks/useSetSelection.d.ts.map +1 -0
  148. package/cjs/hooks/useSetSelection.js +40 -0
  149. package/cjs/hooks/useSetWillDropTargets.d.ts +2 -0
  150. package/cjs/hooks/useSetWillDropTargets.d.ts.map +1 -0
  151. package/cjs/hooks/useSetWillDropTargets.js +26 -0
  152. package/cjs/hooks/useUpstream.d.ts +3 -0
  153. package/cjs/hooks/useUpstream.d.ts.map +1 -0
  154. package/cjs/hooks/useUpstream.js +105 -0
  155. package/cjs/hooks/useWatchSelectionNodes.d.ts +2 -0
  156. package/cjs/hooks/useWatchSelectionNodes.d.ts.map +1 -0
  157. package/cjs/hooks/useWatchSelectionNodes.js +22 -0
  158. package/cjs/hooks/useWorkFlow.d.ts +12 -0
  159. package/cjs/hooks/useWorkFlow.d.ts.map +1 -0
  160. package/cjs/hooks/useWorkFlow.js +93 -0
  161. package/cjs/hooks/useWorkFlowProps.d.ts +485 -0
  162. package/cjs/hooks/useWorkFlowProps.d.ts.map +1 -0
  163. package/cjs/hooks/useWorkFlowProps.js +98 -0
  164. package/cjs/index.d.ts +23 -0
  165. package/cjs/index.d.ts.map +1 -0
  166. package/cjs/index.js +77 -0
  167. package/cjs/types.d.ts +103 -0
  168. package/cjs/types.d.ts.map +1 -0
  169. package/cjs/types.js +8 -0
  170. package/cjs/utils/arrayUtils.d.ts +2 -0
  171. package/cjs/utils/arrayUtils.d.ts.map +1 -0
  172. package/cjs/utils/arrayUtils.js +23 -0
  173. package/cjs/utils/checkChildren.d.ts +11 -0
  174. package/cjs/utils/checkChildren.d.ts.map +1 -0
  175. package/cjs/utils/checkChildren.js +27 -0
  176. package/cjs/utils/dimensions.d.ts +12 -0
  177. package/cjs/utils/dimensions.d.ts.map +1 -0
  178. package/cjs/utils/dimensions.js +23 -0
  179. package/cjs/utils/dragDataTransfer.d.ts +19 -0
  180. package/cjs/utils/dragDataTransfer.d.ts.map +1 -0
  181. package/cjs/utils/dragDataTransfer.js +29 -0
  182. package/cjs/utils/dropTargetsCheck.d.ts +20 -0
  183. package/cjs/utils/dropTargetsCheck.d.ts.map +1 -0
  184. package/cjs/utils/dropTargetsCheck.js +105 -0
  185. package/cjs/utils/edgeEqualConnect.d.ts +11 -0
  186. package/cjs/utils/edgeEqualConnect.d.ts.map +1 -0
  187. package/cjs/utils/edgeEqualConnect.js +19 -0
  188. package/cjs/utils/events.d.ts +11 -0
  189. package/cjs/utils/events.d.ts.map +1 -0
  190. package/cjs/utils/events.js +19 -0
  191. package/cjs/utils/getEdgeId.d.ts +12 -0
  192. package/cjs/utils/getEdgeId.d.ts.map +1 -0
  193. package/cjs/utils/getEdgeId.js +22 -0
  194. package/cjs/utils/getParentFlow.d.ts +5 -0
  195. package/cjs/utils/getParentFlow.d.ts.map +1 -0
  196. package/cjs/utils/getParentFlow.js +36 -0
  197. package/cjs/utils/graph.d.ts +12 -0
  198. package/cjs/utils/graph.d.ts.map +1 -0
  199. package/cjs/utils/graph.js +55 -0
  200. package/cjs/utils/index.d.ts +18 -0
  201. package/cjs/utils/index.d.ts.map +1 -0
  202. package/cjs/utils/index.js +104 -0
  203. package/cjs/utils/isInSameParent.d.ts +11 -0
  204. package/cjs/utils/isInSameParent.d.ts.map +1 -0
  205. package/cjs/utils/isInSameParent.js +19 -0
  206. package/cjs/utils/parent.d.ts +23 -0
  207. package/cjs/utils/parent.d.ts.map +1 -0
  208. package/cjs/utils/parent.js +166 -0
  209. package/cjs/utils/position.d.ts +29 -0
  210. package/cjs/utils/position.d.ts.map +1 -0
  211. package/cjs/utils/position.js +67 -0
  212. package/cjs/utils/prepareInnerLookup.d.ts +16 -0
  213. package/cjs/utils/prepareInnerLookup.d.ts.map +1 -0
  214. package/cjs/utils/prepareInnerLookup.js +93 -0
  215. package/cjs/utils/scheduleCallback.d.ts +2 -0
  216. package/cjs/utils/scheduleCallback.d.ts.map +1 -0
  217. package/cjs/utils/scheduleCallback.js +38 -0
  218. package/cjs/utils/serialize.d.ts +31 -0
  219. package/cjs/utils/serialize.d.ts.map +1 -0
  220. package/cjs/utils/serialize.js +60 -0
  221. package/cjs/utils/triggerConnect.d.ts +12 -0
  222. package/cjs/utils/triggerConnect.d.ts.map +1 -0
  223. package/cjs/utils/triggerConnect.js +50 -0
  224. package/esm/components/CanvasLoading/index.d.ts +14 -0
  225. package/esm/components/CanvasLoading/index.d.ts.map +1 -0
  226. package/esm/components/CanvasLoading/index.js +45 -0
  227. package/esm/components/CanvasLoading/index.less +69 -0
  228. package/esm/components/CodeEditor/DebugPanel/index.d.ts +16 -0
  229. package/esm/components/CodeEditor/DebugPanel/index.d.ts.map +1 -0
  230. package/esm/components/CodeEditor/DebugPanel/index.js +199 -0
  231. package/esm/components/CodeEditor/DebugPanel/index.less +56 -0
  232. package/esm/components/CodeEditor/FileTree/LibraryIcon.d.ts +11 -0
  233. package/esm/components/CodeEditor/FileTree/LibraryIcon.d.ts.map +1 -0
  234. package/esm/components/CodeEditor/FileTree/LibraryIcon.js +27 -0
  235. package/esm/components/CodeEditor/FileTree/icons/Javascript.d.ts +11 -0
  236. package/esm/components/CodeEditor/FileTree/icons/Javascript.d.ts.map +1 -0
  237. package/esm/components/CodeEditor/FileTree/icons/Javascript.js +32 -0
  238. package/esm/components/CodeEditor/FileTree/icons/Python.d.ts +11 -0
  239. package/esm/components/CodeEditor/FileTree/icons/Python.d.ts.map +1 -0
  240. package/esm/components/CodeEditor/FileTree/icons/Python.js +32 -0
  241. package/esm/components/CodeEditor/FileTree/index.d.ts +9 -0
  242. package/esm/components/CodeEditor/FileTree/index.d.ts.map +1 -0
  243. package/esm/components/CodeEditor/FileTree/index.js +62 -0
  244. package/esm/components/CodeEditor/FileTree/index.less +83 -0
  245. package/esm/components/CodeEditor/FileTree/useFileIcon.d.ts +11 -0
  246. package/esm/components/CodeEditor/FileTree/useFileIcon.d.ts.map +1 -0
  247. package/esm/components/CodeEditor/FileTree/useFileIcon.js +39 -0
  248. package/esm/components/CodeEditor/Header/index.d.ts +15 -0
  249. package/esm/components/CodeEditor/Header/index.d.ts.map +1 -0
  250. package/esm/components/CodeEditor/Header/index.js +43 -0
  251. package/esm/components/CodeEditor/Header/style.less +23 -0
  252. package/esm/components/CodeEditor/Terminal/XTerm.d.ts +5 -0
  253. package/esm/components/CodeEditor/Terminal/XTerm.d.ts.map +1 -0
  254. package/esm/components/CodeEditor/Terminal/XTerm.js +59 -0
  255. package/esm/components/CodeEditor/Terminal/index.d.ts +15 -0
  256. package/esm/components/CodeEditor/Terminal/index.d.ts.map +1 -0
  257. package/esm/components/CodeEditor/Terminal/index.js +23 -0
  258. package/esm/components/CodeEditor/Terminal/index.less +28 -0
  259. package/esm/components/CodeEditor/Terminal/types.d.ts +13 -0
  260. package/esm/components/CodeEditor/editors/JSON.d.ts +12 -0
  261. package/esm/components/CodeEditor/editors/JSON.d.ts.map +1 -0
  262. package/esm/components/CodeEditor/editors/JSON.js +35 -0
  263. package/esm/components/CodeEditor/editors/Python.d.ts +4 -0
  264. package/esm/components/CodeEditor/editors/Python.d.ts.map +1 -0
  265. package/esm/components/CodeEditor/editors/Python.js +34 -0
  266. package/esm/components/CodeEditor/editors/index.less +11 -0
  267. package/esm/components/CodeEditor/editors/types.d.ts +24 -0
  268. package/esm/components/CodeEditor/index.d.ts +7 -0
  269. package/esm/components/CodeEditor/index.d.ts.map +1 -0
  270. package/esm/components/CodeEditor/index.js +233 -0
  271. package/esm/components/CodeEditor/style.less +49 -0
  272. package/esm/components/CodeEditor/types.d.ts +46 -0
  273. package/esm/components/Handle/NodePopover.d.ts +15 -0
  274. package/esm/components/Handle/NodePopover.d.ts.map +1 -0
  275. package/esm/components/Handle/NodePopover.js +165 -0
  276. package/esm/components/Handle/index.d.ts +24 -0
  277. package/esm/components/Handle/index.d.ts.map +1 -0
  278. package/esm/components/Handle/index.js +190 -0
  279. package/esm/components/Handle/index.less +111 -0
  280. package/esm/components/InlineCodeEditor/index.d.ts +11 -0
  281. package/esm/components/InlineCodeEditor/index.d.ts.map +1 -0
  282. package/esm/components/InlineCodeEditor/index.js +24 -0
  283. package/esm/components/InlineCodeEditor/index.module.less +0 -0
  284. package/esm/components/InlineCodeEditor/types.d.ts +22 -0
  285. package/esm/components/Layout/index.d.ts +14 -0
  286. package/esm/components/Layout/index.d.ts.map +1 -0
  287. package/esm/components/Layout/index.js +43 -0
  288. package/esm/components/Layout/index.less +14 -0
  289. package/esm/components/LoadingButton.d.ts +16 -0
  290. package/esm/components/LoadingButton.d.ts.map +1 -0
  291. package/esm/components/LoadingButton.js +112 -0
  292. package/esm/components/Sider/index.d.ts +15 -0
  293. package/esm/components/Sider/index.d.ts.map +1 -0
  294. package/esm/components/Sider/index.js +142 -0
  295. package/esm/components/Sider/index.less +68 -0
  296. package/esm/constants/RunningStatus.d.ts +14 -0
  297. package/esm/constants/RunningStatus.d.ts.map +1 -0
  298. package/esm/constants/RunningStatus.js +15 -0
  299. package/esm/hooks/run/useActiveEdge.d.ts +15 -0
  300. package/esm/hooks/run/useActiveEdge.d.ts.map +1 -0
  301. package/esm/hooks/run/useActiveEdge.js +30 -0
  302. package/esm/hooks/run/useCleanRunState.d.ts +9 -0
  303. package/esm/hooks/run/useCleanRunState.d.ts.map +1 -0
  304. package/esm/hooks/run/useCleanRunState.js +26 -0
  305. package/esm/hooks/run/useNodeRunningState.d.ts +8 -0
  306. package/esm/hooks/run/useNodeRunningState.d.ts.map +1 -0
  307. package/esm/hooks/run/useNodeRunningState.js +26 -0
  308. package/esm/hooks/run/useRunState.d.ts +21 -0
  309. package/esm/hooks/run/useRunState.d.ts.map +1 -0
  310. package/esm/hooks/run/useRunState.js +35 -0
  311. package/esm/hooks/run/useSetRunState.d.ts +18 -0
  312. package/esm/hooks/run/useSetRunState.d.ts.map +1 -0
  313. package/esm/hooks/run/useSetRunState.js +35 -0
  314. package/esm/hooks/state.d.ts +7 -0
  315. package/esm/hooks/state.d.ts.map +1 -0
  316. package/esm/hooks/state.js +6 -0
  317. package/esm/hooks/useDeleteNode.d.ts +2 -0
  318. package/esm/hooks/useDeleteNode.d.ts.map +1 -0
  319. package/esm/hooks/useDeleteNode.js +44 -0
  320. package/esm/hooks/useEdgeIsHover.d.ts +2 -0
  321. package/esm/hooks/useEdgeIsHover.d.ts.map +1 -0
  322. package/esm/hooks/useEdgeIsHover.js +14 -0
  323. package/esm/hooks/useGetSelection.d.ts +13 -0
  324. package/esm/hooks/useGetSelection.d.ts.map +1 -0
  325. package/esm/hooks/useGetSelection.js +21 -0
  326. package/esm/hooks/useGetUpstreamNodes.d.ts +14 -0
  327. package/esm/hooks/useGetUpstreamNodes.d.ts.map +1 -0
  328. package/esm/hooks/useGetUpstreamNodes.js +71 -0
  329. package/esm/hooks/useGetWillDropTarget.d.ts +5 -0
  330. package/esm/hooks/useGetWillDropTarget.d.ts.map +1 -0
  331. package/esm/hooks/useGetWillDropTarget.js +21 -0
  332. package/esm/hooks/useGroupIsWillDrop.d.ts +2 -0
  333. package/esm/hooks/useGroupIsWillDrop.d.ts.map +1 -0
  334. package/esm/hooks/useGroupIsWillDrop.js +14 -0
  335. package/esm/hooks/useIsValidConnection.d.ts +12 -0
  336. package/esm/hooks/useIsValidConnection.d.ts.map +1 -0
  337. package/esm/hooks/useIsValidConnection.js +82 -0
  338. package/esm/hooks/useMouseEvents.d.ts +19 -0
  339. package/esm/hooks/useMouseEvents.d.ts.map +1 -0
  340. package/esm/hooks/useMouseEvents.js +40 -0
  341. package/esm/hooks/useNodeDragHandles.d.ts +10 -0
  342. package/esm/hooks/useNodeDragHandles.d.ts.map +1 -0
  343. package/esm/hooks/useNodeDragHandles.js +311 -0
  344. package/esm/hooks/useNodes.d.ts +9 -0
  345. package/esm/hooks/useNodes.d.ts.map +1 -0
  346. package/esm/hooks/useNodes.js +14 -0
  347. package/esm/hooks/useOnBeforeDelete.d.ts +19 -0
  348. package/esm/hooks/useOnBeforeDelete.d.ts.map +1 -0
  349. package/esm/hooks/useOnBeforeDelete.js +138 -0
  350. package/esm/hooks/useOnConnect.d.ts +12 -0
  351. package/esm/hooks/useOnConnect.d.ts.map +1 -0
  352. package/esm/hooks/useOnConnect.js +26 -0
  353. package/esm/hooks/useOnEdgeMouseEnter.d.ts +13 -0
  354. package/esm/hooks/useOnEdgeMouseEnter.d.ts.map +1 -0
  355. package/esm/hooks/useOnEdgeMouseEnter.js +20 -0
  356. package/esm/hooks/useOnEdgeMouseLeave.d.ts +13 -0
  357. package/esm/hooks/useOnEdgeMouseLeave.d.ts.map +1 -0
  358. package/esm/hooks/useOnEdgeMouseLeave.js +20 -0
  359. package/esm/hooks/useOnNodesChange.d.ts +4 -0
  360. package/esm/hooks/useOnNodesChange.d.ts.map +1 -0
  361. package/esm/hooks/useOnNodesChange.js +107 -0
  362. package/esm/hooks/useOnSelectionChange.d.ts +13 -0
  363. package/esm/hooks/useOnSelectionChange.d.ts.map +1 -0
  364. package/esm/hooks/useOnSelectionChange.js +171 -0
  365. package/esm/hooks/useSetEdges.d.ts +12 -0
  366. package/esm/hooks/useSetEdges.d.ts.map +1 -0
  367. package/esm/hooks/useSetEdges.js +22 -0
  368. package/esm/hooks/useSetSelection.d.ts +3 -0
  369. package/esm/hooks/useSetSelection.d.ts.map +1 -0
  370. package/esm/hooks/useSetSelection.js +33 -0
  371. package/esm/hooks/useSetWillDropTargets.d.ts +2 -0
  372. package/esm/hooks/useSetWillDropTargets.d.ts.map +1 -0
  373. package/esm/hooks/useSetWillDropTargets.js +18 -0
  374. package/esm/hooks/useUpstream.d.ts +3 -0
  375. package/esm/hooks/useUpstream.d.ts.map +1 -0
  376. package/esm/hooks/useUpstream.js +101 -0
  377. package/esm/hooks/useWatchSelectionNodes.d.ts +2 -0
  378. package/esm/hooks/useWatchSelectionNodes.d.ts.map +1 -0
  379. package/esm/hooks/useWatchSelectionNodes.js +14 -0
  380. package/esm/hooks/useWorkFlow.d.ts +12 -0
  381. package/esm/hooks/useWorkFlow.d.ts.map +1 -0
  382. package/esm/hooks/useWorkFlow.js +92 -0
  383. package/esm/hooks/useWorkFlowProps.d.ts +485 -0
  384. package/esm/hooks/useWorkFlowProps.d.ts.map +1 -0
  385. package/esm/hooks/useWorkFlowProps.js +102 -0
  386. package/esm/index.d.ts +23 -0
  387. package/esm/index.d.ts.map +1 -0
  388. package/esm/index.js +28 -0
  389. package/esm/types.d.ts +103 -0
  390. package/esm/types.d.ts.map +1 -0
  391. package/esm/types.js +4 -0
  392. package/esm/utils/arrayUtils.d.ts +2 -0
  393. package/esm/utils/arrayUtils.d.ts.map +1 -0
  394. package/esm/utils/arrayUtils.js +16 -0
  395. package/esm/utils/checkChildren.d.ts +11 -0
  396. package/esm/utils/checkChildren.d.ts.map +1 -0
  397. package/esm/utils/checkChildren.js +16 -0
  398. package/esm/utils/dimensions.d.ts +12 -0
  399. package/esm/utils/dimensions.d.ts.map +1 -0
  400. package/esm/utils/dimensions.js +17 -0
  401. package/esm/utils/dragDataTransfer.d.ts +19 -0
  402. package/esm/utils/dragDataTransfer.d.ts.map +1 -0
  403. package/esm/utils/dragDataTransfer.js +21 -0
  404. package/esm/utils/dropTargetsCheck.d.ts +20 -0
  405. package/esm/utils/dropTargetsCheck.d.ts.map +1 -0
  406. package/esm/utils/dropTargetsCheck.js +116 -0
  407. package/esm/utils/edgeEqualConnect.d.ts +11 -0
  408. package/esm/utils/edgeEqualConnect.d.ts.map +1 -0
  409. package/esm/utils/edgeEqualConnect.js +12 -0
  410. package/esm/utils/events.d.ts +11 -0
  411. package/esm/utils/events.d.ts.map +1 -0
  412. package/esm/utils/events.js +12 -0
  413. package/esm/utils/getEdgeId.d.ts +12 -0
  414. package/esm/utils/getEdgeId.d.ts.map +1 -0
  415. package/esm/utils/getEdgeId.js +16 -0
  416. package/esm/utils/getParentFlow.d.ts +5 -0
  417. package/esm/utils/getParentFlow.d.ts.map +1 -0
  418. package/esm/utils/getParentFlow.js +28 -0
  419. package/esm/utils/graph.d.ts +12 -0
  420. package/esm/utils/graph.d.ts.map +1 -0
  421. package/esm/utils/graph.js +51 -0
  422. package/esm/utils/index.d.ts +18 -0
  423. package/esm/utils/index.d.ts.map +1 -0
  424. package/esm/utils/index.js +18 -0
  425. package/esm/utils/isInSameParent.d.ts +11 -0
  426. package/esm/utils/isInSameParent.d.ts.map +1 -0
  427. package/esm/utils/isInSameParent.js +12 -0
  428. package/esm/utils/parent.d.ts +23 -0
  429. package/esm/utils/parent.d.ts.map +1 -0
  430. package/esm/utils/parent.js +186 -0
  431. package/esm/utils/position.d.ts +29 -0
  432. package/esm/utils/position.d.ts.map +1 -0
  433. package/esm/utils/position.js +61 -0
  434. package/esm/utils/prepareInnerLookup.d.ts +16 -0
  435. package/esm/utils/prepareInnerLookup.d.ts.map +1 -0
  436. package/esm/utils/prepareInnerLookup.js +79 -0
  437. package/esm/utils/scheduleCallback.d.ts +2 -0
  438. package/esm/utils/scheduleCallback.d.ts.map +1 -0
  439. package/esm/utils/scheduleCallback.js +36 -0
  440. package/esm/utils/serialize.d.ts +31 -0
  441. package/esm/utils/serialize.d.ts.map +1 -0
  442. package/esm/utils/serialize.js +64 -0
  443. package/esm/utils/triggerConnect.d.ts +12 -0
  444. package/esm/utils/triggerConnect.d.ts.map +1 -0
  445. package/esm/utils/triggerConnect.js +59 -0
  446. package/package.json +70 -0
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Sider = void 0;
7
+ require("./index.less");
8
+ var _dragDataTransfer = require("../../utils/dragDataTransfer");
9
+ var _CanvasLoading = _interopRequireDefault(require("../CanvasLoading"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _groupBy = _interopRequireDefault(require("lodash/groupBy"));
12
+ var _antd = require("antd");
13
+ var _SearchOutlined = _interopRequireDefault(require("@ant-design/icons/lib/icons/SearchOutlined"));
14
+ var _reactHighlightWords = _interopRequireDefault(require("react-highlight-words"));
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ /**
20
+ * @author: yanxianliang
21
+ * @date: 2025-07-27 11:34
22
+ * @modified:2025/7/27 11:34 by yanxianliang
23
+ * @desc: 节点列表
24
+ *
25
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
26
+ */
27
+
28
+ const Sider = ({
29
+ loading,
30
+ nodeTypes = []
31
+ }) => {
32
+ const [filter, setFilter] = (0, _react.useState)('');
33
+
34
+ // 分组
35
+ const nodeCategoryList = (0, _react.useMemo)(() => {
36
+ if (!nodeTypes || !nodeTypes.length) {
37
+ return [];
38
+ }
39
+ // 分组
40
+ const group = (0, _groupBy.default)(nodeTypes.filter(type => !type.hideInSider && type.label && type.label.indexOf(filter) > -1), node => node.group || '');
41
+ return Object.keys(group).map(category => {
42
+ return {
43
+ group: category,
44
+ list: group[category] || []
45
+ };
46
+ });
47
+ }, [nodeTypes, filter]);
48
+ const onDragStart = (0, _react.useCallback)(ev => {
49
+ const element = ev.target;
50
+ const nodeType = element.getAttribute("data-node-type");
51
+ const rect = element.getBoundingClientRect();
52
+ const offsetX = ev.clientX - rect.left; // 鼠标在元素内的X偏移[6]
53
+ const offsetY = ev.clientY - rect.top; // 鼠标在元素内的Y偏移[6]
54
+ ev.dataTransfer.effectAllowed = 'move';
55
+ ev.dataTransfer.setData('node@drag', nodeType);
56
+ (0, _dragDataTransfer.setDragDataTransfer)({
57
+ width: rect.width,
58
+ height: rect.height,
59
+ offsetX,
60
+ offsetY,
61
+ type: nodeType
62
+ });
63
+ }, []);
64
+ const onSearch = (0, _react.useCallback)(e => {
65
+ setFilter(e.currentTarget.value);
66
+ }, []);
67
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
68
+ className: 'rxflow-sider',
69
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
70
+ className: 'rxflow-sider-search',
71
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Input, {
72
+ onChange: onSearch,
73
+ prefix: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchOutlined.default, {
74
+ style: {
75
+ color: 'rgba(32, 41, 69, 0.62)'
76
+ }
77
+ }),
78
+ placeholder: '搜索节点'
79
+ })
80
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
81
+ className: 'rxflow-sider-scroll',
82
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CanvasLoading.default, {
83
+ loading: loading,
84
+ tip: '节点加载中...',
85
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
86
+ className: 'rxflow-sider-content',
87
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
88
+ size: 12,
89
+ direction: 'vertical',
90
+ style: {
91
+ width: '100%'
92
+ },
93
+ children: nodeCategoryList.map(categoryItem => {
94
+ const {
95
+ group,
96
+ list
97
+ } = categoryItem;
98
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
99
+ children: [group ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
100
+ className: 'rxflow-sider-group',
101
+ children: group
102
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List, {
103
+ grid: {
104
+ gutter: 0,
105
+ column: 1
106
+ },
107
+ dataSource: list,
108
+ renderItem: item => {
109
+ const {
110
+ icon,
111
+ label
112
+ } = item;
113
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List.Item, {
114
+ className: 'rxflow-sider-item',
115
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
116
+ draggable: true,
117
+ className: 'rxflow-sider-card',
118
+ onDragStart: onDragStart,
119
+ "data-node-type": item.type,
120
+ children: [icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
121
+ className: 'rxflow-sider-icon',
122
+ children: icon
123
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
124
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHighlightWords.default, {
125
+ highlightClassName: 'rxflow-sider-highlight',
126
+ textToHighlight: label || '',
127
+ searchWords: [filter]
128
+ })
129
+ })]
130
+ })
131
+ }, item.type);
132
+ }
133
+ })]
134
+ }, group);
135
+ })
136
+ })
137
+ })
138
+ })
139
+ })]
140
+ });
141
+ };
142
+ exports.Sider = Sider;
@@ -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,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RunningStatus = void 0;
7
+ /**
8
+ * @author: yanxianliang
9
+ * @date: 2025-08-23 12:46
10
+ * @modified:2025/8/23 12:46 by yanxianliang
11
+ * @desc: 运行状态枚举
12
+ *
13
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
14
+ */
15
+ let RunningStatus = exports.RunningStatus = /*#__PURE__*/function (RunningStatus) {
16
+ RunningStatus["running"] = "running";
17
+ RunningStatus["success"] = "success";
18
+ RunningStatus["error"] = "error";
19
+ return RunningStatus;
20
+ }({});
@@ -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,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useActiveEdge = useActiveEdge;
7
+ var _state = require("../state");
8
+ /**
9
+ * @author: yanxianliang
10
+ * @date: 2025-07-23 09:42
11
+ * @modified:2025/7/23 09:42 by yanxianliang
12
+ * @desc: Edge 是否高亮
13
+ *
14
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
15
+ */
16
+
17
+ /**
18
+ * 检测边是否高亮
19
+ * @param edge
20
+ */
21
+ function useActiveEdge(edge) {
22
+ return (0, _state.useSelector)(state => {
23
+ const edgeSet = state.runState?.activeEdges; // active Set
24
+ const {
25
+ source,
26
+ sourceHandleId,
27
+ targetHandleId,
28
+ target
29
+ } = edge;
30
+ if (!edgeSet) {
31
+ return false;
32
+ }
33
+ // 查找是否有对应的边
34
+ return edgeSet.has(`${source},${sourceHandleId},${target},${targetHandleId}`) || edgeSet.has(`${source},${sourceHandleId},${target}`) || edgeSet.has(`${source},${target}`);
35
+ });
36
+ }
@@ -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,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useCleanRunState = void 0;
7
+ var _react = require("react");
8
+ var _state = require("../state");
9
+ /**
10
+ * @author: yanxianliang
11
+ * @date: 2025-08-23 18:15
12
+ * @modified:2025/8/23 18:15 by yanxianliang
13
+ * @desc:
14
+ *
15
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
16
+ */
17
+
18
+ /**
19
+ * Retrieves the setDebugStore function from the zustand store within the DebugContext.
20
+ * This function is intended to be used for setting the debug state in a React application.
21
+ * If the DebugContext provider is missing, it will log an error and throw an exception.
22
+ *
23
+ * @throws {Error} Throws an error if the DebugContext provider is not found.
24
+ */
25
+ const useCleanRunState = () => {
26
+ const setState = (0, _state.useSetState)();
27
+ return (0, _react.useCallback)(() => {
28
+ setState({
29
+ runState: undefined
30
+ });
31
+ }, []);
32
+ };
33
+ exports.useCleanRunState = useCleanRunState;
@@ -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,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useNodeRunningState = void 0;
7
+ var _react = require("@xyflow/react");
8
+ var _shallow = require("zustand/react/shallow");
9
+ var _state = require("../state");
10
+ /**
11
+ * @author: yanxianliang
12
+ * @date: 2025-07-19 17:21
13
+ * @modified:2025/7/19 17:21 by yanxianliang
14
+ * @desc: 获取节点运行/调试状态
15
+ *
16
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
17
+ */
18
+
19
+ /**
20
+ * A custom hook that retrieves the debug state for a specific node.
21
+ * It uses the `useNodeId` hook to get the node ID and the `DebugContext` context to access the debug store.
22
+ * If the `DebugContext` provider is missing, it throws an error.
23
+ *
24
+ */
25
+ const useNodeRunningState = nodeId => {
26
+ const innerId = (0, _react.useNodeId)();
27
+ const id = nodeId || innerId;
28
+ return (0, _state.useSelector)((0, _shallow.useShallow)(state => id ? state.runState?.nodeRunMap?.[id] : undefined));
29
+ };
30
+ exports.useNodeRunningState = useNodeRunningState;
@@ -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,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useRunState = void 0;
7
+ var _shallow = require("zustand/react/shallow");
8
+ var _state = require("../state");
9
+ /**
10
+ * @author: yanxianliang
11
+ * @date: 2025-07-24 09:33
12
+ * @modified:2025/7/24 09:33 by yanxianliang
13
+ * @desc: get/set run state
14
+ *
15
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
16
+ */
17
+
18
+ /**
19
+ * useNodeDebugState is a custom hook that provides access to the debug state and allows modification of the running state.
20
+ * It utilizes the DebugContext to retrieve the zustand store, which holds the debug state information.
21
+ * If the DebugContext provider is missing, it throws an error.
22
+ *
23
+ * @returns A tuple where the first element is a boolean indicating if the debug is running,
24
+ * and the second element is a function to set the running state.
25
+ */
26
+ const useRunState = () => {
27
+ const {
28
+ runningStatus,
29
+ timeSpent
30
+ } = (0, _state.useSelector)((0, _shallow.useShallow)(state => ({
31
+ runningStatus: state.runState?.runningStatus,
32
+ timeSpent: state.runState?.timeSpent
33
+ })));
34
+ return {
35
+ runningStatus,
36
+ timeSpent
37
+ };
38
+ };
39
+ exports.useRunState = useRunState;
@@ -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,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSetRunState = void 0;
7
+ var _react = require("react");
8
+ var _state = require("../state");
9
+ /**
10
+ * @author: yanxianliang
11
+ * @date: 2025-07-19 19:55
12
+ * @modified:2025/7/19 19:55 by yanxianliang
13
+ * @desc: 设置运行/调试 状态
14
+ *
15
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
16
+ */
17
+
18
+ /**
19
+ * Retrieves the setDebugStore function from the zustand store within the DebugContext.
20
+ * This function is intended to be used for setting the debug state in a React application.
21
+ * If the DebugContext provider is missing, it will log an error and throw an exception.
22
+ *
23
+ * @throws {Error} Throws an error if the DebugContext provider is not found.
24
+ */
25
+ const useSetRunState = () => {
26
+ const setState = (0, _state.useSetState)();
27
+ return (0, _react.useCallback)(runState => {
28
+ setState(state => {
29
+ return {
30
+ ...state,
31
+ runState: {
32
+ ...state.runState,
33
+ ...runState
34
+ }
35
+ };
36
+ });
37
+ }, []);
38
+ };
39
+ exports.useSetRunState = useSetRunState;
@@ -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,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSetState = exports.useSelector = exports.useGetState = void 0;
7
+ var _base = require("@rxflow/base");
8
+ const useSetState = exports.useSetState = _base.useSetState;
9
+ const useGetState = exports.useGetState = _base.useGetState;
10
+ const useSelector = selector => {
11
+ return (0, _base.useSelector)(selector);
12
+ };
13
+ exports.useSelector = useSelector;
@@ -0,0 +1,2 @@
1
+ export declare const useDeleteNode: () => (id: string) => Promise<void>;
2
+ //# sourceMappingURL=useDeleteNode.d.ts.map
@@ -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,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useDeleteNode = void 0;
7
+ var _react = require("@xyflow/react");
8
+ var _react2 = require("react");
9
+ /**
10
+ * @author: yanxianliang
11
+ * @date: 2025-08-18 19:45
12
+ * @modified:2025/8/18 19:45 by yanxianliang
13
+ * @desc: 删除节点的 hook
14
+ *
15
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
16
+ */
17
+
18
+ const useDeleteNode = () => {
19
+ const {
20
+ deleteElements,
21
+ getNode
22
+ } = (0, _react.useReactFlow)();
23
+ return (0, _react2.useCallback)(async id => {
24
+ const node = getNode(id);
25
+ if (node) {
26
+ await deleteElements({
27
+ nodes: [node]
28
+ });
29
+ }
30
+ }, []);
31
+ };
32
+ exports.useDeleteNode = useDeleteNode;
@@ -0,0 +1,2 @@
1
+ export declare const useEdgeIsHover: (id: string) => boolean;
2
+ //# sourceMappingURL=useEdgeIsHover.d.ts.map
@@ -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,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useEdgeIsHover = void 0;
7
+ var _state = require("./state");
8
+ /**
9
+ * @author: yanxianliang
10
+ * @date: 2025-08-15 22:06
11
+ * @modified:2025/8/15 22:06 by yanxianliang
12
+ * @desc: Edge Hover State
13
+ *
14
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
15
+ */
16
+
17
+ const useEdgeIsHover = id => {
18
+ return (0, _state.useSelector)(state => state.hoveredEdge === id);
19
+ };
20
+ exports.useEdgeIsHover = useEdgeIsHover;
@@ -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"}