@metadev/daga 1.5.7 → 2.0.2

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.
Files changed (137) hide show
  1. package/Changelog.md +30 -1
  2. package/README.md +67 -30
  3. package/assets/daga-logo.svg +10 -0
  4. package/index.cjs.d.ts +1 -0
  5. package/index.cjs.default.js +1 -0
  6. package/index.cjs.js +8085 -0
  7. package/index.cjs.mjs +2 -0
  8. package/index.esm.d.ts +1 -0
  9. package/index.esm.js +7999 -0
  10. package/package.json +19 -37
  11. package/src/index.d.ts +49 -0
  12. package/src/lib/core.d.ts +1 -0
  13. package/{lib/diagram-editor/diagram → src/lib/diagram/canvas}/diagram-canvas.d.ts +69 -66
  14. package/src/lib/diagram/canvas/diagram-context-menu.d.ts +27 -0
  15. package/src/lib/diagram/canvas/diagram-user-highlight.d.ts +30 -0
  16. package/src/lib/diagram/canvas/diagram-user-selection.d.ts +74 -0
  17. package/{lib/diagram-editor → src/lib}/diagram/collab/collab-action.d.ts +36 -12
  18. package/{lib/diagram-editor → src/lib}/diagram/collab/collab-client.d.ts +1 -1
  19. package/{lib/diagram-editor → src/lib}/diagram/collab/collab-engine.d.ts +1 -1
  20. package/{lib/diagram-editor → src/lib}/diagram/collab/message-types.d.ts +3 -8
  21. package/{lib/diagram-editor → src/lib}/diagram/converters/daga-exporter.d.ts +6 -6
  22. package/{lib/diagram-editor → src/lib}/diagram/converters/daga-importer.d.ts +6 -4
  23. package/{lib/diagram-editor → src/lib}/diagram/converters/daga-model.d.ts +3 -3
  24. package/{lib/diagram-editor → src/lib}/diagram/converters/diagram-model-exporter.d.ts +2 -2
  25. package/{lib/diagram-editor → src/lib}/diagram/converters/diagram-model-importer.d.ts +2 -2
  26. package/{lib/diagram-editor → src/lib}/diagram/diagram-action.d.ts +75 -55
  27. package/{lib/diagram-editor → src/lib}/diagram/diagram-config.d.ts +139 -84
  28. package/{lib/diagram-editor → src/lib}/diagram/diagram-event.d.ts +3 -3
  29. package/{lib/diagram-editor → src/lib}/diagram/layout/adjacency-layout.d.ts +1 -1
  30. package/{lib/diagram-editor → src/lib}/diagram/layout/breadth-adjacency-layout.d.ts +1 -1
  31. package/{lib/diagram-editor → src/lib}/diagram/layout/breadth-layout.d.ts +1 -1
  32. package/{lib/diagram-editor → src/lib}/diagram/layout/diagram-layout.d.ts +1 -1
  33. package/{lib/diagram-editor → src/lib}/diagram/layout/force-layout.d.ts +1 -1
  34. package/{lib/diagram-editor → src/lib}/diagram/layout/horizontal-layout.d.ts +1 -1
  35. package/{lib/diagram-editor → src/lib}/diagram/layout/priority-layout.d.ts +1 -1
  36. package/{lib/diagram-editor → src/lib}/diagram/layout/tree-layout.d.ts +1 -1
  37. package/{lib/diagram-editor → src/lib}/diagram/layout/vertical-layout.d.ts +1 -1
  38. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-connection.d.ts +4 -4
  39. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-element.d.ts +7 -11
  40. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-entity.d.ts +2 -2
  41. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-field.d.ts +4 -4
  42. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-model.d.ts +15 -15
  43. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-node.d.ts +7 -7
  44. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-property.d.ts +46 -31
  45. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-section.d.ts +8 -8
  46. package/{lib → src/lib}/errors/diagram-validator.d.ts +1 -1
  47. package/{lib → src/lib}/interfaces/canvas.d.ts +79 -107
  48. package/{lib → src/lib}/interfaces/diagram-buttons.d.ts +8 -8
  49. package/{lib → src/lib}/interfaces/diagram-editor.d.ts +4 -11
  50. package/{lib → src/lib}/interfaces/palette.d.ts +2 -2
  51. package/{lib → src/lib}/interfaces/property-editor.d.ts +5 -5
  52. package/{lib → src/lib}/util/canvas-util.d.ts +20 -5
  53. package/src/lib/util/device-util.d.ts +5 -0
  54. package/{lib → src/lib}/util/events.d.ts +4 -4
  55. package/{lib → src/lib}/util/style.d.ts +1 -0
  56. package/src/lib/util/test-util.d.ts +11 -0
  57. package/assets/fonts/DMMono-Medium.ttf +0 -0
  58. package/assets/fonts/DMMono-Medium.woff +0 -0
  59. package/assets/fonts/DMMono-Medium.woff2 +0 -0
  60. package/assets/fonts/WonderUnitSans-Medium.ttf +0 -0
  61. package/assets/fonts/WonderUnitSans-Medium.woff +0 -0
  62. package/assets/fonts/WonderUnitSans-Medium.woff2 +0 -0
  63. package/assets/icon/action/drop-down-arrow.svg +0 -8
  64. package/assets/icon/action/drop-horizontal-left.svg +0 -14
  65. package/assets/icon/action/drop-horizontal-none.svg +0 -13
  66. package/assets/icon/action/drop-horizontal-right.svg +0 -14
  67. package/assets/icon/action/drop-vertical-down.svg +0 -14
  68. package/assets/icon/action/drop-vertical-none.svg +0 -13
  69. package/assets/icon/action/drop-vertical-up.svg +0 -14
  70. package/assets/icon/action/filter-clear.png +0 -0
  71. package/assets/icon/buttons/center-hover.svg +0 -10
  72. package/assets/icon/buttons/center.svg +0 -10
  73. package/assets/icon/buttons/ellipsis-hover.svg +0 -7
  74. package/assets/icon/buttons/ellipsis.svg +0 -7
  75. package/assets/icon/buttons/filter-off-hover.svg +0 -5
  76. package/assets/icon/buttons/filter-off.svg +0 -5
  77. package/assets/icon/buttons/filter-on-hover.svg +0 -5
  78. package/assets/icon/buttons/filter-on.svg +0 -5
  79. package/assets/icon/buttons/layout-hover.svg +0 -8
  80. package/assets/icon/buttons/layout.svg +0 -8
  81. package/assets/icon/buttons/redo-hover.svg +0 -5
  82. package/assets/icon/buttons/redo.svg +0 -5
  83. package/assets/icon/buttons/undo-hover.svg +0 -5
  84. package/assets/icon/buttons/undo.svg +0 -5
  85. package/assets/icon/buttons/zoom-in-hover.svg +0 -8
  86. package/assets/icon/buttons/zoom-in.svg +0 -8
  87. package/assets/icon/buttons/zoom-out-hover.svg +0 -7
  88. package/assets/icon/buttons/zoom-out.svg +0 -7
  89. package/assets/icon/context/copy.svg +0 -4
  90. package/assets/icon/context/cross.svg +0 -3
  91. package/assets/icon/context/cut.svg +0 -4
  92. package/assets/icon/context/delete.svg +0 -4
  93. package/assets/icon/context/paste.svg +0 -4
  94. package/assets/icon/property/add.svg +0 -23
  95. package/assets/icon/property/close.svg +0 -3
  96. package/assets/icon/property/ellipsis.svg +0 -5
  97. package/assets/icon/property/gear.svg +0 -3
  98. package/assets/icon/property/hide.svg +0 -10
  99. package/assets/icon/property/move.svg +0 -35
  100. package/assets/styles/_collapse-button.scss +0 -37
  101. package/assets/styles/_context-menu.scss +0 -32
  102. package/assets/styles/_diagram-buttons.scss +0 -166
  103. package/assets/styles/_diagram.scss +0 -15
  104. package/assets/styles/_errors.scss +0 -83
  105. package/assets/styles/_palette.scss +0 -20
  106. package/assets/styles/_property-editor.scss +0 -285
  107. package/assets/styles/daga.scss +0 -150
  108. package/fesm2022/metadev-daga.mjs +0 -10977
  109. package/fesm2022/metadev-daga.mjs.map +0 -1
  110. package/index.d.ts +0 -55
  111. package/lib/collapse-button/collapse-button.component.d.ts +0 -22
  112. package/lib/daga.module.d.ts +0 -18
  113. package/lib/diagram/diagram.component.d.ts +0 -44
  114. package/lib/diagram-buttons/diagram-buttons.component.d.ts +0 -44
  115. package/lib/diagram-editor/diagram-editor.component.d.ts +0 -38
  116. package/lib/errors/errors.component.d.ts +0 -26
  117. package/lib/palette/palette.component.d.ts +0 -39
  118. package/lib/property-editor/autocomplete/autocomplete.component.d.ts +0 -39
  119. package/lib/property-editor/object-editor/object-editor.component.d.ts +0 -30
  120. package/lib/property-editor/option-list-editor/option-list-editor.component.d.ts +0 -33
  121. package/lib/property-editor/property-editor.component.d.ts +0 -34
  122. package/lib/property-editor/property-settings/property-settings.component.d.ts +0 -35
  123. package/lib/property-editor/text-list-editor/text-list-editor.component.d.ts +0 -29
  124. package/lib/property-editor/text-map-editor/text-map-editor.component.d.ts +0 -36
  125. package/lib/services/canvas-provider.service.d.ts +0 -32
  126. package/lib/services/daga-configuration.service.d.ts +0 -23
  127. package/{lib/diagram-editor → src/lib}/diagram/collab/primitives.d.ts +0 -0
  128. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-decorator.d.ts +1 -1
  129. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-object.d.ts +0 -0
  130. package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-port.d.ts +2 -2
  131. package/{lib → src/lib}/errors/diagram-error.d.ts +3 -3
  132. package/{lib → src/lib}/util/grid.d.ts +0 -0
  133. package/{lib → src/lib}/util/line.d.ts +0 -0
  134. package/{lib → src/lib}/util/list-util.d.ts +0 -0
  135. package/{lib → src/lib}/util/shape.d.ts +10 -10
  136. /package/{lib → src/lib}/util/svg-util.d.ts +0 -0
  137. /package/{lib → src/lib}/util/text-util.d.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import * as d3 from 'd3';
2
- import { CollabTimestamp } from './collab/primitives';
2
+ import { CollabTimestamp } from '../collab/primitives';
3
3
  import { DiagramEntity, DiagramEntitySet } from './diagram-entity';
4
4
  import { DiagramModel } from './diagram-model';
5
5
  /**
@@ -18,19 +18,18 @@ export declare abstract class DiagramElement implements DiagramEntity {
18
18
  * Diagram model this diagram element is part of.
19
19
  * @private
20
20
  */
21
- model: DiagramModel;
21
+ readonly model: DiagramModel;
22
22
  private _id;
23
23
  get id(): string;
24
24
  /**
25
- * Whether this diagram element is currently highlighted by the user.
25
+ * Whether this diagram element is currently in the user highlight.
26
26
  * @private
27
27
  */
28
- highlighted: boolean;
28
+ get highlighted(): boolean;
29
29
  /**
30
- * Whether this diagram element is currently selected by the user.
31
- * @private
30
+ * Whether this diagram element is currently in the user selection.
32
31
  */
33
- selected: boolean;
32
+ get selected(): boolean;
34
33
  /**
35
34
  * Whether this diagram element has itself been explicitly removed.
36
35
  *
@@ -83,10 +82,7 @@ export declare class DiagramElementSet<E extends DiagramElement> extends Diagram
83
82
  find(predicate: (value: E, index: number, array: E[]) => unknown, includeRemoved?: boolean): E | undefined;
84
83
  get(id: string, includeRemoved?: boolean): E | undefined;
85
84
  map<R>(callback: (value: E, index: number, array: E[]) => R, includeRemoved?: boolean): R[];
86
- /**
87
- * Gets the number of entities in this set.
88
- * @public
89
- */
85
+ remove(id: string): void;
90
86
  size(includeRemoved?: boolean): number;
91
87
  [Symbol.iterator](includeRemoved?: boolean): Iterator<E>;
92
88
  }
@@ -21,12 +21,12 @@ export declare class DiagramEntitySet<E extends DiagramEntity> implements Iterab
21
21
  * The list of entities contained in this set.
22
22
  * @private
23
23
  */
24
- protected entities: E[];
24
+ protected readonly entities: E[];
25
25
  /**
26
26
  * A mapping of entity ids to their corresponding entity in this set for quickly fetching entities based on their id.
27
27
  * @private
28
28
  */
29
- protected entityMap: {
29
+ protected readonly entityMap: {
30
30
  [id: string]: E;
31
31
  };
32
32
  /**
@@ -1,7 +1,7 @@
1
1
  import { Point } from '../../util/canvas-util';
2
2
  import { HorizontalAlign, VerticalAlign } from '../../util/svg-util';
3
- import { CollabTimestamp } from './collab/primitives';
4
- import { FieldConfig } from './diagram-config';
3
+ import { CollabTimestamp } from '../collab/primitives';
4
+ import { FieldConfig } from '../diagram-config';
5
5
  import { DiagramElement, DiagramElementSet } from './diagram-element';
6
6
  import { DiagramModel } from './diagram-model';
7
7
  import { DiagramNode } from './diagram-node';
@@ -9,8 +9,8 @@ import { DiagramPort } from './diagram-port';
9
9
  import { DiagramSection } from './diagram-section';
10
10
  /**
11
11
  * Default values of the parameters of a diagram field.
12
- * @see DiagramField
13
12
  * @private
13
+ * @see DiagramField
14
14
  */
15
15
  export declare const DIAGRAM_FIELD_DEFAULTS: {
16
16
  editable: boolean;
@@ -26,10 +26,10 @@ export declare const DIAGRAM_FIELD_DEFAULTS: {
26
26
  };
27
27
  /**
28
28
  * A field which displays text and is part of a diagram element.
29
+ * @public
29
30
  * @see DiagramNode
30
31
  * @see DiagramPort
31
32
  * @see DiagramSection
32
- * @public
33
33
  */
34
34
  export declare class DiagramField extends DiagramElement {
35
35
  /**
@@ -17,49 +17,49 @@ export declare class DiagramModel {
17
17
  * The canvas where this model's data is being rendered.
18
18
  * @private
19
19
  */
20
- canvas?: Canvas;
20
+ readonly canvas?: Canvas;
21
21
  /**
22
22
  * Nodes of this model.
23
- * @see DiagramNode
24
23
  * @public
24
+ * @see DiagramNode
25
25
  */
26
- nodes: DiagramNodeSet;
26
+ readonly nodes: DiagramNodeSet;
27
27
  /**
28
28
  * Sections of this model.
29
- * @see DiagramSection
30
29
  * @public
30
+ * @see DiagramSection
31
31
  */
32
- sections: DiagramSectionSet;
32
+ readonly sections: DiagramSectionSet;
33
33
  /**
34
34
  * Ports of this model.
35
- * @see DiagramPort
36
35
  * @public
36
+ * @see DiagramPort
37
37
  */
38
- ports: DiagramPortSet;
38
+ readonly ports: DiagramPortSet;
39
39
  /**
40
40
  * Connections of this model.
41
- * @see DiagramConnection
42
41
  * @public
42
+ * @see DiagramConnection
43
43
  */
44
- connections: DiagramConnectionSet;
44
+ readonly connections: DiagramConnectionSet;
45
45
  /**
46
46
  * Fields of this model.
47
- * @see DiagramField
48
47
  * @public
48
+ * @see DiagramField
49
49
  */
50
- fields: DiagramFieldSet;
50
+ readonly fields: DiagramFieldSet;
51
51
  /**
52
52
  * Objects of this model.
53
- * @see DiagramObject
54
53
  * @public
54
+ * @see DiagramObject
55
55
  */
56
- objects: DiagramObjectSet;
56
+ readonly objects: DiagramObjectSet;
57
57
  /**
58
58
  * Decorators of this model.
59
- * @see DiagramDecorator
60
59
  * @public
60
+ * @see DiagramDecorator
61
61
  */
62
- decorators: DiagramDecoratorSet;
62
+ readonly decorators: DiagramDecoratorSet;
63
63
  /**
64
64
  * Identifier of this diagram. Set by the consumer of the diagram.
65
65
  * @public
@@ -1,7 +1,7 @@
1
1
  import { Point } from '../../util/canvas-util';
2
2
  import { Side } from '../../util/svg-util';
3
- import { CollabTimestamp } from './collab/primitives';
4
- import { FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTypeConfig, PortConfig, SectionGridConfig } from './diagram-config';
3
+ import { CollabTimestamp } from '../collab/primitives';
4
+ import { FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTypeConfig, PortConfig, SectionGridConfig } from '../diagram-config';
5
5
  import { DiagramConnection } from './diagram-connection';
6
6
  import { DiagramDecorator } from './diagram-decorator';
7
7
  import { DiagramElement, DiagramElementSet } from './diagram-element';
@@ -13,14 +13,14 @@ import { PropertySet, ValueSet } from './diagram-property';
13
13
  import { DiagramSection, DiagramSectionGeometry } from './diagram-section';
14
14
  /**
15
15
  * Default values of the look of a diagram node.
16
- * @see DIAGRAM_NODE_TYPE_DEFAULTS
17
16
  * @private
17
+ * @see DIAGRAM_NODE_TYPE_DEFAULTS
18
18
  */
19
19
  export declare const DIAGRAM_NODE_LOOK_DEFAULTS: NodeShapedLook;
20
20
  /**
21
21
  * Default values of the parameters of a diagram node.
22
- * @see DiagramNode
23
22
  * @private
23
+ * @see DiagramNode
24
24
  */
25
25
  export declare const DIAGRAM_NODE_TYPE_DEFAULTS: {
26
26
  name: string;
@@ -48,11 +48,11 @@ export type DiagramNodeGeometry = {
48
48
  };
49
49
  /**
50
50
  * A node type, which holds properties that nodes of this type share in common.
51
- * @see NodeTypeConfig
52
51
  * @public
52
+ * @see NodeTypeConfig
53
53
  */
54
54
  export declare class DiagramNodeType implements DiagramEntity {
55
- id: string;
55
+ readonly id: string;
56
56
  name: string;
57
57
  defaultWidth: number;
58
58
  defaultHeight: number;
@@ -71,10 +71,10 @@ export declare class DiagramNodeType implements DiagramEntity {
71
71
  }
72
72
  /**
73
73
  * A node, the most basic element of a diagram, which can have connections to other nodes through its ports or be divided into sections.
74
+ * @public
74
75
  * @see DiagramConnection
75
76
  * @see DiagramPort
76
77
  * @see DiagramSection
77
- * @public
78
78
  */
79
79
  export declare class DiagramNode extends DiagramElement {
80
80
  type: DiagramNodeType;
@@ -1,9 +1,9 @@
1
- import { CollabTimestamp, CollabTimestampSet } from './collab/primitives';
1
+ import { CollabTimestamp, CollabTimestampSet } from '../collab/primitives';
2
2
  /**
3
3
  * A property which is part of a property set and defines what values a value in a value set can take.
4
+ * @public
4
5
  * @see PropertySet
5
6
  * @see ValueSet
6
- * @private
7
7
  */
8
8
  export declare class Property {
9
9
  /**
@@ -29,17 +29,19 @@ export declare class Property {
29
29
  */
30
30
  editable: boolean;
31
31
  /**
32
- * Which attribute of the parent component the value of this property is linked to. `undefined` if none.
32
+ * Which attribute of the parent component the value of this property is linked to. By default, it is not linked to any.
33
33
  * @default undefined
34
34
  */
35
35
  rootAttribute?: string[] | string;
36
36
  /**
37
- * The list of possible values if the value of the property is chosen from a set of possible values. Undefined otherwise.
37
+ * The list of possible values if the value of the property is chosen from a set of possible values.
38
+ * Should be set if the type of this property is `'option'` or 'option-list'. Otherwise, it should not be set.
38
39
  * @default undefined
39
40
  */
40
41
  options?: Option<unknown>[];
41
42
  /**
42
- * The list of properties that are part of this property if the type of this property is `'object'`.
43
+ * The list of properties that are part of this property if this property is composed of other properties.
44
+ * Should be set if the type of this property is `'object'`. Otherwise, it should not be set.
43
45
  * @default undefined
44
46
  */
45
47
  properties?: Property[];
@@ -56,8 +58,8 @@ export interface Option<T> {
56
58
  }
57
59
  /**
58
60
  * The type that a property can have.
61
+ * @public
59
62
  * @see Property
60
- * @private
61
63
  */
62
64
  export declare enum Type {
63
65
  /**
@@ -129,9 +131,9 @@ export declare enum Type {
129
131
  }
130
132
  /**
131
133
  * A set of properties based on which a set of values of those properties can be created.
134
+ * @public
132
135
  * @see Property
133
136
  * @see ValueSet
134
- * @private
135
137
  */
136
138
  export declare class PropertySet {
137
139
  propertyMap: {
@@ -145,8 +147,8 @@ export declare class PropertySet {
145
147
  }
146
148
  /**
147
149
  * A set of values corresponding to a set of properties.
150
+ * @public
148
151
  * @see PropertySet
149
- * @private
150
152
  */
151
153
  export declare class ValueSet {
152
154
  rootElement: {
@@ -166,15 +168,15 @@ export declare class ValueSet {
166
168
  private ownTimestamps;
167
169
  constructor(propertySet: PropertySet, rootElement: unknown);
168
170
  /**
169
- * Get the value of the root element attribute under the given keys.
171
+ * Gets the value of the root element attribute under the given keys.
170
172
  * If given an array of keys, the value is found under repeated lookups to enable obtaining nested values.
171
- * @private
173
+ * @public
172
174
  * @param rootAttribute A key or array of keys to look up in the root element.
173
175
  * @returns The value if it could be found, `undefined` if nothing could be found.
174
176
  */
175
177
  getRootElementValue(rootAttribute: string[] | string | null): unknown;
176
178
  /**
177
- * Set the value of the root element's attribute under the given keys.
179
+ * Sets the value of the root element's attribute under the given keys.
178
180
  * If given an array of keys, the value is found under repeated lookups to enable setting nested values.
179
181
  * If the root element has a function `updateInView()`, it is called upon successful setting of the value.
180
182
  * If the root element's attribute doesn't exist, it does nothing.
@@ -184,14 +186,14 @@ export declare class ValueSet {
184
186
  */
185
187
  setRootElementValue(rootAttribute: string[] | string | null, value: unknown): void;
186
188
  /**
187
- * Obtain the value under the given key.
189
+ * Obtains the value under the given key.
188
190
  * @private
189
191
  * @param key A key.
190
192
  * @returns The value under the given key.
191
193
  */
192
194
  getValue(key: string): any;
193
195
  /**
194
- * Obtain all the values in the set.
196
+ * Obtains all the values in the set.
195
197
  * @private
196
198
  * @returns An object containing all the values in the set.
197
199
  */
@@ -200,7 +202,6 @@ export declare class ValueSet {
200
202
  };
201
203
  /**
202
204
  * Returns the values for all keys present in the given object, including keys in sub-objects.
203
- *
204
205
  * @private
205
206
  * @param values An object containing all values for keys present in the given object.
206
207
  */
@@ -210,40 +211,40 @@ export declare class ValueSet {
210
211
  [key: string]: unknown;
211
212
  };
212
213
  /**
213
- * Obtain all CollabTimestamps in the set, including those corresponding to nested keys.
214
+ * Obtains all CollabTimestamps in the set, including those corresponding to nested keys.
214
215
  * @private
215
216
  * @returns An object containing all the CollabTimestamps in the set.
216
217
  */
217
218
  getTimestamps(): CollabTimestampSet;
218
219
  /**
219
- * Check if the value under the key is not empty.
220
+ * Checks if the value under the key is not empty.
220
221
  * @private
221
222
  * @param key A key.
222
223
  * @returns `true` if the value under the key is empty, `false` otherwise.
223
224
  */
224
225
  hasValue(key: string): boolean;
225
226
  /**
226
- * Check if the value under the key is not empty or the default value.
227
+ * Checks if the value under the key is not empty or the default value.
227
228
  * @private
228
229
  * @param key A key.
229
230
  * @returns `true` if the value under the key is not empty or the default value, `false` otherwise.
230
231
  */
231
232
  hasSetValue(key: string): boolean;
232
233
  /**
233
- * Check if any of the values in the set are not empty or the default value.
234
+ * Checks if any of the values in the set are not empty or the default value.
234
235
  * @private
235
236
  * @returns `true` if any of the values in the set are not empty or the default value, `false` otherwise.
236
237
  */
237
238
  hasAnySetValue(): boolean;
238
239
  /**
239
- * Set the value under the given key.
240
+ * Sets the value under the given key.
240
241
  * @private
241
242
  * @param key A key.
242
243
  * @param value A value.
243
244
  */
244
245
  setValue(key: string, value: unknown): void;
245
246
  /**
246
- * Reset all values and then set them to the given values.
247
+ * Resets all values and then set them to the given values.
247
248
  * @private
248
249
  * @param values An object containing all values to set the values to.
249
250
  */
@@ -251,7 +252,7 @@ export declare class ValueSet {
251
252
  [key: string]: unknown;
252
253
  }): void;
253
254
  /**
254
- * Reset all timestamps and then set them to the given timestamps.
255
+ * Resets all timestamps and then set them to the given timestamps.
255
256
  * @private
256
257
  * @param values An object containing all the CollabTimestamps in the set.
257
258
  */
@@ -265,7 +266,7 @@ export declare class ValueSet {
265
266
  [key: string]: unknown;
266
267
  }): void;
267
268
  /**
268
- * Variant of overwriteValues that applies last-writer-wins to each key, updating timestamps if appropriate.
269
+ * Variant of `overwriteValues` that applies last-writer-wins to each key, updating timestamps if appropriate.
269
270
  * @private
270
271
  * @param values An object containing all values to set the values to.
271
272
  */
@@ -273,7 +274,7 @@ export declare class ValueSet {
273
274
  [key: string]: unknown;
274
275
  }, timestamp: CollabTimestamp): void;
275
276
  /**
276
- * Set all the values of this set to the defaults.
277
+ * Sets all the values of this set to the defaults.
277
278
  * If this set has a root element and any of its properties have root attributes, the root element's attributes are also set to the property's default value if one is provided.
278
279
  * @private
279
280
  */
@@ -286,42 +287,50 @@ export declare class ValueSet {
286
287
  */
287
288
  private constructSubValueSet;
288
289
  /**
289
- * Get the ValueSet under the given key when there are nested ValueSets.
290
+ * Gets the ValueSet under the given key when there are nested ValueSets.
290
291
  * @private
291
292
  * @param key A key.
292
293
  * @returns A ValueSet.
293
294
  */
294
295
  getSubValueSet(key: string): ValueSet;
295
296
  /**
296
- * Move the given property to the list of displayed properties.
297
+ * Moves the given property to the list of displayed properties.
297
298
  * @private
298
299
  * @param property A property.
299
300
  */
300
301
  displayProperty(property: Property): void;
301
302
  /**
302
- * Move the given property to the list of hidden properties.
303
+ * Moves the given property to the list of hidden properties.
303
304
  * @private
304
305
  * @param property A property.
305
306
  */
306
307
  hideProperty(property: Property): void;
307
308
  }
308
309
  /**
309
- * Check if the given value is not empty.
310
+ * Checks if the given value is not empty.
311
+ * @private
310
312
  * @param a A value.
311
313
  * @returns `true` if the given value is not `undefined`, `null`, `''`, `[]` or `{}`; `false` otherwise.
312
314
  */
313
315
  export declare const empty: (a: unknown) => boolean;
314
316
  /**
315
- * Check whether the given values are equal.
317
+ * Checks whether the given values are equal.
318
+ * @public
316
319
  * @param a A value.
317
320
  * @param b A value.
318
321
  * @returns `true` if the given values are equal, `false` otherwise.
319
322
  */
320
323
  export declare const equals: (a: unknown, b: unknown) => boolean;
321
324
  /**
322
- * Calculate the differences between the given objects and return two objects, each containing the keys for which the values are different in each argument, containing the different values.
323
- * @param a A dictionary.
324
- * @param b A dictionary.
325
+ * Calculates the differences between the two given objects and returns two objects containing the differences in each relative to the other.
326
+ *
327
+ * For each key that holds a different value in the two objects, the resulting objects will contain the differences in the values under that key.
328
+ *
329
+ * This function is recursive, that is, if the value under the key is an object, the function will be applied to that value recursively.
330
+ *
331
+ * @public
332
+ * @param a An object.
333
+ * @param b An object.
325
334
  * @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.
326
335
  */
327
336
  export declare const diff: (a: {
@@ -333,4 +342,10 @@ export declare const diff: (a: {
333
342
  }, {
334
343
  [key: string]: unknown;
335
344
  }];
345
+ /**
346
+ * Checks if the given value is an object.
347
+ * @public
348
+ * @param x A value.
349
+ * @returns `true` if the given value is an object, `false` otherwise.
350
+ */
336
351
  export declare const isObject: (x: unknown) => boolean;
@@ -1,6 +1,6 @@
1
1
  import { Point } from '../../util/canvas-util';
2
2
  import { Side } from '../../util/svg-util';
3
- import { NodeShapedLook, SectionConfig } from './diagram-config';
3
+ import { NodeShapedLook, SectionConfig } from '../diagram-config';
4
4
  import { DiagramConnection } from './diagram-connection';
5
5
  import { DiagramDecorator } from './diagram-decorator';
6
6
  import { DiagramElement, DiagramElementSet } from './diagram-element';
@@ -10,14 +10,14 @@ import { DiagramNode } from './diagram-node';
10
10
  import { DiagramPort } from './diagram-port';
11
11
  /**
12
12
  * Default values of the look of a diagram section.
13
- * @see DIAGRAM_SECTION_DEFAULTS
14
13
  * @private
14
+ * @see DIAGRAM_SECTION_DEFAULTS
15
15
  */
16
16
  export declare const DIAGRAM_SECTION_LOOK_DEFAULTS: NodeShapedLook;
17
17
  /**
18
18
  * Default values of the parameters of a diagram section.
19
- * @see DiagramSection
20
19
  * @private
20
+ * @see DiagramSection
21
21
  */
22
22
  export declare const DIAGRAM_SECTION_DEFAULTS: {
23
23
  label: null;
@@ -27,26 +27,26 @@ export declare const DIAGRAM_SECTION_DEFAULTS: {
27
27
  };
28
28
  /**
29
29
  * Default value of the default width of a diagram section.
30
- * @see DiagramSection
31
30
  * @private
31
+ * @see DiagramSection
32
32
  */
33
33
  export declare const DIAGRAM_SECTION_DEFAULT_WIDTH = 1;
34
34
  /**
35
35
  * Default value of the default height of a diagram section.
36
- * @see DiagramSection
37
36
  * @private
37
+ * @see DiagramSection
38
38
  */
39
39
  export declare const DIAGRAM_SECTION_DEFAULT_HEIGHT = 1;
40
40
  /**
41
41
  * Default value of the minimum width of a diagram section.
42
- * @see DiagramSection
43
42
  * @private
43
+ * @see DiagramSection
44
44
  */
45
45
  export declare const DIAGRAM_SECTION_MIN_WIDTH = 1;
46
46
  /**
47
47
  * Default value of the minimum height of a diagram section.
48
- * @see DiagramSection
49
48
  * @private
49
+ * @see DiagramSection
50
50
  */
51
51
  export declare const DIAGRAM_SECTION_MIN_HEIGHT = 1;
52
52
  export type DiagramSectionGeometry = {
@@ -56,10 +56,10 @@ export type DiagramSectionGeometry = {
56
56
  };
57
57
  /**
58
58
  * A section of a node which can have connections and display a property of the node.
59
+ * @public
59
60
  * @see DiagramConnection
60
61
  * @see DiagramNode
61
62
  * @see DiagramPort
62
- * @public
63
63
  */
64
64
  export declare class DiagramSection extends DiagramElement {
65
65
  /**
@@ -1,4 +1,4 @@
1
- import { DiagramModel } from '../diagram-editor/diagram/diagram-model';
1
+ import { DiagramModel } from '../diagram/model/diagram-model';
2
2
  import { DiagramError } from './diagram-error';
3
3
  /**
4
4
  * A validator that checks for specific types of errors in a diagram.