@rxflow/base 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 (442) hide show
  1. package/README.md +44 -0
  2. package/cjs/Flow.d.ts +14 -0
  3. package/cjs/Flow.d.ts.map +1 -0
  4. package/cjs/Flow.js +236 -0
  5. package/cjs/components/CollapseButton/index.d.ts +11 -0
  6. package/cjs/components/CollapseButton/index.d.ts.map +1 -0
  7. package/cjs/components/CollapseButton/index.js +58 -0
  8. package/cjs/components/CollapseButton/index.less +68 -0
  9. package/cjs/components/Controls/icons.d.ts +8 -0
  10. package/cjs/components/Controls/icons.d.ts.map +1 -0
  11. package/cjs/components/Controls/icons.js +85 -0
  12. package/cjs/components/Controls/index.d.ts +13 -0
  13. package/cjs/components/Controls/index.d.ts.map +1 -0
  14. package/cjs/components/Controls/index.js +195 -0
  15. package/cjs/components/DebugInfo/index.d.ts +5 -0
  16. package/cjs/components/DebugInfo/index.d.ts.map +1 -0
  17. package/cjs/components/DebugInfo/index.js +33 -0
  18. package/cjs/components/DebugInfo/index.less +6 -0
  19. package/cjs/components/EdgeText/index.d.ts +6 -0
  20. package/cjs/components/EdgeText/index.d.ts.map +1 -0
  21. package/cjs/components/EdgeText/index.js +48 -0
  22. package/cjs/components/Handle/index.d.ts +3 -0
  23. package/cjs/components/Handle/index.d.ts.map +1 -0
  24. package/cjs/components/Handle/index.js +24 -0
  25. package/cjs/components/Handle/index.module.less +9 -0
  26. package/cjs/components/HiddenHandle/index.css +9 -0
  27. package/cjs/components/HiddenHandle/index.d.ts +4 -0
  28. package/cjs/components/HiddenHandle/index.d.ts.map +1 -0
  29. package/cjs/components/HiddenHandle/index.js +23 -0
  30. package/cjs/components/Legend/index.d.ts +6 -0
  31. package/cjs/components/Legend/index.d.ts.map +1 -0
  32. package/cjs/components/Legend/index.js +72 -0
  33. package/cjs/components/Legend/index.less +41 -0
  34. package/cjs/components/LoadingButton.d.ts +16 -0
  35. package/cjs/components/LoadingButton.d.ts.map +1 -0
  36. package/cjs/components/LoadingButton.js +86 -0
  37. package/cjs/components/MarkerDefinitions/Mark.d.ts +11 -0
  38. package/cjs/components/MarkerDefinitions/Mark.d.ts.map +1 -0
  39. package/cjs/components/MarkerDefinitions/Mark.js +48 -0
  40. package/cjs/components/MarkerDefinitions/Symbols/Arrow.d.ts +11 -0
  41. package/cjs/components/MarkerDefinitions/Symbols/Arrow.d.ts.map +1 -0
  42. package/cjs/components/MarkerDefinitions/Symbols/Arrow.js +31 -0
  43. package/cjs/components/MarkerDefinitions/Symbols/ArrowClosed.d.ts +11 -0
  44. package/cjs/components/MarkerDefinitions/Symbols/ArrowClosed.d.ts.map +1 -0
  45. package/cjs/components/MarkerDefinitions/Symbols/ArrowClosed.js +32 -0
  46. package/cjs/components/MarkerDefinitions/index.d.ts +6 -0
  47. package/cjs/components/MarkerDefinitions/index.d.ts.map +1 -0
  48. package/cjs/components/MarkerDefinitions/index.js +45 -0
  49. package/cjs/components/MarkerDefinitions/styles.less +5 -0
  50. package/cjs/components/MarkerDefinitions/symbols.d.ts +5 -0
  51. package/cjs/components/MarkerDefinitions/symbols.d.ts.map +1 -0
  52. package/cjs/components/MarkerDefinitions/symbols.js +22 -0
  53. package/cjs/components/MarkerDefinitions/types.d.ts +21 -0
  54. package/cjs/components/NodeRenderFactory.d.ts +11 -0
  55. package/cjs/components/NodeRenderFactory.d.ts.map +1 -0
  56. package/cjs/components/NodeRenderFactory.js +26 -0
  57. package/cjs/components/Nodes/DefaultNode.d.ts +3 -0
  58. package/cjs/components/Nodes/DefaultNode.d.ts.map +1 -0
  59. package/cjs/components/Nodes/DefaultNode.js +30 -0
  60. package/cjs/components/Nodes/GroupNode.d.ts +3 -0
  61. package/cjs/components/Nodes/GroupNode.d.ts.map +1 -0
  62. package/cjs/components/Nodes/GroupNode.js +13 -0
  63. package/cjs/components/Nodes/InputNode.d.ts +3 -0
  64. package/cjs/components/Nodes/InputNode.d.ts.map +1 -0
  65. package/cjs/components/Nodes/InputNode.js +25 -0
  66. package/cjs/components/Nodes/OutputNode.d.ts +3 -0
  67. package/cjs/components/Nodes/OutputNode.d.ts.map +1 -0
  68. package/cjs/components/Nodes/OutputNode.js +25 -0
  69. package/cjs/components/Popover/index.d.ts +11 -0
  70. package/cjs/components/Popover/index.d.ts.map +1 -0
  71. package/cjs/components/Popover/index.js +100 -0
  72. package/cjs/components/Tooltip/index.d.ts +12 -0
  73. package/cjs/components/Tooltip/index.d.ts.map +1 -0
  74. package/cjs/components/Tooltip/index.js +110 -0
  75. package/cjs/components/index.d.ts +16 -0
  76. package/cjs/components/index.d.ts.map +1 -0
  77. package/cjs/components/index.js +100 -0
  78. package/cjs/constants/InnerFlowType.d.ts +12 -0
  79. package/cjs/constants/InnerFlowType.d.ts.map +1 -0
  80. package/cjs/constants/InnerFlowType.js +18 -0
  81. package/cjs/constants/NodeRoleType.d.ts +16 -0
  82. package/cjs/constants/NodeRoleType.d.ts.map +1 -0
  83. package/cjs/constants/NodeRoleType.js +22 -0
  84. package/cjs/constants/SelectionStrategy.d.ts +14 -0
  85. package/cjs/constants/SelectionStrategy.d.ts.map +1 -0
  86. package/cjs/constants/SelectionStrategy.js +20 -0
  87. package/cjs/edges/SmartEdge/index.d.ts +15 -0
  88. package/cjs/edges/SmartEdge/index.d.ts.map +1 -0
  89. package/cjs/edges/SmartEdge/index.js +54 -0
  90. package/cjs/hoc/createFlow.d.ts +14 -0
  91. package/cjs/hoc/createFlow.d.ts.map +1 -0
  92. package/cjs/hoc/createFlow.js +67 -0
  93. package/cjs/hoc/withFlowProvider.d.ts +11 -0
  94. package/cjs/hoc/withFlowProvider.d.ts.map +1 -0
  95. package/cjs/hoc/withFlowProvider.js +29 -0
  96. package/cjs/hooks/edges/useGetEdgesChangeHandlers.d.ts +11 -0
  97. package/cjs/hooks/edges/useGetEdgesChangeHandlers.d.ts.map +1 -0
  98. package/cjs/hooks/edges/useGetEdgesChangeHandlers.js +24 -0
  99. package/cjs/hooks/edges/useOnEdgesChange.d.ts +11 -0
  100. package/cjs/hooks/edges/useOnEdgesChange.d.ts.map +1 -0
  101. package/cjs/hooks/edges/useOnEdgesChange.js +31 -0
  102. package/cjs/hooks/index.d.ts +22 -0
  103. package/cjs/hooks/index.d.ts.map +1 -0
  104. package/cjs/hooks/index.js +159 -0
  105. package/cjs/hooks/node/useCheckUnMount.d.ts +2 -0
  106. package/cjs/hooks/node/useCheckUnMount.d.ts.map +1 -0
  107. package/cjs/hooks/node/useCheckUnMount.js +27 -0
  108. package/cjs/hooks/node/useInitialized.d.ts +2 -0
  109. package/cjs/hooks/node/useInitialized.d.ts.map +1 -0
  110. package/cjs/hooks/node/useInitialized.js +20 -0
  111. package/cjs/hooks/node/useNodeDragging.d.ts +2 -0
  112. package/cjs/hooks/node/useNodeDragging.d.ts.map +1 -0
  113. package/cjs/hooks/node/useNodeDragging.js +20 -0
  114. package/cjs/hooks/node/useNodeInitialize.d.ts +2 -0
  115. package/cjs/hooks/node/useNodeInitialize.d.ts.map +1 -0
  116. package/cjs/hooks/node/useNodeInitialize.js +23 -0
  117. package/cjs/hooks/node/useNodeTypeMap.d.ts +11 -0
  118. package/cjs/hooks/node/useNodeTypeMap.d.ts.map +1 -0
  119. package/cjs/hooks/node/useNodeTypeMap.js +20 -0
  120. package/cjs/hooks/node/useNodes.d.ts +10 -0
  121. package/cjs/hooks/node/useNodes.d.ts.map +1 -0
  122. package/cjs/hooks/node/useNodes.js +12 -0
  123. package/cjs/hooks/node/useSetNodeDragging.d.ts +2 -0
  124. package/cjs/hooks/node/useSetNodeDragging.d.ts.map +1 -0
  125. package/cjs/hooks/node/useSetNodeDragging.js +26 -0
  126. package/cjs/hooks/props/useGetProps.d.ts +6 -0
  127. package/cjs/hooks/props/useGetProps.d.ts.map +1 -0
  128. package/cjs/hooks/props/useGetProps.js +29 -0
  129. package/cjs/hooks/props/useProps.d.ts +2 -0
  130. package/cjs/hooks/props/useProps.d.ts.map +1 -0
  131. package/cjs/hooks/props/useProps.js +20 -0
  132. package/cjs/hooks/props/usePropsSelector.d.ts +13 -0
  133. package/cjs/hooks/props/usePropsSelector.d.ts.map +1 -0
  134. package/cjs/hooks/props/usePropsSelector.js +37 -0
  135. package/cjs/hooks/render/useForceUpdate.d.ts +2 -0
  136. package/cjs/hooks/render/useForceUpdate.d.ts.map +1 -0
  137. package/cjs/hooks/render/useForceUpdate.js +28 -0
  138. package/cjs/hooks/render/useForceUpdateTimes.d.ts +2 -0
  139. package/cjs/hooks/render/useForceUpdateTimes.d.ts.map +1 -0
  140. package/cjs/hooks/render/useForceUpdateTimes.js +20 -0
  141. package/cjs/hooks/state/useGetState.d.ts +11 -0
  142. package/cjs/hooks/state/useGetState.d.ts.map +1 -0
  143. package/cjs/hooks/state/useGetState.js +27 -0
  144. package/cjs/hooks/state/useSelector.d.ts +13 -0
  145. package/cjs/hooks/state/useSelector.d.ts.map +1 -0
  146. package/cjs/hooks/state/useSelector.js +28 -0
  147. package/cjs/hooks/state/useSetState.d.ts +11 -0
  148. package/cjs/hooks/state/useSetState.d.ts.map +1 -0
  149. package/cjs/hooks/state/useSetState.js +27 -0
  150. package/cjs/hooks/useFlowId.d.ts +6 -0
  151. package/cjs/hooks/useFlowId.d.ts.map +1 -0
  152. package/cjs/hooks/useFlowId.js +24 -0
  153. package/cjs/hooks/useListenRender.d.ts +2 -0
  154. package/cjs/hooks/useListenRender.d.ts.map +1 -0
  155. package/cjs/hooks/useListenRender.js +48 -0
  156. package/cjs/hooks/useNodeTypes.d.ts +14 -0
  157. package/cjs/hooks/useNodeTypes.d.ts.map +1 -0
  158. package/cjs/hooks/useNodeTypes.js +54 -0
  159. package/cjs/hooks/useTheme.d.ts +9 -0
  160. package/cjs/hooks/useTheme.d.ts.map +1 -0
  161. package/cjs/hooks/useTheme.js +25 -0
  162. package/cjs/hooks/useThemeVars.d.ts +15 -0
  163. package/cjs/hooks/useThemeVars.d.ts.map +1 -0
  164. package/cjs/hooks/useThemeVars.js +37 -0
  165. package/cjs/index.d.ts +28 -0
  166. package/cjs/index.d.ts.map +1 -0
  167. package/cjs/index.js +180 -0
  168. package/cjs/index.less +7 -0
  169. package/cjs/index.module.less +10 -0
  170. package/cjs/plugins/export/index.d.ts +18 -0
  171. package/cjs/plugins/export/index.d.ts.map +1 -0
  172. package/cjs/plugins/export/index.js +52 -0
  173. package/cjs/plugins/scrollbar/hooks/useScrollerOptions.d.ts +11 -0
  174. package/cjs/plugins/scrollbar/hooks/useScrollerOptions.d.ts.map +1 -0
  175. package/cjs/plugins/scrollbar/hooks/useScrollerOptions.js +46 -0
  176. package/cjs/plugins/scrollbar/index.d.ts +5 -0
  177. package/cjs/plugins/scrollbar/index.d.ts.map +1 -0
  178. package/cjs/plugins/scrollbar/index.js +215 -0
  179. package/cjs/plugins/scrollbar/index.less +10 -0
  180. package/cjs/plugins/scrollbar/types.d.ts +24 -0
  181. package/cjs/plugins/scrollbar/types.d.ts.map +1 -0
  182. package/cjs/plugins/scrollbar/types.js +5 -0
  183. package/cjs/providers/FlowProvider.d.ts +27 -0
  184. package/cjs/providers/FlowProvider.d.ts.map +1 -0
  185. package/cjs/providers/FlowProvider.js +91 -0
  186. package/cjs/store/PropsStore.d.ts +16 -0
  187. package/cjs/store/PropsStore.d.ts.map +1 -0
  188. package/cjs/store/PropsStore.js +75 -0
  189. package/cjs/types.d.ts +223 -0
  190. package/cjs/types.d.ts.map +1 -0
  191. package/cjs/types.js +5 -0
  192. package/cjs/utils/dimension.d.ts +20 -0
  193. package/cjs/utils/dimension.d.ts.map +1 -0
  194. package/cjs/utils/dimension.js +96 -0
  195. package/cjs/utils/getPopupContainer.d.ts +10 -0
  196. package/cjs/utils/getPopupContainer.d.ts.map +1 -0
  197. package/cjs/utils/getPopupContainer.js +19 -0
  198. package/cjs/utils/getThemeWithDefaultValue.d.ts +10 -0
  199. package/cjs/utils/getThemeWithDefaultValue.d.ts.map +1 -0
  200. package/cjs/utils/getThemeWithDefaultValue.js +23 -0
  201. package/cjs/utils/hasDimensionsChange.d.ts +10 -0
  202. package/cjs/utils/hasDimensionsChange.d.ts.map +1 -0
  203. package/cjs/utils/hasDimensionsChange.js +23 -0
  204. package/cjs/utils/layouts/base.d.ts +16 -0
  205. package/cjs/utils/layouts/base.d.ts.map +1 -0
  206. package/cjs/utils/layouts/base.js +27 -0
  207. package/cjs/utils/layouts/mindmap.d.ts +7 -0
  208. package/cjs/utils/layouts/mindmap.d.ts.map +1 -0
  209. package/cjs/utils/layouts/mindmap.js +133 -0
  210. package/cjs/utils/measureText.d.ts +21 -0
  211. package/cjs/utils/measureText.d.ts.map +1 -0
  212. package/cjs/utils/measureText.js +76 -0
  213. package/cjs/utils/parse.d.ts +11 -0
  214. package/cjs/utils/parse.d.ts.map +1 -0
  215. package/cjs/utils/parse.js +29 -0
  216. package/cjs/utils/preCreateInnerNode.d.ts +11 -0
  217. package/cjs/utils/preCreateInnerNode.d.ts.map +1 -0
  218. package/cjs/utils/preCreateInnerNode.js +44 -0
  219. package/cjs/utils/uuid.d.ts +10 -0
  220. package/cjs/utils/uuid.d.ts.map +1 -0
  221. package/cjs/utils/uuid.js +16 -0
  222. package/esm/Flow.d.ts +14 -0
  223. package/esm/Flow.d.ts.map +1 -0
  224. package/esm/Flow.js +251 -0
  225. package/esm/components/CollapseButton/index.d.ts +11 -0
  226. package/esm/components/CollapseButton/index.d.ts.map +1 -0
  227. package/esm/components/CollapseButton/index.js +59 -0
  228. package/esm/components/CollapseButton/index.less +68 -0
  229. package/esm/components/Controls/icons.d.ts +8 -0
  230. package/esm/components/Controls/icons.d.ts.map +1 -0
  231. package/esm/components/Controls/icons.js +75 -0
  232. package/esm/components/Controls/index.d.ts +13 -0
  233. package/esm/components/Controls/index.d.ts.map +1 -0
  234. package/esm/components/Controls/index.js +201 -0
  235. package/esm/components/DebugInfo/index.d.ts +5 -0
  236. package/esm/components/DebugInfo/index.d.ts.map +1 -0
  237. package/esm/components/DebugInfo/index.js +23 -0
  238. package/esm/components/DebugInfo/index.less +6 -0
  239. package/esm/components/EdgeText/index.d.ts +6 -0
  240. package/esm/components/EdgeText/index.d.ts.map +1 -0
  241. package/esm/components/EdgeText/index.js +52 -0
  242. package/esm/components/Handle/index.d.ts +3 -0
  243. package/esm/components/Handle/index.d.ts.map +1 -0
  244. package/esm/components/Handle/index.js +21 -0
  245. package/esm/components/Handle/index.module.less +9 -0
  246. package/esm/components/HiddenHandle/index.css +9 -0
  247. package/esm/components/HiddenHandle/index.d.ts +4 -0
  248. package/esm/components/HiddenHandle/index.d.ts.map +1 -0
  249. package/esm/components/HiddenHandle/index.js +21 -0
  250. package/esm/components/Legend/index.d.ts +6 -0
  251. package/esm/components/Legend/index.d.ts.map +1 -0
  252. package/esm/components/Legend/index.js +68 -0
  253. package/esm/components/Legend/index.less +41 -0
  254. package/esm/components/LoadingButton.d.ts +16 -0
  255. package/esm/components/LoadingButton.d.ts.map +1 -0
  256. package/esm/components/LoadingButton.js +112 -0
  257. package/esm/components/MarkerDefinitions/Mark.d.ts +11 -0
  258. package/esm/components/MarkerDefinitions/Mark.d.ts.map +1 -0
  259. package/esm/components/MarkerDefinitions/Mark.js +44 -0
  260. package/esm/components/MarkerDefinitions/Symbols/Arrow.d.ts +11 -0
  261. package/esm/components/MarkerDefinitions/Symbols/Arrow.d.ts.map +1 -0
  262. package/esm/components/MarkerDefinitions/Symbols/Arrow.js +25 -0
  263. package/esm/components/MarkerDefinitions/Symbols/ArrowClosed.d.ts +11 -0
  264. package/esm/components/MarkerDefinitions/Symbols/ArrowClosed.d.ts.map +1 -0
  265. package/esm/components/MarkerDefinitions/Symbols/ArrowClosed.js +26 -0
  266. package/esm/components/MarkerDefinitions/index.d.ts +6 -0
  267. package/esm/components/MarkerDefinitions/index.d.ts.map +1 -0
  268. package/esm/components/MarkerDefinitions/index.js +37 -0
  269. package/esm/components/MarkerDefinitions/styles.less +5 -0
  270. package/esm/components/MarkerDefinitions/symbols.d.ts +5 -0
  271. package/esm/components/MarkerDefinitions/symbols.d.ts.map +1 -0
  272. package/esm/components/MarkerDefinitions/symbols.js +16 -0
  273. package/esm/components/MarkerDefinitions/types.d.ts +21 -0
  274. package/esm/components/NodeRenderFactory.d.ts +11 -0
  275. package/esm/components/NodeRenderFactory.d.ts.map +1 -0
  276. package/esm/components/NodeRenderFactory.js +23 -0
  277. package/esm/components/Nodes/DefaultNode.d.ts +3 -0
  278. package/esm/components/Nodes/DefaultNode.d.ts.map +1 -0
  279. package/esm/components/Nodes/DefaultNode.js +27 -0
  280. package/esm/components/Nodes/GroupNode.d.ts +3 -0
  281. package/esm/components/Nodes/GroupNode.d.ts.map +1 -0
  282. package/esm/components/Nodes/GroupNode.js +6 -0
  283. package/esm/components/Nodes/InputNode.d.ts +3 -0
  284. package/esm/components/Nodes/InputNode.d.ts.map +1 -0
  285. package/esm/components/Nodes/InputNode.js +21 -0
  286. package/esm/components/Nodes/OutputNode.d.ts +3 -0
  287. package/esm/components/Nodes/OutputNode.d.ts.map +1 -0
  288. package/esm/components/Nodes/OutputNode.js +21 -0
  289. package/esm/components/Popover/index.d.ts +11 -0
  290. package/esm/components/Popover/index.d.ts.map +1 -0
  291. package/esm/components/Popover/index.js +109 -0
  292. package/esm/components/Tooltip/index.d.ts +12 -0
  293. package/esm/components/Tooltip/index.d.ts.map +1 -0
  294. package/esm/components/Tooltip/index.js +121 -0
  295. package/esm/components/index.d.ts +16 -0
  296. package/esm/components/index.d.ts.map +1 -0
  297. package/esm/components/index.js +15 -0
  298. package/esm/constants/InnerFlowType.d.ts +12 -0
  299. package/esm/constants/InnerFlowType.d.ts.map +1 -0
  300. package/esm/constants/InnerFlowType.js +13 -0
  301. package/esm/constants/NodeRoleType.d.ts +16 -0
  302. package/esm/constants/NodeRoleType.d.ts.map +1 -0
  303. package/esm/constants/NodeRoleType.js +16 -0
  304. package/esm/constants/SelectionStrategy.d.ts +14 -0
  305. package/esm/constants/SelectionStrategy.d.ts.map +1 -0
  306. package/esm/constants/SelectionStrategy.js +15 -0
  307. package/esm/edges/SmartEdge/index.d.ts +15 -0
  308. package/esm/edges/SmartEdge/index.d.ts.map +1 -0
  309. package/esm/edges/SmartEdge/index.js +45 -0
  310. package/esm/hoc/createFlow.d.ts +14 -0
  311. package/esm/hoc/createFlow.d.ts.map +1 -0
  312. package/esm/hoc/createFlow.js +66 -0
  313. package/esm/hoc/withFlowProvider.d.ts +11 -0
  314. package/esm/hoc/withFlowProvider.d.ts.map +1 -0
  315. package/esm/hoc/withFlowProvider.js +24 -0
  316. package/esm/hooks/edges/useGetEdgesChangeHandlers.d.ts +11 -0
  317. package/esm/hooks/edges/useGetEdgesChangeHandlers.d.ts.map +1 -0
  318. package/esm/hooks/edges/useGetEdgesChangeHandlers.js +17 -0
  319. package/esm/hooks/edges/useOnEdgesChange.d.ts +11 -0
  320. package/esm/hooks/edges/useOnEdgesChange.d.ts.map +1 -0
  321. package/esm/hooks/edges/useOnEdgesChange.js +24 -0
  322. package/esm/hooks/index.d.ts +22 -0
  323. package/esm/hooks/index.d.ts.map +1 -0
  324. package/esm/hooks/index.js +22 -0
  325. package/esm/hooks/node/useCheckUnMount.d.ts +2 -0
  326. package/esm/hooks/node/useCheckUnMount.d.ts.map +1 -0
  327. package/esm/hooks/node/useCheckUnMount.js +18 -0
  328. package/esm/hooks/node/useInitialized.d.ts +2 -0
  329. package/esm/hooks/node/useInitialized.d.ts.map +1 -0
  330. package/esm/hooks/node/useInitialized.js +12 -0
  331. package/esm/hooks/node/useNodeDragging.d.ts +2 -0
  332. package/esm/hooks/node/useNodeDragging.d.ts.map +1 -0
  333. package/esm/hooks/node/useNodeDragging.js +14 -0
  334. package/esm/hooks/node/useNodeInitialize.d.ts +2 -0
  335. package/esm/hooks/node/useNodeInitialize.d.ts.map +1 -0
  336. package/esm/hooks/node/useNodeInitialize.js +15 -0
  337. package/esm/hooks/node/useNodeTypeMap.d.ts +11 -0
  338. package/esm/hooks/node/useNodeTypeMap.d.ts.map +1 -0
  339. package/esm/hooks/node/useNodeTypeMap.js +14 -0
  340. package/esm/hooks/node/useNodes.d.ts +10 -0
  341. package/esm/hooks/node/useNodes.d.ts.map +1 -0
  342. package/esm/hooks/node/useNodes.js +9 -0
  343. package/esm/hooks/node/useSetNodeDragging.d.ts +2 -0
  344. package/esm/hooks/node/useSetNodeDragging.d.ts.map +1 -0
  345. package/esm/hooks/node/useSetNodeDragging.js +18 -0
  346. package/esm/hooks/props/useGetProps.d.ts +6 -0
  347. package/esm/hooks/props/useGetProps.d.ts.map +1 -0
  348. package/esm/hooks/props/useGetProps.js +21 -0
  349. package/esm/hooks/props/useProps.d.ts +2 -0
  350. package/esm/hooks/props/useProps.d.ts.map +1 -0
  351. package/esm/hooks/props/useProps.js +14 -0
  352. package/esm/hooks/props/usePropsSelector.d.ts +13 -0
  353. package/esm/hooks/props/usePropsSelector.d.ts.map +1 -0
  354. package/esm/hooks/props/usePropsSelector.js +31 -0
  355. package/esm/hooks/render/useForceUpdate.d.ts +2 -0
  356. package/esm/hooks/render/useForceUpdate.d.ts.map +1 -0
  357. package/esm/hooks/render/useForceUpdate.js +20 -0
  358. package/esm/hooks/render/useForceUpdateTimes.d.ts +2 -0
  359. package/esm/hooks/render/useForceUpdateTimes.d.ts.map +1 -0
  360. package/esm/hooks/render/useForceUpdateTimes.js +14 -0
  361. package/esm/hooks/state/useGetState.d.ts +11 -0
  362. package/esm/hooks/state/useGetState.d.ts.map +1 -0
  363. package/esm/hooks/state/useGetState.js +20 -0
  364. package/esm/hooks/state/useSelector.d.ts +13 -0
  365. package/esm/hooks/state/useSelector.d.ts.map +1 -0
  366. package/esm/hooks/state/useSelector.js +21 -0
  367. package/esm/hooks/state/useSetState.d.ts +11 -0
  368. package/esm/hooks/state/useSetState.d.ts.map +1 -0
  369. package/esm/hooks/state/useSetState.js +20 -0
  370. package/esm/hooks/useFlowId.d.ts +6 -0
  371. package/esm/hooks/useFlowId.d.ts.map +1 -0
  372. package/esm/hooks/useFlowId.js +19 -0
  373. package/esm/hooks/useListenRender.d.ts +2 -0
  374. package/esm/hooks/useListenRender.d.ts.map +1 -0
  375. package/esm/hooks/useListenRender.js +39 -0
  376. package/esm/hooks/useNodeTypes.d.ts +14 -0
  377. package/esm/hooks/useNodeTypes.d.ts.map +1 -0
  378. package/esm/hooks/useNodeTypes.js +46 -0
  379. package/esm/hooks/useTheme.d.ts +9 -0
  380. package/esm/hooks/useTheme.d.ts.map +1 -0
  381. package/esm/hooks/useTheme.js +19 -0
  382. package/esm/hooks/useThemeVars.d.ts +15 -0
  383. package/esm/hooks/useThemeVars.d.ts.map +1 -0
  384. package/esm/hooks/useThemeVars.js +26 -0
  385. package/esm/index.d.ts +28 -0
  386. package/esm/index.d.ts.map +1 -0
  387. package/esm/index.js +27 -0
  388. package/esm/index.less +7 -0
  389. package/esm/index.module.less +10 -0
  390. package/esm/plugins/export/index.d.ts +18 -0
  391. package/esm/plugins/export/index.d.ts.map +1 -0
  392. package/esm/plugins/export/index.js +71 -0
  393. package/esm/plugins/scrollbar/hooks/useScrollerOptions.d.ts +11 -0
  394. package/esm/plugins/scrollbar/hooks/useScrollerOptions.d.ts.map +1 -0
  395. package/esm/plugins/scrollbar/hooks/useScrollerOptions.js +38 -0
  396. package/esm/plugins/scrollbar/index.d.ts +5 -0
  397. package/esm/plugins/scrollbar/index.d.ts.map +1 -0
  398. package/esm/plugins/scrollbar/index.js +198 -0
  399. package/esm/plugins/scrollbar/index.less +10 -0
  400. package/esm/plugins/scrollbar/types.d.ts +24 -0
  401. package/esm/plugins/scrollbar/types.d.ts.map +1 -0
  402. package/esm/plugins/scrollbar/types.js +1 -0
  403. package/esm/providers/FlowProvider.d.ts +27 -0
  404. package/esm/providers/FlowProvider.d.ts.map +1 -0
  405. package/esm/providers/FlowProvider.js +90 -0
  406. package/esm/store/PropsStore.d.ts +16 -0
  407. package/esm/store/PropsStore.d.ts.map +1 -0
  408. package/esm/store/PropsStore.js +67 -0
  409. package/esm/types.d.ts +223 -0
  410. package/esm/types.d.ts.map +1 -0
  411. package/esm/types.js +1 -0
  412. package/esm/utils/dimension.d.ts +20 -0
  413. package/esm/utils/dimension.d.ts.map +1 -0
  414. package/esm/utils/dimension.js +89 -0
  415. package/esm/utils/getPopupContainer.d.ts +10 -0
  416. package/esm/utils/getPopupContainer.d.ts.map +1 -0
  417. package/esm/utils/getPopupContainer.js +12 -0
  418. package/esm/utils/getThemeWithDefaultValue.d.ts +10 -0
  419. package/esm/utils/getThemeWithDefaultValue.d.ts.map +1 -0
  420. package/esm/utils/getThemeWithDefaultValue.js +22 -0
  421. package/esm/utils/hasDimensionsChange.d.ts +10 -0
  422. package/esm/utils/hasDimensionsChange.d.ts.map +1 -0
  423. package/esm/utils/hasDimensionsChange.js +28 -0
  424. package/esm/utils/layouts/base.d.ts +16 -0
  425. package/esm/utils/layouts/base.d.ts.map +1 -0
  426. package/esm/utils/layouts/base.js +19 -0
  427. package/esm/utils/layouts/mindmap.d.ts +7 -0
  428. package/esm/utils/layouts/mindmap.d.ts.map +1 -0
  429. package/esm/utils/layouts/mindmap.js +131 -0
  430. package/esm/utils/measureText.d.ts +21 -0
  431. package/esm/utils/measureText.d.ts.map +1 -0
  432. package/esm/utils/measureText.js +69 -0
  433. package/esm/utils/parse.d.ts +11 -0
  434. package/esm/utils/parse.d.ts.map +1 -0
  435. package/esm/utils/parse.js +26 -0
  436. package/esm/utils/preCreateInnerNode.d.ts +11 -0
  437. package/esm/utils/preCreateInnerNode.d.ts.map +1 -0
  438. package/esm/utils/preCreateInnerNode.js +42 -0
  439. package/esm/utils/uuid.d.ts +10 -0
  440. package/esm/utils/uuid.d.ts.map +1 -0
  441. package/esm/utils/uuid.js +10 -0
  442. package/package.json +82 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowProvider.d.ts","sourceRoot":"","sources":["FlowProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,aAAa,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAErD,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAS,aAAa,EAAC,MAAM,SAAS,CAAC;AAE9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAG9C,eAAO,MAAM,WAAW;;EAET,CAAC;AA+BhB,eAAO,MAAM,YAAY;cAIX,MAAM,SAAS;;4TAY3B,CAAA;AAGF;;;GAGG;AACH,eAAO,MAAM,WAAW,wBAA2B,aAAa,SAAS,aAAa,CAAC,CAAC,KAAK,CAAC,MAO7F,CAAA;AAED,eAAO,MAAM,WAAW,qKAOvB,CAAA;AAED,eAAO,MAAM,WAAW,2BAOvB,CAAA"}
@@ -0,0 +1,90 @@
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-10-16 17:28
10
+ * @modified:2025/10/16 17:28 by yanxianliang
11
+ * @desc: 全局状态管理器
12
+ *
13
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
14
+ */
15
+
16
+ import { ReactFlowProvider } from "@xyflow/react";
17
+ import React, { memo, useContext, useState } from "react";
18
+ import { create } from "zustand";
19
+ import { devtools } from "zustand/middleware";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ // Context 外部提供,支持inner hooks
22
+ export var FlowContext = /*#__PURE__*/React.createContext(null);
23
+ var FlowProviderWrapper = function FlowProviderWrapper(_ref) {
24
+ var children = _ref.children;
25
+ var _useState = useState(function () {
26
+ return create(devtools(function (set) {
27
+ return {
28
+ onEdgesChangeHandlers: [],
29
+ // onChange 列表
30
+ forceRenderTimes: 0,
31
+ initialNodeIdSet: new Set(),
32
+ nodeTypeMap: new Map(),
33
+ smartEdges: {},
34
+ edgeStore: {}
35
+ };
36
+ }, {
37
+ name: "flow",
38
+ enabled: process.env.NODE_ENV === 'development'
39
+ }));
40
+ }),
41
+ _useState2 = _slicedToArray(_useState, 1),
42
+ useStore = _useState2[0];
43
+ return /*#__PURE__*/_jsx(FlowContext.Provider, {
44
+ value: {
45
+ useStore: useStore
46
+ },
47
+ children: children
48
+ });
49
+ };
50
+ export var FlowProvider = /*#__PURE__*/memo(function (_ref2) {
51
+ var children = _ref2.children;
52
+ var hasWrapped = useContext(FlowContext);
53
+ if (hasWrapped) {
54
+ return children;
55
+ }
56
+ return /*#__PURE__*/_jsx(ReactFlowProvider, {
57
+ children: /*#__PURE__*/_jsx(FlowProviderWrapper, {
58
+ children: children
59
+ })
60
+ });
61
+ });
62
+
63
+ /**
64
+ * hooks 创建
65
+ * selector 创建
66
+ */
67
+ export var useSelector = function useSelector(selector) {
68
+ var context = useContext(FlowContext);
69
+ if (!context) {
70
+ console.error("Missing provider for context:", FlowContext);
71
+ throw new Error("Missing provider for context");
72
+ }
73
+ return context.useStore(selector);
74
+ };
75
+ export var useSetState = function useSetState() {
76
+ var context = useContext(FlowContext);
77
+ if (!context) {
78
+ console.error("Missing provider for context:", FlowContext);
79
+ throw new Error("Missing provider for context");
80
+ }
81
+ return context.useStore.setState;
82
+ };
83
+ export var useGetState = function useGetState() {
84
+ var context = useContext(FlowContext);
85
+ if (!context) {
86
+ console.error("Missing provider for context:", FlowContext);
87
+ throw new Error("Missing provider for context");
88
+ }
89
+ return context.useStore.getState;
90
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-10-16 19:35
4
+ * @modified:2025/10/16 19:35 by yanxianliang
5
+ * @desc: Props 存储
6
+ *
7
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
8
+ */
9
+ import { IBaseFlowProps } from "../types";
10
+ import { Edge, Node } from "@xyflow/react";
11
+ import { ReactNode } from "react";
12
+ export declare const PropsStore: <NodeType extends Node = Node, EdgeType extends Edge = Edge>({ props, children }: {
13
+ props: IBaseFlowProps<NodeType, EdgeType>;
14
+ children: ReactNode;
15
+ }) => import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=PropsStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropsStore.d.ts","sourceRoot":"","sources":["PropsStore.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,cAAc,EAAkB,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAc,EAAC,SAAS,EAA6B,MAAM,OAAO,CAAC;AAKnE,eAAO,MAAM,UAAU;WAQZ,eAAe,QAAQ,EAAE,QAAQ,CAAC;cAC/B,SAAS;6CAoDtB,CAAA"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-10-16 19:35
4
+ * @modified:2025/10/16 19:35 by yanxianliang
5
+ * @desc: Props 存储
6
+ *
7
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
8
+ */
9
+
10
+ import { NodeRoleType } from "../constants/NodeRoleType";
11
+ import { useDeepCompareEffect } from 'ahooks';
12
+ import React, { useEffect, useMemo, useRef } from "react";
13
+ import { v4 as uuid } from "uuid";
14
+ import { useGetState } from "./..";
15
+ import { useSetState } from "./..";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ export var PropsStore = function PropsStore(_ref) {
20
+ var props = _ref.props,
21
+ children = _ref.children;
22
+ var setState = useSetState();
23
+ var getState = useGetState();
24
+ var defaultId = useMemo(function () {
25
+ return uuid();
26
+ }, []);
27
+ var nodeTypes = props.nodeTypes;
28
+ var styleContentRef = useRef([]);
29
+
30
+ // TODO 怎么支持内置的 nodeTypes???
31
+ var nodeTypeMap = useMemo(function () {
32
+ var map = new Map();
33
+ styleContentRef.current = [];
34
+ if (nodeTypes) {
35
+ for (var i = 0; i < nodeTypes.length; i++) {
36
+ var _definition$allowCont;
37
+ var definition = nodeTypes[i];
38
+ map.set(definition.type, definition);
39
+ // TODO 子工作流需要禁用内容区域的拖拽
40
+ if (definition.nodeRoleType === NodeRoleType.SubFlow && ((_definition$allowCont = definition.allowContentSelection) !== null && _definition$allowCont !== void 0 ? _definition$allowCont : true)) {
41
+ // 子工作流,需要固定样式
42
+ var type = definition.type;
43
+ styleContentRef.current.push(".react-flow__node-".concat(type, " {pointer-events: none!important;}"));
44
+ }
45
+ }
46
+ }
47
+ return map;
48
+ }, [nodeTypes]);
49
+ useDeepCompareEffect(function () {
50
+ setState({
51
+ props: props,
52
+ id: props.id || defaultId,
53
+ nodeTypeMap: nodeTypeMap
54
+ });
55
+ }, [props]);
56
+ useEffect(function () {
57
+ // nodes 变化,需要重新进行初始化,清除当前初始化记录
58
+ getState().initialNodeIdSet.clear();
59
+ }, [props.nodes]);
60
+
61
+ // 样式需要注入
62
+ return /*#__PURE__*/_jsxs(_Fragment, {
63
+ children: [/*#__PURE__*/_jsx("style", {
64
+ children: styleContentRef.current.join('')
65
+ }), children]
66
+ });
67
+ };
package/esm/types.d.ts ADDED
@@ -0,0 +1,223 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-07-02 09:30
4
+ * @desc: BaseFlow 类型文件定义
5
+ *
6
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
7
+ */
8
+ import { Edge, MarkerType, Node, PanelPosition, ReactFlowState, NodeProps, OnEdgesChange, ReactFlowProps } from "@xyflow/react";
9
+ import { NodeHandleBounds } from "@xyflow/system";
10
+ import React, { ComponentType } from "react";
11
+ import { MarkDefinition } from "./components/MarkerDefinitions/types";
12
+ import { ScrollbarPluginOptions } from "./plugins/scrollbar/types";
13
+ export type NodeTypeComponent<DataType extends Record<string, unknown> = Record<string, unknown>> = ComponentType<NodeProps<Node<DataType>>> & {
14
+ measureHandles?: (data: Node<DataType>) => NodeHandleBounds;
15
+ defaultSize?: {
16
+ width: number | ((node: Node<DataType>, theme: BaseThemeConfig) => number);
17
+ height: number | ((data: Node<DataType>, theme: BaseThemeConfig) => number);
18
+ };
19
+ };
20
+ export interface BaseThemeConfig {
21
+ /**
22
+ * @description 字体大小配置
23
+ * @default 14
24
+ */
25
+ fontSize?: number;
26
+ /**
27
+ * @description 字体家族配置
28
+ * @default "Arial, helvetica, sans-serif"
29
+ */
30
+ fontFamily?: string;
31
+ /**
32
+ * @description 主题色
33
+ * @default "#5F95FF"
34
+ */
35
+ primaryColor?: string;
36
+ /**
37
+ * @description 折叠按钮形状
38
+ * @default 'rect'
39
+ */
40
+ collapseButtonShape?: 'rect' | 'circle';
41
+ /**
42
+ * 展开时自动隐藏关联节点数量
43
+ */
44
+ autoHideCountWhenExpanded?: boolean;
45
+ /**
46
+ * @desc 是否显示依赖数量
47
+ * @default true
48
+ */
49
+ showCount?: boolean;
50
+ }
51
+ export type LayoutConfig<NodeType extends Node = Node, EdgeType extends Edge = Edge> = {
52
+ nodeTypes: Record<string, NodeTypeComponent>;
53
+ originNodes: NodeType[];
54
+ originEdges: EdgeType[];
55
+ theme: BaseThemeConfig;
56
+ onlyRenderVisibleElements: boolean;
57
+ store: ReactFlowState<NodeType, EdgeType>;
58
+ state: BaseStateType;
59
+ flowProps: IBaseFlowProps<NodeType, EdgeType>;
60
+ };
61
+ export type LayoutFunction<NodeType extends Node = Node, EdgeType extends Edge = Edge> = (config: LayoutConfig<NodeType, EdgeType>) => ({
62
+ nodes: NodeType[];
63
+ edges: EdgeType[];
64
+ });
65
+ export type MindMapLayoutConfig = {
66
+ hGap?: number;
67
+ vGap?: number;
68
+ markerType?: MarkerType;
69
+ };
70
+ export interface INodeDefinition<DataType extends Record<string, unknown> = Record<string, unknown>> {
71
+ type: string;
72
+ hideInLegend?: boolean;
73
+ hideInSider?: boolean;
74
+ group?: string;
75
+ order?: number;
76
+ label?: string;
77
+ icon?: React.ReactNode;
78
+ color?: string;
79
+ deletable?: boolean;
80
+ component: NodeTypeComponent<DataType>;
81
+ _component?: NodeTypeComponent<DataType>;
82
+ measureHandles?: (data: Node<DataType>) => NodeHandleBounds;
83
+ defaultSize?: {
84
+ width: number | ((node: Node<DataType>, theme: BaseThemeConfig) => number);
85
+ height: number | ((data: Node<DataType>, theme: BaseThemeConfig) => number);
86
+ };
87
+ [key: string]: any;
88
+ }
89
+ export interface IBaseFlowProps<NodeType extends Node = Node, EdgeType extends Edge = Edge> extends Omit<ReactFlowProps<NodeType, EdgeType>, 'nodeTypes' | 'width' | 'height'> {
90
+ /**
91
+ * @description graph 宽度
92
+ */
93
+ width?: string | number;
94
+ /**
95
+ * @description graph 高度
96
+ */
97
+ height?: string | number;
98
+ /**
99
+ * @description 背景颜色
100
+ */
101
+ background?: string;
102
+ /**
103
+ * @description 主题配置
104
+ */
105
+ theme?: BaseThemeConfig;
106
+ nodeTypes?: Array<INodeDefinition<NodeType['data']>>;
107
+ /**
108
+ * @description 是否显示控制器
109
+ * @default true
110
+ */
111
+ showControls?: boolean;
112
+ controlsPosition?: PanelPosition;
113
+ controlsOrientation?: 'horizontal' | 'vertical';
114
+ customControls?: React.ReactNode;
115
+ showMiniMap?: boolean;
116
+ getMiniMapNodeColor?: (node: Node) => string;
117
+ showFullscreen?: boolean;
118
+ /**
119
+ * @description 是否显示布局优化操作
120
+ */
121
+ showForceLayout?: boolean;
122
+ showInteractive?: boolean;
123
+ showFitView?: boolean;
124
+ showZoom?: boolean;
125
+ /**
126
+ * @description 是否显示图例
127
+ * @default false
128
+ */
129
+ showLegend?: boolean | {
130
+ /**
131
+ * 是否显示所有的图例,false时只显示当前显示节点的图例
132
+ * @default true
133
+ */
134
+ showAll?: boolean;
135
+ };
136
+ /**
137
+ * @description 是否自动居中
138
+ * @default false
139
+ */
140
+ autoCenter?: boolean;
141
+ rootStyle?: React.CSSProperties;
142
+ layout?: LayoutFunction<NodeType, EdgeType>;
143
+ /**
144
+ * @description 是否强制布局
145
+ * @default !!layout
146
+ */
147
+ forceLayout?: boolean;
148
+ markers?: MarkDefinition[];
149
+ plugins?: {
150
+ scroller?: false | ScrollbarPluginOptions;
151
+ };
152
+ /**
153
+ * @description 是否开启 service worker 模式,当为数字时,检测当前的节点数量,节点数量大于配置阈值时启用 serviceWorker模式,否则直接在 js中执行;当为true时强制使用 service worker 执行计算逻辑。false时默认关闭
154
+ * @default false
155
+ */
156
+ readOnly?: boolean;
157
+ onZoomIn?: () => void;
158
+ /** Called in addition the default zoom behavior when the zoom out button is clicked. */
159
+ onZoomOut?: () => void;
160
+ /**
161
+ * Called when the fit view button is clicked. When this is not provided, the viewport will be
162
+ * adjusted so that all nodes are visible.
163
+ */
164
+ onFitView?: () => void;
165
+ /** Called when the interactive (lock) button is clicked. */
166
+ onInteractiveChange?: (interactiveStatus: boolean) => void;
167
+ /**
168
+ * @description nodes 节点变化/初始化渲染回调
169
+ */
170
+ onRender?: (nodes: NodeType[], edges: EdgeType[], timing: number) => void;
171
+ omitProps?: string[];
172
+ /**
173
+ * 强制执行 fitView 逻辑,当 nodes 变化时自动触发 forceFitView
174
+ */
175
+ forceFitView?: boolean;
176
+ }
177
+ export type CollapseButtonProps = {
178
+ position?: 'left' | 'right';
179
+ loading?: boolean;
180
+ collapsed?: boolean;
181
+ count: number;
182
+ onCollapse?: (collapsed: boolean) => void;
183
+ direction?: 'vertical' | 'horizontal';
184
+ displayCount?: boolean;
185
+ autoHideCountWhenExpanded?: boolean;
186
+ };
187
+ export interface TreeNode {
188
+ id: string;
189
+ type: string;
190
+ collapsed?: boolean;
191
+ childCount?: number;
192
+ children?: Array<TreeNode>;
193
+ }
194
+ export interface BaseNodeData {
195
+ id: string;
196
+ type: string;
197
+ }
198
+ export type NodeRenderProps = NodeProps & {
199
+ data: any;
200
+ type: any;
201
+ };
202
+ export type PopupTriggerEventType = {
203
+ onMouseEnter?: (event: React.MouseEvent<HTMLElement>) => void;
204
+ onMouseLeave?: (event: React.MouseEvent<HTMLElement>) => void;
205
+ onPointerEnter?: (event: React.MouseEvent<HTMLElement>) => void;
206
+ onPointerLeave?: (event: React.MouseEvent<HTMLElement>) => void;
207
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
208
+ };
209
+ export type BaseStateType = {
210
+ id: string;
211
+ props: Record<string, any>;
212
+ onEdgesChangeHandlers: OnEdgesChange<any>[];
213
+ isNodeDragging: boolean;
214
+ forceRenderTimes: number;
215
+ initialNodeIdSet: Set<string>;
216
+ nodeTypeMap: Map<string, INodeDefinition>;
217
+ smartEdges: Record<string, boolean>;
218
+ edgeStore: Record<string, any>;
219
+ };
220
+ export type ExtractState<S> = S extends {
221
+ getState: () => infer T;
222
+ } ? T : never;
223
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,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AK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC9D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAChE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CAC1D,CAAA;AAID,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,qBAAqB,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5C,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC,CAAA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS;IACtC,QAAQ,EAAE,MAAM,MAAM,CAAC,CAAC;CACzB,GAAG,CAAC,GAAG,KAAK,CAAC"}
package/esm/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { BaseThemeConfig, NodeTypeComponent } from "../types";
2
+ import { InternalNode, Node } from '@xyflow/react';
3
+ import { NodeLookup } from "@xyflow/system";
4
+ /**
5
+ * 计算节点的宽度
6
+ * @param node
7
+ * @param nodeTypes
8
+ * @param theme
9
+ * @param nodeLookup
10
+ */
11
+ export declare function getNodeWidth(node: Node, nodeTypes?: Record<string, NodeTypeComponent>, theme?: BaseThemeConfig, nodeLookup?: NodeLookup<InternalNode>): number;
12
+ /**
13
+ * 计算节点的高度
14
+ * @param node
15
+ * @param nodeTypes
16
+ * @param theme
17
+ * @param nodeLookup
18
+ */
19
+ export declare function getNodeHeight(node: Node, nodeTypes?: Record<string, NodeTypeComponent>, theme?: BaseThemeConfig, nodeLookup?: NodeLookup<InternalNode>): number;
20
+ //# sourceMappingURL=dimension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dimension.d.ts","sourceRoot":"","sources":["dimension.ts"],"names":[],"mappings":"AAQA,OAAO,EAAe,eAAe,EAAE,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAC,YAAY,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAG1C;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC7C,KAAK,CAAC,EAAE,eAAe,EACvB,UAAU,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,UAkCtC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,EACV,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC7C,KAAK,CAAC,EAAE,eAAe,EACvB,UAAU,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,UAkCtC"}
@@ -0,0 +1,89 @@
1
+ /*
2
+ * @author: yanxianliang
3
+ * @date: 2025-05-17 22:24
4
+ * @desc: dimension 计算 utils
5
+ *
6
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
7
+ */
8
+
9
+ /**
10
+ * 计算节点的宽度
11
+ * @param node
12
+ * @param nodeTypes
13
+ * @param theme
14
+ * @param nodeLookup
15
+ */
16
+ export function getNodeWidth(node, nodeTypes, theme, nodeLookup) {
17
+ // 优先级,lookup > node measured 配置>size>calc
18
+ if (nodeLookup && nodeLookup.has(node.id)) {
19
+ var _lookup$measured;
20
+ var lookup = nodeLookup.get(node.id);
21
+ if (typeof (lookup === null || lookup === void 0 || (_lookup$measured = lookup.measured) === null || _lookup$measured === void 0 ? void 0 : _lookup$measured.width) === 'number') {
22
+ var _lookup$measured2;
23
+ return lookup === null || lookup === void 0 || (_lookup$measured2 = lookup.measured) === null || _lookup$measured2 === void 0 ? void 0 : _lookup$measured2.width; // 实际的高度
24
+ }
25
+ }
26
+ var type = node.type,
27
+ measured = node.measured,
28
+ width = node.width;
29
+ if (typeof (measured === null || measured === void 0 ? void 0 : measured.width) === 'number') {
30
+ return measured.width;
31
+ }
32
+ if (typeof width === 'number') {
33
+ return width;
34
+ }
35
+ if (!type || !(nodeTypes !== null && nodeTypes !== void 0 && nodeTypes[type]) || !(nodeTypes !== null && nodeTypes !== void 0 && nodeTypes[type].defaultSize)) {
36
+ return 1;
37
+ }
38
+ var ctr = nodeTypes[type];
39
+ var defaults = ctr.defaultSize;
40
+ if (defaults.width) {
41
+ if (typeof defaults.width === 'number') {
42
+ return defaults.width;
43
+ }
44
+ return defaults.width(node, theme);
45
+ } else {
46
+ return 1;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * 计算节点的高度
52
+ * @param node
53
+ * @param nodeTypes
54
+ * @param theme
55
+ * @param nodeLookup
56
+ */
57
+ export function getNodeHeight(node, nodeTypes, theme, nodeLookup) {
58
+ // 优先级,lookup > node measured 配置>size>calc
59
+ if (nodeLookup && nodeLookup.has(node.id)) {
60
+ var _lookup$measured3;
61
+ var lookup = nodeLookup.get(node.id);
62
+ if (typeof (lookup === null || lookup === void 0 || (_lookup$measured3 = lookup.measured) === null || _lookup$measured3 === void 0 ? void 0 : _lookup$measured3.height) === 'number') {
63
+ var _lookup$measured4;
64
+ return lookup === null || lookup === void 0 || (_lookup$measured4 = lookup.measured) === null || _lookup$measured4 === void 0 ? void 0 : _lookup$measured4.height; // 实际的高度
65
+ }
66
+ }
67
+ var type = node.type,
68
+ measured = node.measured,
69
+ height = node.height;
70
+ if (typeof (measured === null || measured === void 0 ? void 0 : measured.height) === 'number') {
71
+ return measured.height;
72
+ }
73
+ if (typeof height === 'number') {
74
+ return height;
75
+ }
76
+ if (!type || !(nodeTypes !== null && nodeTypes !== void 0 && nodeTypes[type]) || !(nodeTypes !== null && nodeTypes !== void 0 && nodeTypes[type].defaultSize)) {
77
+ return 1;
78
+ }
79
+ var ctr = nodeTypes[type];
80
+ var defaults = ctr === null || ctr === void 0 ? void 0 : ctr.defaultSize;
81
+ if (defaults.height) {
82
+ if (typeof defaults.height === 'number') {
83
+ return defaults.height;
84
+ }
85
+ return defaults.height(node, theme);
86
+ } else {
87
+ return 1;
88
+ }
89
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-09-10 15:28
4
+ * @modified:2025/9/10 15:28 by yanxianliang
5
+ * @desc: popupContainer 处理
6
+ *
7
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
8
+ */
9
+ export declare const getPopupContainer: () => HTMLElement;
10
+ //# sourceMappingURL=getPopupContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPopupContainer.d.ts","sourceRoot":"","sources":["getPopupContainer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,iBAAiB,mBAE7B,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-09-10 15:28
4
+ * @modified:2025/9/10 15:28 by yanxianliang
5
+ * @desc: popupContainer 处理
6
+ *
7
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
8
+ */
9
+
10
+ export var getPopupContainer = function getPopupContainer() {
11
+ return document.fullscreenElement || document.body;
12
+ };
@@ -0,0 +1,10 @@
1
+ import { BaseThemeConfig } from "../types";
2
+ export declare const getThemeWithDefaultValue: <ThemeConfig extends BaseThemeConfig>(theme?: ThemeConfig) => {
3
+ fontSize: number;
4
+ fontFamily: string;
5
+ primaryColor: string;
6
+ collapseButtonShape?: "rect" | "circle" | undefined;
7
+ autoHideCountWhenExpanded?: boolean | undefined;
8
+ showCount?: boolean | undefined;
9
+ };
10
+ //# sourceMappingURL=getThemeWithDefaultValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getThemeWithDefaultValue.d.ts","sourceRoot":"","sources":["getThemeWithDefaultValue.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,wBAAwB,gDAAiD,WAAW;;;;;;;CAOhG,CAAA"}
@@ -0,0 +1,22 @@
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-05-17 16:12
10
+ * @desc: 默认主题获取函数
11
+ *
12
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
13
+ */
14
+
15
+ export var getThemeWithDefaultValue = function getThemeWithDefaultValue(theme) {
16
+ var _theme$fontSize, _theme$fontFamily, _theme$primaryColor;
17
+ return _objectSpread(_objectSpread({}, theme), {}, {
18
+ fontSize: (_theme$fontSize = theme === null || theme === void 0 ? void 0 : theme.fontSize) !== null && _theme$fontSize !== void 0 ? _theme$fontSize : 14,
19
+ fontFamily: (_theme$fontFamily = theme === null || theme === void 0 ? void 0 : theme.fontFamily) !== null && _theme$fontFamily !== void 0 ? _theme$fontFamily : 'Arial, helvetica, sans-serif',
20
+ primaryColor: (_theme$primaryColor = theme === null || theme === void 0 ? void 0 : theme.primaryColor) !== null && _theme$primaryColor !== void 0 ? _theme$primaryColor : '#5F95FF'
21
+ });
22
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-07-08 10:22
4
+ * @desc: 有dimensions change事件
5
+ *
6
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
7
+ */
8
+ import { NodeChange, Node } from "@xyflow/react";
9
+ export declare const hasDimensionsChange: <NodeType extends Node>(changes: NodeChange<NodeType>[]) => boolean;
10
+ //# sourceMappingURL=hasDimensionsChange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasDimensionsChange.d.ts","sourceRoot":"","sources":["hasDimensionsChange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,mBAAmB,mCAAoC,WAAW,QAAQ,CAAC,EAAE,YAOzF,CAAA"}
@@ -0,0 +1,28 @@
1
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
+ 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); }
3
+ 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; }
4
+ /**
5
+ * @author: yanxianliang
6
+ * @date: 2025-07-08 10:22
7
+ * @desc: 有dimensions change事件
8
+ *
9
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
10
+ */
11
+
12
+ export var hasDimensionsChange = function hasDimensionsChange(changes) {
13
+ var _iterator = _createForOfIteratorHelper(changes),
14
+ _step;
15
+ try {
16
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
17
+ var change = _step.value;
18
+ if (change.type === 'dimensions') {
19
+ return true;
20
+ }
21
+ }
22
+ } catch (err) {
23
+ _iterator.e(err);
24
+ } finally {
25
+ _iterator.f();
26
+ }
27
+ return false;
28
+ };