ngx-vflow 1.16.4 → 2.1.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/README.md +35 -69
- package/fesm2022/ngx-vflow-testing.mjs +77 -67
- package/fesm2022/ngx-vflow-testing.mjs.map +1 -1
- package/fesm2022/ngx-vflow.mjs +944 -562
- package/fesm2022/ngx-vflow.mjs.map +1 -1
- package/lib/vflow/components/custom-node-base/custom-node-base.component.d.ts +1 -1
- package/lib/vflow/components/vflow/vflow.component.d.ts +18 -9
- package/lib/vflow/directives/auto-pan.directive.d.ts +16 -0
- package/lib/vflow/directives/changes-controller.directive.d.ts +13 -87
- package/lib/vflow/directives/connection-controller.directive.d.ts +8 -10
- package/lib/vflow/directives/space-point-context.directive.d.ts +2 -1
- package/lib/vflow/interfaces/component-node-event.interface.d.ts +1 -2
- package/lib/vflow/interfaces/connection-events.interface.d.ts +66 -0
- package/lib/vflow/interfaces/connection-settings.interface.d.ts +7 -1
- package/lib/vflow/interfaces/connection.interface.d.ts +0 -5
- package/lib/vflow/interfaces/curve-factory.interface.d.ts +2 -2
- package/lib/vflow/interfaces/edge-label.interface.d.ts +0 -4
- package/lib/vflow/interfaces/edge.interface.d.ts +36 -8
- package/lib/vflow/interfaces/node.interface.d.ts +46 -63
- package/lib/vflow/interfaces/selection-strategy.interface.d.ts +16 -0
- package/lib/vflow/interfaces/template-context.interface.d.ts +8 -3
- package/lib/vflow/models/connection.model.d.ts +1 -1
- package/lib/vflow/models/edge.model.d.ts +20 -23
- package/lib/vflow/models/handle.model.d.ts +1 -1
- package/lib/vflow/models/node.model.d.ts +5 -7
- package/lib/vflow/public-components/custom-node/custom-node.component.d.ts +1 -1
- package/lib/vflow/public-components/custom-template-edge/custom-template-edge.component.d.ts +2 -1
- package/lib/vflow/public-components/minimap/minimap.component.d.ts +1 -1
- package/lib/vflow/services/draggable.service.d.ts +3 -0
- package/lib/vflow/services/flow-entities.service.d.ts +2 -2
- package/lib/vflow/services/flow-settings.service.d.ts +3 -0
- package/lib/vflow/services/flow-status.service.d.ts +35 -7
- package/lib/vflow/services/selection.service.d.ts +4 -1
- package/lib/vflow/strategies/default-selection.strategy.d.ts +6 -0
- package/lib/vflow/strategies/manual-selection.strategy.d.ts +5 -0
- package/lib/vflow/types/selection-mode.type.d.ts +1 -0
- package/lib/vflow/types/unwrap-signal.type.d.ts +4 -0
- package/lib/vflow/utils/adjust-direction.d.ts +2 -6
- package/lib/vflow/utils/identity-checker/reference-identity-checker.d.ts +2 -2
- package/lib/vflow/utils/is-vflow-component.d.ts +0 -2
- package/lib/vflow/utils/signals/to-lazy-signal.d.ts +4 -4
- package/package.json +3 -7
- package/public-api.d.ts +3 -2
- package/testing/component-mocks/vflow-mock.component.d.ts +8 -6
- package/testing/directive-mocks/connection-controller-mock.directive.d.ts +8 -6
- package/esm2022/lib/vflow/components/alignment-helper/alignment-helper.component.mjs +0 -103
- package/esm2022/lib/vflow/components/background/background.component.mjs +0 -121
- package/esm2022/lib/vflow/components/connection/connection.component.mjs +0 -157
- package/esm2022/lib/vflow/components/custom-node-base/custom-node-base.component.mjs +0 -57
- package/esm2022/lib/vflow/components/default-node/default-node.component.mjs +0 -16
- package/esm2022/lib/vflow/components/defs/defs.component.mjs +0 -16
- package/esm2022/lib/vflow/components/edge/edge.component.mjs +0 -54
- package/esm2022/lib/vflow/components/edge-label/edge-label.component.mjs +0 -76
- package/esm2022/lib/vflow/components/node/node.component.mjs +0 -107
- package/esm2022/lib/vflow/components/preview-flow/draw-node.mjs +0 -100
- package/esm2022/lib/vflow/components/preview-flow/preview-flow.component.mjs +0 -62
- package/esm2022/lib/vflow/components/vflow/vflow.component.mjs +0 -437
- package/esm2022/lib/vflow/constants/magic-number-to-fix-glitch-in-chrome.constant.mjs +0 -4
- package/esm2022/lib/vflow/decorators/microtask.decorator.mjs +0 -11
- package/esm2022/lib/vflow/directives/changes-controller.directive.mjs +0 -165
- package/esm2022/lib/vflow/directives/connection-controller.directive.mjs +0 -145
- package/esm2022/lib/vflow/directives/drag-handle.directive.mjs +0 -28
- package/esm2022/lib/vflow/directives/flow-size-controller.directive.mjs +0 -40
- package/esm2022/lib/vflow/directives/handle-size-controller.directive.mjs +0 -41
- package/esm2022/lib/vflow/directives/map-context.directive.mjs +0 -116
- package/esm2022/lib/vflow/directives/node-handles-controller.directive.mjs +0 -33
- package/esm2022/lib/vflow/directives/node-resize-controller.directive.mjs +0 -37
- package/esm2022/lib/vflow/directives/pointer.directive.mjs +0 -84
- package/esm2022/lib/vflow/directives/reference.directive.mjs +0 -17
- package/esm2022/lib/vflow/directives/root-pointer.directive.mjs +0 -58
- package/esm2022/lib/vflow/directives/root-svg-context.directive.mjs +0 -35
- package/esm2022/lib/vflow/directives/selectable.directive.mjs +0 -48
- package/esm2022/lib/vflow/directives/space-point-context.directive.mjs +0 -42
- package/esm2022/lib/vflow/directives/template.directive.mjs +0 -119
- package/esm2022/lib/vflow/interfaces/alignment-helper-settings.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/box.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/component-node-event.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/connection-settings.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/connection.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/connection.internal.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/contextable.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/curve-factory.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/edge-label.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/edge.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/fit-view-options.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/flow-entity.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/intersecting-nodes-options.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/marker.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/node-preview.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/node.interface.mjs +0 -53
- package/esm2022/lib/vflow/interfaces/optimization.interface.mjs +0 -7
- package/esm2022/lib/vflow/interfaces/point.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/rect.mjs +0 -10
- package/esm2022/lib/vflow/interfaces/template-context.interface.mjs +0 -2
- package/esm2022/lib/vflow/interfaces/viewport.interface.mjs +0 -2
- package/esm2022/lib/vflow/math/edge-path/bezier-path.mjs +0 -66
- package/esm2022/lib/vflow/math/edge-path/smooth-step-path.mjs +0 -226
- package/esm2022/lib/vflow/math/edge-path/straigh-path.mjs +0 -12
- package/esm2022/lib/vflow/math/point-on-line-by-ratio.mjs +0 -12
- package/esm2022/lib/vflow/models/connection.model.mjs +0 -31
- package/esm2022/lib/vflow/models/edge-label.model.mjs +0 -8
- package/esm2022/lib/vflow/models/edge.model.mjs +0 -208
- package/esm2022/lib/vflow/models/handle.model.mjs +0 -98
- package/esm2022/lib/vflow/models/minimap.model.mjs +0 -7
- package/esm2022/lib/vflow/models/node.model.mjs +0 -181
- package/esm2022/lib/vflow/models/toolbar.model.mjs +0 -36
- package/esm2022/lib/vflow/public-components/custom-dynamic-node/custom-dynamic-node.component.mjs +0 -25
- package/esm2022/lib/vflow/public-components/custom-node/custom-node.component.mjs +0 -24
- package/esm2022/lib/vflow/public-components/custom-template-edge/custom-template-edge.component.mjs +0 -29
- package/esm2022/lib/vflow/public-components/handle/handle.component.mjs +0 -53
- package/esm2022/lib/vflow/public-components/minimap/minimap.component.mjs +0 -108
- package/esm2022/lib/vflow/public-components/node-toolbar/node-toolbar.component.mjs +0 -73
- package/esm2022/lib/vflow/public-components/resizable/resizable.component.mjs +0 -272
- package/esm2022/lib/vflow/services/component-event-bus.service.mjs +0 -18
- package/esm2022/lib/vflow/services/draggable.service.mjs +0 -124
- package/esm2022/lib/vflow/services/edge-changes.service.mjs +0 -43
- package/esm2022/lib/vflow/services/edge-rendering.service.mjs +0 -40
- package/esm2022/lib/vflow/services/flow-entities.service.mjs +0 -56
- package/esm2022/lib/vflow/services/flow-rendering.service.mjs +0 -41
- package/esm2022/lib/vflow/services/flow-settings.service.mjs +0 -33
- package/esm2022/lib/vflow/services/flow-status.service.mjs +0 -49
- package/esm2022/lib/vflow/services/handle.service.mjs +0 -30
- package/esm2022/lib/vflow/services/keyboard.service.mjs +0 -47
- package/esm2022/lib/vflow/services/node-accessor.service.mjs +0 -16
- package/esm2022/lib/vflow/services/node-changes.service.mjs +0 -41
- package/esm2022/lib/vflow/services/node-rendering.service.mjs +0 -66
- package/esm2022/lib/vflow/services/overlays.service.mjs +0 -35
- package/esm2022/lib/vflow/services/preview-flow-render-strategy.service.mjs +0 -21
- package/esm2022/lib/vflow/services/selection.service.mjs +0 -54
- package/esm2022/lib/vflow/services/viewport.service.mjs +0 -64
- package/esm2022/lib/vflow/types/background.type.mjs +0 -2
- package/esm2022/lib/vflow/types/connection-mode.type.mjs +0 -2
- package/esm2022/lib/vflow/types/edge-change.type.mjs +0 -2
- package/esm2022/lib/vflow/types/handle-type.type.mjs +0 -2
- package/esm2022/lib/vflow/types/keyboard-action.type.mjs +0 -2
- package/esm2022/lib/vflow/types/node-change.type.mjs +0 -2
- package/esm2022/lib/vflow/types/position.type.mjs +0 -2
- package/esm2022/lib/vflow/types/viewport-change-type.type.mjs +0 -2
- package/esm2022/lib/vflow/utils/add-nodes-to-edges.mjs +0 -11
- package/esm2022/lib/vflow/utils/adjust-direction.mjs +0 -30
- package/esm2022/lib/vflow/utils/align-number.mjs +0 -4
- package/esm2022/lib/vflow/utils/assert-injector.mjs +0 -27
- package/esm2022/lib/vflow/utils/event.mjs +0 -4
- package/esm2022/lib/vflow/utils/get-os.mjs +0 -24
- package/esm2022/lib/vflow/utils/get-overlapping-area.mjs +0 -6
- package/esm2022/lib/vflow/utils/get-space-points.mjs +0 -25
- package/esm2022/lib/vflow/utils/hash.mjs +0 -7
- package/esm2022/lib/vflow/utils/id.mjs +0 -5
- package/esm2022/lib/vflow/utils/identity-checker/reference-identity-checker.mjs +0 -28
- package/esm2022/lib/vflow/utils/is-callable.mjs +0 -10
- package/esm2022/lib/vflow/utils/is-defined.mjs +0 -4
- package/esm2022/lib/vflow/utils/is-group-node.mjs +0 -4
- package/esm2022/lib/vflow/utils/is-vflow-component.mjs +0 -9
- package/esm2022/lib/vflow/utils/nodes.mjs +0 -60
- package/esm2022/lib/vflow/utils/resizable.mjs +0 -11
- package/esm2022/lib/vflow/utils/round.mjs +0 -2
- package/esm2022/lib/vflow/utils/signals/extended-computed.mjs +0 -15
- package/esm2022/lib/vflow/utils/signals/to-lazy-signal.mjs +0 -35
- package/esm2022/lib/vflow/utils/to-unified-node.mjs +0 -24
- package/esm2022/lib/vflow/utils/transform-background.mjs +0 -4
- package/esm2022/lib/vflow/utils/viewport.mjs +0 -51
- package/esm2022/lib/vflow/vflow.mjs +0 -29
- package/esm2022/ngx-vflow.mjs +0 -5
- package/esm2022/public-api.mjs +0 -55
- package/esm2022/testing/component-mocks/custom-template-edge-mock.component.mjs +0 -16
- package/esm2022/testing/component-mocks/handle-mock.component.mjs +0 -26
- package/esm2022/testing/component-mocks/minimap-mock.component.mjs +0 -24
- package/esm2022/testing/component-mocks/node-toolbar-mock.component.mjs +0 -23
- package/esm2022/testing/component-mocks/resizable-mock.component.mjs +0 -27
- package/esm2022/testing/component-mocks/vflow-mock.component.mjs +0 -299
- package/esm2022/testing/directive-mocks/connection-controller-mock.directive.mjs +0 -29
- package/esm2022/testing/directive-mocks/drag-handle-mock.directive.mjs +0 -11
- package/esm2022/testing/directive-mocks/selectable-mock.directive.mjs +0 -14
- package/esm2022/testing/directive-mocks/template-mock.directive.mjs +0 -101
- package/esm2022/testing/ngx-vflow-testing.mjs +0 -5
- package/esm2022/testing/provide-custom-node-mocks.mjs +0 -60
- package/esm2022/testing/public-api.mjs +0 -13
- package/esm2022/testing/types.mjs +0 -2
- package/esm2022/testing/vflow-mocks.mjs +0 -28
- package/lib/vflow/public-components/custom-dynamic-node/custom-dynamic-node.component.d.ts +0 -13
- package/lib/vflow/utils/to-unified-node.d.ts +0 -2
package/fesm2022/ngx-vflow.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, computed, Injectable, inject, ElementRef, Directive, NgZone, effect, untracked, TemplateRef, DestroyRef, EventEmitter, OutputEmitterRef, input, assertInInjectionContext,
|
|
2
|
+
import { signal, computed, Injectable, inject, ElementRef, Directive, NgZone, effect, untracked, Injector, TemplateRef, DestroyRef, EventEmitter, OutputEmitterRef, input, assertInInjectionContext, runInInjectionContext, viewChild, ChangeDetectionStrategy, Component, output, HostListener, Renderer2, contentChild, Input, forwardRef } from '@angular/core';
|
|
3
3
|
import { select } from 'd3-selection';
|
|
4
4
|
import { zoomIdentity, zoom } from 'd3-zoom';
|
|
5
|
-
import { Subject, switchMap, merge, fromEvent, tap,
|
|
5
|
+
import { Subject, switchMap, merge, fromEvent, tap, shareReplay, skip, pairwise, filter, Observable, observeOn, asyncScheduler, debounceTime, map, catchError, of, distinctUntilChanged, zip, animationFrameScheduler, share, startWith, EMPTY, take, animationFrames, withLatestFrom } from 'rxjs';
|
|
6
6
|
import { toObservable, takeUntilDestroyed, toSignal, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
7
7
|
import { drag } from 'd3-drag';
|
|
8
8
|
import { __decorate } from 'tslib';
|
|
@@ -79,19 +79,21 @@ class ConnectionModel {
|
|
|
79
79
|
this.curve = settings.curve ?? 'bezier';
|
|
80
80
|
this.type = settings.type ?? 'default';
|
|
81
81
|
this.mode = settings.mode ?? 'strict';
|
|
82
|
-
|
|
83
|
-
this.validator = (connection) => validatorsToRun.every((v) => v(connection));
|
|
84
|
-
}
|
|
85
|
-
getValidators(settings) {
|
|
82
|
+
this.allowSelfConnections = settings.allowSelfConnections ?? false;
|
|
86
83
|
const validators = [];
|
|
87
|
-
|
|
84
|
+
if (!this.allowSelfConnections) {
|
|
85
|
+
validators.push(notSelfValidator);
|
|
86
|
+
}
|
|
87
|
+
if (this.mode === 'strict') {
|
|
88
|
+
validators.push(notSameHandleTypeValidator);
|
|
89
|
+
}
|
|
88
90
|
if (this.mode === 'loose') {
|
|
89
91
|
validators.push(hasSourceAndTargetHandleValidator);
|
|
90
92
|
}
|
|
91
93
|
if (settings.validator) {
|
|
92
94
|
validators.push(settings.validator);
|
|
93
95
|
}
|
|
94
|
-
|
|
96
|
+
this.validator = (connection) => validators.every((v) => v(connection));
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
99
|
/**
|
|
@@ -100,6 +102,12 @@ class ConnectionModel {
|
|
|
100
102
|
const notSelfValidator = (connection) => {
|
|
101
103
|
return connection.source !== connection.target;
|
|
102
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* Internal validator that not allows connections between handles of the same type
|
|
107
|
+
*/
|
|
108
|
+
const notSameHandleTypeValidator = (connection) => {
|
|
109
|
+
return connection.sourceHandleType !== connection.targetHandleType;
|
|
110
|
+
};
|
|
103
111
|
const hasSourceAndTargetHandleValidator = (connection) => {
|
|
104
112
|
return connection.sourceHandle !== undefined && connection.targetHandle !== undefined;
|
|
105
113
|
};
|
|
@@ -131,13 +139,14 @@ class FlowEntitiesService {
|
|
|
131
139
|
this.markers = computed(() => {
|
|
132
140
|
const markersMap = new Map();
|
|
133
141
|
this.validEdges().forEach((e) => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
142
|
+
const markers = e.markers();
|
|
143
|
+
if (markers?.start) {
|
|
144
|
+
const hash = hashCode(JSON.stringify(markers.start));
|
|
145
|
+
markersMap.set(hash, markers.start);
|
|
137
146
|
}
|
|
138
|
-
if (
|
|
139
|
-
const hash = hashCode(JSON.stringify(
|
|
140
|
-
markersMap.set(hash,
|
|
147
|
+
if (markers?.end) {
|
|
148
|
+
const hash = hashCode(JSON.stringify(markers.end));
|
|
149
|
+
markersMap.set(hash, markers.end);
|
|
141
150
|
}
|
|
142
151
|
});
|
|
143
152
|
const connectionMarker = this.connection().settings.marker;
|
|
@@ -156,10 +165,10 @@ class FlowEntitiesService {
|
|
|
156
165
|
getDetachedEdges() {
|
|
157
166
|
return this.edges().filter((e) => e.detached());
|
|
158
167
|
}
|
|
159
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
160
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
168
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowEntitiesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
169
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowEntitiesService }); }
|
|
161
170
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowEntitiesService, decorators: [{
|
|
163
172
|
type: Injectable
|
|
164
173
|
}] });
|
|
165
174
|
|
|
@@ -226,6 +235,7 @@ class FlowSettingsService {
|
|
|
226
235
|
this.entitiesSelectable = signal(true);
|
|
227
236
|
this.elevateNodesOnSelect = signal(true);
|
|
228
237
|
this.elevateEdgesOnSelect = signal(true);
|
|
238
|
+
this.autoPan = signal(true);
|
|
229
239
|
/**
|
|
230
240
|
* @see {VflowComponent.view}
|
|
231
241
|
*/
|
|
@@ -243,11 +253,12 @@ class FlowSettingsService {
|
|
|
243
253
|
this.background = signal({ type: 'solid', color: '#fff' });
|
|
244
254
|
this.snapGrid = signal([1, 1]);
|
|
245
255
|
this.optimization = signal(DEFAULT_OPTIMIZATION);
|
|
256
|
+
this.selectionMode = signal('default');
|
|
246
257
|
}
|
|
247
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
248
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
258
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
259
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowSettingsService }); }
|
|
249
260
|
}
|
|
250
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowSettingsService, decorators: [{
|
|
251
262
|
type: Injectable
|
|
252
263
|
}] });
|
|
253
264
|
|
|
@@ -301,10 +312,10 @@ class ViewportService {
|
|
|
301
312
|
.map((nodeId) => this.entitiesService.nodes().find(({ rawNode }) => rawNode.id === nodeId))
|
|
302
313
|
.filter((node) => !!node);
|
|
303
314
|
}
|
|
304
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
305
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
316
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportService }); }
|
|
306
317
|
}
|
|
307
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportService, decorators: [{
|
|
308
319
|
type: Injectable
|
|
309
320
|
}] });
|
|
310
321
|
|
|
@@ -316,10 +327,10 @@ class RootSvgReferenceDirective {
|
|
|
316
327
|
constructor() {
|
|
317
328
|
this.element = inject(ElementRef).nativeElement;
|
|
318
329
|
}
|
|
319
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
320
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
330
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootSvgReferenceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
331
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: RootSvgReferenceDirective, isStandalone: true, selector: "svg[rootSvgRef]", ngImport: i0 }); }
|
|
321
332
|
}
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootSvgReferenceDirective, decorators: [{
|
|
323
334
|
type: Directive,
|
|
324
335
|
args: [{
|
|
325
336
|
standalone: true,
|
|
@@ -386,31 +397,71 @@ class KeyboardService {
|
|
|
386
397
|
isActiveAction(action) {
|
|
387
398
|
return this.actionsActive[action];
|
|
388
399
|
}
|
|
389
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
390
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
400
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: KeyboardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
401
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: KeyboardService }); }
|
|
391
402
|
}
|
|
392
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: KeyboardService, decorators: [{
|
|
393
404
|
type: Injectable
|
|
394
405
|
}], ctorParameters: () => [] });
|
|
395
406
|
|
|
407
|
+
class DefaultSelectionStrategy {
|
|
408
|
+
select(entity, context) {
|
|
409
|
+
// if entity already selected - do nothing
|
|
410
|
+
if (entity?.selected()) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (!context.isMultiSelectionActive) {
|
|
414
|
+
// undo select for previously selected nodes
|
|
415
|
+
context.entities.forEach((n) => n.selected.set(false));
|
|
416
|
+
}
|
|
417
|
+
if (entity) {
|
|
418
|
+
// select passed entity
|
|
419
|
+
entity.selected.set(true);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
handleViewportChange(viewport, context) {
|
|
423
|
+
const { start, end, target, delta } = viewport;
|
|
424
|
+
const diffX = Math.abs(end.x - start.x);
|
|
425
|
+
const diffY = Math.abs(end.y - start.y);
|
|
426
|
+
// click (not drag)
|
|
427
|
+
const isClick = diffX < delta && diffY < delta;
|
|
428
|
+
// do not reset if event chain contains selectable elems
|
|
429
|
+
const isNotSelectable = !target.closest('.selectable');
|
|
430
|
+
if (isClick && isNotSelectable) {
|
|
431
|
+
this.select(null, context);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
class ManualSelectionStrategy {
|
|
437
|
+
select() {
|
|
438
|
+
return;
|
|
439
|
+
// noop - user manages selection manually
|
|
440
|
+
}
|
|
441
|
+
handleViewportChange() {
|
|
442
|
+
return;
|
|
443
|
+
// noop - user manages selection manually
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
396
447
|
class SelectionService {
|
|
397
448
|
constructor() {
|
|
398
449
|
this.flowEntitiesService = inject(FlowEntitiesService);
|
|
399
450
|
this.keyboardService = inject(KeyboardService);
|
|
451
|
+
this.flowSettingsService = inject(FlowSettingsService);
|
|
452
|
+
this.strategies = {
|
|
453
|
+
default: new DefaultSelectionStrategy(),
|
|
454
|
+
manual: new ManualSelectionStrategy(),
|
|
455
|
+
};
|
|
456
|
+
this.currentStrategy = computed(() => this.strategies[this.flowSettingsService.selectionMode()]);
|
|
400
457
|
this.viewport$ = new Subject();
|
|
401
|
-
this.
|
|
458
|
+
this.viewportChangeSub = this.viewport$
|
|
402
459
|
.pipe(tap(({ start, end, target }) => {
|
|
403
460
|
if (start && end && target) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
const isClick = diffX < delta && diffY < delta;
|
|
409
|
-
// do not reset if event chain contains selectable elems
|
|
410
|
-
const isNotSelectable = !target.closest('.selectable');
|
|
411
|
-
if (isClick && isNotSelectable) {
|
|
412
|
-
this.select(null);
|
|
413
|
-
}
|
|
461
|
+
this.currentStrategy().handleViewportChange({ start, end, target, delta: SelectionService.delta }, {
|
|
462
|
+
entities: this.flowEntitiesService.entities(),
|
|
463
|
+
isMultiSelectionActive: this.keyboardService.isActiveAction('multiSelection'),
|
|
464
|
+
});
|
|
414
465
|
}
|
|
415
466
|
}), takeUntilDestroyed())
|
|
416
467
|
.subscribe();
|
|
@@ -420,24 +471,15 @@ class SelectionService {
|
|
|
420
471
|
this.viewport$.next(viewport);
|
|
421
472
|
}
|
|
422
473
|
select(entity) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
if (!this.keyboardService.isActiveAction('multiSelection')) {
|
|
429
|
-
// undo select for previously selected nodes
|
|
430
|
-
this.flowEntitiesService.entities().forEach((n) => n.selected.set(false));
|
|
431
|
-
}
|
|
432
|
-
if (entity) {
|
|
433
|
-
// select passed entity
|
|
434
|
-
entity.selected.set(true);
|
|
435
|
-
}
|
|
474
|
+
this.currentStrategy().select(entity, {
|
|
475
|
+
entities: this.flowEntitiesService.entities(),
|
|
476
|
+
isMultiSelectionActive: this.keyboardService.isActiveAction('multiSelection'),
|
|
477
|
+
});
|
|
436
478
|
}
|
|
437
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
438
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
479
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
480
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectionService }); }
|
|
439
481
|
}
|
|
440
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectionService, decorators: [{
|
|
441
483
|
type: Injectable
|
|
442
484
|
}] });
|
|
443
485
|
|
|
@@ -523,10 +565,10 @@ class MapContextDirective {
|
|
|
523
565
|
this.rootSvgSelection.call(this.zoomBehavior).on('dblclick.zoom', null);
|
|
524
566
|
});
|
|
525
567
|
}
|
|
526
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
527
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
568
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MapContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
569
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: MapContextDirective, isStandalone: true, selector: "g[mapContext]", host: { properties: { "attr.transform": "transform()" } }, ngImport: i0 }); }
|
|
528
570
|
}
|
|
529
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
571
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MapContextDirective, decorators: [{
|
|
530
572
|
type: Directive,
|
|
531
573
|
args: [{
|
|
532
574
|
standalone: true,
|
|
@@ -557,6 +599,7 @@ function align(num, constant) {
|
|
|
557
599
|
class FlowStatusService {
|
|
558
600
|
constructor() {
|
|
559
601
|
this.status = signal({ state: 'idle', payload: null });
|
|
602
|
+
this.status$ = toObservable(this.status).pipe(shareReplay({ bufferSize: 1, refCount: true }));
|
|
560
603
|
}
|
|
561
604
|
setIdleStatus() {
|
|
562
605
|
this.status.set({ state: 'idle', payload: null });
|
|
@@ -576,11 +619,32 @@ class FlowStatusService {
|
|
|
576
619
|
payload: { source, target, sourceHandle, targetHandle, valid, oldEdge },
|
|
577
620
|
});
|
|
578
621
|
}
|
|
579
|
-
|
|
580
|
-
this.status.set({ state: 'connection-
|
|
622
|
+
setConnectionReleaseStatus(source, target, sourceHandle, targetHandle) {
|
|
623
|
+
this.status.set({ state: 'connection-release', payload: { source, target, sourceHandle, targetHandle } });
|
|
624
|
+
}
|
|
625
|
+
setConnectionReleaseValidatedStatus(source, target, sourceHandle, targetHandle, valid) {
|
|
626
|
+
this.status.set({
|
|
627
|
+
state: 'connection-release-validated',
|
|
628
|
+
payload: { source, target, sourceHandle, targetHandle, valid },
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
setConnectionDroppedStatus(source, sourceHandle) {
|
|
632
|
+
this.status.set({ state: 'connection-dropped', payload: { source, sourceHandle } });
|
|
633
|
+
}
|
|
634
|
+
setReconnectionReleaseStatus(source, target, sourceHandle, targetHandle, oldEdge) {
|
|
635
|
+
this.status.set({
|
|
636
|
+
state: 'reconnection-release',
|
|
637
|
+
payload: { source, target, sourceHandle, targetHandle, oldEdge },
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
setReconnectionReleaseValidatedStatus(source, target, sourceHandle, targetHandle, oldEdge, valid) {
|
|
641
|
+
this.status.set({
|
|
642
|
+
state: 'reconnection-release-validated',
|
|
643
|
+
payload: { source, target, sourceHandle, targetHandle, oldEdge, valid },
|
|
644
|
+
});
|
|
581
645
|
}
|
|
582
|
-
|
|
583
|
-
this.status.set({ state: 'reconnection-
|
|
646
|
+
setReconnectionDroppedStatus(source, sourceHandle, oldEdge) {
|
|
647
|
+
this.status.set({ state: 'reconnection-dropped', payload: { source, sourceHandle, oldEdge } });
|
|
584
648
|
}
|
|
585
649
|
setNodeDragStartStatus(node) {
|
|
586
650
|
this.status.set({ state: 'node-drag-start', payload: { node } });
|
|
@@ -588,10 +652,10 @@ class FlowStatusService {
|
|
|
588
652
|
setNodeDragEndStatus(node) {
|
|
589
653
|
this.status.set({ state: 'node-drag-end', payload: { node } });
|
|
590
654
|
}
|
|
591
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
592
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
655
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowStatusService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
656
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowStatusService }); }
|
|
593
657
|
}
|
|
594
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
658
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowStatusService, decorators: [{
|
|
595
659
|
type: Injectable
|
|
596
660
|
}] });
|
|
597
661
|
function isNodeDragStartStatus(params) {
|
|
@@ -606,6 +670,8 @@ class DraggableService {
|
|
|
606
670
|
this.entitiesService = inject(FlowEntitiesService);
|
|
607
671
|
this.settingsService = inject(FlowSettingsService);
|
|
608
672
|
this.flowStatusService = inject(FlowStatusService);
|
|
673
|
+
this.viewportService = inject(ViewportService);
|
|
674
|
+
this.injector = inject(Injector);
|
|
609
675
|
}
|
|
610
676
|
/**
|
|
611
677
|
* Enable draggable behavior for element.
|
|
@@ -642,6 +708,7 @@ class DraggableService {
|
|
|
642
708
|
getDragBehavior(model) {
|
|
643
709
|
let dragNodes = [];
|
|
644
710
|
let initialPositions = [];
|
|
711
|
+
let moveNodesOnAutoPanSub = null;
|
|
645
712
|
const filterCondition = (event) => {
|
|
646
713
|
// if there is at least one drag handle, we should check if we are dragging it
|
|
647
714
|
if (model.dragHandlesCount()) {
|
|
@@ -658,6 +725,8 @@ class DraggableService {
|
|
|
658
725
|
x: node.point().x - event.x,
|
|
659
726
|
y: node.point().y - event.y,
|
|
660
727
|
}));
|
|
728
|
+
// Subscribe to viewport changes during drag to sync node positions with auto-pan
|
|
729
|
+
moveNodesOnAutoPanSub = this.moveNodesOnAutoPan$(dragNodes);
|
|
661
730
|
})
|
|
662
731
|
.on('drag', (event) => {
|
|
663
732
|
dragNodes.forEach((model, index) => {
|
|
@@ -665,10 +734,13 @@ class DraggableService {
|
|
|
665
734
|
x: round(event.x + initialPositions[index].x),
|
|
666
735
|
y: round(event.y + initialPositions[index].y),
|
|
667
736
|
};
|
|
737
|
+
this.alignToGrid(point);
|
|
668
738
|
this.moveNode(model, point);
|
|
669
739
|
});
|
|
670
740
|
})
|
|
671
741
|
.on('end', () => {
|
|
742
|
+
moveNodesOnAutoPanSub?.unsubscribe();
|
|
743
|
+
moveNodesOnAutoPanSub = null;
|
|
672
744
|
this.flowStatusService.setNodeDragEndStatus(model);
|
|
673
745
|
});
|
|
674
746
|
}
|
|
@@ -685,10 +757,9 @@ class DraggableService {
|
|
|
685
757
|
* @todo make it unit testable
|
|
686
758
|
*/
|
|
687
759
|
moveNode(model, point) {
|
|
688
|
-
point = this.alignToGrid(point);
|
|
689
760
|
const parent = model.parent();
|
|
690
761
|
// keep node in bounds of parent
|
|
691
|
-
if (parent) {
|
|
762
|
+
if (model.extent() === 'parent' && parent) {
|
|
692
763
|
point.x = Math.min(parent.width() - model.width(), point.x);
|
|
693
764
|
point.x = Math.max(0, point.x);
|
|
694
765
|
point.y = Math.min(parent.height() - model.height(), point.y);
|
|
@@ -709,10 +780,32 @@ class DraggableService {
|
|
|
709
780
|
}
|
|
710
781
|
return point;
|
|
711
782
|
}
|
|
712
|
-
|
|
713
|
-
|
|
783
|
+
moveNodesOnAutoPan$(dragNodes) {
|
|
784
|
+
return toObservable(this.viewportService.readableViewport, { injector: this.injector })
|
|
785
|
+
.pipe(skip(1), // Skip initial value
|
|
786
|
+
pairwise(), filter(([prev, next]) => prev.x !== next.x || prev.y !== next.y))
|
|
787
|
+
.subscribe(([prev, next]) => {
|
|
788
|
+
const dx = next.x - prev.x;
|
|
789
|
+
const dy = next.y - prev.y;
|
|
790
|
+
const zoom = next.zoom;
|
|
791
|
+
// Calculate shift in flow space (inverse of viewport shift)
|
|
792
|
+
const shiftX = -dx / zoom;
|
|
793
|
+
const shiftY = -dy / zoom;
|
|
794
|
+
// Update each dragged node
|
|
795
|
+
dragNodes.forEach((node) => {
|
|
796
|
+
// Move node using existing pipeline (snap + parent bounds)
|
|
797
|
+
const newPoint = {
|
|
798
|
+
x: node.point().x + shiftX,
|
|
799
|
+
y: node.point().y + shiftY,
|
|
800
|
+
};
|
|
801
|
+
this.moveNode(node, newPoint);
|
|
802
|
+
});
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DraggableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
806
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DraggableService }); }
|
|
714
807
|
}
|
|
715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
808
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DraggableService, decorators: [{
|
|
716
809
|
type: Injectable
|
|
717
810
|
}] });
|
|
718
811
|
|
|
@@ -723,10 +816,10 @@ class EdgeTemplateDirective {
|
|
|
723
816
|
static ngTemplateContextGuard(dir, ctx) {
|
|
724
817
|
return true;
|
|
725
818
|
}
|
|
726
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
727
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
819
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
820
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: EdgeTemplateDirective, isStandalone: true, selector: "ng-template[edge]", ngImport: i0 }); }
|
|
728
821
|
}
|
|
729
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
822
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeTemplateDirective, decorators: [{
|
|
730
823
|
type: Directive,
|
|
731
824
|
args: [{
|
|
732
825
|
standalone: true,
|
|
@@ -740,10 +833,10 @@ class ConnectionTemplateDirective {
|
|
|
740
833
|
static ngTemplateContextGuard(dir, ctx) {
|
|
741
834
|
return true;
|
|
742
835
|
}
|
|
743
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
744
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
836
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
837
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: ConnectionTemplateDirective, isStandalone: true, selector: "ng-template[connection]", ngImport: i0 }); }
|
|
745
838
|
}
|
|
746
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionTemplateDirective, decorators: [{
|
|
747
840
|
type: Directive,
|
|
748
841
|
args: [{
|
|
749
842
|
standalone: true,
|
|
@@ -757,10 +850,10 @@ class EdgeLabelHtmlTemplateDirective {
|
|
|
757
850
|
static ngTemplateContextGuard(dir, ctx) {
|
|
758
851
|
return true;
|
|
759
852
|
}
|
|
760
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
761
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
853
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeLabelHtmlTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
854
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: EdgeLabelHtmlTemplateDirective, isStandalone: true, selector: "ng-template[edgeLabelHtml]", ngImport: i0 }); }
|
|
762
855
|
}
|
|
763
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeLabelHtmlTemplateDirective, decorators: [{
|
|
764
857
|
type: Directive,
|
|
765
858
|
args: [{
|
|
766
859
|
standalone: true,
|
|
@@ -774,10 +867,10 @@ class NodeHtmlTemplateDirective {
|
|
|
774
867
|
static ngTemplateContextGuard(dir, ctx) {
|
|
775
868
|
return true;
|
|
776
869
|
}
|
|
777
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
778
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
870
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeHtmlTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
871
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: NodeHtmlTemplateDirective, isStandalone: true, selector: "ng-template[nodeHtml]", ngImport: i0 }); }
|
|
779
872
|
}
|
|
780
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
873
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeHtmlTemplateDirective, decorators: [{
|
|
781
874
|
type: Directive,
|
|
782
875
|
args: [{
|
|
783
876
|
standalone: true,
|
|
@@ -791,10 +884,10 @@ class NodeSvgTemplateDirective {
|
|
|
791
884
|
static ngTemplateContextGuard(dir, ctx) {
|
|
792
885
|
return true;
|
|
793
886
|
}
|
|
794
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
795
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
887
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeSvgTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
888
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: NodeSvgTemplateDirective, isStandalone: true, selector: "ng-template[nodeSvg]", ngImport: i0 }); }
|
|
796
889
|
}
|
|
797
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
890
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeSvgTemplateDirective, decorators: [{
|
|
798
891
|
type: Directive,
|
|
799
892
|
args: [{
|
|
800
893
|
standalone: true,
|
|
@@ -808,10 +901,10 @@ class GroupNodeTemplateDirective {
|
|
|
808
901
|
static ngTemplateContextGuard(dir, ctx) {
|
|
809
902
|
return true;
|
|
810
903
|
}
|
|
811
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
812
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
904
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: GroupNodeTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
905
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: GroupNodeTemplateDirective, isStandalone: true, selector: "ng-template[groupNode]", ngImport: i0 }); }
|
|
813
906
|
}
|
|
814
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: GroupNodeTemplateDirective, decorators: [{
|
|
815
908
|
type: Directive,
|
|
816
909
|
args: [{
|
|
817
910
|
standalone: true,
|
|
@@ -822,10 +915,10 @@ class HandleTemplateDirective {
|
|
|
822
915
|
constructor() {
|
|
823
916
|
this.templateRef = inject(TemplateRef);
|
|
824
917
|
}
|
|
825
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
826
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
918
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
919
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: HandleTemplateDirective, isStandalone: true, selector: "ng-template[handle]", ngImport: i0 }); }
|
|
827
920
|
}
|
|
828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleTemplateDirective, decorators: [{
|
|
829
922
|
type: Directive,
|
|
830
923
|
args: [{
|
|
831
924
|
standalone: true,
|
|
@@ -862,10 +955,10 @@ class ComponentEventBusService {
|
|
|
862
955
|
pushEvent(event) {
|
|
863
956
|
this._event$.next(event);
|
|
864
957
|
}
|
|
865
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
866
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
958
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ComponentEventBusService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
959
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ComponentEventBusService }); }
|
|
867
960
|
}
|
|
868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ComponentEventBusService, decorators: [{
|
|
869
962
|
type: Injectable
|
|
870
963
|
}] });
|
|
871
964
|
|
|
@@ -876,10 +969,10 @@ class NodeAccessorService {
|
|
|
876
969
|
constructor() {
|
|
877
970
|
this.model = signal(null);
|
|
878
971
|
}
|
|
879
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
880
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
972
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeAccessorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
973
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeAccessorService }); }
|
|
881
974
|
}
|
|
882
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
975
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeAccessorService, decorators: [{
|
|
883
976
|
type: Injectable
|
|
884
977
|
}] });
|
|
885
978
|
|
|
@@ -917,10 +1010,10 @@ class CustomNodeBaseComponent {
|
|
|
917
1010
|
});
|
|
918
1011
|
}))));
|
|
919
1012
|
}
|
|
920
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
921
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1013
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomNodeBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1014
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: CustomNodeBaseComponent, isStandalone: true, ngImport: i0 }); }
|
|
922
1015
|
}
|
|
923
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1016
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomNodeBaseComponent, decorators: [{
|
|
924
1017
|
type: Directive
|
|
925
1018
|
}] });
|
|
926
1019
|
function outputRefToObservable(ref) {
|
|
@@ -934,28 +1027,6 @@ function outputRefToObservable(ref) {
|
|
|
934
1027
|
});
|
|
935
1028
|
}
|
|
936
1029
|
|
|
937
|
-
class CustomDynamicNodeComponent extends CustomNodeBaseComponent {
|
|
938
|
-
constructor() {
|
|
939
|
-
super(...arguments);
|
|
940
|
-
/**
|
|
941
|
-
* Reference to node bound to this component
|
|
942
|
-
*/
|
|
943
|
-
this.node = input.required();
|
|
944
|
-
}
|
|
945
|
-
ngOnInit() {
|
|
946
|
-
const data = this.node().data;
|
|
947
|
-
if (data) {
|
|
948
|
-
this.data = data;
|
|
949
|
-
}
|
|
950
|
-
super.ngOnInit();
|
|
951
|
-
}
|
|
952
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CustomDynamicNodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
953
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.12", type: CustomDynamicNodeComponent, inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
954
|
-
}
|
|
955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CustomDynamicNodeComponent, decorators: [{
|
|
956
|
-
type: Directive
|
|
957
|
-
}] });
|
|
958
|
-
|
|
959
1030
|
class CustomNodeComponent extends CustomNodeBaseComponent {
|
|
960
1031
|
constructor() {
|
|
961
1032
|
super(...arguments);
|
|
@@ -965,102 +1036,229 @@ class CustomNodeComponent extends CustomNodeBaseComponent {
|
|
|
965
1036
|
this.node = input.required();
|
|
966
1037
|
}
|
|
967
1038
|
ngOnInit() {
|
|
968
|
-
|
|
969
|
-
|
|
1039
|
+
const nodeData = this.node().data;
|
|
1040
|
+
if (nodeData) {
|
|
1041
|
+
this.data = nodeData;
|
|
970
1042
|
}
|
|
971
1043
|
super.ngOnInit();
|
|
972
1044
|
}
|
|
973
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
974
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1045
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomNodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1046
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: CustomNodeComponent, isStandalone: true, inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
975
1047
|
}
|
|
976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1048
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomNodeComponent, decorators: [{
|
|
977
1049
|
type: Directive
|
|
978
1050
|
}] });
|
|
979
1051
|
|
|
980
1052
|
function isCustomNodeComponent(type) {
|
|
981
1053
|
return Object.prototype.isPrototypeOf.call(CustomNodeComponent, type);
|
|
982
1054
|
}
|
|
983
|
-
function isCustomDynamicNodeComponent(type) {
|
|
984
|
-
return Object.prototype.isPrototypeOf.call(CustomDynamicNodeComponent, type);
|
|
985
|
-
}
|
|
986
1055
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1056
|
+
const NODE_DEFAULTS = {
|
|
1057
|
+
point: { x: 0, y: 0 },
|
|
1058
|
+
width: 100,
|
|
1059
|
+
height: 50,
|
|
1060
|
+
draggable: true,
|
|
1061
|
+
parentId: null,
|
|
1062
|
+
extent: 'parent',
|
|
1063
|
+
preview: { style: {} },
|
|
1064
|
+
selected: false,
|
|
1065
|
+
color: '#1b262c',
|
|
1066
|
+
resizable: false,
|
|
1067
|
+
text: '',
|
|
1068
|
+
data: {},
|
|
1069
|
+
};
|
|
1070
|
+
function isComponentNode(node) {
|
|
994
1071
|
if (isCustomNodeComponent(node.type)) {
|
|
995
1072
|
return true;
|
|
996
1073
|
}
|
|
997
1074
|
// Check if the type is a function with dynamic import
|
|
998
|
-
return isCallable(node.type)
|
|
1075
|
+
return isCallable(node.type);
|
|
999
1076
|
}
|
|
1000
|
-
function
|
|
1001
|
-
if (isCustomDynamicNodeComponent(node.type)) {
|
|
1002
|
-
return true;
|
|
1003
|
-
}
|
|
1004
|
-
// Check if the type is a function with dynamic import
|
|
1005
|
-
return isCallable(node.type) && isCallable(node.point);
|
|
1006
|
-
}
|
|
1007
|
-
function isTemplateStaticNode(node) {
|
|
1077
|
+
function isTemplateNode(node) {
|
|
1008
1078
|
return node.type === 'html-template';
|
|
1009
1079
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return node.type === 'html-template';
|
|
1012
|
-
}
|
|
1013
|
-
function isSvgTemplateStaticNode(node) {
|
|
1080
|
+
function isSvgTemplateNode(node) {
|
|
1014
1081
|
return node.type === 'svg-template';
|
|
1015
1082
|
}
|
|
1016
|
-
function
|
|
1017
|
-
return node.type === 'html-template';
|
|
1018
|
-
}
|
|
1019
|
-
function isDefaultStaticNode(node) {
|
|
1083
|
+
function isDefaultNode(node) {
|
|
1020
1084
|
return node.type === 'default';
|
|
1021
1085
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return node.type === 'default';
|
|
1024
|
-
}
|
|
1025
|
-
function isDefaultStaticGroupNode(node) {
|
|
1086
|
+
function isDefaultGroupNode(node) {
|
|
1026
1087
|
return node.type === 'default-group';
|
|
1027
1088
|
}
|
|
1028
|
-
function
|
|
1029
|
-
return node.type === 'default-group';
|
|
1030
|
-
}
|
|
1031
|
-
function isTemplateStaticGroupNode(node) {
|
|
1032
|
-
return node.type === 'template-group';
|
|
1033
|
-
}
|
|
1034
|
-
function isTemplateDynamicGroupNode(node) {
|
|
1089
|
+
function isTemplateGroupNode(node) {
|
|
1035
1090
|
return node.type === 'template-group';
|
|
1036
1091
|
}
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1092
|
+
function createBaseNode(node, useDefaults) {
|
|
1093
|
+
if (useDefaults) {
|
|
1094
|
+
return {
|
|
1095
|
+
id: node.id,
|
|
1096
|
+
point: signal(node.point),
|
|
1097
|
+
draggable: signal(isDefined(node.draggable) ? node.draggable : NODE_DEFAULTS.draggable),
|
|
1098
|
+
parentId: signal(isDefined(node.parentId) ? node.parentId : NODE_DEFAULTS.parentId),
|
|
1099
|
+
extent: signal(isDefined(node.extent) ? node.extent : NODE_DEFAULTS.extent),
|
|
1100
|
+
preview: signal(isDefined(node.preview) ? node.preview : NODE_DEFAULTS.preview),
|
|
1101
|
+
selected: signal(isDefined(node.selected) ? node.selected : NODE_DEFAULTS.selected),
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
else {
|
|
1105
|
+
return {
|
|
1106
|
+
id: node.id,
|
|
1107
|
+
point: signal(node.point),
|
|
1108
|
+
draggable: isDefined(node.draggable) ? signal(node.draggable) : undefined,
|
|
1109
|
+
parentId: isDefined(node.parentId) ? signal(node.parentId) : undefined,
|
|
1110
|
+
extent: isDefined(node.extent) ? signal(node.extent) : undefined,
|
|
1111
|
+
preview: isDefined(node.preview) ? signal(node.preview) : undefined,
|
|
1112
|
+
selected: isDefined(node.selected) ? signal(node.selected) : undefined,
|
|
1113
|
+
};
|
|
1045
1114
|
}
|
|
1046
|
-
return {
|
|
1047
|
-
...toSignalProperties(node),
|
|
1048
|
-
// non-signal props below
|
|
1049
|
-
id: node.id,
|
|
1050
|
-
// TODO this actually of incorrect type for component nodes
|
|
1051
|
-
type: node.type,
|
|
1052
|
-
};
|
|
1053
1115
|
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1116
|
+
// Реализация
|
|
1117
|
+
function createNode(node, options = { useDefaults: true }) {
|
|
1118
|
+
const baseNode = createBaseNode(node, options.useDefaults);
|
|
1119
|
+
if (node.type === 'default') {
|
|
1120
|
+
if (options.useDefaults) {
|
|
1121
|
+
return {
|
|
1122
|
+
...baseNode,
|
|
1123
|
+
type: 'default',
|
|
1124
|
+
text: signal(node.text ?? ''),
|
|
1125
|
+
width: signal(node.width ?? NODE_DEFAULTS.width),
|
|
1126
|
+
height: signal(node.height ?? NODE_DEFAULTS.height),
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
else {
|
|
1130
|
+
return {
|
|
1131
|
+
...baseNode,
|
|
1132
|
+
type: 'default',
|
|
1133
|
+
text: isDefined(node.text) ? signal(node.text) : undefined,
|
|
1134
|
+
width: isDefined(node.width) ? signal(node.width) : undefined,
|
|
1135
|
+
height: isDefined(node.height) ? signal(node.height) : undefined,
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
if (node.type === 'html-template') {
|
|
1140
|
+
if (options.useDefaults) {
|
|
1141
|
+
return {
|
|
1142
|
+
...baseNode,
|
|
1143
|
+
type: 'html-template',
|
|
1144
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1145
|
+
width: signal(node.width ?? NODE_DEFAULTS.width),
|
|
1146
|
+
height: signal(node.height ?? NODE_DEFAULTS.height),
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
else {
|
|
1150
|
+
return {
|
|
1151
|
+
...baseNode,
|
|
1152
|
+
type: 'html-template',
|
|
1153
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1154
|
+
width: isDefined(node.width) ? signal(node.width) : undefined,
|
|
1155
|
+
height: isDefined(node.height) ? signal(node.height) : undefined,
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
if (node.type === 'svg-template') {
|
|
1160
|
+
const width = signal(node.width);
|
|
1161
|
+
const height = signal(node.height);
|
|
1162
|
+
if (options.useDefaults) {
|
|
1163
|
+
return {
|
|
1164
|
+
...baseNode,
|
|
1165
|
+
type: 'svg-template',
|
|
1166
|
+
width,
|
|
1167
|
+
height,
|
|
1168
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
else {
|
|
1172
|
+
return {
|
|
1173
|
+
...baseNode,
|
|
1174
|
+
type: 'svg-template',
|
|
1175
|
+
width,
|
|
1176
|
+
height,
|
|
1177
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1178
|
+
};
|
|
1059
1179
|
}
|
|
1060
1180
|
}
|
|
1061
|
-
|
|
1181
|
+
if (node.type === 'default-group') {
|
|
1182
|
+
const width = signal(node.width);
|
|
1183
|
+
const height = signal(node.height);
|
|
1184
|
+
if (options.useDefaults) {
|
|
1185
|
+
return {
|
|
1186
|
+
...baseNode,
|
|
1187
|
+
type: 'default-group',
|
|
1188
|
+
width,
|
|
1189
|
+
height,
|
|
1190
|
+
color: signal(node.color ?? NODE_DEFAULTS.color),
|
|
1191
|
+
resizable: signal(node.resizable ?? NODE_DEFAULTS.resizable),
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
return {
|
|
1196
|
+
...baseNode,
|
|
1197
|
+
type: 'default-group',
|
|
1198
|
+
width,
|
|
1199
|
+
height,
|
|
1200
|
+
color: isDefined(node.color) ? signal(node.color) : undefined,
|
|
1201
|
+
resizable: isDefined(node.resizable) ? signal(node.resizable) : undefined,
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
if (node.type === 'template-group') {
|
|
1206
|
+
const width = signal(node.width);
|
|
1207
|
+
const height = signal(node.height);
|
|
1208
|
+
if (options.useDefaults) {
|
|
1209
|
+
return {
|
|
1210
|
+
...baseNode,
|
|
1211
|
+
type: 'template-group',
|
|
1212
|
+
width,
|
|
1213
|
+
height,
|
|
1214
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
else {
|
|
1218
|
+
return {
|
|
1219
|
+
...baseNode,
|
|
1220
|
+
type: 'template-group',
|
|
1221
|
+
width,
|
|
1222
|
+
height,
|
|
1223
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1224
|
+
};
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
if (isCustomNodeComponent(node.type) || isCallable(node.type)) {
|
|
1228
|
+
if (options.useDefaults) {
|
|
1229
|
+
return {
|
|
1230
|
+
...baseNode,
|
|
1231
|
+
type: node.type,
|
|
1232
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1233
|
+
width: signal(node.width ?? NODE_DEFAULTS.width),
|
|
1234
|
+
height: signal(node.height ?? NODE_DEFAULTS.height),
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
return {
|
|
1239
|
+
...baseNode,
|
|
1240
|
+
type: node.type,
|
|
1241
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1242
|
+
width: isDefined(node.width) ? signal(node.width) : undefined,
|
|
1243
|
+
height: isDefined(node.height) ? signal(node.height) : undefined,
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
throw new Error(`Unknown node type for node with id ${node.id}`);
|
|
1248
|
+
}
|
|
1249
|
+
function createNodes(nodes, options = { useDefaults: true }) {
|
|
1250
|
+
if (options.useDefaults) {
|
|
1251
|
+
return nodes.map((node) => createNode(node, { useDefaults: true }));
|
|
1252
|
+
}
|
|
1253
|
+
else {
|
|
1254
|
+
return nodes.map((node) => createNode(node, { useDefaults: false }));
|
|
1255
|
+
}
|
|
1062
1256
|
}
|
|
1063
1257
|
|
|
1258
|
+
// this is a number to fix visual artifact in chrome.
|
|
1259
|
+
// the bug reproduces if edgeLabelWrapperRef size fully matched the size of parent foreignObject
|
|
1260
|
+
const MAGIC_NUMBER_TO_FIX_GLITCH_IN_CHROME = 2;
|
|
1261
|
+
|
|
1064
1262
|
// MIT License
|
|
1065
1263
|
// Copyright (c) 2023 Chau Tran
|
|
1066
1264
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
@@ -1172,10 +1370,10 @@ class NodeRenderingService {
|
|
|
1172
1370
|
// pull children
|
|
1173
1371
|
node.children().forEach((n) => this.pullNode(n));
|
|
1174
1372
|
}
|
|
1175
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1176
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1373
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeRenderingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1374
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeRenderingService }); }
|
|
1177
1375
|
}
|
|
1178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeRenderingService, decorators: [{
|
|
1179
1377
|
type: Injectable
|
|
1180
1378
|
}] });
|
|
1181
1379
|
|
|
@@ -1194,9 +1392,6 @@ function extendedComputed(computedCallback, options) {
|
|
|
1194
1392
|
}
|
|
1195
1393
|
|
|
1196
1394
|
class NodeModel {
|
|
1197
|
-
static { this.defaultWidth = 100; }
|
|
1198
|
-
static { this.defaultHeight = 50; }
|
|
1199
|
-
static { this.defaultColor = '#1b262c'; }
|
|
1200
1395
|
constructor(rawNode) {
|
|
1201
1396
|
this.rawNode = rawNode;
|
|
1202
1397
|
this.entitiesService = inject(FlowEntitiesService);
|
|
@@ -1204,8 +1399,8 @@ class NodeModel {
|
|
|
1204
1399
|
this.nodeRenderingService = inject(NodeRenderingService);
|
|
1205
1400
|
this.isVisible = signal(false);
|
|
1206
1401
|
this.point = signal({ x: 0, y: 0 });
|
|
1207
|
-
this.width = signal(
|
|
1208
|
-
this.height = signal(
|
|
1402
|
+
this.width = signal(NODE_DEFAULTS.width);
|
|
1403
|
+
this.height = signal(NODE_DEFAULTS.height);
|
|
1209
1404
|
/**
|
|
1210
1405
|
* @deprecated use width or height signals
|
|
1211
1406
|
*/
|
|
@@ -1221,6 +1416,7 @@ class NodeModel {
|
|
|
1221
1416
|
this.renderOrder = signal(0);
|
|
1222
1417
|
this.selected = signal(false);
|
|
1223
1418
|
this.preview = signal({ style: {} });
|
|
1419
|
+
this.extent = signal(NODE_DEFAULTS.extent);
|
|
1224
1420
|
this.globalPoint = computed(() => {
|
|
1225
1421
|
let parent = this.parent();
|
|
1226
1422
|
let x = this.point().x;
|
|
@@ -1239,7 +1435,7 @@ class NodeModel {
|
|
|
1239
1435
|
// disabled for configuration for now
|
|
1240
1436
|
this.magnetRadius = 20;
|
|
1241
1437
|
// TODO: not sure if we need to statically store it
|
|
1242
|
-
this.isComponentType =
|
|
1438
|
+
this.isComponentType = isComponentNode(this.rawNode);
|
|
1243
1439
|
this.shouldLoad = extendedComputed((previousShouldLoad) => {
|
|
1244
1440
|
if (previousShouldLoad) {
|
|
1245
1441
|
return true;
|
|
@@ -1252,10 +1448,6 @@ class NodeModel {
|
|
|
1252
1448
|
if (isCustomNodeComponent(this.rawNode.type)) {
|
|
1253
1449
|
return true;
|
|
1254
1450
|
}
|
|
1255
|
-
// Immediately load component if it's a plain class
|
|
1256
|
-
if (isCustomDynamicNodeComponent(this.rawNode.type)) {
|
|
1257
|
-
return true;
|
|
1258
|
-
}
|
|
1259
1451
|
// For cases
|
|
1260
1452
|
// - if it's a factory with dynamic import
|
|
1261
1453
|
// - if it's a template (html, svg, group)
|
|
@@ -1274,63 +1466,70 @@ class NodeModel {
|
|
|
1274
1466
|
// @ts-expect-error we assume it's a function with dynamic import
|
|
1275
1467
|
switchMap(() => this.rawNode.type()), catchError(() => of(this.rawNode.type)), shareReplay(1));
|
|
1276
1468
|
// Default node specific thing
|
|
1277
|
-
this.text = signal(
|
|
1469
|
+
this.text = signal(NODE_DEFAULTS.text);
|
|
1278
1470
|
// Component node specific thing
|
|
1279
1471
|
this.componentTypeInputs = {
|
|
1280
1472
|
node: this.rawNode,
|
|
1281
1473
|
};
|
|
1282
1474
|
this.parent = computed(() => this.entitiesService.nodes().find((n) => n.rawNode.id === this.parentId()) ?? null);
|
|
1283
1475
|
this.children = computed(() => this.entitiesService.nodes().filter((n) => n.parentId() === this.rawNode.id));
|
|
1284
|
-
this.color = signal(
|
|
1476
|
+
this.color = signal(NODE_DEFAULTS.color);
|
|
1285
1477
|
this.controlledByResizer = signal(false);
|
|
1286
|
-
this.resizable = signal(
|
|
1478
|
+
this.resizable = signal(NODE_DEFAULTS.resizable);
|
|
1287
1479
|
this.resizing = signal(false);
|
|
1288
1480
|
this.resizerTemplate = signal(null);
|
|
1289
1481
|
this.context = {
|
|
1290
1482
|
$implicit: {},
|
|
1291
1483
|
};
|
|
1292
|
-
this.parentId = signal(
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1484
|
+
this.parentId = signal(NODE_DEFAULTS.parentId);
|
|
1485
|
+
if (rawNode.point) {
|
|
1486
|
+
this.point = rawNode.point;
|
|
1487
|
+
}
|
|
1488
|
+
if (rawNode.width) {
|
|
1489
|
+
this.width = rawNode.width;
|
|
1490
|
+
}
|
|
1491
|
+
if (rawNode.height) {
|
|
1492
|
+
this.height = rawNode.height;
|
|
1296
1493
|
}
|
|
1297
|
-
if (
|
|
1298
|
-
this.
|
|
1494
|
+
if (rawNode.draggable) {
|
|
1495
|
+
this.draggable = rawNode.draggable;
|
|
1299
1496
|
}
|
|
1300
|
-
if (
|
|
1301
|
-
this.
|
|
1497
|
+
if (rawNode.parentId) {
|
|
1498
|
+
this.parentId = rawNode.parentId;
|
|
1302
1499
|
}
|
|
1303
|
-
if (
|
|
1304
|
-
this.
|
|
1500
|
+
if (rawNode.preview) {
|
|
1501
|
+
this.preview = rawNode.preview;
|
|
1305
1502
|
}
|
|
1306
|
-
if (
|
|
1307
|
-
this.
|
|
1503
|
+
if (rawNode.selected) {
|
|
1504
|
+
this.selected = rawNode.selected;
|
|
1308
1505
|
}
|
|
1309
|
-
if (
|
|
1310
|
-
this.
|
|
1506
|
+
if (rawNode.extent) {
|
|
1507
|
+
this.extent = rawNode.extent;
|
|
1311
1508
|
}
|
|
1312
|
-
if (
|
|
1313
|
-
this.color =
|
|
1509
|
+
if (rawNode.type === 'default-group' && rawNode.color) {
|
|
1510
|
+
this.color = rawNode.color;
|
|
1314
1511
|
}
|
|
1315
|
-
if (
|
|
1316
|
-
this.resizable =
|
|
1512
|
+
if (rawNode.type === 'default-group' && rawNode.resizable) {
|
|
1513
|
+
this.resizable = rawNode.resizable;
|
|
1317
1514
|
}
|
|
1318
|
-
if (
|
|
1319
|
-
this.text =
|
|
1515
|
+
if (rawNode.type === 'default' && rawNode.text) {
|
|
1516
|
+
this.text = rawNode.text;
|
|
1320
1517
|
}
|
|
1321
|
-
if (
|
|
1518
|
+
if (rawNode.type === 'html-template') {
|
|
1322
1519
|
this.context = {
|
|
1323
1520
|
$implicit: {
|
|
1324
1521
|
node: rawNode,
|
|
1522
|
+
data: rawNode.data ?? signal(NODE_DEFAULTS.data),
|
|
1325
1523
|
selected: this.selected.asReadonly(),
|
|
1326
1524
|
shouldLoad: this.shouldLoad,
|
|
1327
1525
|
},
|
|
1328
1526
|
};
|
|
1329
1527
|
}
|
|
1330
|
-
if (
|
|
1528
|
+
if (rawNode.type === 'svg-template') {
|
|
1331
1529
|
this.context = {
|
|
1332
1530
|
$implicit: {
|
|
1333
1531
|
node: rawNode,
|
|
1532
|
+
data: rawNode.data ?? signal(NODE_DEFAULTS.data),
|
|
1334
1533
|
selected: this.selected.asReadonly(),
|
|
1335
1534
|
width: this.width.asReadonly(),
|
|
1336
1535
|
height: this.height.asReadonly(),
|
|
@@ -1338,10 +1537,11 @@ class NodeModel {
|
|
|
1338
1537
|
},
|
|
1339
1538
|
};
|
|
1340
1539
|
}
|
|
1341
|
-
if (
|
|
1540
|
+
if (rawNode.type === 'template-group') {
|
|
1342
1541
|
this.context = {
|
|
1343
1542
|
$implicit: {
|
|
1344
1543
|
node: rawNode,
|
|
1544
|
+
data: rawNode.data ?? signal(NODE_DEFAULTS.data),
|
|
1345
1545
|
selected: this.selected.asReadonly(),
|
|
1346
1546
|
width: this.width.asReadonly(),
|
|
1347
1547
|
height: this.height.asReadonly(),
|
|
@@ -1362,6 +1562,61 @@ class NodeModel {
|
|
|
1362
1562
|
}
|
|
1363
1563
|
}
|
|
1364
1564
|
|
|
1565
|
+
const EDGE_DEFAULTS = {
|
|
1566
|
+
type: 'default',
|
|
1567
|
+
curve: 'bezier',
|
|
1568
|
+
data: {},
|
|
1569
|
+
edgeLabels: {},
|
|
1570
|
+
markers: {},
|
|
1571
|
+
reconnectable: false,
|
|
1572
|
+
floating: false,
|
|
1573
|
+
selected: false,
|
|
1574
|
+
};
|
|
1575
|
+
function createEdge(edge, options = { useDefaults: true }) {
|
|
1576
|
+
if (options.useDefaults) {
|
|
1577
|
+
return {
|
|
1578
|
+
id: edge.id,
|
|
1579
|
+
source: edge.source,
|
|
1580
|
+
target: edge.target,
|
|
1581
|
+
type: isDefined(edge.type) ? edge.type : EDGE_DEFAULTS.type,
|
|
1582
|
+
sourceHandle: isDefined(edge.sourceHandle) ? edge.sourceHandle : '',
|
|
1583
|
+
targetHandle: isDefined(edge.targetHandle) ? edge.targetHandle : '',
|
|
1584
|
+
curve: signal(isDefined(edge.curve) ? edge.curve : EDGE_DEFAULTS.curve),
|
|
1585
|
+
data: signal(isDefined(edge.data) ? edge.data : EDGE_DEFAULTS.data),
|
|
1586
|
+
edgeLabels: signal(isDefined(edge.edgeLabels) ? edge.edgeLabels : EDGE_DEFAULTS.edgeLabels),
|
|
1587
|
+
markers: signal(isDefined(edge.markers) ? edge.markers : EDGE_DEFAULTS.markers),
|
|
1588
|
+
reconnectable: signal(isDefined(edge.reconnectable) ? edge.reconnectable : EDGE_DEFAULTS.reconnectable),
|
|
1589
|
+
floating: signal(isDefined(edge.floating) ? edge.floating : EDGE_DEFAULTS.floating),
|
|
1590
|
+
selected: signal(isDefined(edge.selected) ? edge.selected : EDGE_DEFAULTS.selected),
|
|
1591
|
+
};
|
|
1592
|
+
}
|
|
1593
|
+
else {
|
|
1594
|
+
return {
|
|
1595
|
+
id: edge.id,
|
|
1596
|
+
type: edge.type,
|
|
1597
|
+
source: edge.source,
|
|
1598
|
+
target: edge.target,
|
|
1599
|
+
sourceHandle: edge.sourceHandle,
|
|
1600
|
+
targetHandle: edge.targetHandle,
|
|
1601
|
+
curve: isDefined(edge.curve) ? signal(edge.curve) : undefined,
|
|
1602
|
+
data: isDefined(edge.data) ? signal(edge.data) : undefined,
|
|
1603
|
+
edgeLabels: isDefined(edge.edgeLabels) ? signal(edge.edgeLabels) : undefined,
|
|
1604
|
+
markers: isDefined(edge.markers) ? signal(edge.markers) : undefined,
|
|
1605
|
+
reconnectable: isDefined(edge.reconnectable) ? signal(edge.reconnectable) : undefined,
|
|
1606
|
+
floating: isDefined(edge.floating) ? signal(edge.floating) : undefined,
|
|
1607
|
+
selected: isDefined(edge.selected) ? signal(edge.selected) : undefined,
|
|
1608
|
+
};
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
function createEdges(edges, options = { useDefaults: true }) {
|
|
1612
|
+
if (options.useDefaults) {
|
|
1613
|
+
return edges.map((edge) => createEdge(edge, { useDefaults: true }));
|
|
1614
|
+
}
|
|
1615
|
+
else {
|
|
1616
|
+
return edges.map((edge) => createEdge(edge, { useDefaults: false }));
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1365
1620
|
class EdgeLabelModel {
|
|
1366
1621
|
constructor(edgeLabel) {
|
|
1367
1622
|
this.edgeLabel = edgeLabel;
|
|
@@ -1689,7 +1944,12 @@ class EdgeModel {
|
|
|
1689
1944
|
this.flowEntitiesService = inject(FlowEntitiesService);
|
|
1690
1945
|
this.source = signal(undefined);
|
|
1691
1946
|
this.target = signal(undefined);
|
|
1692
|
-
this.
|
|
1947
|
+
this.curve = signal(EDGE_DEFAULTS.curve);
|
|
1948
|
+
this.reconnectable = signal(EDGE_DEFAULTS.reconnectable);
|
|
1949
|
+
this.floating = signal(EDGE_DEFAULTS.floating);
|
|
1950
|
+
this.markers = signal(EDGE_DEFAULTS.markers);
|
|
1951
|
+
this.edgeLabels = signal(EDGE_DEFAULTS.edgeLabels);
|
|
1952
|
+
this.selected = signal(EDGE_DEFAULTS.selected);
|
|
1693
1953
|
this.selected$ = toObservable(this.selected);
|
|
1694
1954
|
this.shouldLoad = computed(() => (this.source()?.shouldLoad() ?? false) && (this.target()?.shouldLoad() ?? false));
|
|
1695
1955
|
this.renderOrder = signal(0);
|
|
@@ -1724,7 +1984,8 @@ class EdgeModel {
|
|
|
1724
1984
|
return { path: '' };
|
|
1725
1985
|
}
|
|
1726
1986
|
const params = this.getPathFactoryParams(source, target);
|
|
1727
|
-
|
|
1987
|
+
const curve = this.curve();
|
|
1988
|
+
switch (curve) {
|
|
1728
1989
|
case 'straight':
|
|
1729
1990
|
return straightPath(params);
|
|
1730
1991
|
case 'bezier':
|
|
@@ -1734,12 +1995,12 @@ class EdgeModel {
|
|
|
1734
1995
|
case 'step':
|
|
1735
1996
|
return smoothStepPath(params, 0);
|
|
1736
1997
|
default:
|
|
1737
|
-
return
|
|
1998
|
+
return curve(params);
|
|
1738
1999
|
}
|
|
1739
2000
|
});
|
|
1740
2001
|
this.sourceHandle = extendedComputed((previousHandle) => {
|
|
1741
2002
|
let handle = null;
|
|
1742
|
-
if (this.floating) {
|
|
2003
|
+
if (this.floating()) {
|
|
1743
2004
|
handle = this.closestHandles().sourceHandle;
|
|
1744
2005
|
}
|
|
1745
2006
|
else {
|
|
@@ -1767,7 +2028,7 @@ class EdgeModel {
|
|
|
1767
2028
|
});
|
|
1768
2029
|
this.targetHandle = extendedComputed((previousHandle) => {
|
|
1769
2030
|
let handle = null;
|
|
1770
|
-
if (this.floating) {
|
|
2031
|
+
if (this.floating()) {
|
|
1771
2032
|
handle = this.closestHandles().targetHandle;
|
|
1772
2033
|
}
|
|
1773
2034
|
else {
|
|
@@ -1831,24 +2092,48 @@ class EdgeModel {
|
|
|
1831
2092
|
targetHandle: closestTargetHandle,
|
|
1832
2093
|
};
|
|
1833
2094
|
});
|
|
1834
|
-
/**
|
|
1835
|
-
* TODO: not reactive
|
|
1836
|
-
*/
|
|
1837
2095
|
this.markerStartUrl = computed(() => {
|
|
1838
|
-
const marker = this.
|
|
2096
|
+
const marker = this.markers()?.start;
|
|
1839
2097
|
return marker ? `url(#${hashCode(JSON.stringify(marker))})` : '';
|
|
1840
2098
|
});
|
|
1841
|
-
/**
|
|
1842
|
-
* TODO: not reactive
|
|
1843
|
-
*/
|
|
1844
2099
|
this.markerEndUrl = computed(() => {
|
|
1845
|
-
const marker = this.
|
|
2100
|
+
const marker = this.markers()?.end;
|
|
1846
2101
|
return marker ? `url(#${hashCode(JSON.stringify(marker))})` : '';
|
|
1847
2102
|
});
|
|
2103
|
+
this.labelModels = computed(() => {
|
|
2104
|
+
const models = {};
|
|
2105
|
+
const labels = this.edgeLabels();
|
|
2106
|
+
if (labels?.start)
|
|
2107
|
+
models.start = new EdgeLabelModel(labels.start);
|
|
2108
|
+
if (labels?.center)
|
|
2109
|
+
models.center = new EdgeLabelModel(labels.center);
|
|
2110
|
+
if (labels?.end)
|
|
2111
|
+
models.end = new EdgeLabelModel(labels.end);
|
|
2112
|
+
return models;
|
|
2113
|
+
});
|
|
2114
|
+
this.type = edge.type ?? EDGE_DEFAULTS.type;
|
|
2115
|
+
if (edge.curve) {
|
|
2116
|
+
this.curve = edge.curve;
|
|
2117
|
+
}
|
|
2118
|
+
if (edge.reconnectable) {
|
|
2119
|
+
this.reconnectable = edge.reconnectable;
|
|
2120
|
+
}
|
|
2121
|
+
if (edge.floating) {
|
|
2122
|
+
this.floating = edge.floating;
|
|
2123
|
+
}
|
|
2124
|
+
if (edge.selected) {
|
|
2125
|
+
this.selected = edge.selected;
|
|
2126
|
+
}
|
|
2127
|
+
if (edge.markers) {
|
|
2128
|
+
this.markers = edge.markers;
|
|
2129
|
+
}
|
|
2130
|
+
if (edge.edgeLabels) {
|
|
2131
|
+
this.edgeLabels = edge.edgeLabels;
|
|
2132
|
+
}
|
|
1848
2133
|
this.context = {
|
|
1849
2134
|
$implicit: {
|
|
1850
|
-
// TODO: check if edge could change
|
|
1851
2135
|
edge: this.edge,
|
|
2136
|
+
data: this.edge.data ?? signal({}),
|
|
1852
2137
|
path: computed(() => this.path().path),
|
|
1853
2138
|
markerStart: this.markerStartUrl,
|
|
1854
2139
|
markerEnd: this.markerEndUrl,
|
|
@@ -1856,17 +2141,7 @@ class EdgeModel {
|
|
|
1856
2141
|
shouldLoad: this.shouldLoad,
|
|
1857
2142
|
},
|
|
1858
2143
|
};
|
|
1859
|
-
this.
|
|
1860
|
-
this.type = edge.type ?? 'default';
|
|
1861
|
-
this.curve = edge.curve ?? 'bezier';
|
|
1862
|
-
this.reconnectable = edge.reconnectable ?? false;
|
|
1863
|
-
this.floating = edge.floating ?? false;
|
|
1864
|
-
if (edge.edgeLabels?.start)
|
|
1865
|
-
this.edgeLabels.start = new EdgeLabelModel(edge.edgeLabels.start);
|
|
1866
|
-
if (edge.edgeLabels?.center)
|
|
1867
|
-
this.edgeLabels.center = new EdgeLabelModel(edge.edgeLabels.center);
|
|
1868
|
-
if (edge.edgeLabels?.end)
|
|
1869
|
-
this.edgeLabels.end = new EdgeLabelModel(edge.edgeLabels.end);
|
|
2144
|
+
this.selected$ = toObservable(this.selected);
|
|
1870
2145
|
}
|
|
1871
2146
|
getPathFactoryParams(source, target) {
|
|
1872
2147
|
return {
|
|
@@ -1937,10 +2212,10 @@ class NodesChangeService {
|
|
|
1937
2212
|
// you can't get valid list of detached edges
|
|
1938
2213
|
observeOn(asyncScheduler, DELAY_FOR_SCHEDULER));
|
|
1939
2214
|
}
|
|
1940
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1941
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2215
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodesChangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2216
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodesChangeService }); }
|
|
1942
2217
|
}
|
|
1943
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodesChangeService, decorators: [{
|
|
1944
2219
|
type: Injectable
|
|
1945
2220
|
}] });
|
|
1946
2221
|
|
|
@@ -1975,10 +2250,10 @@ class EdgeChangesService {
|
|
|
1975
2250
|
// right after [nodes] input change
|
|
1976
2251
|
observeOn(asyncScheduler));
|
|
1977
2252
|
}
|
|
1978
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1979
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeChangesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2254
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeChangesService }); }
|
|
1980
2255
|
}
|
|
1981
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeChangesService, decorators: [{
|
|
1982
2257
|
type: Injectable
|
|
1983
2258
|
}] });
|
|
1984
2259
|
|
|
@@ -1987,135 +2262,39 @@ class ChangesControllerDirective {
|
|
|
1987
2262
|
this.nodesChangeService = inject(NodesChangeService);
|
|
1988
2263
|
this.edgesChangeService = inject(EdgeChangesService);
|
|
1989
2264
|
/**
|
|
1990
|
-
* Watch nodes
|
|
2265
|
+
* Watch nodes changes
|
|
1991
2266
|
*/
|
|
1992
|
-
this.
|
|
1993
|
-
this.
|
|
1994
|
-
alias: '
|
|
2267
|
+
this.nodesChanges = outputFromObservable(this.nodesChangeService.changes$);
|
|
2268
|
+
this.nodesChangesPosition = outputFromObservable(this.nodeChangesOfType('position'), {
|
|
2269
|
+
alias: 'nodesChanges.position',
|
|
1995
2270
|
});
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
*/
|
|
1999
|
-
this.onNodesChangePositionSignle = outputFromObservable(this.singleChange(this.nodeChangesOfType('position')), { alias: 'onNodesChange.position.single' });
|
|
2000
|
-
/**
|
|
2001
|
-
* @deprecated use `onNodesChange.position` instead
|
|
2002
|
-
*/
|
|
2003
|
-
this.onNodesChangePositionMany = outputFromObservable(this.manyChanges(this.nodeChangesOfType('position')), { alias: 'onNodesChange.position.many' });
|
|
2004
|
-
this.onNodesChangeSize = outputFromObservable(this.nodeChangesOfType('size'), {
|
|
2005
|
-
alias: 'onNodesChange.size',
|
|
2271
|
+
this.nodesChangesSize = outputFromObservable(this.nodeChangesOfType('size'), {
|
|
2272
|
+
alias: 'nodesChanges.size',
|
|
2006
2273
|
});
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
*/
|
|
2010
|
-
this.onNodesChangeSizeSingle = outputFromObservable(this.singleChange(this.nodeChangesOfType('size')), {
|
|
2011
|
-
alias: 'onNodesChange.size.single',
|
|
2012
|
-
});
|
|
2013
|
-
/**
|
|
2014
|
-
* @deprecated use `onNodesChange.size` instead
|
|
2015
|
-
*/
|
|
2016
|
-
this.onNodesChangeSizeMany = outputFromObservable(this.manyChanges(this.nodeChangesOfType('size')), {
|
|
2017
|
-
alias: 'onNodesChange.size.many',
|
|
2018
|
-
});
|
|
2019
|
-
this.onNodesChangeAdd = outputFromObservable(this.nodeChangesOfType('add'), {
|
|
2020
|
-
alias: 'onNodesChange.add',
|
|
2274
|
+
this.nodesChangesAdd = outputFromObservable(this.nodeChangesOfType('add'), {
|
|
2275
|
+
alias: 'nodesChanges.add',
|
|
2021
2276
|
});
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
*/
|
|
2025
|
-
this.onNodesChangeAddSingle = outputFromObservable(this.singleChange(this.nodeChangesOfType('add')), {
|
|
2026
|
-
alias: 'onNodesChange.add.single',
|
|
2027
|
-
});
|
|
2028
|
-
/**
|
|
2029
|
-
* @deprecated use `onNodesChange.add` instead
|
|
2030
|
-
*/
|
|
2031
|
-
this.onNodesChangeAddMany = outputFromObservable(this.manyChanges(this.nodeChangesOfType('add')), {
|
|
2032
|
-
alias: 'onNodesChange.add.many',
|
|
2277
|
+
this.nodesChangesRemove = outputFromObservable(this.nodeChangesOfType('remove'), {
|
|
2278
|
+
alias: 'nodesChanges.remove',
|
|
2033
2279
|
});
|
|
2034
|
-
this.
|
|
2035
|
-
alias: '
|
|
2036
|
-
});
|
|
2037
|
-
/**
|
|
2038
|
-
* @deprecated use `onNodesChange.remove` instead
|
|
2039
|
-
*/
|
|
2040
|
-
this.onNodesChangeRemoveSingle = outputFromObservable(this.singleChange(this.nodeChangesOfType('remove')), { alias: 'onNodesChange.remove.single' });
|
|
2041
|
-
/**
|
|
2042
|
-
* @deprecated use `onNodesChange.remove` instead
|
|
2043
|
-
*/
|
|
2044
|
-
this.onNodesChangeRemoveMany = outputFromObservable(this.manyChanges(this.nodeChangesOfType('remove')), {
|
|
2045
|
-
alias: 'onNodesChange.remove.many',
|
|
2046
|
-
});
|
|
2047
|
-
this.onNodesChangeSelect = outputFromObservable(this.nodeChangesOfType('select'), {
|
|
2048
|
-
alias: 'onNodesChange.select',
|
|
2049
|
-
});
|
|
2050
|
-
/**
|
|
2051
|
-
* @deprecated use `onNodesChange.select` instead
|
|
2052
|
-
*/
|
|
2053
|
-
this.onNodesChangeSelectSingle = outputFromObservable(this.singleChange(this.nodeChangesOfType('select')), { alias: 'onNodesChange.select.single' });
|
|
2054
|
-
/**
|
|
2055
|
-
* @deprecated use `onNodesChange.select` instead
|
|
2056
|
-
*/
|
|
2057
|
-
this.onNodesChangeSelectMany = outputFromObservable(this.manyChanges(this.nodeChangesOfType('select')), {
|
|
2058
|
-
alias: 'onNodesChange.select.many',
|
|
2280
|
+
this.nodesChangesSelect = outputFromObservable(this.nodeChangesOfType('select'), {
|
|
2281
|
+
alias: 'nodesChanges.select',
|
|
2059
2282
|
});
|
|
2060
2283
|
/**
|
|
2061
2284
|
* Watch edges change
|
|
2062
2285
|
*/
|
|
2063
|
-
this.
|
|
2064
|
-
this.
|
|
2065
|
-
alias: '
|
|
2286
|
+
this.edgesChanges = outputFromObservable(this.edgesChangeService.changes$);
|
|
2287
|
+
this.edgesChangesDetached = outputFromObservable(this.edgeChangesOfType('detached'), {
|
|
2288
|
+
alias: 'edgesChanges.detached',
|
|
2066
2289
|
});
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
*/
|
|
2070
|
-
this.onNodesChangeDetachedSingle = outputFromObservable(this.singleChange(this.edgeChangesOfType('detached')), { alias: 'onEdgesChange.detached.single' });
|
|
2071
|
-
/**
|
|
2072
|
-
* @deprecated use `onEdgesChange.detached` instead
|
|
2073
|
-
*/
|
|
2074
|
-
this.onNodesChangeDetachedMany = outputFromObservable(this.manyChanges(this.edgeChangesOfType('detached')), { alias: 'onEdgesChange.detached.many' });
|
|
2075
|
-
this.onEdgesChangeAdd = outputFromObservable(this.edgeChangesOfType('add'), {
|
|
2076
|
-
alias: 'onEdgesChange.add',
|
|
2077
|
-
});
|
|
2078
|
-
/**
|
|
2079
|
-
* @deprecated use `onEdgesChange.add` instead
|
|
2080
|
-
*/
|
|
2081
|
-
this.onEdgeChangeAddSingle = outputFromObservable(this.singleChange(this.edgeChangesOfType('add')), {
|
|
2082
|
-
alias: 'onEdgesChange.add.single',
|
|
2290
|
+
this.edgesChangesAdd = outputFromObservable(this.edgeChangesOfType('add'), {
|
|
2291
|
+
alias: 'edgesChanges.add',
|
|
2083
2292
|
});
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
*/
|
|
2087
|
-
this.onEdgeChangeAddMany = outputFromObservable(this.manyChanges(this.edgeChangesOfType('add')), {
|
|
2088
|
-
alias: 'onEdgesChange.add.many',
|
|
2293
|
+
this.edgesChangesRemove = outputFromObservable(this.edgeChangesOfType('remove'), {
|
|
2294
|
+
alias: 'edgesChanges.remove',
|
|
2089
2295
|
});
|
|
2090
|
-
this.
|
|
2091
|
-
alias: '
|
|
2092
|
-
});
|
|
2093
|
-
/**
|
|
2094
|
-
* @deprecated use `onEdgesChange.remove` instead
|
|
2095
|
-
*/
|
|
2096
|
-
this.onEdgeChangeRemoveSingle = outputFromObservable(this.singleChange(this.edgeChangesOfType('remove')), {
|
|
2097
|
-
alias: 'onEdgesChange.remove.single',
|
|
2098
|
-
});
|
|
2099
|
-
/**
|
|
2100
|
-
* @deprecated use `onEdgesChange.remove` instead
|
|
2101
|
-
*/
|
|
2102
|
-
this.onEdgeChangeRemoveMany = outputFromObservable(this.manyChanges(this.edgeChangesOfType('remove')), {
|
|
2103
|
-
alias: 'onEdgesChange.remove.many',
|
|
2104
|
-
});
|
|
2105
|
-
this.onEdgeChangeSelect = outputFromObservable(this.edgeChangesOfType('select'), {
|
|
2106
|
-
alias: 'onEdgesChange.select',
|
|
2107
|
-
});
|
|
2108
|
-
/**
|
|
2109
|
-
* @deprecated use `onEdgesChange.select` instead
|
|
2110
|
-
*/
|
|
2111
|
-
this.onEdgeChangeSelectSingle = outputFromObservable(this.singleChange(this.edgeChangesOfType('select')), {
|
|
2112
|
-
alias: 'onEdgesChange.select.single',
|
|
2113
|
-
});
|
|
2114
|
-
/**
|
|
2115
|
-
* @deprecated use `onEdgesChange.select` instead
|
|
2116
|
-
*/
|
|
2117
|
-
this.onEdgeChangeSelectMany = outputFromObservable(this.manyChanges(this.edgeChangesOfType('select')), {
|
|
2118
|
-
alias: 'onEdgesChange.select.many',
|
|
2296
|
+
this.edgesChangesSelect = outputFromObservable(this.edgeChangesOfType('select'), {
|
|
2297
|
+
alias: 'edgesChanges.select',
|
|
2119
2298
|
});
|
|
2120
2299
|
}
|
|
2121
2300
|
nodeChangesOfType(type) {
|
|
@@ -2124,16 +2303,10 @@ class ChangesControllerDirective {
|
|
|
2124
2303
|
edgeChangesOfType(type) {
|
|
2125
2304
|
return this.edgesChangeService.changes$.pipe(map((changes) => changes.filter((c) => c.type === type)), filter((changes) => !!changes.length));
|
|
2126
2305
|
}
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
}
|
|
2130
|
-
manyChanges(changes$) {
|
|
2131
|
-
return changes$.pipe(filter((changes) => changes.length > 1));
|
|
2132
|
-
}
|
|
2133
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ChangesControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2134
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: ChangesControllerDirective, isStandalone: true, selector: "[changesController]", outputs: { onNodesChange: "onNodesChange", onNodesChangePosition: "onNodesChange.position", onNodesChangePositionSignle: "onNodesChange.position.single", onNodesChangePositionMany: "onNodesChange.position.many", onNodesChangeSize: "onNodesChange.size", onNodesChangeSizeSingle: "onNodesChange.size.single", onNodesChangeSizeMany: "onNodesChange.size.many", onNodesChangeAdd: "onNodesChange.add", onNodesChangeAddSingle: "onNodesChange.add.single", onNodesChangeAddMany: "onNodesChange.add.many", onNodesChangeRemove: "onNodesChange.remove", onNodesChangeRemoveSingle: "onNodesChange.remove.single", onNodesChangeRemoveMany: "onNodesChange.remove.many", onNodesChangeSelect: "onNodesChange.select", onNodesChangeSelectSingle: "onNodesChange.select.single", onNodesChangeSelectMany: "onNodesChange.select.many", onEdgesChange: "onEdgesChange", onNodesChangeDetached: "onEdgesChange.detached", onNodesChangeDetachedSingle: "onEdgesChange.detached.single", onNodesChangeDetachedMany: "onEdgesChange.detached.many", onEdgesChangeAdd: "onEdgesChange.add", onEdgeChangeAddSingle: "onEdgesChange.add.single", onEdgeChangeAddMany: "onEdgesChange.add.many", onEdgeChangeRemove: "onEdgesChange.remove", onEdgeChangeRemoveSingle: "onEdgesChange.remove.single", onEdgeChangeRemoveMany: "onEdgesChange.remove.many", onEdgeChangeSelect: "onEdgesChange.select", onEdgeChangeSelectSingle: "onEdgesChange.select.single", onEdgeChangeSelectMany: "onEdgesChange.select.many" }, ngImport: i0 }); }
|
|
2306
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ChangesControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2307
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: ChangesControllerDirective, isStandalone: true, selector: "[changesController]", outputs: { nodesChanges: "nodesChanges", nodesChangesPosition: "nodesChanges.position", nodesChangesSize: "nodesChanges.size", nodesChangesAdd: "nodesChanges.add", nodesChangesRemove: "nodesChanges.remove", nodesChangesSelect: "nodesChanges.select", edgesChanges: "edgesChanges", edgesChangesDetached: "edgesChanges.detached", edgesChangesAdd: "edgesChanges.add", edgesChangesRemove: "edgesChanges.remove", edgesChangesSelect: "edgesChanges.select" }, ngImport: i0 }); }
|
|
2135
2308
|
}
|
|
2136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ChangesControllerDirective, decorators: [{
|
|
2137
2310
|
type: Directive,
|
|
2138
2311
|
args: [{
|
|
2139
2312
|
selector: '[changesController]',
|
|
@@ -2185,10 +2358,10 @@ class RootPointerDirective {
|
|
|
2185
2358
|
setInitialTouch(event) {
|
|
2186
2359
|
this.initialTouch$.next(event);
|
|
2187
2360
|
}
|
|
2188
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2189
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2361
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootPointerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2362
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: RootPointerDirective, isStandalone: true, selector: "svg[rootPointer]", ngImport: i0 }); }
|
|
2190
2363
|
}
|
|
2191
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootPointerDirective, decorators: [{
|
|
2192
2365
|
type: Directive,
|
|
2193
2366
|
args: [{
|
|
2194
2367
|
standalone: true,
|
|
@@ -2201,20 +2374,24 @@ class SpacePointContextDirective {
|
|
|
2201
2374
|
this.pointerMovementDirective = inject(RootPointerDirective);
|
|
2202
2375
|
this.rootSvg = inject(RootSvgReferenceDirective).element;
|
|
2203
2376
|
this.host = inject(ElementRef).nativeElement;
|
|
2377
|
+
this.viewportService = inject(ViewportService);
|
|
2204
2378
|
/**
|
|
2205
2379
|
* Signal with current mouse position in svg space
|
|
2206
2380
|
*/
|
|
2207
2381
|
this.svgCurrentSpacePoint = computed(() => {
|
|
2208
|
-
|
|
2209
|
-
|
|
2382
|
+
// Add dependency on viewport to recalculate when auto-pan changes viewport
|
|
2383
|
+
// TODO: hacky solution, need to find a better way
|
|
2384
|
+
this.viewportService.readableViewport();
|
|
2385
|
+
const point = this.currentPoint();
|
|
2386
|
+
if (!point) {
|
|
2210
2387
|
return { x: 0, y: 0 };
|
|
2211
2388
|
}
|
|
2212
2389
|
return this.documentPointToFlowPoint({
|
|
2213
|
-
x:
|
|
2214
|
-
y:
|
|
2390
|
+
x: point.x,
|
|
2391
|
+
y: point.y,
|
|
2215
2392
|
});
|
|
2216
2393
|
});
|
|
2217
|
-
this.
|
|
2394
|
+
this.currentPoint = toSignal(this.pointerMovementDirective.pointerMovement$);
|
|
2218
2395
|
}
|
|
2219
2396
|
documentPointToFlowPoint(documentPoint) {
|
|
2220
2397
|
const point = this.rootSvg.createSVGPoint();
|
|
@@ -2222,10 +2399,10 @@ class SpacePointContextDirective {
|
|
|
2222
2399
|
point.y = documentPoint.y;
|
|
2223
2400
|
return point.matrixTransform(this.host.getScreenCTM().inverse());
|
|
2224
2401
|
}
|
|
2225
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2226
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpacePointContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2403
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: SpacePointContextDirective, isStandalone: true, selector: "g[spacePointContext]", ngImport: i0 }); }
|
|
2227
2404
|
}
|
|
2228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpacePointContextDirective, decorators: [{
|
|
2229
2406
|
type: Directive,
|
|
2230
2407
|
args: [{
|
|
2231
2408
|
standalone: true,
|
|
@@ -2266,8 +2443,8 @@ class OverlaysService {
|
|
|
2266
2443
|
removeToolbar(toolbar) {
|
|
2267
2444
|
this.toolbars.update((toolbars) => toolbars.filter((t) => t !== toolbar));
|
|
2268
2445
|
}
|
|
2269
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2270
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2446
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: OverlaysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2447
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: OverlaysService }); }
|
|
2271
2448
|
}
|
|
2272
2449
|
__decorate([
|
|
2273
2450
|
Microtask
|
|
@@ -2275,7 +2452,7 @@ __decorate([
|
|
|
2275
2452
|
__decorate([
|
|
2276
2453
|
Microtask
|
|
2277
2454
|
], OverlaysService.prototype, "removeToolbar", null);
|
|
2278
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: OverlaysService, decorators: [{
|
|
2279
2456
|
type: Injectable
|
|
2280
2457
|
}], propDecorators: { addToolbar: [], removeToolbar: [] } });
|
|
2281
2458
|
|
|
@@ -2349,26 +2526,34 @@ class EdgeLabelComponent {
|
|
|
2349
2526
|
},
|
|
2350
2527
|
};
|
|
2351
2528
|
}
|
|
2352
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2353
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2529
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2530
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EdgeLabelComponent, isStandalone: true, selector: "g[edgeLabel]", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, edgeModel: { classPropertyName: "edgeModel", publicName: "edgeModel", isSignal: true, isRequired: true, transformFunction: null }, point: { classPropertyName: "point", publicName: "point", isSignal: true, isRequired: false, transformFunction: null }, htmlTemplate: { classPropertyName: "htmlTemplate", publicName: "htmlTemplate", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "edgeLabelWrapperRef", first: true, predicate: ["edgeLabelWrapper"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (model(); as model) {\n @if (model.edgeLabel.type === 'html-template' && htmlTemplate()) {\n @if (htmlTemplate(); as htmlTemplate) {\n <svg:foreignObject\n [attr.x]=\"edgeLabelPoint().x\"\n [attr.y]=\"edgeLabelPoint().y\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\">\n <div #edgeLabelWrapper class=\"edge-label-wrapper\">\n <ng-container *ngTemplateOutlet=\"htmlTemplate; context: getLabelContext()\" />\n </div>\n </svg:foreignObject>\n }\n }\n\n @if (model.edgeLabel.type === 'default') {\n <svg:foreignObject\n [attr.x]=\"edgeLabelPoint().x\"\n [attr.y]=\"edgeLabelPoint().y\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\">\n <div #edgeLabelWrapper class=\"edge-label-wrapper\" [style]=\"edgeLabelStyle()\">\n {{ model.edgeLabel.text }}\n </div>\n </svg:foreignObject>\n }\n}\n", styles: [".edge-label-wrapper{width:max-content;margin-top:1px;margin-left:1px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2354
2531
|
}
|
|
2355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2532
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeLabelComponent, decorators: [{
|
|
2356
2533
|
type: Component,
|
|
2357
|
-
args: [{
|
|
2534
|
+
args: [{ selector: 'g[edgeLabel]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet], template: "@if (model(); as model) {\n @if (model.edgeLabel.type === 'html-template' && htmlTemplate()) {\n @if (htmlTemplate(); as htmlTemplate) {\n <svg:foreignObject\n [attr.x]=\"edgeLabelPoint().x\"\n [attr.y]=\"edgeLabelPoint().y\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\">\n <div #edgeLabelWrapper class=\"edge-label-wrapper\">\n <ng-container *ngTemplateOutlet=\"htmlTemplate; context: getLabelContext()\" />\n </div>\n </svg:foreignObject>\n }\n }\n\n @if (model.edgeLabel.type === 'default') {\n <svg:foreignObject\n [attr.x]=\"edgeLabelPoint().x\"\n [attr.y]=\"edgeLabelPoint().y\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\">\n <div #edgeLabelWrapper class=\"edge-label-wrapper\" [style]=\"edgeLabelStyle()\">\n {{ model.edgeLabel.text }}\n </div>\n </svg:foreignObject>\n }\n}\n", styles: [".edge-label-wrapper{width:max-content;margin-top:1px;margin-left:1px}\n"] }]
|
|
2358
2535
|
}] });
|
|
2359
2536
|
|
|
2360
2537
|
/**
|
|
2361
|
-
*
|
|
2362
|
-
*
|
|
2363
|
-
* it returns nodes where source === target and
|
|
2364
|
-
* handles where sourceHandle === targetHandle
|
|
2538
|
+
* Adjust connection direction based on handle types.
|
|
2539
|
+
*
|
|
2365
2540
|
*
|
|
2366
|
-
* This leads to that notSelfValidator returns false for these cases,
|
|
2367
|
-
* exactly what we need for strict connection type
|
|
2368
2541
|
*/
|
|
2369
2542
|
function adjustDirection(connection) {
|
|
2543
|
+
const sourceType = connection.sourceHandle.rawHandle.type;
|
|
2544
|
+
const targetType = connection.targetHandle.rawHandle.type;
|
|
2545
|
+
// If both handles are of the same type, preserve the original
|
|
2546
|
+
// source/target mapping
|
|
2547
|
+
if (sourceType === targetType) {
|
|
2548
|
+
return {
|
|
2549
|
+
source: connection.source,
|
|
2550
|
+
sourceHandle: connection.sourceHandle,
|
|
2551
|
+
target: connection.target,
|
|
2552
|
+
targetHandle: connection.targetHandle,
|
|
2553
|
+
};
|
|
2554
|
+
}
|
|
2370
2555
|
const result = {};
|
|
2371
|
-
if (
|
|
2556
|
+
if (sourceType === 'source') {
|
|
2372
2557
|
result.source = connection.source;
|
|
2373
2558
|
result.sourceHandle = connection.sourceHandle;
|
|
2374
2559
|
}
|
|
@@ -2376,7 +2561,7 @@ function adjustDirection(connection) {
|
|
|
2376
2561
|
result.source = connection.target;
|
|
2377
2562
|
result.sourceHandle = connection.targetHandle;
|
|
2378
2563
|
}
|
|
2379
|
-
if (
|
|
2564
|
+
if (targetType === 'target') {
|
|
2380
2565
|
result.target = connection.target;
|
|
2381
2566
|
result.targetHandle = connection.targetHandle;
|
|
2382
2567
|
}
|
|
@@ -2387,10 +2572,112 @@ function adjustDirection(connection) {
|
|
|
2387
2572
|
return result;
|
|
2388
2573
|
}
|
|
2389
2574
|
|
|
2575
|
+
function connectStartEventFromConnectionStartStatus(status) {
|
|
2576
|
+
return {
|
|
2577
|
+
node: status.payload.source.rawNode,
|
|
2578
|
+
handle: {
|
|
2579
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2580
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2581
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2582
|
+
},
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
2585
|
+
function connectEndEventFromConnectionReleaseValidatedStatus(status) {
|
|
2586
|
+
return {
|
|
2587
|
+
valid: status.payload.valid,
|
|
2588
|
+
from: {
|
|
2589
|
+
node: status.payload.source.rawNode,
|
|
2590
|
+
handle: {
|
|
2591
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2592
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2593
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2594
|
+
},
|
|
2595
|
+
},
|
|
2596
|
+
to: {
|
|
2597
|
+
node: status.payload.target.rawNode,
|
|
2598
|
+
handle: {
|
|
2599
|
+
id: status.payload.targetHandle.rawHandle.id,
|
|
2600
|
+
type: status.payload.targetHandle.rawHandle.type,
|
|
2601
|
+
position: status.payload.targetHandle.rawHandle.position,
|
|
2602
|
+
},
|
|
2603
|
+
},
|
|
2604
|
+
};
|
|
2605
|
+
}
|
|
2606
|
+
function connectEndEventFromConnectionDroppedStatus(status) {
|
|
2607
|
+
return {
|
|
2608
|
+
valid: null,
|
|
2609
|
+
from: {
|
|
2610
|
+
node: status.payload.source.rawNode,
|
|
2611
|
+
handle: {
|
|
2612
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2613
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2614
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2615
|
+
},
|
|
2616
|
+
},
|
|
2617
|
+
to: {
|
|
2618
|
+
node: null,
|
|
2619
|
+
handle: null,
|
|
2620
|
+
},
|
|
2621
|
+
};
|
|
2622
|
+
}
|
|
2623
|
+
function reconnectStartEventFromReconnectionStartStatus(status) {
|
|
2624
|
+
return {
|
|
2625
|
+
edge: status.payload.oldEdge.edge,
|
|
2626
|
+
node: status.payload.source.rawNode,
|
|
2627
|
+
handle: {
|
|
2628
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2629
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2630
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2631
|
+
},
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
function reconnectEndEventFromReconnectionReleaseValidatedStatus(status) {
|
|
2635
|
+
return {
|
|
2636
|
+
valid: status.payload.valid,
|
|
2637
|
+
edge: status.payload.oldEdge.edge,
|
|
2638
|
+
from: {
|
|
2639
|
+
node: status.payload.source.rawNode,
|
|
2640
|
+
handle: {
|
|
2641
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2642
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2643
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2644
|
+
},
|
|
2645
|
+
},
|
|
2646
|
+
to: {
|
|
2647
|
+
node: status.payload.target.rawNode,
|
|
2648
|
+
handle: {
|
|
2649
|
+
id: status.payload.targetHandle.rawHandle.id,
|
|
2650
|
+
type: status.payload.targetHandle.rawHandle.type,
|
|
2651
|
+
position: status.payload.targetHandle.rawHandle.position,
|
|
2652
|
+
},
|
|
2653
|
+
},
|
|
2654
|
+
};
|
|
2655
|
+
}
|
|
2656
|
+
function reconnectEndEventFromReconnectionDroppedStatus(status) {
|
|
2657
|
+
return {
|
|
2658
|
+
valid: null,
|
|
2659
|
+
edge: status.payload.oldEdge.edge,
|
|
2660
|
+
from: {
|
|
2661
|
+
node: status.payload.source.rawNode,
|
|
2662
|
+
handle: {
|
|
2663
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2664
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2665
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2666
|
+
},
|
|
2667
|
+
},
|
|
2668
|
+
to: {
|
|
2669
|
+
node: null,
|
|
2670
|
+
handle: null,
|
|
2671
|
+
},
|
|
2672
|
+
};
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2390
2675
|
class ConnectionControllerDirective {
|
|
2391
2676
|
constructor() {
|
|
2392
2677
|
this.statusService = inject(FlowStatusService);
|
|
2393
2678
|
this.flowEntitiesService = inject(FlowEntitiesService);
|
|
2679
|
+
// TODO emits duplicates when status degrades back to connection-start from connection-validation
|
|
2680
|
+
this.connectStart = outputFromObservable(this.statusService.status$.pipe(filter((status) => status.state === 'connection-start'), map(connectStartEventFromConnectionStartStatus)));
|
|
2394
2681
|
/**
|
|
2395
2682
|
* This event fires when user tries to create new Edge.
|
|
2396
2683
|
*
|
|
@@ -2398,25 +2685,24 @@ class ConnectionControllerDirective {
|
|
|
2398
2685
|
*
|
|
2399
2686
|
* Also it's important to note, that this event only fires when connection is valid by validator function in `ConnectionSettings`,
|
|
2400
2687
|
* by default without passing the validator every connection concidered valid.
|
|
2401
|
-
*
|
|
2402
|
-
* @deprecated use `connect` output instead
|
|
2403
|
-
*/
|
|
2404
|
-
// eslint-disable-next-line @angular-eslint/no-output-on-prefix
|
|
2405
|
-
this.onConnect = outputFromObservable(toObservable(this.statusService.status).pipe(filter((status) => status.state === 'connection-end'), map((status) => statusToConnection(status, this.isStrictMode())), tap(() => this.statusService.setIdleStatus()), filter((connection) => this.flowEntitiesService.connection().validator(connection))));
|
|
2406
|
-
this.connect = outputFromObservable(toObservable(this.statusService.status).pipe(filter((status) => status.state === 'connection-end'), map((status) => statusToConnection(status, this.isStrictMode())), tap(() => this.statusService.setIdleStatus()), filter((connection) => this.flowEntitiesService.connection().validator(connection))));
|
|
2407
|
-
/**
|
|
2408
|
-
* @deprecated use `reconnect` output instead
|
|
2409
2688
|
*/
|
|
2410
|
-
this.
|
|
2689
|
+
this.connect = outputFromObservable(this.statusService.status$.pipe(filter((status) => status.state === 'connection-release'), map((status) => statusToConnection(status, this.isStrictMode())), tap((connection) => {
|
|
2690
|
+
// We are 99% sure that status is FlowStatusConnectionRelease here
|
|
2691
|
+
const status = this.statusService.status();
|
|
2692
|
+
this.statusService.setConnectionReleaseValidatedStatus(status.payload.source, status.payload.target, status.payload.sourceHandle, status.payload.targetHandle, this.flowEntitiesService.connection().validator(connection));
|
|
2693
|
+
}), filter((connection) => this.flowEntitiesService.connection().validator(connection))));
|
|
2694
|
+
this.connectEnd = outputFromObservable(merge(this.statusService.status$.pipe(filter((status) => status.state === 'connection-release-validated'), map(connectEndEventFromConnectionReleaseValidatedStatus)), this.statusService.status$.pipe(filter((status) => status.state === 'connection-dropped'), map(connectEndEventFromConnectionDroppedStatus))).pipe(tap(() => this.statusService.setIdleStatus())));
|
|
2695
|
+
this.reconnectStart = outputFromObservable(this.statusService.status$.pipe(filter((status) => status.state === 'reconnection-start'), map(reconnectStartEventFromReconnectionStartStatus)));
|
|
2696
|
+
this.reconnect = outputFromObservable(toObservable(this.statusService.status).pipe(filter((status) => status.state === 'reconnection-release'), map((status) => {
|
|
2411
2697
|
const connection = statusToConnection(status, this.isStrictMode());
|
|
2412
2698
|
const oldEdge = status.payload.oldEdge.edge;
|
|
2413
2699
|
return { connection, oldEdge };
|
|
2414
|
-
}), tap((
|
|
2415
|
-
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2700
|
+
}), tap(({ connection }) => {
|
|
2701
|
+
// We are 99% sure that status is FlowStatusReconnectionRelease here
|
|
2702
|
+
const status = this.statusService.status();
|
|
2703
|
+
this.statusService.setReconnectionReleaseValidatedStatus(status.payload.source, status.payload.target, status.payload.sourceHandle, status.payload.targetHandle, status.payload.oldEdge, this.flowEntitiesService.connection().validator(connection));
|
|
2704
|
+
}), filter(({ connection }) => this.flowEntitiesService.connection().validator(connection))));
|
|
2705
|
+
this.reconnectEnd = outputFromObservable(merge(this.statusService.status$.pipe(filter((status) => status.state === 'reconnection-release-validated'), map(reconnectEndEventFromReconnectionReleaseValidatedStatus)), this.statusService.status$.pipe(filter((status) => status.state === 'reconnection-dropped'), map(reconnectEndEventFromReconnectionDroppedStatus))).pipe(tap(() => this.statusService.setIdleStatus())));
|
|
2420
2706
|
this.isStrictMode = computed(() => this.flowEntitiesService.connection().mode === 'strict');
|
|
2421
2707
|
}
|
|
2422
2708
|
startConnection(handle) {
|
|
@@ -2451,6 +2737,8 @@ class ConnectionControllerDirective {
|
|
|
2451
2737
|
target: target.rawNode.id,
|
|
2452
2738
|
sourceHandle: sourceHandle.rawHandle.id,
|
|
2453
2739
|
targetHandle: targetHandle.rawHandle.id,
|
|
2740
|
+
sourceHandleType: sourceHandle.rawHandle.type,
|
|
2741
|
+
targetHandleType: targetHandle.rawHandle.type,
|
|
2454
2742
|
});
|
|
2455
2743
|
// TODO: check how react flow handles highlight of handle
|
|
2456
2744
|
// if direction changes
|
|
@@ -2482,17 +2770,17 @@ class ConnectionControllerDirective {
|
|
|
2482
2770
|
const target = status.payload.target;
|
|
2483
2771
|
const targetHandle = status.payload.targetHandle;
|
|
2484
2772
|
isReconnection
|
|
2485
|
-
? this.statusService.
|
|
2486
|
-
: this.statusService.
|
|
2773
|
+
? this.statusService.setReconnectionReleaseStatus(source, target, sourceHandle, targetHandle, status.payload.oldEdge)
|
|
2774
|
+
: this.statusService.setConnectionReleaseStatus(source, target, sourceHandle, targetHandle);
|
|
2487
2775
|
}
|
|
2488
2776
|
}
|
|
2489
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2490
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2777
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2778
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: ConnectionControllerDirective, isStandalone: true, selector: "[connectStart], [connect], [connectEnd], [reconnectStart], [reconnect], [reconnectEnd]", outputs: { connectStart: "connectStart", connect: "connect", connectEnd: "connectEnd", reconnectStart: "reconnectStart", reconnect: "reconnect", reconnectEnd: "reconnectEnd" }, ngImport: i0 }); }
|
|
2491
2779
|
}
|
|
2492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2780
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionControllerDirective, decorators: [{
|
|
2493
2781
|
type: Directive,
|
|
2494
2782
|
args: [{
|
|
2495
|
-
selector: '[
|
|
2783
|
+
selector: '[connectStart], [connect], [connectEnd], [reconnectStart], [reconnect], [reconnectEnd]',
|
|
2496
2784
|
standalone: true,
|
|
2497
2785
|
}]
|
|
2498
2786
|
}] });
|
|
@@ -2522,6 +2810,8 @@ function statusToConnection(status, isStrictMode) {
|
|
|
2522
2810
|
target: targetId,
|
|
2523
2811
|
sourceHandle: sourceHandleId,
|
|
2524
2812
|
targetHandle: targetHandleId,
|
|
2813
|
+
sourceHandleType: sourceHandle.rawHandle.type,
|
|
2814
|
+
targetHandleType: targetHandle.rawHandle.type,
|
|
2525
2815
|
};
|
|
2526
2816
|
}
|
|
2527
2817
|
|
|
@@ -2554,10 +2844,10 @@ class EdgeRenderingService {
|
|
|
2554
2844
|
// pull node
|
|
2555
2845
|
edge.renderOrder.set(this.maxOrder() + 1);
|
|
2556
2846
|
}
|
|
2557
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2558
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2847
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeRenderingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2848
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeRenderingService }); }
|
|
2559
2849
|
}
|
|
2560
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2850
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeRenderingService, decorators: [{
|
|
2561
2851
|
type: Injectable
|
|
2562
2852
|
}] });
|
|
2563
2853
|
|
|
@@ -2617,10 +2907,10 @@ class PointerDirective {
|
|
|
2617
2907
|
this.wasPointerOver = false;
|
|
2618
2908
|
}
|
|
2619
2909
|
}
|
|
2620
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2621
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2910
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PointerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2911
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: PointerDirective, isStandalone: true, selector: "[pointerStart], [pointerEnd], [pointerOver], [pointerOut]", outputs: { pointerOver: "pointerOver", pointerOut: "pointerOut", pointerStart: "pointerStart", pointerEnd: "pointerEnd" }, host: { listeners: { "mousedown": "onPointerStart($event)", "touchstart": "onPointerStart($event)", "mouseup": "onPointerEnd($event)", "mouseover": "onMouseOver($event)", "mouseout": "onMouseOut($event)" } }, ngImport: i0 }); }
|
|
2622
2912
|
}
|
|
2623
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PointerDirective, decorators: [{
|
|
2624
2914
|
type: Directive,
|
|
2625
2915
|
args: [{
|
|
2626
2916
|
standalone: true,
|
|
@@ -2676,15 +2966,15 @@ class EdgeComponent {
|
|
|
2676
2966
|
event.stopPropagation();
|
|
2677
2967
|
this.connectionController?.startReconnection(handle, this.model());
|
|
2678
2968
|
}
|
|
2679
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2680
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2969
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2970
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EdgeComponent, isStandalone: true, selector: "g[edge]", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, edgeTemplate: { classPropertyName: "edgeTemplate", publicName: "edgeTemplate", isSignal: true, isRequired: false, transformFunction: null }, edgeLabelHtmlTemplate: { classPropertyName: "edgeLabelHtmlTemplate", publicName: "edgeLabelHtmlTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.visibility": "isReconnecting() ? \"hidden\" : \"visible\"" }, classAttribute: "selectable" }, ngImport: i0, template: "@if (model().type === 'default') {\n <svg:path\n class=\"edge\"\n [attr.d]=\"model().path().path\"\n [attr.marker-start]=\"model().markerStartUrl()\"\n [attr.marker-end]=\"model().markerEndUrl()\"\n [class.edge_selected]=\"model().selected()\" />\n\n <svg:path class=\"interactive-edge\" [attr.d]=\"model().path().path\" (click)=\"select(); pull()\" />\n}\n\n@if (model().type === 'template' && edgeTemplate()) {\n @if (edgeTemplate(); as edgeTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"edgeTemplate\"\n [ngTemplateOutletContext]=\"model().context\"\n [ngTemplateOutletInjector]=\"injector\" />\n }\n}\n\n@if (model().labelModels().start; as label) {\n @if (model().path().labelPoints?.start; as point) {\n <svg:g edgeLabel [model]=\"label\" [point]=\"point\" [edgeModel]=\"model()\" [htmlTemplate]=\"edgeLabelHtmlTemplate()\" />\n }\n}\n\n@if (model().labelModels().center; as label) {\n @if (model().path().labelPoints?.center; as point) {\n <svg:g edgeLabel [model]=\"label\" [point]=\"point\" [edgeModel]=\"model()\" [htmlTemplate]=\"edgeLabelHtmlTemplate()\" />\n }\n}\n\n@if (model().labelModels().end; as label) {\n @if (model().path().labelPoints?.end; as point) {\n <svg:g edgeLabel [model]=\"label\" [point]=\"point\" [edgeModel]=\"model()\" [htmlTemplate]=\"edgeLabelHtmlTemplate()\" />\n }\n}\n\n@if (model().sourceHandle() && model().targetHandle()) {\n @if (model().reconnectable() === true || model().reconnectable() === 'source') {\n <svg:circle\n class=\"reconnect-handle\"\n r=\"10\"\n [attr.cx]=\"model().sourceHandle()!.pointAbsolute().x\"\n [attr.cy]=\"model().sourceHandle()!.pointAbsolute().y\"\n (pointerStart)=\"startReconnection($event, model().targetHandle()!)\" />\n }\n\n @if (model().reconnectable() === true || model().reconnectable() === 'target') {\n <svg:circle\n class=\"reconnect-handle\"\n r=\"10\"\n [attr.cx]=\"model().targetHandle()!.pointAbsolute().x\"\n [attr.cy]=\"model().targetHandle()!.pointAbsolute().y\"\n (pointerStart)=\"startReconnection($event, model().sourceHandle()!)\" />\n }\n}\n", styles: [".edge{fill:none;stroke-width:2;stroke:#b1b1b7}.edge_selected{stroke-width:2.5;stroke:#0f4c75}.interactive-edge{fill:none;stroke-width:20;stroke:transparent}.reconnect-handle{fill:transparent;cursor:move}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: EdgeLabelComponent, selector: "g[edgeLabel]", inputs: ["model", "edgeModel", "point", "htmlTemplate"] }, { kind: "directive", type: PointerDirective, selector: "[pointerStart], [pointerEnd], [pointerOver], [pointerOut]", outputs: ["pointerOver", "pointerOut", "pointerStart", "pointerEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2681
2971
|
}
|
|
2682
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2972
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeComponent, decorators: [{
|
|
2683
2973
|
type: Component,
|
|
2684
|
-
args: [{
|
|
2974
|
+
args: [{ selector: 'g[edge]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
2685
2975
|
class: 'selectable',
|
|
2686
2976
|
'[style.visibility]': 'isReconnecting() ? "hidden" : "visible"',
|
|
2687
|
-
}, imports: [NgTemplateOutlet, EdgeLabelComponent, PointerDirective], template: "@if (model().type === 'default') {\n <svg:path\n class=\"edge\"\n [attr.d]=\"model().path().path\"\n [attr.marker-start]=\"model().markerStartUrl()\"\n [attr.marker-end]=\"model().markerEndUrl()\"\n [class.edge_selected]=\"model().selected()\" />\n\n <svg:path class=\"interactive-edge\" [attr.d]=\"model().path().path\" (click)=\"select(); pull()\" />\n}\n\n@if (model().type === 'template' && edgeTemplate()) {\n @if (edgeTemplate(); as edgeTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"edgeTemplate\"\n [ngTemplateOutletContext]=\"model().context\"\n [ngTemplateOutletInjector]=\"injector\" />\n }\n}\n\n@if (model().
|
|
2977
|
+
}, imports: [NgTemplateOutlet, EdgeLabelComponent, PointerDirective], template: "@if (model().type === 'default') {\n <svg:path\n class=\"edge\"\n [attr.d]=\"model().path().path\"\n [attr.marker-start]=\"model().markerStartUrl()\"\n [attr.marker-end]=\"model().markerEndUrl()\"\n [class.edge_selected]=\"model().selected()\" />\n\n <svg:path class=\"interactive-edge\" [attr.d]=\"model().path().path\" (click)=\"select(); pull()\" />\n}\n\n@if (model().type === 'template' && edgeTemplate()) {\n @if (edgeTemplate(); as edgeTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"edgeTemplate\"\n [ngTemplateOutletContext]=\"model().context\"\n [ngTemplateOutletInjector]=\"injector\" />\n }\n}\n\n@if (model().labelModels().start; as label) {\n @if (model().path().labelPoints?.start; as point) {\n <svg:g edgeLabel [model]=\"label\" [point]=\"point\" [edgeModel]=\"model()\" [htmlTemplate]=\"edgeLabelHtmlTemplate()\" />\n }\n}\n\n@if (model().labelModels().center; as label) {\n @if (model().path().labelPoints?.center; as point) {\n <svg:g edgeLabel [model]=\"label\" [point]=\"point\" [edgeModel]=\"model()\" [htmlTemplate]=\"edgeLabelHtmlTemplate()\" />\n }\n}\n\n@if (model().labelModels().end; as label) {\n @if (model().path().labelPoints?.end; as point) {\n <svg:g edgeLabel [model]=\"label\" [point]=\"point\" [edgeModel]=\"model()\" [htmlTemplate]=\"edgeLabelHtmlTemplate()\" />\n }\n}\n\n@if (model().sourceHandle() && model().targetHandle()) {\n @if (model().reconnectable() === true || model().reconnectable() === 'source') {\n <svg:circle\n class=\"reconnect-handle\"\n r=\"10\"\n [attr.cx]=\"model().sourceHandle()!.pointAbsolute().x\"\n [attr.cy]=\"model().sourceHandle()!.pointAbsolute().y\"\n (pointerStart)=\"startReconnection($event, model().targetHandle()!)\" />\n }\n\n @if (model().reconnectable() === true || model().reconnectable() === 'target') {\n <svg:circle\n class=\"reconnect-handle\"\n r=\"10\"\n [attr.cx]=\"model().targetHandle()!.pointAbsolute().x\"\n [attr.cy]=\"model().targetHandle()!.pointAbsolute().y\"\n (pointerStart)=\"startReconnection($event, model().sourceHandle()!)\" />\n }\n}\n", styles: [".edge{fill:none;stroke-width:2;stroke:#b1b1b7}.edge_selected{stroke-width:2.5;stroke:#0f4c75}.interactive-edge{fill:none;stroke-width:20;stroke:transparent}.reconnect-handle{fill:transparent;cursor:move}\n"] }]
|
|
2688
2978
|
}] });
|
|
2689
2979
|
|
|
2690
2980
|
class HandleService {
|
|
@@ -2703,13 +2993,13 @@ class HandleService {
|
|
|
2703
2993
|
node.handles.update((handles) => handles.filter((handle) => handle !== handleToDestoy));
|
|
2704
2994
|
}
|
|
2705
2995
|
}
|
|
2706
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2707
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2996
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2997
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleService }); }
|
|
2708
2998
|
}
|
|
2709
2999
|
__decorate([
|
|
2710
3000
|
Microtask // TODO fixes rendering of handle for group node
|
|
2711
3001
|
], HandleService.prototype, "createHandle", null);
|
|
2712
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3002
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleService, decorators: [{
|
|
2713
3003
|
type: Injectable
|
|
2714
3004
|
}], propDecorators: { createHandle: [] } });
|
|
2715
3005
|
|
|
@@ -2729,10 +3019,10 @@ class HandleSizeControllerDirective {
|
|
|
2729
3019
|
height: rect.height + stroke,
|
|
2730
3020
|
});
|
|
2731
3021
|
}
|
|
2732
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2733
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
3022
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleSizeControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3023
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: HandleSizeControllerDirective, isStandalone: true, selector: "[handleSizeController]", inputs: { handleModel: { classPropertyName: "handleModel", publicName: "handleSizeController", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
2734
3024
|
}
|
|
2735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3025
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleSizeControllerDirective, decorators: [{
|
|
2736
3026
|
type: Directive,
|
|
2737
3027
|
args: [{
|
|
2738
3028
|
standalone: true,
|
|
@@ -2756,10 +3046,10 @@ class DefaultNodeComponent {
|
|
|
2756
3046
|
constructor() {
|
|
2757
3047
|
this.selected = input(false);
|
|
2758
3048
|
}
|
|
2759
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2760
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
3049
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefaultNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3050
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: DefaultNodeComponent, isStandalone: true, selector: "default-node", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.selected": "selected()" } }, ngImport: i0, template: "<ng-content />\n", styles: [":host{border:1.5px solid #1b262c;border-radius:5px;display:flex;align-items:center;justify-content:center;color:#000;background-color:#fff}:host(.selected){border-width:2px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2761
3051
|
}
|
|
2762
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3052
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefaultNodeComponent, decorators: [{
|
|
2763
3053
|
type: Component,
|
|
2764
3054
|
args: [{ standalone: true, selector: 'default-node', host: {
|
|
2765
3055
|
'[class.selected]': 'selected()',
|
|
@@ -2946,15 +3236,15 @@ class ResizableComponent {
|
|
|
2946
3236
|
}
|
|
2947
3237
|
}
|
|
2948
3238
|
}
|
|
2949
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2950
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
3239
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ResizableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3240
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.17", type: ResizableComponent, isStandalone: true, selector: "[resizable]", inputs: { resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, resizerColor: { classPropertyName: "resizerColor", publicName: "resizerColor", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "resizer", first: true, predicate: ["resizer"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #resizer>\n <svg:g>\n <!-- top line -->\n <svg:line\n class=\"top\"\n stroke-width=\"2\"\n [attr.x1]=\"lineGap\"\n [attr.y1]=\"-gap()\"\n [attr.x2]=\"model.size().width - lineGap\"\n [attr.y2]=\"-gap()\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('top', $event)\" />\n <!-- Left line -->\n <svg:line\n class=\"left\"\n stroke-width=\"2\"\n [attr.x1]=\"-gap()\"\n [attr.y1]=\"lineGap\"\n [attr.x2]=\"-gap()\"\n [attr.y2]=\"model.size().height - lineGap\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('left', $event)\" />\n <!-- Bottom line -->\n <svg:line\n class=\"bottom\"\n stroke-width=\"2\"\n [attr.x1]=\"lineGap\"\n [attr.y1]=\"model.size().height + gap()\"\n [attr.x2]=\"model.size().width - lineGap\"\n [attr.y2]=\"model.size().height + gap()\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('bottom', $event)\" />\n <!-- Right line -->\n <svg:line\n class=\"right\"\n stroke-width=\"2\"\n [attr.x1]=\"model.size().width + gap()\"\n [attr.y1]=\"lineGap\"\n [attr.x2]=\"model.size().width + gap()\"\n [attr.y2]=\"model.size().height - lineGap\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('right', $event)\" />\n\n <!-- Top Left -->\n <svg:rect\n class=\"top-left\"\n [attr.x]=\"-(handleSize / 2) - gap()\"\n [attr.y]=\"-(handleSize / 2) - gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('top-left', $event)\" />\n\n <!-- Top right -->\n <svg:rect\n class=\"top-right\"\n [attr.x]=\"model.size().width - handleSize / 2 + gap()\"\n [attr.y]=\"-(handleSize / 2) - gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('top-right', $event)\" />\n\n <!-- Bottom left -->\n <svg:rect\n class=\"bottom-left\"\n [attr.x]=\"-(handleSize / 2) - gap()\"\n [attr.y]=\"model.size().height - handleSize / 2 + gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('bottom-left', $event)\" />\n\n <!-- Bottom right -->\n <svg:rect\n class=\"bottom-right\"\n [attr.x]=\"model.size().width - handleSize / 2 + gap()\"\n [attr.y]=\"model.size().height - handleSize / 2 + gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('bottom-right', $event)\" />\n </svg:g>\n</ng-template>\n\n<ng-content />\n", styles: [".top{cursor:n-resize}.left{cursor:w-resize}.right{cursor:e-resize}.bottom{cursor:s-resize}.top-left{cursor:nw-resize}.top-right{cursor:ne-resize}.bottom-left{cursor:sw-resize}.bottom-right{cursor:se-resize}\n"], dependencies: [{ kind: "directive", type: PointerDirective, selector: "[pointerStart], [pointerEnd], [pointerOver], [pointerOut]", outputs: ["pointerOver", "pointerOut", "pointerStart", "pointerEnd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2951
3241
|
}
|
|
2952
3242
|
__decorate([
|
|
2953
3243
|
Microtask
|
|
2954
3244
|
], ResizableComponent.prototype, "ngAfterViewInit", null);
|
|
2955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3245
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ResizableComponent, decorators: [{
|
|
2956
3246
|
type: Component,
|
|
2957
|
-
args: [{
|
|
3247
|
+
args: [{ selector: '[resizable]', imports: [PointerDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #resizer>\n <svg:g>\n <!-- top line -->\n <svg:line\n class=\"top\"\n stroke-width=\"2\"\n [attr.x1]=\"lineGap\"\n [attr.y1]=\"-gap()\"\n [attr.x2]=\"model.size().width - lineGap\"\n [attr.y2]=\"-gap()\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('top', $event)\" />\n <!-- Left line -->\n <svg:line\n class=\"left\"\n stroke-width=\"2\"\n [attr.x1]=\"-gap()\"\n [attr.y1]=\"lineGap\"\n [attr.x2]=\"-gap()\"\n [attr.y2]=\"model.size().height - lineGap\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('left', $event)\" />\n <!-- Bottom line -->\n <svg:line\n class=\"bottom\"\n stroke-width=\"2\"\n [attr.x1]=\"lineGap\"\n [attr.y1]=\"model.size().height + gap()\"\n [attr.x2]=\"model.size().width - lineGap\"\n [attr.y2]=\"model.size().height + gap()\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('bottom', $event)\" />\n <!-- Right line -->\n <svg:line\n class=\"right\"\n stroke-width=\"2\"\n [attr.x1]=\"model.size().width + gap()\"\n [attr.y1]=\"lineGap\"\n [attr.x2]=\"model.size().width + gap()\"\n [attr.y2]=\"model.size().height - lineGap\"\n [attr.stroke]=\"resizerColor()\"\n (pointerStart)=\"startResize('right', $event)\" />\n\n <!-- Top Left -->\n <svg:rect\n class=\"top-left\"\n [attr.x]=\"-(handleSize / 2) - gap()\"\n [attr.y]=\"-(handleSize / 2) - gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('top-left', $event)\" />\n\n <!-- Top right -->\n <svg:rect\n class=\"top-right\"\n [attr.x]=\"model.size().width - handleSize / 2 + gap()\"\n [attr.y]=\"-(handleSize / 2) - gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('top-right', $event)\" />\n\n <!-- Bottom left -->\n <svg:rect\n class=\"bottom-left\"\n [attr.x]=\"-(handleSize / 2) - gap()\"\n [attr.y]=\"model.size().height - handleSize / 2 + gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('bottom-left', $event)\" />\n\n <!-- Bottom right -->\n <svg:rect\n class=\"bottom-right\"\n [attr.x]=\"model.size().width - handleSize / 2 + gap()\"\n [attr.y]=\"model.size().height - handleSize / 2 + gap()\"\n [attr.width]=\"handleSize\"\n [attr.height]=\"handleSize\"\n [attr.fill]=\"resizerColor()\"\n (pointerStart)=\"startResize('bottom-right', $event)\" />\n </svg:g>\n</ng-template>\n\n<ng-content />\n", styles: [".top{cursor:n-resize}.left{cursor:w-resize}.right{cursor:e-resize}.bottom{cursor:s-resize}.top-left{cursor:nw-resize}.top-right{cursor:ne-resize}.bottom-left{cursor:sw-resize}.bottom-right{cursor:se-resize}\n"] }]
|
|
2958
3248
|
}], ctorParameters: () => [], propDecorators: { ngAfterViewInit: [] } });
|
|
2959
3249
|
function calcOffset(movementX, movementY, zoom) {
|
|
2960
3250
|
return {
|
|
@@ -3159,10 +3449,10 @@ class HandleComponent {
|
|
|
3159
3449
|
}
|
|
3160
3450
|
});
|
|
3161
3451
|
}
|
|
3162
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3163
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
3452
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3453
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: HandleComponent, isStandalone: true, selector: "handle", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, offsetX: { classPropertyName: "offsetX", publicName: "offsetX", isSignal: true, isRequired: false, transformFunction: null }, offsetY: { classPropertyName: "offsetY", publicName: "offsetY", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3164
3454
|
}
|
|
3165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleComponent, decorators: [{
|
|
3166
3456
|
type: Component,
|
|
3167
3457
|
args: [{ standalone: true, selector: 'handle', changeDetection: ChangeDetectionStrategy.OnPush, template: "" }]
|
|
3168
3458
|
}] });
|
|
@@ -3183,10 +3473,10 @@ class NodeHandlesControllerDirective {
|
|
|
3183
3473
|
}), takeUntilDestroyed(this.destroyRef))
|
|
3184
3474
|
.subscribe();
|
|
3185
3475
|
}
|
|
3186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3187
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3476
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeHandlesControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3477
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: NodeHandlesControllerDirective, isStandalone: true, selector: "[nodeHandlesController]", ngImport: i0 }); }
|
|
3188
3478
|
}
|
|
3189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3479
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeHandlesControllerDirective, decorators: [{
|
|
3190
3480
|
type: Directive,
|
|
3191
3481
|
args: [{
|
|
3192
3482
|
selector: '[nodeHandlesController]',
|
|
@@ -3214,10 +3504,10 @@ class NodeResizeControllerDirective {
|
|
|
3214
3504
|
}), takeUntilDestroyed(this.destroyRef))
|
|
3215
3505
|
.subscribe();
|
|
3216
3506
|
}
|
|
3217
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3218
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3507
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeResizeControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3508
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: NodeResizeControllerDirective, isStandalone: true, selector: "[nodeResizeController]", ngImport: i0 }); }
|
|
3219
3509
|
}
|
|
3220
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeResizeControllerDirective, decorators: [{
|
|
3221
3511
|
type: Directive,
|
|
3222
3512
|
args: [{
|
|
3223
3513
|
selector: '[nodeResizeController]',
|
|
@@ -3290,12 +3580,12 @@ class NodeComponent {
|
|
|
3290
3580
|
this.selectionService.select(this.model());
|
|
3291
3581
|
}
|
|
3292
3582
|
}
|
|
3293
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3294
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3583
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3584
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: NodeComponent, isStandalone: true, selector: "g[node]", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, nodeTemplate: { classPropertyName: "nodeTemplate", publicName: "nodeTemplate", isSignal: true, isRequired: false, transformFunction: null }, nodeSvgTemplate: { classPropertyName: "nodeSvgTemplate", publicName: "nodeSvgTemplate", isSignal: true, isRequired: false, transformFunction: null }, groupNodeTemplate: { classPropertyName: "groupNodeTemplate", publicName: "groupNodeTemplate", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "vflow-node" }, providers: [HandleService, NodeAccessorService], ngImport: i0, template: "<!-- Default node -->\n@if (model().rawNode.type === 'default') {\n <svg:foreignObject\n class=\"selectable\"\n [attr.width]=\"model().foWidth()\"\n [attr.height]=\"model().foHeight()\"\n (click)=\"pullNode(); selectNode()\">\n <default-node\n nodeHandlesController\n [selected]=\"model().selected()\"\n [style.width]=\"model().styleWidth()\"\n [style.height]=\"model().styleHeight()\"\n [style.max-width]=\"model().styleWidth()\"\n [style.max-height]=\"model().styleHeight()\">\n <div [outerHTML]=\"model().text()\"></div>\n\n <handle type=\"source\" position=\"right\" />\n <handle type=\"target\" position=\"left\" />\n </default-node>\n </svg:foreignObject>\n}\n\n<!-- HTML Template node -->\n@if (model().rawNode.type === 'html-template' && nodeTemplate()) {\n <svg:foreignObject\n class=\"selectable\"\n [attr.width]=\"model().foWidth()\"\n [attr.height]=\"model().foHeight()\"\n (click)=\"pullNode()\">\n <div\n nodeHandlesController\n nodeResizeController\n class=\"wrapper\"\n [style.width]=\"model().styleWidth()\"\n [style.height]=\"model().styleHeight()\">\n <ng-container\n [ngTemplateOutlet]=\"nodeTemplate() ?? null\"\n [ngTemplateOutletContext]=\"model().context\"\n [ngTemplateOutletInjector]=\"injector\" />\n </div>\n </svg:foreignObject>\n}\n\n<!-- SVG Template node -->\n@if (model().rawNode.type === 'svg-template' && nodeSvgTemplate()) {\n <svg:g class=\"selectable\" nodeHandlesController (click)=\"pullNode()\">\n <ng-container\n [ngTemplateOutlet]=\"nodeSvgTemplate() ?? null\"\n [ngTemplateOutletContext]=\"model().context\"\n [ngTemplateOutletInjector]=\"injector\" />\n </svg:g>\n}\n\n<!-- Component node -->\n@if (model().isComponentType) {\n @if (model().componentInstance$ | async; as component) {\n <svg:foreignObject\n class=\"selectable\"\n [attr.width]=\"model().foWidth()\"\n [attr.height]=\"model().foHeight()\"\n (click)=\"pullNode()\">\n <div\n nodeHandlesController\n nodeResizeController\n class=\"wrapper\"\n [style.width]=\"model().styleWidth()\"\n [style.height]=\"model().styleHeight()\">\n <ng-container\n [ngComponentOutlet]=\"$any(component)\"\n [ngComponentOutletInputs]=\"model().componentTypeInputs\"\n [ngComponentOutletInjector]=\"injector\" />\n </div>\n </svg:foreignObject>\n }\n}\n\n<!-- Default group node -->\n@if (model().rawNode.type === 'default-group') {\n <svg:rect\n class=\"default-group-node\"\n rx=\"5\"\n ry=\"5\"\n [resizable]=\"model().resizable()\"\n [gap]=\"3\"\n [resizerColor]=\"model().color()\"\n [class.default-group-node_selected]=\"model().selected()\"\n [attr.width]=\"model().size().width\"\n [attr.height]=\"model().size().height\"\n [style.stroke]=\"model().color()\"\n [style.fill]=\"model().color()\"\n (click)=\"pullNode(); selectNode()\" />\n}\n\n<!-- Template group node -->\n@if (model().rawNode.type === 'template-group' && groupNodeTemplate()) {\n <svg:g class=\"selectable\" nodeHandlesController (click)=\"pullNode()\">\n <ng-container\n [ngTemplateOutlet]=\"groupNodeTemplate() ?? null\"\n [ngTemplateOutletContext]=\"model().context\"\n [ngTemplateOutletInjector]=\"injector\" />\n </svg:g>\n}\n\n<!-- Resizer -->\n@if (model().resizerTemplate(); as template) {\n @if (model().resizable()) {\n <ng-template [ngTemplateOutlet]=\"template\" />\n }\n}\n\n<!-- Handles -->\n@for (handle of model().handles(); track handle) {\n @if (handle.template === undefined) {\n <svg:circle\n class=\"default-handle\"\n r=\"5\"\n [attr.cx]=\"handle.hostOffset().x\"\n [attr.cy]=\"handle.hostOffset().y\"\n [attr.stroke-width]=\"handle.strokeWidth\"\n (pointerStart)=\"startConnection($event, handle)\"\n (pointerEnd)=\"endConnection()\" />\n }\n\n @if (handle.template === null) {\n <svg:g\n [handleSizeController]=\"handle\"\n (pointerStart)=\"startConnection($event, handle)\"\n (pointerEnd)=\"endConnection()\" />\n }\n\n @if (handle.template) {\n <svg:g\n [handleSizeController]=\"handle\"\n (pointerStart)=\"startConnection($event, handle)\"\n (pointerEnd)=\"endConnection()\">\n <ng-container *ngTemplateOutlet=\"handle.template; context: handle.templateContext\" />\n </svg:g>\n }\n\n @if (showMagnet()) {\n <svg:circle\n class=\"magnet\"\n [attr.r]=\"model().magnetRadius\"\n [attr.cx]=\"handle.hostOffset().x\"\n [attr.cy]=\"handle.hostOffset().y\"\n (pointerEnd)=\"endConnection(); resetValidateConnection(handle)\"\n (pointerOver)=\"validateConnection(handle)\"\n (pointerOut)=\"resetValidateConnection(handle)\" />\n }\n}\n\n<!-- Toolbar -->\n@for (toolbar of toolbars(); track toolbar) {\n <svg:foreignObject\n [attr.width]=\"toolbar.size().width\"\n [attr.height]=\"toolbar.size().height\"\n [attr.transform]=\"toolbar.transform()\">\n <ng-container [ngTemplateOutlet]=\"toolbar.template()\" />\n </svg:foreignObject>\n}\n", styles: [".magnet{opacity:0}.wrapper{display:table-cell}.default-group-node{stroke-width:1.5px;fill-opacity:.05}.default-group-node_selected{stroke-width:2px}.default-handle{stroke:#fff;fill:#1b262c}\n"], dependencies: [{ kind: "directive", type: PointerDirective, selector: "[pointerStart], [pointerEnd], [pointerOver], [pointerOut]", outputs: ["pointerOver", "pointerOut", "pointerStart", "pointerEnd"] }, { kind: "component", type: DefaultNodeComponent, selector: "default-node", inputs: ["selected"] }, { kind: "component", type: HandleComponent, selector: "handle", inputs: ["position", "type", "id", "template", "offsetX", "offsetY"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: ResizableComponent, selector: "[resizable]", inputs: ["resizable", "resizerColor", "gap"] }, { kind: "directive", type: HandleSizeControllerDirective, selector: "[handleSizeController]", inputs: ["handleSizeController"] }, { kind: "directive", type: NodeHandlesControllerDirective, selector: "[nodeHandlesController]" }, { kind: "directive", type: NodeResizeControllerDirective, selector: "[nodeResizeController]" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3295
3585
|
}
|
|
3296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3586
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeComponent, decorators: [{
|
|
3297
3587
|
type: Component,
|
|
3298
|
-
args: [{
|
|
3588
|
+
args: [{ selector: 'g[node]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [HandleService, NodeAccessorService], host: {
|
|
3299
3589
|
class: 'vflow-node',
|
|
3300
3590
|
}, imports: [
|
|
3301
3591
|
PointerDirective,
|
|
@@ -3398,8 +3688,8 @@ class ConnectionComponent {
|
|
|
3398
3688
|
allNodes: this.flowEntitiesService.rawNodes(),
|
|
3399
3689
|
};
|
|
3400
3690
|
}
|
|
3401
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3402
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3691
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3692
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: ConnectionComponent, isStandalone: true, selector: "g[connection]", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
3403
3693
|
@if (model().type === 'default') {
|
|
3404
3694
|
@if (path(); as path) {
|
|
3405
3695
|
<svg:path
|
|
@@ -3418,10 +3708,9 @@ class ConnectionComponent {
|
|
|
3418
3708
|
}
|
|
3419
3709
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3420
3710
|
}
|
|
3421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3711
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionComponent, decorators: [{
|
|
3422
3712
|
type: Component,
|
|
3423
3713
|
args: [{
|
|
3424
|
-
standalone: true,
|
|
3425
3714
|
selector: 'g[connection]',
|
|
3426
3715
|
template: `
|
|
3427
3716
|
@if (model().type === 'default') {
|
|
@@ -3560,10 +3849,10 @@ class BackgroundComponent {
|
|
|
3560
3849
|
}
|
|
3561
3850
|
});
|
|
3562
3851
|
}
|
|
3563
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3564
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3852
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3853
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: BackgroundComponent, isStandalone: true, selector: "g[background]", ngImport: i0, template: "@if (backgroundSignal().type === 'dots') {\n <svg:pattern\n patternUnits=\"userSpaceOnUse\"\n [attr.id]=\"patternId\"\n [attr.x]=\"x()\"\n [attr.y]=\"y()\"\n [attr.width]=\"scaledGap()\"\n [attr.height]=\"scaledGap()\">\n <svg:circle\n [attr.cx]=\"patternSize()\"\n [attr.cy]=\"patternSize()\"\n [attr.r]=\"patternSize()\"\n [attr.fill]=\"patternColor()\" />\n </svg:pattern>\n\n <svg:rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" [attr.fill]=\"patternUrl\" />\n}\n\n@if (backgroundSignal().type === 'image') {\n @if (repeated()) {\n <svg:pattern\n patternUnits=\"userSpaceOnUse\"\n [attr.id]=\"patternId\"\n [attr.x]=\"imageX()\"\n [attr.y]=\"imageY()\"\n [attr.width]=\"scaledImageWidth()\"\n [attr.height]=\"scaledImageHeight()\">\n <svg:image [attr.href]=\"bgImageSrc()\" [attr.width]=\"scaledImageWidth()\" [attr.height]=\"scaledImageHeight()\" />\n </svg:pattern>\n\n <svg:rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" [attr.fill]=\"patternUrl\" />\n }\n\n @if (!repeated()) {\n <svg:image\n [attr.x]=\"imageX()\"\n [attr.y]=\"imageY()\"\n [attr.width]=\"scaledImageWidth()\"\n [attr.height]=\"scaledImageHeight()\"\n [attr.href]=\"bgImageSrc()\" />\n }\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3565
3854
|
}
|
|
3566
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3855
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BackgroundComponent, decorators: [{
|
|
3567
3856
|
type: Component,
|
|
3568
3857
|
args: [{ standalone: true, selector: 'g[background]', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (backgroundSignal().type === 'dots') {\n <svg:pattern\n patternUnits=\"userSpaceOnUse\"\n [attr.id]=\"patternId\"\n [attr.x]=\"x()\"\n [attr.y]=\"y()\"\n [attr.width]=\"scaledGap()\"\n [attr.height]=\"scaledGap()\">\n <svg:circle\n [attr.cx]=\"patternSize()\"\n [attr.cy]=\"patternSize()\"\n [attr.r]=\"patternSize()\"\n [attr.fill]=\"patternColor()\" />\n </svg:pattern>\n\n <svg:rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" [attr.fill]=\"patternUrl\" />\n}\n\n@if (backgroundSignal().type === 'image') {\n @if (repeated()) {\n <svg:pattern\n patternUnits=\"userSpaceOnUse\"\n [attr.id]=\"patternId\"\n [attr.x]=\"imageX()\"\n [attr.y]=\"imageY()\"\n [attr.width]=\"scaledImageWidth()\"\n [attr.height]=\"scaledImageHeight()\">\n <svg:image [attr.href]=\"bgImageSrc()\" [attr.width]=\"scaledImageWidth()\" [attr.height]=\"scaledImageHeight()\" />\n </svg:pattern>\n\n <svg:rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" [attr.fill]=\"patternUrl\" />\n }\n\n @if (!repeated()) {\n <svg:image\n [attr.x]=\"imageX()\"\n [attr.y]=\"imageY()\"\n [attr.width]=\"scaledImageWidth()\"\n [attr.height]=\"scaledImageHeight()\"\n [attr.href]=\"bgImageSrc()\" />\n }\n}\n" }]
|
|
3569
3858
|
}], ctorParameters: () => [] });
|
|
@@ -3580,12 +3869,12 @@ class DefsComponent {
|
|
|
3580
3869
|
this.markers = input.required();
|
|
3581
3870
|
this.defaultColor = 'rgb(177, 177, 183)';
|
|
3582
3871
|
}
|
|
3583
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3584
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3872
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3873
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: DefsComponent, isStandalone: true, selector: "defs[flowDefs]", inputs: { markers: { classPropertyName: "markers", publicName: "markers", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@for (marker of markers() | keyvalue; track marker) {\n <svg:marker\n viewBox=\"-10 -10 20 20\"\n refX=\"0\"\n refY=\"0\"\n [attr.id]=\"marker.key\"\n [attr.markerWidth]=\"marker.value.width ?? 16.5\"\n [attr.markerHeight]=\"marker.value.height ?? 16.5\"\n [attr.orient]=\"marker.value.orient ?? 'auto-start-reverse'\"\n [attr.markerUnits]=\"marker.value.markerUnits ?? 'userSpaceOnUse'\">\n @if (marker.value.type === 'arrow-closed' || !marker.value.type) {\n <polyline\n class=\"marker__arrow_closed\"\n points=\"-5,-4 1,0 -5,4 -5,-4\"\n [style.stroke]=\"marker.value.color ?? defaultColor\"\n [style.stroke-width]=\"marker.value.strokeWidth ?? 2\"\n [style.fill]=\"marker.value.color ?? defaultColor\" />\n }\n\n @if (marker.value.type === 'arrow') {\n <polyline\n class=\"marker__arrow_default\"\n points=\"-5,-4 0,0 -5,4\"\n [style.stroke]=\"marker.value.color ?? defaultColor\"\n [style.stroke-width]=\"marker.value.strokeWidth ?? 2\" />\n }\n </svg:marker>\n}\n", styles: [".marker__arrow_default{stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;fill:none}.marker__arrow_closed{stroke-linecap:round;stroke-linejoin:round}\n"], dependencies: [{ kind: "pipe", type: KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3585
3874
|
}
|
|
3586
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefsComponent, decorators: [{
|
|
3587
3876
|
type: Component,
|
|
3588
|
-
args: [{
|
|
3877
|
+
args: [{ selector: 'defs[flowDefs]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [KeyValuePipe], template: "@for (marker of markers() | keyvalue; track marker) {\n <svg:marker\n viewBox=\"-10 -10 20 20\"\n refX=\"0\"\n refY=\"0\"\n [attr.id]=\"marker.key\"\n [attr.markerWidth]=\"marker.value.width ?? 16.5\"\n [attr.markerHeight]=\"marker.value.height ?? 16.5\"\n [attr.orient]=\"marker.value.orient ?? 'auto-start-reverse'\"\n [attr.markerUnits]=\"marker.value.markerUnits ?? 'userSpaceOnUse'\">\n @if (marker.value.type === 'arrow-closed' || !marker.value.type) {\n <polyline\n class=\"marker__arrow_closed\"\n points=\"-5,-4 1,0 -5,4 -5,-4\"\n [style.stroke]=\"marker.value.color ?? defaultColor\"\n [style.stroke-width]=\"marker.value.strokeWidth ?? 2\"\n [style.fill]=\"marker.value.color ?? defaultColor\" />\n }\n\n @if (marker.value.type === 'arrow') {\n <polyline\n class=\"marker__arrow_default\"\n points=\"-5,-4 0,0 -5,4\"\n [style.stroke]=\"marker.value.color ?? defaultColor\"\n [style.stroke-width]=\"marker.value.strokeWidth ?? 2\" />\n }\n </svg:marker>\n}\n", styles: [".marker__arrow_default{stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;fill:none}.marker__arrow_closed{stroke-linecap:round;stroke-linejoin:round}\n"] }]
|
|
3589
3878
|
}] });
|
|
3590
3879
|
|
|
3591
3880
|
class FlowSizeControllerDirective {
|
|
@@ -3607,10 +3896,10 @@ class FlowSizeControllerDirective {
|
|
|
3607
3896
|
}), takeUntilDestroyed())
|
|
3608
3897
|
.subscribe();
|
|
3609
3898
|
}
|
|
3610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3611
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3899
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowSizeControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3900
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: FlowSizeControllerDirective, isStandalone: true, selector: "svg[flowSizeController]", host: { properties: { "attr.width": "flowWidth()", "attr.height": "flowHeight()" } }, ngImport: i0 }); }
|
|
3612
3901
|
}
|
|
3613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3902
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowSizeControllerDirective, decorators: [{
|
|
3614
3903
|
type: Directive,
|
|
3615
3904
|
args: [{
|
|
3616
3905
|
standalone: true,
|
|
@@ -3630,14 +3919,17 @@ class RootSvgContextDirective {
|
|
|
3630
3919
|
// TODO: check for multiple instances on page
|
|
3631
3920
|
resetConnection() {
|
|
3632
3921
|
const status = this.flowStatusService.status();
|
|
3633
|
-
if (status.state === 'connection-start'
|
|
3634
|
-
this.flowStatusService.
|
|
3922
|
+
if (status.state === 'connection-start') {
|
|
3923
|
+
this.flowStatusService.setConnectionDroppedStatus(status.payload.source, status.payload.sourceHandle);
|
|
3924
|
+
}
|
|
3925
|
+
if (status.state === 'reconnection-start') {
|
|
3926
|
+
this.flowStatusService.setReconnectionDroppedStatus(status.payload.source, status.payload.sourceHandle, status.payload.oldEdge);
|
|
3635
3927
|
}
|
|
3636
3928
|
}
|
|
3637
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3638
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3929
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootSvgContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3930
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: RootSvgContextDirective, isStandalone: true, selector: "svg[rootSvgContext]", host: { listeners: { "document:mouseup": "resetConnection()", "document:touchend": "resetConnection()", "contextmenu": "resetConnection()" } }, ngImport: i0 }); }
|
|
3639
3931
|
}
|
|
3640
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3932
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootSvgContextDirective, decorators: [{
|
|
3641
3933
|
type: Directive,
|
|
3642
3934
|
args: [{
|
|
3643
3935
|
standalone: true,
|
|
@@ -3680,10 +3972,10 @@ function getSpacePoints(point, groups) {
|
|
|
3680
3972
|
}
|
|
3681
3973
|
|
|
3682
3974
|
class PreviewFlowRenderStrategyService {
|
|
3683
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3684
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3975
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowRenderStrategyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3976
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowRenderStrategyService }); }
|
|
3685
3977
|
}
|
|
3686
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowRenderStrategyService, decorators: [{
|
|
3687
3979
|
type: Injectable
|
|
3688
3980
|
}] });
|
|
3689
3981
|
class ViewportPreviewFlowRenderStrategyService extends PreviewFlowRenderStrategyService {
|
|
@@ -3691,10 +3983,10 @@ class ViewportPreviewFlowRenderStrategyService extends PreviewFlowRenderStrategy
|
|
|
3691
3983
|
// Do not render preview node if the real node is visible
|
|
3692
3984
|
return !node.isVisible();
|
|
3693
3985
|
}
|
|
3694
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3695
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3986
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportPreviewFlowRenderStrategyService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3987
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportPreviewFlowRenderStrategyService }); }
|
|
3696
3988
|
}
|
|
3697
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3989
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportPreviewFlowRenderStrategyService, decorators: [{
|
|
3698
3990
|
type: Injectable
|
|
3699
3991
|
}] });
|
|
3700
3992
|
|
|
@@ -3841,10 +4133,10 @@ class PreviewFlowComponent {
|
|
|
3841
4133
|
this.ctx.restore();
|
|
3842
4134
|
});
|
|
3843
4135
|
}
|
|
3844
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3845
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
4136
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4137
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.17", type: PreviewFlowComponent, isStandalone: true, selector: "canvas[previewFlow]", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3846
4138
|
}
|
|
3847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowComponent, decorators: [{
|
|
3848
4140
|
type: Component,
|
|
3849
4141
|
args: [{
|
|
3850
4142
|
standalone: true,
|
|
@@ -3866,10 +4158,10 @@ class FlowRenderingService {
|
|
|
3866
4158
|
this.flowInitialized.set(true);
|
|
3867
4159
|
});
|
|
3868
4160
|
}
|
|
3869
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3870
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowRenderingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4162
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowRenderingService }); }
|
|
3871
4163
|
}
|
|
3872
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4164
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowRenderingService, decorators: [{
|
|
3873
4165
|
type: Injectable
|
|
3874
4166
|
}], ctorParameters: () => [] });
|
|
3875
4167
|
// TODO may break on edge cases
|
|
@@ -3978,52 +4270,125 @@ class AlignmentHelperComponent {
|
|
|
3978
4270
|
.pipe(filter(isNodeDragEndStatus), map((status) => status.payload.node), map((node) => [node, this.intersections()]), tap(([node, intersections]) => {
|
|
3979
4271
|
if (intersections) {
|
|
3980
4272
|
const snapped = { x: intersections.snappedX, y: intersections.snappedY };
|
|
3981
|
-
const
|
|
3982
|
-
|
|
4273
|
+
const parent = node.parent();
|
|
4274
|
+
if (parent) {
|
|
4275
|
+
node.setPoint({
|
|
4276
|
+
x: snapped.x - parent.globalPoint().x,
|
|
4277
|
+
y: snapped.y - parent.globalPoint().y,
|
|
4278
|
+
});
|
|
4279
|
+
}
|
|
4280
|
+
else {
|
|
4281
|
+
node.setPoint(snapped);
|
|
4282
|
+
}
|
|
3983
4283
|
}
|
|
3984
4284
|
}), takeUntilDestroyed())
|
|
3985
4285
|
.subscribe();
|
|
3986
4286
|
}
|
|
3987
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3988
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4287
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AlignmentHelperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4288
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: AlignmentHelperComponent, isStandalone: true, selector: "g[alignmentHelper]", inputs: { tolerance: { classPropertyName: "tolerance", publicName: "tolerance", isSignal: true, isRequired: false, transformFunction: null }, lineColor: { classPropertyName: "lineColor", publicName: "lineColor", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (isNodeDragging()) {\n @if (intersections(); as intersections) {\n @for (intersection of intersections.lines; track $index) {\n <svg:line\n [attr.stroke]=\"lineColor()\"\n [attr.stroke-dasharray]=\"intersection.isCenter ? 4 : null\"\n [attr.x1]=\"intersection.x\"\n [attr.y1]=\"intersection.y\"\n [attr.x2]=\"intersection.x2\"\n [attr.y2]=\"intersection.y2\" />\n }\n }\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3989
4289
|
}
|
|
3990
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AlignmentHelperComponent, decorators: [{
|
|
3991
4291
|
type: Component,
|
|
3992
4292
|
args: [{ selector: 'g[alignmentHelper]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (isNodeDragging()) {\n @if (intersections(); as intersections) {\n @for (intersection of intersections.lines; track $index) {\n <svg:line\n [attr.stroke]=\"lineColor()\"\n [attr.stroke-dasharray]=\"intersection.isCenter ? 4 : null\"\n [attr.x1]=\"intersection.x\"\n [attr.y1]=\"intersection.y\"\n [attr.x2]=\"intersection.x2\"\n [attr.y2]=\"intersection.y2\" />\n }\n }\n}\n" }]
|
|
3993
4293
|
}], ctorParameters: () => [] });
|
|
3994
4294
|
|
|
4295
|
+
const EDGE = 48; // px from edge to trigger pan
|
|
4296
|
+
const BASE_SPEED = 10;
|
|
4297
|
+
const START_STATES = ['node-drag-start', 'connection-start', 'reconnection-start'];
|
|
4298
|
+
class AutoPanDirective {
|
|
4299
|
+
constructor() {
|
|
4300
|
+
this.statusService = inject(FlowStatusService);
|
|
4301
|
+
this.viewportService = inject(ViewportService);
|
|
4302
|
+
this.flowSettingsService = inject(FlowSettingsService);
|
|
4303
|
+
this.rootSvg = inject(RootSvgReferenceDirective).element;
|
|
4304
|
+
this.injector = inject(Injector);
|
|
4305
|
+
this.destroyRef = inject(DestroyRef);
|
|
4306
|
+
this.documentPoint$ = merge(fromEvent(document, 'pointerdown', { capture: true }), fromEvent(document, 'pointermove', { capture: true })).pipe(map((event) => ({ x: event.clientX, y: event.clientY })), map((point) => this.toViewportPoint(point)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
4307
|
+
}
|
|
4308
|
+
ngOnInit() {
|
|
4309
|
+
if (this.flowSettingsService.autoPan()) {
|
|
4310
|
+
toObservable(this.statusService.status, { injector: this.injector })
|
|
4311
|
+
.pipe(switchMap((status) => START_STATES.includes(status.state)
|
|
4312
|
+
? this.documentPoint$.pipe(take(1), switchMap(() => animationFrames().pipe(withLatestFrom(this.documentPoint$), map(([, point]) => point), tap((point) => this.pan(point)))))
|
|
4313
|
+
: EMPTY), takeUntilDestroyed(this.destroyRef))
|
|
4314
|
+
.subscribe();
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
toViewportPoint(event) {
|
|
4318
|
+
const rect = this.rootSvg.getBoundingClientRect();
|
|
4319
|
+
return {
|
|
4320
|
+
x: event.x - rect.left,
|
|
4321
|
+
y: event.y - rect.top,
|
|
4322
|
+
};
|
|
4323
|
+
}
|
|
4324
|
+
pan(point) {
|
|
4325
|
+
const viewport = this.viewportService.readableViewport();
|
|
4326
|
+
const { x, y, zoom } = viewport;
|
|
4327
|
+
const width = this.flowSettingsService.computedFlowWidth();
|
|
4328
|
+
const height = this.flowSettingsService.computedFlowHeight();
|
|
4329
|
+
const dL = point.x;
|
|
4330
|
+
const dR = width - point.x;
|
|
4331
|
+
const dT = point.y;
|
|
4332
|
+
const dB = height - point.y;
|
|
4333
|
+
let deltaX = 0;
|
|
4334
|
+
let deltaY = 0;
|
|
4335
|
+
// Left edge: pan right (increase x)
|
|
4336
|
+
if (dL < EDGE) {
|
|
4337
|
+
const speedL = BASE_SPEED * edgeFactor(dL);
|
|
4338
|
+
deltaX += speedL;
|
|
4339
|
+
}
|
|
4340
|
+
// Right edge: pan left (decrease x)
|
|
4341
|
+
if (dR < EDGE) {
|
|
4342
|
+
const speedR = BASE_SPEED * edgeFactor(dR);
|
|
4343
|
+
deltaX -= speedR;
|
|
4344
|
+
}
|
|
4345
|
+
// Top edge: pan down (increase y)
|
|
4346
|
+
if (dT < EDGE) {
|
|
4347
|
+
const speedT = BASE_SPEED * edgeFactor(dT);
|
|
4348
|
+
deltaY += speedT;
|
|
4349
|
+
}
|
|
4350
|
+
// Bottom edge: pan up (decrease y)
|
|
4351
|
+
if (dB < EDGE) {
|
|
4352
|
+
const speedB = BASE_SPEED * edgeFactor(dB);
|
|
4353
|
+
deltaY -= speedB;
|
|
4354
|
+
}
|
|
4355
|
+
if (deltaX !== 0 || deltaY !== 0) {
|
|
4356
|
+
this.viewportService.writableViewport.set({
|
|
4357
|
+
changeType: 'absolute',
|
|
4358
|
+
state: { x: x + deltaX, y: y + deltaY, zoom },
|
|
4359
|
+
duration: 0,
|
|
4360
|
+
});
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AutoPanDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4364
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: AutoPanDirective, isStandalone: true, selector: "[autoPan]", ngImport: i0 }); }
|
|
4365
|
+
}
|
|
4366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AutoPanDirective, decorators: [{
|
|
4367
|
+
type: Directive,
|
|
4368
|
+
args: [{ selector: '[autoPan]', standalone: true }]
|
|
4369
|
+
}] });
|
|
4370
|
+
function clamp01(n) {
|
|
4371
|
+
return Math.max(0, Math.min(1, n));
|
|
4372
|
+
}
|
|
4373
|
+
function edgeFactor(distance) {
|
|
4374
|
+
const t = clamp01((EDGE - distance) / EDGE);
|
|
4375
|
+
return t * t; // ease-in: t^2
|
|
4376
|
+
}
|
|
4377
|
+
|
|
3995
4378
|
const changesControllerHostDirective = {
|
|
3996
4379
|
directive: ChangesControllerDirective,
|
|
3997
4380
|
outputs: [
|
|
3998
|
-
'
|
|
3999
|
-
'
|
|
4000
|
-
'
|
|
4001
|
-
'
|
|
4002
|
-
'
|
|
4003
|
-
'
|
|
4004
|
-
'
|
|
4005
|
-
'
|
|
4006
|
-
'
|
|
4007
|
-
'
|
|
4008
|
-
'
|
|
4009
|
-
'onNodesChange.remove.single',
|
|
4010
|
-
'onNodesChange.remove.many',
|
|
4011
|
-
'onNodesChange.select',
|
|
4012
|
-
'onNodesChange.select.single',
|
|
4013
|
-
'onNodesChange.select.many',
|
|
4014
|
-
'onEdgesChange',
|
|
4015
|
-
'onEdgesChange.detached',
|
|
4016
|
-
'onEdgesChange.detached.single',
|
|
4017
|
-
'onEdgesChange.detached.many',
|
|
4018
|
-
'onEdgesChange.add',
|
|
4019
|
-
'onEdgesChange.add.single',
|
|
4020
|
-
'onEdgesChange.add.many',
|
|
4021
|
-
'onEdgesChange.remove',
|
|
4022
|
-
'onEdgesChange.remove.single',
|
|
4023
|
-
'onEdgesChange.remove.many',
|
|
4024
|
-
'onEdgesChange.select',
|
|
4025
|
-
'onEdgesChange.select.single',
|
|
4026
|
-
'onEdgesChange.select.many',
|
|
4381
|
+
'nodesChanges',
|
|
4382
|
+
'nodesChanges.position',
|
|
4383
|
+
'nodesChanges.size',
|
|
4384
|
+
'nodesChanges.add',
|
|
4385
|
+
'nodesChanges.remove',
|
|
4386
|
+
'nodesChanges.select',
|
|
4387
|
+
'edgesChanges',
|
|
4388
|
+
'edgesChanges.detached',
|
|
4389
|
+
'edgesChanges.add',
|
|
4390
|
+
'edgesChanges.remove',
|
|
4391
|
+
'edgesChanges.select',
|
|
4027
4392
|
],
|
|
4028
4393
|
};
|
|
4029
4394
|
class VflowComponent {
|
|
@@ -4049,10 +4414,8 @@ class VflowComponent {
|
|
|
4049
4414
|
// #region OUTPUTS
|
|
4050
4415
|
/**
|
|
4051
4416
|
* Event that accumulates all custom node events
|
|
4052
|
-
*
|
|
4053
|
-
* @experimental
|
|
4054
4417
|
*/
|
|
4055
|
-
this.
|
|
4418
|
+
this.componentNodeEvent = outputFromObservable(this.componentEventBusService.event$); // TODO: research how to remove any
|
|
4056
4419
|
// #endregion
|
|
4057
4420
|
// #region TEMPLATES
|
|
4058
4421
|
this.nodeTemplateDirective = contentChild(NodeHtmlTemplateDirective);
|
|
@@ -4148,6 +4511,14 @@ class VflowComponent {
|
|
|
4148
4511
|
set entitiesSelectable(value) {
|
|
4149
4512
|
this.flowSettingsService.entitiesSelectable.set(value);
|
|
4150
4513
|
}
|
|
4514
|
+
/**
|
|
4515
|
+
* Selection mode strategy
|
|
4516
|
+
* - 'default': library manages selection automatically
|
|
4517
|
+
* - 'manual': library does not manage selection, user controls it via node.selected signal
|
|
4518
|
+
*/
|
|
4519
|
+
set selectionMode(value) {
|
|
4520
|
+
this.flowSettingsService.selectionMode.set(value);
|
|
4521
|
+
}
|
|
4151
4522
|
set keyboardShortcuts(value) {
|
|
4152
4523
|
this.keyboardService.setShortcuts(value);
|
|
4153
4524
|
}
|
|
@@ -4180,6 +4551,12 @@ class VflowComponent {
|
|
|
4180
4551
|
set elevateEdgesOnSelect(value) {
|
|
4181
4552
|
this.flowSettingsService.elevateEdgesOnSelect.set(value);
|
|
4182
4553
|
}
|
|
4554
|
+
/**
|
|
4555
|
+
* Enable auto-pan
|
|
4556
|
+
*/
|
|
4557
|
+
set autoPan(value) {
|
|
4558
|
+
this.flowSettingsService.autoPan.set(value);
|
|
4559
|
+
}
|
|
4183
4560
|
// #endregion
|
|
4184
4561
|
// #region MAIN_INPUTS
|
|
4185
4562
|
/**
|
|
@@ -4301,8 +4678,8 @@ class VflowComponent {
|
|
|
4301
4678
|
trackEdges(idx, { edge }) {
|
|
4302
4679
|
return edge;
|
|
4303
4680
|
}
|
|
4304
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4305
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4681
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: VflowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4682
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: VflowComponent, isStandalone: true, selector: "vflow", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: false, isRequired: false, transformFunction: null }, minZoom: { classPropertyName: "minZoom", publicName: "minZoom", isSignal: false, isRequired: false, transformFunction: null }, maxZoom: { classPropertyName: "maxZoom", publicName: "maxZoom", isSignal: false, isRequired: false, transformFunction: null }, background: { classPropertyName: "background", publicName: "background", isSignal: false, isRequired: false, transformFunction: null }, optimization: { classPropertyName: "optimization", publicName: "optimization", isSignal: false, isRequired: false, transformFunction: null }, entitiesSelectable: { classPropertyName: "entitiesSelectable", publicName: "entitiesSelectable", isSignal: false, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: false, isRequired: false, transformFunction: null }, keyboardShortcuts: { classPropertyName: "keyboardShortcuts", publicName: "keyboardShortcuts", isSignal: false, isRequired: false, transformFunction: null }, connection: { classPropertyName: "connection", publicName: "connection", isSignal: false, isRequired: false, transformFunction: (settings) => new ConnectionModel(settings) }, snapGrid: { classPropertyName: "snapGrid", publicName: "snapGrid", isSignal: false, isRequired: false, transformFunction: null }, elevateNodesOnSelect: { classPropertyName: "elevateNodesOnSelect", publicName: "elevateNodesOnSelect", isSignal: false, isRequired: false, transformFunction: null }, elevateEdgesOnSelect: { classPropertyName: "elevateEdgesOnSelect", publicName: "elevateEdgesOnSelect", isSignal: false, isRequired: false, transformFunction: null }, autoPan: { classPropertyName: "autoPan", publicName: "autoPan", isSignal: false, isRequired: false, transformFunction: null }, nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: false, isRequired: true, transformFunction: null }, alignmentHelper: { classPropertyName: "alignmentHelper", publicName: "alignmentHelper", isSignal: true, isRequired: false, transformFunction: null }, edges: { classPropertyName: "edges", publicName: "edges", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { componentNodeEvent: "componentNodeEvent" }, providers: [
|
|
4306
4683
|
DraggableService,
|
|
4307
4684
|
ViewportService,
|
|
4308
4685
|
FlowStatusService,
|
|
@@ -4318,11 +4695,11 @@ class VflowComponent {
|
|
|
4318
4695
|
OverlaysService,
|
|
4319
4696
|
{ provide: PreviewFlowRenderStrategyService, useClass: ViewportPreviewFlowRenderStrategyService },
|
|
4320
4697
|
FlowRenderingService,
|
|
4321
|
-
], queries: [{ propertyName: "nodeTemplateDirective", first: true, predicate: NodeHtmlTemplateDirective, descendants: true, isSignal: true }, { propertyName: "nodeSvgTemplateDirective", first: true, predicate: NodeSvgTemplateDirective, descendants: true, isSignal: true }, { propertyName: "groupNodeTemplateDirective", first: true, predicate: GroupNodeTemplateDirective, descendants: true, isSignal: true }, { propertyName: "edgeTemplateDirective", first: true, predicate: EdgeTemplateDirective, descendants: true, isSignal: true }, { propertyName: "edgeLabelHtmlDirective", first: true, predicate: EdgeLabelHtmlTemplateDirective, descendants: true, isSignal: true }, { propertyName: "connectionTemplateDirective", first: true, predicate: ConnectionTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "mapContext", first: true, predicate: MapContextDirective, descendants: true, isSignal: true }, { propertyName: "spacePointContext", first: true, predicate: SpacePointContextDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: ChangesControllerDirective, outputs: ["
|
|
4698
|
+
], queries: [{ propertyName: "nodeTemplateDirective", first: true, predicate: NodeHtmlTemplateDirective, descendants: true, isSignal: true }, { propertyName: "nodeSvgTemplateDirective", first: true, predicate: NodeSvgTemplateDirective, descendants: true, isSignal: true }, { propertyName: "groupNodeTemplateDirective", first: true, predicate: GroupNodeTemplateDirective, descendants: true, isSignal: true }, { propertyName: "edgeTemplateDirective", first: true, predicate: EdgeTemplateDirective, descendants: true, isSignal: true }, { propertyName: "edgeLabelHtmlDirective", first: true, predicate: EdgeLabelHtmlTemplateDirective, descendants: true, isSignal: true }, { propertyName: "connectionTemplateDirective", first: true, predicate: ConnectionTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "mapContext", first: true, predicate: MapContextDirective, descendants: true, isSignal: true }, { propertyName: "spacePointContext", first: true, predicate: SpacePointContextDirective, descendants: true, isSignal: true }], hostDirectives: [{ directive: ChangesControllerDirective, outputs: ["nodesChanges", "nodesChanges", "nodesChanges.position", "nodesChanges.position", "nodesChanges.size", "nodesChanges.size", "nodesChanges.add", "nodesChanges.add", "nodesChanges.remove", "nodesChanges.remove", "nodesChanges.select", "nodesChanges.select", "edgesChanges", "edgesChanges", "edgesChanges.detached", "edgesChanges.detached", "edgesChanges.add", "edgesChanges.add", "edgesChanges.remove", "edgesChanges.remove", "edgesChanges.select", "edgesChanges.select"] }], ngImport: i0, template: "<svg:svg #flow rootSvgRef rootSvgContext rootPointer flowSizeController class=\"root-svg\">\n <defs flowDefs [markers]=\"markers()\" />\n\n <g background />\n\n <svg:g mapContext spacePointContext autoPan>\n @if (alignmentHelper(); as alignmentHelper) {\n @if (alignmentHelper === true) {\n <svg:g alignmentHelper />\n } @else {\n <svg:g alignmentHelper [tolerance]=\"alignmentHelper.tolerance\" [lineColor]=\"alignmentHelper.lineColor\" />\n }\n }\n\n <!-- Connection -->\n <svg:g connection [model]=\"connection\" [template]=\"connectionTemplateDirective()?.templateRef\" />\n\n @if (flowOptimization().detachedGroupsLayer) {\n <!-- Groups -->\n @for (model of groups(); track trackNodes($index, model)) {\n <svg:g\n node\n [model]=\"model\"\n [groupNodeTemplate]=\"groupNodeTemplateDirective()?.templateRef\"\n [attr.transform]=\"model.pointTransform()\" />\n }\n <!-- Edges -->\n @for (model of edgeModels(); track trackEdges($index, model)) {\n <svg:g\n edge\n [model]=\"model\"\n [edgeTemplate]=\"edgeTemplateDirective()?.templateRef\"\n [edgeLabelHtmlTemplate]=\"edgeLabelHtmlDirective()?.templateRef\" />\n }\n <!-- Nodes -->\n @for (model of nonGroups(); track trackNodes($index, model)) {\n <svg:g\n node\n [model]=\"model\"\n [nodeTemplate]=\"nodeTemplateDirective()?.templateRef\"\n [nodeSvgTemplate]=\"nodeSvgTemplateDirective()?.templateRef\"\n [attr.transform]=\"model.pointTransform()\" />\n }\n }\n\n @if (!flowOptimization().detachedGroupsLayer) {\n <!-- Edges -->\n @for (model of edgeModels(); track trackEdges($index, model)) {\n <svg:g\n edge\n [model]=\"model\"\n [edgeTemplate]=\"edgeTemplateDirective()?.templateRef\"\n [edgeLabelHtmlTemplate]=\"edgeLabelHtmlDirective()?.templateRef\" />\n }\n\n @for (model of nodeModels(); track trackNodes($index, model)) {\n <svg:g\n node\n [model]=\"model\"\n [nodeTemplate]=\"nodeTemplateDirective()?.templateRef\"\n [nodeSvgTemplate]=\"nodeSvgTemplateDirective()?.templateRef\"\n [groupNodeTemplate]=\"groupNodeTemplateDirective()?.templateRef\"\n [attr.transform]=\"model.pointTransform()\" />\n }\n }\n </svg:g>\n\n <!-- Minimap -->\n @if (minimap(); as minimap) {\n <ng-container [ngTemplateOutlet]=\"minimap.template()\" />\n }\n</svg:svg>\n\n@if (flowOptimization().virtualization) {\n <canvas previewFlow class=\"preview-flow\" [width]=\"flowWidth()\" [height]=\"flowHeight()\"></canvas>\n}\n", styles: [":host{display:grid;grid-template-columns:1fr;width:100%;height:100%;-webkit-user-select:none;user-select:none}:host ::ng-deep *{box-sizing:border-box}.root-svg{grid-row-start:1;grid-column-start:1}.preview-flow{pointer-events:none;grid-row-start:1;grid-column-start:1}\n"], dependencies: [{ kind: "directive", type: RootSvgReferenceDirective, selector: "svg[rootSvgRef]" }, { kind: "directive", type: RootSvgContextDirective, selector: "svg[rootSvgContext]" }, { kind: "directive", type: RootPointerDirective, selector: "svg[rootPointer]" }, { kind: "directive", type: FlowSizeControllerDirective, selector: "svg[flowSizeController]" }, { kind: "component", type: DefsComponent, selector: "defs[flowDefs]", inputs: ["markers"] }, { kind: "component", type: BackgroundComponent, selector: "g[background]" }, { kind: "directive", type: MapContextDirective, selector: "g[mapContext]" }, { kind: "directive", type: SpacePointContextDirective, selector: "g[spacePointContext]" }, { kind: "component", type: ConnectionComponent, selector: "g[connection]", inputs: ["model", "template"] }, { kind: "component", type: NodeComponent, selector: "g[node]", inputs: ["model", "nodeTemplate", "nodeSvgTemplate", "groupNodeTemplate"] }, { kind: "component", type: EdgeComponent, selector: "g[edge]", inputs: ["model", "edgeTemplate", "edgeLabelHtmlTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PreviewFlowComponent, selector: "canvas[previewFlow]", inputs: ["width", "height"] }, { kind: "component", type: AlignmentHelperComponent, selector: "g[alignmentHelper]", inputs: ["tolerance", "lineColor"] }, { kind: "directive", type: AutoPanDirective, selector: "[autoPan]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4322
4699
|
}
|
|
4323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4700
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: VflowComponent, decorators: [{
|
|
4324
4701
|
type: Component,
|
|
4325
|
-
args: [{
|
|
4702
|
+
args: [{ selector: 'vflow', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
4326
4703
|
DraggableService,
|
|
4327
4704
|
ViewportService,
|
|
4328
4705
|
FlowStatusService,
|
|
@@ -4353,7 +4730,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
4353
4730
|
NgTemplateOutlet,
|
|
4354
4731
|
PreviewFlowComponent,
|
|
4355
4732
|
AlignmentHelperComponent,
|
|
4356
|
-
|
|
4733
|
+
AutoPanDirective,
|
|
4734
|
+
], template: "<svg:svg #flow rootSvgRef rootSvgContext rootPointer flowSizeController class=\"root-svg\">\n <defs flowDefs [markers]=\"markers()\" />\n\n <g background />\n\n <svg:g mapContext spacePointContext autoPan>\n @if (alignmentHelper(); as alignmentHelper) {\n @if (alignmentHelper === true) {\n <svg:g alignmentHelper />\n } @else {\n <svg:g alignmentHelper [tolerance]=\"alignmentHelper.tolerance\" [lineColor]=\"alignmentHelper.lineColor\" />\n }\n }\n\n <!-- Connection -->\n <svg:g connection [model]=\"connection\" [template]=\"connectionTemplateDirective()?.templateRef\" />\n\n @if (flowOptimization().detachedGroupsLayer) {\n <!-- Groups -->\n @for (model of groups(); track trackNodes($index, model)) {\n <svg:g\n node\n [model]=\"model\"\n [groupNodeTemplate]=\"groupNodeTemplateDirective()?.templateRef\"\n [attr.transform]=\"model.pointTransform()\" />\n }\n <!-- Edges -->\n @for (model of edgeModels(); track trackEdges($index, model)) {\n <svg:g\n edge\n [model]=\"model\"\n [edgeTemplate]=\"edgeTemplateDirective()?.templateRef\"\n [edgeLabelHtmlTemplate]=\"edgeLabelHtmlDirective()?.templateRef\" />\n }\n <!-- Nodes -->\n @for (model of nonGroups(); track trackNodes($index, model)) {\n <svg:g\n node\n [model]=\"model\"\n [nodeTemplate]=\"nodeTemplateDirective()?.templateRef\"\n [nodeSvgTemplate]=\"nodeSvgTemplateDirective()?.templateRef\"\n [attr.transform]=\"model.pointTransform()\" />\n }\n }\n\n @if (!flowOptimization().detachedGroupsLayer) {\n <!-- Edges -->\n @for (model of edgeModels(); track trackEdges($index, model)) {\n <svg:g\n edge\n [model]=\"model\"\n [edgeTemplate]=\"edgeTemplateDirective()?.templateRef\"\n [edgeLabelHtmlTemplate]=\"edgeLabelHtmlDirective()?.templateRef\" />\n }\n\n @for (model of nodeModels(); track trackNodes($index, model)) {\n <svg:g\n node\n [model]=\"model\"\n [nodeTemplate]=\"nodeTemplateDirective()?.templateRef\"\n [nodeSvgTemplate]=\"nodeSvgTemplateDirective()?.templateRef\"\n [groupNodeTemplate]=\"groupNodeTemplateDirective()?.templateRef\"\n [attr.transform]=\"model.pointTransform()\" />\n }\n }\n </svg:g>\n\n <!-- Minimap -->\n @if (minimap(); as minimap) {\n <ng-container [ngTemplateOutlet]=\"minimap.template()\" />\n }\n</svg:svg>\n\n@if (flowOptimization().virtualization) {\n <canvas previewFlow class=\"preview-flow\" [width]=\"flowWidth()\" [height]=\"flowHeight()\"></canvas>\n}\n", styles: [":host{display:grid;grid-template-columns:1fr;width:100%;height:100%;-webkit-user-select:none;user-select:none}:host ::ng-deep *{box-sizing:border-box}.root-svg{grid-row-start:1;grid-column-start:1}.preview-flow{pointer-events:none;grid-row-start:1;grid-column-start:1}\n"] }]
|
|
4357
4735
|
}], propDecorators: { view: [{
|
|
4358
4736
|
type: Input
|
|
4359
4737
|
}], minZoom: [{
|
|
@@ -4366,6 +4744,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
4366
4744
|
type: Input
|
|
4367
4745
|
}], entitiesSelectable: [{
|
|
4368
4746
|
type: Input
|
|
4747
|
+
}], selectionMode: [{
|
|
4748
|
+
type: Input
|
|
4369
4749
|
}], keyboardShortcuts: [{
|
|
4370
4750
|
type: Input
|
|
4371
4751
|
}], connection: [{
|
|
@@ -4379,6 +4759,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
4379
4759
|
type: Input
|
|
4380
4760
|
}], elevateEdgesOnSelect: [{
|
|
4381
4761
|
type: Input
|
|
4762
|
+
}], autoPan: [{
|
|
4763
|
+
type: Input
|
|
4382
4764
|
}], nodes: [{
|
|
4383
4765
|
type: Input,
|
|
4384
4766
|
args: [{ required: true }]
|
|
@@ -4397,10 +4779,10 @@ class DragHandleDirective {
|
|
|
4397
4779
|
this.model.dragHandlesCount.update((count) => count - 1);
|
|
4398
4780
|
});
|
|
4399
4781
|
}
|
|
4400
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4401
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
4782
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DragHandleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4783
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: DragHandleDirective, isStandalone: true, selector: "[dragHandle]", host: { classAttribute: "vflow-drag-handle" }, ngImport: i0 }); }
|
|
4402
4784
|
}
|
|
4403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4785
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DragHandleDirective, decorators: [{
|
|
4404
4786
|
type: Directive,
|
|
4405
4787
|
args: [{
|
|
4406
4788
|
standalone: true,
|
|
@@ -4440,10 +4822,10 @@ class SelectableDirective {
|
|
|
4440
4822
|
getEvent$() {
|
|
4441
4823
|
return fromEvent(this.host.nativeElement, 'click');
|
|
4442
4824
|
}
|
|
4443
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4444
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
4825
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4826
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: SelectableDirective, isStandalone: true, selector: "[selectable]", ngImport: i0 }); }
|
|
4445
4827
|
}
|
|
4446
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4828
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectableDirective, decorators: [{
|
|
4447
4829
|
type: Directive,
|
|
4448
4830
|
args: [{
|
|
4449
4831
|
standalone: true,
|
|
@@ -4548,12 +4930,12 @@ class MiniMapComponent {
|
|
|
4548
4930
|
trackNodes(idx, { rawNode }) {
|
|
4549
4931
|
return rawNode;
|
|
4550
4932
|
}
|
|
4551
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4552
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4933
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MiniMapComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4934
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: MiniMapComponent, isStandalone: true, selector: "mini-map", inputs: { maskColor: { classPropertyName: "maskColor", publicName: "maskColor", isSignal: true, isRequired: false, transformFunction: null }, strokeColor: { classPropertyName: "strokeColor", publicName: "strokeColor", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, scaleOnHover: { classPropertyName: "scaleOnHover", publicName: "scaleOnHover", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "minimap", first: true, predicate: ["minimap"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #minimap>\n <svg:rect\n fill=\"none\"\n [attr.x]=\"minimapPoint().x\"\n [attr.y]=\"minimapPoint().y\"\n [attr.width]=\"minimapWidth()\"\n [attr.height]=\"minimapHeight()\"\n [attr.stroke]=\"strokeColor()\" />\n\n <svg:svg\n [attr.x]=\"minimapPoint().x\"\n [attr.y]=\"minimapPoint().y\"\n [attr.width]=\"minimapWidth()\"\n [attr.height]=\"minimapHeight()\"\n (mouseover)=\"hovered.set(true)\"\n (mouseleave)=\"hovered.set(false)\">\n <svg:rect [attr.width]=\"minimapWidth()\" [attr.height]=\"minimapHeight()\" [attr.fill]=\"maskColor()\" />\n\n <svg:g [attr.transform]=\"minimapTransform()\">\n <svg:rect\n [attr.fill]=\"viewportColor()\"\n [attr.transform]=\"viewportTransform()\"\n [attr.width]=\"minimapWidth()\"\n [attr.height]=\"minimapHeight()\" />\n\n @for (model of entitiesService.nodes(); track trackNodes($index, model)) {\n <ng-container>\n @if (model.rawNode.type === 'default' || model.rawNode.type === 'html-template' || model.isComponentType) {\n <svg:foreignObject\n [attr.transform]=\"model.pointTransform()\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\">\n <default-node\n [selected]=\"model.selected()\"\n [style.width.px]=\"model.size().width\"\n [style.height.px]=\"model.size().height\"\n [style.max-width.px]=\"model.size().width\"\n [style.max-height.px]=\"model.size().height\">\n <div [outerHTML]=\"model.text()\"></div>\n </default-node>\n </svg:foreignObject>\n }\n @if (model.rawNode.type === 'default-group' || model.rawNode.type === 'template-group') {\n <svg:rect\n class=\"default-group-node\"\n rx=\"5\"\n ry=\"5\"\n [attr.transform]=\"model.pointTransform()\"\n [class.default-group-node_selected]=\"model.selected()\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\"\n [style.stroke]=\"model.color()\"\n [style.fill]=\"model.color()\" />\n }\n </ng-container>\n }\n </svg:g>\n </svg:svg>\n</ng-template>\n", styles: [".default-group-node{stroke-width:1.5px;fill-opacity:.05}.default-group-node_selected{stroke-width:2px}\n"], dependencies: [{ kind: "component", type: DefaultNodeComponent, selector: "default-node", inputs: ["selected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4553
4935
|
}
|
|
4554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4936
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MiniMapComponent, decorators: [{
|
|
4555
4937
|
type: Component,
|
|
4556
|
-
args: [{
|
|
4938
|
+
args: [{ selector: 'mini-map', imports: [DefaultNodeComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #minimap>\n <svg:rect\n fill=\"none\"\n [attr.x]=\"minimapPoint().x\"\n [attr.y]=\"minimapPoint().y\"\n [attr.width]=\"minimapWidth()\"\n [attr.height]=\"minimapHeight()\"\n [attr.stroke]=\"strokeColor()\" />\n\n <svg:svg\n [attr.x]=\"minimapPoint().x\"\n [attr.y]=\"minimapPoint().y\"\n [attr.width]=\"minimapWidth()\"\n [attr.height]=\"minimapHeight()\"\n (mouseover)=\"hovered.set(true)\"\n (mouseleave)=\"hovered.set(false)\">\n <svg:rect [attr.width]=\"minimapWidth()\" [attr.height]=\"minimapHeight()\" [attr.fill]=\"maskColor()\" />\n\n <svg:g [attr.transform]=\"minimapTransform()\">\n <svg:rect\n [attr.fill]=\"viewportColor()\"\n [attr.transform]=\"viewportTransform()\"\n [attr.width]=\"minimapWidth()\"\n [attr.height]=\"minimapHeight()\" />\n\n @for (model of entitiesService.nodes(); track trackNodes($index, model)) {\n <ng-container>\n @if (model.rawNode.type === 'default' || model.rawNode.type === 'html-template' || model.isComponentType) {\n <svg:foreignObject\n [attr.transform]=\"model.pointTransform()\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\">\n <default-node\n [selected]=\"model.selected()\"\n [style.width.px]=\"model.size().width\"\n [style.height.px]=\"model.size().height\"\n [style.max-width.px]=\"model.size().width\"\n [style.max-height.px]=\"model.size().height\">\n <div [outerHTML]=\"model.text()\"></div>\n </default-node>\n </svg:foreignObject>\n }\n @if (model.rawNode.type === 'default-group' || model.rawNode.type === 'template-group') {\n <svg:rect\n class=\"default-group-node\"\n rx=\"5\"\n ry=\"5\"\n [attr.transform]=\"model.pointTransform()\"\n [class.default-group-node_selected]=\"model.selected()\"\n [attr.width]=\"model.size().width\"\n [attr.height]=\"model.size().height\"\n [style.stroke]=\"model.color()\"\n [style.fill]=\"model.color()\" />\n }\n </ng-container>\n }\n </svg:g>\n </svg:svg>\n</ng-template>\n", styles: [".default-group-node{stroke-width:1.5px;fill-opacity:.05}.default-group-node_selected{stroke-width:2px}\n"] }]
|
|
4557
4939
|
}] });
|
|
4558
4940
|
|
|
4559
4941
|
class ToolbarModel {
|
|
@@ -4607,8 +4989,8 @@ class NodeToolbarComponent {
|
|
|
4607
4989
|
ngOnDestroy() {
|
|
4608
4990
|
this.overlaysService.removeToolbar(this.model);
|
|
4609
4991
|
}
|
|
4610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4611
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
4992
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4993
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.17", type: NodeToolbarComponent, isStandalone: true, selector: "node-toolbar", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "toolbarContentTemplate", first: true, predicate: ["toolbar"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
4612
4994
|
<ng-template #toolbar>
|
|
4613
4995
|
<div class="wrapper" nodeToolbarWrapper [model]="model">
|
|
4614
4996
|
<ng-content />
|
|
@@ -4616,9 +4998,9 @@ class NodeToolbarComponent {
|
|
|
4616
4998
|
</ng-template>
|
|
4617
4999
|
`, isInline: true, styles: [".wrapper{width:max-content}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => NodeToolbarWrapperDirective), selector: "[nodeToolbarWrapper]", inputs: ["model"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4618
5000
|
}
|
|
4619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5001
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarComponent, decorators: [{
|
|
4620
5002
|
type: Component,
|
|
4621
|
-
args: [{
|
|
5003
|
+
args: [{ selector: 'node-toolbar', template: `
|
|
4622
5004
|
<ng-template #toolbar>
|
|
4623
5005
|
<div class="wrapper" nodeToolbarWrapper [model]="model">
|
|
4624
5006
|
<ng-content />
|
|
@@ -4644,10 +5026,10 @@ class NodeToolbarWrapperDirective {
|
|
|
4644
5026
|
height: this.element.nativeElement.clientHeight,
|
|
4645
5027
|
});
|
|
4646
5028
|
}
|
|
4647
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4648
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
5029
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarWrapperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5030
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: NodeToolbarWrapperDirective, isStandalone: true, selector: "[nodeToolbarWrapper]", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
4649
5031
|
}
|
|
4650
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5032
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarWrapperDirective, decorators: [{
|
|
4651
5033
|
type: Directive,
|
|
4652
5034
|
args: [{
|
|
4653
5035
|
selector: '[nodeToolbarWrapper]',
|
|
@@ -4668,10 +5050,10 @@ class CustomTemplateEdgeComponent {
|
|
|
4668
5050
|
this.edgeRenderingService.pull(this.model);
|
|
4669
5051
|
}
|
|
4670
5052
|
}
|
|
4671
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4672
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
5053
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomTemplateEdgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5054
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: CustomTemplateEdgeComponent, isStandalone: true, selector: "g[customTemplateEdge]", host: { listeners: { "mousedown": "pull()", "touchstart": "pull()" } }, ngImport: i0, template: "<ng-content />\n\n<svg:path #interactiveEdge class=\"interactive-edge\" [attr.d]=\"context.path()\" />\n", styles: [".interactive-edge{fill:none;stroke-width:20;stroke:transparent}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4673
5055
|
}
|
|
4674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5056
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomTemplateEdgeComponent, decorators: [{
|
|
4675
5057
|
type: Component,
|
|
4676
5058
|
args: [{ selector: 'g[customTemplateEdge]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
4677
5059
|
'(mousedown)': 'pull()',
|
|
@@ -4704,5 +5086,5 @@ const Vflow = [
|
|
|
4704
5086
|
* Generated bundle index. Do not edit.
|
|
4705
5087
|
*/
|
|
4706
5088
|
|
|
4707
|
-
export { ChangesControllerDirective, ConnectionControllerDirective, ConnectionTemplateDirective,
|
|
5089
|
+
export { ChangesControllerDirective, ConnectionControllerDirective, ConnectionTemplateDirective, CustomNodeComponent, CustomTemplateEdgeComponent, DEFAULT_OPTIMIZATION, DragHandleDirective, EDGE_DEFAULTS, EdgeLabelHtmlTemplateDirective, EdgeTemplateDirective, GroupNodeTemplateDirective, HandleComponent, HandleTemplateDirective, MiniMapComponent, NODE_DEFAULTS, NodeHtmlTemplateDirective, NodeSvgTemplateDirective, NodeToolbarComponent, NodeToolbarWrapperDirective, ResizableComponent, SelectableDirective, Vflow, VflowComponent, createEdge, createEdges, createNode, createNodes, isComponentNode, isDefaultGroupNode, isDefaultNode, isSvgTemplateNode, isTemplateGroupNode, isTemplateNode, ComponentEventBusService as ɵComponentEventBusService, ConnectionModel as ɵConnectionModel, FlowEntitiesService as ɵFlowEntitiesService, FlowSettingsService as ɵFlowSettingsService, HandleModel as ɵHandleModel, HandleService as ɵHandleService, NodeAccessorService as ɵNodeAccessorService, NodeModel as ɵNodeModel, NodeRenderingService as ɵNodeRenderingService, RootPointerDirective as ɵRootPointerDirective, SelectionService as ɵSelectionService, SpacePointContextDirective as ɵSpacePointContextDirective, ViewportService as ɵViewportService };
|
|
4708
5090
|
//# sourceMappingURL=ngx-vflow.mjs.map
|