@metadev/daga 1.5.6 → 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.
- package/Changelog.md +35 -1
- package/README.md +67 -30
- package/assets/daga-logo.svg +10 -0
- package/index.cjs.d.ts +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +8085 -0
- package/index.cjs.mjs +2 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +7999 -0
- package/package.json +19 -37
- package/src/index.d.ts +49 -0
- package/src/lib/core.d.ts +1 -0
- package/{lib/diagram-editor/diagram → src/lib/diagram/canvas}/diagram-canvas.d.ts +69 -66
- package/src/lib/diagram/canvas/diagram-context-menu.d.ts +27 -0
- package/src/lib/diagram/canvas/diagram-user-highlight.d.ts +30 -0
- package/src/lib/diagram/canvas/diagram-user-selection.d.ts +74 -0
- package/{lib/diagram-editor → src/lib}/diagram/collab/collab-action.d.ts +36 -12
- package/{lib/diagram-editor → src/lib}/diagram/collab/collab-client.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/collab/collab-engine.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/collab/message-types.d.ts +3 -8
- package/{lib/diagram-editor → src/lib}/diagram/converters/daga-exporter.d.ts +6 -6
- package/{lib/diagram-editor → src/lib}/diagram/converters/daga-importer.d.ts +6 -4
- package/{lib/diagram-editor → src/lib}/diagram/converters/daga-model.d.ts +3 -3
- package/{lib/diagram-editor → src/lib}/diagram/converters/diagram-model-exporter.d.ts +2 -2
- package/{lib/diagram-editor → src/lib}/diagram/converters/diagram-model-importer.d.ts +2 -2
- package/{lib/diagram-editor → src/lib}/diagram/diagram-action.d.ts +75 -55
- package/{lib/diagram-editor → src/lib}/diagram/diagram-config.d.ts +139 -84
- package/{lib/diagram-editor → src/lib}/diagram/diagram-event.d.ts +3 -3
- package/{lib/diagram-editor → src/lib}/diagram/layout/adjacency-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/breadth-adjacency-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/breadth-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/diagram-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/force-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/horizontal-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/priority-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/tree-layout.d.ts +1 -1
- package/{lib/diagram-editor → src/lib}/diagram/layout/vertical-layout.d.ts +1 -1
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-connection.d.ts +4 -4
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-element.d.ts +7 -11
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-entity.d.ts +2 -2
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-field.d.ts +4 -4
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-model.d.ts +15 -15
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-node.d.ts +7 -7
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-property.d.ts +46 -31
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-section.d.ts +8 -8
- package/{lib → src/lib}/errors/diagram-validator.d.ts +1 -1
- package/{lib → src/lib}/interfaces/canvas.d.ts +79 -107
- package/{lib → src/lib}/interfaces/diagram-buttons.d.ts +8 -8
- package/{lib → src/lib}/interfaces/diagram-editor.d.ts +4 -11
- package/{lib → src/lib}/interfaces/palette.d.ts +2 -2
- package/{lib → src/lib}/interfaces/property-editor.d.ts +5 -5
- package/{lib → src/lib}/util/canvas-util.d.ts +20 -5
- package/src/lib/util/device-util.d.ts +5 -0
- package/{lib → src/lib}/util/events.d.ts +4 -4
- package/{lib → src/lib}/util/style.d.ts +1 -0
- package/src/lib/util/test-util.d.ts +11 -0
- package/assets/fonts/DMMono-Medium.ttf +0 -0
- package/assets/fonts/DMMono-Medium.woff +0 -0
- package/assets/fonts/DMMono-Medium.woff2 +0 -0
- package/assets/fonts/WonderUnitSans-Medium.ttf +0 -0
- package/assets/fonts/WonderUnitSans-Medium.woff +0 -0
- package/assets/fonts/WonderUnitSans-Medium.woff2 +0 -0
- package/assets/icon/action/drop-down-arrow.svg +0 -8
- package/assets/icon/action/drop-horizontal-left.svg +0 -14
- package/assets/icon/action/drop-horizontal-none.svg +0 -13
- package/assets/icon/action/drop-horizontal-right.svg +0 -14
- package/assets/icon/action/drop-vertical-down.svg +0 -14
- package/assets/icon/action/drop-vertical-none.svg +0 -13
- package/assets/icon/action/drop-vertical-up.svg +0 -14
- package/assets/icon/action/filter-clear.png +0 -0
- package/assets/icon/buttons/center-hover.svg +0 -10
- package/assets/icon/buttons/center.svg +0 -10
- package/assets/icon/buttons/ellipsis-hover.svg +0 -7
- package/assets/icon/buttons/ellipsis.svg +0 -7
- package/assets/icon/buttons/filter-off-hover.svg +0 -5
- package/assets/icon/buttons/filter-off.svg +0 -5
- package/assets/icon/buttons/filter-on-hover.svg +0 -5
- package/assets/icon/buttons/filter-on.svg +0 -5
- package/assets/icon/buttons/layout-hover.svg +0 -8
- package/assets/icon/buttons/layout.svg +0 -8
- package/assets/icon/buttons/redo-hover.svg +0 -5
- package/assets/icon/buttons/redo.svg +0 -5
- package/assets/icon/buttons/undo-hover.svg +0 -5
- package/assets/icon/buttons/undo.svg +0 -5
- package/assets/icon/buttons/zoom-in-hover.svg +0 -8
- package/assets/icon/buttons/zoom-in.svg +0 -8
- package/assets/icon/buttons/zoom-out-hover.svg +0 -7
- package/assets/icon/buttons/zoom-out.svg +0 -7
- package/assets/icon/context/copy.svg +0 -4
- package/assets/icon/context/cross.svg +0 -3
- package/assets/icon/context/cut.svg +0 -4
- package/assets/icon/context/delete.svg +0 -4
- package/assets/icon/context/paste.svg +0 -4
- package/assets/icon/property/add.svg +0 -23
- package/assets/icon/property/close.svg +0 -3
- package/assets/icon/property/ellipsis.svg +0 -5
- package/assets/icon/property/gear.svg +0 -3
- package/assets/icon/property/hide.svg +0 -10
- package/assets/icon/property/move.svg +0 -35
- package/assets/styles/_collapse-button.scss +0 -37
- package/assets/styles/_context-menu.scss +0 -32
- package/assets/styles/_diagram-buttons.scss +0 -166
- package/assets/styles/_diagram.scss +0 -15
- package/assets/styles/_errors.scss +0 -83
- package/assets/styles/_palette.scss +0 -20
- package/assets/styles/_property-editor.scss +0 -285
- package/assets/styles/daga.scss +0 -150
- package/fesm2022/metadev-daga.mjs +0 -10957
- package/fesm2022/metadev-daga.mjs.map +0 -1
- package/index.d.ts +0 -55
- package/lib/collapse-button/collapse-button.component.d.ts +0 -22
- package/lib/daga.module.d.ts +0 -18
- package/lib/diagram/diagram.component.d.ts +0 -44
- package/lib/diagram-buttons/diagram-buttons.component.d.ts +0 -44
- package/lib/diagram-editor/diagram-editor.component.d.ts +0 -38
- package/lib/errors/errors.component.d.ts +0 -26
- package/lib/palette/palette.component.d.ts +0 -39
- package/lib/property-editor/autocomplete/autocomplete.component.d.ts +0 -39
- package/lib/property-editor/object-editor/object-editor.component.d.ts +0 -30
- package/lib/property-editor/option-list-editor/option-list-editor.component.d.ts +0 -33
- package/lib/property-editor/property-editor.component.d.ts +0 -30
- package/lib/property-editor/property-settings/property-settings.component.d.ts +0 -35
- package/lib/property-editor/text-list-editor/text-list-editor.component.d.ts +0 -29
- package/lib/property-editor/text-map-editor/text-map-editor.component.d.ts +0 -36
- package/lib/services/canvas-provider.service.d.ts +0 -32
- package/lib/services/daga-configuration.service.d.ts +0 -23
- package/{lib/diagram-editor → src/lib}/diagram/collab/primitives.d.ts +0 -0
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-decorator.d.ts +1 -1
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-object.d.ts +0 -0
- package/{lib/diagram-editor/diagram → src/lib/diagram/model}/diagram-port.d.ts +2 -2
- package/{lib → src/lib}/errors/diagram-error.d.ts +3 -3
- package/{lib → src/lib}/util/grid.d.ts +0 -0
- package/{lib → src/lib}/util/line.d.ts +0 -0
- package/{lib → src/lib}/util/list-util.d.ts +0 -0
- package/{lib → src/lib}/util/shape.d.ts +10 -10
- /package/{lib → src/lib}/util/svg-util.d.ts +0 -0
- /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 '
|
|
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
|
|
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
|
|
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 '
|
|
4
|
-
import { FieldConfig } from '
|
|
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 '
|
|
4
|
-
import { FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTypeConfig, PortConfig, SectionGridConfig } from '
|
|
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 '
|
|
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.
|
|
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.
|
|
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
|
|
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
|
-
*
|
|
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
|
-
* @
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
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 '
|
|
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
|
/**
|