@visuallyjs/browser-ui-angular 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/esm2022/index.mjs +6 -0
  2. package/esm2022/lib/background.component.mjs +38 -0
  3. package/esm2022/lib/base.group.component.mjs +3 -3
  4. package/esm2022/lib/base.node.component.mjs +3 -3
  5. package/esm2022/lib/base.port.component.mjs +4 -4
  6. package/esm2022/lib/base.vertex.component.mjs +33 -12
  7. package/esm2022/lib/browser-ui-angular.module.mjs +38 -8
  8. package/esm2022/lib/charts/area.chart.component.mjs +3 -3
  9. package/esm2022/lib/charts/bar.chart.component.mjs +3 -3
  10. package/esm2022/lib/charts/bubble.chart.component.mjs +3 -3
  11. package/esm2022/lib/charts/column.chart.component.mjs +3 -3
  12. package/esm2022/lib/charts/line.chart.component.mjs +3 -3
  13. package/esm2022/lib/charts/pie.chart.component.mjs +3 -3
  14. package/esm2022/lib/charts/sankey.chart.component.mjs +4 -4
  15. package/esm2022/lib/charts/scatter.chart.component.mjs +3 -3
  16. package/esm2022/lib/charts/series.based.chart.component.mjs +4 -4
  17. package/esm2022/lib/charts/xy.chart.component.mjs +3 -3
  18. package/esm2022/lib/color.tag.component.mjs +6 -6
  19. package/esm2022/lib/controls-component.mjs +4 -4
  20. package/esm2022/lib/decorator-component.mjs +3 -3
  21. package/esm2022/lib/default-group-component.mjs +3 -3
  22. package/esm2022/lib/default-node-component.mjs +3 -3
  23. package/esm2022/lib/diagram-component.mjs +34 -12
  24. package/esm2022/lib/diagram-palette-component.mjs +4 -4
  25. package/esm2022/lib/edge.type.picker.component.mjs +5 -5
  26. package/esm2022/lib/export-controls-component.mjs +3 -3
  27. package/esm2022/lib/grid-background.component.mjs +77 -0
  28. package/esm2022/lib/image-background.component.mjs +38 -0
  29. package/esm2022/lib/inspector.component.mjs +4 -4
  30. package/esm2022/lib/miniview-component.mjs +4 -4
  31. package/esm2022/lib/overlay-component.mjs +52 -1
  32. package/esm2022/lib/palette.component.mjs +4 -4
  33. package/esm2022/lib/paper-component.mjs +354 -0
  34. package/esm2022/lib/shape.component.mjs +4 -4
  35. package/esm2022/lib/shape.palette.component.mjs +4 -4
  36. package/esm2022/lib/surface-component.mjs +87 -16
  37. package/esm2022/lib/surface-popup-component.mjs +62 -0
  38. package/esm2022/lib/tiled-image-background.component.mjs +62 -0
  39. package/esm2022/lib/vjs-service.mjs +3 -3
  40. package/fesm2022/visuallyjs-browser-ui-angular.mjs +938 -144
  41. package/fesm2022/visuallyjs-browser-ui-angular.mjs.map +1 -1
  42. package/index.d.ts +6 -0
  43. package/lib/background.component.d.ts +13 -0
  44. package/lib/base.vertex.component.d.ts +29 -3
  45. package/lib/browser-ui-angular.module.d.ts +27 -21
  46. package/lib/diagram-component.d.ts +7 -5
  47. package/lib/grid-background.component.d.ts +81 -0
  48. package/lib/image-background.component.d.ts +18 -0
  49. package/lib/overlay-component.d.ts +32 -8
  50. package/lib/paper-component.d.ts +162 -0
  51. package/lib/surface-component.d.ts +25 -11
  52. package/lib/surface-popup-component.d.ts +62 -0
  53. package/lib/tiled-image-background.component.d.ts +72 -0
  54. package/package.json +2 -2
  55. package/visuallyjs-browser-ui-angular.tgz +0 -0
@@ -7,10 +7,10 @@ export class DefaultNodeComponent extends BaseNodeComponent {
7
7
  super(...arguments);
8
8
  this.label = computed(() => this.$data().label || "");
9
9
  }
10
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DefaultNodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
11
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DefaultNodeComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `<div class="vjs-default-node">{{label()}}</div>`, isInline: true }); }
10
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DefaultNodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
11
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DefaultNodeComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `<div class="vjs-default-node">{{label()}}</div>`, isInline: true }); }
12
12
  }
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DefaultNodeComponent, decorators: [{
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DefaultNodeComponent, decorators: [{
14
14
  type: Component,
15
15
  args: [{
16
16
  template: `<div class="vjs-default-node">{{label()}}</div>`
@@ -1,23 +1,49 @@
1
- import { Component, ElementRef, inject, Input, NgZone } from "@angular/core";
1
+ import { Component, effect, ElementRef, inject, input, Input, NgZone } from "@angular/core";
2
2
  import { createDiagram } from "@visuallyjs/browser-ui";
3
3
  import { VisuallyJsService } from "./vjs-service";
4
4
  import * as i0 from "@angular/core";
5
5
 
6
6
  export class DiagramComponent {
7
7
  constructor() {
8
+
9
+ this.data = input();
10
+
11
+ this.url = input();
8
12
  this.$ngZone = inject(NgZone);
9
13
  this.$el = inject(ElementRef);
10
14
  this.$vjs = inject(VisuallyJsService);
15
+ this._dataEffect = effect(() => {
16
+ const currentData = this.data();
17
+ if (currentData) {
18
+ if (this.diagram) {
19
+ this.diagram.clear();
20
+ this.diagram.load({ data: currentData });
21
+ }
22
+ }
23
+ });
24
+ this._urlEffect = effect(() => {
25
+ const currentUrl = this.url();
26
+ if (currentUrl) {
27
+ // Respond to changes in the url here.
28
+ // For example, if you need to reload the model with new data:
29
+ if (this.diagram) {
30
+ this.diagram.clear();
31
+ this.diagram.load({ url: currentUrl });
32
+ }
33
+ }
34
+ });
11
35
  }
12
36
  ngAfterViewInit() {
13
37
  this.$ngZone.runOutsideAngular(() => {
14
38
  this.diagram = createDiagram(this.$el.nativeElement, this.options, this.modelOptions);
15
39
  this.$vjs.$setDiagram(this.diagram);
16
- if (this.data != null) {
17
- this.diagram.load({ data: this.data });
40
+ const initialData = this.data();
41
+ const initialUrl = this.url();
42
+ if (initialData) {
43
+ this.diagram.load({ data: initialData });
18
44
  }
19
- else if (this.url != null) {
20
- this.diagram.load({ url: this.url });
45
+ else if (initialUrl) {
46
+ this.diagram.load({ url: initialUrl });
21
47
  }
22
48
  });
23
49
  }
@@ -32,10 +58,10 @@ export class DiagramComponent {
32
58
  saveToUrl(options) {
33
59
  this.diagram.saveToUrl(options);
34
60
  }
35
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagramComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
36
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DiagramComponent, selector: "vjs-diagram", inputs: { options: "options", data: "data", url: "url", modelOptions: "modelOptions" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
61
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DiagramComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
62
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: DiagramComponent, selector: "vjs-diagram", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, modelOptions: { classPropertyName: "modelOptions", publicName: "modelOptions", isSignal: false, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
37
63
  }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagramComponent, decorators: [{
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DiagramComponent, decorators: [{
39
65
  type: Component,
40
66
  args: [{
41
67
  selector: "vjs-diagram",
@@ -43,10 +69,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
43
69
  }]
44
70
  }], propDecorators: { options: [{
45
71
  type: Input
46
- }], data: [{
47
- type: Input
48
- }], url: [{
49
- type: Input
50
72
  }], modelOptions: [{
51
73
  type: Input
52
74
  }] } });
@@ -42,16 +42,16 @@ export class DiagramPaletteComponent {
42
42
  this.$init(this.inputDiagram);
43
43
  }
44
44
  }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagramPaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
46
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DiagramPaletteComponent, selector: "vjs-diagram-palette", inputs: { fill: "fill", outline: "outline", dragSize: "dragSize", inspector: "inspector", iconSize: "iconSize", showLabels: "showLabels", paletteStrokeWidth: "paletteStrokeWidth", showAllMessage: "showAllMessage", onCellAdded: "onCellAdded", mode: "mode", allowClickToAdd: "allowClickToAdd", autoExitDrawMode: "autoExitDrawMode", selectAfterAdd: "selectAfterAdd", inputDiagram: ["diagram", "inputDiagram"], onVertexAdded: "onVertexAdded", preparedShapes: "preparedShapes" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DiagramPaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
46
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DiagramPaletteComponent, selector: "vjs-diagram-palette", inputs: { fill: "fill", outline: "outline", dragSize: "dragSize", inspector: "inspector", iconSize: "iconSize", showLabels: "showLabels", paletteStrokeWidth: "paletteStrokeWidth", showAllMessage: "showAllMessage", onCellAdded: "onCellAdded", mode: "mode", allowClickToAdd: "allowClickToAdd", autoExitDrawMode: "autoExitDrawMode", selectAfterAdd: "selectAfterAdd", inputDiagram: ["diagram", "inputDiagram"], onVertexAdded: "onVertexAdded", preparedShapes: "preparedShapes" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
47
47
  }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DiagramPaletteComponent, decorators: [{
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DiagramPaletteComponent, decorators: [{
49
49
  type: Component,
50
50
  args: [{
51
51
  selector: "vjs-diagram-palette",
52
52
  template: `<div></div>`,
53
53
  }]
54
- }], ctorParameters: function () { return []; }, propDecorators: { fill: [{
54
+ }], ctorParameters: () => [], propDecorators: { fill: [{
55
55
  type: Input
56
56
  }], outline: [{
57
57
  type: Input
@@ -25,7 +25,7 @@ export class EdgeTypePickerComponent {
25
25
  });
26
26
  const current = inspector.getValue(this.propertyName) || '';
27
27
  this.edgeTypePicker = new EdgeTypePicker(inspector.$ui, this.el.nativeElement, this.resolveMappings(), current, (p, v) => {
28
- inspector.setValue(this.propertyName, v);
28
+ inspector.setValue(this.propertyName, v, null);
29
29
  this.changeEvent.emit(v);
30
30
  });
31
31
  this.edgeTypePicker.render(this.propertyName, inspector._currentCommonData);
@@ -33,16 +33,16 @@ export class EdgeTypePickerComponent {
33
33
  }
34
34
  });
35
35
  }
36
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EdgeTypePickerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
37
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EdgeTypePickerComponent, selector: "vjs-edge-type", inputs: { propertyName: "propertyName", edgeMappings: "edgeMappings" }, outputs: { changeEvent: "changeEvent" }, ngImport: i0, template: `<div [attr.vjs-att]="propertyName"></div>`, isInline: true }); }
36
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EdgeTypePickerComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
37
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: EdgeTypePickerComponent, selector: "vjs-edge-type", inputs: { propertyName: "propertyName", edgeMappings: "edgeMappings" }, outputs: { changeEvent: "changeEvent" }, ngImport: i0, template: `<div [attr.vjs-att]="propertyName"></div>`, isInline: true }); }
38
38
  }
39
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EdgeTypePickerComponent, decorators: [{
39
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: EdgeTypePickerComponent, decorators: [{
40
40
  type: Component,
41
41
  args: [{
42
42
  selector: "vjs-edge-type",
43
43
  template: `<div [attr.vjs-att]="propertyName"></div>`
44
44
  }]
45
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { propertyName: [{
45
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { propertyName: [{
46
46
  type: Input
47
47
  }], edgeMappings: [{
48
48
  type: Input
@@ -34,10 +34,10 @@ export class ExportControlsComponent {
34
34
  type: "image/jpeg",
35
35
  }));
36
36
  }
37
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExportControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
38
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ExportControlsComponent, selector: "vjs-export-controls", inputs: { showLabel: "showLabel", label: "label", margins: "margins", svgOptions: "svgOptions", imageOptions: "imageOptions", allowSvgExport: "allowSvgExport", allowPngExport: "allowPngExport", allowJpgExport: "allowJpgExport" }, ngImport: i0, template: "<div class=\"vjs-controls vjs-export-controls\">\n <span *ngIf=\"showLabel\">{{ label }}</span>\n <i *ngIf=\"allowSvgExport\"\n ><a href=\"#\" id=\"exportSvg\" (click)=\"exportSVG()\">SVG</a></i\n >\n <i *ngIf=\"allowPngExport\"\n ><a href=\"#\" id=\"exportPng\" (click)=\"exportPNG()\">PNG</a></i\n >\n <i *ngIf=\"allowJpgExport\"\n ><a href=\"#\" id=\"exportJpg\" (click)=\"exportJPG()\">JPG</a></i\n >\n </div>", isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
37
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ExportControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
38
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ExportControlsComponent, selector: "vjs-export-controls", inputs: { showLabel: "showLabel", label: "label", margins: "margins", svgOptions: "svgOptions", imageOptions: "imageOptions", allowSvgExport: "allowSvgExport", allowPngExport: "allowPngExport", allowJpgExport: "allowJpgExport" }, ngImport: i0, template: "<div class=\"vjs-controls vjs-export-controls\">\n <span *ngIf=\"showLabel\">{{ label }}</span>\n <i *ngIf=\"allowSvgExport\"\n ><a href=\"#\" id=\"exportSvg\" (click)=\"exportSVG()\">SVG</a></i\n >\n <i *ngIf=\"allowPngExport\"\n ><a href=\"#\" id=\"exportPng\" (click)=\"exportPNG()\">PNG</a></i\n >\n <i *ngIf=\"allowJpgExport\"\n ><a href=\"#\" id=\"exportJpg\" (click)=\"exportJPG()\">JPG</a></i\n >\n </div>", isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
39
39
  }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExportControlsComponent, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ExportControlsComponent, decorators: [{
41
41
  type: Component,
42
42
  args: [{
43
43
  selector: "vjs-export-controls",
@@ -0,0 +1,77 @@
1
+ import { inject, Component, Input } from "@angular/core";
2
+ import { BackgroundPlugin, GeneratedGridBackground, log } from "@visuallyjs/browser-ui";
3
+ import { VisuallyJsService } from "./vjs-service";
4
+ import * as i0 from "@angular/core";
5
+
6
+ export class GridBackgroundComponent {
7
+ constructor() {
8
+ this.$vjs = inject(VisuallyJsService);
9
+ this._bg = null;
10
+ }
11
+ _getOptions() {
12
+ return {
13
+ type: GeneratedGridBackground.type,
14
+ grid: this.grid,
15
+ showBorder: this.showBorder,
16
+ minWidth: this.minWidth,
17
+ minHeight: this.minHeight,
18
+ showTickMarks: this.showTickMarks,
19
+ tickMarksPerCell: this.tickMarksPerCell,
20
+ maxWidth: this.maxWidth,
21
+ maxHeight: this.maxHeight,
22
+ autoShrink: this.autoShrink,
23
+ gridType: this.gridType,
24
+ dotRadius: this.dotRadius,
25
+ tickDotRadius: this.tickDotRadius,
26
+ visible: this.visible
27
+ };
28
+ }
29
+ ngAfterViewInit() {
30
+ this.$vjs.getSurface(s => {
31
+ try {
32
+ this._bg = s.addPlugin({
33
+ type: BackgroundPlugin.type,
34
+ options: this._getOptions()
35
+ });
36
+ }
37
+ catch (e) {
38
+ log(`WARN: GridBackgroundComponent could not mount background ${e}`);
39
+ }
40
+ });
41
+ }
42
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GridBackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
43
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: GridBackgroundComponent, selector: "vjs-grid-background", inputs: { grid: "grid", showBorder: "showBorder", minWidth: "minWidth", minHeight: "minHeight", showTickMarks: "showTickMarks", tickMarksPerCell: "tickMarksPerCell", maxWidth: "maxWidth", maxHeight: "maxHeight", autoShrink: "autoShrink", gridType: "gridType", dotRadius: "dotRadius", tickDotRadius: "tickDotRadius", visible: "visible" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
44
+ }
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GridBackgroundComponent, decorators: [{
46
+ type: Component,
47
+ args: [{
48
+ selector: "vjs-grid-background",
49
+ template: `<ng-content></ng-content>`
50
+ }]
51
+ }], propDecorators: { grid: [{
52
+ type: Input
53
+ }], showBorder: [{
54
+ type: Input
55
+ }], minWidth: [{
56
+ type: Input
57
+ }], minHeight: [{
58
+ type: Input
59
+ }], showTickMarks: [{
60
+ type: Input
61
+ }], tickMarksPerCell: [{
62
+ type: Input
63
+ }], maxWidth: [{
64
+ type: Input
65
+ }], maxHeight: [{
66
+ type: Input
67
+ }], autoShrink: [{
68
+ type: Input
69
+ }], gridType: [{
70
+ type: Input
71
+ }], dotRadius: [{
72
+ type: Input
73
+ }], tickDotRadius: [{
74
+ type: Input
75
+ }], visible: [{
76
+ type: Input
77
+ }] } });
@@ -0,0 +1,38 @@
1
+ import { inject, Component, Input } from "@angular/core";
2
+ import { BackgroundPlugin, log, SimpleBackground } from "@visuallyjs/browser-ui";
3
+ import { VisuallyJsService } from "./vjs-service";
4
+ import * as i0 from "@angular/core";
5
+
6
+ export class ImageBackgroundComponent {
7
+ constructor() {
8
+ this.$vjs = inject(VisuallyJsService);
9
+ }
10
+ ngAfterViewInit() {
11
+ this.$vjs.getSurface(s => {
12
+ try {
13
+ // tslint:disable-next-line:no-unused-expression
14
+ s.addPlugin({
15
+ type: BackgroundPlugin.type,
16
+ options: {
17
+ type: SimpleBackground.type,
18
+ url: this.url
19
+ }
20
+ });
21
+ }
22
+ catch (e) {
23
+ log(`WARN: ImageBackgroundComponent could not mount background ${e}`);
24
+ }
25
+ });
26
+ }
27
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ImageBackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
28
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ImageBackgroundComponent, selector: "vjs-image-background", inputs: { url: "url" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true }); }
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ImageBackgroundComponent, decorators: [{
31
+ type: Component,
32
+ args: [{
33
+ selector: "vjs-image-background",
34
+ template: `<ng-content></ng-content>`
35
+ }]
36
+ }], propDecorators: { url: [{
37
+ type: Input
38
+ }] } });
@@ -65,12 +65,12 @@ export class InspectorComponent {
65
65
  }
66
66
 
67
67
  afterUpdate(ui) { }
68
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InspectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
69
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: InspectorComponent, inputs: { cssClass: "cssClass", showCloseButton: "showCloseButton", context: "context" }, ngImport: i0 }); }
68
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InspectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
69
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: InspectorComponent, inputs: { cssClass: "cssClass", showCloseButton: "showCloseButton", context: "context" }, ngImport: i0 }); }
70
70
  }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InspectorComponent, decorators: [{
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InspectorComponent, decorators: [{
72
72
  type: Directive
73
- }], ctorParameters: function () { return []; }, propDecorators: { cssClass: [{
73
+ }], ctorParameters: () => [], propDecorators: { cssClass: [{
74
74
  type: Input
75
75
  }], showCloseButton: [{
76
76
  type: Input
@@ -47,16 +47,16 @@ export class MiniviewComponent {
47
47
  this.$miniview.invalidate();
48
48
  }
49
49
  }
50
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MiniviewComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
51
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MiniviewComponent, selector: "vjs-miniview", inputs: { elementFilter: "elementFilter", typeFunction: "typeFunction", activeTracking: "activeTracking", clickToCenter: "clickToCenter", showLasso: "showLasso", trackSelection: "trackSelection" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
50
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MiniviewComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
51
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MiniviewComponent, selector: "vjs-miniview", inputs: { elementFilter: "elementFilter", typeFunction: "typeFunction", activeTracking: "activeTracking", clickToCenter: "clickToCenter", showLasso: "showLasso", trackSelection: "trackSelection" }, ngImport: i0, template: `<div></div>`, isInline: true }); }
52
52
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MiniviewComponent, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MiniviewComponent, decorators: [{
54
54
  type: Component,
55
55
  args: [{
56
56
  selector: 'vjs-miniview',
57
57
  template: `<div></div>`
58
58
  }]
59
- }], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { elementFilter: [{
59
+ }], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { elementFilter: [{
60
60
  type: Input
61
61
  }], typeFunction: [{
62
62
  type: Input
@@ -1,4 +1,6 @@
1
- import { ChangeDetectorRef, inject } from "@angular/core";
1
+ import { EVENT_EDGE_UPDATED, EVENT_GROUP_UPDATED, EVENT_NODE_UPDATED, EVENT_PORT_UPDATED } from "@visuallyjs/browser-ui";
2
+ import { ChangeDetectorRef, inject, Injectable, signal } from "@angular/core";
3
+ import * as i0 from "@angular/core";
2
4
 
3
5
  export const AngularComponentOverlayType = "AngularComponent";
4
6
 
@@ -6,6 +8,50 @@ export class BaseAngularOverlayComponent {
6
8
  constructor() {
7
9
 
8
10
  this.changeDetectorRef = inject(ChangeDetectorRef);
11
+
12
+ this.$edgeData = signal({});
13
+
14
+ this.$sourceData = signal({});
15
+
16
+ this.$targetData = signal({});
17
+ }
18
+ ngOnInit() {
19
+ this.$edgeData.set(this.edge.data);
20
+ this.$sourceData.set(this.edge.source.data);
21
+ this.$targetData.set(this.edge.target.data);
22
+ this._edgeUpdate = (p) => {
23
+ if (p.edge.id === this.edge.id) {
24
+ this.$edgeData.set({ ...p.edge.data });
25
+ this.$sourceData.set({ ...p.edge.source.data });
26
+ this.$targetData.set({ ...p.edge.target.data });
27
+ }
28
+ };
29
+ this._vertexUpdate = (p) => {
30
+ if (p.vertex === this.edge.source) {
31
+ this.$sourceData.set({ ...p.vertex.data });
32
+ }
33
+ if (p.vertex === this.edge.target) {
34
+ this.$targetData.set({ ...p.vertex.data });
35
+ }
36
+ };
37
+ this._portUpdate = (p) => {
38
+ if (p.port === this.edge.source) {
39
+ this.$sourceData.set({ ...p.port.data });
40
+ }
41
+ if (p.port === this.edge.target) {
42
+ this.$targetData.set({ ...p.port.data });
43
+ }
44
+ };
45
+ this.model.bind(EVENT_EDGE_UPDATED, this._edgeUpdate);
46
+ this.model.bind(EVENT_NODE_UPDATED, this._vertexUpdate);
47
+ this.model.bind(EVENT_GROUP_UPDATED, this._vertexUpdate);
48
+ this.model.bind(EVENT_PORT_UPDATED, this._portUpdate);
49
+ }
50
+ ngOnDestroy() {
51
+ this.model.unbind(EVENT_EDGE_UPDATED, this._edgeUpdate);
52
+ this.model.unbind(EVENT_NODE_UPDATED, this._vertexUpdate);
53
+ this.model.unbind(EVENT_GROUP_UPDATED, this._vertexUpdate);
54
+ this.model.unbind(EVENT_PORT_UPDATED, this._portUpdate);
9
55
  }
10
56
 
11
57
  updateEdge(updates) {
@@ -15,4 +61,9 @@ export class BaseAngularOverlayComponent {
15
61
  removeEdge() {
16
62
  this.model.removeEdge(this.edge);
17
63
  }
64
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseAngularOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
65
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseAngularOverlayComponent }); }
18
66
  }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseAngularOverlayComponent, decorators: [{
68
+ type: Injectable
69
+ }] });
@@ -50,15 +50,15 @@ export class PaletteComponent {
50
50
  }
51
51
  });
52
52
  }
53
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
54
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PaletteComponent, selector: "[vjs-palette]", inputs: { selector: "selector", dataGenerator: "dataGenerator", typeGenerator: "typeGenerator", groupIdentifier: "groupIdentifier", allowDropOnEdge: "allowDropOnEdge", allowDropOnGroup: "allowDropOnGroup", allowDropOnCanvas: "allowDropOnCanvas", allowDropOnNode: "allowDropOnNode", onVertexAdded: "onVertexAdded", dragSize: "dragSize", canvasDropFilter: "canvasDropFilter", mode: "mode", selectAfterAdd: "selectAfterAdd", allowClickToAdd: "allowClickToAdd", clickToAddOnly: "clickToAddOnly" }, ngImport: i0 }); }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
54
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: PaletteComponent, selector: "[vjs-palette]", inputs: { selector: "selector", dataGenerator: "dataGenerator", typeGenerator: "typeGenerator", groupIdentifier: "groupIdentifier", allowDropOnEdge: "allowDropOnEdge", allowDropOnGroup: "allowDropOnGroup", allowDropOnCanvas: "allowDropOnCanvas", allowDropOnNode: "allowDropOnNode", onVertexAdded: "onVertexAdded", dragSize: "dragSize", canvasDropFilter: "canvasDropFilter", mode: "mode", selectAfterAdd: "selectAfterAdd", allowClickToAdd: "allowClickToAdd", clickToAddOnly: "clickToAddOnly" }, ngImport: i0 }); }
55
55
  }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PaletteComponent, decorators: [{
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PaletteComponent, decorators: [{
57
57
  type: Directive,
58
58
  args: [{
59
59
  selector: "[vjs-palette]",
60
60
  }]
61
- }], ctorParameters: function () { return []; }, propDecorators: { selector: [{
61
+ }], ctorParameters: () => [], propDecorators: { selector: [{
62
62
  type: Input
63
63
  }], dataGenerator: [{
64
64
  type: Input