@aloudata/ink-flow 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +1 -1
- package/dist/components/EdgeWrapper/EdgeUpdateAnchors.d.ts.map +1 -1
- package/dist/components/Edges/BezierEdge.d.ts.map +1 -1
- package/dist/components/Edges/EdgeAnchor.d.ts +1 -1
- package/dist/components/Edges/SimpleBezierEdge.d.ts +1 -1
- package/dist/components/Edges/SimpleBezierEdge.d.ts.map +1 -1
- package/dist/components/Handle/index.d.ts +5 -3
- package/dist/components/Handle/index.d.ts.map +1 -1
- package/dist/components/NodeWrapper/utils.d.ts +1 -1
- package/dist/components/Nodes/DefaultNode.d.ts.map +1 -1
- package/dist/components/Nodes/InputNode.d.ts +1 -2
- package/dist/components/Nodes/InputNode.d.ts.map +1 -1
- package/dist/components/Nodes/OutputNode.d.ts.map +1 -1
- package/dist/components/Nodes/utils.d.ts.map +1 -1
- package/dist/components/Panel/index.d.ts +1 -1
- package/dist/components/StoreUpdater/index.d.ts.map +1 -1
- package/dist/container/EdgeRenderer/MarkerSymbols.d.ts +1 -1
- package/dist/container/EdgeRenderer/MarkerSymbols.d.ts.map +1 -1
- package/dist/container/InkFlow/index.d.ts.map +1 -1
- package/dist/container/InkFlow/init-values.d.ts +1 -1
- package/dist/hooks/useGlobalKeyHandler.d.ts +1 -1
- package/dist/hooks/useGlobalKeyHandler.d.ts.map +1 -1
- package/dist/hooks/useInkFlow.d.ts.map +1 -1
- package/dist/hooks/useKeyPress.d.ts +1 -1
- package/dist/hooks/useKeyPress.d.ts.map +1 -1
- package/dist/hooks/useMoveSelectedNodes.d.ts +1 -1
- package/dist/hooks/useMoveSelectedNodes.d.ts.map +1 -1
- package/dist/hooks/useStore.d.ts.map +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/plugins/Controls/types.d.ts +1 -1
- package/dist/store/initialState.d.ts.map +1 -1
- package/dist/types/edges.d.ts +1 -1
- package/dist/types/edges.d.ts.map +1 -1
- package/dist/types/general.d.ts +1 -1
- package/dist/types/general.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/instance.d.ts +1 -1
- package/dist/types/instance.d.ts.map +1 -1
- package/dist/types/nodes.d.ts +1 -1
- package/dist/types/nodes.d.ts.map +1 -1
- package/dist/types/props.d.ts +1 -1
- package/dist/types/props.d.ts.map +1 -1
- package/dist/types/store.d.ts +1 -1
- package/dist/types/store.d.ts.map +1 -1
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/types/utils/types.d.ts.map +1 -1
- package/dist/utils/changes.d.ts +1 -1
- package/dist/utils/changes.d.ts.map +1 -1
- package/dist/utils/dom.d.ts +1 -1
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/edges/bezier-edge.d.ts +1 -1
- package/dist/utils/edges/general.d.ts +1 -1
- package/dist/utils/edges/general.d.ts.map +1 -1
- package/dist/utils/edges/positions.d.ts +1 -1
- package/dist/utils/edges/positions.d.ts.map +1 -1
- package/dist/utils/edges/smoothstep-edge.d.ts +1 -1
- package/dist/utils/general.d.ts +1 -1
- package/dist/utils/general.d.ts.map +1 -1
- package/dist/utils/graph.d.ts +1 -1
- package/dist/utils/graph.d.ts.map +1 -1
- package/dist/utils/marker.d.ts +1 -1
- package/dist/utils/marker.d.ts.map +1 -1
- package/dist/utils/positions.d.ts +1 -1
- package/dist/utils/positions.d.ts.map +1 -1
- package/dist/utils/store.d.ts +1 -1
- package/dist/utils/store.d.ts.map +1 -1
- package/package.json +2 -3
- package/dist/base.css +0 -6
- package/dist/constants/errorMessages.d.ts +0 -22
- package/dist/constants/errorMessages.d.ts.map +0 -1
- package/dist/constants/index.d.ts +0 -2
- package/dist/constants/index.d.ts.map +0 -1
- package/dist/types/system/changes.d.ts +0 -51
- package/dist/types/system/changes.d.ts.map +0 -1
- package/dist/types/system/edges.d.ts +0 -83
- package/dist/types/system/edges.d.ts.map +0 -1
- package/dist/types/system/general.d.ts +0 -119
- package/dist/types/system/general.d.ts.map +0 -1
- package/dist/types/system/handles.d.ts +0 -51
- package/dist/types/system/handles.d.ts.map +0 -1
- package/dist/types/system/index.d.ts +0 -8
- package/dist/types/system/index.d.ts.map +0 -1
- package/dist/types/system/nodes.d.ts +0 -126
- package/dist/types/system/nodes.d.ts.map +0 -1
- package/dist/types/system/panzoom.d.ts +0 -49
- package/dist/types/system/panzoom.d.ts.map +0 -1
- package/dist/types/system/utils.d.ts +0 -25
- package/dist/types/system/utils.d.ts.map +0 -1
- package/dist/utils/bezier-edge.d.ts +0 -59
- package/dist/utils/bezier-edge.d.ts.map +0 -1
- package/dist/utils/edges.d.ts +0 -26
- package/dist/utils/edges.d.ts.map +0 -1
- package/dist/utils/smoothstep-edge.d.ts +0 -43
- package/dist/utils/smoothstep-edge.d.ts.map +0 -1
- package/dist/utils/straight-edge.d.ts +0 -34
- package/dist/utils/straight-edge.d.ts.map +0 -1
- package/dist/utils/xydrag/XYDrag.d.ts +0 -52
- package/dist/utils/xydrag/XYDrag.d.ts.map +0 -1
- package/dist/utils/xydrag/index.d.ts +0 -2
- package/dist/utils/xydrag/index.d.ts.map +0 -1
- package/dist/utils/xydrag/utils.d.ts +0 -10
- package/dist/utils/xydrag/utils.d.ts.map +0 -1
- package/dist/utils/xyhandle/XYHandle.d.ts +0 -49
- package/dist/utils/xyhandle/XYHandle.d.ts.map +0 -1
- package/dist/utils/xyhandle/index.d.ts +0 -2
- package/dist/utils/xyhandle/index.d.ts.map +0 -1
- package/dist/utils/xyhandle/utils.d.ts +0 -14
- package/dist/utils/xyhandle/utils.d.ts.map +0 -1
- package/dist/utils/xypanzoom/XYPanZoom.d.ts +0 -12
- package/dist/utils/xypanzoom/XYPanZoom.d.ts.map +0 -1
- package/dist/utils/xypanzoom/eventhandler.d.ts +0 -46
- package/dist/utils/xypanzoom/eventhandler.d.ts.map +0 -1
- package/dist/utils/xypanzoom/filter.d.ts +0 -14
- package/dist/utils/xypanzoom/filter.d.ts.map +0 -1
- package/dist/utils/xypanzoom/index.d.ts +0 -2
- package/dist/utils/xypanzoom/index.d.ts.map +0 -1
- package/dist/utils/xypanzoom/utils.d.ts +0 -10
- package/dist/utils/xypanzoom/utils.d.ts.map +0 -1
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Position } from './utils';
|
|
2
|
-
export type EdgeBase<EdgeData extends Record<string, unknown> = Record<string, unknown>, EdgeType extends string | undefined = string | undefined> = {
|
|
3
|
-
/** Unique id of an edge */
|
|
4
|
-
id: string;
|
|
5
|
-
/** Type of an edge defined in edgeTypes */
|
|
6
|
-
type?: EdgeType;
|
|
7
|
-
/** Id of source node */
|
|
8
|
-
source: string;
|
|
9
|
-
/** Id of target node */
|
|
10
|
-
target: string;
|
|
11
|
-
/** Id of source handle
|
|
12
|
-
* only needed if there are multiple handles per node
|
|
13
|
-
*/
|
|
14
|
-
sourceHandle?: string | null;
|
|
15
|
-
/** Id of target handle
|
|
16
|
-
* only needed if there are multiple handles per node
|
|
17
|
-
*/
|
|
18
|
-
targetHandle?: string | null;
|
|
19
|
-
animated?: boolean;
|
|
20
|
-
hidden?: boolean;
|
|
21
|
-
deletable?: boolean;
|
|
22
|
-
selectable?: boolean;
|
|
23
|
-
/** Arbitrary data passed to an edge */
|
|
24
|
-
data?: EdgeData;
|
|
25
|
-
selected?: boolean;
|
|
26
|
-
/** Set the marker on the beginning of an edge
|
|
27
|
-
* @example 'arrow', 'arrowclosed' or custom marker
|
|
28
|
-
*/
|
|
29
|
-
markerStart?: EdgeMarkerType;
|
|
30
|
-
/** Set the marker on the end of an edge
|
|
31
|
-
* @example 'arrow', 'arrowclosed' or custom marker
|
|
32
|
-
*/
|
|
33
|
-
markerEnd?: EdgeMarkerType;
|
|
34
|
-
zIndex?: number;
|
|
35
|
-
ariaLabel?: string;
|
|
36
|
-
/** Padding around the edge where interaction is still possible */
|
|
37
|
-
interactionWidth?: number;
|
|
38
|
-
};
|
|
39
|
-
export type SmoothStepPathOptions = {
|
|
40
|
-
offset?: number;
|
|
41
|
-
borderRadius?: number;
|
|
42
|
-
};
|
|
43
|
-
export type StepPathOptions = {
|
|
44
|
-
offset?: number;
|
|
45
|
-
};
|
|
46
|
-
export type BezierPathOptions = {
|
|
47
|
-
curvature?: number;
|
|
48
|
-
};
|
|
49
|
-
export type DefaultEdgeOptionsBase<EdgeType extends EdgeBase> = Omit<EdgeType, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'selected'>;
|
|
50
|
-
export declare enum ConnectionLineType {
|
|
51
|
-
Bezier = "default",
|
|
52
|
-
Straight = "straight",
|
|
53
|
-
Step = "step",
|
|
54
|
-
SmoothStep = "smoothstep",
|
|
55
|
-
SimpleBezier = "simplebezier"
|
|
56
|
-
}
|
|
57
|
-
export type EdgeMarker = {
|
|
58
|
-
type: MarkerType;
|
|
59
|
-
color?: string;
|
|
60
|
-
width?: number;
|
|
61
|
-
height?: number;
|
|
62
|
-
markerUnits?: string;
|
|
63
|
-
orient?: string;
|
|
64
|
-
strokeWidth?: number;
|
|
65
|
-
};
|
|
66
|
-
export type EdgeMarkerType = string | EdgeMarker;
|
|
67
|
-
export declare enum MarkerType {
|
|
68
|
-
Arrow = "arrow",
|
|
69
|
-
ArrowClosed = "arrowclosed"
|
|
70
|
-
}
|
|
71
|
-
export type MarkerProps = EdgeMarker & {
|
|
72
|
-
id: string;
|
|
73
|
-
};
|
|
74
|
-
export type EdgePosition = {
|
|
75
|
-
sourceX: number;
|
|
76
|
-
sourceY: number;
|
|
77
|
-
targetX: number;
|
|
78
|
-
targetY: number;
|
|
79
|
-
sourcePosition: Position;
|
|
80
|
-
targetPosition: Position;
|
|
81
|
-
};
|
|
82
|
-
export type EdgeLookup<EdgeType extends EdgeBase = EdgeBase> = Map<string, EdgeType>;
|
|
83
|
-
//# sourceMappingURL=edges.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../../src/types/system/edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,QAAQ,CAClB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,QAAQ,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IACtD;IACF,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,G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CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { D3DragEvent, Selection as D3Selection, SubjectPosition, ZoomBehavior } from 'd3';
|
|
2
|
-
import type { XYPosition, Rect } from './utils';
|
|
3
|
-
import type { InternalNodeBase, NodeBase, NodeDragItem, NodeOrigin } from './nodes';
|
|
4
|
-
import type { ConnectingHandle, HandleType } from './handles';
|
|
5
|
-
import { PanZoomInstance } from './panzoom';
|
|
6
|
-
import { EdgeBase } from '.';
|
|
7
|
-
export type Project = (position: XYPosition) => XYPosition;
|
|
8
|
-
export type OnMove = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void;
|
|
9
|
-
export type OnMoveStart = OnMove;
|
|
10
|
-
export type OnMoveEnd = OnMove;
|
|
11
|
-
export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => void;
|
|
12
|
-
export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => void;
|
|
13
|
-
export type GetZoom = () => number;
|
|
14
|
-
export type GetViewport = () => Viewport;
|
|
15
|
-
export type SetViewport = (viewport: Viewport, options?: ViewportHelperFunctionOptions) => void;
|
|
16
|
-
export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => void;
|
|
17
|
-
export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => void;
|
|
18
|
-
export type Connection = {
|
|
19
|
-
source: string;
|
|
20
|
-
target: string;
|
|
21
|
-
sourceHandle: string | null;
|
|
22
|
-
targetHandle: string | null;
|
|
23
|
-
};
|
|
24
|
-
export type HandleConnection = Connection & {
|
|
25
|
-
edgeId: string;
|
|
26
|
-
};
|
|
27
|
-
export type ConnectionStatus = 'valid' | 'invalid';
|
|
28
|
-
export declare enum ConnectionMode {
|
|
29
|
-
Strict = "strict",
|
|
30
|
-
Loose = "loose"
|
|
31
|
-
}
|
|
32
|
-
export type OnConnectStartParams = {
|
|
33
|
-
nodeId: string | null;
|
|
34
|
-
handleId: string | null;
|
|
35
|
-
handleType: HandleType | null;
|
|
36
|
-
};
|
|
37
|
-
export type OnConnectStart = (event: MouseEvent | TouchEvent, params: OnConnectStartParams) => void;
|
|
38
|
-
export type OnConnect = (connection: Connection) => void;
|
|
39
|
-
export type OnConnectEnd = (event: MouseEvent | TouchEvent) => void;
|
|
40
|
-
export type IsValidConnection = (edge: EdgeBase | Connection) => boolean;
|
|
41
|
-
export type FitViewParamsBase<NodeType extends NodeBase> = {
|
|
42
|
-
nodeLookup: Map<string, InternalNodeBase<NodeType>>;
|
|
43
|
-
width: number;
|
|
44
|
-
height: number;
|
|
45
|
-
panZoom: PanZoomInstance;
|
|
46
|
-
minZoom: number;
|
|
47
|
-
maxZoom: number;
|
|
48
|
-
nodeOrigin?: NodeOrigin;
|
|
49
|
-
};
|
|
50
|
-
export type FitViewOptionsBase<NodeType extends NodeBase = NodeBase> = {
|
|
51
|
-
padding?: number;
|
|
52
|
-
includeHiddenNodes?: boolean;
|
|
53
|
-
minZoom?: number;
|
|
54
|
-
maxZoom?: number;
|
|
55
|
-
duration?: number;
|
|
56
|
-
nodes?: (NodeType | {
|
|
57
|
-
id: string;
|
|
58
|
-
})[];
|
|
59
|
-
};
|
|
60
|
-
export type Viewport = {
|
|
61
|
-
x: number;
|
|
62
|
-
y: number;
|
|
63
|
-
zoom: number;
|
|
64
|
-
};
|
|
65
|
-
export type KeyCode = string | Array<string>;
|
|
66
|
-
export type SnapGrid = [number, number];
|
|
67
|
-
export declare enum PanOnScrollMode {
|
|
68
|
-
Free = "free",
|
|
69
|
-
Vertical = "vertical",
|
|
70
|
-
Horizontal = "horizontal"
|
|
71
|
-
}
|
|
72
|
-
export type ViewportHelperFunctionOptions = {
|
|
73
|
-
duration?: number;
|
|
74
|
-
};
|
|
75
|
-
export type SetCenterOptions = ViewportHelperFunctionOptions & {
|
|
76
|
-
zoom?: number;
|
|
77
|
-
};
|
|
78
|
-
export type FitBoundsOptions = ViewportHelperFunctionOptions & {
|
|
79
|
-
padding?: number;
|
|
80
|
-
};
|
|
81
|
-
export type OnViewportChange = (viewport: Viewport) => void;
|
|
82
|
-
export type D3ZoomInstance = ZoomBehavior<Element, unknown>;
|
|
83
|
-
export type D3SelectionInstance = D3Selection<Element, unknown, null, undefined>;
|
|
84
|
-
export type D3ZoomHandler = (this: Element, event: any, d: unknown) => void;
|
|
85
|
-
export type UpdateNodeInternals = (nodeId: string | string[]) => void;
|
|
86
|
-
export type PanelPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
87
|
-
export type ProOptions = {
|
|
88
|
-
account?: string;
|
|
89
|
-
hideAttribution: boolean;
|
|
90
|
-
};
|
|
91
|
-
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition>;
|
|
92
|
-
export declare enum SelectionMode {
|
|
93
|
-
Partial = "partial",
|
|
94
|
-
Full = "full"
|
|
95
|
-
}
|
|
96
|
-
export type SelectionRect = Rect & {
|
|
97
|
-
startX: number;
|
|
98
|
-
startY: number;
|
|
99
|
-
};
|
|
100
|
-
export type OnError = (id: string, message: string) => void;
|
|
101
|
-
export type UpdateNodePositions = (dragItems: Map<string, NodeDragItem | InternalNodeBase>, dragging?: boolean) => void;
|
|
102
|
-
export type PanBy = (delta: XYPosition) => boolean;
|
|
103
|
-
export type UpdateConnection = (params: {
|
|
104
|
-
connectionPosition: XYPosition | null;
|
|
105
|
-
connectionStatus: ConnectionStatus | null;
|
|
106
|
-
connectionStartHandle: ConnectingHandle | null;
|
|
107
|
-
connectionEndHandle: ConnectingHandle | null;
|
|
108
|
-
}) => void;
|
|
109
|
-
export type ColorModeClass = 'light' | 'dark';
|
|
110
|
-
export type ColorMode = ColorModeClass | 'system';
|
|
111
|
-
export type ConnectionLookup = Map<string, Map<string, HandleConnection>>;
|
|
112
|
-
export type OnBeforeDeleteBase<NodeType extends NodeBase = NodeBase, EdgeType extends EdgeBase = EdgeBase> = ({ nodes, edges, }: {
|
|
113
|
-
nodes: NodeType[];
|
|
114
|
-
edges: EdgeType[];
|
|
115
|
-
}) => Promise<boolean | {
|
|
116
|
-
nodes: NodeType[];
|
|
117
|
-
edges: EdgeType[];
|
|
118
|
-
}>;
|
|
119
|
-
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/types/system/general.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,IAAI,WAAW,EACxB,eAAe,EACf,YAAY,EACb,MAAM,IAAI,CAAC;AAEZ,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,MAAM,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,EACrC,QAAQ,EAAE,QAAQ,KACf,IAAI,CAAC;AACV,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,IAAI,CAAC;AAC1E,MAAM,MAAM,MAAM,GAAG,CACnB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,6BAA6B,KACpC,IAA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AM,KAAK,IAAI,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG,CAChC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAAC,EACvD,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI,CAAC;AACV,MAAM,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE;IACtC,kBAAkB,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,qBAAqB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC/C,mBAAmB,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC9C,KAAK,IAAI,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE1E,MAAM,MAAM,kBAAkB,CAC5B,QAAQ,SAAS,QAAQ,GAAG,QAAQ,EACpC,QAAQ,SAAS,QAAQ,GAAG,QAAQ,IAClC,CAAC,EACH,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,KAAK,OAAO,CAAC,OAAO,GAAG;IAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { Position, OnConnect, IsValidConnection } from '.';
|
|
2
|
-
export type HandleType = 'source' | 'target';
|
|
3
|
-
export type HandleElement = {
|
|
4
|
-
id?: string | null;
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
position: Position;
|
|
10
|
-
type?: HandleType;
|
|
11
|
-
};
|
|
12
|
-
export type ConnectingHandle = {
|
|
13
|
-
nodeId: string;
|
|
14
|
-
type: HandleType;
|
|
15
|
-
handleId?: string | null;
|
|
16
|
-
};
|
|
17
|
-
export type ConnectionHandle = {
|
|
18
|
-
id: string | null;
|
|
19
|
-
type: HandleType;
|
|
20
|
-
nodeId: string;
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
};
|
|
24
|
-
export type HandleProps = {
|
|
25
|
-
/** Type of the handle
|
|
26
|
-
* @example HandleType.Source, HandleType.Target
|
|
27
|
-
*/
|
|
28
|
-
type: HandleType;
|
|
29
|
-
/** Position of the handle
|
|
30
|
-
* @example Position.TopLeft, Position.TopRight,
|
|
31
|
-
* Position.BottomLeft, Position.BottomRight
|
|
32
|
-
*/
|
|
33
|
-
position: Position;
|
|
34
|
-
/** Should you be able to connect to/from this handle */
|
|
35
|
-
isConnectable?: boolean;
|
|
36
|
-
/** Should you be able to connect from this handle */
|
|
37
|
-
isConnectableStart?: boolean;
|
|
38
|
-
/** Should you be able to connect to this handle */
|
|
39
|
-
isConnectableEnd?: boolean;
|
|
40
|
-
/** Callback called when connection is made */
|
|
41
|
-
onConnect?: OnConnect;
|
|
42
|
-
/** Callback if connection is valid
|
|
43
|
-
* @remarks connection becomes an edge if isValidConnection returns true
|
|
44
|
-
*/
|
|
45
|
-
isValidConnection?: IsValidConnection;
|
|
46
|
-
/** Id of the handle
|
|
47
|
-
* @remarks optional if there is only one handle of this type
|
|
48
|
-
*/
|
|
49
|
-
id?: string;
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=handles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../../../src/types/system/handles.ts"],"names":[],"mappings":"AA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0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/system/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import type { XYPosition, Position, CoordinateExtent, HandleElement } from '.';
|
|
2
|
-
import { Optional } from '../utils/types';
|
|
3
|
-
/**
|
|
4
|
-
* Framework independent node data structure.
|
|
5
|
-
*
|
|
6
|
-
* @typeParam NodeData - type of the node data
|
|
7
|
-
* @typeParam NodeType - type of the node
|
|
8
|
-
*/
|
|
9
|
-
export type NodeBase<NodeData extends any = any, NodeType extends string = string> = {
|
|
10
|
-
/** Unique id of a node */
|
|
11
|
-
id: string;
|
|
12
|
-
/** Position of a node on the pane
|
|
13
|
-
* @example { x: 0, y: 0 }
|
|
14
|
-
*/
|
|
15
|
-
position: XYPosition;
|
|
16
|
-
/** Arbitrary data passed to a node */
|
|
17
|
-
data: NodeData;
|
|
18
|
-
/** Type of node defined in nodeTypes */
|
|
19
|
-
type?: NodeType;
|
|
20
|
-
/** Only relevant for default, source, target nodeType. controls source position
|
|
21
|
-
* @example 'right', 'left', 'top', 'bottom'
|
|
22
|
-
*/
|
|
23
|
-
sourcePosition?: Position;
|
|
24
|
-
/** Only relevant for default, source, target nodeType. controls target position
|
|
25
|
-
* @example 'right', 'left', 'top', 'bottom'
|
|
26
|
-
*/
|
|
27
|
-
targetPosition?: Position;
|
|
28
|
-
hidden?: boolean;
|
|
29
|
-
selected?: boolean;
|
|
30
|
-
/** True, if node is being dragged */
|
|
31
|
-
dragging?: boolean;
|
|
32
|
-
draggable?: boolean;
|
|
33
|
-
selectable?: boolean;
|
|
34
|
-
connectable?: boolean;
|
|
35
|
-
deletable?: boolean;
|
|
36
|
-
dragHandle?: string;
|
|
37
|
-
width?: number;
|
|
38
|
-
height?: number;
|
|
39
|
-
initialWidth?: number;
|
|
40
|
-
initialHeight?: number;
|
|
41
|
-
/** Parent node id, used for creating sub-flows */
|
|
42
|
-
parentId?: string;
|
|
43
|
-
zIndex?: number;
|
|
44
|
-
/** Boundary a node can be moved in
|
|
45
|
-
* @example 'parent' or [[0, 0], [100, 100]]
|
|
46
|
-
*/
|
|
47
|
-
extent?: 'parent' | CoordinateExtent;
|
|
48
|
-
expandParent?: boolean;
|
|
49
|
-
ariaLabel?: string;
|
|
50
|
-
/** Origin of the node relative to it's position
|
|
51
|
-
* @example
|
|
52
|
-
* [0.5, 0.5] // centers the node
|
|
53
|
-
* [0, 0] // top left
|
|
54
|
-
* [1, 1] // bottom right
|
|
55
|
-
*/
|
|
56
|
-
origin?: NodeOrigin;
|
|
57
|
-
handles?: NodeHandle[];
|
|
58
|
-
measured?: {
|
|
59
|
-
width?: number;
|
|
60
|
-
height?: number;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
export type InternalNodeBase<NodeType extends NodeBase = NodeBase> = NodeType & {
|
|
64
|
-
measured: {
|
|
65
|
-
width?: number;
|
|
66
|
-
height?: number;
|
|
67
|
-
};
|
|
68
|
-
internals: {
|
|
69
|
-
positionAbsolute: XYPosition;
|
|
70
|
-
z: number;
|
|
71
|
-
/** Holds a reference to the original node object provided by the user.
|
|
72
|
-
* Used as an optimization to avoid certain operations. */
|
|
73
|
-
userNode: NodeType;
|
|
74
|
-
handleBounds?: NodeHandleBounds;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* The node data structure that gets used for the nodes prop.
|
|
79
|
-
*
|
|
80
|
-
* @public
|
|
81
|
-
*/
|
|
82
|
-
export type NodeProps<NodeType extends NodeBase> = Pick<NodeType, 'id' | 'data' | 'width' | 'height' | 'sourcePosition' | 'targetPosition' | 'selected' | 'dragHandle'> & Required<Pick<NodeType, 'type' | 'dragging' | 'zIndex'>> & {
|
|
83
|
-
/** whether a node is connectable or not */
|
|
84
|
-
isConnectable: boolean;
|
|
85
|
-
/** position absolute x value */
|
|
86
|
-
positionAbsoluteX: number;
|
|
87
|
-
/** position absolute x value */
|
|
88
|
-
positionAbsoluteY: number;
|
|
89
|
-
};
|
|
90
|
-
export type NodeHandleBounds = {
|
|
91
|
-
source: HandleElement[] | null;
|
|
92
|
-
target: HandleElement[] | null;
|
|
93
|
-
};
|
|
94
|
-
export type InternalNodeUpdate = {
|
|
95
|
-
id: string;
|
|
96
|
-
nodeElement: HTMLDivElement;
|
|
97
|
-
force?: boolean;
|
|
98
|
-
};
|
|
99
|
-
export type NodeBounds = XYPosition & {
|
|
100
|
-
width: number | null;
|
|
101
|
-
height: number | null;
|
|
102
|
-
};
|
|
103
|
-
export type NodeDragItem = {
|
|
104
|
-
id: string;
|
|
105
|
-
position: XYPosition;
|
|
106
|
-
distance: XYPosition;
|
|
107
|
-
measured: {
|
|
108
|
-
width: number;
|
|
109
|
-
height: number;
|
|
110
|
-
};
|
|
111
|
-
internals: {
|
|
112
|
-
positionAbsolute: XYPosition;
|
|
113
|
-
};
|
|
114
|
-
extent?: 'parent' | CoordinateExtent;
|
|
115
|
-
parentId?: string;
|
|
116
|
-
dragging?: boolean;
|
|
117
|
-
origin?: NodeOrigin;
|
|
118
|
-
expandParent?: boolean;
|
|
119
|
-
};
|
|
120
|
-
export type NodeOrigin = [number, number];
|
|
121
|
-
export type OnSelectionDrag = (event: MouseEvent, nodes: NodeBase[]) => void;
|
|
122
|
-
export type NodeHandle = Optional<HandleElement, 'width' | 'height'>;
|
|
123
|
-
export type Align = 'center' | 'start' | 'end';
|
|
124
|
-
export type NodeLookup<NodeType extends InternalNodeBase = InternalNodeBase> = Map<string, NodeType>;
|
|
125
|
-
export type ParentLookup<NodeType extends InternalNodeBase = InternalNodeBase> = Map<string, NodeType[]>;
|
|
126
|
-
//# sourceMappingURL=nodes.d.ts.map
|
|
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AC,CAAC;AACxB,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,gBAAgB,GAAG,gBAAgB,IAC3E,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ZoomTransform } from 'd3-zoom';
|
|
2
|
-
import { PanOnScrollMode, type CoordinateExtent, type Transform, type Viewport } from './';
|
|
3
|
-
export type OnDraggingChange = (dragging: boolean) => void;
|
|
4
|
-
export type OnTransformChange = (transform: Transform) => void;
|
|
5
|
-
export type PanZoomParams = {
|
|
6
|
-
domNode: Element;
|
|
7
|
-
minZoom: number;
|
|
8
|
-
maxZoom: number;
|
|
9
|
-
viewport: Viewport;
|
|
10
|
-
translateExtent: CoordinateExtent;
|
|
11
|
-
onTransformChange: OnTransformChange;
|
|
12
|
-
onDraggingChange: OnDraggingChange;
|
|
13
|
-
onPanZoomStart?: OnPanZoom;
|
|
14
|
-
onPanZoom?: OnPanZoom;
|
|
15
|
-
onPanZoomEnd?: OnPanZoom;
|
|
16
|
-
};
|
|
17
|
-
export type PanZoomTransformOptions = {
|
|
18
|
-
duration?: number;
|
|
19
|
-
};
|
|
20
|
-
export type OnPanZoom = (event: MouseEvent | TouchEvent | null, viewport: Viewport) => void;
|
|
21
|
-
export type PanZoomUpdateOptions = {
|
|
22
|
-
noWheelClassName: string;
|
|
23
|
-
noPanClassName: string;
|
|
24
|
-
onPaneContextMenu?: (event: MouseEvent) => void;
|
|
25
|
-
preventScrolling: boolean;
|
|
26
|
-
panOnScroll: boolean;
|
|
27
|
-
panOnDrag: boolean | number[];
|
|
28
|
-
panOnScrollMode: PanOnScrollMode;
|
|
29
|
-
panOnScrollSpeed: number;
|
|
30
|
-
userSelectionActive: boolean;
|
|
31
|
-
zoomOnPinch: boolean;
|
|
32
|
-
zoomOnScroll: boolean;
|
|
33
|
-
zoomOnDoubleClick: boolean;
|
|
34
|
-
zoomActivationKeyPressed: boolean;
|
|
35
|
-
lib: string;
|
|
36
|
-
};
|
|
37
|
-
export type PanZoomInstance = {
|
|
38
|
-
update: (params: PanZoomUpdateOptions) => void;
|
|
39
|
-
destroy: () => void;
|
|
40
|
-
getViewport: () => Viewport;
|
|
41
|
-
setViewport: (viewport: Viewport, options?: PanZoomTransformOptions) => ZoomTransform | undefined;
|
|
42
|
-
setViewportConstrained: (viewport: Viewport, extent: CoordinateExtent, translateExtent: CoordinateExtent) => ZoomTransform | undefined;
|
|
43
|
-
setScaleExtent: (scaleExtent: [number, number]) => void;
|
|
44
|
-
setTranslateExtent: (translateExtent: CoordinateExtent) => void;
|
|
45
|
-
scaleTo: (scale: number, options?: PanZoomTransformOptions) => void;
|
|
46
|
-
scaleBy: (factor: number, options?: PanZoomTransformOptions) => void;
|
|
47
|
-
syncViewport: (viewport: Viewport) => void;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=panzoom.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panzoom.d.ts","sourceRoot":"","sources":["../../../src/types/system/panzoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE3F,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,gBAAgB,CAAC;IAClC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,gBAAgB,EAAE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B,EACxB,eAAe,EAAE,gBAAgB,KAC9B,aAAa,GAAG,SAAS,CAAC;IAC/B,cAAc,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,kBAAkB,EAAE,CAAC,eAAe,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAChE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACpE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACrE,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC5C,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare enum Position {
|
|
2
|
-
Left = "left",
|
|
3
|
-
Top = "top",
|
|
4
|
-
Right = "right",
|
|
5
|
-
Bottom = "bottom"
|
|
6
|
-
}
|
|
7
|
-
export type XYPosition = {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
};
|
|
11
|
-
export type XYZPosition = XYPosition & {
|
|
12
|
-
z: number;
|
|
13
|
-
};
|
|
14
|
-
export type Dimensions = {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
};
|
|
18
|
-
export type Rect = Dimensions & XYPosition;
|
|
19
|
-
export type Box = XYPosition & {
|
|
20
|
-
x2: number;
|
|
21
|
-
y2: number;
|
|
22
|
-
};
|
|
23
|
-
export type Transform = [number, number, number];
|
|
24
|
-
export type CoordinateExtent = [[number, number], [number, number]];
|
|
25
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/system/utils.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC;AAE3C,MAAM,MAAM,GAAG,GAAG,UAAU,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Position } from '../types/system';
|
|
2
|
-
export type GetBezierPathParams = {
|
|
3
|
-
sourceX: number;
|
|
4
|
-
sourceY: number;
|
|
5
|
-
sourcePosition?: Position;
|
|
6
|
-
targetX: number;
|
|
7
|
-
targetY: number;
|
|
8
|
-
targetPosition?: Position;
|
|
9
|
-
curvature?: number;
|
|
10
|
-
};
|
|
11
|
-
export type GetControlWithCurvatureParams = {
|
|
12
|
-
pos: Position;
|
|
13
|
-
x1: number;
|
|
14
|
-
y1: number;
|
|
15
|
-
x2: number;
|
|
16
|
-
y2: number;
|
|
17
|
-
c: number;
|
|
18
|
-
};
|
|
19
|
-
export declare function getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }: {
|
|
20
|
-
sourceX: number;
|
|
21
|
-
sourceY: number;
|
|
22
|
-
targetX: number;
|
|
23
|
-
targetY: number;
|
|
24
|
-
sourceControlX: number;
|
|
25
|
-
sourceControlY: number;
|
|
26
|
-
targetControlX: number;
|
|
27
|
-
targetControlY: number;
|
|
28
|
-
}): [number, number, number, number];
|
|
29
|
-
/**
|
|
30
|
-
* Get a bezier path from source to target handle
|
|
31
|
-
* @param params.sourceX - The x position of the source handle
|
|
32
|
-
* @param params.sourceY - The y position of the source handle
|
|
33
|
-
* @param params.sourcePosition - The position of the source handle (default: Position.Bottom)
|
|
34
|
-
* @param params.targetX - The x position of the target handle
|
|
35
|
-
* @param params.targetY - The y position of the target handle
|
|
36
|
-
* @param params.targetPosition - The position of the target handle (default: Position.Top)
|
|
37
|
-
* @param params.curvature - The curvature of the bezier edge
|
|
38
|
-
* @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
|
|
39
|
-
* @example
|
|
40
|
-
* const source = { x: 0, y: 20 };
|
|
41
|
-
const target = { x: 150, y: 100 };
|
|
42
|
-
|
|
43
|
-
const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({
|
|
44
|
-
sourceX: source.x,
|
|
45
|
-
sourceY: source.y,
|
|
46
|
-
sourcePosition: Position.Right,
|
|
47
|
-
targetX: target.x,
|
|
48
|
-
targetY: target.y,
|
|
49
|
-
targetPosition: Position.Left,
|
|
50
|
-
});
|
|
51
|
-
*/
|
|
52
|
-
export declare function getBezierPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, curvature, }: GetBezierPathParams): [
|
|
53
|
-
path: string,
|
|
54
|
-
labelX: number,
|
|
55
|
-
labelY: number,
|
|
56
|
-
offsetX: number,
|
|
57
|
-
offsetY: number
|
|
58
|
-
];
|
|
59
|
-
//# sourceMappingURL=bezier-edge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bezier-edge.d.ts","sourceRoot":"","sources":["../../src/utils/bezier-edge.ts"],"names":[],"mappings":"AAAA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AM;IACd,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;CAChB,CAmCA"}
|
package/dist/utils/edges.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Connection, EdgeBase, InternalNodeBase, Transform } from '../types/system';
|
|
2
|
-
type IsEdgeVisibleParams = {
|
|
3
|
-
sourceNode: InternalNodeBase;
|
|
4
|
-
targetNode: InternalNodeBase;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
transform: Transform;
|
|
8
|
-
};
|
|
9
|
-
export declare function isEdgeVisible({ sourceNode, targetNode, width, height, transform, }: IsEdgeVisibleParams): boolean;
|
|
10
|
-
export type GetEdgeZIndexParams = {
|
|
11
|
-
sourceNode: InternalNodeBase;
|
|
12
|
-
targetNode: InternalNodeBase;
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
zIndex?: number;
|
|
15
|
-
elevateOnSelect?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export declare function getElevatedEdgeZIndex({ sourceNode, targetNode, selected, zIndex, elevateOnSelect, }: GetEdgeZIndexParams): number;
|
|
18
|
-
export declare const addEdge: <EdgeType extends EdgeBase>(edgeParams: EdgeType | Connection, edges: EdgeType[]) => EdgeType[];
|
|
19
|
-
export declare function getEdgeCenter({ sourceX, sourceY, targetX, targetY, }: {
|
|
20
|
-
sourceX: number;
|
|
21
|
-
sourceY: number;
|
|
22
|
-
targetX: number;
|
|
23
|
-
targetY: number;
|
|
24
|
-
}): [number, number, number, number];
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=edges.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/utils/edges.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAEV,QAAQ,EAER,gBAAgB,EAGhB,SAAS,EACV,MAAM,iBAAiB,CAAC;AASzB,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,GACV,EAAE,mBAAmB,GAAG,OAAO,CAsB/B;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,EACpC,UAAU,EACV,UAAU,EACV,QAAgB,EAChB,MAAU,EACV,eAAuB,GACxB,EAAE,mBAAmB,GAAG,MAAM,CAc9B;AAED,eAAO,MAAM,OAAO,0CACN,QAAQ,GAAG,UAAU,SAC1B,QAAQ,EAAE,KAChB,QAAQ,EA8BV,CAAC;AAsBF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQnC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Position } from '../types/system';
|
|
2
|
-
export interface GetSmoothStepPathParams {
|
|
3
|
-
sourceX: number;
|
|
4
|
-
sourceY: number;
|
|
5
|
-
sourcePosition?: Position;
|
|
6
|
-
targetX: number;
|
|
7
|
-
targetY: number;
|
|
8
|
-
targetPosition?: Position;
|
|
9
|
-
borderRadius?: number;
|
|
10
|
-
centerX?: number;
|
|
11
|
-
centerY?: number;
|
|
12
|
-
offset?: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Get a smooth step path from source to target handle
|
|
16
|
-
* @param params.sourceX - The x position of the source handle
|
|
17
|
-
* @param params.sourceY - The y position of the source handle
|
|
18
|
-
* @param params.sourcePosition - The position of the source handle (default: Position.Bottom)
|
|
19
|
-
* @param params.targetX - The x position of the target handle
|
|
20
|
-
* @param params.targetY - The y position of the target handle
|
|
21
|
-
* @param params.targetPosition - The position of the target handle (default: Position.Top)
|
|
22
|
-
* @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
|
|
23
|
-
* @example
|
|
24
|
-
* const source = { x: 0, y: 20 };
|
|
25
|
-
const target = { x: 150, y: 100 };
|
|
26
|
-
|
|
27
|
-
const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({
|
|
28
|
-
sourceX: source.x,
|
|
29
|
-
sourceY: source.y,
|
|
30
|
-
sourcePosition: Position.Right,
|
|
31
|
-
targetX: target.x,
|
|
32
|
-
targetY: target.y,
|
|
33
|
-
targetPosition: Position.Left,
|
|
34
|
-
});
|
|
35
|
-
*/
|
|
36
|
-
export declare function getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, borderRadius, centerX, centerY, offset, }: GetSmoothStepPathParams): [
|
|
37
|
-
path: string,
|
|
38
|
-
labelX: number,
|
|
39
|
-
labelY: number,
|
|
40
|
-
offsetX: number,
|
|
41
|
-
offsetY: number
|
|
42
|
-
];
|
|
43
|
-
//# sourceMappingURL=smoothstep-edge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smoothstep-edge.d.ts","sourceRoot":"","sources":["../../src/utils/smoothstep-edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,iBAAiB,CAAC;AAGvD,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkOD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,OAAO,EACP,cAAgC,EAChC,OAAO,EACP,OAAO,EACP,cAA6B,EAC7B,YAAgB,EAChB,OAAO,EACP,OAAO,EACP,MAAW,GACZ,EAAE,uBAAuB,GAAG;IAC3B,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;CAChB,CAyBA"}
|