refactor(types)!: Remove ElementId type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
+2
-13
@@ -1,16 +1,5 @@
|
||||
import { isGraphNode, rectToBox } from './graph'
|
||||
import {
|
||||
Edge,
|
||||
EdgePositions,
|
||||
ElementId,
|
||||
GraphNode,
|
||||
HandleElement,
|
||||
Position,
|
||||
Transform,
|
||||
XYPosition,
|
||||
FlowElements,
|
||||
GraphEdge,
|
||||
} from '~/types'
|
||||
import { Edge, EdgePositions, GraphNode, HandleElement, Position, Transform, XYPosition, FlowElements, GraphEdge } from '~/types'
|
||||
|
||||
export function getHandlePosition(position: Position, node: GraphNode, handle?: HandleElement): XYPosition {
|
||||
const x = (handle?.x ?? 0) + node.position.x
|
||||
@@ -42,7 +31,7 @@ export function getHandlePosition(position: Position, node: GraphNode, handle?:
|
||||
}
|
||||
}
|
||||
|
||||
export function getHandle(bounds: HandleElement[], handleId?: ElementId): HandleElement | undefined {
|
||||
export function getHandle(bounds: HandleElement[], handleId?: string): HandleElement | undefined {
|
||||
if (!bounds) return undefined
|
||||
|
||||
// there is no handleId when there are no multiple handles/ handles with ids
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import { getSourceTargetNodes } from './edge'
|
||||
import {
|
||||
ElementId,
|
||||
Node,
|
||||
Edge,
|
||||
Elements,
|
||||
@@ -81,7 +80,7 @@ export const removeElements = (elementsToRemove: Elements, elements: Elements) =
|
||||
return elements.filter((element) => !shouldRemove(element))
|
||||
}
|
||||
|
||||
const getEdgeId = ({ source, sourceHandle, target, targetHandle }: Connection): ElementId =>
|
||||
const getEdgeId = ({ source, sourceHandle, target, targetHandle }: Connection) =>
|
||||
`vueflow__edge-${source}${sourceHandle}-${target}${targetHandle}`
|
||||
|
||||
const connectionExists = (edge: Edge, elements: Elements) => {
|
||||
|
||||
Reference in New Issue
Block a user