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
+17 -12
View File
@@ -1,21 +1,22 @@
import { Component, CSSProperties, DefineComponent } from 'vue'
import { XYPosition, ElementId, Position } from './types'
import { HandleElement } from '~/types/handle'
import { XYPosition, ElementId, Position } from './flow'
import { HandleElement } from './handle'
interface VFInternals {
position: XYPosition
isDragging?: boolean
width: number
height: number
handleBounds: {
source: HandleElement[] | null
target: HandleElement[] | null
}
}
export interface Node<T = any> {
id: ElementId
position: XYPosition
type?: string
__vf?: {
position: XYPosition
isDragging?: boolean
width: number
height: number
handleBounds?: {
source?: HandleElement[] | null
target?: HandleElement[] | null
}
}
class?: string
style?: CSSProperties
data?: T
@@ -27,6 +28,10 @@ export interface Node<T = any> {
connectable?: boolean
}
export interface GraphNode<T = any> extends Node<T> {
__vf: VFInternals
}
export type NodePosUpdate = {
id: ElementId
pos: XYPosition