feat(nodes): add option to pass a valid target pos / valid source pos func to nodes
* edge updater cannot discern a valid connection by itself so we allow an option to pass a valid connection func to nodes which will then be used to determine if updating connection is valid * it is optional, by default all connections are valid Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -11,8 +11,8 @@ export enum ConnectionLineType {
|
||||
export interface Connection {
|
||||
source: ElementId
|
||||
target: ElementId
|
||||
sourceHandle: ElementId
|
||||
targetHandle: ElementId
|
||||
sourceHandle?: ElementId
|
||||
targetHandle?: ElementId
|
||||
}
|
||||
|
||||
export type ConnectionLineProps = {
|
||||
@@ -28,9 +28,9 @@ export type ConnectionLineProps = {
|
||||
|
||||
export type OnConnectFunc = (connection: Connection) => void
|
||||
export type OnConnectStartParams = {
|
||||
nodeId: ElementId | undefined
|
||||
handleId: ElementId | undefined
|
||||
handleType: HandleType | undefined
|
||||
nodeId?: ElementId
|
||||
handleId?: ElementId
|
||||
handleType?: HandleType
|
||||
}
|
||||
export type OnConnectStartFunc = (event: MouseEvent, params: OnConnectStartParams) => void
|
||||
export type OnConnectStopFunc = (event: MouseEvent) => void
|
||||
|
||||
Reference in New Issue
Block a user