@metadev/daga 1.1.0 → 1.3.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 +29 -1
- package/README.md +1 -1
- 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/styles/_collapse-button.scss +37 -0
- package/assets/styles/_diagram-buttons.scss +132 -0
- package/assets/styles/_diagram.scss +15 -0
- package/assets/styles/_errors.scss +83 -0
- package/assets/styles/_palette.scss +12 -0
- package/assets/styles/_property-editor.scss +160 -0
- package/assets/styles/daga.scss +152 -0
- package/fesm2022/metadev-daga.mjs +1174 -279
- package/fesm2022/metadev-daga.mjs.map +1 -1
- package/index.d.ts +16 -7
- package/lib/collapse-button/collapse-button.component.d.ts +5 -0
- package/lib/diagram/diagram.component.d.ts +1 -0
- package/lib/diagram-buttons/diagram-buttons.component.d.ts +4 -0
- package/lib/diagram-editor/diagram/converters/daga-exporter.d.ts +4 -0
- package/lib/diagram-editor/diagram/converters/daga-importer.d.ts +4 -0
- package/lib/diagram-editor/diagram/converters/daga-model.d.ts +5 -0
- package/lib/diagram-editor/diagram/converters/diagram-model-exporter.d.ts +7 -0
- package/lib/diagram-editor/diagram/converters/diagram-model-importer.d.ts +7 -0
- package/lib/diagram-editor/diagram/diagram-action.d.ts +77 -2
- package/lib/diagram-editor/diagram/diagram-canvas.d.ts +8 -1
- package/lib/diagram-editor/diagram/diagram-config.d.ts +26 -0
- package/lib/diagram-editor/diagram/diagram-connection.d.ts +75 -0
- package/lib/diagram-editor/diagram/diagram-element.d.ts +40 -3
- package/lib/diagram-editor/diagram/diagram-field.d.ts +64 -0
- package/lib/diagram-editor/diagram/diagram-model.d.ts +75 -2
- package/lib/diagram-editor/diagram/diagram-node.d.ts +59 -1
- package/lib/diagram-editor/diagram/diagram-port.d.ts +36 -0
- package/lib/diagram-editor/diagram/diagram-property.d.ts +23 -2
- package/lib/diagram-editor/diagram/diagram-section.d.ts +48 -1
- package/lib/diagram-editor/diagram/layout/adjacency-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/breadth-adjacency-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/breadth-layout.d.ts +2 -2
- package/lib/diagram-editor/diagram/layout/diagram-layout.d.ts +8 -0
- package/lib/diagram-editor/diagram/layout/force-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/horizontal-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/priority-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram/layout/vertical-layout.d.ts +1 -0
- package/lib/diagram-editor/diagram-editor.component.d.ts +4 -0
- package/lib/errors/diagram-error.d.ts +19 -0
- package/lib/errors/diagram-validator.d.ts +6 -1
- package/lib/errors/errors.component.d.ts +5 -0
- package/lib/interfaces/canvas.d.ts +50 -0
- package/lib/interfaces/diagram-buttons.d.ts +8 -0
- package/lib/interfaces/diagram-editor.d.ts +4 -0
- package/lib/interfaces/palette.d.ts +2 -0
- package/lib/interfaces/property-editor.d.ts +4 -0
- package/lib/object-editor/object-editor.component.d.ts +8 -1
- package/lib/palette/palette.component.d.ts +6 -0
- package/lib/property-editor/property-editor.component.d.ts +5 -0
- package/lib/services/canvas-provider.service.d.ts +17 -0
- package/lib/services/daga-configuration.service.d.ts +11 -0
- package/lib/text-list-editor/text-list-editor.component.d.ts +7 -0
- package/lib/text-map-editor/text-map-editor.component.d.ts +7 -0
- package/lib/util/canvas-util.d.ts +104 -0
- package/lib/util/events.d.ts +8 -4
- package/lib/util/grid.d.ts +47 -4
- package/lib/util/line.d.ts +44 -0
- package/lib/util/list-util.d.ts +14 -0
- package/lib/util/shape.d.ts +98 -0
- package/lib/util/svg-util.d.ts +77 -5
- package/package.json +1 -1
- package/assets/styles/styles.scss +0 -181
package/index.d.ts
CHANGED
|
@@ -7,16 +7,17 @@ export { DagaImporter } from './lib/diagram-editor/diagram/converters/daga-impor
|
|
|
7
7
|
export { DagaModel } from './lib/diagram-editor/diagram/converters/daga-model';
|
|
8
8
|
export { DiagramModelExporter } from './lib/diagram-editor/diagram/converters/diagram-model-exporter';
|
|
9
9
|
export { DiagramModelImporter } from './lib/diagram-editor/diagram/converters/diagram-model-importer';
|
|
10
|
-
export { ActionQueue, AddConnectionAction, AddNodeAction, DiagramAction, EditFieldAction, MoveNodeAction, RemoveAction, StretchNodeAction, UpdateValuesAction } from './lib/diagram-editor/diagram/diagram-action';
|
|
10
|
+
export { ActionQueue, AddConnectionAction, AddNodeAction, DiagramAction, DiagramActions, EditFieldAction, MoveNodeAction, RemoveAction, StretchNodeAction, UpdateValuesAction } from './lib/diagram-editor/diagram/diagram-action';
|
|
11
11
|
export { ACTION_QUEUE_SIZE, DiagramCanvas } from './lib/diagram-editor/diagram/diagram-canvas';
|
|
12
|
-
export { DiagramConfig } from './lib/diagram-editor/diagram/diagram-config';
|
|
13
|
-
export { DiagramConnection, DiagramConnectionType } from './lib/diagram-editor/diagram/diagram-connection';
|
|
14
|
-
export { DiagramElement, DiagramEntity } from './lib/diagram-editor/diagram/diagram-element';
|
|
15
|
-
export { DiagramField } from './lib/diagram-editor/diagram/diagram-field';
|
|
12
|
+
export { ConnectionMarkerLook, ConnectionTemplateConfig, ConnectionTypeConfig, DiagramConfig, FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTemplateConfig, NodeTypeConfig, PaletteConfig, PortConfig, SectionConfig } from './lib/diagram-editor/diagram/diagram-config';
|
|
13
|
+
export { DiagramConnection, DiagramConnectionSet, DiagramConnectionType } from './lib/diagram-editor/diagram/diagram-connection';
|
|
14
|
+
export { DiagramElement, DiagramEntity, DiagramEntitySet } from './lib/diagram-editor/diagram/diagram-element';
|
|
15
|
+
export { DiagramField, DiagramFieldSet } from './lib/diagram-editor/diagram/diagram-field';
|
|
16
16
|
export { DiagramModel } from './lib/diagram-editor/diagram/diagram-model';
|
|
17
|
-
export { DiagramNode, DiagramNodeType } from './lib/diagram-editor/diagram/diagram-node';
|
|
18
|
-
export { DiagramPort } from './lib/diagram-editor/diagram/diagram-port';
|
|
17
|
+
export { DiagramNode, DiagramNodeSet, DiagramNodeType } from './lib/diagram-editor/diagram/diagram-node';
|
|
18
|
+
export { DiagramPort, DiagramPortSet } from './lib/diagram-editor/diagram/diagram-port';
|
|
19
19
|
export { Property, PropertySet, Type, ValueSet } from './lib/diagram-editor/diagram/diagram-property';
|
|
20
|
+
export { DiagramSection, DiagramSectionSet } from './lib/diagram-editor/diagram/diagram-section';
|
|
20
21
|
export { AdjacencyLayout } from './lib/diagram-editor/diagram/layout/adjacency-layout';
|
|
21
22
|
export { BreadthAdjacencyLayout } from './lib/diagram-editor/diagram/layout/breadth-adjacency-layout';
|
|
22
23
|
export { BreadthLayout } from './lib/diagram-editor/diagram/layout/breadth-layout';
|
|
@@ -30,6 +31,10 @@ export { DiagramError } from './lib/errors/diagram-error';
|
|
|
30
31
|
export { DiagramValidator } from './lib/errors/diagram-validator';
|
|
31
32
|
export { ErrorsComponent } from './lib/errors/errors.component';
|
|
32
33
|
export { Canvas } from './lib/interfaces/canvas';
|
|
34
|
+
export { DiagramButtons } from './lib/interfaces/diagram-buttons';
|
|
35
|
+
export { DiagramEditor } from './lib/interfaces/diagram-editor';
|
|
36
|
+
export { Palette } from './lib/interfaces/palette';
|
|
37
|
+
export { PropertyEditor } from './lib/interfaces/property-editor';
|
|
33
38
|
export { ObjectEditorComponent } from './lib/object-editor/object-editor.component';
|
|
34
39
|
export { PaletteComponent } from './lib/palette/palette.component';
|
|
35
40
|
export { PropertyEditorComponent } from './lib/property-editor/property-editor.component';
|
|
@@ -37,3 +42,7 @@ export { CanvasProviderService } from './lib/services/canvas-provider.service';
|
|
|
37
42
|
export { DagaConfigurationService } from './lib/services/daga-configuration.service';
|
|
38
43
|
export { TextListEditorComponent } from './lib/text-list-editor/text-list-editor.component';
|
|
39
44
|
export { TextMapEditorComponent } from './lib/text-map-editor/text-map-editor.component';
|
|
45
|
+
export { Line, Point, Rectangle } from './lib/util/canvas-util';
|
|
46
|
+
export { LineShape, LineStyle } from './lib/util/line';
|
|
47
|
+
export { ClosedShape } from './lib/util/shape';
|
|
48
|
+
export { Corner, HorizontalAlign, Side, VerticalAlign } from './lib/util/svg-util';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { Side } from '../util/svg-util';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Button used to collapse components that implement it.
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
4
8
|
export declare class CollapseButtonComponent {
|
|
5
9
|
collapsableSelector: string | ElementRef | HTMLElement;
|
|
6
10
|
collapsableAdditionalSelector: string;
|
|
@@ -12,6 +16,7 @@ export declare class CollapseButtonComponent {
|
|
|
12
16
|
visibleValue: string;
|
|
13
17
|
Side: typeof Side;
|
|
14
18
|
toggleCollapse(): void;
|
|
19
|
+
getClass(): string;
|
|
15
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<CollapseButtonComponent, never>;
|
|
16
21
|
static ɵcmp: i0.ɵɵComponentDeclaration<CollapseButtonComponent, "daga-collapse-button", never, { "collapsableSelector": { "alias": "collapsableSelector"; "required": false; }; "collapsableAdditionalSelector": { "alias": "collapsableAdditionalSelector"; "required": false; }; "collapsed": { "alias": "collapsed"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "rule": { "alias": "rule"; "required": false; }; "collapsedValue": { "alias": "collapsedValue"; "required": false; }; "visibleValue": { "alias": "visibleValue"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
22
|
}
|
|
@@ -6,6 +6,7 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
/**
|
|
7
7
|
* The context of a diagram. Every separate diagram must be contained within its own {@link DiagramComponent} and every {@link DiagramComponent} must contain its own {@link DiagramEditorComponent}.
|
|
8
8
|
* This component defines a {@link DagaConfigurationService} and a {@link CanvasProviderService}, which is shared by all the components within and allows accessing the configuration and the canvas of this component's diagram, respectively.
|
|
9
|
+
* @public
|
|
9
10
|
*/
|
|
10
11
|
export declare class DiagramComponent implements OnInit {
|
|
11
12
|
private configurationService;
|
|
@@ -3,6 +3,10 @@ import { Canvas } from '../interfaces/canvas';
|
|
|
3
3
|
import { DiagramButtons } from '../interfaces/diagram-buttons';
|
|
4
4
|
import { CanvasProviderService } from '../services/canvas-provider.service';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Buttons used to trigger diagram functionalities by the user.
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
6
10
|
export declare class DiagramButtonsComponent implements DiagramButtons {
|
|
7
11
|
private canvasProvider;
|
|
8
12
|
get canvas(): Canvas;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DiagramModel } from '../diagram-model';
|
|
2
2
|
import { DagaModel } from './daga-model';
|
|
3
3
|
import { DiagramModelExporter } from './diagram-model-exporter';
|
|
4
|
+
/**
|
|
5
|
+
* Importer which exports a diagram to its daga model representation.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
4
8
|
export declare class DagaExporter implements DiagramModelExporter<DagaModel> {
|
|
5
9
|
export(model: DiagramModel): DagaModel;
|
|
6
10
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DiagramModel } from '../diagram-model';
|
|
2
2
|
import { DagaModel } from './daga-model';
|
|
3
3
|
import { DiagramModelImporter } from './diagram-model-importer';
|
|
4
|
+
/**
|
|
5
|
+
* Importer which imports a diagram from its daga model representation.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
4
8
|
export declare class DagaImporter implements DiagramModelImporter<DagaModel> {
|
|
5
9
|
import(model: DiagramModel, data: DagaModel): DiagramModel;
|
|
6
10
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Point } from '../../../util/canvas-util';
|
|
2
2
|
import { Side } from '../../../util/svg-util';
|
|
3
3
|
export declare const DAGA_FILE_VERSION = 1;
|
|
4
|
+
/**
|
|
5
|
+
* Representation of a diagram model in a serialized format.
|
|
6
|
+
* @see DiagramModel
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
4
9
|
export interface DagaModel {
|
|
5
10
|
id?: string;
|
|
6
11
|
/** User version */
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { DiagramModel } from '../diagram-model';
|
|
2
|
+
/**
|
|
3
|
+
* A diagram exporter which given a diagram model returns a representation of the diagram in some other form.
|
|
4
|
+
* @see DiagramModel
|
|
5
|
+
* @see DiagramModelImporter
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
2
8
|
export interface DiagramModelExporter<T> {
|
|
3
9
|
/**
|
|
4
10
|
* Exports a diagram from the given model.
|
|
11
|
+
* @public
|
|
5
12
|
*/
|
|
6
13
|
export(model: DiagramModel): T;
|
|
7
14
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { DiagramModel } from '../diagram-model';
|
|
2
|
+
/**
|
|
3
|
+
* A diagram importer which given a diagram's representation in some other form imports the diagram into a given diagram model.
|
|
4
|
+
* @see DiagramModel
|
|
5
|
+
* @see DiagramModelExporter
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
2
8
|
export interface DiagramModelImporter<T> {
|
|
3
9
|
/**
|
|
4
10
|
* Imports a diagram in the given model using the given data.
|
|
11
|
+
* @public
|
|
5
12
|
*/
|
|
6
13
|
import(model: DiagramModel, data: T): DiagramModel;
|
|
7
14
|
}
|
|
@@ -8,29 +8,71 @@ import { DiagramNode, DiagramNodeType } from './diagram-node';
|
|
|
8
8
|
import { DiagramPort } from './diagram-port';
|
|
9
9
|
import { ValueSet } from './diagram-property';
|
|
10
10
|
import { DiagramSection } from './diagram-section';
|
|
11
|
+
/**
|
|
12
|
+
* A queue of recent actions taken by the user that can be undone and redone.
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
11
15
|
export declare class ActionQueue {
|
|
16
|
+
/**
|
|
17
|
+
* Maximum number of actions that can be recorded simultaneously.
|
|
18
|
+
* When new actions are added past this limit, older actions are removed.
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
12
21
|
maximum: number;
|
|
22
|
+
/**
|
|
23
|
+
* List of recorded actions, from oldest to newest.
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
13
26
|
history: DiagramAction[];
|
|
14
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Index of the last action not counting undone actions. One-indexed. Zero if all actions are undone.
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
15
31
|
index: number;
|
|
16
32
|
constructor(maximum: number);
|
|
17
33
|
/**
|
|
18
34
|
* Adds an action to the history.
|
|
35
|
+
* @private
|
|
19
36
|
*/
|
|
20
37
|
add(action: DiagramAction): void;
|
|
21
38
|
/**
|
|
22
39
|
* Undoes the last action in the history, not counting undone actions.
|
|
40
|
+
* @private
|
|
23
41
|
*/
|
|
24
42
|
undo(): void;
|
|
25
43
|
/**
|
|
26
44
|
* Redoes the last undone action in the history.
|
|
45
|
+
* @private
|
|
27
46
|
*/
|
|
28
47
|
redo(): void;
|
|
29
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* An action taken by the user that can be undone and redone.
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
30
53
|
export interface DiagramAction {
|
|
31
54
|
undo(): void;
|
|
32
55
|
redo(): void;
|
|
33
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Enum listing the actions that can be taken by the user.
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
export declare enum DiagramActions {
|
|
62
|
+
AddConnectionAction = "add-connection",
|
|
63
|
+
AddNodeAction = "add-node",
|
|
64
|
+
EditFieldAction = "edit-field",
|
|
65
|
+
MoveNodeAction = "move-node",
|
|
66
|
+
RemoveAction = "remove",
|
|
67
|
+
StretchNodeAction = "stretch-node",
|
|
68
|
+
StretchSectionAction = "stretch-section",
|
|
69
|
+
UpdateValuesAction = "update-values"
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Action which consists of adding a node.
|
|
73
|
+
* @see DiagramNode
|
|
74
|
+
* @private
|
|
75
|
+
*/
|
|
34
76
|
export declare class AddNodeAction implements DiagramAction {
|
|
35
77
|
canvas: Canvas;
|
|
36
78
|
type: DiagramNodeType;
|
|
@@ -52,6 +94,11 @@ export declare class AddNodeAction implements DiagramAction {
|
|
|
52
94
|
undo(): void;
|
|
53
95
|
redo(): void;
|
|
54
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Action which consists of moving a node.
|
|
99
|
+
* @see DiagramNode
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
55
102
|
export declare class MoveNodeAction implements DiagramAction {
|
|
56
103
|
canvas: Canvas;
|
|
57
104
|
nodeId: string;
|
|
@@ -61,6 +108,11 @@ export declare class MoveNodeAction implements DiagramAction {
|
|
|
61
108
|
undo(): void;
|
|
62
109
|
redo(): void;
|
|
63
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Action which consists of changing the dimensions of a node in a given direction.
|
|
113
|
+
* @see DiagramNode
|
|
114
|
+
* @private
|
|
115
|
+
*/
|
|
64
116
|
export declare class StretchNodeAction implements DiagramAction {
|
|
65
117
|
canvas: Canvas;
|
|
66
118
|
nodeId: string;
|
|
@@ -71,6 +123,11 @@ export declare class StretchNodeAction implements DiagramAction {
|
|
|
71
123
|
undo(): void;
|
|
72
124
|
redo(): void;
|
|
73
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Action which consists of changing the dimensions of a section in a given direction.
|
|
128
|
+
* @see DiagramSection
|
|
129
|
+
* @private
|
|
130
|
+
*/
|
|
74
131
|
export declare class StretchSectionAction implements DiagramAction {
|
|
75
132
|
canvas: Canvas;
|
|
76
133
|
sectionId: string;
|
|
@@ -81,6 +138,11 @@ export declare class StretchSectionAction implements DiagramAction {
|
|
|
81
138
|
undo(): void;
|
|
82
139
|
redo(): void;
|
|
83
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Action which consists of adding a connection.
|
|
143
|
+
* @see DiagramConnection
|
|
144
|
+
* @private
|
|
145
|
+
*/
|
|
84
146
|
export declare class AddConnectionAction implements DiagramAction {
|
|
85
147
|
canvas: Canvas;
|
|
86
148
|
type: DiagramConnectionType;
|
|
@@ -91,6 +153,11 @@ export declare class AddConnectionAction implements DiagramAction {
|
|
|
91
153
|
undo(): void;
|
|
92
154
|
redo(): void;
|
|
93
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Action which consists of editing the text of a field.
|
|
158
|
+
* @see DiagramField
|
|
159
|
+
* @private
|
|
160
|
+
*/
|
|
94
161
|
export declare class EditFieldAction implements DiagramAction {
|
|
95
162
|
canvas: Canvas;
|
|
96
163
|
fieldId: string;
|
|
@@ -100,6 +167,11 @@ export declare class EditFieldAction implements DiagramAction {
|
|
|
100
167
|
undo(): void;
|
|
101
168
|
redo(): void;
|
|
102
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Action which consists of editing the values of a value set.
|
|
172
|
+
* @see ValueSet
|
|
173
|
+
* @private
|
|
174
|
+
*/
|
|
103
175
|
export declare class UpdateValuesAction implements DiagramAction {
|
|
104
176
|
model: DiagramModel;
|
|
105
177
|
id: string | undefined;
|
|
@@ -118,6 +190,10 @@ export declare class UpdateValuesAction implements DiagramAction {
|
|
|
118
190
|
undo(): void;
|
|
119
191
|
redo(): void;
|
|
120
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Action which consists of removing elements from a diagram.
|
|
195
|
+
* @private
|
|
196
|
+
*/
|
|
121
197
|
export declare class RemoveAction implements DiagramAction {
|
|
122
198
|
model: DiagramModel;
|
|
123
199
|
nodes: DiagramNode[];
|
|
@@ -134,4 +210,3 @@ export declare class RemoveAction implements DiagramAction {
|
|
|
134
210
|
undo(): void;
|
|
135
211
|
redo(): void;
|
|
136
212
|
}
|
|
137
|
-
export declare const clone: <T extends object | null | undefined>(obj: T) => T;
|
|
@@ -4,7 +4,7 @@ import { DiagramValidator } from '../../errors/diagram-validator';
|
|
|
4
4
|
import { Canvas } from '../../interfaces/canvas';
|
|
5
5
|
import { DiagramEditor } from '../../interfaces/diagram-editor';
|
|
6
6
|
import { Point } from '../../util/canvas-util';
|
|
7
|
-
import { ActionQueue } from './diagram-action';
|
|
7
|
+
import { ActionQueue, DiagramActions } from './diagram-action';
|
|
8
8
|
import { DiagramConfig } from './diagram-config';
|
|
9
9
|
import { DiagramConnection, DiagramConnectionType } from './diagram-connection';
|
|
10
10
|
import { DiagramElement } from './diagram-element';
|
|
@@ -13,20 +13,24 @@ import { DiagramPort } from './diagram-port';
|
|
|
13
13
|
import { ValueSet } from './diagram-property';
|
|
14
14
|
/**
|
|
15
15
|
* Thickness of the invisible path around a connection used to make it easier to click on, in pixels.
|
|
16
|
+
* @private
|
|
16
17
|
*/
|
|
17
18
|
export declare const CONNECTION_PATH_BOX_THICKNESS = 12;
|
|
18
19
|
/**
|
|
19
20
|
* Thickness of the resizer line used to resize nodes and sections on drag, in pixels.
|
|
21
|
+
* @private
|
|
20
22
|
*/
|
|
21
23
|
export declare const RESIZER_THICKNESS = 6;
|
|
22
24
|
/**
|
|
23
25
|
* Text to display as the title of the property editor when editing this diagram's properties.
|
|
24
26
|
* @see PropertyEditorComponent
|
|
27
|
+
* @private
|
|
25
28
|
*/
|
|
26
29
|
export declare const DIAGRAM_PROPERTIES_TEXT = "Diagram properties";
|
|
27
30
|
/**
|
|
28
31
|
* Maximum number of user actions that can be recorded in the user action queue.
|
|
29
32
|
* @see ActionQueue
|
|
33
|
+
* @private
|
|
30
34
|
*/
|
|
31
35
|
export declare const ACTION_QUEUE_SIZE = 25;
|
|
32
36
|
export declare class DiagramCanvas implements Canvas {
|
|
@@ -42,6 +46,9 @@ export declare class DiagramCanvas implements Canvas {
|
|
|
42
46
|
priorityThresholds: number[];
|
|
43
47
|
validators: DiagramValidator[];
|
|
44
48
|
layoutFormat?: string;
|
|
49
|
+
userActions: {
|
|
50
|
+
[key in DiagramActions]?: boolean;
|
|
51
|
+
};
|
|
45
52
|
actionQueue: ActionQueue;
|
|
46
53
|
private static canvasCount;
|
|
47
54
|
private backgroundPatternId;
|
|
@@ -2,9 +2,11 @@ import { Point } from '../../util/canvas-util';
|
|
|
2
2
|
import { LineShape, LineStyle } from '../../util/line';
|
|
3
3
|
import { ClosedShape } from '../../util/shape';
|
|
4
4
|
import { HorizontalAlign, Side, VerticalAlign } from '../../util/svg-util';
|
|
5
|
+
import { DiagramActions } from './diagram-action';
|
|
5
6
|
import { Property } from './diagram-property';
|
|
6
7
|
/**
|
|
7
8
|
* The configuration for a diagram.
|
|
9
|
+
* @public
|
|
8
10
|
*/
|
|
9
11
|
export interface DiagramConfig {
|
|
10
12
|
/**
|
|
@@ -58,6 +60,11 @@ export interface DiagramConfig {
|
|
|
58
60
|
* @default undefined
|
|
59
61
|
*/
|
|
60
62
|
layoutFormat?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Mapping of user actions to a boolean indicating whether the user can perform those actions. Absent values are assumed to be `true`.
|
|
65
|
+
* @default {}
|
|
66
|
+
*/
|
|
67
|
+
userActions?: UserActionConfig;
|
|
61
68
|
/**
|
|
62
69
|
* Configuration for the palettes of this diagram. Each configuration provided will configure one palette, which will be displayed as one of the tabs in the palette component.
|
|
63
70
|
* @see PaletteComponent
|
|
@@ -91,9 +98,17 @@ export interface DiagramConfig {
|
|
|
91
98
|
*/
|
|
92
99
|
properties?: Property[];
|
|
93
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Configuration for which user actions are allowed in a diagram.
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
export type UserActionConfig = {
|
|
106
|
+
[key in DiagramActions]?: boolean;
|
|
107
|
+
};
|
|
94
108
|
/**
|
|
95
109
|
* Configuration for a palette.
|
|
96
110
|
* @see PaletteComponent
|
|
111
|
+
* @public
|
|
97
112
|
*/
|
|
98
113
|
export interface PaletteConfig {
|
|
99
114
|
/**
|
|
@@ -114,6 +129,7 @@ export interface PaletteConfig {
|
|
|
114
129
|
/**
|
|
115
130
|
* Configuration for a template of a node in a palette.
|
|
116
131
|
* @see PaletteComponent
|
|
132
|
+
* @public
|
|
117
133
|
*/
|
|
118
134
|
export interface NodeTemplateConfig {
|
|
119
135
|
/**
|
|
@@ -138,6 +154,7 @@ export interface NodeTemplateConfig {
|
|
|
138
154
|
/**
|
|
139
155
|
* Configuration for a template of a connection in a palette.
|
|
140
156
|
* @see PaletteComponent
|
|
157
|
+
* @public
|
|
141
158
|
*/
|
|
142
159
|
export interface ConnectionTemplateConfig {
|
|
143
160
|
/**
|
|
@@ -172,6 +189,7 @@ export interface ConnectionTemplateConfig {
|
|
|
172
189
|
/**
|
|
173
190
|
* Configuration for a type of node.
|
|
174
191
|
* @see DiagramNodeType
|
|
192
|
+
* @public
|
|
175
193
|
*/
|
|
176
194
|
export interface NodeTypeConfig {
|
|
177
195
|
/**
|
|
@@ -252,6 +270,7 @@ export interface NodeTypeConfig {
|
|
|
252
270
|
/**
|
|
253
271
|
* Configuration for a field that is part of another element.
|
|
254
272
|
* @see DiagramField
|
|
273
|
+
* @public
|
|
255
274
|
*/
|
|
256
275
|
export interface FieldConfig {
|
|
257
276
|
/**
|
|
@@ -304,6 +323,7 @@ export interface FieldConfig {
|
|
|
304
323
|
/**
|
|
305
324
|
* Configuration for a port that is part of another element.
|
|
306
325
|
* @see DiagramPort
|
|
326
|
+
* @public
|
|
307
327
|
*/
|
|
308
328
|
export interface PortConfig {
|
|
309
329
|
/**
|
|
@@ -323,6 +343,7 @@ export interface PortConfig {
|
|
|
323
343
|
/**
|
|
324
344
|
* Configuration for the sections of a node.
|
|
325
345
|
* @see DiagramSection
|
|
346
|
+
* @public
|
|
326
347
|
*/
|
|
327
348
|
export interface SectionConfig {
|
|
328
349
|
/**
|
|
@@ -368,6 +389,7 @@ export interface SectionConfig {
|
|
|
368
389
|
}
|
|
369
390
|
/**
|
|
370
391
|
* Configuration for the look of a node given by shape and color.
|
|
392
|
+
* @public
|
|
371
393
|
*/
|
|
372
394
|
export interface NodeShapedLook {
|
|
373
395
|
/**
|
|
@@ -397,6 +419,7 @@ export interface NodeShapedLook {
|
|
|
397
419
|
}
|
|
398
420
|
/**
|
|
399
421
|
* Configuration for the look of a node given by an image.
|
|
422
|
+
* @public
|
|
400
423
|
*/
|
|
401
424
|
export interface NodeImageLook {
|
|
402
425
|
/**
|
|
@@ -414,6 +437,7 @@ export interface NodeImageLook {
|
|
|
414
437
|
}
|
|
415
438
|
/**
|
|
416
439
|
* Configuration for the look of a node given by fixed size images in the corners and stretchable images in the middle.
|
|
440
|
+
* @public
|
|
417
441
|
*/
|
|
418
442
|
export interface NodeStretchableImageLook {
|
|
419
443
|
/**
|
|
@@ -512,6 +536,7 @@ export interface NodeStretchableImageLook {
|
|
|
512
536
|
/**
|
|
513
537
|
* Configuration for a type of connection.
|
|
514
538
|
* @see DiagramConnectionType
|
|
539
|
+
* @public
|
|
515
540
|
*/
|
|
516
541
|
export interface ConnectionTypeConfig {
|
|
517
542
|
/**
|
|
@@ -580,6 +605,7 @@ export interface ConnectionTypeConfig {
|
|
|
580
605
|
}
|
|
581
606
|
/**
|
|
582
607
|
* Configuration for the look of the markers at the start and end of a connection.
|
|
608
|
+
* @public
|
|
583
609
|
*/
|
|
584
610
|
export interface ConnectionMarkerLook {
|
|
585
611
|
/**
|
|
@@ -6,6 +6,11 @@ import { DiagramElement, DiagramEntity, DiagramEntitySet } from './diagram-eleme
|
|
|
6
6
|
import { DiagramModel } from './diagram-model';
|
|
7
7
|
import { DiagramPort } from './diagram-port';
|
|
8
8
|
import { PropertySet, ValueSet } from './diagram-property';
|
|
9
|
+
/**
|
|
10
|
+
* Default values of the parameters of a diagram connection.
|
|
11
|
+
* @see DiagramConnection
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
9
14
|
export declare const DIAGRAM_CONNECTION_TYPE_DEFAULTS: {
|
|
10
15
|
name: string;
|
|
11
16
|
width: number;
|
|
@@ -20,6 +25,11 @@ export declare const DIAGRAM_CONNECTION_TYPE_DEFAULTS: {
|
|
|
20
25
|
selectedColor: string;
|
|
21
26
|
properties: never[];
|
|
22
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* A connection type, which holds properties that connections of this type share in common.
|
|
30
|
+
* @see ConnectionTypeConfig
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
23
33
|
export declare class DiagramConnectionType implements DiagramEntity {
|
|
24
34
|
id: string;
|
|
25
35
|
name: string;
|
|
@@ -38,22 +48,87 @@ export declare class DiagramConnectionType implements DiagramEntity {
|
|
|
38
48
|
canStartFromType(type: string): boolean;
|
|
39
49
|
canFinishOnType(type: string): boolean;
|
|
40
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* A connection which goes from one port to another.
|
|
53
|
+
* @see DiagramPort
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
41
56
|
export declare class DiagramConnection extends DiagramElement {
|
|
42
57
|
type: DiagramConnectionType;
|
|
58
|
+
/**
|
|
59
|
+
* Additional properties of this connection.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
43
62
|
valueSet: ValueSet;
|
|
63
|
+
/**
|
|
64
|
+
* Variable used to preserve the original data of a connection when importing from a different format.
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
44
67
|
originalData: unknown;
|
|
68
|
+
/**
|
|
69
|
+
* Port that this connection starts from.
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
45
72
|
start?: DiagramPort;
|
|
73
|
+
/**
|
|
74
|
+
* Direction that this connection follows at its start.
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
46
77
|
startDirection?: Side;
|
|
78
|
+
/**
|
|
79
|
+
* Coordinates of the start point of this connection.
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
47
82
|
startCoords: Point;
|
|
83
|
+
/**
|
|
84
|
+
* Look of the marker of this connection at the start, or `null` if the connection has no start marker.
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
48
87
|
startMarkerLook: ConnectionMarkerLook | null;
|
|
88
|
+
/**
|
|
89
|
+
* Port that this connection ends at.
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
49
92
|
end?: DiagramPort;
|
|
93
|
+
/**
|
|
94
|
+
* Direction that this connection follows at its end.
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
50
97
|
endDirection?: Side;
|
|
98
|
+
/**
|
|
99
|
+
* Coordinates of the end point of this connection.
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
51
102
|
endCoords: Point;
|
|
103
|
+
/**
|
|
104
|
+
* Look of the marker of this connection at the end, or `null` if the connection has no end marker.
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
52
107
|
endMarkerLook: ConnectionMarkerLook | null;
|
|
108
|
+
/**
|
|
109
|
+
* Text at the start of this connection, or `''` if no text.
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
53
112
|
startLabel: string;
|
|
113
|
+
/**
|
|
114
|
+
* Text at the middle of this connection, or `''` if no text.
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
54
117
|
middleLabel: string;
|
|
118
|
+
/**
|
|
119
|
+
* Text at the end of this connection, or `''` if no text.
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
55
122
|
endLabel: string;
|
|
123
|
+
/**
|
|
124
|
+
* Points that this connection passes through.
|
|
125
|
+
* @public
|
|
126
|
+
*/
|
|
56
127
|
points: Point[];
|
|
128
|
+
/**
|
|
129
|
+
* Name of this connection. Alias for this connection's middle label.
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
57
132
|
get name(): string;
|
|
58
133
|
set name(name: string);
|
|
59
134
|
constructor(model: DiagramModel, type: DiagramConnectionType, start?: DiagramPort, end?: DiagramPort, id?: string);
|