@metadev/daga 3.1.5 → 4.0.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/Changelog.md +6 -0
- package/index.cjs.js +653 -307
- package/index.esm.js +653 -307
- package/package.json +1 -1
- package/src/index.d.ts +4 -2
- package/src/lib/diagram/canvas/diagram-canvas-util.d.ts +26 -0
- package/src/lib/diagram/canvas/diagram-canvas.d.ts +1 -3
- package/src/lib/diagram/{diagram-config.d.ts → config/diagram-config.d.ts} +22 -231
- package/src/lib/diagram/config/diagram-look.d.ts +220 -0
- package/src/lib/diagram/model/diagram-connection.d.ts +86 -26
- package/src/lib/diagram/model/diagram-decorator.d.ts +8 -1
- package/src/lib/diagram/model/diagram-element.d.ts +4 -0
- package/src/lib/diagram/model/diagram-field.d.ts +1 -1
- package/src/lib/diagram/model/diagram-node.d.ts +38 -8
- package/src/lib/diagram/model/diagram-object.d.ts +8 -1
- package/src/lib/diagram/model/diagram-port.d.ts +47 -12
- package/src/lib/diagram/model/diagram-property.d.ts +18 -3
- package/src/lib/diagram/model/diagram-section.d.ts +44 -20
- package/src/lib/interfaces/canvas.d.ts +1 -1
- package/src/lib/util/test-util.d.ts +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Point } from '../../util/canvas-util';
|
|
2
|
-
import {
|
|
2
|
+
import { LineShape, LineStyle } from '../../util/line';
|
|
3
3
|
import { Side } from '../../util/svg-util';
|
|
4
|
-
import {
|
|
4
|
+
import { ConnectionTypeConfig, FieldConfig } from '../config/diagram-config';
|
|
5
|
+
import { ConnectionLook, ConnectionLookConfig, MarkerImageLook, MarkerImageLookConfig } from '../config/diagram-look';
|
|
5
6
|
import { DiagramElement, DiagramElementSet } from './diagram-element';
|
|
6
7
|
import { DiagramEntity, DiagramEntitySet } from './diagram-entity';
|
|
7
8
|
import { DiagramModel } from './diagram-model';
|
|
@@ -14,16 +15,24 @@ import { PropertySet, ValueSet } from './diagram-property';
|
|
|
14
15
|
*/
|
|
15
16
|
export declare const DIAGRAM_CONNECTION_TYPE_DEFAULTS: {
|
|
16
17
|
name: string;
|
|
17
|
-
width: number;
|
|
18
|
-
shape: LineShape;
|
|
19
|
-
style: LineStyle;
|
|
20
18
|
label: null;
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
look: {
|
|
20
|
+
lookType: string;
|
|
21
|
+
color: string;
|
|
22
|
+
thickness: number;
|
|
23
|
+
shape: LineShape;
|
|
24
|
+
style: LineStyle;
|
|
25
|
+
selected: {
|
|
26
|
+
color: string;
|
|
27
|
+
};
|
|
28
|
+
highlighted: {
|
|
29
|
+
thickness: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
startMarkerLook: undefined;
|
|
33
|
+
endMarkerLook: undefined;
|
|
23
34
|
startTypes: never[];
|
|
24
35
|
endTypes: never[];
|
|
25
|
-
color: string;
|
|
26
|
-
selectedColor: string;
|
|
27
36
|
properties: never[];
|
|
28
37
|
};
|
|
29
38
|
/**
|
|
@@ -42,6 +51,13 @@ export declare const CAN_CONNECTIONS_SHARE_PORTS = true;
|
|
|
42
51
|
* Whether tightening connections is allowed.
|
|
43
52
|
*/
|
|
44
53
|
export declare const CAN_TIGHTEN_CONNECTIONS = true;
|
|
54
|
+
/**
|
|
55
|
+
* The types allowed for the look of the markers of a connection.
|
|
56
|
+
* @public
|
|
57
|
+
* @see Look
|
|
58
|
+
* @see DiagramConnection
|
|
59
|
+
*/
|
|
60
|
+
export type ConnectionMarkerLook = MarkerImageLook;
|
|
45
61
|
/**
|
|
46
62
|
* A connection type, which holds properties that connections of this type share in common.
|
|
47
63
|
* @public
|
|
@@ -50,16 +66,21 @@ export declare const CAN_TIGHTEN_CONNECTIONS = true;
|
|
|
50
66
|
export declare class DiagramConnectionType implements DiagramEntity {
|
|
51
67
|
id: string;
|
|
52
68
|
name: string;
|
|
53
|
-
width: number;
|
|
54
|
-
shape: LineShape | LineFunction;
|
|
55
|
-
style: LineStyle;
|
|
56
69
|
label: FieldConfig | null;
|
|
70
|
+
defaultLook: ConnectionLook;
|
|
71
|
+
selectedLook: ConnectionLook;
|
|
72
|
+
highlightedLook: ConnectionLook;
|
|
73
|
+
selectedAndHighlightedLook: ConnectionLook;
|
|
57
74
|
defaultStartMarkerLook: ConnectionMarkerLook | null;
|
|
75
|
+
selectedStartMarkerLook: ConnectionMarkerLook | null;
|
|
76
|
+
highlightedStartMarkerLook: ConnectionMarkerLook | null;
|
|
77
|
+
selectedAndHighlightedStartMarkerLook: ConnectionMarkerLook | null;
|
|
58
78
|
defaultEndMarkerLook: ConnectionMarkerLook | null;
|
|
79
|
+
selectedEndMarkerLook: ConnectionMarkerLook | null;
|
|
80
|
+
highlightedEndMarkerLook: ConnectionMarkerLook | null;
|
|
81
|
+
selectedAndHighlightedEndMarkerLook: ConnectionMarkerLook | null;
|
|
59
82
|
startTypes: string[];
|
|
60
83
|
endTypes: string[];
|
|
61
|
-
color: string;
|
|
62
|
-
selectedColor: string;
|
|
63
84
|
propertySet: PropertySet;
|
|
64
85
|
constructor(options: ConnectionTypeConfig);
|
|
65
86
|
canStartFromType(type: string): boolean;
|
|
@@ -71,7 +92,11 @@ export declare class DiagramConnectionType implements DiagramEntity {
|
|
|
71
92
|
* @see DiagramPort
|
|
72
93
|
*/
|
|
73
94
|
export declare class DiagramConnection extends DiagramElement {
|
|
74
|
-
|
|
95
|
+
private _type;
|
|
96
|
+
get type(): DiagramConnectionType;
|
|
97
|
+
set type(type: DiagramConnectionType);
|
|
98
|
+
get typeString(): string;
|
|
99
|
+
set typeString(typeString: string);
|
|
75
100
|
/**
|
|
76
101
|
* Additional properties of this connection.
|
|
77
102
|
* @public
|
|
@@ -97,11 +122,6 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
97
122
|
* @public
|
|
98
123
|
*/
|
|
99
124
|
startCoords: Point;
|
|
100
|
-
/**
|
|
101
|
-
* Look of the marker of this connection at the start, or `null` if the connection has no start marker.
|
|
102
|
-
* @public
|
|
103
|
-
*/
|
|
104
|
-
startMarkerLook: ConnectionMarkerLook | null;
|
|
105
125
|
/**
|
|
106
126
|
* Port that this connection ends at.
|
|
107
127
|
* @public
|
|
@@ -117,11 +137,6 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
117
137
|
* @public
|
|
118
138
|
*/
|
|
119
139
|
endCoords: Point;
|
|
120
|
-
/**
|
|
121
|
-
* Look of the marker of this connection at the end, or `null` if the connection has no end marker.
|
|
122
|
-
* @public
|
|
123
|
-
*/
|
|
124
|
-
endMarkerLook: ConnectionMarkerLook | null;
|
|
125
140
|
/**
|
|
126
141
|
* Text at the start of this connection, or `''` if no text.
|
|
127
142
|
* @public
|
|
@@ -148,6 +163,51 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
148
163
|
*/
|
|
149
164
|
get name(): string;
|
|
150
165
|
set name(name: string);
|
|
166
|
+
private _defaultLook?;
|
|
167
|
+
private _selectedLook?;
|
|
168
|
+
private _highlightedLook?;
|
|
169
|
+
private _selectedAndHighlightedLook?;
|
|
170
|
+
/**
|
|
171
|
+
* Current look of the connection.
|
|
172
|
+
* @private
|
|
173
|
+
*/
|
|
174
|
+
get look(): ConnectionLook;
|
|
175
|
+
/**
|
|
176
|
+
* Sets the look configuration of the connection to override the one determined by the type.
|
|
177
|
+
* `undefined` resets it to the one determined by the type.
|
|
178
|
+
* @private
|
|
179
|
+
*/
|
|
180
|
+
set look(look: ConnectionLookConfig | undefined);
|
|
181
|
+
private _defaultStartMarkerLook?;
|
|
182
|
+
private _selectedStartMarkerLook?;
|
|
183
|
+
private _highlightedStartMarkerLook?;
|
|
184
|
+
private _selectedAndHighlightedStartMarkerLook?;
|
|
185
|
+
/**
|
|
186
|
+
* Current look of the start marker.
|
|
187
|
+
* @private
|
|
188
|
+
*/
|
|
189
|
+
get startMarkerLook(): MarkerImageLook | null;
|
|
190
|
+
/**
|
|
191
|
+
* Sets the look configuration of the start marker to override the one determined by the type.
|
|
192
|
+
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
193
|
+
* @private
|
|
194
|
+
*/
|
|
195
|
+
set startMarkerLook(startMarkerLook: MarkerImageLookConfig | null | undefined);
|
|
196
|
+
private _defaultEndMarkerLook?;
|
|
197
|
+
private _selectedEndMarkerLook?;
|
|
198
|
+
private _highlightedEndMarkerLook?;
|
|
199
|
+
private _selectedAndHighlightedEndMarkerLook?;
|
|
200
|
+
/**
|
|
201
|
+
* Current look of the end marker.
|
|
202
|
+
* @private
|
|
203
|
+
*/
|
|
204
|
+
get endMarkerLook(): MarkerImageLook | null;
|
|
205
|
+
/**
|
|
206
|
+
* Sets the look configuration of the end marker to override the one determined by the type.
|
|
207
|
+
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
208
|
+
* @private
|
|
209
|
+
*/
|
|
210
|
+
set endMarkerLook(endMarkerLook: MarkerImageLookConfig | null | undefined);
|
|
151
211
|
constructor(model: DiagramModel, type: DiagramConnectionType, start: DiagramPort | undefined, end: DiagramPort | undefined, id: string);
|
|
152
212
|
get removed(): boolean;
|
|
153
213
|
updateInView(): void;
|
|
@@ -192,7 +252,7 @@ export declare class DiagramConnectionSet extends DiagramElementSet<DiagramConne
|
|
|
192
252
|
* @param type The type of the connection given as either the type itself or the id of the type.
|
|
193
253
|
* @param start The start port of the connection.
|
|
194
254
|
* @param end The end port of the connection.
|
|
195
|
-
* @param id The id of the connection.
|
|
255
|
+
* @param id The id of the connection. Cannot be an empty string.
|
|
196
256
|
* @returns The instanced connection.
|
|
197
257
|
*/
|
|
198
258
|
new(type: DiagramConnectionType | string, start: DiagramPort | undefined, end: DiagramPort | undefined, id: string): DiagramConnection;
|
|
@@ -57,7 +57,14 @@ export declare class DiagramDecoratorSet extends DiagramElementSet<DiagramDecora
|
|
|
57
57
|
constructor(model: DiagramModel);
|
|
58
58
|
/**
|
|
59
59
|
* Instance a new decorator and add it to this set.
|
|
60
|
-
* @
|
|
60
|
+
* @public
|
|
61
|
+
* @param coords The coordinates of the top left corner of the decorator in the diagram.
|
|
62
|
+
* @param width The dimension of the decorator along the x axis.
|
|
63
|
+
* @param height The dimension of the decorator along the y axis.
|
|
64
|
+
* @param priority The priority of the decorator. Used when filtering by priority.
|
|
65
|
+
* @param html The html contents of the decorator.
|
|
66
|
+
* @param id The id of the decorator. Cannot be an empty string.
|
|
67
|
+
* @returns The instanced decorator.
|
|
61
68
|
*/
|
|
62
69
|
new(rootElement: DiagramNode | DiagramSection | undefined, coords: Point, width: number, height: number, priority: number, html: string, id: string): DiagramDecorator;
|
|
63
70
|
remove(id: string): void;
|
|
@@ -20,6 +20,10 @@ export declare abstract class DiagramElement implements DiagramEntity {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly model: DiagramModel;
|
|
22
22
|
private _id;
|
|
23
|
+
/**
|
|
24
|
+
* Identifier that uniquely identifies this element within its diagram model. Cannot be an empty string.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
23
27
|
get id(): string;
|
|
24
28
|
/**
|
|
25
29
|
* Whether this diagram element is currently in the user highlight.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Point } from '../../util/canvas-util';
|
|
2
2
|
import { HorizontalAlign, VerticalAlign } from '../../util/svg-util';
|
|
3
3
|
import { CollabTimestamp } from '../collab/primitives';
|
|
4
|
-
import { FieldConfig } from '../diagram-config';
|
|
4
|
+
import { FieldConfig } from '../config/diagram-config';
|
|
5
5
|
import { DiagramElement, DiagramElementSet } from './diagram-element';
|
|
6
6
|
import { DiagramModel } from './diagram-model';
|
|
7
7
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
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 { FieldConfig,
|
|
4
|
+
import { FieldConfig, NodeTypeConfig, PortConfig } from '../config/diagram-config';
|
|
5
|
+
import { ImageLook, ImageLookConfig, ShapedLook, ShapedLookConfig, StretchableImageLook, StretchableImageLookConfig } from '../config/diagram-look';
|
|
5
6
|
import { DiagramConnection } from './diagram-connection';
|
|
6
7
|
import { DiagramDecorator } from './diagram-decorator';
|
|
7
8
|
import { DiagramElement, DiagramElementSet } from './diagram-element';
|
|
@@ -10,13 +11,13 @@ import { DiagramField, LabeledElement } from './diagram-field';
|
|
|
10
11
|
import { DiagramModel } from './diagram-model';
|
|
11
12
|
import { DiagramPort } from './diagram-port';
|
|
12
13
|
import { PropertySet, ValueSet } from './diagram-property';
|
|
13
|
-
import { DiagramSection, DiagramSectionGeometry } from './diagram-section';
|
|
14
|
+
import { DiagramSection, DiagramSectionGeometry, DiagramSectionGrid } from './diagram-section';
|
|
14
15
|
/**
|
|
15
16
|
* Default values of the look of a diagram node.
|
|
16
17
|
* @private
|
|
17
18
|
* @see DIAGRAM_NODE_TYPE_DEFAULTS
|
|
18
19
|
*/
|
|
19
|
-
export declare const DIAGRAM_NODE_LOOK_DEFAULTS:
|
|
20
|
+
export declare const DIAGRAM_NODE_LOOK_DEFAULTS: ShapedLookConfig;
|
|
20
21
|
/**
|
|
21
22
|
* Default values of the parameters of a diagram node.
|
|
22
23
|
* @private
|
|
@@ -34,7 +35,7 @@ export declare const DIAGRAM_NODE_TYPE_DEFAULTS: {
|
|
|
34
35
|
label: null;
|
|
35
36
|
ports: never[];
|
|
36
37
|
sectionGrid: null;
|
|
37
|
-
look:
|
|
38
|
+
look: ShapedLookConfig;
|
|
38
39
|
isUnique: boolean;
|
|
39
40
|
canBeParentless: boolean;
|
|
40
41
|
childrenTypes: never[];
|
|
@@ -52,6 +53,13 @@ export type DiagramNodeGeometry = {
|
|
|
52
53
|
[childId: string]: DiagramNodeGeometry;
|
|
53
54
|
};
|
|
54
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* The types allowed for the look of a node.
|
|
58
|
+
* @public
|
|
59
|
+
* @see Look
|
|
60
|
+
* @see DiagramNode
|
|
61
|
+
*/
|
|
62
|
+
export type NodeLook = ShapedLook | ImageLook | StretchableImageLook;
|
|
55
63
|
/**
|
|
56
64
|
* A node type, which holds properties that nodes of this type share in common.
|
|
57
65
|
* @public
|
|
@@ -72,8 +80,11 @@ export declare class DiagramNodeType implements DiagramEntity {
|
|
|
72
80
|
topPadding: number;
|
|
73
81
|
label: FieldConfig | null;
|
|
74
82
|
ports: PortConfig[];
|
|
75
|
-
sectionGrid:
|
|
76
|
-
|
|
83
|
+
sectionGrid: DiagramSectionGrid | null;
|
|
84
|
+
defaultLook: NodeLook;
|
|
85
|
+
selectedLook: NodeLook;
|
|
86
|
+
highlightedLook: NodeLook;
|
|
87
|
+
selectedAndHighlightedLook: NodeLook;
|
|
77
88
|
isUnique: boolean;
|
|
78
89
|
canBeParentless: boolean;
|
|
79
90
|
childrenTypes: string[];
|
|
@@ -89,7 +100,11 @@ export declare class DiagramNodeType implements DiagramEntity {
|
|
|
89
100
|
* @see DiagramSection
|
|
90
101
|
*/
|
|
91
102
|
export declare class DiagramNode extends DiagramElement implements LabeledElement {
|
|
92
|
-
|
|
103
|
+
private _type;
|
|
104
|
+
get type(): DiagramNodeType;
|
|
105
|
+
set type(type: DiagramNodeType);
|
|
106
|
+
get typeString(): string;
|
|
107
|
+
set typeString(typeString: string);
|
|
93
108
|
/**
|
|
94
109
|
* Additional properties of this node.
|
|
95
110
|
* @public
|
|
@@ -156,6 +171,21 @@ export declare class DiagramNode extends DiagramElement implements LabeledElemen
|
|
|
156
171
|
*/
|
|
157
172
|
get name(): string;
|
|
158
173
|
set name(name: string);
|
|
174
|
+
private _defaultLook?;
|
|
175
|
+
private _selectedLook?;
|
|
176
|
+
private _highlightedLook?;
|
|
177
|
+
private _selectedAndHighlightedLook?;
|
|
178
|
+
/**
|
|
179
|
+
* Current look of this port.
|
|
180
|
+
* @private
|
|
181
|
+
*/
|
|
182
|
+
get look(): NodeLook;
|
|
183
|
+
/**
|
|
184
|
+
* Sets the look configuration of the look to override the one determined by the type.
|
|
185
|
+
* `undefined` resets it to the one determined by the type.
|
|
186
|
+
* @private
|
|
187
|
+
*/
|
|
188
|
+
set look(look: ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined);
|
|
159
189
|
constructor(model: DiagramModel, type: DiagramNodeType, coords: Point | undefined, id: string);
|
|
160
190
|
get removed(): boolean;
|
|
161
191
|
updateInView(): void;
|
|
@@ -261,7 +291,7 @@ export declare class DiagramNodeSet extends DiagramElementSet<DiagramNode> {
|
|
|
261
291
|
* @public
|
|
262
292
|
* @param type The type of the node given as either the type itself or the id of the type.
|
|
263
293
|
* @param coords The coordinates of the top left corner of the node in the diagram.
|
|
264
|
-
* @param id The id of the node.
|
|
294
|
+
* @param id The id of the node. Cannot be an empty string.
|
|
265
295
|
* @returns The instanced node.
|
|
266
296
|
*/
|
|
267
297
|
new(type: DiagramNodeType | string, coords: Point, id: string): DiagramNode;
|
|
@@ -46,7 +46,14 @@ export declare class DiagramObjectSet extends DiagramElementSet<DiagramObject> {
|
|
|
46
46
|
constructor(model: DiagramModel);
|
|
47
47
|
/**
|
|
48
48
|
* Instance a new object and add it to this set.
|
|
49
|
-
* @
|
|
49
|
+
* @public
|
|
50
|
+
* @param coords The coordinates of the top left corner of the object in the diagram.
|
|
51
|
+
* @param width The dimension of the object along the x axis.
|
|
52
|
+
* @param height The dimension of the object along the y axis.
|
|
53
|
+
* @param priority The priority of the object. Used when filtering by priority.
|
|
54
|
+
* @param html The html contents of the object.
|
|
55
|
+
* @param id The id of the object. Cannot be an empty string.
|
|
56
|
+
* @returns The instanced object.
|
|
50
57
|
*/
|
|
51
58
|
new(coords: Point, width: number, height: number, priority: number, html: string, id: string): DiagramObject;
|
|
52
59
|
remove(id: string): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Point } from '../../util/canvas-util';
|
|
2
2
|
import { Side } from '../../util/svg-util';
|
|
3
|
-
import { FieldConfig,
|
|
3
|
+
import { FieldConfig, PortTypeConfig } from '../config/diagram-config';
|
|
4
|
+
import { ImageLook, ImageLookConfig, ShapedLook, ShapedLookConfig } from '../config/diagram-look';
|
|
4
5
|
import { DiagramConnection } from './diagram-connection';
|
|
5
6
|
import { DiagramElement, DiagramElementSet } from './diagram-element';
|
|
6
7
|
import { DiagramEntity, DiagramEntitySet } from './diagram-entity';
|
|
@@ -9,14 +10,11 @@ import { DiagramModel } from './diagram-model';
|
|
|
9
10
|
import { DiagramNode } from './diagram-node';
|
|
10
11
|
import { DiagramSection } from './diagram-section';
|
|
11
12
|
/**
|
|
12
|
-
* Default values of the
|
|
13
|
+
* Default values of the look of a diagram port.
|
|
13
14
|
* @private
|
|
14
|
-
* @see
|
|
15
|
+
* @see DIAGRAM_NODE_TYPE_DEFAULTS
|
|
15
16
|
*/
|
|
16
|
-
export declare const
|
|
17
|
-
highlightedColor: string;
|
|
18
|
-
selectedColor: string;
|
|
19
|
-
};
|
|
17
|
+
export declare const DIAGRAM_PORT_LOOK_DEFAULTS: ShapedLookConfig;
|
|
20
18
|
/**
|
|
21
19
|
* Default values of the parameters of a diagram port.
|
|
22
20
|
* @private
|
|
@@ -28,7 +26,15 @@ export declare const DIAGRAM_PORT_TYPE_DEFAULTS: {
|
|
|
28
26
|
allowsOutgoing: boolean;
|
|
29
27
|
allowsIncoming: boolean;
|
|
30
28
|
width: number;
|
|
29
|
+
look: ShapedLookConfig;
|
|
31
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* The types allowed for the look of a port.
|
|
33
|
+
* @public
|
|
34
|
+
* @see Look
|
|
35
|
+
* @see DiagramPort
|
|
36
|
+
*/
|
|
37
|
+
export type PortLook = ShapedLook | ImageLook;
|
|
32
38
|
/**
|
|
33
39
|
* A port type, which holds properties that ports of this type share in common.
|
|
34
40
|
* @public
|
|
@@ -50,10 +56,10 @@ export declare class DiagramPortType implements DiagramEntity {
|
|
|
50
56
|
* Width of ports of this type in diagram units.
|
|
51
57
|
*/
|
|
52
58
|
width: number;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
defaultLook: PortLook;
|
|
60
|
+
selectedLook: PortLook;
|
|
61
|
+
highlightedLook: PortLook;
|
|
62
|
+
selectedAndHighlightedLook: PortLook;
|
|
57
63
|
constructor(options: PortTypeConfig);
|
|
58
64
|
}
|
|
59
65
|
/**
|
|
@@ -64,7 +70,11 @@ export declare class DiagramPortType implements DiagramEntity {
|
|
|
64
70
|
* @see DiagramSection
|
|
65
71
|
*/
|
|
66
72
|
export declare class DiagramPort extends DiagramElement implements LabeledElement {
|
|
67
|
-
|
|
73
|
+
private _type;
|
|
74
|
+
get type(): DiagramPortType | undefined;
|
|
75
|
+
set type(type: DiagramPortType | undefined);
|
|
76
|
+
get typeString(): string | undefined;
|
|
77
|
+
set typeString(typeString: string | undefined);
|
|
68
78
|
/**
|
|
69
79
|
* Element that this port belongs to.
|
|
70
80
|
* @public
|
|
@@ -114,6 +124,31 @@ export declare class DiagramPort extends DiagramElement implements LabeledElemen
|
|
|
114
124
|
*/
|
|
115
125
|
get name(): string;
|
|
116
126
|
set name(name: string);
|
|
127
|
+
private _defaultLook?;
|
|
128
|
+
private _selectedLook?;
|
|
129
|
+
private _highlightedLook?;
|
|
130
|
+
private _selectedAndHighlightedLook?;
|
|
131
|
+
/**
|
|
132
|
+
* Current look of this port.
|
|
133
|
+
* @private
|
|
134
|
+
*/
|
|
135
|
+
get look(): PortLook;
|
|
136
|
+
/**
|
|
137
|
+
* Sets the look configuration of the look to override the one determined by the type.
|
|
138
|
+
* `undefined` resets it to the one determined by the type.
|
|
139
|
+
* @private
|
|
140
|
+
*/
|
|
141
|
+
set look(look: ShapedLookConfig | ImageLookConfig | undefined);
|
|
142
|
+
/**
|
|
143
|
+
* Current width of this port.
|
|
144
|
+
* @private
|
|
145
|
+
*/
|
|
146
|
+
get width(): number;
|
|
147
|
+
/**
|
|
148
|
+
* Current height of this port. Same as the width.
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
151
|
+
get height(): number;
|
|
117
152
|
constructor(model: DiagramModel, type: DiagramPortType | undefined, rootElement: DiagramNode | DiagramSection | undefined, coords: Point, connectionPoint: Point | undefined, direction: Side, id: string);
|
|
118
153
|
get removed(): boolean;
|
|
119
154
|
updateInView(): void;
|
|
@@ -157,9 +157,7 @@ export declare class ValueSet {
|
|
|
157
157
|
propertySet: PropertySet;
|
|
158
158
|
displayedProperties: Property[];
|
|
159
159
|
hiddenProperties: Property[];
|
|
160
|
-
values
|
|
161
|
-
[key: string]: unknown;
|
|
162
|
-
};
|
|
160
|
+
private values;
|
|
163
161
|
private valueSets;
|
|
164
162
|
/**
|
|
165
163
|
* Collaborative timestamps for all keys in this.values that have ever been set,
|
|
@@ -344,6 +342,23 @@ export declare const diff: (a: {
|
|
|
344
342
|
}, {
|
|
345
343
|
[key: string]: unknown;
|
|
346
344
|
}];
|
|
345
|
+
/**
|
|
346
|
+
* Calculates the differences between the two given values of a valueset and returns two objects containing the differences in each relative to the other.
|
|
347
|
+
*
|
|
348
|
+
* @param a An object.
|
|
349
|
+
* @param b An object.
|
|
350
|
+
* @param valueSet A ValueSet to use as reference for the keys and types of each property.
|
|
351
|
+
* @returns A tuple of two objects with each containing the keys that have a different value in the corresponding argument compared to the other argument.
|
|
352
|
+
*/
|
|
353
|
+
export declare const diffProperties: (a: {
|
|
354
|
+
[key: string]: unknown;
|
|
355
|
+
}, b: {
|
|
356
|
+
[key: string]: unknown;
|
|
357
|
+
}, valueSet: ValueSet) => [{
|
|
358
|
+
[key: string]: unknown;
|
|
359
|
+
}, {
|
|
360
|
+
[key: string]: unknown;
|
|
361
|
+
}];
|
|
347
362
|
/**
|
|
348
363
|
* Checks if the given value is an object.
|
|
349
364
|
* @public
|
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
import { Point } from '../../util/canvas-util';
|
|
2
2
|
import { Side } from '../../util/svg-util';
|
|
3
|
-
import { SectionConfig,
|
|
3
|
+
import { FieldConfig, PortConfig, SectionConfig, SectionGridConfig } from '../config/diagram-config';
|
|
4
|
+
import { ImageLookConfig, ShapedLookConfig, StretchableImageLookConfig } from '../config/diagram-look';
|
|
4
5
|
import { DiagramConnection } from './diagram-connection';
|
|
5
6
|
import { DiagramDecorator } from './diagram-decorator';
|
|
6
7
|
import { DiagramElement, DiagramElementSet } from './diagram-element';
|
|
7
8
|
import { DiagramField, LabeledElement } from './diagram-field';
|
|
8
9
|
import { DiagramModel } from './diagram-model';
|
|
9
|
-
import { DiagramNode } from './diagram-node';
|
|
10
|
+
import { DiagramNode, NodeLook } from './diagram-node';
|
|
10
11
|
import { DiagramPort } from './diagram-port';
|
|
11
|
-
/**
|
|
12
|
-
* Default values of the look of a diagram section.
|
|
13
|
-
* @private
|
|
14
|
-
* @see DIAGRAM_SECTION_DEFAULTS
|
|
15
|
-
*/
|
|
16
|
-
export declare const DIAGRAM_SECTION_LOOK_DEFAULTS: ShapedLook;
|
|
17
|
-
/**
|
|
18
|
-
* Default values of the parameters of a diagram section.
|
|
19
|
-
* @private
|
|
20
|
-
* @see DiagramSection
|
|
21
|
-
*/
|
|
22
|
-
export declare const DIAGRAM_SECTION_DEFAULTS: {
|
|
23
|
-
label: null;
|
|
24
|
-
ports: never[];
|
|
25
|
-
look: ShapedLook;
|
|
26
|
-
priority: number;
|
|
27
|
-
};
|
|
28
12
|
/**
|
|
29
13
|
* Default value of the default width of a diagram section.
|
|
30
14
|
* @private
|
|
@@ -54,6 +38,31 @@ export type DiagramSectionGeometry = {
|
|
|
54
38
|
readonly width: number;
|
|
55
39
|
readonly height: number;
|
|
56
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* A grid of sections which a node has.
|
|
43
|
+
* @public
|
|
44
|
+
* @see DiagramNode
|
|
45
|
+
* @see SectionGridConfig
|
|
46
|
+
*/
|
|
47
|
+
export declare class DiagramSectionGrid {
|
|
48
|
+
defaultWidths: number[] | null;
|
|
49
|
+
defaultHeights: number[] | null;
|
|
50
|
+
minWidths: number[] | null;
|
|
51
|
+
minHeights: number[] | null;
|
|
52
|
+
margin: number;
|
|
53
|
+
sections: DiagramSectionType[][];
|
|
54
|
+
constructor(options: SectionGridConfig);
|
|
55
|
+
}
|
|
56
|
+
export declare class DiagramSectionType {
|
|
57
|
+
label: FieldConfig | null;
|
|
58
|
+
ports: PortConfig[];
|
|
59
|
+
defaultLook: NodeLook;
|
|
60
|
+
selectedLook: NodeLook;
|
|
61
|
+
highlightedLook: NodeLook;
|
|
62
|
+
selectedAndHighlightedLook: NodeLook;
|
|
63
|
+
priority: number;
|
|
64
|
+
constructor(options: SectionConfig);
|
|
65
|
+
}
|
|
57
66
|
/**
|
|
58
67
|
* A section of a node which can have connections and display a property of the node.
|
|
59
68
|
* @public
|
|
@@ -111,11 +120,26 @@ export declare class DiagramSection extends DiagramElement implements LabeledEle
|
|
|
111
120
|
*/
|
|
112
121
|
get name(): string;
|
|
113
122
|
set name(name: string);
|
|
123
|
+
private _defaultLook?;
|
|
124
|
+
private _selectedLook?;
|
|
125
|
+
private _highlightedLook?;
|
|
126
|
+
private _selectedAndHighlightedLook?;
|
|
127
|
+
/**
|
|
128
|
+
* Current look of this port.
|
|
129
|
+
* @private
|
|
130
|
+
*/
|
|
131
|
+
get look(): NodeLook;
|
|
132
|
+
/**
|
|
133
|
+
* Sets the look configuration of the look to override the one determined by the type.
|
|
134
|
+
* `undefined` resets it to the one determined by the type.
|
|
135
|
+
* @private
|
|
136
|
+
*/
|
|
137
|
+
set look(look: ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined);
|
|
114
138
|
constructor(model: DiagramModel, node: DiagramNode | undefined, indexXInNode: number, indexYInNode: number, coords: Point, width: number, height: number, id: string);
|
|
115
139
|
get removed(): boolean;
|
|
116
140
|
updateInView(): void;
|
|
117
141
|
raise(): void;
|
|
118
|
-
|
|
142
|
+
get type(): DiagramSectionType | undefined;
|
|
119
143
|
getMinWidth(): number;
|
|
120
144
|
getMinHeight(): number;
|
|
121
145
|
getPriority(): number;
|
|
@@ -4,7 +4,7 @@ import { DiagramUserHighlight } from '../diagram/canvas/diagram-user-highlight';
|
|
|
4
4
|
import { DiagramUserSelection } from '../diagram/canvas/diagram-user-selection';
|
|
5
5
|
import { CollabEngine } from '../diagram/collab/collab-engine';
|
|
6
6
|
import { ActionStack, DiagramAction, DiagramActionMethod, DiagramActions } from '../diagram/diagram-action';
|
|
7
|
-
import { UserActionConfig } from '../diagram/diagram-config';
|
|
7
|
+
import { UserActionConfig } from '../diagram/config/diagram-config';
|
|
8
8
|
import { DiagramEvent } from '../diagram/diagram-event';
|
|
9
9
|
import { DiagramConnectionType } from '../diagram/model/diagram-connection';
|
|
10
10
|
import { DiagramModel } from '../diagram/model/diagram-model';
|