@metadev/daga 4.2.2 → 4.2.4

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.
@@ -26,15 +26,10 @@ export interface DiagramConfig {
26
26
  */
27
27
  canvas?: CanvasConfig;
28
28
  /**
29
- * When true, connections made by the user will have their type assumed based on the type of the source and target nodes.
30
- * @default false
31
- */
32
- inferConnectionType?: boolean;
33
- /**
34
- * Id of the type of connection that is initially selected for the user to draw when drawing connections. By default, no type is selected.
35
- * @default undefined
29
+ * Configuration regarding the general settings of connections.
30
+ * @default {}
36
31
  */
37
- defaultConnection?: string;
32
+ connectionSettings?: ConnectionSettingsConfig;
38
33
  /**
39
34
  * Name of the layout format used to arrange the nodes of this diagram when pressing the layout button in the diagram buttons component.
40
35
  * @default undefined
@@ -88,6 +83,47 @@ export interface DiagramConfig {
88
83
  */
89
84
  properties?: Property[];
90
85
  }
86
+ /**
87
+ * Configuration regarding the general settings of connections.
88
+ * @public
89
+ */
90
+ export interface ConnectionSettingsConfig {
91
+ /**
92
+ * When true, connections made by the user will have their type assumed based on the type of the source and target nodes.
93
+ * @default false
94
+ */
95
+ inferConnectionType?: boolean;
96
+ /**
97
+ * Id of the type of connection that is initially selected for the user to draw when drawing connections. By default, no type is selected.
98
+ * @default undefined
99
+ */
100
+ defaultConnection?: string;
101
+ /**
102
+ * Automatically try to change the start and end ports of a connection to minimize the distance between them.
103
+ * @default true
104
+ */
105
+ autoTighten?: boolean;
106
+ /**
107
+ * Whether a connection can use the same port as start and end.
108
+ * @default false
109
+ */
110
+ allowLoops?: boolean;
111
+ /**
112
+ * Whether the same port can be used by two different connections.
113
+ * @default true
114
+ */
115
+ sharePorts?: boolean;
116
+ /**
117
+ * Whether two connections can use the same ports.
118
+ * @default false
119
+ */
120
+ shareBothPorts?: boolean;
121
+ /**
122
+ * Within what radius the closest port may be highlighted when drawing a new connection as a guide to the user.
123
+ * @default 100
124
+ */
125
+ portHighlightRadius?: number;
126
+ }
91
127
  /**
92
128
  * Configuration for which user actions are allowed in a diagram.
93
129
  * @public
@@ -314,6 +350,11 @@ export interface FieldConfig {
314
350
  * @default '#000000'
315
351
  */
316
352
  color?: string;
353
+ /**
354
+ * The background color of the text of this field.
355
+ * @default '#00000000'
356
+ */
357
+ backgroundColor?: string;
317
358
  /**
318
359
  * The color of the text of this field when selected.
319
360
  * @default '#000000'
@@ -71,20 +71,29 @@ export interface ShapedLook extends Look {
71
71
  lookType: 'shaped-look';
72
72
  /**
73
73
  * Shape of nodes using this look.
74
+ * @default 'rectangle'
74
75
  */
75
- shape: ClosedShape | ShapeFunction;
76
+ shape?: ClosedShape | ShapeFunction;
76
77
  /**
77
78
  * Background color of this look.
79
+ * @default '#FFFFFF'
78
80
  */
79
- fillColor: string;
81
+ fillColor?: string;
80
82
  /**
81
83
  * Border color of this look.
84
+ * @default '#000000'
82
85
  */
83
- borderColor: string;
86
+ borderColor?: string;
84
87
  /**
85
88
  * Border thickness of this look in diagram units.
89
+ * @default 1
90
+ */
91
+ borderThickness?: number;
92
+ /**
93
+ * Border style of this look.
94
+ * @default 'solid'
86
95
  */
87
- borderThickness: number;
96
+ borderStyle?: LineStyle;
88
97
  }
89
98
  /**
90
99
  * Configuration for a look given by an image.
@@ -201,20 +210,20 @@ export interface ConnectionLook extends Look {
201
210
  * Color of the line of connections of this type.
202
211
  * @default '#000000'
203
212
  */
204
- color: string;
213
+ color?: string;
205
214
  /**
206
215
  * Thickness of the line of connections of this type in diagram units.
207
216
  * @default 1
208
217
  */
209
- thickness: number;
218
+ thickness?: number;
210
219
  /**
211
220
  * Shape of the line of connections of this type.
212
221
  * @default 'straight'
213
222
  */
214
- shape: LineShape | LineFunction;
223
+ shape?: LineShape | LineFunction;
215
224
  /**
216
225
  * Style of the line of connections of this type.
217
226
  * @default 'solid'
218
227
  */
219
- style: LineStyle;
228
+ style?: LineStyle;
220
229
  }
@@ -36,22 +36,6 @@ export declare const DIAGRAM_CONNECTION_TYPE_DEFAULTS: {
36
36
  endTypes: never[];
37
37
  properties: never[];
38
38
  };
39
- /**
40
- * Whether a connection can have the same port as both its start port and its end port.
41
- */
42
- export declare const CAN_A_CONNECTION_END_ON_THE_SAME_PORT_IT_STARTS = false;
43
- /**
44
- * Whether a connection can have the same ports as another connection.
45
- */
46
- export declare const CAN_A_CONNECTION_HAVE_THE_SAME_PORTS_AS_ANOTHER = false;
47
- /**
48
- * Whether a port can have multiple connections.
49
- */
50
- export declare const CAN_CONNECTIONS_SHARE_PORTS = true;
51
- /**
52
- * Whether tightening connections is allowed.
53
- */
54
- export declare const CAN_TIGHTEN_CONNECTIONS = true;
55
39
  /**
56
40
  * The types allowed for the look of the markers of a connection.
57
41
  * @public
@@ -17,6 +17,7 @@ export declare const DIAGRAM_FIELD_DEFAULTS: {
17
17
  fontFamily: string;
18
18
  color: string;
19
19
  selectedColor: string;
20
+ backgroundColor: string;
20
21
  horizontalAlign: HorizontalAlign;
21
22
  verticalAlign: VerticalAlign;
22
23
  orientation: Side;
@@ -6,9 +6,13 @@
6
6
  */
7
7
  export declare class Property {
8
8
  /**
9
- * The name of this property. Used to distinguish this property from others.
9
+ * The name of this property. Used to distinguish this property from others. Must be unique.
10
10
  */
11
11
  name: string;
12
+ /**
13
+ * The label of this property. Used when displaying this property to the user.
14
+ */
15
+ label?: string;
12
16
  /**
13
17
  * The type of this property, which indicates the possible values that this property can have.
14
18
  */
@@ -20,13 +24,15 @@ export declare class Property {
20
24
  defaultValue?: unknown;
21
25
  /**
22
26
  * Whether this property should always appear in the property editor component.
27
+ * @default true
23
28
  * @see PropertyEditorComponent
24
29
  */
25
- basic: boolean;
30
+ basic?: boolean;
26
31
  /**
27
32
  * Whether the value of this property can be edited.
33
+ * @default true
28
34
  */
29
- editable: boolean;
35
+ editable?: boolean;
30
36
  /**
31
37
  * Which attribute of the parent component the value of this property is linked to. By default, it is not linked to any.
32
38
  * @default undefined
@@ -44,7 +50,7 @@ export declare class Property {
44
50
  * @default undefined
45
51
  */
46
52
  properties?: Property[];
47
- constructor(name: string, type: Type, defaultValue: unknown, basic: boolean, editable: boolean, rootAttribute?: string[] | string);
53
+ constructor(name: string, label: string | undefined, type: Type, defaultValue: unknown, basic: boolean | undefined, editable: boolean | undefined, rootAttribute?: string[] | string);
48
54
  }
49
55
  /**
50
56
  * Each of the possible values that a property of type option can have.
@@ -98,15 +98,40 @@ export interface Canvas {
98
98
  * @public
99
99
  */
100
100
  inferConnectionType: boolean;
101
- /**
102
- * If true, the next drag action will create a multiple selection rectangle.
103
- */
104
- multipleSelectionOn: boolean;
105
101
  /**
106
102
  * When a new connection is made, it should have this type.
107
103
  * @public
108
104
  */
109
105
  connectionType?: DiagramConnectionType;
106
+ /**
107
+ * Whether the start and end ports should automatically change to try to minimize the distance between them.
108
+ * @public
109
+ */
110
+ autoTightenConnections: boolean;
111
+ /**
112
+ * Whether a connection can use the same port as start and end.
113
+ * @public
114
+ */
115
+ allowConnectionLoops: boolean;
116
+ /**
117
+ * Whether the same port can be used by two different connections.
118
+ * @public
119
+ */
120
+ allowSharingPorts: boolean;
121
+ /**
122
+ * Whether two connections can use the same ports.
123
+ * @public
124
+ */
125
+ allowSharingBothPorts: boolean;
126
+ /**
127
+ * Within what radius the closest port may be highlighted when drawing a new connection as a guide to the user.
128
+ * @public
129
+ */
130
+ portHighlightRadius: number;
131
+ /**
132
+ * If true, the next drag action will create a multiple selection rectangle.
133
+ */
134
+ multipleSelectionOn: boolean;
110
135
  /**
111
136
  * Identifier of the current layout format used by the diagram.
112
137
  * @public