@metadev/daga 4.2.13 → 4.2.15
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/Changelog.md +14 -0
- package/index.cjs.js +184 -65
- package/index.esm.js +185 -66
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/lib/diagram/canvas/diagram-canvas-util.d.ts +3 -1
- package/src/lib/diagram/canvas/diagram-canvas.d.ts +4 -1
- package/src/lib/diagram/config/diagram-components-config.d.ts +5 -0
- package/src/lib/diagram/config/diagram-config.d.ts +12 -4
- package/src/lib/diagram/model/diagram-connection.d.ts +1 -1
- package/src/lib/diagram/model/diagram-node.d.ts +13 -3
- package/src/lib/diagram/model/diagram-port.d.ts +1 -1
- package/src/lib/diagram/model/diagram-section.d.ts +3 -3
- package/src/lib/interfaces/canvas.d.ts +22 -3
|
@@ -53,6 +53,7 @@ export declare class DiagramCanvas implements Canvas {
|
|
|
53
53
|
get connectionType(): DiagramConnectionType | undefined;
|
|
54
54
|
set connectionType(value: DiagramConnectionType | undefined);
|
|
55
55
|
autoTightenConnections: boolean;
|
|
56
|
+
tightenConnectionsAcrossPortTypes: boolean;
|
|
56
57
|
allowConnectionLoops: boolean;
|
|
57
58
|
allowSharingPorts: boolean;
|
|
58
59
|
allowSharingBothPorts: boolean;
|
|
@@ -73,6 +74,7 @@ export declare class DiagramCanvas implements Canvas {
|
|
|
73
74
|
* Invisible path followed by an unfinished connection. Used for making unfinished connections stop before the cursor rather than stopping right at the cursor.
|
|
74
75
|
*/
|
|
75
76
|
private unfinishedConnectionTracer?;
|
|
77
|
+
private unfinishedConnectionPort?;
|
|
76
78
|
private inputFieldContainer?;
|
|
77
79
|
private multipleSelectionContainer?;
|
|
78
80
|
private draggingFrom;
|
|
@@ -105,7 +107,8 @@ export declare class DiagramCanvas implements Canvas {
|
|
|
105
107
|
getViewCoordinates(): Point;
|
|
106
108
|
translateBy(x: number, y: number): void;
|
|
107
109
|
translateTo(x: number, y: number): void;
|
|
108
|
-
|
|
110
|
+
zoomAndPanTo(x: number, y: number, z: number, duration?: number): void;
|
|
111
|
+
center(nodeIds?: string[], maxZoomLevel?: number, duration?: number): void;
|
|
109
112
|
getClosestGridPoint(point: Point): Point;
|
|
110
113
|
getCoordinatesOnScreen(): [Point, Point];
|
|
111
114
|
private getEventHoldingCoordinates;
|
|
@@ -52,6 +52,11 @@ export interface ButtonsComponentConfig {
|
|
|
52
52
|
* @default 'top'
|
|
53
53
|
*/
|
|
54
54
|
direction?: Side;
|
|
55
|
+
/**
|
|
56
|
+
* Duration of the center animation when pressing the center button. May be set to `0` or `undefined` to make it instant without animation.
|
|
57
|
+
* @default undefined
|
|
58
|
+
*/
|
|
59
|
+
centerAnimationDuration?: number;
|
|
55
60
|
/**
|
|
56
61
|
* Whether to enable the user action (undo, redo) buttons in this component.
|
|
57
62
|
* @default true
|
|
@@ -103,6 +103,11 @@ export interface ConnectionSettingsConfig {
|
|
|
103
103
|
* @default true
|
|
104
104
|
*/
|
|
105
105
|
autoTighten?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* When tightening a connection allow changing the start and end ports to ports of a different type.
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
tightenAcrossPortTypes?: boolean;
|
|
106
111
|
/**
|
|
107
112
|
* Whether a connection can use the same port as start and end.
|
|
108
113
|
* @default false
|
|
@@ -169,12 +174,12 @@ export interface NodeTypeConfig {
|
|
|
169
174
|
* Whether the user can resize nodes of this type along the x axis.
|
|
170
175
|
* @default false
|
|
171
176
|
*/
|
|
172
|
-
resizableX?: boolean;
|
|
177
|
+
resizableX?: boolean | ResizableMode;
|
|
173
178
|
/**
|
|
174
179
|
* Whether the user can resize nodes of this type along the y axis.
|
|
175
180
|
* @default false
|
|
176
181
|
*/
|
|
177
|
-
resizableY?: boolean;
|
|
182
|
+
resizableY?: boolean | ResizableMode;
|
|
178
183
|
/**
|
|
179
184
|
* By how much the location of nodes of this type should be offset when snapping to grid in diagram units.
|
|
180
185
|
* Each value corresponds to left, top, right and bottom respectively.
|
|
@@ -499,13 +504,13 @@ export interface SectionConfig {
|
|
|
499
504
|
* If undefined, inherits from the parent node's resizableX setting.
|
|
500
505
|
* @default undefined
|
|
501
506
|
*/
|
|
502
|
-
resizableX?: boolean;
|
|
507
|
+
resizableX?: boolean | ResizableMode;
|
|
503
508
|
/**
|
|
504
509
|
* Whether this section can be resized vertically.
|
|
505
510
|
* If undefined, inherits from the parent node's resizableY setting.
|
|
506
511
|
* @default undefined
|
|
507
512
|
*/
|
|
508
|
-
resizableY?: boolean;
|
|
513
|
+
resizableY?: boolean | ResizableMode;
|
|
509
514
|
}
|
|
510
515
|
/**
|
|
511
516
|
* Configuration for a type of connection.
|
|
@@ -556,3 +561,6 @@ export interface ConnectionTypeConfig {
|
|
|
556
561
|
*/
|
|
557
562
|
properties?: Property[];
|
|
558
563
|
}
|
|
564
|
+
export declare enum ResizableMode {
|
|
565
|
+
OnlyWhenSelected = 0
|
|
566
|
+
}
|
|
@@ -138,7 +138,7 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
138
138
|
*/
|
|
139
139
|
endLabel: string;
|
|
140
140
|
/**
|
|
141
|
-
* Points that this connection
|
|
141
|
+
* Points that this connection must pass through in its route from its start point to its end point, in order.
|
|
142
142
|
* @public
|
|
143
143
|
*/
|
|
144
144
|
points: Point[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Point } from '../../util/canvas-util';
|
|
2
2
|
import { Side } from '../../util/svg-util';
|
|
3
3
|
import { CollabTimestamp } from '../collab/primitives';
|
|
4
|
-
import { DecoratorConfig, FieldConfig, NodeTypeConfig, PortConfig } from '../config/diagram-config';
|
|
4
|
+
import { DecoratorConfig, FieldConfig, NodeTypeConfig, PortConfig, ResizableMode } from '../config/diagram-config';
|
|
5
5
|
import { ImageLook, ImageLookConfig, ShapedLook, ShapedLookConfig, StretchableImageLook, StretchableImageLookConfig } from '../config/diagram-look-config';
|
|
6
6
|
import { PropertySet } from '../property/property';
|
|
7
7
|
import { ValueSet } from '../property/value';
|
|
@@ -75,8 +75,8 @@ export declare class DiagramNodeType implements DiagramEntity {
|
|
|
75
75
|
defaultHeight: number;
|
|
76
76
|
minWidth: number;
|
|
77
77
|
minHeight: number;
|
|
78
|
-
resizableX: boolean;
|
|
79
|
-
resizableY: boolean;
|
|
78
|
+
resizableX: boolean | ResizableMode;
|
|
79
|
+
resizableY: boolean | ResizableMode;
|
|
80
80
|
snapToGridOffset: [number, number, number, number];
|
|
81
81
|
bottomPadding: number;
|
|
82
82
|
leftPadding: number;
|
|
@@ -207,6 +207,16 @@ export declare class DiagramNode extends DiagramElement implements LabeledElemen
|
|
|
207
207
|
updateInView(): void;
|
|
208
208
|
raise(): void;
|
|
209
209
|
getPriority(): number;
|
|
210
|
+
/**
|
|
211
|
+
* Returns whether this node can be resized horizontally.
|
|
212
|
+
* @public
|
|
213
|
+
*/
|
|
214
|
+
getResizableX(): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Returns whether this node can be resized vertically.
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
getResizableY(): boolean;
|
|
210
220
|
/**
|
|
211
221
|
* Get the port of this node which is closest to the given coordinates.
|
|
212
222
|
* @param coords A point in the diagram.
|
|
@@ -173,7 +173,7 @@ export declare class DiagramPort extends DiagramElement implements LabeledElemen
|
|
|
173
173
|
constructor(model: DiagramModel, type: DiagramPortType | undefined, rootElement: DiagramNode | DiagramSection | undefined, coords: Point, connectionPoint: Point | undefined, direction: Side, id: string, anchorPointX?: AnchorPoint, anchorPointY?: AnchorPoint);
|
|
174
174
|
get removed(): boolean;
|
|
175
175
|
updateInView(): void;
|
|
176
|
-
raise(): void;
|
|
176
|
+
raise(raiseConnections?: boolean): void;
|
|
177
177
|
/**
|
|
178
178
|
* Add a connection to this port's list of outgoing connections.
|
|
179
179
|
* @public
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Point } from '../../util/canvas-util';
|
|
2
2
|
import { Side } from '../../util/svg-util';
|
|
3
|
-
import { FieldConfig, PortConfig, SectionConfig, SectionGridConfig } from '../config/diagram-config';
|
|
3
|
+
import { FieldConfig, PortConfig, ResizableMode, SectionConfig, SectionGridConfig } from '../config/diagram-config';
|
|
4
4
|
import { ImageLookConfig, ShapedLookConfig, StretchableImageLookConfig } from '../config/diagram-look-config';
|
|
5
5
|
import { DiagramConnection } from './diagram-connection';
|
|
6
6
|
import { DiagramDecorator } from './diagram-decorator';
|
|
@@ -61,8 +61,8 @@ export declare class DiagramSectionType {
|
|
|
61
61
|
highlightedLook: NodeLook;
|
|
62
62
|
selectedAndHighlightedLook: NodeLook;
|
|
63
63
|
priority: number;
|
|
64
|
-
resizableX: boolean | undefined;
|
|
65
|
-
resizableY: boolean | undefined;
|
|
64
|
+
resizableX: boolean | ResizableMode | undefined;
|
|
65
|
+
resizableY: boolean | ResizableMode | undefined;
|
|
66
66
|
constructor(options: SectionConfig);
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
@@ -108,6 +108,11 @@ export interface Canvas {
|
|
|
108
108
|
* @public
|
|
109
109
|
*/
|
|
110
110
|
autoTightenConnections: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Whether a connection can be tightened to use ports of a different type.
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
tightenConnectionsAcrossPortTypes: boolean;
|
|
111
116
|
/**
|
|
112
117
|
* Whether a connection can use the same port as start and end.
|
|
113
118
|
* @public
|
|
@@ -195,7 +200,8 @@ export interface Canvas {
|
|
|
195
200
|
*/
|
|
196
201
|
zoomTo(level: number): void;
|
|
197
202
|
/**
|
|
198
|
-
* Gets the current coordinates of the view.
|
|
203
|
+
* Gets the current coordinates of the center of view.
|
|
204
|
+
* Ensures that calling `translateTo()` with the result causes no changes.
|
|
199
205
|
* @public
|
|
200
206
|
*/
|
|
201
207
|
getViewCoordinates(): Point;
|
|
@@ -207,17 +213,30 @@ export interface Canvas {
|
|
|
207
213
|
*/
|
|
208
214
|
translateBy(x: number, y: number): void;
|
|
209
215
|
/**
|
|
210
|
-
* Translates the view to the given point.
|
|
216
|
+
* Translates the center of the view to the given point.
|
|
211
217
|
* @public
|
|
212
218
|
* @param x A coordinate along the x axis.
|
|
213
219
|
* @param y A coordinate along the y axis.
|
|
214
220
|
*/
|
|
215
221
|
translateTo(x: number, y: number): void;
|
|
222
|
+
/**
|
|
223
|
+
* Translates the center of the view to the given point and the given zoom level over the given duration of time.
|
|
224
|
+
* The duration may be set to `0` or `undefined` to make the move instant without animation.
|
|
225
|
+
* @public
|
|
226
|
+
* @param x A coordinate along the x axis.
|
|
227
|
+
* @param y A coordinate along the y axis.
|
|
228
|
+
* @param z A level of zoom.
|
|
229
|
+
* @param duration A duration for the animation in milliseconds. May be set to `0` or `undefined` to make it instant without animation.
|
|
230
|
+
*/
|
|
231
|
+
zoomAndPanTo(x: number, y: number, z: number, duration?: number): void;
|
|
216
232
|
/**
|
|
217
233
|
* Centers by zooming and translating the view such that every element fits in the view.
|
|
218
234
|
* @public
|
|
235
|
+
* @param nodeIds A list of node ids to center the view on. If `undefined`, it encompasses all nodes.
|
|
236
|
+
* @param maxZoomLevel The maximum zoom level that can be used when zooming into the elements. Can be used to prevent zooming in past a given level. `1` by default.
|
|
237
|
+
* @param duration A duration for the animation in milliseconds. May be set to `0` or `undefined` to make it instant without animation.
|
|
219
238
|
*/
|
|
220
|
-
center(): void;
|
|
239
|
+
center(nodeIds?: string[], maxZoomLevel?: number, duration?: number): void;
|
|
221
240
|
/**
|
|
222
241
|
* Get the closest grid point to the given point.
|
|
223
242
|
* @public
|