refactor(core): remove node intersections arg from drag events (#1460)

* refactor(core): remove node intersections arg from drag events

* chore(changeset): add

* docs(examples): update intersection example
This commit is contained in:
Braks
2024-06-13 00:04:51 +02:00
parent a9ccd61eec
commit 0825101ebe
8 changed files with 70 additions and 22 deletions
@@ -50,7 +50,6 @@ const NodeWrapper = defineComponent({
addSelectedNodes,
updateNodeDimensions,
onUpdateNodeInternals,
getIntersectingNodes,
getNodeTypes,
nodeExtent,
elevateNodesOnSelect,
@@ -120,17 +119,16 @@ const NodeWrapper = defineComponent({
id: props.id,
el: nodeElement,
disabled: () => !isDraggable.value,
selectable: () => isSelectable.value,
selectable: isSelectable,
dragHandle: () => node.dragHandle,
onStart(args) {
// todo: remove intersections from here - they are not needed and only reduce performance
emit.dragStart({ ...args, intersections: getIntersectingNodes(node) })
emit.dragStart(args)
},
onDrag(args) {
emit.drag({ ...args, intersections: getIntersectingNodes(node) })
emit.drag(args)
},
onStop(args) {
emit.dragStop({ ...args, intersections: getIntersectingNodes(node) })
emit.dragStop(args)
},
})