Implemented 2D visualization for notes using Vue Flow

This commit is contained in:
Atharva Sawant
2024-03-08 11:23:47 +05:30
parent ffb5eeddf2
commit ce53a54dc5
488 changed files with 123675 additions and 20 deletions

View File

@@ -0,0 +1,16 @@
declare const _default: import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>
export default _default

View File

@@ -0,0 +1,24 @@
declare const ConnectionLine: import('vue').DefineComponent<
{},
() =>
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
| null,
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>
export default ConnectionLine

View File

@@ -0,0 +1,108 @@
declare const _default: import('vue').DefineComponent<
{
id: {
type: import('vue').PropType<string>
}
label: {
type: import('vue').PropType<any>
}
markerStart: {
type: import('vue').PropType<string>
}
markerEnd: {
type: import('vue').PropType<string>
}
interactionWidth: {
type: import('vue').PropType<number>
default: number
}
labelStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelShowBg: {
type: import('vue').PropType<boolean>
}
labelBgStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelBgPadding: {
type: import('vue').PropType<[number, number]>
}
labelBgBorderRadius: {
type: import('vue').PropType<number>
}
path: {
type: import('vue').PropType<string>
required: true
}
labelX: {
type: import('vue').PropType<number>
}
labelY: {
type: import('vue').PropType<number>
}
},
{
pathEl: import('vue').Ref<SVGPathElement | null>
interactionEl: import('vue').Ref<SVGPathElement | null>
labelEl: import('vue').Ref<SVGGElement | null>
},
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<{
id: {
type: import('vue').PropType<string>
}
label: {
type: import('vue').PropType<any>
}
markerStart: {
type: import('vue').PropType<string>
}
markerEnd: {
type: import('vue').PropType<string>
}
interactionWidth: {
type: import('vue').PropType<number>
default: number
}
labelStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelShowBg: {
type: import('vue').PropType<boolean>
}
labelBgStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelBgPadding: {
type: import('vue').PropType<[number, number]>
}
labelBgBorderRadius: {
type: import('vue').PropType<number>
}
path: {
type: import('vue').PropType<string>
required: true
}
labelX: {
type: import('vue').PropType<number>
}
labelY: {
type: import('vue').PropType<number>
}
}>
>,
{
interactionWidth: number
},
{}
>
export default _default

View File

@@ -0,0 +1,20 @@
import type { BezierEdgeProps } from '../../types'
declare const BezierEdge: import('vue').DefineComponent<
BezierEdgeProps,
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<BezierEdgeProps>,
{
label?: any
},
{}
>
export default BezierEdge

View File

@@ -0,0 +1,12 @@
import type { FunctionalComponent, HTMLAttributes } from 'vue'
import type { Position } from '../../types'
interface Props extends HTMLAttributes {
position: Position
centerX: number
centerY: number
radius?: number
type: string
}
declare const EdgeAnchor: FunctionalComponent<Props>
export default EdgeAnchor

View File

@@ -0,0 +1,26 @@
declare const _default: __VLS_WithTemplateSlots<
import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>,
{
default?(_: {}): any
}
>
export default _default
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S
}
}

View File

@@ -0,0 +1,102 @@
declare const _default: __VLS_WithTemplateSlots<
import('vue').DefineComponent<
{
x: {
type: import('vue').PropType<number>
required: true
}
y: {
type: import('vue').PropType<number>
required: true
}
label: {
type: import('vue').PropType<
| string
| object
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
>
}
labelStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelShowBg: {
type: import('vue').PropType<boolean>
}
labelBgStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelBgPadding: {
type: import('vue').PropType<[number, number]>
}
labelBgBorderRadius: {
type: import('vue').PropType<number>
}
},
{},
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<{
x: {
type: import('vue').PropType<number>
required: true
}
y: {
type: import('vue').PropType<number>
required: true
}
label: {
type: import('vue').PropType<
| string
| object
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
>
}
labelStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelShowBg: {
type: import('vue').PropType<boolean>
}
labelBgStyle: {
type: import('vue').PropType<import('vue').CSSProperties>
}
labelBgPadding: {
type: import('vue').PropType<[number, number]>
}
labelBgBorderRadius: {
type: import('vue').PropType<number>
}
}>
>,
{},
{}
>,
{
default?(_: {}): any
}
>
export default _default
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S
}
}

View File

@@ -0,0 +1,34 @@
declare const EdgeWrapper: import('vue').DefineComponent<
Readonly<{
id?: any
}>,
() =>
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
| null,
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<
Readonly<{
id?: any
}>
>
>,
{
readonly id?: any
},
{}
>
export default EdgeWrapper

View File

@@ -0,0 +1,20 @@
import type { SimpleBezierEdgeProps } from '../../types'
declare const SimpleBezierEdge: import('vue').DefineComponent<
SimpleBezierEdgeProps,
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<SimpleBezierEdgeProps>,
{
label?: any
},
{}
>
export default SimpleBezierEdge

View File

@@ -0,0 +1,20 @@
import type { SmoothStepEdgeProps } from '../../types'
declare const SmoothStepEdge: import('vue').DefineComponent<
SmoothStepEdgeProps,
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<SmoothStepEdgeProps>,
{
label?: any
},
{}
>
export default SmoothStepEdge

View File

@@ -0,0 +1,20 @@
import type { StepEdgeProps } from '../../types'
declare const StepEdge: import('vue').DefineComponent<
StepEdgeProps,
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<StepEdgeProps>,
{
label?: any
},
{}
>
export default StepEdge

View File

@@ -0,0 +1,20 @@
import type { StraightEdgeProps } from '../../types'
declare const StraightEdge: import('vue').DefineComponent<
StraightEdgeProps,
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<StraightEdgeProps>,
{
label?: any
},
{}
>
export default StraightEdge

View File

@@ -0,0 +1,10 @@
export { default as BaseEdge } from './BaseEdge.vue'
export { default as BezierEdge } from './BezierEdge'
export { default as SimpleBezierEdge } from './SimpleBezierEdge'
export { default as StepEdge } from './StepEdge'
export { default as SmoothStepEdge } from './SmoothStepEdge'
export { default as StraightEdge } from './StraightEdge'
export { default as EdgeAnchor } from './EdgeAnchor'
export { default as EdgeText } from './EdgeText.vue'
export { default as EdgeWrapper } from './EdgeWrapper'
export { default as EdgeLabelRenderer } from './EdgeLabelRenderer.vue'

View File

@@ -0,0 +1,27 @@
import type { Position } from '../../../types'
import type { EdgePathParams } from './general'
export interface GetBezierPathParams {
sourceX: number
sourceY: number
sourcePosition?: Position
targetX: number
targetY: number
targetPosition?: Position
curvature?: number
}
/**
* Get a bezier path from source to target handle
* @public
*
* @param bezierPathParams
* @param bezierPathParams.sourceX - The x position of the source handle
* @param bezierPathParams.sourceY - The y position of the source handle
* @param bezierPathParams.sourcePosition - The position of the source handle (default: Position.Bottom)
* @param bezierPathParams.targetX - The x position of the target handle
* @param bezierPathParams.targetY - The y position of the target handle
* @param bezierPathParams.targetPosition - The position of the target handle (default: Position.Top)
* @param bezierPathParams.curvature - The curvature of the edge (default: 0.25)
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
*/
export declare function getBezierPath(bezierPathParams: GetBezierPathParams): EdgePathParams

View File

@@ -0,0 +1,31 @@
export type EdgePathParams = [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]
export declare function getSimpleEdgeCenter({
sourceX,
sourceY,
targetX,
targetY,
}: {
sourceX: number
sourceY: number
targetX: number
targetY: number
}): [number, number, number, number]
export declare function getBezierEdgeCenter({
sourceX,
sourceY,
targetX,
targetY,
sourceControlX,
sourceControlY,
targetControlX,
targetControlY,
}: {
sourceX: number
sourceY: number
targetX: number
targetY: number
sourceControlX: number
sourceControlY: number
targetControlX: number
targetControlY: number
}): [number, number, number, number]

View File

@@ -0,0 +1,5 @@
export * from './bezier'
export * from './general'
export * from './simple-bezier'
export * from './smoothstep'
export * from './straight'

View File

@@ -0,0 +1,25 @@
import type { Position } from '../../../types'
import type { EdgePathParams } from './general'
export interface GetSimpleBezierPathParams {
sourceX: number
sourceY: number
sourcePosition?: Position
targetX: number
targetY: number
targetPosition?: Position
}
/**
* Get a simple bezier path from source to target handle (no curvature)
* @public
*
* @param simpleBezierPathParams
* @param simpleBezierPathParams.sourceX - The x position of the source handle
* @param simpleBezierPathParams.sourceY - The y position of the source handle
* @param simpleBezierPathParams.sourcePosition - The position of the source handle (default: Position.Bottom)
* @param simpleBezierPathParams.targetX - The x position of the target handle
* @param simpleBezierPathParams.targetY - The y position of the target handle
* @param simpleBezierPathParams.targetPosition - The position of the target handle (default: Position.Top)
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
*/
export declare function getSimpleBezierPath(simpleBezierPathParams: GetSimpleBezierPathParams): EdgePathParams

View File

@@ -0,0 +1,30 @@
import type { Position } from '../../../types'
import type { EdgePathParams } from './general'
export interface GetSmoothStepPathParams {
sourceX: number
sourceY: number
sourcePosition?: Position
targetX: number
targetY: number
targetPosition?: Position
borderRadius?: number
centerX?: number
centerY?: number
offset?: number
}
/**
* Get a smooth step path from source to target handle
* @public
*
* @param smoothStepPathParams
* @param smoothStepPathParams.sourceX - The x position of the source handle
* @param smoothStepPathParams.sourceY - The y position of the source handle
* @param smoothStepPathParams.sourcePosition - The position of the source handle (default: Position.Bottom)
* @param smoothStepPathParams.targetX - The x position of the target handle
* @param smoothStepPathParams.targetY - The y position of the target handle
* @param smoothStepPathParams.targetPosition - The position of the target handle (default: Position.Top)
* @param smoothStepPathParams.borderRadius - The border radius of the edge (default: 5)
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
*/
export declare function getSmoothStepPath(smoothStepPathParams: GetSmoothStepPathParams): EdgePathParams

View File

@@ -0,0 +1,20 @@
import type { EdgePathParams } from './general'
export interface GetStraightPathParams {
sourceX: number
sourceY: number
targetX: number
targetY: number
}
/**
* Get a straight path from source to target handle
* @public
*
* @param straightEdgeParams
* @param straightEdgeParams.sourceX - The x position of the source handle
* @param straightEdgeParams.sourceY - The y position of the source handle
* @param straightEdgeParams.targetX - The x position of the target handle
* @param straightEdgeParams.targetY - The y position of the target handle
* @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label
*/
export declare function getStraightPath(straightEdgeParams: GetStraightPathParams): EdgePathParams

View File

@@ -0,0 +1,79 @@
import type { Position } from '../../types'
declare const _default: __VLS_WithTemplateSlots<
import('vue').DefineComponent<
{
id: {
type: import('vue').PropType<string>
}
type: {
type: import('vue').PropType<import('../../types').HandleType>
}
position: {
type: import('vue').PropType<Position>
}
isValidConnection: {
type: import('vue').PropType<import('../../types').ValidConnectionFunc>
}
connectable: {
type: import('vue').PropType<import('../../types').HandleConnectable>
}
connectableStart: {
type: import('vue').PropType<boolean>
}
connectableEnd: {
type: import('vue').PropType<boolean>
}
},
{
handleClick: (event: MouseEvent) => void
handlePointerDown: (event: import('../../types').MouseTouchEvent) => void
onClick: (event: MouseEvent) => void
onPointerDown: (event: MouseEvent | TouchEvent) => void
},
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<{
id: {
type: import('vue').PropType<string>
}
type: {
type: import('vue').PropType<import('../../types').HandleType>
}
position: {
type: import('vue').PropType<Position>
}
isValidConnection: {
type: import('vue').PropType<import('../../types').ValidConnectionFunc>
}
connectable: {
type: import('vue').PropType<import('../../types').HandleConnectable>
}
connectableStart: {
type: import('vue').PropType<boolean>
}
connectableEnd: {
type: import('vue').PropType<boolean>
}
}>
>,
{},
{}
>,
{
default?(_: { id: string | undefined }): any
}
>
export default _default
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S
}
}

View File

@@ -0,0 +1,9 @@
import type { FunctionalComponent } from 'vue'
import type { NodeProps } from '../../types'
declare const DefaultNode: FunctionalComponent<
NodeProps<{
label: any
}>
>
export default DefaultNode

View File

@@ -0,0 +1,9 @@
import type { FunctionalComponent } from 'vue'
import type { NodeProps } from '../../types'
declare const InputNode: FunctionalComponent<
NodeProps<{
label: any
}>
>
export default InputNode

View File

@@ -0,0 +1,37 @@
declare const NodeWrapper: import('vue').DefineComponent<
Readonly<{
id?: any
resizeObserver?: any
}>,
() =>
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
| null,
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<
Readonly<{
id?: any
resizeObserver?: any
}>
>
>,
{
readonly id?: any
readonly resizeObserver?: any
},
{}
>
export default NodeWrapper

View File

@@ -0,0 +1,9 @@
import type { FunctionalComponent } from 'vue'
import type { NodeProps } from '../../types'
declare const OutputNode: FunctionalComponent<
NodeProps<{
label: any
}>
>
export default OutputNode

View File

@@ -0,0 +1,4 @@
export { default as DefaultNode } from './DefaultNode'
export { default as InputNode } from './InputNode'
export { default as OutputNode } from './OutputNode'
export { default as NodeWrapper } from './NodeWrapper'

View File

@@ -0,0 +1,16 @@
declare const _default: import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>
export default _default

View File

@@ -0,0 +1,38 @@
declare const _default: __VLS_WithTemplateSlots<
import('vue').DefineComponent<
{
position: {
type: import('vue').PropType<import('../../types/panel').PanelPositionType | import('../../types/panel').PanelPosition>
required: true
}
},
{},
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<{
position: {
type: import('vue').PropType<import('../../types/panel').PanelPositionType | import('../../types/panel').PanelPosition>
required: true
}
}>
>,
{},
{}
>,
{
default?(_: {}): any
}
>
export default _default
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S
}
}

View File

@@ -0,0 +1,30 @@
import type { SelectionRect } from '../../types'
declare const _default: import('vue').DefineComponent<
{
userSelectionRect: {
type: import('vue').PropType<SelectionRect>
required: true
}
},
{},
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<{
userSelectionRect: {
type: import('vue').PropType<SelectionRect>
required: true
}
}>
>,
{},
{}
>
export default _default

View File

@@ -0,0 +1,6 @@
export * from './Nodes'
export * from './Edges'
export { default as ConnectionLine } from './ConnectionLine'
export { default as Handle } from './Handle/Handle.vue'
export { default as NodesSelection } from './NodesSelection/NodesSelection.vue'
export { default as UserSelection } from './UserSelection/UserSelection.vue'

View File

@@ -0,0 +1,13 @@
export * from './useDrag'
export * from './useEdge'
export * from './useEdgeHooks'
export * from './useGetPointerPosition'
export * from './useHandle'
export * from './useKeyPress'
export * from './useNode'
export * from './useNodeHooks'
export * from './useUpdateNodePositions'
export * from './useViewportHelper'
export * from './useVueFlow'
export * from './useWatchProps'
export * from './useZoomPanHelper'

View File

@@ -0,0 +1,12 @@
/**
* Composable for accessing the currently ongoing connection.
*
* @public
* @returns current connection: startHandle, endHandle, status, position
*/
export declare function useConnection(): {
startHandle: import('vue').Ref<import('..').ConnectingHandle | null>
endHandle: import('vue').Ref<import('..').ConnectingHandle | null>
status: import('vue').Ref<import('..').ConnectionStatus | null>
position: import('vue').Ref<import('..').XYPosition>
}

View File

@@ -0,0 +1,24 @@
import type { D3DragEvent, SubjectPosition } from 'd3-drag'
import type { MaybeRefOrGetter, Ref } from 'vue'
import type { MouseTouchEvent, NodeDragEvent } from '../types'
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>
interface UseDragParams {
onStart: (event: NodeDragEvent) => void
onDrag: (event: NodeDragEvent) => void
onStop: (event: NodeDragEvent) => void
onClick?: (event: MouseTouchEvent) => void
el: Ref<Element | null>
disabled?: MaybeRefOrGetter<boolean>
selectable?: MaybeRefOrGetter<boolean>
dragHandle?: MaybeRefOrGetter<string | undefined>
id?: string
}
/**
* Composable that provides drag behavior for nodes
*
* @internal
* @param params
*/
export declare function useDrag(params: UseDragParams): Ref<boolean>
export {}

View File

@@ -0,0 +1,20 @@
import type { CustomEvent, ElementData } from '../types'
/**
* Composable that provides access to an edge object and it's dom element
*
* If no edge id is provided, the edge id is injected from context
*
* If you do not provide an id, this composable has to be called in a child of your custom edge component, or it will throw
*
* @public
* @param id - The id of the edge to access
* @returns the edge id, the edge and the edge dom element
*/
export declare function useEdge<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(
id?: string,
): {
id: string
edge: import('../types').GraphEdge<Data, CustomEvents>
edgeEl: import('vue').Ref<SVGElement | null>
}

View File

@@ -0,0 +1,14 @@
import type { EdgeEventsEmit, EdgeEventsOn, GraphEdge, VueFlowStore } from '../types'
/**
* Composable for handling edge events
*
* @internal
*/
export declare function useEdgeHooks(
edge: GraphEdge,
emits: VueFlowStore['emits'],
): {
emit: EdgeEventsEmit
on: EdgeEventsOn
}

View File

@@ -0,0 +1,27 @@
import type { ComputedRef, MaybeRefOrGetter } from 'vue'
import type { Edge, GraphEdge } from '../types'
interface EdgeData<EdgeType extends Edge = GraphEdge> {
id: string
type: EdgeType['type']
data: NonNullable<EdgeType['data']> | null
}
/**
* Composable for receiving data of one or multiple nodes
*
* @public
* @param edgeId - The id (or ids) of the node to get the data from
* @param guard - Optional guard function to narrow down the node type
* @returns An array of data objects
*/
export declare function useEdgesData<EdgeType extends Edge = GraphEdge>(
edgeId: MaybeRefOrGetter<string>,
): ComputedRef<EdgeData<EdgeType> | null>
export declare function useEdgesData<EdgeType extends Edge = GraphEdge>(
edgeIds: MaybeRefOrGetter<string[]>,
): ComputedRef<EdgeData<EdgeType>[]>
export declare function useEdgesData<EdgeType extends Edge = GraphEdge>(
edgeIds: MaybeRefOrGetter<string[]>,
guard: (node: Edge) => node is EdgeType,
): ComputedRef<EdgeData<EdgeType>[]>
export {}

View File

@@ -0,0 +1,14 @@
import type { MouseTouchEvent } from '../types'
import type { UseDragEvent } from './useDrag'
/**
* Composable that returns a function to get the pointer position
*
* @internal
*/
export declare function useGetPointerPosition(): (event: UseDragEvent | MouseTouchEvent) => {
x: number
y: number
xSnapped: number
ySnapped: number
}

View File

@@ -0,0 +1,31 @@
import type { MaybeRefOrGetter } from 'vue'
import type { Connection, HandleType, MouseTouchEvent, ValidConnectionFunc } from '../types'
export interface UseHandleProps {
handleId: MaybeRefOrGetter<string | null>
nodeId: MaybeRefOrGetter<string>
type: MaybeRefOrGetter<HandleType>
isValidConnection?: MaybeRefOrGetter<ValidConnectionFunc | null>
edgeUpdaterType?: MaybeRefOrGetter<HandleType>
onEdgeUpdate?: (event: MouseTouchEvent, connection: Connection) => void
onEdgeUpdateEnd?: (event: MouseTouchEvent) => void
}
/**
* This composable provides listeners for handle events
*
* Generally it's recommended to use the `<Handle />` component instead of this composable.
*
* @public
*/
export declare function useHandle({
handleId,
nodeId,
type,
isValidConnection,
edgeUpdaterType,
onEdgeUpdate,
onEdgeUpdateEnd,
}: UseHandleProps): {
handlePointerDown: (event: MouseTouchEvent) => void
handleClick: (event: MouseEvent) => void
}

View File

@@ -0,0 +1,25 @@
import type { ComputedRef, MaybeRefOrGetter } from 'vue'
import type { HandleConnection, HandleType } from '../types'
export interface UseHandleConnectionsParams {
type: MaybeRefOrGetter<HandleType>
id?: MaybeRefOrGetter<string | null>
nodeId?: MaybeRefOrGetter<string | null>
onConnect?: (connections: HandleConnection[]) => void
onDisconnect?: (connections: HandleConnection[]) => void
}
/**
* Composable that returns existing connections of a `<Handle />`.
*
* @deprecated use `useNodeConnections` instead
* @public
* @param params
* @param params.type - handle type `source` or `target`
* @param params.nodeId - node id - if not provided, the node id from the `useNodeId` (meaning, the context-based injection) is used
* @param params.id - the handle id (this is required if the node has multiple handles of the same type)
* @param params.onConnect - gets called when a connection is created
* @param params.onDisconnect - gets called when a connection is removed
*
* @returns An array of connections
*/
export declare function useHandleConnections(params: UseHandleConnectionsParams): ComputedRef<HandleConnection[]>

View File

@@ -0,0 +1,20 @@
import type { MaybeRefOrGetter } from 'vue'
import type { KeyFilter } from '@vueuse/core'
export interface UseKeyPressOptions {
target?: MaybeRefOrGetter<EventTarget | null | undefined>
actInsideInputWithModifier?: MaybeRefOrGetter<boolean>
preventDefault?: MaybeRefOrGetter<boolean>
}
export declare function isInputDOMNode(event: KeyboardEvent): boolean
/**
* Composable that returns a boolean value if a key is pressed
*
* @public
* @param keyFilter - Can be a boolean, a string, an array of strings or a function that returns a boolean. If it's a boolean, it will act as if the key is always pressed. If it's a string, it will return true if a key matching that string is pressed. If it's an array of strings, it will return true if any of the strings match a key being pressed, or a combination (e.g. ['ctrl+a', 'ctrl+b'])
* @param options - Options object
*/
export declare function useKeyPress(
keyFilter: MaybeRefOrGetter<KeyFilter | boolean | null>,
options?: UseKeyPressOptions,
): import('vue').ShallowRef<boolean>

View File

@@ -0,0 +1,22 @@
import type { CustomEvent, ElementData } from '../types'
/**
* Composable that provides access to a node object, parent node object, connected edges and it's dom element
*
* If no node id is provided, the node id is injected from context
*
* If you do not provide an id, this composable has to be called in a child of your custom node component, or it will throw
*
* @public
* @param id - The id of the node to access
* @returns the node id, the node, the node dom element, it's parent and connected edges
*/
export declare function useNode<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(
id?: string,
): {
id: string
nodeEl: import('vue').Ref<HTMLDivElement | null>
node: import('../types').GraphNode<Data, CustomEvents, string>
parentNode: import('vue').ComputedRef<import('../types').GraphNode<any, any, string> | undefined>
connectedEdges: import('vue').ComputedRef<import('../types').GraphEdge[]>
}

View File

@@ -0,0 +1,24 @@
import type { MaybeRefOrGetter } from 'vue'
import type { HandleType, NodeConnection } from '../types'
export interface UseNodeConnectionsParams {
handleType?: MaybeRefOrGetter<HandleType | null | undefined>
handleId?: MaybeRefOrGetter<string | null | undefined>
nodeId?: MaybeRefOrGetter<string | null | undefined>
onConnect?: (connections: NodeConnection[]) => void
onDisconnect?: (connections: NodeConnection[]) => void
}
/**
* Hook to retrieve all edges connected to a node. Can be filtered by handle type and id.
*
* @public
* @param params
* @param params.handleType - handle type `source` or `target`
* @param params.nodeId - node id - if not provided, the node id from the `useNodeId` (meaning, the context-based injection) is used
* @param params.handleId - the handle id (this is required if the node has multiple handles of the same type)
* @param params.onConnect - gets called when a connection is created
* @param params.onDisconnect - gets called when a connection is removed
*
* @returns An array of connections
*/
export declare function useNodeConnections(params?: UseNodeConnectionsParams): import('vue').ComputedRef<NodeConnection[]>

View File

@@ -0,0 +1,14 @@
import type { GraphNode, NodeEventsEmit, NodeEventsOn, VueFlowStore } from '../types'
/**
* Composable for handling node events
*
* @internal
*/
export declare function useNodeHooks(
node: GraphNode,
emits: VueFlowStore['emits'],
): {
emit: NodeEventsEmit
on: NodeEventsOn
}

View File

@@ -0,0 +1,9 @@
/**
* This composable returns the current node id from the ctx.
*
* It should be used inside a (custom-)node components ctx as the id is provided by the internal `NodeWrapper` component.
*
* @public
* @returns the current node id
*/
export declare function useNodeId(): string

View File

@@ -0,0 +1,27 @@
import type { ComputedRef, MaybeRefOrGetter } from 'vue'
import type { GraphNode, Node } from '../types'
interface NodeData<NodeType extends Node = GraphNode> {
id: string
type: NodeType['type']
data: NonNullable<NodeType['data']>
}
/**
* Composable for receiving data of one or multiple nodes
*
* @public
* @param nodeId - The id (or ids) of the node to get the data from
* @param guard - Optional guard function to narrow down the node type
* @returns An array of data objects
*/
export declare function useNodesData<NodeType extends Node = GraphNode>(
nodeId: MaybeRefOrGetter<string>,
): ComputedRef<NodeData<NodeType> | null>
export declare function useNodesData<NodeType extends Node = GraphNode>(
nodeIds: MaybeRefOrGetter<string[]>,
): ComputedRef<NodeData<NodeType>[]>
export declare function useNodesData<NodeType extends Node = GraphNode>(
nodeIds: MaybeRefOrGetter<string[]>,
guard: (node: Node) => node is NodeType,
): ComputedRef<NodeData<NodeType>[]>
export {}

View File

@@ -0,0 +1,15 @@
export interface UseNodesInitializedOptions {
includeHiddenNodes?: boolean
}
/**
* Composable for getting the initialized state of all nodes.
*
* When a new node is added to the graph, it is not immediately initialized.
* That's because the node's bounds are not yet known.
* This composable will return false and then true when all nodes are initialized, i.e. when their bounds are known.
*
* @public
* @param options - Options
* @returns boolean indicating whether all nodes are initialized
*/
export declare function useNodesInitialized(options?: UseNodesInitializedOptions): import('vue').ComputedRef<boolean>

View File

@@ -0,0 +1,6 @@
/**
* Composable that handles the initialization of the viewport.
*
* @internal
*/
export declare function useOnInitHandler(): void

View File

@@ -0,0 +1,9 @@
import type { Ref } from 'vue'
/**
* Composable that handles the resize of the viewport.
*
* @internal
* @param viewportEl
*/
export declare function useResizeHandler(viewportEl: Ref<HTMLDivElement | null>): void

View File

@@ -0,0 +1 @@
export declare function useStylesLoadedWarning(): void

View File

@@ -0,0 +1,8 @@
import type { XYPosition } from '../types'
/**
* Composable for updating the position of nodes.
*
* @internal
*/
export declare function useUpdateNodePositions(): (positionDiff: XYPosition, isShiftPressed?: boolean) => void

View File

@@ -0,0 +1,20 @@
import type { D3Selection, Project, State, ViewportFunctions } from '../types'
export interface ViewportHelper extends ViewportFunctions {
viewportInitialized: boolean
screenToFlowCoordinate: Project
flowToScreenCoordinate: Project
}
/**
* Composable that provides viewport helper functions.
*
* @internal
* @param state
*/
export declare function useViewportHelper(state: State): import('vue').ComputedRef<ViewportHelper>
export declare function getD3Transition(
selection: D3Selection,
duration?: number,
ease?: (t: number) => number,
onEnd?: () => void,
): D3Selection | import('d3-transition').Transition<HTMLDivElement, unknown, null, undefined>

View File

@@ -0,0 +1,15 @@
import type { FlowOptions, VueFlowStore } from '../types'
/**
* Composable that provides access to a store instance
*
* If no id is provided, the store instance is injected from context
*
* If no store instance is found in context, a new store instance is created and registered in storage
*
* @public
* @returns a vue flow store instance
* @param idOrOpts - id of the store instance or options to create a new store instance
*/
export declare function useVueFlow(id?: string): VueFlowStore
export declare function useVueFlow(options?: FlowOptions): VueFlowStore

View File

@@ -0,0 +1,16 @@
import type { ToRefs } from 'vue'
import type { FlowProps, VueFlowStore } from '../types'
/**
* Watches props and updates the store accordingly
*
* @internal
* @param models
* @param props
* @param store
*/
export declare function useWatchProps(
models: ToRefs<Pick<FlowProps, 'nodes' | 'edges' | 'modelValue'>>,
props: FlowProps,
store: VueFlowStore,
): () => void

View File

@@ -0,0 +1,6 @@
import type { ViewportFunctions } from '../types'
/**
* @deprecated use {@link useVueFlow} instead (all viewport functions are also available in {@link useVueFlow})
*/
export declare function useZoomPanHelper(vueFlowId?: string): ViewportFunctions

View File

@@ -0,0 +1,16 @@
declare const _default: import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>
export default _default

View File

@@ -0,0 +1,16 @@
declare const _default: import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>
export default _default

View File

@@ -0,0 +1,72 @@
declare const _default: import('vue').DefineComponent<
{
id: {
type: import('vue').PropType<string>
required: true
}
type: {
type: import('vue').PropType<string>
required: true
}
color: {
type: import('vue').PropType<string>
}
width: {
type: import('vue').PropType<number>
}
height: {
type: import('vue').PropType<number>
}
markerUnits: {
type: import('vue').PropType<string>
}
orient: {
type: import('vue').PropType<string>
}
strokeWidth: {
type: import('vue').PropType<number>
}
},
{},
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<{
id: {
type: import('vue').PropType<string>
required: true
}
type: {
type: import('vue').PropType<string>
required: true
}
color: {
type: import('vue').PropType<string>
}
width: {
type: import('vue').PropType<number>
}
height: {
type: import('vue').PropType<number>
}
markerUnits: {
type: import('vue').PropType<string>
}
orient: {
type: import('vue').PropType<string>
}
strokeWidth: {
type: import('vue').PropType<number>
}
}>
>,
{},
{}
>
export default _default

View File

@@ -0,0 +1,16 @@
declare const _default: import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>
export default _default

View File

@@ -0,0 +1,46 @@
declare const _default: __VLS_WithTemplateSlots<
import('vue').DefineComponent<
{
isSelecting: {
type: import('vue').PropType<boolean>
required: true
}
selectionKeyPressed: {
type: import('vue').PropType<boolean>
required: true
}
},
{},
unknown,
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<
import('vue').ExtractPropTypes<{
isSelecting: {
type: import('vue').PropType<boolean>
required: true
}
selectionKeyPressed: {
type: import('vue').PropType<boolean>
required: true
}
}>
>,
{},
{}
>,
{
default?(_: {}): any
}
>
export default _default
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S
}
}

View File

@@ -0,0 +1,3 @@
import type { XYPosition } from '../../types'
export declare function getMousePosition(event: MouseEvent, containerBounds: DOMRect): XYPosition

View File

@@ -0,0 +1,26 @@
declare const _default: __VLS_WithTemplateSlots<
import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>,
{
default?(_: {}): any
}
>
export default _default
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S
}
}

View File

@@ -0,0 +1,26 @@
declare const _default: __VLS_WithTemplateSlots<
import('vue').DefineComponent<
{},
{},
{},
{},
{},
import('vue').ComponentOptionsMixin,
import('vue').ComponentOptionsMixin,
{},
string,
import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps,
Readonly<import('vue').ExtractPropTypes<{}>>,
{},
{}
>,
{
default?(_: {}): any
}
>
export default _default
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
export { default as VueFlow } from './VueFlow/VueFlow.vue'
export { default as EdgeRenderer } from './EdgeRenderer/EdgeRenderer.vue'
export { default as Marker } from './EdgeRenderer/Marker.vue'
export { default as MarkerDefinitions } from './EdgeRenderer/MarkerDefinitions.vue'
export { default as NodeRenderer } from './NodeRenderer/NodeRenderer.vue'
export { default as Viewport } from './Viewport/Viewport.vue'

View File

@@ -0,0 +1,9 @@
import type { InjectionKey, Ref } from 'vue'
import type { FlowSlots, VueFlowStore } from '../types'
export declare const VueFlow: InjectionKey<VueFlowStore>
export declare const NodeId: InjectionKey<string>
export declare const NodeRef: InjectionKey<Ref<HTMLDivElement | null>>
export declare const EdgeId: InjectionKey<string>
export declare const EdgeRef: InjectionKey<Ref<SVGElement | null>>
export declare const Slots: InjectionKey<Readonly<FlowSlots>>

69
node_modules/@vue-flow/core/dist/src/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,69 @@
/**
* Vue Flow
* @module vue-flow
*/
export { default as VueFlow } from './container/VueFlow/VueFlow.vue'
export { default as Handle } from './components/Handle/Handle.vue'
export { default as Panel } from './components/Panel/Panel.vue'
export { default as StraightEdge } from './components/Edges/StraightEdge'
export { default as StepEdge } from './components/Edges/StepEdge'
export { default as BezierEdge } from './components/Edges/BezierEdge'
export { default as SimpleBezierEdge } from './components/Edges/SimpleBezierEdge'
export { default as SmoothStepEdge } from './components/Edges/SmoothStepEdge'
export { default as BaseEdge } from './components/Edges/BaseEdge.vue'
export { default as EdgeText } from './components/Edges/EdgeText.vue'
export { default as EdgeLabelRenderer } from './components/Edges/EdgeLabelRenderer.vue'
export {
getBezierPath,
getSimpleBezierPath,
getSmoothStepPath,
getStraightPath,
getSimpleEdgeCenter,
getBezierEdgeCenter,
} from './components/Edges/utils'
export {
isNode,
isEdge,
isGraphNode,
isGraphEdge,
addEdge,
updateEdge,
getOutgoers,
getIncomers,
getConnectedEdges,
getTransformForBounds,
getRectOfNodes,
pointToRendererPoint,
rendererPointToPoint,
/** @deprecated - will be removed in the next major version, use `rendererPointToPoint` instead */
rendererPointToPoint as graphPosToZoomedPos,
getNodesInside,
getMarkerId,
getBoundsofRects,
connectionExists,
clamp,
} from './utils/graph'
/**
* @deprecated - Use store instance and call `applyChanges` with template-ref or the one received by `onPaneReady` instead
* Intended for options API
* In composition API you can access apply utilities from `useVueFlow`
*/
export { applyChanges, applyEdgeChanges, applyNodeChanges } from './utils/changes'
export { defaultEdgeTypes, defaultNodeTypes } from './utils/defaultNodesEdges'
export { VueFlow as VueFlowInjection, NodeId as NodeIdInjection } from './context'
export { useZoomPanHelper } from './composables/useZoomPanHelper'
export { useVueFlow } from './composables/useVueFlow'
export { useHandle } from './composables/useHandle'
export { useNode } from './composables/useNode'
export { useEdge } from './composables/useEdge'
export { useGetPointerPosition } from './composables/useGetPointerPosition'
export { useNodeId } from './composables/useNodeId'
export { useConnection } from './composables/useConnection'
export { useHandleConnections } from './composables/useHandleConnections'
export { useNodeConnections } from './composables/useNodeConnections'
export { useNodesData } from './composables/useNodesData'
export { useEdgesData } from './composables/useEdgesData'
export { useNodesInitialized } from './composables/useNodesInitialized'
export { useKeyPress } from './composables/useKeyPress'
export { VueFlowError, ErrorCode, isErrorOfType } from './utils/errors'
export * from './types'

View File

@@ -0,0 +1,8 @@
import type { ComputedRef } from 'vue'
import type { Actions, EdgeLookup, NodeLookup, State } from '../types'
export declare function useActions(
state: State,
nodeLookup: ComputedRef<NodeLookup>,
edgeLookup: ComputedRef<EdgeLookup>,
): Actions

View File

@@ -0,0 +1,8 @@
import type { ComputedRef } from 'vue'
import type { ComputedGetters, EdgeLookup, NodeLookup, State } from '../types'
export declare function useGetters(
state: State,
nodeLookup: ComputedRef<NodeLookup>,
edgeLookup: ComputedRef<EdgeLookup>,
): ComputedGetters

View File

@@ -0,0 +1,5 @@
import type { Ref } from 'vue'
import type { FlowHooks } from '../types'
export declare function createHooks(): FlowHooks
export declare function useHooks(emit: (...args: any[]) => void, hooks: Ref<FlowHooks>): void

View File

@@ -0,0 +1,4 @@
export * from './actions'
export * from './getters'
export * from './hooks'
export * from './state'

View File

@@ -0,0 +1,4 @@
import type { FlowOptions, State } from '../types'
export declare function useState(): State
export declare const storeOptionsToSkip: (keyof Partial<FlowOptions & Omit<State, 'nodes' | 'edges' | 'modelValue'>>)[]

View File

@@ -0,0 +1,56 @@
import type { Dimensions, ElementData, XYPosition } from './flow'
import type { GraphNode, Node, NodeHandleBounds } from './node'
import type { GraphEdge } from './edge'
export interface NodeDragItem {
id: string
position: XYPosition
distance: XYPosition
dimensions: Dimensions
from: XYPosition
extent?: Node['extent']
parentNode?: string
expandParent?: boolean
}
export interface NodeDimensionChange {
id: string
type: 'dimensions'
dimensions?: Dimensions
handleBounds?: NodeHandleBounds
updateStyle?: boolean
resizing?: boolean
}
export interface NodePositionChange {
id: string
type: 'position'
position: XYPosition
from: XYPosition
dragging?: boolean
}
export interface NodeSelectionChange {
id: string
type: 'select'
selected: boolean
}
export interface NodeRemoveChange {
id: string
type: 'remove'
}
export interface NodeAddChange<Data = ElementData> {
item: GraphNode<Data>
type: 'add'
}
export type NodeChange = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange
export type EdgeSelectionChange = NodeSelectionChange
export interface EdgeRemoveChange extends NodeRemoveChange {
source: string
target: string
sourceHandle: string | null
targetHandle: string | null
}
export interface EdgeAddChange<Data = ElementData> {
item: GraphEdge<Data>
type: 'add'
}
export type EdgeChange = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange
export type ElementChange = NodeChange | EdgeChange

View File

@@ -0,0 +1,39 @@
import type { CSSProperties, Component, DefineComponent, VNode } from 'vue'
import type { BezierEdge, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge } from '../components'
import type { NodeProps } from './node'
import type { EdgeProps } from './edge'
/** Global component names are components registered to the vue instance and are "autoloaded" by their string name */
type GlobalComponentName = string
/** Node Components can either be a component definition or a string name */
export type NodeComponent = Component<NodeProps> | DefineComponent<NodeProps, any, any, any, any> | GlobalComponentName
export type NodeTypesObject = {
[key in keyof DefaultNodeTypes]?: NodeComponent
} & Record<string, NodeComponent>
export type EdgeTypesObject = {
[key in keyof DefaultEdgeTypes]?: EdgeComponent
} & Record<string, EdgeComponent>
/** Edge Components can either be a component definition or a string name */
export type EdgeComponent = Component<EdgeProps> | DefineComponent<EdgeProps, any, any, any, any, any> | GlobalComponentName
export interface DefaultEdgeTypes {
default: typeof BezierEdge
straight: typeof StraightEdge
simplebezier: typeof SimpleBezierEdge
step: typeof StepEdge
smoothstep: typeof SmoothStepEdge
}
export type DefaultNodeTypes = {
[key in 'input' | 'output' | 'default']: NodeComponent
}
/** these props are passed to edge texts */
export interface EdgeTextProps {
x: number
y: number
label?: string | VNode | object
labelStyle?: CSSProperties
labelShowBg?: boolean
labelBgStyle?: CSSProperties
labelBgPadding?: [number, number]
labelBgBorderRadius?: number
}
export {}

View File

@@ -0,0 +1,90 @@
import type { CSSProperties } from 'vue'
import type { Position } from './flow'
import type { GraphNode } from './node'
import type { HandleElement, HandleType } from './handle'
import type { Edge, EdgeMarkerType } from './edge'
/** Connection line types (same as default edge types */
export declare enum ConnectionLineType {
Bezier = 'default',
SimpleBezier = 'simple-bezier',
Straight = 'straight',
Step = 'step',
SmoothStep = 'smoothstep',
}
export interface ConnectionLineOptions {
type?: ConnectionLineType
style?: CSSProperties
class?: string
markerEnd?: EdgeMarkerType
markerStart?: EdgeMarkerType
}
/** Connection params that are passed when onConnect is called */
export interface Connection {
/** Source node id */
source: string
/** Target node id */
target: string
/** Source handle id */
sourceHandle?: string | null
/** Target handle id */
targetHandle?: string | null
}
/**
* Connection with edge id
* @deprecated
* todo: remove in next major release
*/
export interface HandleConnection extends Connection {
edgeId: string
}
export type NodeConnection = Connection & {
edgeId: string
}
export type Connector = (
params: Connection,
) => Promise<(Connection & Partial<Edge>) | false> | ((Connection & Partial<Edge>) | false)
export type ConnectionStatus = 'valid' | 'invalid'
/** The source nodes params when connection is initiated */
export interface OnConnectStartParams {
/** Source node id */
nodeId?: string
/** Source handle id */
handleId: string | null
/** Source handle type */
handleType?: HandleType
}
/** Connection modes, when set to loose all handles are treated as source */
export declare enum ConnectionMode {
Strict = 'strict',
Loose = 'loose',
}
export interface ConnectionLineProps {
/** Source X position of the connection line */
sourceX: number
/** Source Y position of the connection line */
sourceY: number
/** Source position of the connection line */
sourcePosition: Position
/** Target X position of the connection line */
targetX: number
/** Target Y position of the connection line */
targetY: number
/** Target position of the connection line */
targetPosition: Position
/** The source node of the connection line */
sourceNode: GraphNode
/** The source handle element (not the DOM element) of the connection line */
sourceHandle: HandleElement | null
/** The target node of the connection line */
targetNode: GraphNode | null
/** The target handle element (not the DOM element) of the connection line */
targetHandle: HandleElement | null
/** marker url */
markerStart: string
/** marker url */
markerEnd: string
/** status of the connection (valid, invalid) */
connectionStatus: ConnectionStatus | null
}
export type ConnectionLookup = Map<string, Map<string, NodeConnection>>

208
node_modules/@vue-flow/core/dist/src/types/edge.d.ts generated vendored Normal file
View File

@@ -0,0 +1,208 @@
import type { CSSProperties, Component, VNode } from 'vue'
import type { ClassFunc, ElementData, Position, StyleFunc, Styles } from './flow'
import type { GraphNode } from './node'
import type { EdgeComponent, EdgeTextProps } from './components'
import type { CustomEvent, EdgeEventsHandler, EdgeEventsOn } from './hooks'
/** Edge markers */
export declare enum MarkerType {
Arrow = 'arrow',
ArrowClosed = 'arrowclosed',
}
/** Edge marker definition */
export interface EdgeMarker {
/** Unique marker id */
id?: string
/** Marker type */
type: MarkerType
/** Marker color */
color?: string
/** Marker width */
width?: number
/** Marker height */
height?: number
/** Marker units */
markerUnits?: string
/** Marker orientation */
orient?: string
/** Marker stroke width */
strokeWidth?: number
}
export interface MarkerProps {
id: string
type: MarkerType | string
color?: string
width?: number
height?: number
markerUnits?: string
orient?: string
strokeWidth?: number
}
export type EdgeMarkerType = string | MarkerType | EdgeMarker
export type EdgeUpdatable = boolean | 'target' | 'source'
export interface EdgeLabelOptions {
/** Label styles (CSSProperties) */
labelStyle?: CSSProperties
/** Show label bg */
labelShowBg?: boolean
/** Label Bg styles (CSSProperties) */
labelBgStyle?: CSSProperties
/** Label Bg padding */
labelBgPadding?: [number, number]
/** Label Bg border radius */
labelBgBorderRadius?: number
}
export interface DefaultEdge<
Data = ElementData,
CustomEvents extends Record<string, CustomEvent> = any,
Type extends string = string,
> extends EdgeLabelOptions {
/** Unique edge id */
id: string
/** An edge label */
label?: string | VNode | Component<EdgeTextProps>
/** Edge type, can be a default type or a custom type */
type?: Type
/** Source node id */
source: string
/** Target node id */
target: string
/** Source handle id */
sourceHandle?: string | null
/** Target handle id */
targetHandle?: string | null
/** Animated edge */
animated?: boolean
/** EdgeMarker */
markerStart?: EdgeMarkerType
/** EdgeMarker */
markerEnd?: EdgeMarkerType
/** Disable/enable updating edge */
updatable?: EdgeUpdatable
/** Disable/enable selecting edge */
selectable?: boolean
/** Disable/enable focusing edge (a11y) */
focusable?: boolean
/** Disable/enable deleting edge */
deletable?: boolean
/** Additional class names, can be a string or a callback returning a string (receives current flow element) */
class?: string | string[] | Record<string, any> | ClassFunc<GraphEdge<Data, CustomEvents>>
/** Additional styles, can be an object or a callback returning an object (receives current flow element) */
style?: Styles | StyleFunc<GraphEdge<Data, CustomEvents>>
/** Is edge hidden */
hidden?: boolean
/** Radius of mouse event triggers (to ease selecting edges), defaults to 2 */
interactionWidth?: number
/** Overwrites current edge type */
template?: EdgeComponent
/** Additional data that is passed to your custom components */
data?: Data
/** @deprecated will be removed in the next major version */
events?: Partial<EdgeEventsHandler<CustomEvents>>
/** Aria label for edge (a11y) */
zIndex?: number
ariaLabel?: string | null
}
export interface SmoothStepPathOptions {
offset?: number
borderRadius?: number
}
export type SmoothStepEdgeType<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = DefaultEdge<
Data,
CustomEvents
> & {
type: 'smoothstep'
pathOptions?: SmoothStepPathOptions
}
export interface BezierPathOptions {
curvature?: number
}
export type BezierEdgeType<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = DefaultEdge<
Data,
CustomEvents
> & {
type: 'default'
pathOptions?: BezierPathOptions
}
export type Edge<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any, Type extends string = string> =
| DefaultEdge<Data, CustomEvents, Type>
| SmoothStepEdgeType<Data, CustomEvents>
| BezierEdgeType<Data, CustomEvents>
export type DefaultEdgeOptions = Omit<Edge, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle'>
export interface EdgePositions {
sourceX: number
sourceY: number
targetX: number
targetY: number
}
/** Internal edge type */
export type GraphEdge<
Data = ElementData,
CustomEvents extends Record<string, CustomEvent> = any,
Type extends string = string,
> = Edge<Data, CustomEvents> & {
selected: boolean
sourceNode: GraphNode
targetNode: GraphNode
data: Data
/** @deprecated will be removed in the next major version */
events: Partial<EdgeEventsHandler<CustomEvents>>
type: Type
} & EdgePositions
/** these props are passed to edge components */
export interface EdgeProps<Data = ElementData, CustomEvents = object, Type extends string = string>
extends EdgeLabelOptions,
EdgePositions {
id: string
sourceNode: GraphNode
targetNode: GraphNode
source: string
target: string
type: Type
label?: string | VNode | Component<EdgeTextProps> | object
style?: CSSProperties
selected?: boolean
sourcePosition: Position
targetPosition: Position
sourceHandleId?: string
targetHandleId?: string
animated?: boolean
updatable?: boolean
markerStart: string
markerEnd: string
curvature?: number
interactionWidth?: number
data: Data
/** contextual and custom events of edge */
events: EdgeEventsOn<CustomEvents>
}
export interface BaseEdgeProps extends EdgeLabelOptions {
id?: string
labelX?: number
labelY?: number
path: string
label?: any
markerStart?: string
markerEnd?: string
interactionWidth?: number
}
export type BezierEdgeProps = EdgePositions &
BezierPathOptions &
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> &
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>
export type SimpleBezierEdgeProps = EdgePositions &
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> &
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>
export type StraightEdgeProps = EdgePositions & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>
export type StepEdgeProps = EdgePositions &
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> &
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>
export type SmoothStepEdgeProps = EdgePositions &
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> &
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'> &
SmoothStepPathOptions
export type ToGraphEdge<T extends Edge> = GraphEdge<
T extends Edge<infer Data> ? Data : never,
T extends Edge<never, infer CustomEvents> ? CustomEvents : never,
T extends Edge<never, never, infer Type> ? Type : never
>

322
node_modules/@vue-flow/core/dist/src/types/flow.d.ts generated vendored Normal file
View File

@@ -0,0 +1,322 @@
import type { CSSProperties } from 'vue'
import type { KeyFilter } from '@vueuse/core'
import type { D3ZoomEvent } from 'd3-zoom'
import type { VueFlowError } from '../utils'
import type { DefaultEdgeOptions, Edge, EdgeProps, EdgeUpdatable, GraphEdge } from './edge'
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node, NodeProps } from './node'
import type {
Connection,
ConnectionLineOptions,
ConnectionLineProps,
ConnectionLineType,
ConnectionMode,
Connector,
OnConnectStartParams,
} from './connection'
import type { PanOnScrollMode, ViewportTransform } from './zoom'
import type { EdgeTypesObject, NodeTypesObject } from './components'
import type { CustomEvent, EdgeMouseEvent, EdgeUpdateEvent, NodeDragEvent, NodeMouseEvent } from './hooks'
import type { ValidConnectionFunc } from './handle'
import type { EdgeChange, NodeChange } from './changes'
import type { VueFlowStore } from './store'
export type ElementData = any
/**
* @deprecated - will be removed in the next major version
* A flow element (after parsing into state)
*/
export type FlowElement<
NodeData = ElementData,
EdgeData = ElementData,
NodeEvents extends Record<string, CustomEvent> = any,
EdgeEvents extends Record<string, CustomEvent> = any,
> = GraphNode<NodeData, NodeEvents> | GraphEdge<EdgeData, EdgeEvents>
/**
* @deprecated - will be removed in the next major version
* An array of flow elements (after parsing into state)
*/
export type FlowElements<
NodeData = ElementData,
EdgeData = ElementData,
NodeEvents extends Record<string, CustomEvent> = any,
EdgeEvents extends Record<string, CustomEvent> = any,
> = FlowElement<NodeData, EdgeData, NodeEvents, EdgeEvents>[]
/** Initial elements (before parsing into state) */
export type Element<
NodeData = ElementData,
EdgeData = ElementData,
NodeEvents extends Record<string, CustomEvent> = any,
EdgeEvents extends Record<string, CustomEvent> = any,
> = Node<NodeData, NodeEvents> | Edge<EdgeData, EdgeEvents>
export type Elements<
NodeData = ElementData,
EdgeData = ElementData,
NodeEvents extends Record<string, CustomEvent> = any,
EdgeEvents extends Record<string, CustomEvent> = any,
> = Element<NodeData, EdgeData, NodeEvents, EdgeEvents>[]
export type MaybeElement = Node | Edge | Connection | FlowElement | Element
export interface CustomThemeVars {
[key: string]: string | number | undefined
}
export type CSSVars =
| '--vf-node-color'
| '--vf-box-shadow'
| '--vf-node-bg'
| '--vf-node-text'
| '--vf-connection-path'
| '--vf-handle'
export type ThemeVars = {
[key in CSSVars]?: CSSProperties['color']
}
export type Styles = CSSProperties & ThemeVars & CustomThemeVars
/** @deprecated will be removed in the next major version */
export type ClassFunc<ElementType extends FlowElement = FlowElement> = (element: ElementType) => string | void
/** @deprecated will be removed in the next major version */
export type StyleFunc<ElementType extends FlowElement = FlowElement> = (element: ElementType) => Styles | void
/** Handle Positions */
export declare enum Position {
Left = 'left',
Top = 'top',
Right = 'right',
Bottom = 'bottom',
}
export interface XYPosition {
x: number
y: number
}
export type XYZPosition = XYPosition & {
z: number
}
export interface Dimensions {
width: number
height: number
}
export interface Box extends XYPosition {
x2: number
y2: number
}
export interface Rect extends Dimensions, XYPosition {}
export type SnapGrid = [x: number, y: number]
export interface SelectionRect extends Rect {
startX: number
startY: number
}
export declare enum SelectionMode {
Partial = 'partial',
Full = 'full',
}
export interface FlowExportObject {
/** exported nodes */
nodes: Node[]
/** exported edges */
edges: Edge[]
/**
* exported viewport position
* @deprecated use {@link FlowExportObject.viewport} instead
*/
position: [x: number, y: number]
/**
* exported zoom level
* @deprecated use {@link FlowExportObject.viewport} instead
*/
zoom: number
/** exported viewport (position + zoom) */
viewport: ViewportTransform
}
export interface FlowProps {
id?: string
/**
* all elements (nodes + edges)
* @deprecated use {@link FlowProps.nodes} & {@link FlowProps.nodes} instead
*/
modelValue?: Elements
nodes?: Node[]
edges?: Edge[]
/** either use the edgeTypes prop to define your edge-types or use slots (<template #edge-mySpecialType="props">) */
edgeTypes?: EdgeTypesObject
/** either use the nodeTypes prop to define your node-types or use slots (<template #node-mySpecialType="props">) */
nodeTypes?: NodeTypesObject
connectionMode?: ConnectionMode
/** @deprecated use {@link ConnectionLineOptions.type} */
connectionLineType?: ConnectionLineType | null
/** @deprecated use {@link ConnectionLineOptions.style} */
connectionLineStyle?: CSSProperties | null
connectionLineOptions?: ConnectionLineOptions
connectionRadius?: number
isValidConnection?: ValidConnectionFunc | null
deleteKeyCode?: KeyFilter | null
selectionKeyCode?: KeyFilter | boolean | null
multiSelectionKeyCode?: KeyFilter | null
zoomActivationKeyCode?: KeyFilter | null
panActivationKeyCode?: KeyFilter | null
snapToGrid?: boolean
snapGrid?: SnapGrid
onlyRenderVisibleElements?: boolean
edgesUpdatable?: EdgeUpdatable
nodesDraggable?: boolean
nodesConnectable?: boolean
nodeDragThreshold?: number
elementsSelectable?: boolean
selectNodesOnDrag?: boolean
/** move pane on drag, replaced prop `paneMovable` */
panOnDrag?: boolean | number[]
minZoom?: number
maxZoom?: number
defaultViewport?: Partial<ViewportTransform>
translateExtent?: CoordinateExtent
nodeExtent?: CoordinateExtent | CoordinateExtentRange
defaultMarkerColor?: string
zoomOnScroll?: boolean
zoomOnPinch?: boolean
panOnScroll?: boolean
panOnScrollSpeed?: number
panOnScrollMode?: PanOnScrollMode
/**
* Distance that the mouse can move between mousedown/up that will trigger a click
* @default 0
*/
paneClickDistance?: number
zoomOnDoubleClick?: boolean
/** If set to false, scrolling inside the viewport will be disabled and instead the page scroll will be used */
preventScrolling?: boolean
selectionMode?: SelectionMode
edgeUpdaterRadius?: number
/** will be renamed to `fitView` */
fitViewOnInit?: boolean
/** allow connection with click handlers, i.e. support touch devices */
connectOnClick?: boolean
/**
* apply default change handlers for position, dimensions, adding/removing nodes. set this to false if you want to apply the changes manually
* @deprecated - will be removed in the next major version, changes will not be auto applied in the future
*/
applyDefault?: boolean
/**
* automatically create an edge when connection is triggered
* @deprecated - will be removed in the next major version
*/
autoConnect?: boolean | Connector
noDragClassName?: string
noWheelClassName?: string
noPanClassName?: string
/** does not work for the `addEdge` utility! */
defaultEdgeOptions?: DefaultEdgeOptions
/** elevates edges when selected and applies z-Index to put them above their nodes */
elevateEdgesOnSelect?: boolean
/** elevates nodes when selected and applies z-Index + 1000 */
elevateNodesOnSelect?: boolean
disableKeyboardA11y?: boolean
edgesFocusable?: boolean
nodesFocusable?: boolean
autoPanOnConnect?: boolean
autoPanOnNodeDrag?: boolean
autoPanSpeed?: number
}
/**
* All available VueFlow options
* @deprecated use the {@link FlowProps} type instead
*/
export type FlowOptions = FlowProps
export interface FlowEmits {
(event: 'nodesChange', changes: NodeChange[]): void
(event: 'edgesChange', changes: EdgeChange[]): void
(event: 'nodesInitialized'): void
/** @deprecated use `init` instead */
(event: 'paneReady', paneEvent: VueFlowStore): void
(event: 'init', paneEvent: VueFlowStore): void
(event: 'updateNodeInternals'): void
(event: 'error', error: VueFlowError): void
(event: 'connect', connectionEvent: Connection): void
(
event: 'connectStart',
connectionEvent: {
event?: MouseEvent
} & OnConnectStartParams,
): void
(event: 'connectEnd', connectionEvent?: MouseEvent): void
(
event: 'clickConnectStart',
connectionEvent: {
event?: MouseEvent
} & OnConnectStartParams,
): void
(event: 'clickConnectEnd', connectionEvent?: MouseEvent): void
(
event: 'moveStart',
moveEvent: {
event: D3ZoomEvent<HTMLDivElement, any>
flowTransform: ViewportTransform
},
): void
(
event: 'move',
moveEvent: {
event: D3ZoomEvent<HTMLDivElement, any>
flowTransform: ViewportTransform
},
): void
(
event: 'moveEnd',
moveEvent: {
event: D3ZoomEvent<HTMLDivElement, any>
flowTransform: ViewportTransform
},
): void
(event: 'selectionDragStart', selectionEvent: NodeDragEvent): void
(event: 'selectionDrag', selectionEvent: NodeDragEvent): void
(event: 'selectionDragStop', selectionEvent: NodeDragEvent): void
(
event: 'selectionContextMenu',
selectionEvent: {
event: MouseEvent
nodes: GraphNode[]
},
): void
(event: 'selectionStart', selectionEvent: MouseEvent): void
(event: 'selectionEnd', selectionEvent: MouseEvent): void
(event: 'viewportChangeStart', viewport: ViewportTransform): void
(event: 'viewportChange', viewport: ViewportTransform): void
(event: 'viewportChangeEnd', viewport: ViewportTransform): void
(event: 'paneScroll', paneScrollEvent: WheelEvent | undefined): void
(
event: 'paneClick' | 'paneContextMenu' | 'paneMouseEnter' | 'paneMouseMove' | 'paneMouseLeave',
paneMouseEvent: MouseEvent,
): void
(event: 'edgeUpdate', edgeUpdateEvent: EdgeUpdateEvent): void
(
event:
| 'edgeContextMenu'
| 'edgeMouseEnter'
| 'edgeMouseMove'
| 'edgeMouseLeave'
| 'edgeDoubleClick'
| 'edgeClick'
| 'edgeUpdateStart'
| 'edgeUpdateEnd',
edgeMouseEvent: EdgeMouseEvent,
): void
(
event: 'nodeContextMenu' | 'nodeMouseEnter' | 'nodeMouseMove' | 'nodeMouseLeave' | 'nodeDoubleClick' | 'nodeClick',
nodeMouseEvent: NodeMouseEvent,
): void
(event: 'nodeDragStart' | 'nodeDrag' | 'nodeDragStop', nodeDragEvent: NodeDragEvent): void
(
event:
| 'miniMapNodeClick'
| 'miniMapNodeDoubleClick'
| 'miniMapNodeMouseEnter'
| 'miniMapNodeMouseMove'
| 'miniMapNodeMouseLeave',
nodeMouseEvent: NodeMouseEvent,
): void
/** v-model event definitions */
(event: 'update:modelValue', value: FlowElements): void
(event: 'update:nodes', value: GraphNode[]): void
(event: 'update:edges', value: GraphEdge[]): void
}
export interface NodeSlots extends Record<`node-${string}`, (nodeProps: NodeProps) => any> {}
export interface EdgeSlots extends Record<`edge-${string}`, (edgeProps: EdgeProps) => any> {}
export interface FlowSlots extends NodeSlots, EdgeSlots {
'connection-line': (connectionLineProps: ConnectionLineProps) => any
'zoom-pane': () => any
'default': () => any
}

89
node_modules/@vue-flow/core/dist/src/types/handle.d.ts generated vendored Normal file
View File

@@ -0,0 +1,89 @@
import type { Dimensions, Position, XYPosition } from './flow'
import type { Connection, ConnectionMode } from './connection'
import type { GraphEdge } from './edge'
import type { GraphNode } from './node'
import type { NodeLookup } from './store'
export type HandleType = 'source' | 'target'
export interface HandleElement extends XYPosition, Dimensions {
id?: string | null
position: Position
type: HandleType
nodeId: string
}
export interface ConnectionHandle extends XYPosition {
id: string | null
type: HandleType | null
nodeId: string
}
export interface ConnectingHandle extends XYPosition {
nodeId: string
type: HandleType
id?: string | null
position: Position
}
/** A valid connection function can determine if an attempted connection is valid or not, i.e. abort creating a new edge */
export type ValidConnectionFunc = (
connection: Connection,
elements: {
edges: GraphEdge[]
nodes: GraphNode[]
sourceNode: GraphNode
targetNode: GraphNode
},
) => boolean
export type HandleConnectableFunc = (node: GraphNode, connectedEdges: GraphEdge[]) => boolean
/**
* set to true to allow unlimited connections,
* single for only one connection
* or use a cb function to determine connect-ability
*
* if set to single and the handle already has more than one connection, it will act the same as setting it to false
*/
export type HandleConnectable = boolean | number | 'single' | HandleConnectableFunc
export interface HandleProps {
/** Unique id of handle element */
id?: string
/** Handle type (source / target) {@link HandleType} */
type?: HandleType
/** Handle position (top, bottom, left, right) {@link Position} */
position?: Position
/** A valid connection func {@link ValidConnectionFunc} */
isValidConnection?: ValidConnectionFunc
/** Enable/disable connecting to handle altogether */
connectable?: HandleConnectable
/** Can this handle be used to *start* a connection */
connectableStart?: boolean
/** Can this handle be used to *end* a connection */
connectableEnd?: boolean
}
export interface IsValidParams {
handle: ConnectingHandle | null
connectionMode: ConnectionMode
fromNodeId: string
fromHandleId: string | null
fromType: HandleType
isValidConnection?: ValidConnectionFunc
doc: Document | ShadowRoot
lib: string
flowId: string | null
nodeLookup: NodeLookup
}
export interface Result {
handleDomNode: Element | null
isValid: boolean
connection: Connection | null
toHandle: ConnectingHandle | null
}
export interface ConnectionInProgress<NodeType extends GraphNode = GraphNode> {
inProgress: true
isValid: boolean | null
from: XYPosition
fromHandle: HandleElement
fromPosition: Position
fromNode: NodeType
to: XYPosition
toHandle: ConnectingHandle | null
toPosition: Position
toNode: NodeType | null
}

189
node_modules/@vue-flow/core/dist/src/types/hooks.d.ts generated vendored Normal file
View File

@@ -0,0 +1,189 @@
import type { EventHookOn, EventHookTrigger } from '@vueuse/core'
import type { D3ZoomEvent } from 'd3-zoom'
import type { EventHookExtended, VueFlowError } from '../utils'
import type { GraphEdge } from './edge'
import type { GraphNode } from './node'
import type { Connection, OnConnectStartParams } from './connection'
import type { ViewportTransform } from './zoom'
import type { EdgeChange, NodeChange } from './changes'
import type { VueFlowStore } from './store'
export type MouseTouchEvent = MouseEvent | TouchEvent
export interface NodeMouseEvent {
event: MouseTouchEvent
node: GraphNode
}
export interface NodeDragEvent {
event: MouseTouchEvent
node: GraphNode
nodes: GraphNode[]
}
export interface EdgeMouseEvent {
event: MouseTouchEvent
edge: GraphEdge
}
export interface EdgeUpdateEvent {
event: MouseTouchEvent
edge: GraphEdge
connection: Connection
}
export interface FlowEvents {
nodesChange: NodeChange[]
edgesChange: EdgeChange[]
nodeDoubleClick: NodeMouseEvent
nodeClick: NodeMouseEvent
nodeMouseEnter: NodeMouseEvent
nodeMouseMove: NodeMouseEvent
nodeMouseLeave: NodeMouseEvent
nodeContextMenu: NodeMouseEvent
nodeDragStart: NodeDragEvent
nodeDrag: NodeDragEvent
nodeDragStop: NodeDragEvent
nodesInitialized: GraphNode[]
updateNodeInternals: string[]
miniMapNodeClick: NodeMouseEvent
miniMapNodeDoubleClick: NodeMouseEvent
miniMapNodeMouseEnter: NodeMouseEvent
miniMapNodeMouseMove: NodeMouseEvent
miniMapNodeMouseLeave: NodeMouseEvent
connect: Connection
connectStart: {
event?: MouseEvent | TouchEvent
} & OnConnectStartParams
connectEnd: MouseEvent | TouchEvent | undefined
clickConnectStart: {
event?: MouseEvent | TouchEvent
} & OnConnectStartParams
clickConnectEnd: MouseEvent | TouchEvent | undefined
/** @deprecated use `init` instead */
paneReady: VueFlowStore
init: VueFlowStore
move: {
event: D3ZoomEvent<HTMLDivElement, any> | WheelEvent
flowTransform: ViewportTransform
}
moveStart: {
event: D3ZoomEvent<HTMLDivElement, any> | WheelEvent
flowTransform: ViewportTransform
}
moveEnd: {
event: D3ZoomEvent<HTMLDivElement, any> | WheelEvent
flowTransform: ViewportTransform
}
selectionDragStart: NodeDragEvent
selectionDrag: NodeDragEvent
selectionDragStop: NodeDragEvent
selectionContextMenu: {
event: MouseEvent
nodes: GraphNode[]
}
selectionStart: MouseEvent
selectionEnd: MouseEvent
viewportChangeStart: ViewportTransform
viewportChange: ViewportTransform
viewportChangeEnd: ViewportTransform
paneScroll: WheelEvent | undefined
paneClick: MouseEvent
paneContextMenu: MouseEvent
paneMouseEnter: PointerEvent
paneMouseMove: PointerEvent
paneMouseLeave: PointerEvent
edgeContextMenu: EdgeMouseEvent
edgeMouseEnter: EdgeMouseEvent
edgeMouseMove: EdgeMouseEvent
edgeMouseLeave: EdgeMouseEvent
edgeDoubleClick: EdgeMouseEvent
edgeClick: EdgeMouseEvent
edgeUpdateStart: EdgeMouseEvent
edgeUpdate: EdgeUpdateEvent
edgeUpdateEnd: EdgeMouseEvent
error: VueFlowError
}
export type FlowHooks = Readonly<{
[key in keyof FlowEvents]: EventHookExtended<FlowEvents[key]>
}>
export type FlowHooksOn = Readonly<{
[key in keyof FlowEvents as `on${Capitalize<key>}`]: EventHookOn<FlowEvents[key]>
}>
export type FlowHooksEmit = Readonly<{
[key in keyof FlowEvents]: EventHookTrigger<FlowEvents[key]>
}>
/**
* To type `Args` (the event callback arguments) pass an array as argument list as first generic type
* To type `Return` (the event callback return value) pass a value to the second generic type
*/
export type CustomEvent<Args extends any[] = any[], Return = any> = (...args: Args) => Return
type CustomEventHandlers<CustomEvents = object> = {
[key in keyof CustomEvents]: CustomEvents[key]
}
export type NodeEventsHandler<CustomEvents = object> = {
doubleClick: (event: NodeMouseEvent) => void | {
off: () => void
}
click: (event: NodeMouseEvent) => void | {
off: () => void
}
mouseEnter: (event: NodeMouseEvent) => void | {
off: () => void
}
mouseMove: (event: NodeMouseEvent) => void | {
off: () => void
}
mouseLeave: (event: NodeMouseEvent) => void | {
off: () => void
}
contextMenu: (event: NodeMouseEvent) => void | {
off: () => void
}
dragStart: (event: NodeDragEvent) => void | {
off: () => void
}
drag: (event: NodeDragEvent) => void | {
off: () => void
}
dragStop: (event: NodeDragEvent) => void | {
off: () => void
}
} & CustomEventHandlers<CustomEvents>
export type NodeEventsOn<CustomEvents = object> = {
[key in keyof NodeEventsHandler]: EventHookOn<NodeEventsHandler[key] extends (event: infer Event) => any ? Event : never>
} & CustomEventHandlers<CustomEvents>
export type NodeEventsEmit<CustomEvents = object> = {
[key in keyof NodeEventsHandler]: EventHookTrigger<NodeEventsHandler[key] extends (event: infer Event) => any ? Event : never>
} & CustomEventHandlers<CustomEvents>
export type EdgeEventsHandler<CustomEvents = object> = {
doubleClick: (event: EdgeMouseEvent) => void | {
off: () => void
}
click: (event: EdgeMouseEvent) => void | {
off: () => void
}
mouseEnter: (event: EdgeMouseEvent) => void | {
off: () => void
}
mouseMove: (event: EdgeMouseEvent) => void | {
off: () => void
}
mouseLeave: (event: EdgeMouseEvent) => void | {
off: () => void
}
contextMenu: (event: EdgeMouseEvent) => void | {
off: () => void
}
updateStart: (event: EdgeMouseEvent) => void | {
off: () => void
}
update: (event: EdgeUpdateEvent) => void | {
off: () => void
}
updateEnd: (event: EdgeMouseEvent) => void | {
off: () => void
}
} & CustomEventHandlers<CustomEvents>
export type EdgeEventsOn<CustomEvents = object> = {
[key in keyof EdgeEventsHandler]: EventHookOn<EdgeEventsHandler[key] extends (event: infer Event) => any ? Event : never>
} & CustomEventHandlers<CustomEvents>
export type EdgeEventsEmit<CustomEvents = object> = {
[key in keyof EdgeEventsHandler]: EventHookTrigger<EdgeEventsHandler[key] extends (event: infer Event) => any ? Event : never>
} & CustomEventHandlers<CustomEvents>
export {}

11
node_modules/@vue-flow/core/dist/src/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
export * from './flow'
export * from './connection'
export * from './edge'
export * from './components'
export * from './node'
export * from './zoom'
export * from './store'
export * from './hooks'
export * from './changes'
export * from './handle'
export * from './panel'

197
node_modules/@vue-flow/core/dist/src/types/node.d.ts generated vendored Normal file
View File

@@ -0,0 +1,197 @@
import type { Component, VNode } from 'vue'
import type { ClassFunc, Dimensions, ElementData, Position, StyleFunc, Styles, XYPosition, XYZPosition } from './flow'
import type { NodeComponent } from './components'
import type { HandleConnectable, HandleElement, ValidConnectionFunc } from './handle'
import type { CustomEvent, NodeEventsHandler, NodeEventsOn } from './hooks'
/** Defined as [[x-from, y-from], [x-to, y-to]] */
export type CoordinateExtent = [extentFrom: [fromX: number, fromY: number], extentTo: [toX: number, toY: number]]
export interface CoordinateExtentRange {
range: 'parent' | CoordinateExtent
/** Values are top, right, bottom, left, you can use these the same as CSS padding */
padding:
| number
| [padding: number]
| [paddingY: number, paddingX: number]
| [paddingTop: number, paddingX: number, paddingBottom: number]
| [paddingTop: number, paddingRight: number, paddingBottom: number, paddingLeft: number]
}
export interface NodeHandleBounds {
source: HandleElement[] | null
target: HandleElement[] | null
}
/** @deprecated will be removed in next major release */
export type WidthFunc = (node: GraphNode) => number | string | void
/** @deprecated will be removed in next major release */
export type HeightFunc = (node: GraphNode) => number | string | void
export interface Node<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any, Type extends string = string> {
/** Unique node id */
id: string
/**
* @deprecated - will be removed in next major release and replaced with `{ data: { label: string | VNode | Component } }`
* A node label
*/
label?: string | VNode | Component
/** initial node position x, y */
position: XYPosition
/** node type, can be a default type or a custom type */
type?: Type
/** handle position */
targetPosition?: Position
/** handle position */
sourcePosition?: Position
/** Disable/enable dragging node */
draggable?: boolean
/** Disable/enable selecting node */
selectable?: boolean
/** Disable/enable connecting node */
connectable?: HandleConnectable
/** Disable/enable focusing node (a11y) */
focusable?: boolean
/** Disable/enable deleting node */
deletable?: boolean
/** element selector as drag handle for node (can only be dragged from the dragHandle el) */
dragHandle?: string
/**
* @deprecated will be removed in next major release
* called when used as target for new connection
*/
isValidTargetPos?: ValidConnectionFunc
/**
* @deprecated will be removed in next major release
* called when used as source for new connection
*/
isValidSourcePos?: ValidConnectionFunc
/** define node extent, i.e. area in which node can be moved */
extent?: CoordinateExtent | CoordinateExtentRange | 'parent'
/** expands parent area to fit child node */
expandParent?: boolean
/**
* todo: rename to `parentId` in next major release
* define node as a child node by setting a parent node id
*/
parentNode?: string
/**
* Fixed width of node, applied as style
* You can pass a number which will be used in pixel values (width: 300 -> width: 300px)
* or pass a string with units (width: `10rem` -> width: 10rem)
*/
width?: number | string | WidthFunc
/**
* Fixed height of node, applied as style
* You can pass a number which will be used in pixel values (height: 300 -> height: 300px)
* or pass a string with units (height: `10rem` -> height: 10rem)
*/
height?: number | string | HeightFunc
/** Additional class names, can be a string or a callback returning a string (receives current flow element) */
class?: string | string[] | Record<string, any> | ClassFunc<GraphNode<Data, CustomEvents>>
/** Additional styles, can be an object or a callback returning an object (receives current flow element) */
style?: Styles | StyleFunc<GraphNode<Data, CustomEvents>>
/** Is node hidden */
hidden?: boolean
/**
* @deprecated - will be removed in the next major release
* overwrites current node type
*/
template?: NodeComponent
/** Additional data that is passed to your custom components */
data?: Data
/**
* @deprecated - will be removed in the next major release
* contextual and custom events that are passed to your custom components
*/
events?: Partial<NodeEventsHandler<CustomEvents>>
zIndex?: number
ariaLabel?: string
}
export interface GraphNode<
Data = ElementData,
CustomEvents extends Record<string, CustomEvent> = any,
Type extends string = string,
> extends Node<Data, CustomEvents, Type> {
/** absolute position in relation to parent elements + z-index */
computedPosition: XYZPosition
handleBounds: NodeHandleBounds
/** node width, height */
dimensions: Dimensions
isParent: boolean
selected: boolean
resizing: boolean
dragging: boolean
data: Data
/** @deprecated will be removed in the next major version */
events: Partial<NodeEventsHandler<CustomEvents>>
type: Type
}
/** these props are passed to node components */
export interface NodeProps<Data = ElementData, CustomEvents = object, Type extends string = string> {
/** unique node id */
id: string
/** node type */
type: Type
/** is node selected */
selected: boolean
/** can node handles be connected, you need to forward this to your handles for this prop to have any effect */
connectable: HandleConnectable
/**
* @deprecated - will be removed in next major release and replaced with `computedPosition`
* node x, y (relative) position on graph
*/
position: XYPosition
/** dom element dimensions (width, height) */
dimensions: Dimensions
/**
* @deprecated - will be removed in next major release and replaced with `{ data: { label: string | VNode | Component } }`
* node label, either pass a string or a VNode
* For example like this: `h('div', props, children)`)
* Object is just a type-hack for Vue, ignore that
*/
label?: string | VNode | Component | object
/**
* @deprecated will be removed in next major release
* called when used as target for new connection
*/
isValidTargetPos?: ValidConnectionFunc
/**
* @deprecated will be removed in next major release
* called when used as source for new connection
*/
isValidSourcePos?: ValidConnectionFunc
/**
* @deprecated - will be removed in next major release. Use `parentNodeId` instead
* parent node id
*/
parent?: string
/**
* todo: rename to `parentId` in next major release
* parent node id
*/
parentNodeId?: string
/** is node currently dragging */
dragging: boolean
/** is node currently resizing */
resizing: boolean
/** node z-index */
zIndex: number
/** handle position */
targetPosition?: Position
/** handle position */
sourcePosition?: Position
/** drag handle query selector */
dragHandle?: string
/** additional data of node */
data: Data
/**
* @deprecated - will be removed in next major release
* contextual and custom events of node
*/
events: NodeEventsOn<CustomEvents>
}
/**
* Transform a Node type to a GraphNode type
*/
export type ToGraphNode<T extends Node> = GraphNode<
T extends Node<infer Data> ? Data : never,
T extends Node<any, infer Events> ? Events : never,
T extends Node<any, any, infer Type> ? Type : never
>

15
node_modules/@vue-flow/core/dist/src/types/panel.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
/**
* @deprecated; todo: remove this and use `PanelPositionType` instead
*/
export declare enum PanelPosition {
TopLeft = 'top-left',
TopCenter = 'top-center',
TopRight = 'top-right',
BottomLeft = 'bottom-left',
BottomCenter = 'bottom-center',
BottomRight = 'bottom-right',
}
export type PanelPositionType = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
export interface PanelProps {
position: PanelPosition | PanelPositionType
}

361
node_modules/@vue-flow/core/dist/src/types/store.d.ts generated vendored Normal file
View File

@@ -0,0 +1,361 @@
import type { CSSProperties, ComputedRef, ToRefs } from 'vue'
import type { KeyFilter } from '@vueuse/core'
import type { ViewportHelper } from '../composables'
import type {
Dimensions,
ElementData,
Elements,
FlowElements,
FlowExportObject,
FlowOptions,
FlowProps,
Rect,
SelectionMode,
SelectionRect,
SnapGrid,
XYPosition,
} from './flow'
import type { DefaultEdgeTypes, DefaultNodeTypes, EdgeComponent, NodeComponent } from './components'
import type {
Connection,
ConnectionLineOptions,
ConnectionLineType,
ConnectionLookup,
ConnectionMode,
ConnectionStatus,
Connector,
HandleConnection,
} from './connection'
import type { DefaultEdgeOptions, Edge, EdgeUpdatable, GraphEdge } from './edge'
import type { CoordinateExtent, CoordinateExtentRange, GraphNode, Node } from './node'
import type { D3Selection, D3Zoom, D3ZoomHandler, PanOnScrollMode, ViewportTransform } from './zoom'
import type { CustomEvent, FlowHooks, FlowHooksEmit, FlowHooksOn } from './hooks'
import type { EdgeChange, NodeChange, NodeDragItem } from './changes'
import type { ConnectingHandle, HandleType, ValidConnectionFunc } from './handle'
export type NodeLookup = Map<string, GraphNode>
export type EdgeLookup = Map<string, GraphEdge>
export interface UpdateNodeDimensionsParams {
id: string
nodeElement: HTMLDivElement
forceUpdate?: boolean
}
export interface State extends Omit<FlowProps, 'id' | 'modelValue'> {
/** Vue flow element ref */
vueFlowRef: HTMLDivElement | null
/** Vue flow viewport element */
viewportRef: HTMLDivElement | null
/** Event hooks, you can manipulate the triggers at your own peril */
readonly hooks: FlowHooks
/** all stored nodes */
nodes: GraphNode[]
/** all stored edges */
edges: GraphEdge[]
connectionLookup: ConnectionLookup
readonly d3Zoom: D3Zoom | null
readonly d3Selection: D3Selection | null
readonly d3ZoomHandler: D3ZoomHandler | null
/** use setMinZoom action to change minZoom */
minZoom: number
/** use setMaxZoom action to change maxZoom */
maxZoom: number
defaultViewport: Partial<ViewportTransform>
/** use setTranslateExtent action to change translateExtent */
translateExtent: CoordinateExtent
nodeExtent: CoordinateExtent | CoordinateExtentRange
/** viewport dimensions - do not change! */
readonly dimensions: Dimensions
/** viewport transform x, y, z - do not change! */
readonly viewport: ViewportTransform
/** if true will skip rendering any elements currently not inside viewport until they become visible */
onlyRenderVisibleElements: boolean
nodesSelectionActive: boolean
userSelectionActive: boolean
multiSelectionActive: boolean
deleteKeyCode: KeyFilter | null
selectionKeyCode: KeyFilter | boolean | null
multiSelectionKeyCode: KeyFilter | null
zoomActivationKeyCode: KeyFilter | null
panActivationKeyCode: KeyFilter | null
connectionMode: ConnectionMode
connectionLineOptions: ConnectionLineOptions
/** @deprecated use {@link ConnectionLineOptions.type} */
connectionLineType: ConnectionLineType | null
/** @deprecated use {@link ConnectionLineOptions.style} */
connectionLineStyle: CSSProperties | null
connectionStartHandle: ConnectingHandle | null
connectionEndHandle: ConnectingHandle | null
connectionClickStartHandle: ConnectingHandle | null
connectionPosition: XYPosition
connectionRadius: number
connectionStatus: ConnectionStatus | null
isValidConnection: ValidConnectionFunc | null
connectOnClick: boolean
edgeUpdaterRadius: number
snapToGrid: boolean
snapGrid: SnapGrid
defaultMarkerColor: string
edgesUpdatable: EdgeUpdatable
edgesFocusable: boolean
nodesFocusable: boolean
nodesDraggable: boolean
nodesConnectable: boolean
nodeDragThreshold: number
elementsSelectable: boolean
selectNodesOnDrag: boolean
userSelectionRect: SelectionRect | null
selectionMode: SelectionMode
panOnDrag: boolean | number[]
zoomOnScroll: boolean
zoomOnPinch: boolean
panOnScroll: boolean
panOnScrollSpeed: number
panOnScrollMode: PanOnScrollMode
paneClickDistance: number
zoomOnDoubleClick: boolean
preventScrolling: boolean
paneDragging: boolean
initialized: boolean
applyDefault: boolean
autoConnect: boolean | Connector
fitViewOnInit: boolean
fitViewOnInitDone: boolean
noDragClassName: 'nodrag' | string
noWheelClassName: 'nowheel' | string
noPanClassName: 'nopan' | string
defaultEdgeOptions: DefaultEdgeOptions | undefined
elevateEdgesOnSelect: boolean
elevateNodesOnSelect: boolean
autoPanOnConnect: boolean
autoPanOnNodeDrag: boolean
/**
* The speed at which the viewport pans while dragging a node or a selection box.
* @default 15
*/
autoPanSpeed: number
disableKeyboardA11y: boolean
ariaLiveMessage: string
}
export type SetElements = (elements: Elements | ((elements: FlowElements) => Elements)) => void
export type SetNodes = (nodes: Node[] | ((nodes: GraphNode[]) => Node[])) => void
export type SetEdges = (edges: Edge[] | ((edges: GraphEdge[]) => Edge[])) => void
export type AddNodes = (nodes: Node | Node[] | ((nodes: GraphNode[]) => Node | Node[])) => void
export type RemoveNodes = (
nodes: (string | Node) | (Node | string)[] | ((nodes: GraphNode[]) => (string | Node) | (Node | string)[]),
removeConnectedEdges?: boolean,
removeChildren?: boolean,
) => void
export type RemoveEdges = (
edges: (string | Edge) | (Edge | string)[] | ((edges: GraphEdge[]) => (string | Edge) | (Edge | string)[]),
) => void
export type AddEdges = (
edgesOrConnections:
| (Edge | Connection)
| (Edge | Connection)[]
| ((edges: GraphEdge[]) => (Edge | Connection) | (Edge | Connection)[]),
) => void
export type UpdateEdge = (oldEdge: GraphEdge, newConnection: Connection, shouldReplaceId?: boolean) => GraphEdge | false
export type UpdateEdgeData = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(
id: string,
dataUpdate: Partial<Data> | ((edge: GraphEdge<Data, CustomEvents>) => Partial<Data>),
options?: {
replace: boolean
},
) => void
export type SetState = (
state:
| Partial<FlowOptions & Omit<State, 'nodes' | 'edges' | 'modelValue'>>
| ((state: State) => Partial<FlowOptions & Omit<State, 'nodes' | 'edges' | 'modelValue'>>),
) => void
export type UpdateNodePosition = (dragItems: NodeDragItem[], changed: boolean, dragging: boolean) => void
export type UpdateNodeDimensions = (updates: UpdateNodeDimensionsParams[]) => void
export type UpdateNodeInternals = (nodeIds?: string[]) => void
export type FindNode = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(
id: string | undefined | null,
) => GraphNode<Data, CustomEvents> | undefined
export type FindEdge = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(
id: string | undefined | null,
) => GraphEdge<Data, CustomEvents> | undefined
export type GetIntersectingNodes = (
node:
| (Partial<Node> & {
id: Node['id']
})
| Rect,
partially?: boolean,
nodes?: GraphNode[],
) => GraphNode[]
export type UpdateNode = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(
id: string,
nodeUpdate: Partial<Node<Data, CustomEvents>> | ((node: GraphNode<Data, CustomEvents>) => Partial<Node<Data, CustomEvents>>),
options?: {
replace: boolean
},
) => void
export type UpdateNodeData = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>(
id: string,
dataUpdate: Partial<Data> | ((node: GraphNode<Data, CustomEvents>) => Partial<Data>),
options?: {
replace: boolean
},
) => void
export type IsNodeIntersecting = (
node:
| (Partial<Node> & {
id: Node['id']
})
| Rect,
area: Rect,
partially?: boolean,
) => boolean
export interface Actions extends Omit<ViewportHelper, 'viewportInitialized'> {
/** parses elements (nodes + edges) and re-sets the state */
setElements: SetElements
/** parses nodes and re-sets the state */
setNodes: SetNodes
/** parses edges and re-sets the state */
setEdges: SetEdges
/** parses nodes and adds to state */
addNodes: AddNodes
/** parses edges and adds to state */
addEdges: AddEdges
/** remove nodes (and possibly connected edges and children) from state */
removeNodes: RemoveNodes
/** remove edges from state */
removeEdges: RemoveEdges
/** find a node by id */
findNode: FindNode
/** find an edge by id */
findEdge: FindEdge
/** updates an edge */
updateEdge: UpdateEdge
/** updates the data of an edge */
updateEdgeData: UpdateEdgeData
/** updates a node */
updateNode: UpdateNode
/** updates the data of a node */
updateNodeData: UpdateNodeData
/** applies default edge change handler */
applyEdgeChanges: (changes: EdgeChange[]) => GraphEdge[]
/** applies default node change handler */
applyNodeChanges: (changes: NodeChange[]) => GraphNode[]
/**
* manually select elements and add to state
* @deprecated will be removed in the next major, use {@link Actions.addSelectedNodes} or {@link Actions.addSelectedEdges} instead
*/
addSelectedElements: (elements: FlowElements) => void
/** manually select edges and add to state */
addSelectedEdges: (edges: GraphEdge[]) => void
/** manually select nodes and add to state */
addSelectedNodes: (nodes: GraphNode[]) => void
/** manually unselect edges and remove from state */
removeSelectedEdges: (edges: GraphEdge[]) => void
/** manually unselect nodes and remove from state */
removeSelectedNodes: (nodes: GraphNode[]) => void
/** unselect selected elements (if none are passed, all elements are unselected) */
removeSelectedElements: (elements?: Elements) => void
/** apply min zoom value to d3 */
setMinZoom: (zoom: number) => void
/** apply max zoom value to d3 */
setMaxZoom: (zoom: number) => void
/** apply translate extent to d3 */
setTranslateExtent: (translateExtent: CoordinateExtent) => void
/** apply extent to nodes */
setNodeExtent: (nodeExtent: CoordinateExtent | CoordinateExtentRange) => void
setPaneClickDistance: (distance: number) => void
/** enable/disable node interaction (dragging, selecting etc) */
setInteractive: (isInteractive: boolean) => void
/** set new state */
setState: SetState
/** return an object of graph values (elements, viewport transform) for storage and re-loading a graph */
toObject: () => FlowExportObject
/** load graph from export obj */
fromObject: (obj: FlowExportObject) => Promise<boolean>
/** force update node internal data, if handle bounds are incorrect, you might want to use this */
updateNodeInternals: UpdateNodeInternals
/** start a connection */
startConnection: (startHandle: ConnectingHandle, position?: XYPosition, isClick?: boolean) => void
/** update connection position */
updateConnection: (position: XYPosition, result?: ConnectingHandle | null, status?: ConnectionStatus | null) => void
/** end (or cancel) a connection */
endConnection: (event?: MouseEvent | TouchEvent, isClick?: boolean) => void
/** internal position updater, you probably don't want to use this */
updateNodePositions: UpdateNodePosition
/** internal dimensions' updater, you probably don't want to use this */
updateNodeDimensions: UpdateNodeDimensions
/** returns all node intersections */
getIntersectingNodes: GetIntersectingNodes
/** check if a node is intersecting with a defined area */
isNodeIntersecting: IsNodeIntersecting
/** get a node's incomers */
getIncomers: (nodeOrId: Node | string) => GraphNode[]
/** get a node's outgoers */
getOutgoers: (nodeOrId: Node | string) => GraphNode[]
/** get a node's connected edges */
getConnectedEdges: (nodesOrId: Node[] | string) => GraphEdge[]
/** get all connections of a handle belonging to a node */
getHandleConnections: ({ id, type, nodeId }: { id?: string | null; type: HandleType; nodeId: string }) => HandleConnection[]
/** pan the viewport; return indicates if a transform has happened or not */
panBy: (delta: XYPosition) => boolean
/** viewport helper instance */
viewportHelper: ComputedRef<ViewportHelper>
/** reset state to defaults */
$reset: () => void
/** remove store instance from global storage and destroy it (will invalidate effect scopes) */
$destroy: () => void
}
export interface Getters {
/** returns object containing current edge types */
getEdgeTypes: Record<keyof DefaultEdgeTypes | string, EdgeComponent>
/** returns object containing current node types */
getNodeTypes: Record<keyof DefaultNodeTypes | string, NodeComponent>
/**
* get all elements
* @deprecated - will be removed in next major version
*/
getElements: FlowElements
/** all visible node */
getNodes: GraphNode[]
/** all visible edges */
getEdges: GraphEdge[]
/**
* returns a node by id
* @deprecated use {@link Actions.findNode} instead
*/
getNode: (id: string) => GraphNode | undefined
/**
* returns an edge by id
* @deprecated use {@link Actions.findEdge} instead
*/
getEdge: (id: string) => GraphEdge | undefined
/** returns all currently selected elements */
getSelectedElements: FlowElements
/** returns all currently selected nodes */
getSelectedNodes: GraphNode[]
/** returns all currently selected edges */
getSelectedEdges: GraphEdge[]
/**
* returns all nodes that are initialized, i.e. they have actual dimensions
* @deprecated - will be removed in next major version; use {@link useNodesInitialized} instead
*/
getNodesInitialized: GraphNode[]
/**
* returns a boolean flag whether all current nodes are initialized
* @deprecated - will be removed in next major version; use {@link useNodesInitialized} instead
*/
areNodesInitialized: boolean
}
export type ComputedGetters = {
[key in keyof Getters]: ComputedRef<Getters[key]>
}
export type VueFlowStore = {
readonly id: string
readonly emits: FlowHooksEmit
readonly nodeLookup: ComputedRef<NodeLookup>
readonly edgeLookup: ComputedRef<EdgeLookup>
/** current vue flow version you're using */
readonly vueFlowVersion: string
} & FlowHooksOn &
ToRefs<State> &
Readonly<ComputedGetters> &
Readonly<Actions>

69
node_modules/@vue-flow/core/dist/src/types/zoom.d.ts generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import type { Selection } from 'd3-selection'
import type { ZoomBehavior } from 'd3-zoom'
import type { Rect, XYPosition } from './flow'
export type D3Zoom = ZoomBehavior<HTMLDivElement, unknown>
export type D3Selection = Selection<HTMLDivElement, unknown, null, undefined>
export type D3ZoomHandler = (this: HTMLDivElement, event: any, d: unknown) => void
export declare enum PanOnScrollMode {
Free = 'free',
Vertical = 'vertical',
Horizontal = 'horizontal',
}
export interface TransitionOptions {
duration?: number
ease?: (t: number) => number
}
export type FitViewParams = {
padding?: number
includeHiddenNodes?: boolean
minZoom?: number
maxZoom?: number
offset?: {
x?: number
y?: number
}
nodes?: string[]
} & TransitionOptions
export interface ViewportTransform {
x: number
y: number
zoom: number
}
export type SetCenterOptions = TransitionOptions & {
zoom?: number
}
export type FitBoundsOptions = TransitionOptions & {
padding?: number
}
/** Fit the viewport around visible nodes */
export type FitView = (fitViewOptions?: FitViewParams) => Promise<boolean>
/** project a position onto the viewport, i.e. a mouse event clientX/clientY onto graph coordinates */
export type Project = (position: XYPosition) => XYPosition
/** set center of viewport */
export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => Promise<boolean>
/** fit the viewport around bounds */
export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => Promise<boolean>
/** zoom in/out */
export type ZoomInOut = (options?: TransitionOptions) => Promise<boolean>
/** zoom to a specific level */
export type ZoomTo = (zoomLevel: number, options?: TransitionOptions) => Promise<boolean>
/** get current viewport transform */
export type GetViewport = () => ViewportTransform
/** set current viewport transform */
export type SetViewport = (transform: ViewportTransform, options?: TransitionOptions) => Promise<boolean>
export interface ViewportFunctions {
zoomIn: ZoomInOut
zoomOut: ZoomInOut
zoomTo: ZoomTo
setViewport: SetViewport
/** @deprecated use setViewport instead */
setTransform: SetViewport
getViewport: GetViewport
/** @deprecated use getViewport instead */
getTransform: GetViewport
fitView: FitView
setCenter: SetCenter
fitBounds: FitBounds
project: Project
}

7
node_modules/@vue-flow/core/dist/src/utils/a11y.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import type { XYPosition } from '../types'
export declare const ARIA_NODE_DESC_KEY = 'vue-flow__node-desc'
export declare const ARIA_EDGE_DESC_KEY = 'vue-flow__edge-desc'
export declare const ARIA_LIVE_MESSAGE = 'vue-flow__aria-live'
export declare const elementSelectionKeys: string[]
export declare const arrowKeyDiffs: Record<string, XYPosition>

View File

@@ -0,0 +1,8 @@
import type { Dimensions, XYPosition } from '../types'
export declare function calcAutoPan(
pos: XYPosition,
bounds: Dimensions,
speed?: number,
distance?: number,
): [xMovement: number, yMovement: number]

View File

@@ -0,0 +1,41 @@
import type {
EdgeAddChange,
EdgeChange,
EdgeRemoveChange,
EdgeSelectionChange,
ElementChange,
FlowElement,
GraphEdge,
GraphNode,
NodeAddChange,
NodeChange,
NodeRemoveChange,
NodeSelectionChange,
} from '../types'
export declare function applyChanges<
T extends FlowElement = FlowElement,
C extends ElementChange = T extends GraphNode ? NodeChange : EdgeChange,
>(changes: C[], elements: T[]): T[]
/** @deprecated Use store instance and call `applyChanges` with template-ref or the one received by `onPaneReady` instead */
export declare function applyEdgeChanges(changes: EdgeChange[], edges: GraphEdge[]): GraphEdge[]
/** @deprecated Use store instance and call `applyChanges` with template-ref or the one received by `onPaneReady` instead */
export declare function applyNodeChanges(changes: NodeChange[], nodes: GraphNode[]): GraphNode<any, any, string>[]
export declare function createSelectionChange(id: string, selected: boolean): NodeSelectionChange | EdgeSelectionChange
export declare function createAdditionChange<
T extends GraphNode | GraphEdge = GraphNode,
C extends NodeAddChange | EdgeAddChange = T extends GraphNode ? NodeAddChange : EdgeAddChange,
>(item: T): C
export declare function createNodeRemoveChange(id: string): NodeRemoveChange
export declare function createEdgeRemoveChange(
id: string,
source: string,
target: string,
sourceHandle?: string | null,
targetHandle?: string | null,
): EdgeRemoveChange
export declare function getSelectionChanges(
items: Map<string, any>,
selectedIds?: Set<string>,
mutateItem?: boolean,
): NodeSelectionChange[] | EdgeSelectionChange[]

View File

@@ -0,0 +1,12 @@
import type { EventHook } from '@vueuse/core'
/**
* Source code taken from https://github.com/vueuse/vueuse/blob/main/packages/shared/createEventHook/index.ts
*
* Modified to be able to check if there are any event listeners
*/
export interface EventHookExtended<T> extends EventHook<T> {
hasListeners: () => boolean
fns: Set<(param: T) => void>
}
export declare function createExtendedEventHook<T = any>(defaultHandler?: (param: T) => void): EventHookExtended<T>

View File

@@ -0,0 +1,4 @@
import type { DefaultEdgeTypes, DefaultNodeTypes } from '../types'
export declare const defaultNodeTypes: DefaultNodeTypes
export declare const defaultEdgeTypes: DefaultEdgeTypes

38
node_modules/@vue-flow/core/dist/src/utils/drag.d.ts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
import type { Actions, CoordinateExtent, GraphNode, NodeDragItem, State, XYPosition } from '../types'
export declare function hasSelector(target: Element, selector: string, node: Element): boolean
export declare function getDragItems(
nodes: GraphNode[],
nodesDraggable: boolean,
mousePos: XYPosition,
findNode: Actions['findNode'],
nodeId?: string,
): NodeDragItem[]
export declare function getEventHandlerParams({
id,
dragItems,
findNode,
}: {
id?: string
dragItems: NodeDragItem[]
findNode: Actions['findNode']
}): [GraphNode, GraphNode[]]
export declare function getExtent<T extends NodeDragItem | GraphNode>(
item: T,
triggerError: State['hooks']['error']['trigger'],
extent?: State['nodeExtent'],
parent?: GraphNode,
): CoordinateExtent
export declare function calcNextPosition(
node: GraphNode | NodeDragItem,
nextPosition: XYPosition,
triggerError: State['hooks']['error']['trigger'],
nodeExtent?: State['nodeExtent'],
parentNode?: GraphNode,
): {
position: {
x: number
y: number
}
computedPosition: XYPosition
}

34
node_modules/@vue-flow/core/dist/src/utils/edge.d.ts generated vendored Normal file
View File

@@ -0,0 +1,34 @@
import type { Actions, GraphEdge, GraphNode, HandleElement, ViewportTransform, XYPosition } from '../types'
import type { Position } from '../types'
export declare function getHandlePosition(
node: GraphNode,
handle: HandleElement | null,
fallbackPosition?: Position,
center?: boolean,
): XYPosition
export declare function getEdgeHandle(bounds: HandleElement[] | null, handleId?: string | null): HandleElement | null
interface IsEdgeVisibleParams {
sourcePos: XYPosition
targetPos: XYPosition
sourceWidth: number
sourceHeight: number
targetWidth: number
targetHeight: number
width: number
height: number
viewport: ViewportTransform
}
export declare function isEdgeVisible({
sourcePos,
targetPos,
sourceWidth,
sourceHeight,
targetWidth,
targetHeight,
width,
height,
viewport,
}: IsEdgeVisibleParams): boolean
export declare function getEdgeZIndex(edge: GraphEdge, findNode: Actions['findNode'], elevateEdgesOnSelect?: boolean): number
export {}

47
node_modules/@vue-flow/core/dist/src/utils/errors.d.ts generated vendored Normal file
View File

@@ -0,0 +1,47 @@
export declare enum ErrorCode {
MISSING_STYLES = 'MISSING_STYLES',
MISSING_VIEWPORT_DIMENSIONS = 'MISSING_VIEWPORT_DIMENSIONS',
NODE_INVALID = 'NODE_INVALID',
NODE_NOT_FOUND = 'NODE_NOT_FOUND',
NODE_MISSING_PARENT = 'NODE_MISSING_PARENT',
NODE_TYPE_MISSING = 'NODE_TYPE_MISSING',
NODE_EXTENT_INVALID = 'NODE_EXTENT_INVALID',
EDGE_INVALID = 'EDGE_INVALID',
EDGE_NOT_FOUND = 'EDGE_NOT_FOUND',
EDGE_SOURCE_MISSING = 'EDGE_SOURCE_MISSING',
EDGE_TARGET_MISSING = 'EDGE_TARGET_MISSING',
EDGE_TYPE_MISSING = 'EDGE_TYPE_MISSING',
EDGE_SOURCE_TARGET_SAME = 'EDGE_SOURCE_TARGET_SAME',
EDGE_SOURCE_TARGET_MISSING = 'EDGE_SOURCE_TARGET_MISSING',
EDGE_ORPHANED = 'EDGE_ORPHANED',
USEVUEFLOW_OPTIONS = 'USEVUEFLOW_OPTIONS',
}
declare const messages: {
readonly MISSING_STYLES: () => string
readonly MISSING_VIEWPORT_DIMENSIONS: () => string
readonly NODE_INVALID: (id?: string) => string
readonly NODE_NOT_FOUND: (id: string | null) => string
readonly NODE_MISSING_PARENT: (id: string, parentId: string) => string
readonly NODE_TYPE_MISSING: (type: string) => string
readonly NODE_EXTENT_INVALID: (id: string) => string
readonly EDGE_INVALID: (id: string) => string
readonly EDGE_SOURCE_MISSING: (id: string, source: string) => string
readonly EDGE_TARGET_MISSING: (id: string, target: string) => string
readonly EDGE_TYPE_MISSING: (type: string) => string
readonly EDGE_SOURCE_TARGET_SAME: (id: string, source: string, target: string) => string
readonly EDGE_SOURCE_TARGET_MISSING: (id: string, source: string, target: string) => string
readonly EDGE_ORPHANED: (id: string) => string
readonly EDGE_NOT_FOUND: (id: string) => string
readonly USEVUEFLOW_OPTIONS: () => string
}
type ErrorArgs<T extends ErrorCode> = (typeof messages)[T] extends (...args: any[]) => string
? Parameters<(typeof messages)[T]>
: never
export declare class VueFlowError<T extends ErrorCode = ErrorCode, Args extends ErrorArgs<T> = ErrorArgs<T>> extends Error {
name: string
code: T
args: Args
constructor(code: T, ...args: Args)
}
export declare function isErrorOfType<T extends ErrorCode>(error: VueFlowError, code: T): error is VueFlowError<T>
export {}

View File

@@ -0,0 +1,18 @@
import type { GraphNode, SnapGrid, XYPosition } from '../types'
import type { UseDragEvent } from '../composables'
export declare function isMouseEvent(event: MouseEvent | TouchEvent): event is MouseEvent
export declare function isUseDragEvent(event: any): event is UseDragEvent
export declare function getEventPosition(
event: MouseEvent | TouchEvent,
bounds?: DOMRect,
): {
x: number
y: number
}
export declare const isMacOs: () => boolean
export declare function getNodeDimensions(node: GraphNode): {
width: number
height: number
}
export declare function snapPosition(position: XYPosition, snapGrid?: SnapGrid): XYPosition

131
node_modules/@vue-flow/core/dist/src/utils/graph.d.ts generated vendored Normal file
View File

@@ -0,0 +1,131 @@
import type {
Actions,
Box,
Connection,
CoordinateExtent,
DefaultEdgeOptions,
Dimensions,
Edge,
EdgeMarkerType,
ElementData,
Elements,
FlowElements,
GraphEdge,
GraphNode,
MaybeElement,
Node,
Rect,
ViewportTransform,
XYPosition,
XYZPosition,
} from '../types'
export declare function nodeToRect(node: GraphNode): Rect
export declare function getOverlappingArea(rectA: Rect, rectB: Rect): number
export declare function getDimensions(node: HTMLElement): Dimensions
export declare function clamp(val: number, min?: number, max?: number): number
export declare function clampPosition(position: XYPosition, extent: CoordinateExtent): XYPosition
export declare function getHostForElement(element: HTMLElement): Document
export declare function isEdge<Data = ElementData>(element: MaybeElement): element is Edge<Data>
export declare function isGraphEdge<Data = ElementData>(element: MaybeElement): element is GraphEdge<Data>
export declare function isNode<Data = ElementData>(element: MaybeElement): element is Node<Data>
export declare function isGraphNode<Data = ElementData>(element: MaybeElement): element is GraphNode<Data>
export declare function isRect(obj: any): obj is Rect
export declare function parseNode(node: Node, existingNode?: GraphNode, parentNode?: string): GraphNode
export declare function parseEdge(edge: Edge, existingEdge?: GraphEdge, defaultEdgeOptions?: DefaultEdgeOptions): GraphEdge
export declare function getOutgoers<N extends Node>(
nodeOrId:
| Node
| {
id: string
}
| string,
nodes: N[],
edges: Edge[],
): N[]
export declare function getOutgoers<T extends Elements>(
nodeOrId:
| Node
| {
id: string
}
| string,
elements: T,
): T extends FlowElements ? GraphNode[] : Node[]
export declare function getIncomers<N extends Node>(
nodeOrId:
| Node
| {
id: string
}
| string,
nodes: N[],
edges: Edge[],
): N[]
export declare function getIncomers<T extends Elements>(
nodeOrId:
| Node
| {
id: string
}
| string,
elements: T,
): T extends FlowElements ? GraphNode[] : Node[]
export declare function getEdgeId({ source, sourceHandle, target, targetHandle }: Connection): string
export declare function connectionExists(edge: Edge | Connection, elements: Elements): boolean
/**
* @deprecated Use store instance and call `addEdges` with template-ref or the one received by `onPaneReady` instead
*
* Intended for options API
* In composition API you can access utilities from `useVueFlow`
*/
export declare function addEdge(edgeParams: Edge | Connection, elements: Elements, defaults?: DefaultEdgeOptions): Elements
/**
* @deprecated Use store instance and call `updateEdge` with template-ref or the one received by `onPaneReady` instead
*
* Intended for options API
* In composition API you can access utilities from `useVueFlow`
*/
export declare function updateEdge(oldEdge: Edge, newConnection: Connection, elements: Elements): Elements
export declare function rendererPointToPoint({ x, y }: XYPosition, { x: tx, y: ty, zoom: tScale }: ViewportTransform): XYPosition
export declare function pointToRendererPoint(
{ x, y }: XYPosition,
{ x: tx, y: ty, zoom: tScale }: ViewportTransform,
snapToGrid?: boolean,
snapGrid?: [snapX: number, snapY: number],
): XYPosition
export declare function rectToBox({ x, y, width, height }: Rect): Box
export declare function boxToRect({ x, y, x2, y2 }: Box): Rect
export declare function getBoundsofRects(rect1: Rect, rect2: Rect): Rect
export declare function getRectOfNodes(nodes: GraphNode[]): Rect
export declare function getNodesInside(
nodes: GraphNode[],
rect: Rect,
viewport?: ViewportTransform,
partially?: boolean,
excludeNonSelectableNodes?: boolean,
): GraphNode<any, any, string>[]
export declare function getConnectedEdges<E extends Edge>(nodesOrId: Node[] | string, edges: E[]): E[]
export declare function getConnectedNodes<
N extends
| Node
| {
id: string
}
| string,
>(nodes: N[], edges: Edge[]): N[]
export declare function getTransformForBounds(
bounds: Rect,
width: number,
height: number,
minZoom: number,
maxZoom: number,
padding?: number,
offset?: {
x?: number
y?: number
},
): ViewportTransform
export declare function getXYZPos(parentPos: XYZPosition, computedPosition: XYZPosition): XYZPosition
export declare function isParentSelected(node: GraphNode, findNode: Actions['findNode']): boolean
export declare function getMarkerId(marker: EdgeMarkerType | undefined, vueFlowId?: string): string

60
node_modules/@vue-flow/core/dist/src/utils/handle.d.ts generated vendored Normal file
View File

@@ -0,0 +1,60 @@
import type { ConnectionMode, Position } from '../types'
import type {
Actions,
ConnectionHandle,
ConnectionStatus,
GraphEdge,
GraphNode,
HandleElement,
HandleType,
IsValidParams,
NodeHandleBounds,
NodeLookup,
Result,
XYPosition,
} from '../types'
export declare function resetRecentHandle(handleDomNode: Element): void
export declare function getHandles(
node: GraphNode,
handleBounds: NodeHandleBounds,
type: HandleType,
currentHandle: string,
): ConnectionHandle[]
export declare function getClosestHandle(
position: XYPosition,
connectionRadius: number,
nodeLookup: NodeLookup,
fromHandle: {
nodeId: string
type: HandleType
id?: string | null
},
): HandleElement | null
export declare function isValidHandle(
event: MouseEvent | TouchEvent,
{ handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection }: IsValidParams,
edges: GraphEdge[],
nodes: GraphNode[],
findNode: Actions['findNode'],
): Result
export declare function getHandleType(edgeUpdaterType: HandleType | undefined, handleDomNode: Element | null): HandleType | null
export declare function getConnectionStatus(
isInsideConnectionRadius: boolean,
isHandleValid: boolean | null,
): ConnectionStatus | null
export declare function isConnectionValid(isInsideConnectionRadius: boolean, isHandleValid: boolean): boolean | null
export declare function getHandle(
nodeId: string,
handleType: HandleType,
handleId: string | null,
nodeLookup: NodeLookup,
connectionMode: ConnectionMode,
withAbsolutePosition?: boolean,
): HandleElement | null
export declare const oppositePosition: {
left: Position
right: Position
top: Position
bottom: Position
}

13
node_modules/@vue-flow/core/dist/src/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
export * from './a11y'
export * from './autopan'
export * from './changes'
export * from './createExtendedEventHook'
export * from './drag'
export * from './edge'
export * from './errors'
export * from './general'
export * from './graph'
export * from './handle'
export * from './log'
export * from './node'
export * from './store'

2
node_modules/@vue-flow/core/dist/src/utils/log.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export declare function warn(message: string, ...args: any[]): void
export declare function isDev(): boolean

19
node_modules/@vue-flow/core/dist/src/utils/node.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import type { Ref } from 'vue'
import type { Actions, GraphNode, HandleElement, HandleType } from '../types'
export declare function getHandleBounds(
type: HandleType,
nodeElement: HTMLDivElement,
nodeBounds: DOMRect,
zoom: number,
nodeId: string,
): HandleElement[] | null
export declare function handleNodeClick(
node: GraphNode,
multiSelectionActive: boolean,
addSelectedNodes: Actions['addSelectedNodes'],
removeSelectedNodes: Actions['removeSelectedNodes'],
nodesSelectionActive: Ref<boolean>,
unselect: boolean | undefined,
nodeEl: HTMLDivElement,
): void

View File

@@ -0,0 +1,18 @@
import type { FlowOptions, VueFlowStore } from '../types'
/**
* @deprecated will be removed in the next major and replaced with a ctx based solution similar to `<ReactFlowProvider>`
*
* Stores all existing VueFlow state instances
*/
export declare class Storage {
currentId: number
flows: Map<string, VueFlowStore>
static instance: Storage
static getInstance(): Storage
set(id: string, flow: VueFlowStore): Map<string, VueFlowStore>
get(id: string): VueFlowStore | undefined
remove(id: string): boolean
create(id: string, preloadedState?: FlowOptions): VueFlowStore
getId(): string
}

217
node_modules/@vue-flow/core/dist/src/utils/store.d.ts generated vendored Normal file
View File

@@ -0,0 +1,217 @@
import type {
Actions,
Connection,
ConnectionLookup,
DefaultEdgeOptions,
Edge,
EdgeLookup,
GraphEdge,
GraphNode,
Node,
NodeConnection,
State,
ValidConnectionFunc,
VueFlowStore,
} from '../types'
type NonUndefined<T> = T extends undefined ? never : T
export declare function isDef<T>(val: T): val is NonUndefined<T>
export declare function addEdgeToStore(
edgeParams: Edge | Connection,
edges: Edge[],
triggerError: State['hooks']['error']['trigger'],
defaultEdgeOptions?: DefaultEdgeOptions,
): GraphEdge | false
export declare function updateEdgeAction(
edge: GraphEdge,
newConnection: Connection,
prevEdge: GraphEdge | undefined,
shouldReplaceId: boolean,
triggerError: State['hooks']['error']['trigger'],
):
| false
| {
id: string
source: string
target: string
sourceHandle: string | null | undefined
targetHandle: string | null | undefined
label?:
| string
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
| import('vue').Component<import('../types').EdgeTextProps>
| undefined
type: string
animated?: boolean | undefined
markerStart?: import('../types').EdgeMarkerType | undefined
markerEnd?: import('../types').EdgeMarkerType | undefined
updatable?: import('../types').EdgeUpdatable | undefined
selectable?: boolean | undefined
focusable?: boolean | undefined
deletable?: boolean | undefined
class?: string | string[] | Record<string, any> | import('../types').ClassFunc<GraphEdge<any, any, string>> | undefined
style?: import('../types').Styles | import('../types').StyleFunc<GraphEdge<any, any, string>> | undefined
hidden?: boolean | undefined
interactionWidth?: number | undefined
template?: import('../types').EdgeComponent | undefined
data: any
events: Partial<import('../types').EdgeEventsHandler<any>>
zIndex?: number | undefined
ariaLabel?: string | null | undefined
labelStyle?: import('vue').CSSProperties | undefined
labelShowBg?: boolean | undefined
labelBgStyle?: import('vue').CSSProperties | undefined
labelBgPadding?: [number, number] | undefined
labelBgBorderRadius?: number | undefined
selected: boolean
sourceNode: GraphNode<any, any, string>
targetNode: GraphNode<any, any, string>
sourceX: number
sourceY: number
targetX: number
targetY: number
}
| {
id: string
source: string
target: string
sourceHandle: string | null | undefined
targetHandle: string | null | undefined
label?:
| string
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
| import('vue').Component<import('../types').EdgeTextProps>
| undefined
type: 'smoothstep'
animated?: boolean | undefined
markerStart?: import('../types').EdgeMarkerType | undefined
markerEnd?: import('../types').EdgeMarkerType | undefined
updatable?: import('../types').EdgeUpdatable | undefined
selectable?: boolean | undefined
focusable?: boolean | undefined
deletable?: boolean | undefined
class?: string | string[] | Record<string, any> | import('../types').ClassFunc<GraphEdge<any, any, string>> | undefined
style?: import('../types').Styles | import('../types').StyleFunc<GraphEdge<any, any, string>> | undefined
hidden?: boolean | undefined
interactionWidth?: number | undefined
template?: import('../types').EdgeComponent | undefined
data: any
events: Partial<import('../types').EdgeEventsHandler<any>>
zIndex?: number | undefined
ariaLabel?: string | null | undefined
labelStyle?: import('vue').CSSProperties | undefined
labelShowBg?: boolean | undefined
labelBgStyle?: import('vue').CSSProperties | undefined
labelBgPadding?: [number, number] | undefined
labelBgBorderRadius?: number | undefined
pathOptions?: import('../types').SmoothStepPathOptions | undefined
selected: boolean
sourceNode: GraphNode<any, any, string>
targetNode: GraphNode<any, any, string>
sourceX: number
sourceY: number
targetX: number
targetY: number
}
| {
id: string
source: string
target: string
sourceHandle: string | null | undefined
targetHandle: string | null | undefined
label?:
| string
| import('vue').VNode<
import('vue').RendererNode,
import('vue').RendererElement,
{
[key: string]: any
}
>
| import('vue').Component<import('../types').EdgeTextProps>
| undefined
type: 'default'
animated?: boolean | undefined
markerStart?: import('../types').EdgeMarkerType | undefined
markerEnd?: import('../types').EdgeMarkerType | undefined
updatable?: import('../types').EdgeUpdatable | undefined
selectable?: boolean | undefined
focusable?: boolean | undefined
deletable?: boolean | undefined
class?: string | string[] | Record<string, any> | import('../types').ClassFunc<GraphEdge<any, any, string>> | undefined
style?: import('../types').Styles | import('../types').StyleFunc<GraphEdge<any, any, string>> | undefined
hidden?: boolean | undefined
interactionWidth?: number | undefined
template?: import('../types').EdgeComponent | undefined
data: any
events: Partial<import('../types').EdgeEventsHandler<any>>
zIndex?: number | undefined
ariaLabel?: string | null | undefined
labelStyle?: import('vue').CSSProperties | undefined
labelShowBg?: boolean | undefined
labelBgStyle?: import('vue').CSSProperties | undefined
labelBgPadding?: [number, number] | undefined
labelBgBorderRadius?: number | undefined
pathOptions?: import('../types').BezierPathOptions | undefined
selected: boolean
sourceNode: GraphNode<any, any, string>
targetNode: GraphNode<any, any, string>
sourceX: number
sourceY: number
targetX: number
targetY: number
}
export declare function createGraphNodes(
nodes: Node[],
findNode: Actions['findNode'],
triggerError: State['hooks']['error']['trigger'],
): GraphNode<any, any, string>[]
export declare function updateConnectionLookup(
connectionLookup: ConnectionLookup,
edgeLookup: EdgeLookup,
edges: GraphEdge[],
): void
/**
* We call the callback for all connections in a that are not in b
*
* @internal
*/
export declare function handleConnectionChange(
a: Map<string, NodeConnection>,
b: Map<string, NodeConnection>,
cb?: (diff: NodeConnection[]) => void,
): void
/**
* @internal
*/
export declare function areConnectionMapsEqual(a?: Map<string, Connection>, b?: Map<string, Connection>): boolean
/**
* @internal
*/
export declare function areSetsEqual(a: Set<string>, b: Set<string>): boolean
/**
* @internal
*/
export declare function createGraphEdges(
nextEdges: (Edge | Connection)[],
isValidConnection: ValidConnectionFunc | null,
findNode: Actions['findNode'],
findEdge: Actions['findEdge'],
onError: VueFlowStore['emits']['error'],
defaultEdgeOptions: DefaultEdgeOptions | undefined,
nodes: GraphNode[],
edges: GraphEdge[],
): GraphEdge[]
export {}