@focus.matters/diagrams 0.0.9 → 0.1.0
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/{DirectedPoint-HRgiLZeU.js → DirectedPoint-BcpEj8ub.js} +2 -2
- package/dist/DirectedPoint-BcpEj8ub.js.map +1 -0
- package/dist/diagrams.css +1 -1
- package/dist/index-hTkL5cDr.js +12037 -0
- package/dist/index-hTkL5cDr.js.map +1 -0
- package/dist/index.d.ts +1 -8
- package/dist/index.es.js +8 -6
- package/dist/index.umd.js +5 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/{Diagrams → src/Diagrams}/components/Canvas.d.ts +1 -0
- package/dist/src/Diagrams/components/extensions/RenderDiagramExtensions.d.ts +4 -0
- package/dist/src/Diagrams/components/extensions/RenderUIExtensions.d.ts +4 -0
- package/dist/{Diagrams → src/Diagrams}/components/extra/AlignmentSuggestions.d.ts +1 -0
- package/dist/{Diagrams → src/Diagrams}/components/extra/GatewayRender.d.ts +1 -0
- package/dist/src/Diagrams/components/extra/NodeGatewayRender.d.ts +6 -0
- package/dist/src/Diagrams/components/objects/CustomRenderers.d.ts +4 -0
- package/dist/src/Diagrams/components/objects/EdgeLabels.d.ts +7 -0
- package/dist/{Diagrams → src/Diagrams}/components/objects/RenderEdge/EdgeMarker.d.ts +1 -0
- package/dist/src/Diagrams/components/objects/RenderEdge/buildEdgePath.d.ts +5 -0
- package/dist/{Diagrams → src/Diagrams}/components/objects/RenderEdge/debugEdges.d.ts +4 -4
- package/dist/{Diagrams → src/Diagrams}/components/objects/RenderEdge/index.d.ts +1 -0
- package/dist/{Diagrams → src/Diagrams}/components/objects/RenderEdge/types.d.ts +3 -2
- package/dist/src/Diagrams/components/objects/ScreenRenderers.d.ts +4 -0
- package/dist/{Diagrams → src/Diagrams}/components/objects/Shape.d.ts +3 -3
- package/dist/src/Diagrams/components/objects/Shapes.d.ts +2 -0
- package/dist/{Diagrams → src/Diagrams}/components/objects/customRendererProps.d.ts +1 -1
- package/dist/src/Diagrams/components/objects/edgeLabelPlacement.d.ts +4 -0
- package/dist/src/Diagrams/components/objects/screenRendererProps.d.ts +18 -0
- package/dist/{Diagrams → src/Diagrams}/custom/agent/edges/AgentEdge.d.ts +20 -2
- package/dist/{Diagrams → src/Diagrams}/custom/agent/nodes/ActionNode.d.ts +1 -1
- package/dist/{Diagrams → src/Diagrams}/custom/agent/nodes/AgentNode.d.ts +21 -2
- package/dist/{Diagrams → src/Diagrams}/custom/agent/nodes/ConditionNode.d.ts +1 -1
- package/dist/{Diagrams → src/Diagrams}/custom/agent/nodes/OutcomeNode.d.ts +1 -1
- package/dist/{Diagrams → src/Diagrams}/custom/agent/nodes/TriggerNode.d.ts +1 -1
- package/dist/{Diagrams → src/Diagrams}/custom/agent/types.d.ts +6 -6
- package/dist/src/Diagrams/custom/bpmn/BPMDiagram.d.ts +14 -0
- package/dist/src/Diagrams/custom/bpmn/bpmnEvents.d.ts +4 -0
- package/dist/src/Diagrams/custom/bpmn/config/BPMNElementCatalog.d.ts +26 -0
- package/dist/src/Diagrams/custom/bpmn/config/BPMNLabels.d.ts +27 -0
- package/dist/src/Diagrams/custom/bpmn/edges/BPMNEdge.d.ts +77 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNArtifactTransformer.d.ts +5 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNEventAttachments.d.ts +19 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNGridSnap.d.ts +23 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNLaneResizer.d.ts +20 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNModelerExtension.d.ts +97 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNNodeResizer.d.ts +31 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNPropertyChangeEvent.d.ts +4 -0
- package/dist/src/Diagrams/custom/bpmn/extensions/BPMNResizeSuggester.d.ts +23 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/BPMNEventDefinition.d.ts +28 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/BPMNode.d.ts +15 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/BlackBoxPoolNode.d.ts +17 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/DataStoreNode.d.ts +14 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/DocumentAnnotationNode.d.ts +19 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/DocumentNode.d.ts +13 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/EventNode.d.ts +130 -0
- package/dist/{Diagrams → src/Diagrams}/custom/bpmn/nodes/GateNode.d.ts +30 -3
- package/dist/src/Diagrams/custom/bpmn/nodes/Lanes/LaneScreenRenderer.d.ts +6 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/Lanes/index.d.ts +131 -0
- package/dist/src/Diagrams/custom/bpmn/nodes/TaskNode.d.ts +114 -0
- package/dist/{Diagrams/custom/bpmn/nodes/EventNode.d.ts → src/Diagrams/custom/bpmn/nodes/TextAnnotationNode.d.ts} +33 -16
- package/dist/{Diagrams → src/Diagrams}/custom/bpmn/nodes/UnknownBPMNNode.d.ts +22 -3
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNDiagramControls.d.ts +6 -0
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNElementMenu.d.ts +11 -0
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNIcon.d.ts +9 -0
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNPropertiesPanel.d.ts +6 -0
- package/dist/src/Diagrams/custom/bpmn/ui/BPMNResizeHandle.d.ts +7 -0
- package/dist/src/Diagrams/custom/bpmn/ui/resolveToolbarMenuPlacement.d.ts +18 -0
- package/dist/src/Diagrams/custom/bpmn/ui/resolveVisibleEdgeToolbarAnchor.d.ts +4 -0
- package/dist/src/Diagrams/custom/communication/edges/CommunicationEdge.d.ts +9 -0
- package/dist/{Diagrams → src/Diagrams}/custom/communication/nodes/CommunicationActorNode.d.ts +1 -1
- package/dist/{Diagrams → src/Diagrams}/custom/communication/nodes/CommunicationControllerNode.d.ts +1 -1
- package/dist/{Diagrams → src/Diagrams}/custom/communication/nodes/CommunicationObjectNode.d.ts +1 -1
- package/dist/src/Diagrams/custom/communication/types.d.ts +1 -0
- package/dist/src/Diagrams/custom/editable/EditableLabel.d.ts +8 -0
- package/dist/src/Diagrams/custom/editable/EditableNode.d.ts +21 -0
- package/dist/{Diagrams → src/Diagrams}/store/Canvas.d.ts +16 -6
- package/dist/{Diagrams → src/Diagrams}/store/Diagram.d.ts +77 -19
- package/dist/src/Diagrams/store/elements/DEdgeLabelChangeEvent.d.ts +5 -0
- package/dist/src/Diagrams/store/elements/Edge.d.ts +92 -0
- package/dist/src/Diagrams/store/elements/EdgeLabel.d.ts +64 -0
- package/dist/{Diagrams → src/Diagrams}/store/elements/EdgePoint.d.ts +4 -4
- package/dist/{Diagrams → src/Diagrams}/store/elements/Events.d.ts +11 -11
- package/dist/{Diagrams → src/Diagrams}/store/elements/Gateway.d.ts +27 -7
- package/dist/src/Diagrams/store/elements/Node.d.ts +143 -0
- package/dist/{Diagrams → src/Diagrams}/store/extensions/Creator.d.ts +1 -1
- package/dist/src/Diagrams/store/extensions/DiagramExtension.d.ts +23 -0
- package/dist/{Diagrams → src/Diagrams}/store/extensions/DistancesBalancer.d.ts +7 -1
- package/dist/{Diagrams → src/Diagrams}/store/extensions/Dragger.d.ts +20 -5
- package/dist/{Diagrams → src/Diagrams}/store/extensions/EdgesDragger.d.ts +38 -27
- package/dist/src/Diagrams/store/extensions/History.d.ts +23 -0
- package/dist/{Diagrams → src/Diagrams}/store/extensions/Hotkeys.d.ts +4 -1
- package/dist/src/Diagrams/store/extensions/LabelsAligner.d.ts +21 -0
- package/dist/src/Diagrams/store/extensions/NodesAligner.d.ts +46 -0
- package/dist/src/Diagrams/store/extensions/NodesConnector.d.ts +56 -0
- package/dist/{Diagrams → src/Diagrams}/store/extensions/Priorities.d.ts +2 -1
- package/dist/{Diagrams → src/Diagrams}/store/extensions/Rules.d.ts +6 -1
- package/dist/{Diagrams → src/Diagrams}/store/extensions/Selector.d.ts +18 -5
- package/dist/{Diagrams → src/Diagrams}/store/extensions/StraightDrag.d.ts +3 -0
- package/dist/src/Diagrams/store/extensions/StraightLabelsDrag.d.ts +10 -0
- package/dist/src/Diagrams/store/extensions/nodePositionProposalRanking.d.ts +8 -0
- package/dist/{Diagrams → src/Diagrams}/store/primitives/Coordinates.d.ts +1 -1
- package/dist/src/Diagrams/store/routers/CurvedRouter.d.ts +13 -0
- package/dist/src/Diagrams/store/routers/EdgesRouter.d.ts +21 -0
- package/dist/src/Diagrams/store/routers/OrthogonalRouter.d.ts +16 -0
- package/dist/src/Diagrams/store/routers/StraightRouter.d.ts +13 -0
- package/dist/src/Diagrams/store/routers/cardinalAxisConstraint.d.ts +7 -0
- package/dist/src/Diagrams/store/routers/getEdgesRouter.d.ts +4 -0
- package/dist/src/Diagrams/store/routers/resolveConnectionCandidate.d.ts +22 -0
- package/dist/{Diagrams → src/Diagrams}/store/types.d.ts +18 -9
- package/dist/src/Diagrams/util/Autopan.d.ts +14 -0
- package/dist/{Diagrams → src/Diagrams}/util/bpmn/applyBPMNImportPlan.d.ts +1 -0
- package/dist/{Diagrams → src/Diagrams}/util/bpmn/buildBPMNImportPlan.d.ts +1 -1
- package/dist/{Diagrams → src/Diagrams}/util/bpmn/index.d.ts +2 -1
- package/dist/src/Diagrams/util/bpmn/sanitizeId.d.ts +2 -0
- package/dist/{Diagrams → src/Diagrams}/util/bpmn/types.d.ts +2 -1
- package/dist/{Diagrams → src/Diagrams}/util/paths/orthogonalRouter.d.ts +2 -0
- package/dist/src/index.d.ts +11 -0
- package/package.json +1 -1
- package/dist/Diagrams/components/objects/CustomRenderers.d.ts +0 -6
- package/dist/Diagrams/components/objects/Shapes.d.ts +0 -1
- package/dist/Diagrams/custom/bpmn/BPMDiagram.d.ts +0 -5
- package/dist/Diagrams/custom/bpmn/bpmnEvents.d.ts +0 -3
- package/dist/Diagrams/custom/bpmn/nodes/BPMNode.d.ts +0 -6
- package/dist/Diagrams/custom/bpmn/nodes/Lanes/LanesResizer.d.ts +0 -6
- package/dist/Diagrams/custom/bpmn/nodes/Lanes/index.d.ts +0 -66
- package/dist/Diagrams/custom/bpmn/nodes/TaskNode.d.ts +0 -9
- package/dist/Diagrams/custom/communication/edges/CommunicationEdge.d.ts +0 -35
- package/dist/Diagrams/custom/communication/types.d.ts +0 -1
- package/dist/Diagrams/custom/editable/EditableLabel.d.ts +0 -3
- package/dist/Diagrams/custom/editable/EditableNode.d.ts +0 -15
- package/dist/Diagrams/custom/editable/EditableNodeContext.d.ts +0 -3
- package/dist/Diagrams/store/elements/Edge.d.ts +0 -42
- package/dist/Diagrams/store/elements/Node.d.ts +0 -73
- package/dist/Diagrams/store/extensions/DiagramExtension.d.ts +0 -13
- package/dist/Diagrams/store/extensions/History.d.ts +0 -15
- package/dist/Diagrams/store/extensions/NodesAligner.d.ts +0 -19
- package/dist/Diagrams/store/extensions/NodesConnector.d.ts +0 -27
- package/dist/Diagrams/util/paths/findBestPathBetweenNodes.d.ts +0 -8
- package/dist/DirectedPoint-HRgiLZeU.js.map +0 -1
- package/dist/index-DZNvKq1b.js +0 -6657
- package/dist/index-DZNvKq1b.js.map +0 -1
- /package/dist/{Diagrams → src/Diagrams}/DiagramEditor.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/Measurement.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/MouseTracker.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/NodesConnectorRenderer.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/PathFindingRenderer.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/Selection.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/Stats.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/Svg.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/Theme.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/extra/ToolsState.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/nodes/NodeTools.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/objects/Cross.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/objects/Grid.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/objects/RenderEdge/EdgeMidpoints.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/objects/RenderEdge/util.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/components/objects/makeScalableComponent.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/context-menu/ContextMenu.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/context-menu/buildDiagramContextMenu.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/context-menu/index.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/context-menu/types.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/agent/AgentDiagram.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/agent/index.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/bpmn/edges/EdgeWithLoad.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/bpmn/nodes/BPMNNodeContext.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/communication/CommunicationDiagram.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/communication/CommunicationNode.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/editable/EditableDiagram.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/editable/EditionMode.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/custom/editable/events.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/layout/HStack.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/elements/Element.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/elements/EventsMouseInformation.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/elements/TextNode.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/extensions/Debugger.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/extensions/GridSnap.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/extensions/Measurer.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/extensions/NodesResizer.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/extensions/PathFindingRenderer.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/primitives/Dimensions.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/store/primitives/DirectedPoint.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/ClassList.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/Mouse.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/Mutex.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/PriorityQueue.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/Semaphore.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/TasksQueue.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/arrayOrArray.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/awaitTime.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/binders.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/bpmn/importBPMNXmlIntoDiagram.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/bpmn/parseBPMNXml.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/cloneDeep.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/downloadFile.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/getEnumStr.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/getIdForNode.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/getUniqueId.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/insertSorted.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/paths/PathsGrid.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/paths/stepBackFromGateway.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/readFile.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/shapes.d.ts +0 -0
- /package/dist/{Diagrams → src/Diagrams}/util/throttle.d.ts +0 -0
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { Coordinates } from '../primitives/Coordinates';
|
|
2
1
|
import { Midpoint } from '../../components/objects/RenderEdge';
|
|
3
|
-
import { EdgePoint } from '../elements/EdgePoint';
|
|
4
2
|
import { Edge } from '../elements/Edge';
|
|
5
|
-
import {
|
|
3
|
+
import { EdgePoint } from '../elements/EdgePoint';
|
|
4
|
+
import { DEdgeDragStartEvent, DEdgeEndpointDragStartEvent, AnyMouseEvent } from '../elements/Events';
|
|
5
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
6
|
+
import { EdgeRouterAnchor } from '../routers/EdgesRouter';
|
|
7
|
+
import { ConnectionCandidate } from '../routers/resolveConnectionCandidate';
|
|
8
|
+
import { TEdgeAnchorState } from '../types';
|
|
6
9
|
import { DiagramExtension } from './DiagramExtension';
|
|
7
10
|
type DragContext = {
|
|
8
11
|
edge: Edge;
|
|
9
12
|
midpoint: Midpoint;
|
|
10
13
|
pointA: EdgePoint;
|
|
11
14
|
pointB: EdgePoint;
|
|
12
|
-
movedAxis:
|
|
15
|
+
movedAxis: "x" | "y";
|
|
13
16
|
startMouseCanvas: Coordinates;
|
|
14
17
|
startPointA: Coordinates;
|
|
15
18
|
startPointB: Coordinates;
|
|
@@ -21,18 +24,26 @@ type DragContext = {
|
|
|
21
24
|
};
|
|
22
25
|
type EndpointDragContext = {
|
|
23
26
|
edge: Edge;
|
|
24
|
-
endpoint:
|
|
27
|
+
endpoint: "from" | "to";
|
|
28
|
+
originalStart: EdgeRouterAnchor;
|
|
29
|
+
originalEnd: EdgeRouterAnchor;
|
|
30
|
+
originalStartState: TEdgeAnchorState;
|
|
31
|
+
originalEndState: TEdgeAnchorState;
|
|
32
|
+
candidate: ConnectionCandidate | null;
|
|
25
33
|
};
|
|
26
|
-
type EdgeEndSide =
|
|
34
|
+
type EdgeEndSide = "from" | "to";
|
|
27
35
|
type PreparedSegment = {
|
|
28
36
|
pointA: EdgePoint;
|
|
29
37
|
pointB: EdgePoint;
|
|
30
|
-
movedAxis:
|
|
38
|
+
movedAxis: "x" | "y";
|
|
31
39
|
};
|
|
32
40
|
export declare class EdgesDragger extends DiagramExtension {
|
|
41
|
+
private readonly autopan;
|
|
33
42
|
protected drag: DragContext | null;
|
|
34
43
|
protected endpointDrag: EndpointDragContext | null;
|
|
35
44
|
protected uns: () => void;
|
|
45
|
+
endpointDragActive: boolean;
|
|
46
|
+
endpointCandidatePoint: Coordinates | null;
|
|
36
47
|
init(): void;
|
|
37
48
|
protected almostEqual(a: number, b: number): boolean;
|
|
38
49
|
protected pointMatches(a: Coordinates, b: Coordinates): boolean;
|
|
@@ -40,46 +51,46 @@ export declare class EdgesDragger extends DiagramExtension {
|
|
|
40
51
|
protected pointsNear(a: Coordinates, b: Coordinates, epsilon?: number): boolean;
|
|
41
52
|
protected isActivePoint(point: EdgePoint): boolean;
|
|
42
53
|
protected getGridSize(): number;
|
|
43
|
-
protected orientationVector(orientation:
|
|
54
|
+
protected orientationVector(orientation: "up" | "down" | "left" | "right"): {
|
|
44
55
|
x: number;
|
|
45
56
|
y: number;
|
|
46
57
|
};
|
|
47
|
-
protected axisPerpendicularToGateway(orientation:
|
|
58
|
+
protected axisPerpendicularToGateway(orientation: "up" | "down" | "left" | "right"): "x" | "y";
|
|
48
59
|
protected expectedLeadPoint(edge: Edge, side: EdgeEndSide): Coordinates;
|
|
49
|
-
protected leadMatchesGatewaySide(endpoint: Coordinates, lead: Coordinates, orientation:
|
|
60
|
+
protected leadMatchesGatewaySide(endpoint: Coordinates, lead: Coordinates, orientation: "up" | "down" | "left" | "right"): boolean;
|
|
50
61
|
protected endpointLeadPoint(edge: Edge, side: EdgeEndSide): Coordinates | EdgePoint;
|
|
51
62
|
protected ensureEndpointLeadPoint(edge: Edge, side: EdgeEndSide): number;
|
|
52
63
|
protected ensureEndpointLeads(edge: Edge): void;
|
|
53
64
|
protected isProtectedLeadPoint(edge: Edge, index: number): boolean;
|
|
54
|
-
protected segmentMovedAxis(a: Coordinates, b: Coordinates):
|
|
65
|
+
protected segmentMovedAxis(a: Coordinates, b: Coordinates): "x" | "y";
|
|
55
66
|
protected segmentDirection(a: Coordinates, b: Coordinates): "horizontal" | "vertical" | null;
|
|
56
67
|
protected segmentIsParallelToDraggedAxis(a: Coordinates, b: Coordinates): boolean;
|
|
57
|
-
protected perpendicularAxis(axis:
|
|
58
|
-
protected pointAxis(point: Coordinates, axis:
|
|
59
|
-
protected setPointAxis(point: Coordinates, axis:
|
|
60
|
-
protected crossesStaticBoundary(orientation:
|
|
61
|
-
protected copyAsManual(point: EdgePoint, axis?:
|
|
62
|
-
protected markManual(point: EdgePoint, axis?:
|
|
63
|
-
protected clampPointPastLead(point: EdgePoint, lead: Coordinates, orientation:
|
|
64
|
-
protected movedAxisMatchesOrientation(movedAxis:
|
|
65
|
-
protected edgePointAt(edge: Edge, x: number, y: number, mode?:
|
|
66
|
-
protected guardCoordinate(edge: Edge, side: EdgeEndSide, lead: Coordinates, oppositePoint: Coordinates, perpendicularAxis:
|
|
67
|
-
protected makeGuardCorner(edge: Edge, lead: Coordinates, guardCoordinate: number, movedAxis:
|
|
68
|
+
protected perpendicularAxis(axis: "x" | "y"): "x" | "y";
|
|
69
|
+
protected pointAxis(point: Coordinates, axis: "x" | "y"): number;
|
|
70
|
+
protected setPointAxis(point: Coordinates, axis: "x" | "y", value: number): void;
|
|
71
|
+
protected crossesStaticBoundary(orientation: "up" | "down" | "left" | "right", movedAxis: "x" | "y", point: Coordinates, boundary: Coordinates, threshold?: number): boolean;
|
|
72
|
+
protected copyAsManual(point: EdgePoint, axis?: "x" | "y" | "both"): EdgePoint;
|
|
73
|
+
protected markManual(point: EdgePoint, axis?: "x" | "y" | "both"): void;
|
|
74
|
+
protected clampPointPastLead(point: EdgePoint, lead: Coordinates, orientation: "up" | "down" | "left" | "right"): void;
|
|
75
|
+
protected movedAxisMatchesOrientation(movedAxis: "x" | "y", orientation: "up" | "down" | "left" | "right"): boolean;
|
|
76
|
+
protected edgePointAt(edge: Edge, x: number, y: number, mode?: "auto" | "manual" | "static"): EdgePoint;
|
|
77
|
+
protected guardCoordinate(edge: Edge, side: EdgeEndSide, lead: Coordinates, oppositePoint: Coordinates, perpendicularAxis: "x" | "y"): number;
|
|
78
|
+
protected makeGuardCorner(edge: Edge, lead: Coordinates, guardCoordinate: number, movedAxis: "x" | "y"): EdgePoint;
|
|
68
79
|
protected insertStaticBoundaryGuard(side: EdgeEndSide): boolean;
|
|
69
80
|
protected insertStaticBoundaryGuards(): boolean;
|
|
70
81
|
protected clampDraggedSegmentAgainstEndpointLeads(): void;
|
|
71
82
|
protected mergeDraggedSegmentWithManualNeighbors(): boolean;
|
|
72
|
-
protected rebaseDraggedEndpointFixedAxis(side:
|
|
73
|
-
protected replaceDraggedEndpointWithProtectedLeadDuplicate(side:
|
|
83
|
+
protected rebaseDraggedEndpointFixedAxis(side: "pointA" | "pointB", point: EdgePoint): void;
|
|
84
|
+
protected replaceDraggedEndpointWithProtectedLeadDuplicate(side: "pointA" | "pointB", lead: EdgePoint, replacedIndex: number): void;
|
|
74
85
|
protected absorbCollinearSegmentsIntoDraggedSegment(): boolean;
|
|
75
86
|
protected removeAdjacentDuplicates(preserveActivePoints: boolean): boolean;
|
|
76
|
-
protected coordinateAnchorForPair(a: EdgePoint, b: EdgePoint, axis:
|
|
87
|
+
protected coordinateAnchorForPair(a: EdgePoint, b: EdgePoint, axis: "x" | "y", aIndex: number): number;
|
|
77
88
|
protected snapNearlyAlignedDraggedPairs(): boolean;
|
|
78
89
|
protected chooseOrthogonalCorner(from: EdgePoint, to: EdgePoint, previous?: EdgePoint, next?: EdgePoint): EdgePoint;
|
|
79
90
|
protected ensureOrthogonalAdjacency(): boolean;
|
|
80
91
|
protected normalizeDraggedEdge(): boolean;
|
|
81
92
|
protected finalizeDraggedEdge(): void;
|
|
82
|
-
protected prepareStraightLeadSegment(edge: Edge, movedAxis:
|
|
93
|
+
protected prepareStraightLeadSegment(edge: Edge, movedAxis: "x" | "y"): {
|
|
83
94
|
pointA: EdgePoint;
|
|
84
95
|
pointB: EdgePoint;
|
|
85
96
|
movedAxis: "x" | "y";
|
|
@@ -92,7 +103,7 @@ export declare class EdgesDragger extends DiagramExtension {
|
|
|
92
103
|
protected restoreOriginalSteps(edge: Edge, steps: EdgePoint[]): void;
|
|
93
104
|
startDrag(ev: DEdgeDragStartEvent): void;
|
|
94
105
|
startEndpointDrag(ev: DEdgeEndpointDragStartEvent): void;
|
|
95
|
-
protected
|
|
106
|
+
protected restoreEndpointDrag(): void;
|
|
96
107
|
protected handleEndpointMouseMove(ev: AnyMouseEvent): void;
|
|
97
108
|
protected moveDraggedSegment(ev: AnyMouseEvent): void;
|
|
98
109
|
protected handleMouseMove(ev: AnyMouseEvent): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
2
|
+
/** Stores bounded diagram snapshots and exposes undo and redo navigation. */
|
|
3
|
+
export declare class History extends DiagramExtension {
|
|
4
|
+
private readonly windowTime;
|
|
5
|
+
private readonly maxSize;
|
|
6
|
+
private index;
|
|
7
|
+
private snapshots;
|
|
8
|
+
private draggingNodes;
|
|
9
|
+
private avoidEvents;
|
|
10
|
+
private restoreSnapshot;
|
|
11
|
+
private clearTransientExtensions;
|
|
12
|
+
private checkpointPosition;
|
|
13
|
+
unbind: () => void;
|
|
14
|
+
private window;
|
|
15
|
+
/** Restores the next available snapshot while suppressing generated events. */
|
|
16
|
+
redo(): Promise<void> | undefined;
|
|
17
|
+
/** Restores the previous snapshot while suppressing generated change events. */
|
|
18
|
+
undo(): Promise<void> | undefined;
|
|
19
|
+
get hasNext(): boolean;
|
|
20
|
+
get hasPrevious(): boolean;
|
|
21
|
+
/** Observes diagram changes and schedules compact, bounded history snapshots. */
|
|
22
|
+
init(): void;
|
|
23
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Callback } from '../elements/Element';
|
|
1
2
|
import { DKeyDownEvent } from '../elements/Events';
|
|
2
3
|
import { DiagramExtension } from './DiagramExtension';
|
|
3
|
-
import { Callback } from '../elements/Element';
|
|
4
4
|
export type THotKey = Partial<{
|
|
5
5
|
code: string;
|
|
6
6
|
shift: boolean;
|
|
@@ -9,6 +9,7 @@ export type THotKey = Partial<{
|
|
|
9
9
|
}> & {
|
|
10
10
|
cb: Callback<DKeyDownEvent>;
|
|
11
11
|
};
|
|
12
|
+
/** Coordinates diagram keyboard shortcuts while avoiding native browser and editable-field conflicts. */
|
|
12
13
|
export declare class Hotkeys extends DiagramExtension {
|
|
13
14
|
hotkeys: THotKey[];
|
|
14
15
|
private isEditableTarget;
|
|
@@ -16,7 +17,9 @@ export declare class Hotkeys extends DiagramExtension {
|
|
|
16
17
|
private get measurer();
|
|
17
18
|
private get selector();
|
|
18
19
|
private match;
|
|
20
|
+
/** Registers diagram-level keyboard handling for editing, navigation, and export commands. */
|
|
19
21
|
init(): void;
|
|
22
|
+
/** Adds one scoped keyboard shortcut and returns a cleanup callback that unregisters it. */
|
|
20
23
|
register(hotkey: THotKey): () => void;
|
|
21
24
|
protected revertHotkey: Map<string, () => unknown>;
|
|
22
25
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Edge } from '../elements/Edge';
|
|
2
|
+
import { EdgeLabel } from '../elements/EdgeLabel';
|
|
3
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
4
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
5
|
+
type LabelGuide = {
|
|
6
|
+
from: Coordinates;
|
|
7
|
+
id: string;
|
|
8
|
+
to: Coordinates;
|
|
9
|
+
};
|
|
10
|
+
/** Aligns dragged edge labels to related labels and to an optimal five-pixel route clearance. */
|
|
11
|
+
export declare class LabelsAligner extends DiagramExtension {
|
|
12
|
+
proposals: LabelGuide[];
|
|
13
|
+
private readonly snapDistance;
|
|
14
|
+
/** Clears transient label-specific visual guides after a drag session is completed. */
|
|
15
|
+
clear(): void;
|
|
16
|
+
/** Initializes observable state used by the screen renderer for label alignment guides. */
|
|
17
|
+
init(): void;
|
|
18
|
+
/** Snaps one dragged label to peer labels or its edge while returning the resolved position. */
|
|
19
|
+
align(edge: Edge, label: EdgeLabel, position: Coordinates): Coordinates;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Node } from '../elements/Node';
|
|
2
|
+
import { Dimensions } from '../primitives/Dimensions';
|
|
3
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
4
|
+
export type AlignmentGuide = {
|
|
5
|
+
type: "v";
|
|
6
|
+
y: number;
|
|
7
|
+
range: [number, number];
|
|
8
|
+
id: string;
|
|
9
|
+
} | {
|
|
10
|
+
type: "h";
|
|
11
|
+
x: number;
|
|
12
|
+
range: [number, number];
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
type VerticalSuggestion = {
|
|
16
|
+
nodeY: number;
|
|
17
|
+
guideY: number;
|
|
18
|
+
range: [number, number];
|
|
19
|
+
};
|
|
20
|
+
type VerticalSuggestionProvider = (node: Node<any>, box: Dimensions) => VerticalSuggestion[];
|
|
21
|
+
type HorizontalSuggestion = {
|
|
22
|
+
nodeX: number;
|
|
23
|
+
guideX: number;
|
|
24
|
+
range: [number, number];
|
|
25
|
+
};
|
|
26
|
+
type HorizontalSuggestionProvider = (node: Node<any>, box: Dimensions) => HorizontalSuggestion[];
|
|
27
|
+
/** Applies one coherent best-fit alignment recommendation to a dragged group. */
|
|
28
|
+
export declare class NodesAligner extends DiagramExtension {
|
|
29
|
+
private gridSize;
|
|
30
|
+
private horizontalSuggestionProviders;
|
|
31
|
+
private verticalSuggestionProviders;
|
|
32
|
+
proposals: AlignmentGuide[];
|
|
33
|
+
/** Registers extra horizontal candidates while preserving aligner arbitration. */
|
|
34
|
+
registerHorizontalSuggestionProvider(provider: HorizontalSuggestionProvider): () => void;
|
|
35
|
+
/** Registers extra vertical candidates while preserving aligner arbitration. */
|
|
36
|
+
registerVerticalSuggestionProvider(provider: VerticalSuggestionProvider): () => void;
|
|
37
|
+
/** Removes every transient alignment guide after a drag or modifier-key change. */
|
|
38
|
+
clear(): void;
|
|
39
|
+
/** Registers best-candidate alignment arbitration and cleanup for node dragging. */
|
|
40
|
+
init(): void;
|
|
41
|
+
private align;
|
|
42
|
+
private verticalCandidate;
|
|
43
|
+
private horizontalCandidate;
|
|
44
|
+
private applyCandidate;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MouseEvent as RMEv } from 'react';
|
|
2
|
+
import { DMouseMoveEvent } from '../elements/Events';
|
|
3
|
+
import { Gateway } from '../elements/Gateway';
|
|
4
|
+
import { Node } from '../elements/Node';
|
|
5
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
6
|
+
import { EdgeRouterAnchor } from '../routers/EdgesRouter';
|
|
7
|
+
import { OrthogonalRouter } from '../routers/OrthogonalRouter';
|
|
8
|
+
import { EdgePathType, TEdgeAnchorState } from '../types';
|
|
9
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
10
|
+
import { GridSnap } from './GridSnap';
|
|
11
|
+
/** Coordinates interactive edge previews, gateway resolution, and final connection. */
|
|
12
|
+
export declare class NodesConnector extends DiagramExtension {
|
|
13
|
+
protected hasRoutedPreview: boolean;
|
|
14
|
+
protected previewRequestVersion: number;
|
|
15
|
+
protected previewRafId: number | null;
|
|
16
|
+
/** Declares observable connector state used by previews and interaction chrome. */
|
|
17
|
+
init(): void;
|
|
18
|
+
protected arrowTo: Coordinates | null;
|
|
19
|
+
protected startGateway: Gateway | null;
|
|
20
|
+
protected startAnchor: EdgeRouterAnchor | null;
|
|
21
|
+
protected startAnchorMode: TEdgeAnchorState["mode"];
|
|
22
|
+
protected axisConstrained: boolean;
|
|
23
|
+
candidateGateway: Gateway | null;
|
|
24
|
+
protected candidateAnchor: EdgeRouterAnchor | null;
|
|
25
|
+
protected candidateAnchorState: TEdgeAnchorState | null;
|
|
26
|
+
protected readonly previewRouter: OrthogonalRouter;
|
|
27
|
+
private pendingConnection;
|
|
28
|
+
private unbindPendingConnection;
|
|
29
|
+
protected _arrowSteps: Coordinates[];
|
|
30
|
+
get arrowSteps(): Coordinates[];
|
|
31
|
+
/** Reports the effective routing mode required by either preview endpoint. */
|
|
32
|
+
get previewPathType(): EdgePathType;
|
|
33
|
+
/** Exposes the exact candidate point used by preview and final connection. */
|
|
34
|
+
get candidatePoint(): Coordinates | null;
|
|
35
|
+
protected get snap(): GridSnap;
|
|
36
|
+
private resolveStartAnchor;
|
|
37
|
+
protected calculateArrowSteps(): void;
|
|
38
|
+
protected orthogonalMousePreview(startAnchor: EdgeRouterAnchor, mouseOnPlane: Coordinates): Coordinates[];
|
|
39
|
+
protected compactPreviewPoints(points: Coordinates[]): Coordinates[];
|
|
40
|
+
protected cancelScheduledPreview(): void;
|
|
41
|
+
protected scheduleCalculateArrowSteps(): void;
|
|
42
|
+
protected u: () => void;
|
|
43
|
+
private connectionAnchorFromEvent;
|
|
44
|
+
private handleGatewayMouseDown;
|
|
45
|
+
private handlePendingMouseMove;
|
|
46
|
+
private cancelPendingConnection;
|
|
47
|
+
/** Starts a fixed connection from the exact explicitly selected source gateway. */
|
|
48
|
+
startConnectionFrom(gateway: Gateway, ev: RMEv): void;
|
|
49
|
+
/** Starts a fixed connection from the precise clicked node boundary point. */
|
|
50
|
+
startConnectionFromNode(node: Node<any>, ev: RMEv, anchorMode?: TEdgeAnchorState["mode"]): void;
|
|
51
|
+
/** Reports whether an interactive connection preview is currently active. */
|
|
52
|
+
get connecting(): boolean;
|
|
53
|
+
private beginConnection;
|
|
54
|
+
protected handleMouseMove(ev: DMouseMoveEvent): void;
|
|
55
|
+
protected handleMouseUp(): void;
|
|
56
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/** Defines deterministic listener ordering so competing diagram interactions compose predictably. */
|
|
1
2
|
export declare class Priorities {
|
|
2
3
|
Canvas_Rules: number;
|
|
3
4
|
Change_History: number;
|
|
4
5
|
Click_Node: number;
|
|
5
6
|
Drag_Rules: number;
|
|
6
|
-
Drag_Node_Distances_Balancer: number;
|
|
7
7
|
Drag_Node_Straight_Drag: number;
|
|
8
|
+
Drag_Node_Distances_Balancer: number;
|
|
8
9
|
Drag_Node_Aligner: number;
|
|
9
10
|
Drag_Node_Snap_To_Grid: number;
|
|
10
11
|
Drag_Edge_Snap_To_Grid: number;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { Diagram } from '../Diagram';
|
|
2
|
+
/**
|
|
3
|
+
* Controls editor interactions and persists the user's grid visibility choice.
|
|
4
|
+
*/
|
|
2
5
|
export declare class Rules {
|
|
3
6
|
protected d: Diagram;
|
|
4
7
|
allowEdition: boolean;
|
|
5
8
|
allowSelection: boolean;
|
|
6
9
|
allowZoom: boolean;
|
|
7
10
|
displaceWhenDragOnEdges: boolean;
|
|
8
|
-
|
|
11
|
+
private _toggleGrid;
|
|
12
|
+
get toggleGrid(): boolean;
|
|
13
|
+
set toggleGrid(value: boolean);
|
|
9
14
|
constructor(d: Diagram);
|
|
10
15
|
private check;
|
|
11
16
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DMouseDownEvent,
|
|
1
|
+
import { Edge } from '../elements/Edge';
|
|
2
|
+
import { DMouseDownEvent, DMouseMoveEvent, DMouseUpEvent } from '../elements/Events';
|
|
3
3
|
import { Node } from '../elements/Node';
|
|
4
|
+
import { Dimensions } from '../primitives/Dimensions';
|
|
4
5
|
import { DiagramExtension } from './DiagramExtension';
|
|
5
|
-
|
|
6
|
-
type SelectionMode = 'area' | 'element';
|
|
6
|
+
type SelectionMode = "area" | "element";
|
|
7
7
|
/**
|
|
8
8
|
* The selection must be handled entirelly by the Selector class.
|
|
9
9
|
*
|
|
@@ -26,25 +26,38 @@ export declare class Selector extends DiagramExtension {
|
|
|
26
26
|
selectionMode: SelectionMode;
|
|
27
27
|
private _selection;
|
|
28
28
|
private _edgesSelection;
|
|
29
|
+
private readonly autopan;
|
|
30
|
+
private pointerPoint;
|
|
29
31
|
/**
|
|
30
32
|
* Used to draw the selection rectangle
|
|
31
33
|
*/
|
|
32
34
|
private endPoint;
|
|
33
35
|
private startPoint;
|
|
36
|
+
/** Copies selected nodes and rewrites their internal connection identifiers. */
|
|
34
37
|
copy(): string;
|
|
38
|
+
/** Registers selection event handlers and restores serialized node selection. */
|
|
35
39
|
init(): void;
|
|
40
|
+
/** Switches between area and element selection using the requested mode explicitly. */
|
|
36
41
|
toggleSelectionMode(sm?: SelectionMode): void;
|
|
37
42
|
get selectedNodes(): Node<import('../types').TOrientation>[];
|
|
38
43
|
get selectedEdges(): Edge[];
|
|
39
44
|
get box(): Dimensions;
|
|
45
|
+
/** Clears every selected diagram element accepted by the supplied predicate. */
|
|
40
46
|
clearSelection(check?: (n: Node<any>) => boolean): void;
|
|
47
|
+
/** Selects an edge unless a diagram selection listener cancels the request. */
|
|
41
48
|
selectEdge(e: Edge): void;
|
|
49
|
+
/** Selects a selectable node unless a listener cancels the selection request. */
|
|
42
50
|
selectNode(n: Node<any>): void;
|
|
51
|
+
/** Unselects an edge unless a diagram listener cancels the state transition. */
|
|
43
52
|
unselectEdge(e: Edge): void;
|
|
53
|
+
/** Unselects an eligible node unless a listener cancels the state transition. */
|
|
44
54
|
unselectNode(n: Node<any>): void;
|
|
45
55
|
unbind: () => void;
|
|
46
56
|
handleMouseDown: (ev: DMouseDownEvent) => void;
|
|
47
|
-
|
|
57
|
+
private bindEmptyCanvasGesture;
|
|
58
|
+
handleMouseMove: (ev: DMouseMoveEvent) => void;
|
|
59
|
+
private handleSelectionInterval;
|
|
60
|
+
private updateAreaSelection;
|
|
48
61
|
handleMouseUp: (_ev: DMouseUpEvent) => void;
|
|
49
62
|
}
|
|
50
63
|
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { DiagramExtension } from './DiagramExtension';
|
|
2
|
+
/** Constrains node drags to one axis whenever Shift is active before or during the gesture. */
|
|
2
3
|
export declare class StraightDrag extends DiagramExtension {
|
|
3
4
|
private straight;
|
|
4
5
|
private startCoordinates;
|
|
5
6
|
private startProposals;
|
|
7
|
+
private shiftHeld;
|
|
6
8
|
private reset;
|
|
9
|
+
/** Registers modifier and pointer listeners that determine and apply the constrained axis. */
|
|
7
10
|
init(): void;
|
|
8
11
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
2
|
+
import { DiagramExtension } from './DiagramExtension';
|
|
3
|
+
/** Constrains edge-label dragging to its dominant axis whenever Shift is currently active. */
|
|
4
|
+
export declare class StraightLabelsDrag extends DiagramExtension {
|
|
5
|
+
private shiftHeld;
|
|
6
|
+
/** Tracks the Shift modifier globally so pointer-driven label timers share its current state. */
|
|
7
|
+
init(): void;
|
|
8
|
+
/** Locks the minor axis using the raw drag direction while preserving the proposed major axis. */
|
|
9
|
+
constrain(origin: Coordinates, position: Coordinates, direction?: Coordinates): Coordinates;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NodePositionProposal } from '../elements/Events';
|
|
2
|
+
type Axis = "x" | "y";
|
|
3
|
+
/** Tracks which group member first earned a high-priority movement recommendation. */
|
|
4
|
+
export declare const nodePositionProposalRanking: {
|
|
5
|
+
mark(proposal: NodePositionProposal, axis: Axis): void;
|
|
6
|
+
get(proposal: NodePositionProposal, axis: Axis): number | undefined;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -32,7 +32,7 @@ export declare class Coordinates {
|
|
|
32
32
|
};
|
|
33
33
|
multiply(factor: number | Coordinates): this;
|
|
34
34
|
set(i: number, value: number): this;
|
|
35
|
-
snapToGrid(gridSize: number, dimension?:
|
|
35
|
+
snapToGrid(gridSize: number, dimension?: "x" | "y" | "both"): this;
|
|
36
36
|
substract(another: Coordinates | [number, number]): this;
|
|
37
37
|
sum(another: Coordinates | [number, number] | number): this;
|
|
38
38
|
toDirectedPoint(direction: TOrientation): DirectedPoint;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Diagram } from '../Diagram';
|
|
2
|
+
import { Edge } from '../elements/Edge';
|
|
3
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
4
|
+
import { EdgesRouter, EdgeRouterAnchor } from './EdgesRouter';
|
|
5
|
+
/** Resolves curve endpoints while leaving cubic control geometry to rendering. */
|
|
6
|
+
export declare class CurvedRouter extends EdgesRouter {
|
|
7
|
+
/** Chooses the nearest declared source gateway facing the curve destination. */
|
|
8
|
+
findAutomaticStartPoint(edge: Edge): EdgeRouterAnchor;
|
|
9
|
+
/** Chooses the nearest declared target gateway facing the curve source node. */
|
|
10
|
+
findAutomaticEndPoint(edge: Edge): EdgeRouterAnchor;
|
|
11
|
+
/** Supplies curve endpoints while SVG rendering derives cubic control points. */
|
|
12
|
+
findRoute(_diagram: Diagram, _edge: Edge, start: EdgeRouterAnchor, end: EdgeRouterAnchor): Coordinates[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Diagram } from '../Diagram';
|
|
2
|
+
import { Edge } from '../elements/Edge';
|
|
3
|
+
import { Gateway } from '../elements/Gateway';
|
|
4
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
5
|
+
export type EdgeRouterAnchor = {
|
|
6
|
+
gateway: Gateway;
|
|
7
|
+
point: Coordinates;
|
|
8
|
+
relativePosition: Coordinates;
|
|
9
|
+
displacement: Coordinates;
|
|
10
|
+
};
|
|
11
|
+
/** Defines endpoint resolution and route generation for one edge path family. */
|
|
12
|
+
export declare abstract class EdgesRouter {
|
|
13
|
+
/** Selects the most suitable source boundary point for an automatic edge. */
|
|
14
|
+
abstract findAutomaticStartPoint(edge: Edge): EdgeRouterAnchor;
|
|
15
|
+
/** Selects the most suitable target boundary point for an automatic edge. */
|
|
16
|
+
abstract findAutomaticEndPoint(edge: Edge): EdgeRouterAnchor;
|
|
17
|
+
/** Calculates route points after both endpoint anchors have been resolved. */
|
|
18
|
+
abstract findRoute(diagram: Diagram, edge: Edge, start: EdgeRouterAnchor, end: EdgeRouterAnchor): Coordinates[];
|
|
19
|
+
/** Resolves local automatic anchors, attaches them, and calculates the route. */
|
|
20
|
+
route(diagram: Diagram, edge: Edge): Coordinates[];
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Diagram } from '../Diagram';
|
|
2
|
+
import { Edge } from '../elements/Edge';
|
|
3
|
+
import { Gateway } from '../elements/Gateway';
|
|
4
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
5
|
+
import { EdgesRouter, EdgeRouterAnchor } from './EdgesRouter';
|
|
6
|
+
/** Adapts obstacle-aware orthogonal routing to the shared router contract. */
|
|
7
|
+
export declare class OrthogonalRouter extends EdgesRouter {
|
|
8
|
+
/** Chooses the nearest declared source gateway facing the current target node. */
|
|
9
|
+
findAutomaticStartPoint(edge: Edge): EdgeRouterAnchor;
|
|
10
|
+
/** Chooses the nearest declared target gateway facing the current source node. */
|
|
11
|
+
findAutomaticEndPoint(edge: Edge): EdgeRouterAnchor;
|
|
12
|
+
/** Delegates route construction while preserving every manual orthogonal constraint. */
|
|
13
|
+
findRoute(diagram: Diagram, edge: Edge, _start: EdgeRouterAnchor, _end: EdgeRouterAnchor): Coordinates[];
|
|
14
|
+
/** Routes a transient preview without requiring a persisted Edge instance. */
|
|
15
|
+
findRouteBetween(diagram: Diagram, from: Gateway, to: Gateway, fromDisplacement?: Coordinates, toDisplacement?: Coordinates): Coordinates[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Diagram } from '../Diagram';
|
|
2
|
+
import { Edge } from '../elements/Edge';
|
|
3
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
4
|
+
import { EdgesRouter, EdgeRouterAnchor } from './EdgesRouter';
|
|
5
|
+
/** Resolves boundary anchors and draws the shortest direct segment between them. */
|
|
6
|
+
export declare class StraightRouter extends EdgesRouter {
|
|
7
|
+
/** Chooses the source boundary intersection on the center-to-center line. */
|
|
8
|
+
findAutomaticStartPoint(edge: Edge): EdgeRouterAnchor;
|
|
9
|
+
/** Chooses the target boundary intersection on the center-to-center line. */
|
|
10
|
+
findAutomaticEndPoint(edge: Edge): EdgeRouterAnchor;
|
|
11
|
+
/** Produces a direct route between the two fully resolved endpoint anchors. */
|
|
12
|
+
findRoute(_diagram: Diagram, _edge: Edge, start: EdgeRouterAnchor, end: EdgeRouterAnchor): Coordinates[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
2
|
+
/** Projects a dragged point onto the nearest horizontal or vertical cardinal axis. */
|
|
3
|
+
export declare function cardinalAxisConstraint(origin: Coordinates, point: Coordinates): {
|
|
4
|
+
axis: "horizontal" | "vertical";
|
|
5
|
+
origin: Coordinates;
|
|
6
|
+
point: Coordinates;
|
|
7
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Diagram } from '../Diagram';
|
|
2
|
+
import { Node } from '../elements/Node';
|
|
3
|
+
import { Coordinates } from '../primitives/Coordinates';
|
|
4
|
+
import { TEdgeAnchorState } from '../types';
|
|
5
|
+
import { EdgeRouterAnchor } from './EdgesRouter';
|
|
6
|
+
export type ConnectionCandidate = {
|
|
7
|
+
anchor: EdgeRouterAnchor;
|
|
8
|
+
anchorState: TEdgeAnchorState;
|
|
9
|
+
node: Node<any>;
|
|
10
|
+
snappedToGateway: boolean;
|
|
11
|
+
};
|
|
12
|
+
type CandidateOptions = {
|
|
13
|
+
axisConstraint?: {
|
|
14
|
+
axis: "horizontal" | "vertical";
|
|
15
|
+
origin: Coordinates;
|
|
16
|
+
};
|
|
17
|
+
excludeNode?: Node<any>;
|
|
18
|
+
oppositePoint: Coordinates;
|
|
19
|
+
};
|
|
20
|
+
/** Resolves a cursor using gateway snap, exact boundary, then a declared gateway. */
|
|
21
|
+
export declare function resolveConnectionCandidate(diagram: Diagram, point: Coordinates, options: CandidateOptions): ConnectionCandidate | null;
|
|
22
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Dimensions } from './primitives/Dimensions';
|
|
2
|
-
import { Coordinates } from './primitives/Coordinates';
|
|
3
|
-
import { Gateway } from './elements/Gateway';
|
|
4
1
|
import { Edge } from './elements/Edge';
|
|
2
|
+
import { EdgeLabel } from './elements/EdgeLabel';
|
|
5
3
|
import { EdgePoint } from './elements/EdgePoint';
|
|
4
|
+
import { Gateway } from './elements/Gateway';
|
|
5
|
+
import { Coordinates } from './primitives/Coordinates';
|
|
6
|
+
import { Dimensions } from './primitives/Dimensions';
|
|
6
7
|
export type TNodeState = {
|
|
7
8
|
id: string;
|
|
8
9
|
box: Dimensions;
|
|
@@ -10,6 +11,7 @@ export type TNodeState = {
|
|
|
10
11
|
} & Partial<{
|
|
11
12
|
fill: string;
|
|
12
13
|
labelFontSize: number;
|
|
14
|
+
labelOffset: [number, number];
|
|
13
15
|
movable: boolean;
|
|
14
16
|
selectable: boolean;
|
|
15
17
|
selected: boolean;
|
|
@@ -19,25 +21,32 @@ export type TNodeState = {
|
|
|
19
21
|
zIndex: number;
|
|
20
22
|
groupChildren: boolean;
|
|
21
23
|
}>;
|
|
22
|
-
export type EdgePathType =
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
24
|
+
export type EdgePathType = "orthogonal" | "straight" | "curved";
|
|
25
|
+
export type EdgeAnchorMode = "automatic" | "fixed";
|
|
26
|
+
export type TEdgeAnchorState = {
|
|
27
|
+
mode: EdgeAnchorMode;
|
|
28
|
+
position?: Coordinates;
|
|
29
|
+
};
|
|
30
|
+
export type EdgeArrowHead = "none" | "arrow" | "arrow-open" | "triangle" | "triangle-filled" | "diamond" | "circle-small" | "circle-medium" | "default-flow" | "measure";
|
|
31
|
+
export type EdgeLineStyle = "solid" | "dashed" | "dotted";
|
|
25
32
|
export type TEdgeState = {
|
|
26
33
|
dragging: boolean;
|
|
27
34
|
hover: boolean;
|
|
28
35
|
selected: boolean;
|
|
29
|
-
|
|
30
|
-
labelPositioning: Coordinates;
|
|
36
|
+
labels: EdgeLabel[];
|
|
31
37
|
from: Gateway;
|
|
32
38
|
to: Gateway;
|
|
33
39
|
steps: EdgePoint[];
|
|
34
40
|
} & Partial<{
|
|
41
|
+
arrowSize: number;
|
|
35
42
|
arrowHeadEnd: EdgeArrowHead;
|
|
36
43
|
arrowHeadStart: EdgeArrowHead;
|
|
37
44
|
displacementEnd: Coordinates;
|
|
38
45
|
displacementStart: Coordinates;
|
|
46
|
+
endAnchor: TEdgeAnchorState;
|
|
39
47
|
lineStyle: EdgeLineStyle;
|
|
40
48
|
pathType: EdgePathType;
|
|
49
|
+
startAnchor: TEdgeAnchorState;
|
|
41
50
|
stroke: string;
|
|
42
51
|
strokeWidth: number;
|
|
43
52
|
}>;
|
|
@@ -58,4 +67,4 @@ export type TGatewayState = {
|
|
|
58
67
|
*/
|
|
59
68
|
position: Coordinates;
|
|
60
69
|
};
|
|
61
|
-
export type TOrientation =
|
|
70
|
+
export type TOrientation = "up" | "right" | "down" | "left";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Diagram } from '../store/Diagram';
|
|
2
|
+
import { Coordinates } from '../store/primitives/Coordinates';
|
|
3
|
+
/**
|
|
4
|
+
* Displaces a diagram viewport while an interaction remains near its edges.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Autopan {
|
|
7
|
+
private readonly diagram;
|
|
8
|
+
static readonly edgeThreshold = 100;
|
|
9
|
+
constructor(diagram: Diagram);
|
|
10
|
+
/** Applies one auto-pan step for the supplied viewport pointer coordinates. */
|
|
11
|
+
displace(pointer: Coordinates): Coordinates;
|
|
12
|
+
private axisDisplacement;
|
|
13
|
+
private step;
|
|
14
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Diagram } from '../../store/Diagram';
|
|
2
2
|
import { BPMNApplyImportResult, BPMNImportPlan } from './types';
|
|
3
|
+
/** Applies one prepared BPMN import plan and reports the imported element totals. */
|
|
3
4
|
export declare function applyBPMNImportPlan(diagram: Diagram, plan: BPMNImportPlan): BPMNApplyImportResult;
|