@metadev/daga 1.5.1 → 1.5.3

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/index.d.ts CHANGED
@@ -14,12 +14,13 @@ export { ACTION_QUEUE_SIZE, DiagramCanvas } from './lib/diagram-editor/diagram/d
14
14
  export { ButtonsComponentConfig, ComponentsConfig, ConnectionMarkerLook, ConnectionTemplateConfig, ConnectionTypeConfig, DiagramConfig, ErrorsComponentConfig, FieldConfig, NodeImageLook, NodeShapedLook, NodeStretchableImageLook, NodeTemplateConfig, NodeTypeConfig, PaletteComponentConfig, PaletteSectionConfig, PortConfig, PropertyEditorComponentConfig, SectionConfig, SectionGridConfig, UserActionConfig } from './lib/diagram-editor/diagram/diagram-config';
15
15
  export { DiagramConnection, DiagramConnectionSet, DiagramConnectionType } from './lib/diagram-editor/diagram/diagram-connection';
16
16
  export { DiagramElement, DiagramEntity, DiagramEntitySet } from './lib/diagram-editor/diagram/diagram-element';
17
+ export { DiagramEvent } from './lib/diagram-editor/diagram/diagram-event';
17
18
  export { DiagramField, DiagramFieldSet } from './lib/diagram-editor/diagram/diagram-field';
18
19
  export { DiagramModel } from './lib/diagram-editor/diagram/diagram-model';
19
- export { DiagramNode, DiagramNodeSet, DiagramNodeType, DiagramNodeGeometry } from './lib/diagram-editor/diagram/diagram-node';
20
+ export { DiagramNode, DiagramNodeGeometry, DiagramNodeSet, DiagramNodeType } from './lib/diagram-editor/diagram/diagram-node';
20
21
  export { DiagramPort, DiagramPortSet } from './lib/diagram-editor/diagram/diagram-port';
21
22
  export { Property, PropertySet, Type, ValueSet } from './lib/diagram-editor/diagram/diagram-property';
22
- export { DiagramSection, DiagramSectionSet, DiagramSectionGeometry } from './lib/diagram-editor/diagram/diagram-section';
23
+ export { DiagramSection, DiagramSectionGeometry, DiagramSectionSet } from './lib/diagram-editor/diagram/diagram-section';
23
24
  export { AdjacencyLayout } from './lib/diagram-editor/diagram/layout/adjacency-layout';
24
25
  export { BreadthAdjacencyLayout } from './lib/diagram-editor/diagram/layout/breadth-adjacency-layout';
25
26
  export { BreadthLayout } from './lib/diagram-editor/diagram/layout/breadth-layout';
@@ -78,6 +78,7 @@ export declare class DiagramCanvas implements Canvas {
78
78
  validatorChanges$: Subject<void>;
79
79
  diagramChanges$: Subject<void>;
80
80
  diagramImportantChanges$: Subject<void>;
81
+ propertyEditorChanges$: Subject<void>;
81
82
  constructor(parentComponent: DiagramEditor, config: DiagramConfig);
82
83
  addValidator(validator: DiagramValidator): void;
83
84
  removeValidator(validator: DiagramValidator): void;
@@ -125,6 +126,7 @@ export declare class DiagramCanvas implements Canvas {
125
126
  setPropertyEditorSelection(selection?: {
126
127
  valueSet: ValueSet;
127
128
  } & (DiagramElement | DiagramModel)): void;
129
+ private makeUpdateValuesAction;
128
130
  isInUserSelection(selection: DiagramElement): boolean;
129
131
  addToUserSelection(selection: DiagramElement): void;
130
132
  removeFromUserSelection(selection: DiagramElement): void;
@@ -0,0 +1,16 @@
1
+ import { Point } from '../../util/canvas-util';
2
+ import { Events } from '../../util/events';
3
+ import { DiagramElement } from './diagram-element';
4
+ /**
5
+ * Represents an action taken by the user on the diagram.
6
+ * @public
7
+ */
8
+ export declare class DiagramEvent {
9
+ cause: Event;
10
+ type: Events;
11
+ target?: DiagramElement;
12
+ coords?: Point;
13
+ defaultPrevented: boolean;
14
+ constructor(cause: Event, type: Events, target?: DiagramElement, coords?: Point);
15
+ preventDefault(): void;
16
+ }
@@ -140,6 +140,7 @@ export declare class PropertySet {
140
140
  propertyList: Property[];
141
141
  constructor(properties?: Property[]);
142
142
  getProperty(key: string): Property;
143
+ hasProperty(key: string): boolean;
143
144
  hasProperties(): boolean;
144
145
  }
145
146
  /**
@@ -327,12 +328,9 @@ export declare const diff: (a: {
327
328
  [key: string]: unknown;
328
329
  }, b: {
329
330
  [key: string]: unknown;
330
- }) => [
331
- {
332
- [key: string]: unknown;
333
- },
334
- {
335
- [key: string]: unknown;
336
- }
337
- ];
331
+ }) => [{
332
+ [key: string]: unknown;
333
+ }, {
334
+ [key: string]: unknown;
335
+ }];
338
336
  export declare const isObject: (x: unknown) => boolean;
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, ElementRef, OnInit } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, EventEmitter, OnInit } from '@angular/core';
2
2
  import { DiagramButtonsComponent } from '../diagram-buttons/diagram-buttons.component';
3
3
  import { DiagramConfig } from '../diagram-editor/diagram/diagram-config';
4
4
  import { Canvas } from '../interfaces/canvas';
@@ -8,6 +8,7 @@ import { PropertyEditorComponent } from '../property-editor/property-editor.comp
8
8
  import { CanvasProviderService } from '../services/canvas-provider.service';
9
9
  import { DagaConfigurationService } from '../services/daga-configuration.service';
10
10
  import { Corner, Side } from '../util/svg-util';
11
+ import { DiagramEvent } from './diagram/diagram-event';
11
12
  import * as i0 from "@angular/core";
12
13
  /**
13
14
  * A diagram's user interface editor.
@@ -20,6 +21,11 @@ export declare class DiagramEditorComponent implements AfterViewInit, DiagramEdi
20
21
  diagramButtons: DiagramButtonsComponent;
21
22
  palette: PaletteComponent;
22
23
  propertyEditor: PropertyEditorComponent;
24
+ /**
25
+ * Output for user events on the diagram's model.
26
+ * @public
27
+ */
28
+ modelEvent: EventEmitter<DiagramEvent>;
23
29
  get config(): DiagramConfig;
24
30
  get canvas(): Canvas;
25
31
  Corner: typeof Corner;
@@ -28,5 +34,5 @@ export declare class DiagramEditorComponent implements AfterViewInit, DiagramEdi
28
34
  ngOnInit(): void;
29
35
  ngAfterViewInit(): void;
30
36
  static ɵfac: i0.ɵɵFactoryDeclaration<DiagramEditorComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<DiagramEditorComponent, "daga-diagram-editor", never, {}, {}, never, never, true, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<DiagramEditorComponent, "daga-diagram-editor", never, {}, { "modelEvent": "modelEvent"; }, never, never, true, never>;
32
38
  }
@@ -98,6 +98,11 @@ export interface Canvas {
98
98
  * @public
99
99
  */
100
100
  diagramImportantChanges$: Subject<void>;
101
+ /**
102
+ * Subject for tracking changes in the property editor.
103
+ * @public
104
+ */
105
+ propertyEditorChanges$: Subject<void>;
101
106
  /**
102
107
  * Initializes the view of the diagram.
103
108
  * @private
@@ -1,6 +1,8 @@
1
+ import { EventEmitter } from '@angular/core';
1
2
  import { DiagramButtons } from './diagram-buttons';
2
3
  import { Palette } from './palette';
3
4
  import { PropertyEditor } from './property-editor';
5
+ import { DiagramEvent } from '../diagram-editor/diagram/diagram-event';
4
6
  /**
5
7
  * Exposes the components of the diagram editor.
6
8
  * @private
@@ -21,4 +23,9 @@ export interface DiagramEditor {
21
23
  * @private
22
24
  */
23
25
  propertyEditor: PropertyEditor;
26
+ /**
27
+ * Event emitter of user actions taken on the diagram.
28
+ * @private
29
+ */
30
+ modelEvent: EventEmitter<DiagramEvent>;
24
31
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@metadev/daga",
3
3
  "description": "Diagramming engine for editing models on the Web. Made by Metadev.",
4
- "version": "1.5.1",
4
+ "version": "1.5.3",
5
5
  "author": "Metadev (https://metadev.pro)",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
7
7
  "repository": "git+https://github.com/metadevpro/daga-tutorial.git",
@@ -18,12 +18,12 @@
18
18
  "angular"
19
19
  ],
20
20
  "peerDependencies": {
21
- "@angular/common": "^18.0.1",
22
- "@angular/core": "^18.0.1",
23
- "@angular/forms": "^18.0.1",
21
+ "@angular/common": "^18.2.2",
22
+ "@angular/core": "^18.2.2",
23
+ "@angular/forms": "^18.2.2",
24
24
  "d3": "^7.9.0",
25
25
  "rxjs": "~7.8.1",
26
- "uuid": "^9.0.0"
26
+ "uuid": "^10.0.0"
27
27
  },
28
28
  "sideEffects": false,
29
29
  "files": [