update!: graphnode and node typing

* graphnode is a node containing internal Vue Flow data
* move util files to util directory
* move flow actions type into store file
* rename panel type file to zoom
* rename types file to flow
* Rename Node to NodeWrapper
* Rename Edge to EdgeWrapper

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-21 16:25:27 +01:00
parent ba24f3ca62
commit 062aee45b2
36 changed files with 280 additions and 275 deletions
@@ -1,19 +1,19 @@
<script lang="ts" setup>
import { Draggable, DraggableEventListener } from '@braks/revue-draggable'
import { useStore } from '../../composables'
import { Node } from '../../types'
import { getRectOfNodes, isNode } from '../../utils'
import { GraphNode } from '../../types'
import { getRectOfNodes, isGraphNode } from '../../utils'
const store = useStore()
const selectedNodes = store.selectedElements
? store.selectedElements.filter(isNode).map((selectedNode) => {
const selectedNodes: GraphNode[] = store.selectedElements
? store.selectedElements.filter(isGraphNode).map((selectedNode) => {
const matchingNode = store.nodes.find((node) => node.id === selectedNode.id)
return {
...matchingNode,
position: matchingNode?.__vf?.position,
} as Node
} as GraphNode
})
: []