@focus.matters/diagrams 0.0.7
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/Diagrams/DiagramEditor.d.ts +11 -0
- package/dist/Diagrams/components/Canvas.d.ts +6 -0
- package/dist/Diagrams/components/extra/AlignmentSuggestions.d.ts +3 -0
- package/dist/Diagrams/components/extra/GatewayRender.d.ts +5 -0
- package/dist/Diagrams/components/extra/Measurement.d.ts +3 -0
- package/dist/Diagrams/components/extra/MouseTracker.d.ts +3 -0
- package/dist/Diagrams/components/extra/NodesConnectorRenderer.d.ts +3 -0
- package/dist/Diagrams/components/extra/PathFindingRenderer.d.ts +3 -0
- package/dist/Diagrams/components/extra/Selection.d.ts +3 -0
- package/dist/Diagrams/components/extra/Stats.d.ts +3 -0
- package/dist/Diagrams/components/extra/Svg.d.ts +2 -0
- package/dist/Diagrams/components/extra/Theme.d.ts +8 -0
- package/dist/Diagrams/components/extra/ToolsState.d.ts +5 -0
- package/dist/Diagrams/components/nodes/NodeTools.d.ts +4 -0
- package/dist/Diagrams/components/objects/Cross.d.ts +9 -0
- package/dist/Diagrams/components/objects/CustomRenderers.d.ts +6 -0
- package/dist/Diagrams/components/objects/Grid.d.ts +1 -0
- package/dist/Diagrams/components/objects/RenderEdge/EdgeMarker.d.ts +12 -0
- package/dist/Diagrams/components/objects/RenderEdge/EdgeMidpoints.d.ts +11 -0
- package/dist/Diagrams/components/objects/RenderEdge/debugEdges.d.ts +14 -0
- package/dist/Diagrams/components/objects/RenderEdge/index.d.ts +4 -0
- package/dist/Diagrams/components/objects/RenderEdge/types.d.ts +29 -0
- package/dist/Diagrams/components/objects/RenderEdge/util.d.ts +6 -0
- package/dist/Diagrams/components/objects/Shape.d.ts +49 -0
- package/dist/Diagrams/components/objects/Shapes.d.ts +1 -0
- package/dist/Diagrams/components/objects/customRendererProps.d.ts +7 -0
- package/dist/Diagrams/components/objects/makeScalableComponent.d.ts +2 -0
- package/dist/Diagrams/context-menu/ContextMenu.d.ts +22 -0
- package/dist/Diagrams/context-menu/buildDiagramContextMenu.d.ts +6 -0
- package/dist/Diagrams/context-menu/index.d.ts +3 -0
- package/dist/Diagrams/context-menu/types.d.ts +12 -0
- package/dist/Diagrams/custom/agent/AgentDiagram.d.ts +5 -0
- package/dist/Diagrams/custom/agent/edges/AgentEdge.d.ts +32 -0
- package/dist/Diagrams/custom/agent/index.d.ts +2 -0
- package/dist/Diagrams/custom/agent/nodes/ActionNode.d.ts +14 -0
- package/dist/Diagrams/custom/agent/nodes/AgentNode.d.ts +58 -0
- package/dist/Diagrams/custom/agent/nodes/ConditionNode.d.ts +14 -0
- package/dist/Diagrams/custom/agent/nodes/OutcomeNode.d.ts +14 -0
- package/dist/Diagrams/custom/agent/nodes/TriggerNode.d.ts +14 -0
- package/dist/Diagrams/custom/agent/types.d.ts +54 -0
- package/dist/Diagrams/custom/bpmn/BPMDiagram.d.ts +5 -0
- package/dist/Diagrams/custom/bpmn/bpmnEvents.d.ts +3 -0
- package/dist/Diagrams/custom/bpmn/edges/EdgeWithLoad.d.ts +4 -0
- package/dist/Diagrams/custom/bpmn/nodes/BPMNNodeContext.d.ts +3 -0
- package/dist/Diagrams/custom/bpmn/nodes/BPMNode.d.ts +6 -0
- package/dist/Diagrams/custom/bpmn/nodes/EventNode.d.ts +58 -0
- package/dist/Diagrams/custom/bpmn/nodes/GateNode.d.ts +58 -0
- package/dist/Diagrams/custom/bpmn/nodes/Lanes/LanesResizer.d.ts +6 -0
- package/dist/Diagrams/custom/bpmn/nodes/Lanes/index.d.ts +66 -0
- package/dist/Diagrams/custom/bpmn/nodes/TaskNode.d.ts +9 -0
- package/dist/Diagrams/custom/bpmn/nodes/UnknownBPMNNode.d.ts +51 -0
- package/dist/Diagrams/custom/communication/CommunicationDiagram.d.ts +15 -0
- package/dist/Diagrams/custom/communication/CommunicationNode.d.ts +12 -0
- package/dist/Diagrams/custom/communication/edges/CommunicationEdge.d.ts +35 -0
- package/dist/Diagrams/custom/communication/nodes/CommunicationActorNode.d.ts +10 -0
- package/dist/Diagrams/custom/communication/nodes/CommunicationControllerNode.d.ts +10 -0
- package/dist/Diagrams/custom/communication/nodes/CommunicationObjectNode.d.ts +10 -0
- package/dist/Diagrams/custom/communication/types.d.ts +1 -0
- package/dist/Diagrams/custom/editable/EditableDiagram.d.ts +4 -0
- package/dist/Diagrams/custom/editable/EditableLabel.d.ts +3 -0
- package/dist/Diagrams/custom/editable/EditableNode.d.ts +15 -0
- package/dist/Diagrams/custom/editable/EditableNodeContext.d.ts +3 -0
- package/dist/Diagrams/custom/editable/EditionMode.d.ts +10 -0
- package/dist/Diagrams/custom/editable/events.d.ts +9 -0
- package/dist/Diagrams/layout/HStack.d.ts +4 -0
- package/dist/Diagrams/store/Canvas.d.ts +69 -0
- package/dist/Diagrams/store/Diagram.d.ts +134 -0
- package/dist/Diagrams/store/elements/Edge.d.ts +42 -0
- package/dist/Diagrams/store/elements/EdgePoint.d.ts +19 -0
- package/dist/Diagrams/store/elements/Element.d.ts +19 -0
- package/dist/Diagrams/store/elements/Events.d.ts +244 -0
- package/dist/Diagrams/store/elements/EventsMouseInformation.d.ts +10 -0
- package/dist/Diagrams/store/elements/Gateway.d.ts +57 -0
- package/dist/Diagrams/store/elements/Node.d.ts +73 -0
- package/dist/Diagrams/store/elements/TextNode.d.ts +4 -0
- package/dist/Diagrams/store/extensions/Creator.d.ts +9 -0
- package/dist/Diagrams/store/extensions/Debugger.d.ts +6 -0
- package/dist/Diagrams/store/extensions/DiagramExtension.d.ts +13 -0
- package/dist/Diagrams/store/extensions/DistancesBalancer.d.ts +13 -0
- package/dist/Diagrams/store/extensions/Dragger.d.ts +46 -0
- package/dist/Diagrams/store/extensions/EdgesDragger.d.ts +101 -0
- package/dist/Diagrams/store/extensions/GridSnap.d.ts +5 -0
- package/dist/Diagrams/store/extensions/History.d.ts +15 -0
- package/dist/Diagrams/store/extensions/Hotkeys.d.ts +22 -0
- package/dist/Diagrams/store/extensions/Measurer.d.ts +17 -0
- package/dist/Diagrams/store/extensions/NodesAligner.d.ts +19 -0
- package/dist/Diagrams/store/extensions/NodesConnector.d.ts +27 -0
- package/dist/Diagrams/store/extensions/NodesResizer.d.ts +4 -0
- package/dist/Diagrams/store/extensions/PathFindingRenderer.d.ts +9 -0
- package/dist/Diagrams/store/extensions/Priorities.d.ts +26 -0
- package/dist/Diagrams/store/extensions/Rules.d.ts +11 -0
- package/dist/Diagrams/store/extensions/Selector.d.ts +50 -0
- package/dist/Diagrams/store/extensions/StraightDrag.d.ts +8 -0
- package/dist/Diagrams/store/primitives/Coordinates.d.ts +45 -0
- package/dist/Diagrams/store/primitives/Dimensions.d.ts +58 -0
- package/dist/Diagrams/store/primitives/DirectedPoint.d.ts +12 -0
- package/dist/Diagrams/store/types.d.ts +61 -0
- package/dist/Diagrams/util/ClassList.d.ts +8 -0
- package/dist/Diagrams/util/Mouse.d.ts +9 -0
- package/dist/Diagrams/util/Mutex.d.ts +5 -0
- package/dist/Diagrams/util/PriorityQueue.d.ts +19 -0
- package/dist/Diagrams/util/Semaphore.d.ts +37 -0
- package/dist/Diagrams/util/TasksQueue.d.ts +7 -0
- package/dist/Diagrams/util/arrayOrArray.d.ts +1 -0
- package/dist/Diagrams/util/awaitTime.d.ts +1 -0
- package/dist/Diagrams/util/binders.d.ts +17 -0
- package/dist/Diagrams/util/bpmn/applyBPMNImportPlan.d.ts +3 -0
- package/dist/Diagrams/util/bpmn/buildBPMNImportPlan.d.ts +3 -0
- package/dist/Diagrams/util/bpmn/importBPMNXmlIntoDiagram.d.ts +6 -0
- package/dist/Diagrams/util/bpmn/index.d.ts +5 -0
- package/dist/Diagrams/util/bpmn/parseBPMNXml.d.ts +2 -0
- package/dist/Diagrams/util/bpmn/types.d.ts +103 -0
- package/dist/Diagrams/util/cloneDeep.d.ts +1 -0
- package/dist/Diagrams/util/downloadFile.d.ts +1 -0
- package/dist/Diagrams/util/getEnumStr.d.ts +3 -0
- package/dist/Diagrams/util/getIdForNode.d.ts +2 -0
- package/dist/Diagrams/util/getUniqueId.d.ts +1 -0
- package/dist/Diagrams/util/insertSorted.d.ts +1 -0
- package/dist/Diagrams/util/paths/PathsGrid.d.ts +43 -0
- package/dist/Diagrams/util/paths/findBestPathBetweenNodes.d.ts +8 -0
- package/dist/Diagrams/util/paths/orthogonalRouter.d.ts +7 -0
- package/dist/Diagrams/util/paths/stepBackFromGateway.d.ts +5 -0
- package/dist/Diagrams/util/readFile.d.ts +8 -0
- package/dist/Diagrams/util/shapes.d.ts +13 -0
- package/dist/Diagrams/util/throttle.d.ts +1 -0
- package/dist/DirectedPoint-HRgiLZeU.js +53 -0
- package/dist/DirectedPoint-HRgiLZeU.js.map +1 -0
- package/dist/diagrams.css +1 -0
- package/dist/index-DZNvKq1b.js +6657 -0
- package/dist/index-DZNvKq1b.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.es.js +10 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +6 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { MouseEvent as ME, KeyboardEvent as KE } from 'react';
|
|
2
|
+
import { Element } from './Element';
|
|
3
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
4
|
+
import { Node } from './Node';
|
|
5
|
+
import { Edge } from './Edge';
|
|
6
|
+
import { Midpoint } from '../../components/objects/RenderEdge';
|
|
7
|
+
import { MouseInformation } from './EventsMouseInformation';
|
|
8
|
+
import { Dimensions } from '../primitives/Dimensions';
|
|
9
|
+
export type AnyMouseEvent = ME | MouseEvent;
|
|
10
|
+
export type AnyKeyboardEvent = KE | KeyboardEvent;
|
|
11
|
+
export declare abstract class DEvent {
|
|
12
|
+
src: Element;
|
|
13
|
+
protected abstract readonly __brand: void;
|
|
14
|
+
private _cancellable;
|
|
15
|
+
private _cancelled;
|
|
16
|
+
private _bubbles;
|
|
17
|
+
private _spreads;
|
|
18
|
+
constructor(src: Element);
|
|
19
|
+
get bubbles(): boolean;
|
|
20
|
+
get cancelled(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If false, all emitters in the same level must be skipped
|
|
23
|
+
*/
|
|
24
|
+
get spreads(): boolean;
|
|
25
|
+
cancellable(c: boolean): this;
|
|
26
|
+
cancel(): void;
|
|
27
|
+
stopPropagation(): void;
|
|
28
|
+
stopImmediatePropagation(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare abstract class DUIEvent extends DEvent {
|
|
31
|
+
protected readonly __brand: void;
|
|
32
|
+
}
|
|
33
|
+
export declare abstract class DMouseEvent extends DUIEvent {
|
|
34
|
+
src: Element;
|
|
35
|
+
originalEvent: AnyMouseEvent;
|
|
36
|
+
protected readonly __brand: void;
|
|
37
|
+
mouse: MouseInformation;
|
|
38
|
+
constructor(src: Element, originalEvent: AnyMouseEvent);
|
|
39
|
+
get ctrl(): boolean;
|
|
40
|
+
get edge(): Edge | undefined;
|
|
41
|
+
get node(): Node<import('../types').TOrientation> | undefined;
|
|
42
|
+
get shift(): boolean;
|
|
43
|
+
get target(): HTMLElement;
|
|
44
|
+
}
|
|
45
|
+
export declare class DClickEvent extends DMouseEvent {
|
|
46
|
+
protected readonly __brand: void;
|
|
47
|
+
}
|
|
48
|
+
export declare class DDoubleClickEvent extends DMouseEvent {
|
|
49
|
+
protected readonly __brand: void;
|
|
50
|
+
}
|
|
51
|
+
export declare class DMouseDownEvent extends DMouseEvent {
|
|
52
|
+
protected readonly __brand: void;
|
|
53
|
+
}
|
|
54
|
+
export declare class DMouseUpEvent extends DMouseEvent {
|
|
55
|
+
protected readonly __brand: void;
|
|
56
|
+
}
|
|
57
|
+
export declare class DMouseMoveEvent extends DMouseEvent {
|
|
58
|
+
protected readonly __brand: void;
|
|
59
|
+
}
|
|
60
|
+
export declare class DWheelEvent extends DMouseEvent {
|
|
61
|
+
originalEvent: WheelEvent;
|
|
62
|
+
protected readonly __brand: void;
|
|
63
|
+
constructor(src: Element, originalEvent: WheelEvent);
|
|
64
|
+
get directionX(): "right" | "left" | "none";
|
|
65
|
+
get directionY(): "up" | "down" | "none";
|
|
66
|
+
}
|
|
67
|
+
export declare abstract class DKeyboardEvent extends DUIEvent {
|
|
68
|
+
originalEvent: AnyKeyboardEvent;
|
|
69
|
+
protected readonly __brand: void;
|
|
70
|
+
constructor(src: Element, originalEvent: AnyKeyboardEvent);
|
|
71
|
+
get code(): string;
|
|
72
|
+
get alt(): boolean;
|
|
73
|
+
get ctrl(): boolean;
|
|
74
|
+
get shift(): boolean;
|
|
75
|
+
}
|
|
76
|
+
export declare class DKeyDownEvent extends DKeyboardEvent {
|
|
77
|
+
originalEvent: AnyKeyboardEvent;
|
|
78
|
+
protected readonly __brand: void;
|
|
79
|
+
constructor(src: Element, originalEvent: AnyKeyboardEvent);
|
|
80
|
+
}
|
|
81
|
+
export declare class DKeyUpEvent extends DKeyboardEvent {
|
|
82
|
+
originalEvent: AnyKeyboardEvent;
|
|
83
|
+
protected readonly __brand: void;
|
|
84
|
+
constructor(src: Element, originalEvent: AnyKeyboardEvent);
|
|
85
|
+
}
|
|
86
|
+
export declare class DKeyPressEvent extends DKeyboardEvent {
|
|
87
|
+
orignalEvent: AnyKeyboardEvent;
|
|
88
|
+
protected readonly __brand: void;
|
|
89
|
+
constructor(src: Element, orignalEvent: AnyKeyboardEvent);
|
|
90
|
+
}
|
|
91
|
+
export declare abstract class DCanvasEvent extends DUIEvent {
|
|
92
|
+
protected readonly __brand: void;
|
|
93
|
+
}
|
|
94
|
+
/** We can add the events DDisplaceEvent, DResizeEvent extends DCanvasEvent */
|
|
95
|
+
export declare class DScaleEvent extends DCanvasEvent {
|
|
96
|
+
displacement: Coordinates;
|
|
97
|
+
newScale: number;
|
|
98
|
+
previousScale: number;
|
|
99
|
+
protected readonly __brand: void;
|
|
100
|
+
constructor(src: Element, displacement: Coordinates, newScale: number, previousScale: number);
|
|
101
|
+
}
|
|
102
|
+
export declare class DDisplaceEvent extends DCanvasEvent {
|
|
103
|
+
previousDisplacement: Coordinates;
|
|
104
|
+
displacement: Coordinates;
|
|
105
|
+
protected readonly __brand: void;
|
|
106
|
+
constructor(src: Element, previousDisplacement: Coordinates, displacement: Coordinates);
|
|
107
|
+
}
|
|
108
|
+
export declare abstract class DChangeEvent extends DEvent {
|
|
109
|
+
protected readonly __brand: void;
|
|
110
|
+
}
|
|
111
|
+
export declare class DResetGraphEvent extends DChangeEvent {
|
|
112
|
+
protected readonly __brand: void;
|
|
113
|
+
constructor(src: Element, getResolver: (cb: () => Promise<boolean>) => unknown);
|
|
114
|
+
private callbacks;
|
|
115
|
+
/**
|
|
116
|
+
* The defer method allows to introduce a wait condition before the graph resets
|
|
117
|
+
* the current state. It can be used for persistence or confirmation request.
|
|
118
|
+
*
|
|
119
|
+
* Everyone that listens to this event can add a new wait condition, the state
|
|
120
|
+
* will only be reseted if all the conditions return true.
|
|
121
|
+
*
|
|
122
|
+
* If any promise is not resolved, the action can be delayed forever.
|
|
123
|
+
*/
|
|
124
|
+
defer(cb: () => Promise<boolean>): void;
|
|
125
|
+
private resolve;
|
|
126
|
+
}
|
|
127
|
+
export declare abstract class DNodesConnectionEvent extends DChangeEvent {
|
|
128
|
+
protected readonly __brand: void;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* This event is fired when a connection is started by the user.
|
|
132
|
+
*/
|
|
133
|
+
export declare class DNodeConnectionIntentEvent extends DNodesConnectionEvent {
|
|
134
|
+
origin: Node<any>;
|
|
135
|
+
protected readonly __brand: void;
|
|
136
|
+
constructor(src: Element, origin: Node<any>);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* This event is fired when a connection is finishd after the mouse up
|
|
140
|
+
* by the user.
|
|
141
|
+
*/
|
|
142
|
+
export declare class DNodesConnectActionEvent extends DNodesConnectionEvent {
|
|
143
|
+
origin: Node<any>;
|
|
144
|
+
target: Node<any>;
|
|
145
|
+
protected readonly __brand: void;
|
|
146
|
+
constructor(src: Element, origin: Node<any>, target: Node<any>);
|
|
147
|
+
}
|
|
148
|
+
export declare class DNodeChangeTypeEvent extends DChangeEvent {
|
|
149
|
+
protected readonly __brand: void;
|
|
150
|
+
}
|
|
151
|
+
export declare class DDeleteNodeEvent extends DChangeEvent {
|
|
152
|
+
src: Element;
|
|
153
|
+
node: Node<any>;
|
|
154
|
+
protected readonly __brand: void;
|
|
155
|
+
constructor(src: Element, node: Node<any>);
|
|
156
|
+
}
|
|
157
|
+
export declare class DDeleteEdgeEvent extends DChangeEvent {
|
|
158
|
+
src: Element;
|
|
159
|
+
edge: Edge;
|
|
160
|
+
protected readonly __brand: void;
|
|
161
|
+
constructor(src: Element, edge: Edge);
|
|
162
|
+
}
|
|
163
|
+
export declare abstract class DSelectionEvent extends DUIEvent {
|
|
164
|
+
src: Element;
|
|
165
|
+
selected: boolean;
|
|
166
|
+
protected readonly __brand: void;
|
|
167
|
+
constructor(src: Element, selected: boolean);
|
|
168
|
+
}
|
|
169
|
+
export declare class DNodeSelectionEvent extends DSelectionEvent {
|
|
170
|
+
src: Node<any>;
|
|
171
|
+
protected readonly __brand: void;
|
|
172
|
+
constructor(src: Node<any>, selected: boolean);
|
|
173
|
+
}
|
|
174
|
+
export declare class DEdgeSelectionEvent extends DSelectionEvent {
|
|
175
|
+
src: Edge;
|
|
176
|
+
protected readonly __brand: void;
|
|
177
|
+
constructor(src: Edge, selected: boolean);
|
|
178
|
+
}
|
|
179
|
+
export declare abstract class DDragEvent extends DChangeEvent {
|
|
180
|
+
src: Element;
|
|
181
|
+
originalEvent: AnyMouseEvent;
|
|
182
|
+
protected readonly __brand: void;
|
|
183
|
+
constructor(src: Element, originalEvent: AnyMouseEvent);
|
|
184
|
+
}
|
|
185
|
+
export declare class DEdgeDragStartEvent extends DDragEvent {
|
|
186
|
+
src: Edge;
|
|
187
|
+
midPoint: Midpoint;
|
|
188
|
+
originalEvent: AnyMouseEvent;
|
|
189
|
+
protected readonly __brand: void;
|
|
190
|
+
constructor(src: Edge, midPoint: Midpoint, originalEvent: AnyMouseEvent);
|
|
191
|
+
}
|
|
192
|
+
export declare class DEdgeEndpointDragStartEvent extends DDragEvent {
|
|
193
|
+
src: Edge;
|
|
194
|
+
endpoint: 'from' | 'to';
|
|
195
|
+
originalEvent: AnyMouseEvent;
|
|
196
|
+
protected readonly __brand: void;
|
|
197
|
+
constructor(src: Edge, endpoint: 'from' | 'to', originalEvent: AnyMouseEvent);
|
|
198
|
+
}
|
|
199
|
+
export declare class NodePositionProposal {
|
|
200
|
+
readonly node: Node<any>;
|
|
201
|
+
newBox: Dimensions;
|
|
202
|
+
private _cancelled;
|
|
203
|
+
private _updated;
|
|
204
|
+
private _lockX;
|
|
205
|
+
private _lockY;
|
|
206
|
+
constructor(node: Node<any>, newBox: Dimensions);
|
|
207
|
+
cancel(): void;
|
|
208
|
+
get current(): Dimensions;
|
|
209
|
+
get cancelled(): boolean;
|
|
210
|
+
get(): Dimensions;
|
|
211
|
+
lockX(): void;
|
|
212
|
+
lockY(): void;
|
|
213
|
+
update(box: Dimensions): void;
|
|
214
|
+
updateX(x: number): void;
|
|
215
|
+
updateY(y: number): void;
|
|
216
|
+
}
|
|
217
|
+
export declare class DDragNodeEvent extends DDragEvent {
|
|
218
|
+
src: Element;
|
|
219
|
+
proposals: NodePositionProposal[];
|
|
220
|
+
protected readonly __brand: void;
|
|
221
|
+
constructor(src: Element, proposals: NodePositionProposal[], originalEvent: AnyMouseEvent);
|
|
222
|
+
}
|
|
223
|
+
export declare class EdgePointPositionProposal {
|
|
224
|
+
readonly point: Coordinates;
|
|
225
|
+
readonly movedAxis: 'x' | 'y';
|
|
226
|
+
private _updated;
|
|
227
|
+
private _lockX;
|
|
228
|
+
private _lockY;
|
|
229
|
+
constructor(point: Coordinates, movedAxis: 'x' | 'y');
|
|
230
|
+
get current(): Coordinates;
|
|
231
|
+
get(): Coordinates;
|
|
232
|
+
lockX(): void;
|
|
233
|
+
lockY(): void;
|
|
234
|
+
update(point: Coordinates): void;
|
|
235
|
+
updateX(x: number): void;
|
|
236
|
+
updateY(y: number): void;
|
|
237
|
+
}
|
|
238
|
+
export declare class DDragEdgeSegmentEvent extends DDragEvent {
|
|
239
|
+
src: Element;
|
|
240
|
+
proposals: EdgePointPositionProposal[];
|
|
241
|
+
movedAxis: 'x' | 'y';
|
|
242
|
+
protected readonly __brand: void;
|
|
243
|
+
constructor(src: Element, proposals: EdgePointPositionProposal[], movedAxis: 'x' | 'y', originalEvent: AnyMouseEvent);
|
|
244
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
2
|
+
import { AnyMouseEvent } from './Events';
|
|
3
|
+
export declare class MouseInformation {
|
|
4
|
+
protected originalEvent: AnyMouseEvent;
|
|
5
|
+
constructor(originalEvent: AnyMouseEvent);
|
|
6
|
+
get button(): "right" | "left" | "none" | "middle" | "back" | "forward";
|
|
7
|
+
get position(): Coordinates;
|
|
8
|
+
get x(): number;
|
|
9
|
+
get y(): number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { TGatewayState } from '../types';
|
|
2
|
+
import { Edge } from './Edge';
|
|
3
|
+
import { Node } from './Node';
|
|
4
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
5
|
+
import { Element } from './Element';
|
|
6
|
+
export declare class Gateway extends Element {
|
|
7
|
+
parent: Node<any>;
|
|
8
|
+
state: TGatewayState;
|
|
9
|
+
constructor(parent: Node<any>, state: Pick<TGatewayState, 'maxIncomingConnections' | 'maxOutgoingConnections' | 'orientation' | 'id'> & Partial<TGatewayState>);
|
|
10
|
+
addIncomingEdge(edge: Edge): void;
|
|
11
|
+
addOutgoingEdge(edge: Edge): void;
|
|
12
|
+
canConnect(from: Gateway): boolean;
|
|
13
|
+
connectionDisplacement(c: Coordinates): Coordinates;
|
|
14
|
+
connectionDistance(c: Coordinates): number;
|
|
15
|
+
removeIncomingEdge(edge: Edge): void;
|
|
16
|
+
removeOutgoingEdge(edge: Edge): void;
|
|
17
|
+
get coordinates(): Coordinates;
|
|
18
|
+
get fill(): string | undefined;
|
|
19
|
+
get diagram(): import('../Diagram').Diagram;
|
|
20
|
+
get incomingEdges(): Edge[];
|
|
21
|
+
get outgoingEdges(): Edge[];
|
|
22
|
+
get radius(): number;
|
|
23
|
+
get relativePosition(): Coordinates;
|
|
24
|
+
get stroke(): string | undefined;
|
|
25
|
+
get strokeWidth(): number;
|
|
26
|
+
get id(): string;
|
|
27
|
+
get direction(): "horizontal" | "vertical";
|
|
28
|
+
get orientation(): import('../types').TOrientation;
|
|
29
|
+
recomputeConnectedEdge(edge: Edge, _movedSide: 'from' | 'to'): void;
|
|
30
|
+
updateEdges(): void;
|
|
31
|
+
get remainingSlots(): number;
|
|
32
|
+
deserialize(c: ReturnType<(typeof this)['serialize']>): void;
|
|
33
|
+
serialize(): {
|
|
34
|
+
coordinates: [number, number];
|
|
35
|
+
fill: string | undefined;
|
|
36
|
+
id: string;
|
|
37
|
+
orientation: import('../types').TOrientation;
|
|
38
|
+
radius: number;
|
|
39
|
+
stroke: string | undefined;
|
|
40
|
+
strokeWidth: number;
|
|
41
|
+
outEdges: {
|
|
42
|
+
arrowHeadEnd: import('../types').EdgeArrowHead | undefined;
|
|
43
|
+
arrowHeadStart: import('../types').EdgeArrowHead | undefined;
|
|
44
|
+
displacementEnd: [number, number] | undefined;
|
|
45
|
+
displacementStart: [number, number] | undefined;
|
|
46
|
+
lineStyle: import('../types').EdgeLineStyle | undefined;
|
|
47
|
+
pathType: import('../types').EdgePathType | undefined;
|
|
48
|
+
steps: import('./EdgePoint').TSerializedEdgePoint[];
|
|
49
|
+
stroke: string | undefined;
|
|
50
|
+
strokeWidth: number | undefined;
|
|
51
|
+
to: string;
|
|
52
|
+
toParentId: string;
|
|
53
|
+
class: string;
|
|
54
|
+
}[];
|
|
55
|
+
class: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TOrientation, TNodeState } from '../types';
|
|
2
|
+
import { Dimensions } from '../primitives/Dimensions';
|
|
3
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
4
|
+
import { Diagram } from '../Diagram';
|
|
5
|
+
import { Gateway } from './Gateway';
|
|
6
|
+
import { Element } from './Element';
|
|
7
|
+
import { ClassList } from '../../util/ClassList';
|
|
8
|
+
import { FC } from 'react';
|
|
9
|
+
export type TNodeConstructorProps = Pick<TNodeState, 'id' | 'label'> & Partial<TNodeState>;
|
|
10
|
+
export declare class Node<Gateways = TOrientation> extends Element {
|
|
11
|
+
protected _gateways: Map<Gateways, Gateway>;
|
|
12
|
+
state: TNodeState;
|
|
13
|
+
readonly classList: ClassList;
|
|
14
|
+
get selected(): boolean | undefined;
|
|
15
|
+
constructor(parent: Element | null, state: TNodeConstructorProps);
|
|
16
|
+
canSelect(): boolean;
|
|
17
|
+
canUnselect(): boolean;
|
|
18
|
+
setDiagram(d: Diagram): void;
|
|
19
|
+
setState<K extends keyof TNodeState>(prop: K, value: TNodeState[K]): void;
|
|
20
|
+
protected initializeGateways(): void;
|
|
21
|
+
get box(): Dimensions;
|
|
22
|
+
get coordinates(): Coordinates;
|
|
23
|
+
displace(howMuch: Coordinates): void;
|
|
24
|
+
get id(): string;
|
|
25
|
+
get gateways(): Gateway[];
|
|
26
|
+
protected dragEventMouseStartPosition: Coordinates | null;
|
|
27
|
+
protected dragEventStartPosition: Coordinates | null;
|
|
28
|
+
getGateway(which: Gateways): Gateway | undefined;
|
|
29
|
+
setDimentions(c: Coordinates | [number, number]): void;
|
|
30
|
+
private updateConnectedEdges;
|
|
31
|
+
setPosition(c: Coordinates, options?: {
|
|
32
|
+
updateConnectedEdges?: boolean;
|
|
33
|
+
}): void;
|
|
34
|
+
deserialize(o: ReturnType<(typeof this)['serialize']>): void;
|
|
35
|
+
serialize(): {
|
|
36
|
+
box: [number, number, number, number];
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
movable: boolean | undefined;
|
|
40
|
+
selectable: boolean | undefined;
|
|
41
|
+
selected: boolean | undefined;
|
|
42
|
+
gateways: {
|
|
43
|
+
coordinates: [number, number];
|
|
44
|
+
fill: string | undefined;
|
|
45
|
+
id: string;
|
|
46
|
+
orientation: TOrientation;
|
|
47
|
+
radius: number;
|
|
48
|
+
stroke: string | undefined;
|
|
49
|
+
strokeWidth: number;
|
|
50
|
+
outEdges: {
|
|
51
|
+
arrowHeadEnd: import('../types').EdgeArrowHead | undefined;
|
|
52
|
+
arrowHeadStart: import('../types').EdgeArrowHead | undefined;
|
|
53
|
+
displacementEnd: [number, number] | undefined;
|
|
54
|
+
displacementStart: [number, number] | undefined;
|
|
55
|
+
lineStyle: import('../types').EdgeLineStyle | undefined;
|
|
56
|
+
pathType: import('../types').EdgePathType | undefined;
|
|
57
|
+
steps: import('./EdgePoint').TSerializedEdgePoint[];
|
|
58
|
+
stroke: string | undefined;
|
|
59
|
+
strokeWidth: number | undefined;
|
|
60
|
+
to: string;
|
|
61
|
+
toParentId: string;
|
|
62
|
+
class: string;
|
|
63
|
+
}[];
|
|
64
|
+
class: string;
|
|
65
|
+
}[];
|
|
66
|
+
fill: string | undefined;
|
|
67
|
+
labelFontSize: number | undefined;
|
|
68
|
+
stroke: string | undefined;
|
|
69
|
+
strokewWidth: number | undefined;
|
|
70
|
+
class: string;
|
|
71
|
+
};
|
|
72
|
+
Renderer: FC | null;
|
|
73
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DClickEvent } from '../elements/Events';
|
|
2
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
3
|
+
export type TCreationMode = 'none' | 'text';
|
|
4
|
+
export declare class Creator extends DiagramExtension {
|
|
5
|
+
creationMode: TCreationMode;
|
|
6
|
+
init(): void;
|
|
7
|
+
protected getId(): string;
|
|
8
|
+
handleClick(ev: DClickEvent): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Diagram } from '../Diagram';
|
|
2
|
+
import { Element } from '../elements/Element';
|
|
3
|
+
export declare abstract class DiagramExtension extends Element {
|
|
4
|
+
parent: Diagram;
|
|
5
|
+
constructor(parent: Diagram);
|
|
6
|
+
abstract init(): void;
|
|
7
|
+
get diagram(): Diagram;
|
|
8
|
+
protected _enable: boolean;
|
|
9
|
+
get enabled(): boolean;
|
|
10
|
+
disable(): void;
|
|
11
|
+
enable(): void;
|
|
12
|
+
toggle(newValue?: boolean): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
2
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
3
|
+
type Proposal = {
|
|
4
|
+
from: Coordinates;
|
|
5
|
+
to: Coordinates;
|
|
6
|
+
};
|
|
7
|
+
export declare class DistancesBalancer extends DiagramExtension {
|
|
8
|
+
private gridSize;
|
|
9
|
+
proposals: Proposal[];
|
|
10
|
+
clear(): void;
|
|
11
|
+
init(): void;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Diagram } from '../Diagram';
|
|
2
|
+
import { Node } from '../elements/Node';
|
|
3
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
4
|
+
import { DMouseDownEvent, DMouseMoveEvent, DScaleEvent } from '../elements/Events';
|
|
5
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
6
|
+
/**
|
|
7
|
+
* Conditions for dragging:
|
|
8
|
+
*
|
|
9
|
+
* - The mouse down must have been done in a node
|
|
10
|
+
* - The selection mode isn't enabled
|
|
11
|
+
* - The mouse button is the left click
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
*/
|
|
15
|
+
export declare class Dragger extends DiagramExtension {
|
|
16
|
+
private dragThreshold;
|
|
17
|
+
/**
|
|
18
|
+
* childId -> parentId, built at drag start for grouped nodes.
|
|
19
|
+
*/
|
|
20
|
+
private groupedChildren;
|
|
21
|
+
init(): void;
|
|
22
|
+
constructor(parent: Diagram);
|
|
23
|
+
protected draggingNodes: Map<string, {
|
|
24
|
+
node: Node<any>;
|
|
25
|
+
startPoint: Coordinates;
|
|
26
|
+
}>;
|
|
27
|
+
protected startPoint: Coordinates;
|
|
28
|
+
protected startPointScaled: Coordinates;
|
|
29
|
+
protected mousePoint: Coordinates;
|
|
30
|
+
protected unsubscribe: () => void;
|
|
31
|
+
startDrag(node: Node, mousePoint?: Coordinates): void;
|
|
32
|
+
protected originalEvent: DMouseDownEvent | null;
|
|
33
|
+
protected handleMouseDown(ev: DMouseDownEvent): void;
|
|
34
|
+
protected handleMouseMove(ev: DMouseMoveEvent): void;
|
|
35
|
+
protected handleDragAction(): void;
|
|
36
|
+
private calcDisplacement;
|
|
37
|
+
private isFullyContained;
|
|
38
|
+
private collectConnectedEdges;
|
|
39
|
+
private translateEdge;
|
|
40
|
+
private updateEdgesAfterBatchMove;
|
|
41
|
+
private applyNodePositionProposals;
|
|
42
|
+
private includeGroupedChildren;
|
|
43
|
+
protected handleDragInterval(): void;
|
|
44
|
+
protected handleMouseUp(): void;
|
|
45
|
+
protected handleScale(_ev: DScaleEvent): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
2
|
+
import { Midpoint } from '../../components/objects/RenderEdge';
|
|
3
|
+
import { EdgePoint } from '../elements/EdgePoint';
|
|
4
|
+
import { Edge } from '../elements/Edge';
|
|
5
|
+
import { AnyMouseEvent, DEdgeDragStartEvent, DEdgeEndpointDragStartEvent } from '../elements/Events';
|
|
6
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
7
|
+
type DragContext = {
|
|
8
|
+
edge: Edge;
|
|
9
|
+
midpoint: Midpoint;
|
|
10
|
+
pointA: EdgePoint;
|
|
11
|
+
pointB: EdgePoint;
|
|
12
|
+
movedAxis: 'x' | 'y';
|
|
13
|
+
startMouseCanvas: Coordinates;
|
|
14
|
+
startPointA: Coordinates;
|
|
15
|
+
startPointB: Coordinates;
|
|
16
|
+
originalSteps: EdgePoint[];
|
|
17
|
+
sourceLeadAdjacent: boolean;
|
|
18
|
+
targetLeadAdjacent: boolean;
|
|
19
|
+
staticBoundaryGuarded: boolean;
|
|
20
|
+
changed: boolean;
|
|
21
|
+
};
|
|
22
|
+
type EndpointDragContext = {
|
|
23
|
+
edge: Edge;
|
|
24
|
+
endpoint: 'from' | 'to';
|
|
25
|
+
};
|
|
26
|
+
type EdgeEndSide = 'from' | 'to';
|
|
27
|
+
type PreparedSegment = {
|
|
28
|
+
pointA: EdgePoint;
|
|
29
|
+
pointB: EdgePoint;
|
|
30
|
+
movedAxis: 'x' | 'y';
|
|
31
|
+
};
|
|
32
|
+
export declare class EdgesDragger extends DiagramExtension {
|
|
33
|
+
protected drag: DragContext | null;
|
|
34
|
+
protected endpointDrag: EndpointDragContext | null;
|
|
35
|
+
protected uns: () => void;
|
|
36
|
+
init(): void;
|
|
37
|
+
protected almostEqual(a: number, b: number): boolean;
|
|
38
|
+
protected pointMatches(a: Coordinates, b: Coordinates): boolean;
|
|
39
|
+
protected axisAligned(a: Coordinates, b: Coordinates): boolean;
|
|
40
|
+
protected pointsNear(a: Coordinates, b: Coordinates, epsilon?: number): boolean;
|
|
41
|
+
protected isActivePoint(point: EdgePoint): boolean;
|
|
42
|
+
protected getGridSize(): number;
|
|
43
|
+
protected orientationVector(orientation: 'up' | 'down' | 'left' | 'right'): {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
protected axisPerpendicularToGateway(orientation: 'up' | 'down' | 'left' | 'right'): 'x' | 'y';
|
|
48
|
+
protected expectedLeadPoint(edge: Edge, side: EdgeEndSide): Coordinates;
|
|
49
|
+
protected leadMatchesGatewaySide(endpoint: Coordinates, lead: Coordinates, orientation: 'up' | 'down' | 'left' | 'right'): boolean;
|
|
50
|
+
protected endpointLeadPoint(edge: Edge, side: EdgeEndSide): Coordinates | EdgePoint;
|
|
51
|
+
protected ensureEndpointLeadPoint(edge: Edge, side: EdgeEndSide): number;
|
|
52
|
+
protected ensureEndpointLeads(edge: Edge): void;
|
|
53
|
+
protected isProtectedLeadPoint(edge: Edge, index: number): boolean;
|
|
54
|
+
protected segmentMovedAxis(a: Coordinates, b: Coordinates): 'x' | 'y';
|
|
55
|
+
protected segmentDirection(a: Coordinates, b: Coordinates): "horizontal" | "vertical" | null;
|
|
56
|
+
protected segmentIsParallelToDraggedAxis(a: Coordinates, b: Coordinates): boolean;
|
|
57
|
+
protected perpendicularAxis(axis: 'x' | 'y'): 'x' | 'y';
|
|
58
|
+
protected pointAxis(point: Coordinates, axis: 'x' | 'y'): number;
|
|
59
|
+
protected setPointAxis(point: Coordinates, axis: 'x' | 'y', value: number): void;
|
|
60
|
+
protected crossesStaticBoundary(orientation: 'up' | 'down' | 'left' | 'right', movedAxis: 'x' | 'y', point: Coordinates, boundary: Coordinates, threshold?: number): boolean;
|
|
61
|
+
protected copyAsManual(point: EdgePoint, axis?: 'x' | 'y' | 'both'): EdgePoint;
|
|
62
|
+
protected markManual(point: EdgePoint, axis?: 'x' | 'y' | 'both'): void;
|
|
63
|
+
protected clampPointPastLead(point: EdgePoint, lead: Coordinates, orientation: 'up' | 'down' | 'left' | 'right'): void;
|
|
64
|
+
protected movedAxisMatchesOrientation(movedAxis: 'x' | 'y', orientation: 'up' | 'down' | 'left' | 'right'): boolean;
|
|
65
|
+
protected edgePointAt(edge: Edge, x: number, y: number, mode?: 'auto' | 'manual' | 'static'): EdgePoint;
|
|
66
|
+
protected guardCoordinate(edge: Edge, side: EdgeEndSide, lead: Coordinates, oppositePoint: Coordinates, perpendicularAxis: 'x' | 'y'): number;
|
|
67
|
+
protected makeGuardCorner(edge: Edge, lead: Coordinates, guardCoordinate: number, movedAxis: 'x' | 'y'): EdgePoint;
|
|
68
|
+
protected insertStaticBoundaryGuard(side: EdgeEndSide): boolean;
|
|
69
|
+
protected insertStaticBoundaryGuards(): boolean;
|
|
70
|
+
protected clampDraggedSegmentAgainstEndpointLeads(): void;
|
|
71
|
+
protected mergeDraggedSegmentWithManualNeighbors(): boolean;
|
|
72
|
+
protected rebaseDraggedEndpointFixedAxis(side: 'pointA' | 'pointB', point: EdgePoint): void;
|
|
73
|
+
protected replaceDraggedEndpointWithProtectedLeadDuplicate(side: 'pointA' | 'pointB', lead: EdgePoint, replacedIndex: number): void;
|
|
74
|
+
protected absorbCollinearSegmentsIntoDraggedSegment(): boolean;
|
|
75
|
+
protected removeAdjacentDuplicates(preserveActivePoints: boolean): boolean;
|
|
76
|
+
protected coordinateAnchorForPair(a: EdgePoint, b: EdgePoint, axis: 'x' | 'y', aIndex: number): number;
|
|
77
|
+
protected snapNearlyAlignedDraggedPairs(): boolean;
|
|
78
|
+
protected chooseOrthogonalCorner(from: EdgePoint, to: EdgePoint, previous?: EdgePoint, next?: EdgePoint): EdgePoint;
|
|
79
|
+
protected ensureOrthogonalAdjacency(): boolean;
|
|
80
|
+
protected normalizeDraggedEdge(): boolean;
|
|
81
|
+
protected finalizeDraggedEdge(): void;
|
|
82
|
+
protected prepareStraightLeadSegment(edge: Edge, movedAxis: 'x' | 'y'): {
|
|
83
|
+
pointA: EdgePoint;
|
|
84
|
+
pointB: EdgePoint;
|
|
85
|
+
movedAxis: "x" | "y";
|
|
86
|
+
};
|
|
87
|
+
protected prepareSourceSegment(edge: Edge): PreparedSegment | null;
|
|
88
|
+
protected prepareTargetSegment(edge: Edge): PreparedSegment | null;
|
|
89
|
+
protected prepareSegmentAfterProtectedSourceLead(edge: Edge, leadIndex: number): PreparedSegment | null;
|
|
90
|
+
protected prepareSegmentBeforeProtectedTargetLead(edge: Edge, leadIndex: number): PreparedSegment | null;
|
|
91
|
+
protected prepareInteriorSegment(edge: Edge, pointA: EdgePoint, pointB: EdgePoint, fallbackSegmentIndex: number): PreparedSegment | null;
|
|
92
|
+
protected restoreOriginalSteps(edge: Edge, steps: EdgePoint[]): void;
|
|
93
|
+
startDrag(ev: DEdgeDragStartEvent): void;
|
|
94
|
+
startEndpointDrag(ev: DEdgeEndpointDragStartEvent): void;
|
|
95
|
+
protected scheduleEndpointRecompute(): void;
|
|
96
|
+
protected handleEndpointMouseMove(ev: AnyMouseEvent): void;
|
|
97
|
+
protected moveDraggedSegment(ev: AnyMouseEvent): void;
|
|
98
|
+
protected handleMouseMove(ev: AnyMouseEvent): void;
|
|
99
|
+
protected handleMouseUp(): void;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
2
|
+
export declare class History extends DiagramExtension {
|
|
3
|
+
private readonly windowTime;
|
|
4
|
+
private readonly maxSize;
|
|
5
|
+
private index;
|
|
6
|
+
private snapshots;
|
|
7
|
+
private avoidEvents;
|
|
8
|
+
unbind: () => void;
|
|
9
|
+
private window;
|
|
10
|
+
redo(): void;
|
|
11
|
+
undo(): void;
|
|
12
|
+
get hasNext(): boolean;
|
|
13
|
+
get hasPrevious(): boolean;
|
|
14
|
+
init(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DKeyDownEvent } from '../elements/Events';
|
|
2
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
3
|
+
import { Callback } from '../elements/Element';
|
|
4
|
+
export type THotKey = Partial<{
|
|
5
|
+
code: string;
|
|
6
|
+
shift: boolean;
|
|
7
|
+
ctrl: boolean;
|
|
8
|
+
alt: boolean;
|
|
9
|
+
}> & {
|
|
10
|
+
cb: Callback<DKeyDownEvent>;
|
|
11
|
+
};
|
|
12
|
+
export declare class Hotkeys extends DiagramExtension {
|
|
13
|
+
hotkeys: THotKey[];
|
|
14
|
+
private isEditableTarget;
|
|
15
|
+
private shouldIgnoreHotkeys;
|
|
16
|
+
private get measurer();
|
|
17
|
+
private get selector();
|
|
18
|
+
private match;
|
|
19
|
+
init(): void;
|
|
20
|
+
register(hotkey: THotKey): () => void;
|
|
21
|
+
protected revertHotkey: Map<string, () => unknown>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
2
|
+
import { AnyMouseEvent, DMouseDownEvent } from '../elements/Events';
|
|
3
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
4
|
+
export declare class Measurer extends DiagramExtension {
|
|
5
|
+
init(): void;
|
|
6
|
+
protected _enabled: boolean;
|
|
7
|
+
toggle(): void;
|
|
8
|
+
get enabled(): boolean;
|
|
9
|
+
protected endPoint: Coordinates | null;
|
|
10
|
+
protected startPoint: Coordinates | null;
|
|
11
|
+
get(): Coordinates[];
|
|
12
|
+
getMeassurement(): number | undefined;
|
|
13
|
+
u: () => void;
|
|
14
|
+
protected handleMouseDown(ev: DMouseDownEvent): void;
|
|
15
|
+
protected handleMouseMove(ev: AnyMouseEvent): void;
|
|
16
|
+
protected handleMouseUp(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
2
|
+
type Proposal = {
|
|
3
|
+
type: 'v';
|
|
4
|
+
y: number;
|
|
5
|
+
range: [number, number];
|
|
6
|
+
id: string;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'h';
|
|
9
|
+
x: number;
|
|
10
|
+
range: [number, number];
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class NodesAligner extends DiagramExtension {
|
|
14
|
+
private gridSize;
|
|
15
|
+
proposals: Proposal[];
|
|
16
|
+
clear(): void;
|
|
17
|
+
init(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|