11.10.0
版本发布时间: 2023-11-10 23:55:18
xyflow/xyflow最新发布版本:@xyflow/system@0.0.42(2024-09-12 18:24:16)
Upcoming v12
We want to make the migration for v12 as smooth as possible. That's why we added deprecation warnings for the following util functions:
Deprecations / Renamings
Rename useReactFlow.project
to useReactFlow.screenToFlowPosition
⚠️ changes: no need to subtract react flow bounds anymore!
before:
const reactFlowBounds = reactFlowWrapper.current.getBoundingClientRect();
const position = reactFlowInstance.project({
x: event.clientX - reactFlowBounds.left,
y: event.clientY - reactFlowBounds.top,
});
after:
const position = reactFlowInstance.screenToFlowPosition({
x: event.clientX,
y: event.clientY,
});
Rename getTransformForBounds
to getViewportForBounds
⚠️ changes: returns { x: number, y: number, zoom: number }
instead of [number, number, number]
.
before:
const [x, y, zoom] = getTransformForBounds(bounds, width, height, 0.5, 2)
after:
const {x, y, zoom} = getViewportForBounds(bounds, width, height, 0.5, 2)
Rename getRectOfNodes
to getNodesBounds
no changes, just a renaming.
New features
- added
useReactFlow.flowToScreenPosition
Minor Changes
-
#3597
a114c75b
Thanks - chore(utils): add renamed functions and deprecations, adduseReactFlow.flowToScreenPosition
Patch Changes
-
#3586
746fa4a0
Thanks @Nick-Lucas! - fix(intersection-helpers): use nodeRect instead of nodeOrRect -
#3584
291db12f
- fix(panOnScroll): respect zoomActivationKeyPressed when hovering a node -
#3593
e1d3d594
Thanks @juspy! - fix(useOnSelectionChange): multiple handlers -
#3595
ddc40528
Thanks @bcakmakoglu! - refactor(pan-activation): allow panning by scroll when pan activation key is pressed -
#3596
e4c25caf
- refactor(handles): snap to handle center when above handle - Updated dependencies [
a114c75b
,746fa4a0
,291db12f
,e1d3d594
,ddc40528
,e4c25caf
]:- @reactflow/core@11.10.0
- @reactflow/background@11.3.5
- @reactflow/controls@11.2.5
- @reactflow/minimap@11.7.5
- @reactflow/node-resizer@2.2.5
- @reactflow/node-toolbar@1.3.5