@metadev/daga 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/Changelog.md +9 -0
  2. package/LICENSE.md +13 -0
  3. package/README.md +30 -0
  4. package/assets/config/generic-diagram.json +94 -0
  5. package/assets/icon/action/drop-down-arrow.svg +8 -0
  6. package/assets/icon/action/drop-horizontal-left.svg +14 -0
  7. package/assets/icon/action/drop-horizontal-none.svg +13 -0
  8. package/assets/icon/action/drop-horizontal-right.svg +14 -0
  9. package/assets/icon/action/drop-vertical-down.svg +14 -0
  10. package/assets/icon/action/drop-vertical-none.svg +13 -0
  11. package/assets/icon/action/drop-vertical-up.svg +14 -0
  12. package/assets/icon/action/filter-clear.png +0 -0
  13. package/assets/icon/buttons/center-hover.svg +10 -0
  14. package/assets/icon/buttons/center.svg +10 -0
  15. package/assets/icon/buttons/ellipsis-hover.svg +7 -0
  16. package/assets/icon/buttons/ellipsis.svg +7 -0
  17. package/assets/icon/buttons/filter-off-hover.svg +5 -0
  18. package/assets/icon/buttons/filter-off.svg +5 -0
  19. package/assets/icon/buttons/filter-on-hover.svg +5 -0
  20. package/assets/icon/buttons/filter-on.svg +5 -0
  21. package/assets/icon/buttons/layout-hover.svg +8 -0
  22. package/assets/icon/buttons/layout.svg +8 -0
  23. package/assets/icon/buttons/redo-hover.svg +5 -0
  24. package/assets/icon/buttons/redo.svg +5 -0
  25. package/assets/icon/buttons/undo-hover.svg +5 -0
  26. package/assets/icon/buttons/undo.svg +5 -0
  27. package/assets/icon/buttons/zoom-in-hover.svg +8 -0
  28. package/assets/icon/buttons/zoom-in.svg +8 -0
  29. package/assets/icon/buttons/zoom-out-hover.svg +7 -0
  30. package/assets/icon/buttons/zoom-out.svg +7 -0
  31. package/assets/icon/connection/arrow.svg +23 -0
  32. package/assets/icon/connection/empty-arrow.svg +19 -0
  33. package/assets/icon/connection/empty-diamond.svg +20 -0
  34. package/assets/icon/connection/filled-arrow.svg +19 -0
  35. package/assets/icon/connection/filled-diamond.svg +20 -0
  36. package/assets/icon/connection/line.svg +9 -0
  37. package/assets/icon/property/add.svg +3 -0
  38. package/assets/icon/property/close.svg +3 -0
  39. package/assets/icon/property/ellipsis.svg +5 -0
  40. package/assets/icon/property/hide.svg +10 -0
  41. package/assets/styles/styles.scss +181 -0
  42. package/fesm2022/metadev-daga.mjs +6480 -0
  43. package/fesm2022/metadev-daga.mjs.map +1 -0
  44. package/index.d.ts +39 -0
  45. package/lib/collapse-button/collapse-button.component.d.ts +17 -0
  46. package/lib/daga.module.d.ts +19 -0
  47. package/lib/diagram/diagram.component.d.ts +18 -0
  48. package/lib/diagram-buttons/diagram-buttons.component.d.ts +29 -0
  49. package/lib/diagram-editor/diagram/converters/daga-exporter.d.ts +6 -0
  50. package/lib/diagram-editor/diagram/converters/daga-importer.d.ts +6 -0
  51. package/lib/diagram-editor/diagram/converters/daga-model.d.ts +59 -0
  52. package/lib/diagram-editor/diagram/converters/diagram-model-exporter.d.ts +7 -0
  53. package/lib/diagram-editor/diagram/converters/diagram-model-importer.d.ts +7 -0
  54. package/lib/diagram-editor/diagram/diagram-action.d.ts +137 -0
  55. package/lib/diagram-editor/diagram/diagram-canvas.d.ts +99 -0
  56. package/lib/diagram-editor/diagram/diagram-config.d.ts +617 -0
  57. package/lib/diagram-editor/diagram/diagram-connection.d.ts +64 -0
  58. package/lib/diagram-editor/diagram/diagram-element.d.ts +21 -0
  59. package/lib/diagram-editor/diagram/diagram-field.d.ts +37 -0
  60. package/lib/diagram-editor/diagram/diagram-model.d.ts +64 -0
  61. package/lib/diagram-editor/diagram/diagram-node.d.ts +68 -0
  62. package/lib/diagram-editor/diagram/diagram-port.d.ts +27 -0
  63. package/lib/diagram-editor/diagram/diagram-property.d.ts +141 -0
  64. package/lib/diagram-editor/diagram/diagram-section.d.ts +36 -0
  65. package/lib/diagram-editor/diagram/layout/adjacency-layout.d.ts +8 -0
  66. package/lib/diagram-editor/diagram/layout/breadth-adjacency-layout.d.ts +8 -0
  67. package/lib/diagram-editor/diagram/layout/breadth-layout.d.ts +9 -0
  68. package/lib/diagram-editor/diagram/layout/diagram-layout.d.ts +10 -0
  69. package/lib/diagram-editor/diagram/layout/force-layout.d.ts +8 -0
  70. package/lib/diagram-editor/diagram/layout/horizontal-layout.d.ts +8 -0
  71. package/lib/diagram-editor/diagram/layout/priority-layout.d.ts +8 -0
  72. package/lib/diagram-editor/diagram/layout/vertical-layout.d.ts +8 -0
  73. package/lib/diagram-editor/diagram-editor.component.d.ts +27 -0
  74. package/lib/errors/diagram-error.d.ts +5 -0
  75. package/lib/errors/diagram-validator.d.ts +8 -0
  76. package/lib/errors/errors.component.d.ts +21 -0
  77. package/lib/interfaces/canvas.d.ts +203 -0
  78. package/lib/interfaces/diagram-buttons.d.ts +33 -0
  79. package/lib/interfaces/diagram-editor.d.ts +20 -0
  80. package/lib/interfaces/palette.d.ts +10 -0
  81. package/lib/interfaces/property-editor.d.ts +19 -0
  82. package/lib/object-editor/object-editor.component.d.ts +25 -0
  83. package/lib/palette/palette.component.d.ts +31 -0
  84. package/lib/property-editor/property-editor.component.d.ts +18 -0
  85. package/lib/services/canvas-provider.service.d.ts +15 -0
  86. package/lib/services/daga-configuration.service.d.ts +12 -0
  87. package/lib/text-list-editor/text-list-editor.component.d.ts +20 -0
  88. package/lib/text-map-editor/text-map-editor.component.d.ts +29 -0
  89. package/lib/util/canvas-util.d.ts +16 -0
  90. package/lib/util/events.d.ts +53 -0
  91. package/lib/util/grid.d.ts +19 -0
  92. package/lib/util/line.d.ts +15 -0
  93. package/lib/util/list-util.d.ts +2 -0
  94. package/lib/util/shape.d.ts +23 -0
  95. package/lib/util/svg-util.d.ts +22 -0
  96. package/package.json +55 -0
package/index.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ export { CollapseButtonComponent } from './lib/collapse-button/collapse-button.component';
2
+ export { DagaModule } from './lib/daga.module';
3
+ export { DiagramButtonsComponent } from './lib/diagram-buttons/diagram-buttons.component';
4
+ export { DiagramEditorComponent } from './lib/diagram-editor/diagram-editor.component';
5
+ export { DagaExporter } from './lib/diagram-editor/diagram/converters/daga-exporter';
6
+ export { DagaImporter } from './lib/diagram-editor/diagram/converters/daga-importer';
7
+ export { DagaModel } from './lib/diagram-editor/diagram/converters/daga-model';
8
+ export { DiagramModelExporter } from './lib/diagram-editor/diagram/converters/diagram-model-exporter';
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';
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 } from './lib/diagram-editor/diagram/diagram-element';
15
+ export { DiagramField } from './lib/diagram-editor/diagram/diagram-field';
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';
19
+ export { Property, PropertySet, Type, ValueSet } from './lib/diagram-editor/diagram/diagram-property';
20
+ export { AdjacencyLayout } from './lib/diagram-editor/diagram/layout/adjacency-layout';
21
+ export { BreadthAdjacencyLayout } from './lib/diagram-editor/diagram/layout/breadth-adjacency-layout';
22
+ export { BreadthLayout } from './lib/diagram-editor/diagram/layout/breadth-layout';
23
+ export { DiagramLayout, layouts } from './lib/diagram-editor/diagram/layout/diagram-layout';
24
+ export { ForceLayout } from './lib/diagram-editor/diagram/layout/force-layout';
25
+ export { HorizontalLayout } from './lib/diagram-editor/diagram/layout/horizontal-layout';
26
+ export { PriorityLayout } from './lib/diagram-editor/diagram/layout/priority-layout';
27
+ export { VerticalLayout } from './lib/diagram-editor/diagram/layout/vertical-layout';
28
+ export { DiagramComponent } from './lib/diagram/diagram.component';
29
+ export { DiagramError } from './lib/errors/diagram-error';
30
+ export { DiagramValidator } from './lib/errors/diagram-validator';
31
+ export { ErrorsComponent } from './lib/errors/errors.component';
32
+ export { Canvas } from './lib/interfaces/canvas';
33
+ export { ObjectEditorComponent } from './lib/object-editor/object-editor.component';
34
+ export { PaletteComponent } from './lib/palette/palette.component';
35
+ export { PropertyEditorComponent } from './lib/property-editor/property-editor.component';
36
+ export { CanvasProviderService } from './lib/services/canvas-provider.service';
37
+ export { DagaConfigurationService } from './lib/services/daga-configuration.service';
38
+ export { TextListEditorComponent } from './lib/text-list-editor/text-list-editor.component';
39
+ export { TextMapEditorComponent } from './lib/text-map-editor/text-map-editor.component';
@@ -0,0 +1,17 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { Side } from '../util/svg-util';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CollapseButtonComponent {
5
+ collapsableSelector: string | ElementRef | HTMLElement;
6
+ collapsableAdditionalSelector: string;
7
+ collapsed: boolean;
8
+ disabled: boolean;
9
+ direction: Side;
10
+ rule: string;
11
+ collapsedValue: string;
12
+ visibleValue: string;
13
+ Side: typeof Side;
14
+ toggleCollapse(): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<CollapseButtonComponent, never>;
16
+ 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
+ }
@@ -0,0 +1,19 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./collapse-button/collapse-button.component";
3
+ import * as i2 from "./diagram-buttons/diagram-buttons.component";
4
+ import * as i3 from "./diagram/diagram.component";
5
+ import * as i4 from "./diagram-editor/diagram-editor.component";
6
+ import * as i5 from "./errors/errors.component";
7
+ import * as i6 from "./object-editor/object-editor.component";
8
+ import * as i7 from "./palette/palette.component";
9
+ import * as i8 from "./text-list-editor/text-list-editor.component";
10
+ import * as i9 from "./text-map-editor/text-map-editor.component";
11
+ import * as i10 from "./property-editor/property-editor.component";
12
+ import * as i11 from "@angular/common";
13
+ import * as i12 from "@angular/forms";
14
+ import * as i13 from "@metadev/lux";
15
+ export declare class DagaModule {
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DagaModule, never>;
17
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DagaModule, never, [typeof i1.CollapseButtonComponent, typeof i2.DiagramButtonsComponent, typeof i3.DiagramComponent, typeof i4.DiagramEditorComponent, typeof i5.ErrorsComponent, typeof i6.ObjectEditorComponent, typeof i7.PaletteComponent, typeof i8.TextListEditorComponent, typeof i9.TextMapEditorComponent, typeof i10.PropertyEditorComponent, typeof i11.CommonModule, typeof i12.FormsModule, typeof i13.LuxModule], [typeof i3.DiagramComponent, typeof i4.DiagramEditorComponent]>;
18
+ static ɵinj: i0.ɵɵInjectorDeclaration<DagaModule>;
19
+ }
@@ -0,0 +1,18 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { DiagramConfig } from '../diagram-editor/diagram/diagram-config';
3
+ import { CanvasProviderService } from '../services/canvas-provider.service';
4
+ import { DagaConfigurationService } from '../services/daga-configuration.service';
5
+ import * as i0 from "@angular/core";
6
+ /**
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
+ * 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
+ */
10
+ export declare class DiagramComponent implements OnInit {
11
+ private configurationService;
12
+ private canvasProvider;
13
+ config: DiagramConfig;
14
+ constructor(configurationService: DagaConfigurationService, canvasProvider: CanvasProviderService);
15
+ ngOnInit(): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DiagramComponent, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<DiagramComponent, "daga-diagram", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, ["*"], true, never>;
18
+ }
@@ -0,0 +1,29 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { Canvas } from '../interfaces/canvas';
3
+ import { DiagramButtons } from '../interfaces/diagram-buttons';
4
+ import { CanvasProviderService } from '../services/canvas-provider.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class DiagramButtonsComponent implements DiagramButtons {
7
+ private canvasProvider;
8
+ get canvas(): Canvas;
9
+ collapsableButtons: ElementRef<HTMLDivElement>;
10
+ enableFilter: boolean;
11
+ enableLayout: boolean;
12
+ enableUndoRedo: boolean;
13
+ enableZoom: boolean;
14
+ zoomRate: number;
15
+ filterOn: boolean;
16
+ collapsed: boolean;
17
+ animationOngoing: boolean;
18
+ constructor(canvasProvider: CanvasProviderService);
19
+ toggleCollapse(): Promise<void>;
20
+ zoomIn(): void;
21
+ zoomOut(): void;
22
+ center(): void;
23
+ layout(): void;
24
+ filter(): void;
25
+ undo(): void;
26
+ redo(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<DiagramButtonsComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<DiagramButtonsComponent, "daga-diagram-buttons", never, { "enableFilter": { "alias": "enableFilter"; "required": false; }; "enableLayout": { "alias": "enableLayout"; "required": false; }; "enableUndoRedo": { "alias": "enableUndoRedo"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; "zoomRate": { "alias": "zoomRate"; "required": false; }; }, {}, never, never, true, never>;
29
+ }
@@ -0,0 +1,6 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DagaModel } from './daga-model';
3
+ import { DiagramModelExporter } from './diagram-model-exporter';
4
+ export declare class DagaExporter implements DiagramModelExporter<DagaModel> {
5
+ export(model: DiagramModel): DagaModel;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ import { DagaModel } from './daga-model';
3
+ import { DiagramModelImporter } from './diagram-model-importer';
4
+ export declare class DagaImporter implements DiagramModelImporter<DagaModel> {
5
+ import(model: DiagramModel, data: DagaModel): DiagramModel;
6
+ }
@@ -0,0 +1,59 @@
1
+ import { Point } from '../../../util/canvas-util';
2
+ import { Side } from '../../../util/svg-util';
3
+ export declare const DAGA_FILE_VERSION = 1;
4
+ export interface DagaModel {
5
+ id?: string;
6
+ /** User version */
7
+ version?: string;
8
+ name: string;
9
+ description?: string;
10
+ type: string;
11
+ /** Serialization file format version for tooling */
12
+ typeVersion: number;
13
+ createdAt: Date;
14
+ updatedAt: Date;
15
+ updatedDaysAgo?: string;
16
+ nodes: {
17
+ id: string;
18
+ type: string;
19
+ sections?: {
20
+ id: string;
21
+ ports?: {
22
+ id: string;
23
+ coords: Point;
24
+ direction: Side;
25
+ label: string;
26
+ }[];
27
+ label: string;
28
+ coords: Point;
29
+ width: number;
30
+ height: number;
31
+ }[];
32
+ ports?: {
33
+ id: string;
34
+ coords: Point;
35
+ direction: Side;
36
+ label: string;
37
+ }[];
38
+ label: string;
39
+ coords: Point;
40
+ width: number;
41
+ height: number;
42
+ data: {
43
+ [key: string]: unknown;
44
+ };
45
+ }[];
46
+ connections: {
47
+ id: string;
48
+ type: string;
49
+ start: string;
50
+ end: string;
51
+ startLabel: string;
52
+ middleLabel: string;
53
+ endLabel: string;
54
+ points: Point[];
55
+ data: {
56
+ [key: string]: unknown;
57
+ };
58
+ }[];
59
+ }
@@ -0,0 +1,7 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ export interface DiagramModelExporter<T> {
3
+ /**
4
+ * Exports a diagram from the given model.
5
+ */
6
+ export(model: DiagramModel): T;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { DiagramModel } from '../diagram-model';
2
+ export interface DiagramModelImporter<T> {
3
+ /**
4
+ * Imports a diagram in the given model using the given data.
5
+ */
6
+ import(model: DiagramModel, data: T): DiagramModel;
7
+ }
@@ -0,0 +1,137 @@
1
+ import { Canvas } from '../../interfaces/canvas';
2
+ import { Point } from '../../util/canvas-util';
3
+ import { Side } from '../../util/svg-util';
4
+ import { DiagramConnection, DiagramConnectionType } from './diagram-connection';
5
+ import { DiagramField } from './diagram-field';
6
+ import { DiagramModel } from './diagram-model';
7
+ import { DiagramNode, DiagramNodeType } from './diagram-node';
8
+ import { DiagramPort } from './diagram-port';
9
+ import { ValueSet } from './diagram-property';
10
+ import { DiagramSection } from './diagram-section';
11
+ export declare class ActionQueue {
12
+ maximum: number;
13
+ history: DiagramAction[];
14
+ /** Index of the last action not counting undone actions. One-indexed. Zero if all actions are undone. */
15
+ index: number;
16
+ constructor(maximum: number);
17
+ /**
18
+ * Adds an action to the history.
19
+ */
20
+ add(action: DiagramAction): void;
21
+ /**
22
+ * Undoes the last action in the history, not counting undone actions.
23
+ */
24
+ undo(): void;
25
+ /**
26
+ * Redoes the last undone action in the history.
27
+ */
28
+ redo(): void;
29
+ }
30
+ export interface DiagramAction {
31
+ undo(): void;
32
+ redo(): void;
33
+ }
34
+ export declare class AddNodeAction implements DiagramAction {
35
+ canvas: Canvas;
36
+ type: DiagramNodeType;
37
+ coords: Point;
38
+ label?: string;
39
+ values?: {
40
+ [key: string]: unknown;
41
+ };
42
+ id?: string | undefined;
43
+ sectionIds?: (string | undefined)[];
44
+ sectionPortIds?: (string | undefined)[][];
45
+ sectionPortLabelIds?: (string | undefined)[][];
46
+ portIds?: (string | undefined)[];
47
+ portLabelIds?: (string | undefined)[];
48
+ labelId?: string | undefined;
49
+ constructor(canvas: Canvas, type: DiagramNodeType, coords: Point, label?: string, values?: {
50
+ [key: string]: unknown;
51
+ }, id?: string);
52
+ undo(): void;
53
+ redo(): void;
54
+ }
55
+ export declare class MoveNodeAction implements DiagramAction {
56
+ canvas: Canvas;
57
+ nodeId: string;
58
+ from: Point;
59
+ to: Point;
60
+ constructor(canvas: Canvas, nodeId: string, from: Point, to: Point);
61
+ undo(): void;
62
+ redo(): void;
63
+ }
64
+ export declare class StretchNodeAction implements DiagramAction {
65
+ canvas: Canvas;
66
+ nodeId: string;
67
+ direction: Side;
68
+ from: number;
69
+ to: number;
70
+ constructor(canvas: Canvas, nodeId: string, direction: Side, from: number, to: number);
71
+ undo(): void;
72
+ redo(): void;
73
+ }
74
+ export declare class StretchSectionAction implements DiagramAction {
75
+ canvas: Canvas;
76
+ sectionId: string;
77
+ direction: Side;
78
+ from: number;
79
+ to: number;
80
+ constructor(canvas: Canvas, sectionId: string, direction: Side, from: number, to: number);
81
+ undo(): void;
82
+ redo(): void;
83
+ }
84
+ export declare class AddConnectionAction implements DiagramAction {
85
+ canvas: Canvas;
86
+ type: DiagramConnectionType;
87
+ startId: string;
88
+ endId: string;
89
+ id?: string;
90
+ constructor(canvas: Canvas, type: DiagramConnectionType, startId: string, endId: string, id?: string);
91
+ undo(): void;
92
+ redo(): void;
93
+ }
94
+ export declare class EditFieldAction implements DiagramAction {
95
+ canvas: Canvas;
96
+ fieldId: string;
97
+ from: string;
98
+ to: string;
99
+ constructor(canvas: Canvas, fieldId: string, from: string, to: string);
100
+ undo(): void;
101
+ redo(): void;
102
+ }
103
+ export declare class UpdateValuesAction implements DiagramAction {
104
+ model: DiagramModel;
105
+ id: string | undefined;
106
+ from: {
107
+ [key: string]: unknown;
108
+ };
109
+ to: {
110
+ [key: string]: unknown;
111
+ };
112
+ constructor(model: DiagramModel, id: string | undefined, from: {
113
+ [key: string]: unknown;
114
+ }, to: {
115
+ [key: string]: unknown;
116
+ });
117
+ getValueSet(): ValueSet | undefined;
118
+ undo(): void;
119
+ redo(): void;
120
+ }
121
+ export declare class RemoveAction implements DiagramAction {
122
+ model: DiagramModel;
123
+ nodes: DiagramNode[];
124
+ nodeIds: string[];
125
+ sections: DiagramSection[];
126
+ sectionIds: string[];
127
+ ports: DiagramPort[];
128
+ portIds: string[];
129
+ connections: DiagramConnection[];
130
+ connectionIds: string[];
131
+ fields: DiagramField[];
132
+ fieldIds: string[];
133
+ constructor(model: DiagramModel, nodes: DiagramNode[], sections: DiagramSection[], ports: DiagramPort[], connections: DiagramConnection[], fields: DiagramField[]);
134
+ undo(): void;
135
+ redo(): void;
136
+ }
137
+ export declare const clone: <T extends object | null | undefined>(obj: T) => T;
@@ -0,0 +1,99 @@
1
+ import * as d3 from 'd3';
2
+ import { Subject } from 'rxjs';
3
+ import { DiagramValidator } from '../../errors/diagram-validator';
4
+ import { Canvas } from '../../interfaces/canvas';
5
+ import { DiagramEditor } from '../../interfaces/diagram-editor';
6
+ import { Point } from '../../util/canvas-util';
7
+ import { ActionQueue } from './diagram-action';
8
+ import { DiagramConfig } from './diagram-config';
9
+ import { DiagramConnection, DiagramConnectionType } from './diagram-connection';
10
+ import { DiagramElement } from './diagram-element';
11
+ import { DiagramModel } from './diagram-model';
12
+ import { DiagramPort } from './diagram-port';
13
+ import { ValueSet } from './diagram-property';
14
+ /**
15
+ * Thickness of the invisible path around a connection used to make it easier to click on, in pixels.
16
+ */
17
+ export declare const CONNECTION_PATH_BOX_THICKNESS = 12;
18
+ /**
19
+ * Text to display as the title of the property editor when editing this diagram's properties.
20
+ * @see PropertyEditorComponent
21
+ */
22
+ export declare const DIAGRAM_PROPERTIES_TEXT = "Diagram properties";
23
+ /**
24
+ * Maximum number of user actions that can be recorded in the user action queue.
25
+ * @see ActionQueue
26
+ */
27
+ export declare const ACTION_QUEUE_SIZE = 25;
28
+ export declare class DiagramCanvas implements Canvas {
29
+ parentComponent: DiagramEditor;
30
+ diagramRoot: HTMLElement;
31
+ model: DiagramModel;
32
+ color: string;
33
+ gridSize: number;
34
+ snapToGrid: boolean;
35
+ guessConnectionType: boolean;
36
+ connectionType?: DiagramConnectionType;
37
+ priorityThreshold?: number;
38
+ priorityThresholds: number[];
39
+ validators: DiagramValidator[];
40
+ layoutFormat?: string;
41
+ actionQueue: ActionQueue;
42
+ private static canvasCount;
43
+ private backgroundPatternId;
44
+ private zoomBehavior;
45
+ private zoomTransform;
46
+ private mainUserHighlight?;
47
+ private userHighlight;
48
+ private userSelection;
49
+ private propertyEditorSelection?;
50
+ private propertyEditorValues?;
51
+ private unfinishedConnection?;
52
+ private inputFieldContainer?;
53
+ private draggingFrom;
54
+ private currentAction?;
55
+ viewInitialized$: Subject<void>;
56
+ validatorChanges$: Subject<void>;
57
+ diagramChanges$: Subject<number>;
58
+ diagramImportantChanges$: Subject<void>;
59
+ constructor(parentComponent: DiagramEditor, config: DiagramConfig);
60
+ addValidator(validator: DiagramValidator): void;
61
+ removeValidator(validator: DiagramValidator): void;
62
+ initView(appendTo: HTMLElement): void;
63
+ zoomBy(zoom: number): void;
64
+ zoomTo(zoom: number): void;
65
+ translateBy(x: number, y: number): void;
66
+ translateTo(x: number, y: number): void;
67
+ center(): void;
68
+ getClosestGridPoint(point: Point): Point;
69
+ private getEventHoldingCoordinates;
70
+ getPointerLocationRelativeToCanvas(event: MouseEvent): Point;
71
+ getPointerLocationRelativeToBody(event: MouseEvent): Point;
72
+ updateModelInView(): void;
73
+ updateNodesInView(...ids: string[]): void;
74
+ updateSectionsInView(...ids: string[]): void;
75
+ updatePortsInView(...ids: string[]): void;
76
+ updateConnectionsInView(...ids: string[]): void;
77
+ updateFieldsInView(...ids: string[]): void;
78
+ updateConnectionLabelsInView(connection: DiagramConnection): void;
79
+ updateConnectionMarkersInView(connection: DiagramConnection): void;
80
+ selectRoot(): d3.Selection<d3.BaseType, unknown, null, unknown>;
81
+ selectCanvas(): d3.Selection<SVGGElement, unknown, null, unknown>;
82
+ selectCanvasView(): d3.Selection<SVGGElement, unknown, null, unknown>;
83
+ startConnection(port: DiagramPort): void;
84
+ finishConnection(port: DiagramPort): void;
85
+ dropConnection(): void;
86
+ highlight(element: DiagramElement): void;
87
+ unhighlight(): void;
88
+ setPropertyEditorSelection(selection?: DiagramElement & {
89
+ valueSet: ValueSet;
90
+ }): void;
91
+ isInUserSelection(selection: DiagramElement): boolean;
92
+ addToUserSelection(selection: DiagramElement): void;
93
+ removeFromUserSelection(selection: DiagramElement): void;
94
+ toggleUserSelection(selection: DiagramElement): void;
95
+ clearUserSelection(): void;
96
+ cancelAllUserActions(): void;
97
+ private createInputField;
98
+ private removeInputField;
99
+ }