refactor(nodes,edges): Add node/edge add changes

# What's changed?

* Elements are not added directly to state but parsed and emitted through change handler and then inserted to state
* Remove add element cb from apply changes
* Remove reset change (not implemented)
This commit is contained in:
Braks
2022-05-04 20:41:24 +02:00
parent 567b55b8e4
commit 1ddeffe1af
4 changed files with 67 additions and 53 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { Connection, Edge, Elements, FlowEvents, FlowInstance, FlowTransform, Node, SnapGrid } from '@braks/vue-flow'
import { Background, Controls, MarkerType, MiniMap, VueFlow, addEdge } from '@braks/vue-flow/src/index'
import { Background, Controls, MarkerType, MiniMap, VueFlow, addEdge } from '@braks/vue-flow'
const onNodeDragStart = (e: FlowEvents['nodeDragStart']) => console.log('drag start', e)
const onNodeDrag = (e: FlowEvents['nodeDrag']) => console.log('drag', e)