ngx-vflow 1.16.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +926 -559
- 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 +44 -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 +4 -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 } });
|
|
581
633
|
}
|
|
582
|
-
|
|
583
|
-
this.status.set({
|
|
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
|
+
});
|
|
645
|
+
}
|
|
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,7 +757,6 @@ 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
762
|
if (parent) {
|
|
@@ -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,226 @@ 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
|
+
preview: { style: {} },
|
|
1063
|
+
selected: false,
|
|
1064
|
+
color: '#1b262c',
|
|
1065
|
+
resizable: false,
|
|
1066
|
+
text: '',
|
|
1067
|
+
data: {},
|
|
1068
|
+
};
|
|
1069
|
+
function isComponentNode(node) {
|
|
994
1070
|
if (isCustomNodeComponent(node.type)) {
|
|
995
1071
|
return true;
|
|
996
1072
|
}
|
|
997
1073
|
// Check if the type is a function with dynamic import
|
|
998
|
-
return isCallable(node.type)
|
|
999
|
-
}
|
|
1000
|
-
function isComponentDynamicNode(node) {
|
|
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);
|
|
1074
|
+
return isCallable(node.type);
|
|
1006
1075
|
}
|
|
1007
|
-
function
|
|
1076
|
+
function isTemplateNode(node) {
|
|
1008
1077
|
return node.type === 'html-template';
|
|
1009
1078
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return node.type === 'html-template';
|
|
1012
|
-
}
|
|
1013
|
-
function isSvgTemplateStaticNode(node) {
|
|
1079
|
+
function isSvgTemplateNode(node) {
|
|
1014
1080
|
return node.type === 'svg-template';
|
|
1015
1081
|
}
|
|
1016
|
-
function
|
|
1017
|
-
return node.type === 'html-template';
|
|
1018
|
-
}
|
|
1019
|
-
function isDefaultStaticNode(node) {
|
|
1020
|
-
return node.type === 'default';
|
|
1021
|
-
}
|
|
1022
|
-
function isDefaultDynamicNode(node) {
|
|
1082
|
+
function isDefaultNode(node) {
|
|
1023
1083
|
return node.type === 'default';
|
|
1024
1084
|
}
|
|
1025
|
-
function
|
|
1085
|
+
function isDefaultGroupNode(node) {
|
|
1026
1086
|
return node.type === 'default-group';
|
|
1027
1087
|
}
|
|
1028
|
-
function
|
|
1029
|
-
return node.type === 'default-group';
|
|
1030
|
-
}
|
|
1031
|
-
function isTemplateStaticGroupNode(node) {
|
|
1088
|
+
function isTemplateGroupNode(node) {
|
|
1032
1089
|
return node.type === 'template-group';
|
|
1033
1090
|
}
|
|
1034
|
-
function
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1091
|
+
function createBaseNode(node, useDefaults) {
|
|
1092
|
+
if (useDefaults) {
|
|
1093
|
+
return {
|
|
1094
|
+
id: node.id,
|
|
1095
|
+
point: signal(node.point),
|
|
1096
|
+
draggable: signal(node.draggable ?? NODE_DEFAULTS.draggable),
|
|
1097
|
+
parentId: signal(node.parentId ?? NODE_DEFAULTS.parentId),
|
|
1098
|
+
preview: signal(node.preview ?? NODE_DEFAULTS.preview),
|
|
1099
|
+
selected: signal(node.selected ?? NODE_DEFAULTS.selected),
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
else {
|
|
1103
|
+
return {
|
|
1104
|
+
id: node.id,
|
|
1105
|
+
point: signal(node.point),
|
|
1106
|
+
draggable: isDefined(node.draggable) ? signal(node.draggable) : undefined,
|
|
1107
|
+
parentId: isDefined(node.parentId) ? signal(node.parentId) : undefined,
|
|
1108
|
+
preview: isDefined(node.preview) ? signal(node.preview) : undefined,
|
|
1109
|
+
selected: isDefined(node.selected) ? signal(node.selected) : undefined,
|
|
1110
|
+
};
|
|
1045
1111
|
}
|
|
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
1112
|
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1113
|
+
// Реализация
|
|
1114
|
+
function createNode(node, options = { useDefaults: true }) {
|
|
1115
|
+
const baseNode = createBaseNode(node, options.useDefaults);
|
|
1116
|
+
if (node.type === 'default') {
|
|
1117
|
+
if (options.useDefaults) {
|
|
1118
|
+
return {
|
|
1119
|
+
...baseNode,
|
|
1120
|
+
type: 'default',
|
|
1121
|
+
text: signal(node.text ?? ''),
|
|
1122
|
+
width: signal(node.width ?? NODE_DEFAULTS.width),
|
|
1123
|
+
height: signal(node.height ?? NODE_DEFAULTS.height),
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
else {
|
|
1127
|
+
return {
|
|
1128
|
+
...baseNode,
|
|
1129
|
+
type: 'default',
|
|
1130
|
+
text: isDefined(node.text) ? signal(node.text) : undefined,
|
|
1131
|
+
width: isDefined(node.width) ? signal(node.width) : undefined,
|
|
1132
|
+
height: isDefined(node.height) ? signal(node.height) : undefined,
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
if (node.type === 'html-template') {
|
|
1137
|
+
if (options.useDefaults) {
|
|
1138
|
+
return {
|
|
1139
|
+
...baseNode,
|
|
1140
|
+
type: 'html-template',
|
|
1141
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1142
|
+
width: signal(node.width ?? NODE_DEFAULTS.width),
|
|
1143
|
+
height: signal(node.height ?? NODE_DEFAULTS.height),
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
else {
|
|
1147
|
+
return {
|
|
1148
|
+
...baseNode,
|
|
1149
|
+
type: 'html-template',
|
|
1150
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1151
|
+
width: isDefined(node.width) ? signal(node.width) : undefined,
|
|
1152
|
+
height: isDefined(node.height) ? signal(node.height) : undefined,
|
|
1153
|
+
};
|
|
1059
1154
|
}
|
|
1060
1155
|
}
|
|
1061
|
-
|
|
1156
|
+
if (node.type === 'svg-template') {
|
|
1157
|
+
const width = signal(node.width);
|
|
1158
|
+
const height = signal(node.height);
|
|
1159
|
+
if (options.useDefaults) {
|
|
1160
|
+
return {
|
|
1161
|
+
...baseNode,
|
|
1162
|
+
type: 'svg-template',
|
|
1163
|
+
width,
|
|
1164
|
+
height,
|
|
1165
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
else {
|
|
1169
|
+
return {
|
|
1170
|
+
...baseNode,
|
|
1171
|
+
type: 'svg-template',
|
|
1172
|
+
width,
|
|
1173
|
+
height,
|
|
1174
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
if (node.type === 'default-group') {
|
|
1179
|
+
const width = signal(node.width);
|
|
1180
|
+
const height = signal(node.height);
|
|
1181
|
+
if (options.useDefaults) {
|
|
1182
|
+
return {
|
|
1183
|
+
...baseNode,
|
|
1184
|
+
type: 'default-group',
|
|
1185
|
+
width,
|
|
1186
|
+
height,
|
|
1187
|
+
color: signal(node.color ?? NODE_DEFAULTS.color),
|
|
1188
|
+
resizable: signal(node.resizable ?? NODE_DEFAULTS.resizable),
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
else {
|
|
1192
|
+
return {
|
|
1193
|
+
...baseNode,
|
|
1194
|
+
type: 'default-group',
|
|
1195
|
+
width,
|
|
1196
|
+
height,
|
|
1197
|
+
color: isDefined(node.color) ? signal(node.color) : undefined,
|
|
1198
|
+
resizable: isDefined(node.resizable) ? signal(node.resizable) : undefined,
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
if (node.type === 'template-group') {
|
|
1203
|
+
const width = signal(node.width);
|
|
1204
|
+
const height = signal(node.height);
|
|
1205
|
+
if (options.useDefaults) {
|
|
1206
|
+
return {
|
|
1207
|
+
...baseNode,
|
|
1208
|
+
type: 'template-group',
|
|
1209
|
+
width,
|
|
1210
|
+
height,
|
|
1211
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
else {
|
|
1215
|
+
return {
|
|
1216
|
+
...baseNode,
|
|
1217
|
+
type: 'template-group',
|
|
1218
|
+
width,
|
|
1219
|
+
height,
|
|
1220
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
if (isCustomNodeComponent(node.type) || isCallable(node.type)) {
|
|
1225
|
+
if (options.useDefaults) {
|
|
1226
|
+
return {
|
|
1227
|
+
...baseNode,
|
|
1228
|
+
type: node.type,
|
|
1229
|
+
data: signal(node.data ?? NODE_DEFAULTS.data),
|
|
1230
|
+
width: signal(node.width ?? NODE_DEFAULTS.width),
|
|
1231
|
+
height: signal(node.height ?? NODE_DEFAULTS.height),
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
else {
|
|
1235
|
+
return {
|
|
1236
|
+
...baseNode,
|
|
1237
|
+
type: node.type,
|
|
1238
|
+
data: isDefined(node.data) ? signal(node.data) : undefined,
|
|
1239
|
+
width: isDefined(node.width) ? signal(node.width) : undefined,
|
|
1240
|
+
height: isDefined(node.height) ? signal(node.height) : undefined,
|
|
1241
|
+
};
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
throw new Error(`Unknown node type for node with id ${node.id}`);
|
|
1245
|
+
}
|
|
1246
|
+
function createNodes(nodes, options = { useDefaults: true }) {
|
|
1247
|
+
if (options.useDefaults) {
|
|
1248
|
+
return nodes.map((node) => createNode(node, { useDefaults: true }));
|
|
1249
|
+
}
|
|
1250
|
+
else {
|
|
1251
|
+
return nodes.map((node) => createNode(node, { useDefaults: false }));
|
|
1252
|
+
}
|
|
1062
1253
|
}
|
|
1063
1254
|
|
|
1255
|
+
// this is a number to fix visual artifact in chrome.
|
|
1256
|
+
// the bug reproduces if edgeLabelWrapperRef size fully matched the size of parent foreignObject
|
|
1257
|
+
const MAGIC_NUMBER_TO_FIX_GLITCH_IN_CHROME = 2;
|
|
1258
|
+
|
|
1064
1259
|
// MIT License
|
|
1065
1260
|
// Copyright (c) 2023 Chau Tran
|
|
1066
1261
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
@@ -1172,10 +1367,10 @@ class NodeRenderingService {
|
|
|
1172
1367
|
// pull children
|
|
1173
1368
|
node.children().forEach((n) => this.pullNode(n));
|
|
1174
1369
|
}
|
|
1175
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1176
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1370
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeRenderingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1371
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeRenderingService }); }
|
|
1177
1372
|
}
|
|
1178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeRenderingService, decorators: [{
|
|
1179
1374
|
type: Injectable
|
|
1180
1375
|
}] });
|
|
1181
1376
|
|
|
@@ -1194,9 +1389,6 @@ function extendedComputed(computedCallback, options) {
|
|
|
1194
1389
|
}
|
|
1195
1390
|
|
|
1196
1391
|
class NodeModel {
|
|
1197
|
-
static { this.defaultWidth = 100; }
|
|
1198
|
-
static { this.defaultHeight = 50; }
|
|
1199
|
-
static { this.defaultColor = '#1b262c'; }
|
|
1200
1392
|
constructor(rawNode) {
|
|
1201
1393
|
this.rawNode = rawNode;
|
|
1202
1394
|
this.entitiesService = inject(FlowEntitiesService);
|
|
@@ -1204,8 +1396,8 @@ class NodeModel {
|
|
|
1204
1396
|
this.nodeRenderingService = inject(NodeRenderingService);
|
|
1205
1397
|
this.isVisible = signal(false);
|
|
1206
1398
|
this.point = signal({ x: 0, y: 0 });
|
|
1207
|
-
this.width = signal(
|
|
1208
|
-
this.height = signal(
|
|
1399
|
+
this.width = signal(NODE_DEFAULTS.width);
|
|
1400
|
+
this.height = signal(NODE_DEFAULTS.height);
|
|
1209
1401
|
/**
|
|
1210
1402
|
* @deprecated use width or height signals
|
|
1211
1403
|
*/
|
|
@@ -1239,7 +1431,7 @@ class NodeModel {
|
|
|
1239
1431
|
// disabled for configuration for now
|
|
1240
1432
|
this.magnetRadius = 20;
|
|
1241
1433
|
// TODO: not sure if we need to statically store it
|
|
1242
|
-
this.isComponentType =
|
|
1434
|
+
this.isComponentType = isComponentNode(this.rawNode);
|
|
1243
1435
|
this.shouldLoad = extendedComputed((previousShouldLoad) => {
|
|
1244
1436
|
if (previousShouldLoad) {
|
|
1245
1437
|
return true;
|
|
@@ -1252,10 +1444,6 @@ class NodeModel {
|
|
|
1252
1444
|
if (isCustomNodeComponent(this.rawNode.type)) {
|
|
1253
1445
|
return true;
|
|
1254
1446
|
}
|
|
1255
|
-
// Immediately load component if it's a plain class
|
|
1256
|
-
if (isCustomDynamicNodeComponent(this.rawNode.type)) {
|
|
1257
|
-
return true;
|
|
1258
|
-
}
|
|
1259
1447
|
// For cases
|
|
1260
1448
|
// - if it's a factory with dynamic import
|
|
1261
1449
|
// - if it's a template (html, svg, group)
|
|
@@ -1274,63 +1462,67 @@ class NodeModel {
|
|
|
1274
1462
|
// @ts-expect-error we assume it's a function with dynamic import
|
|
1275
1463
|
switchMap(() => this.rawNode.type()), catchError(() => of(this.rawNode.type)), shareReplay(1));
|
|
1276
1464
|
// Default node specific thing
|
|
1277
|
-
this.text = signal(
|
|
1465
|
+
this.text = signal(NODE_DEFAULTS.text);
|
|
1278
1466
|
// Component node specific thing
|
|
1279
1467
|
this.componentTypeInputs = {
|
|
1280
1468
|
node: this.rawNode,
|
|
1281
1469
|
};
|
|
1282
1470
|
this.parent = computed(() => this.entitiesService.nodes().find((n) => n.rawNode.id === this.parentId()) ?? null);
|
|
1283
1471
|
this.children = computed(() => this.entitiesService.nodes().filter((n) => n.parentId() === this.rawNode.id));
|
|
1284
|
-
this.color = signal(
|
|
1472
|
+
this.color = signal(NODE_DEFAULTS.color);
|
|
1285
1473
|
this.controlledByResizer = signal(false);
|
|
1286
|
-
this.resizable = signal(
|
|
1474
|
+
this.resizable = signal(NODE_DEFAULTS.resizable);
|
|
1287
1475
|
this.resizing = signal(false);
|
|
1288
1476
|
this.resizerTemplate = signal(null);
|
|
1289
1477
|
this.context = {
|
|
1290
1478
|
$implicit: {},
|
|
1291
1479
|
};
|
|
1292
|
-
this.parentId = signal(
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
this.point = internalNode.point;
|
|
1480
|
+
this.parentId = signal(NODE_DEFAULTS.parentId);
|
|
1481
|
+
if (rawNode.point) {
|
|
1482
|
+
this.point = rawNode.point;
|
|
1296
1483
|
}
|
|
1297
|
-
if (
|
|
1298
|
-
this.width =
|
|
1484
|
+
if (rawNode.width) {
|
|
1485
|
+
this.width = rawNode.width;
|
|
1299
1486
|
}
|
|
1300
|
-
if (
|
|
1301
|
-
this.height =
|
|
1487
|
+
if (rawNode.height) {
|
|
1488
|
+
this.height = rawNode.height;
|
|
1302
1489
|
}
|
|
1303
|
-
if (
|
|
1304
|
-
this.draggable =
|
|
1490
|
+
if (rawNode.draggable) {
|
|
1491
|
+
this.draggable = rawNode.draggable;
|
|
1305
1492
|
}
|
|
1306
|
-
if (
|
|
1307
|
-
this.parentId =
|
|
1493
|
+
if (rawNode.parentId) {
|
|
1494
|
+
this.parentId = rawNode.parentId;
|
|
1308
1495
|
}
|
|
1309
|
-
if (
|
|
1310
|
-
this.preview =
|
|
1496
|
+
if (rawNode.preview) {
|
|
1497
|
+
this.preview = rawNode.preview;
|
|
1311
1498
|
}
|
|
1312
|
-
if (
|
|
1313
|
-
this.
|
|
1499
|
+
if (rawNode.selected) {
|
|
1500
|
+
this.selected = rawNode.selected;
|
|
1314
1501
|
}
|
|
1315
|
-
if (
|
|
1316
|
-
this.
|
|
1502
|
+
if (rawNode.type === 'default-group' && rawNode.color) {
|
|
1503
|
+
this.color = rawNode.color;
|
|
1317
1504
|
}
|
|
1318
|
-
if (
|
|
1319
|
-
this.
|
|
1505
|
+
if (rawNode.type === 'default-group' && rawNode.resizable) {
|
|
1506
|
+
this.resizable = rawNode.resizable;
|
|
1320
1507
|
}
|
|
1321
|
-
if (
|
|
1508
|
+
if (rawNode.type === 'default' && rawNode.text) {
|
|
1509
|
+
this.text = rawNode.text;
|
|
1510
|
+
}
|
|
1511
|
+
if (rawNode.type === 'html-template') {
|
|
1322
1512
|
this.context = {
|
|
1323
1513
|
$implicit: {
|
|
1324
1514
|
node: rawNode,
|
|
1515
|
+
data: rawNode.data ?? signal(NODE_DEFAULTS.data),
|
|
1325
1516
|
selected: this.selected.asReadonly(),
|
|
1326
1517
|
shouldLoad: this.shouldLoad,
|
|
1327
1518
|
},
|
|
1328
1519
|
};
|
|
1329
1520
|
}
|
|
1330
|
-
if (
|
|
1521
|
+
if (rawNode.type === 'svg-template') {
|
|
1331
1522
|
this.context = {
|
|
1332
1523
|
$implicit: {
|
|
1333
1524
|
node: rawNode,
|
|
1525
|
+
data: rawNode.data ?? signal(NODE_DEFAULTS.data),
|
|
1334
1526
|
selected: this.selected.asReadonly(),
|
|
1335
1527
|
width: this.width.asReadonly(),
|
|
1336
1528
|
height: this.height.asReadonly(),
|
|
@@ -1338,10 +1530,11 @@ class NodeModel {
|
|
|
1338
1530
|
},
|
|
1339
1531
|
};
|
|
1340
1532
|
}
|
|
1341
|
-
if (
|
|
1533
|
+
if (rawNode.type === 'template-group') {
|
|
1342
1534
|
this.context = {
|
|
1343
1535
|
$implicit: {
|
|
1344
1536
|
node: rawNode,
|
|
1537
|
+
data: rawNode.data ?? signal(NODE_DEFAULTS.data),
|
|
1345
1538
|
selected: this.selected.asReadonly(),
|
|
1346
1539
|
width: this.width.asReadonly(),
|
|
1347
1540
|
height: this.height.asReadonly(),
|
|
@@ -1362,6 +1555,61 @@ class NodeModel {
|
|
|
1362
1555
|
}
|
|
1363
1556
|
}
|
|
1364
1557
|
|
|
1558
|
+
const EDGE_DEFAULTS = {
|
|
1559
|
+
type: 'default',
|
|
1560
|
+
curve: 'bezier',
|
|
1561
|
+
data: {},
|
|
1562
|
+
edgeLabels: {},
|
|
1563
|
+
markers: {},
|
|
1564
|
+
reconnectable: false,
|
|
1565
|
+
floating: false,
|
|
1566
|
+
selected: false,
|
|
1567
|
+
};
|
|
1568
|
+
function createEdge(edge, options = { useDefaults: true }) {
|
|
1569
|
+
if (options.useDefaults) {
|
|
1570
|
+
return {
|
|
1571
|
+
id: edge.id,
|
|
1572
|
+
type: edge.type ?? EDGE_DEFAULTS.type,
|
|
1573
|
+
source: edge.source,
|
|
1574
|
+
target: edge.target,
|
|
1575
|
+
sourceHandle: edge.sourceHandle ?? '',
|
|
1576
|
+
targetHandle: edge.targetHandle ?? '',
|
|
1577
|
+
curve: signal(edge.curve ?? EDGE_DEFAULTS.curve),
|
|
1578
|
+
data: signal(edge.data ?? EDGE_DEFAULTS.data),
|
|
1579
|
+
edgeLabels: signal(edge.edgeLabels ?? EDGE_DEFAULTS.edgeLabels),
|
|
1580
|
+
markers: signal(edge.markers ?? EDGE_DEFAULTS.markers),
|
|
1581
|
+
reconnectable: signal(edge.reconnectable ?? EDGE_DEFAULTS.reconnectable),
|
|
1582
|
+
floating: signal(edge.floating ?? EDGE_DEFAULTS.floating),
|
|
1583
|
+
selected: signal(edge.selected ?? EDGE_DEFAULTS.selected),
|
|
1584
|
+
};
|
|
1585
|
+
}
|
|
1586
|
+
else {
|
|
1587
|
+
return {
|
|
1588
|
+
id: edge.id,
|
|
1589
|
+
type: edge.type,
|
|
1590
|
+
source: edge.source,
|
|
1591
|
+
target: edge.target,
|
|
1592
|
+
sourceHandle: edge.sourceHandle,
|
|
1593
|
+
targetHandle: edge.targetHandle,
|
|
1594
|
+
curve: isDefined(edge.curve) ? signal(edge.curve) : undefined,
|
|
1595
|
+
data: isDefined(edge.data) ? signal(edge.data) : undefined,
|
|
1596
|
+
edgeLabels: isDefined(edge.edgeLabels) ? signal(edge.edgeLabels) : undefined,
|
|
1597
|
+
markers: isDefined(edge.markers) ? signal(edge.markers) : undefined,
|
|
1598
|
+
reconnectable: isDefined(edge.reconnectable) ? signal(edge.reconnectable) : undefined,
|
|
1599
|
+
floating: isDefined(edge.floating) ? signal(edge.floating) : undefined,
|
|
1600
|
+
selected: isDefined(edge.selected) ? signal(edge.selected) : undefined,
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
function createEdges(edges, options = { useDefaults: true }) {
|
|
1605
|
+
if (options.useDefaults) {
|
|
1606
|
+
return edges.map((edge) => createEdge(edge, { useDefaults: true }));
|
|
1607
|
+
}
|
|
1608
|
+
else {
|
|
1609
|
+
return edges.map((edge) => createEdge(edge, { useDefaults: false }));
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1365
1613
|
class EdgeLabelModel {
|
|
1366
1614
|
constructor(edgeLabel) {
|
|
1367
1615
|
this.edgeLabel = edgeLabel;
|
|
@@ -1689,7 +1937,12 @@ class EdgeModel {
|
|
|
1689
1937
|
this.flowEntitiesService = inject(FlowEntitiesService);
|
|
1690
1938
|
this.source = signal(undefined);
|
|
1691
1939
|
this.target = signal(undefined);
|
|
1692
|
-
this.
|
|
1940
|
+
this.curve = signal(EDGE_DEFAULTS.curve);
|
|
1941
|
+
this.reconnectable = signal(EDGE_DEFAULTS.reconnectable);
|
|
1942
|
+
this.floating = signal(EDGE_DEFAULTS.floating);
|
|
1943
|
+
this.markers = signal(EDGE_DEFAULTS.markers);
|
|
1944
|
+
this.edgeLabels = signal(EDGE_DEFAULTS.edgeLabels);
|
|
1945
|
+
this.selected = signal(EDGE_DEFAULTS.selected);
|
|
1693
1946
|
this.selected$ = toObservable(this.selected);
|
|
1694
1947
|
this.shouldLoad = computed(() => (this.source()?.shouldLoad() ?? false) && (this.target()?.shouldLoad() ?? false));
|
|
1695
1948
|
this.renderOrder = signal(0);
|
|
@@ -1724,7 +1977,8 @@ class EdgeModel {
|
|
|
1724
1977
|
return { path: '' };
|
|
1725
1978
|
}
|
|
1726
1979
|
const params = this.getPathFactoryParams(source, target);
|
|
1727
|
-
|
|
1980
|
+
const curve = this.curve();
|
|
1981
|
+
switch (curve) {
|
|
1728
1982
|
case 'straight':
|
|
1729
1983
|
return straightPath(params);
|
|
1730
1984
|
case 'bezier':
|
|
@@ -1734,12 +1988,12 @@ class EdgeModel {
|
|
|
1734
1988
|
case 'step':
|
|
1735
1989
|
return smoothStepPath(params, 0);
|
|
1736
1990
|
default:
|
|
1737
|
-
return
|
|
1991
|
+
return curve(params);
|
|
1738
1992
|
}
|
|
1739
1993
|
});
|
|
1740
1994
|
this.sourceHandle = extendedComputed((previousHandle) => {
|
|
1741
1995
|
let handle = null;
|
|
1742
|
-
if (this.floating) {
|
|
1996
|
+
if (this.floating()) {
|
|
1743
1997
|
handle = this.closestHandles().sourceHandle;
|
|
1744
1998
|
}
|
|
1745
1999
|
else {
|
|
@@ -1767,7 +2021,7 @@ class EdgeModel {
|
|
|
1767
2021
|
});
|
|
1768
2022
|
this.targetHandle = extendedComputed((previousHandle) => {
|
|
1769
2023
|
let handle = null;
|
|
1770
|
-
if (this.floating) {
|
|
2024
|
+
if (this.floating()) {
|
|
1771
2025
|
handle = this.closestHandles().targetHandle;
|
|
1772
2026
|
}
|
|
1773
2027
|
else {
|
|
@@ -1831,24 +2085,48 @@ class EdgeModel {
|
|
|
1831
2085
|
targetHandle: closestTargetHandle,
|
|
1832
2086
|
};
|
|
1833
2087
|
});
|
|
1834
|
-
/**
|
|
1835
|
-
* TODO: not reactive
|
|
1836
|
-
*/
|
|
1837
2088
|
this.markerStartUrl = computed(() => {
|
|
1838
|
-
const marker = this.
|
|
2089
|
+
const marker = this.markers()?.start;
|
|
1839
2090
|
return marker ? `url(#${hashCode(JSON.stringify(marker))})` : '';
|
|
1840
2091
|
});
|
|
1841
|
-
/**
|
|
1842
|
-
* TODO: not reactive
|
|
1843
|
-
*/
|
|
1844
2092
|
this.markerEndUrl = computed(() => {
|
|
1845
|
-
const marker = this.
|
|
2093
|
+
const marker = this.markers()?.end;
|
|
1846
2094
|
return marker ? `url(#${hashCode(JSON.stringify(marker))})` : '';
|
|
1847
2095
|
});
|
|
2096
|
+
this.labelModels = computed(() => {
|
|
2097
|
+
const models = {};
|
|
2098
|
+
const labels = this.edgeLabels();
|
|
2099
|
+
if (labels?.start)
|
|
2100
|
+
models.start = new EdgeLabelModel(labels.start);
|
|
2101
|
+
if (labels?.center)
|
|
2102
|
+
models.center = new EdgeLabelModel(labels.center);
|
|
2103
|
+
if (labels?.end)
|
|
2104
|
+
models.end = new EdgeLabelModel(labels.end);
|
|
2105
|
+
return models;
|
|
2106
|
+
});
|
|
2107
|
+
this.type = edge.type ?? EDGE_DEFAULTS.type;
|
|
2108
|
+
if (edge.curve) {
|
|
2109
|
+
this.curve = edge.curve;
|
|
2110
|
+
}
|
|
2111
|
+
if (edge.reconnectable) {
|
|
2112
|
+
this.reconnectable = edge.reconnectable;
|
|
2113
|
+
}
|
|
2114
|
+
if (edge.floating) {
|
|
2115
|
+
this.floating = edge.floating;
|
|
2116
|
+
}
|
|
2117
|
+
if (edge.selected) {
|
|
2118
|
+
this.selected = edge.selected;
|
|
2119
|
+
}
|
|
2120
|
+
if (edge.markers) {
|
|
2121
|
+
this.markers = edge.markers;
|
|
2122
|
+
}
|
|
2123
|
+
if (edge.edgeLabels) {
|
|
2124
|
+
this.edgeLabels = edge.edgeLabels;
|
|
2125
|
+
}
|
|
1848
2126
|
this.context = {
|
|
1849
2127
|
$implicit: {
|
|
1850
|
-
// TODO: check if edge could change
|
|
1851
2128
|
edge: this.edge,
|
|
2129
|
+
data: this.edge.data ?? signal({}),
|
|
1852
2130
|
path: computed(() => this.path().path),
|
|
1853
2131
|
markerStart: this.markerStartUrl,
|
|
1854
2132
|
markerEnd: this.markerEndUrl,
|
|
@@ -1856,17 +2134,7 @@ class EdgeModel {
|
|
|
1856
2134
|
shouldLoad: this.shouldLoad,
|
|
1857
2135
|
},
|
|
1858
2136
|
};
|
|
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);
|
|
2137
|
+
this.selected$ = toObservable(this.selected);
|
|
1870
2138
|
}
|
|
1871
2139
|
getPathFactoryParams(source, target) {
|
|
1872
2140
|
return {
|
|
@@ -1937,10 +2205,10 @@ class NodesChangeService {
|
|
|
1937
2205
|
// you can't get valid list of detached edges
|
|
1938
2206
|
observeOn(asyncScheduler, DELAY_FOR_SCHEDULER));
|
|
1939
2207
|
}
|
|
1940
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1941
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2208
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodesChangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2209
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodesChangeService }); }
|
|
1942
2210
|
}
|
|
1943
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodesChangeService, decorators: [{
|
|
1944
2212
|
type: Injectable
|
|
1945
2213
|
}] });
|
|
1946
2214
|
|
|
@@ -1975,10 +2243,10 @@ class EdgeChangesService {
|
|
|
1975
2243
|
// right after [nodes] input change
|
|
1976
2244
|
observeOn(asyncScheduler));
|
|
1977
2245
|
}
|
|
1978
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1979
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2246
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeChangesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2247
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeChangesService }); }
|
|
1980
2248
|
}
|
|
1981
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeChangesService, decorators: [{
|
|
1982
2250
|
type: Injectable
|
|
1983
2251
|
}] });
|
|
1984
2252
|
|
|
@@ -1987,135 +2255,39 @@ class ChangesControllerDirective {
|
|
|
1987
2255
|
this.nodesChangeService = inject(NodesChangeService);
|
|
1988
2256
|
this.edgesChangeService = inject(EdgeChangesService);
|
|
1989
2257
|
/**
|
|
1990
|
-
* Watch nodes
|
|
1991
|
-
*/
|
|
1992
|
-
this.onNodesChange = outputFromObservable(this.nodesChangeService.changes$);
|
|
1993
|
-
this.onNodesChangePosition = outputFromObservable(this.nodeChangesOfType('position'), {
|
|
1994
|
-
alias: 'onNodesChange.position',
|
|
1995
|
-
});
|
|
1996
|
-
/**
|
|
1997
|
-
* @deprecated use `onNodesChange.position` instead
|
|
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',
|
|
2006
|
-
});
|
|
2007
|
-
/**
|
|
2008
|
-
* @deprecated use `onNodesChange.size` instead
|
|
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',
|
|
2021
|
-
});
|
|
2022
|
-
/**
|
|
2023
|
-
* @deprecated use `onNodesChange.add` instead
|
|
2258
|
+
* Watch nodes changes
|
|
2024
2259
|
*/
|
|
2025
|
-
this.
|
|
2026
|
-
|
|
2260
|
+
this.nodesChanges = outputFromObservable(this.nodesChangeService.changes$);
|
|
2261
|
+
this.nodesChangesPosition = outputFromObservable(this.nodeChangesOfType('position'), {
|
|
2262
|
+
alias: 'nodesChanges.position',
|
|
2027
2263
|
});
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
*/
|
|
2031
|
-
this.onNodesChangeAddMany = outputFromObservable(this.manyChanges(this.nodeChangesOfType('add')), {
|
|
2032
|
-
alias: 'onNodesChange.add.many',
|
|
2264
|
+
this.nodesChangesSize = outputFromObservable(this.nodeChangesOfType('size'), {
|
|
2265
|
+
alias: 'nodesChanges.size',
|
|
2033
2266
|
});
|
|
2034
|
-
this.
|
|
2035
|
-
alias: '
|
|
2267
|
+
this.nodesChangesAdd = outputFromObservable(this.nodeChangesOfType('add'), {
|
|
2268
|
+
alias: 'nodesChanges.add',
|
|
2036
2269
|
});
|
|
2037
|
-
|
|
2038
|
-
|
|
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',
|
|
2270
|
+
this.nodesChangesRemove = outputFromObservable(this.nodeChangesOfType('remove'), {
|
|
2271
|
+
alias: 'nodesChanges.remove',
|
|
2046
2272
|
});
|
|
2047
|
-
this.
|
|
2048
|
-
alias: '
|
|
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',
|
|
2273
|
+
this.nodesChangesSelect = outputFromObservable(this.nodeChangesOfType('select'), {
|
|
2274
|
+
alias: 'nodesChanges.select',
|
|
2059
2275
|
});
|
|
2060
2276
|
/**
|
|
2061
2277
|
* Watch edges change
|
|
2062
2278
|
*/
|
|
2063
|
-
this.
|
|
2064
|
-
this.
|
|
2065
|
-
alias: '
|
|
2279
|
+
this.edgesChanges = outputFromObservable(this.edgesChangeService.changes$);
|
|
2280
|
+
this.edgesChangesDetached = outputFromObservable(this.edgeChangesOfType('detached'), {
|
|
2281
|
+
alias: 'edgesChanges.detached',
|
|
2066
2282
|
});
|
|
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',
|
|
2283
|
+
this.edgesChangesAdd = outputFromObservable(this.edgeChangesOfType('add'), {
|
|
2284
|
+
alias: 'edgesChanges.add',
|
|
2077
2285
|
});
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
*/
|
|
2081
|
-
this.onEdgeChangeAddSingle = outputFromObservable(this.singleChange(this.edgeChangesOfType('add')), {
|
|
2082
|
-
alias: 'onEdgesChange.add.single',
|
|
2286
|
+
this.edgesChangesRemove = outputFromObservable(this.edgeChangesOfType('remove'), {
|
|
2287
|
+
alias: 'edgesChanges.remove',
|
|
2083
2288
|
});
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
*/
|
|
2087
|
-
this.onEdgeChangeAddMany = outputFromObservable(this.manyChanges(this.edgeChangesOfType('add')), {
|
|
2088
|
-
alias: 'onEdgesChange.add.many',
|
|
2089
|
-
});
|
|
2090
|
-
this.onEdgeChangeRemove = outputFromObservable(this.edgeChangesOfType('remove'), {
|
|
2091
|
-
alias: 'onEdgesChange.remove',
|
|
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',
|
|
2289
|
+
this.edgesChangesSelect = outputFromObservable(this.edgeChangesOfType('select'), {
|
|
2290
|
+
alias: 'edgesChanges.select',
|
|
2119
2291
|
});
|
|
2120
2292
|
}
|
|
2121
2293
|
nodeChangesOfType(type) {
|
|
@@ -2124,16 +2296,10 @@ class ChangesControllerDirective {
|
|
|
2124
2296
|
edgeChangesOfType(type) {
|
|
2125
2297
|
return this.edgesChangeService.changes$.pipe(map((changes) => changes.filter((c) => c.type === type)), filter((changes) => !!changes.length));
|
|
2126
2298
|
}
|
|
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 }); }
|
|
2299
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ChangesControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2300
|
+
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
2301
|
}
|
|
2136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2302
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ChangesControllerDirective, decorators: [{
|
|
2137
2303
|
type: Directive,
|
|
2138
2304
|
args: [{
|
|
2139
2305
|
selector: '[changesController]',
|
|
@@ -2185,10 +2351,10 @@ class RootPointerDirective {
|
|
|
2185
2351
|
setInitialTouch(event) {
|
|
2186
2352
|
this.initialTouch$.next(event);
|
|
2187
2353
|
}
|
|
2188
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2189
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2354
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootPointerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2355
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: RootPointerDirective, isStandalone: true, selector: "svg[rootPointer]", ngImport: i0 }); }
|
|
2190
2356
|
}
|
|
2191
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootPointerDirective, decorators: [{
|
|
2192
2358
|
type: Directive,
|
|
2193
2359
|
args: [{
|
|
2194
2360
|
standalone: true,
|
|
@@ -2201,20 +2367,24 @@ class SpacePointContextDirective {
|
|
|
2201
2367
|
this.pointerMovementDirective = inject(RootPointerDirective);
|
|
2202
2368
|
this.rootSvg = inject(RootSvgReferenceDirective).element;
|
|
2203
2369
|
this.host = inject(ElementRef).nativeElement;
|
|
2370
|
+
this.viewportService = inject(ViewportService);
|
|
2204
2371
|
/**
|
|
2205
2372
|
* Signal with current mouse position in svg space
|
|
2206
2373
|
*/
|
|
2207
2374
|
this.svgCurrentSpacePoint = computed(() => {
|
|
2208
|
-
|
|
2209
|
-
|
|
2375
|
+
// Add dependency on viewport to recalculate when auto-pan changes viewport
|
|
2376
|
+
// TODO: hacky solution, need to find a better way
|
|
2377
|
+
this.viewportService.readableViewport();
|
|
2378
|
+
const point = this.currentPoint();
|
|
2379
|
+
if (!point) {
|
|
2210
2380
|
return { x: 0, y: 0 };
|
|
2211
2381
|
}
|
|
2212
2382
|
return this.documentPointToFlowPoint({
|
|
2213
|
-
x:
|
|
2214
|
-
y:
|
|
2383
|
+
x: point.x,
|
|
2384
|
+
y: point.y,
|
|
2215
2385
|
});
|
|
2216
2386
|
});
|
|
2217
|
-
this.
|
|
2387
|
+
this.currentPoint = toSignal(this.pointerMovementDirective.pointerMovement$);
|
|
2218
2388
|
}
|
|
2219
2389
|
documentPointToFlowPoint(documentPoint) {
|
|
2220
2390
|
const point = this.rootSvg.createSVGPoint();
|
|
@@ -2222,10 +2392,10 @@ class SpacePointContextDirective {
|
|
|
2222
2392
|
point.y = documentPoint.y;
|
|
2223
2393
|
return point.matrixTransform(this.host.getScreenCTM().inverse());
|
|
2224
2394
|
}
|
|
2225
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2226
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2395
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpacePointContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2396
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: SpacePointContextDirective, isStandalone: true, selector: "g[spacePointContext]", ngImport: i0 }); }
|
|
2227
2397
|
}
|
|
2228
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SpacePointContextDirective, decorators: [{
|
|
2229
2399
|
type: Directive,
|
|
2230
2400
|
args: [{
|
|
2231
2401
|
standalone: true,
|
|
@@ -2266,8 +2436,8 @@ class OverlaysService {
|
|
|
2266
2436
|
removeToolbar(toolbar) {
|
|
2267
2437
|
this.toolbars.update((toolbars) => toolbars.filter((t) => t !== toolbar));
|
|
2268
2438
|
}
|
|
2269
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2270
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2439
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: OverlaysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2440
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: OverlaysService }); }
|
|
2271
2441
|
}
|
|
2272
2442
|
__decorate([
|
|
2273
2443
|
Microtask
|
|
@@ -2275,7 +2445,7 @@ __decorate([
|
|
|
2275
2445
|
__decorate([
|
|
2276
2446
|
Microtask
|
|
2277
2447
|
], OverlaysService.prototype, "removeToolbar", null);
|
|
2278
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2448
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: OverlaysService, decorators: [{
|
|
2279
2449
|
type: Injectable
|
|
2280
2450
|
}], propDecorators: { addToolbar: [], removeToolbar: [] } });
|
|
2281
2451
|
|
|
@@ -2349,26 +2519,34 @@ class EdgeLabelComponent {
|
|
|
2349
2519
|
},
|
|
2350
2520
|
};
|
|
2351
2521
|
}
|
|
2352
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2353
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2522
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2523
|
+
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
2524
|
}
|
|
2355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeLabelComponent, decorators: [{
|
|
2356
2526
|
type: Component,
|
|
2357
|
-
args: [{
|
|
2527
|
+
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
2528
|
}] });
|
|
2359
2529
|
|
|
2360
2530
|
/**
|
|
2361
|
-
*
|
|
2362
|
-
*
|
|
2363
|
-
* it returns nodes where source === target and
|
|
2364
|
-
* handles where sourceHandle === targetHandle
|
|
2531
|
+
* Adjust connection direction based on handle types.
|
|
2532
|
+
*
|
|
2365
2533
|
*
|
|
2366
|
-
* This leads to that notSelfValidator returns false for these cases,
|
|
2367
|
-
* exactly what we need for strict connection type
|
|
2368
2534
|
*/
|
|
2369
2535
|
function adjustDirection(connection) {
|
|
2536
|
+
const sourceType = connection.sourceHandle.rawHandle.type;
|
|
2537
|
+
const targetType = connection.targetHandle.rawHandle.type;
|
|
2538
|
+
// If both handles are of the same type, preserve the original
|
|
2539
|
+
// source/target mapping
|
|
2540
|
+
if (sourceType === targetType) {
|
|
2541
|
+
return {
|
|
2542
|
+
source: connection.source,
|
|
2543
|
+
sourceHandle: connection.sourceHandle,
|
|
2544
|
+
target: connection.target,
|
|
2545
|
+
targetHandle: connection.targetHandle,
|
|
2546
|
+
};
|
|
2547
|
+
}
|
|
2370
2548
|
const result = {};
|
|
2371
|
-
if (
|
|
2549
|
+
if (sourceType === 'source') {
|
|
2372
2550
|
result.source = connection.source;
|
|
2373
2551
|
result.sourceHandle = connection.sourceHandle;
|
|
2374
2552
|
}
|
|
@@ -2376,7 +2554,7 @@ function adjustDirection(connection) {
|
|
|
2376
2554
|
result.source = connection.target;
|
|
2377
2555
|
result.sourceHandle = connection.targetHandle;
|
|
2378
2556
|
}
|
|
2379
|
-
if (
|
|
2557
|
+
if (targetType === 'target') {
|
|
2380
2558
|
result.target = connection.target;
|
|
2381
2559
|
result.targetHandle = connection.targetHandle;
|
|
2382
2560
|
}
|
|
@@ -2387,10 +2565,112 @@ function adjustDirection(connection) {
|
|
|
2387
2565
|
return result;
|
|
2388
2566
|
}
|
|
2389
2567
|
|
|
2568
|
+
function connectStartEventFromConnectionStartStatus(status) {
|
|
2569
|
+
return {
|
|
2570
|
+
node: status.payload.source.rawNode,
|
|
2571
|
+
handle: {
|
|
2572
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2573
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2574
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2575
|
+
},
|
|
2576
|
+
};
|
|
2577
|
+
}
|
|
2578
|
+
function connectEndEventFromConnectionReleaseValidatedStatus(status) {
|
|
2579
|
+
return {
|
|
2580
|
+
valid: status.payload.valid,
|
|
2581
|
+
from: {
|
|
2582
|
+
node: status.payload.source.rawNode,
|
|
2583
|
+
handle: {
|
|
2584
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2585
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2586
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2587
|
+
},
|
|
2588
|
+
},
|
|
2589
|
+
to: {
|
|
2590
|
+
node: status.payload.target.rawNode,
|
|
2591
|
+
handle: {
|
|
2592
|
+
id: status.payload.targetHandle.rawHandle.id,
|
|
2593
|
+
type: status.payload.targetHandle.rawHandle.type,
|
|
2594
|
+
position: status.payload.targetHandle.rawHandle.position,
|
|
2595
|
+
},
|
|
2596
|
+
},
|
|
2597
|
+
};
|
|
2598
|
+
}
|
|
2599
|
+
function connectEndEventFromConnectionDroppedStatus(status) {
|
|
2600
|
+
return {
|
|
2601
|
+
valid: null,
|
|
2602
|
+
from: {
|
|
2603
|
+
node: status.payload.source.rawNode,
|
|
2604
|
+
handle: {
|
|
2605
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2606
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2607
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2608
|
+
},
|
|
2609
|
+
},
|
|
2610
|
+
to: {
|
|
2611
|
+
node: null,
|
|
2612
|
+
handle: null,
|
|
2613
|
+
},
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2616
|
+
function reconnectStartEventFromReconnectionStartStatus(status) {
|
|
2617
|
+
return {
|
|
2618
|
+
edge: status.payload.oldEdge.edge,
|
|
2619
|
+
node: status.payload.source.rawNode,
|
|
2620
|
+
handle: {
|
|
2621
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2622
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2623
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2624
|
+
},
|
|
2625
|
+
};
|
|
2626
|
+
}
|
|
2627
|
+
function reconnectEndEventFromReconnectionReleaseValidatedStatus(status) {
|
|
2628
|
+
return {
|
|
2629
|
+
valid: status.payload.valid,
|
|
2630
|
+
edge: status.payload.oldEdge.edge,
|
|
2631
|
+
from: {
|
|
2632
|
+
node: status.payload.source.rawNode,
|
|
2633
|
+
handle: {
|
|
2634
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2635
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2636
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2637
|
+
},
|
|
2638
|
+
},
|
|
2639
|
+
to: {
|
|
2640
|
+
node: status.payload.target.rawNode,
|
|
2641
|
+
handle: {
|
|
2642
|
+
id: status.payload.targetHandle.rawHandle.id,
|
|
2643
|
+
type: status.payload.targetHandle.rawHandle.type,
|
|
2644
|
+
position: status.payload.targetHandle.rawHandle.position,
|
|
2645
|
+
},
|
|
2646
|
+
},
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
function reconnectEndEventFromReconnectionDroppedStatus(status) {
|
|
2650
|
+
return {
|
|
2651
|
+
valid: null,
|
|
2652
|
+
edge: status.payload.oldEdge.edge,
|
|
2653
|
+
from: {
|
|
2654
|
+
node: status.payload.source.rawNode,
|
|
2655
|
+
handle: {
|
|
2656
|
+
id: status.payload.sourceHandle.rawHandle.id,
|
|
2657
|
+
type: status.payload.sourceHandle.rawHandle.type,
|
|
2658
|
+
position: status.payload.sourceHandle.rawHandle.position,
|
|
2659
|
+
},
|
|
2660
|
+
},
|
|
2661
|
+
to: {
|
|
2662
|
+
node: null,
|
|
2663
|
+
handle: null,
|
|
2664
|
+
},
|
|
2665
|
+
};
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2390
2668
|
class ConnectionControllerDirective {
|
|
2391
2669
|
constructor() {
|
|
2392
2670
|
this.statusService = inject(FlowStatusService);
|
|
2393
2671
|
this.flowEntitiesService = inject(FlowEntitiesService);
|
|
2672
|
+
// TODO emits duplicates when status degrades back to connection-start from connection-validation
|
|
2673
|
+
this.connectStart = outputFromObservable(this.statusService.status$.pipe(filter((status) => status.state === 'connection-start'), map(connectStartEventFromConnectionStartStatus)));
|
|
2394
2674
|
/**
|
|
2395
2675
|
* This event fires when user tries to create new Edge.
|
|
2396
2676
|
*
|
|
@@ -2398,25 +2678,24 @@ class ConnectionControllerDirective {
|
|
|
2398
2678
|
*
|
|
2399
2679
|
* Also it's important to note, that this event only fires when connection is valid by validator function in `ConnectionSettings`,
|
|
2400
2680
|
* 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
2681
|
*/
|
|
2410
|
-
this.
|
|
2682
|
+
this.connect = outputFromObservable(this.statusService.status$.pipe(filter((status) => status.state === 'connection-release'), map((status) => statusToConnection(status, this.isStrictMode())), tap((connection) => {
|
|
2683
|
+
// We are 99% sure that status is FlowStatusConnectionRelease here
|
|
2684
|
+
const status = this.statusService.status();
|
|
2685
|
+
this.statusService.setConnectionReleaseValidatedStatus(status.payload.source, status.payload.target, status.payload.sourceHandle, status.payload.targetHandle, this.flowEntitiesService.connection().validator(connection));
|
|
2686
|
+
}), filter((connection) => this.flowEntitiesService.connection().validator(connection))));
|
|
2687
|
+
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())));
|
|
2688
|
+
this.reconnectStart = outputFromObservable(this.statusService.status$.pipe(filter((status) => status.state === 'reconnection-start'), map(reconnectStartEventFromReconnectionStartStatus)));
|
|
2689
|
+
this.reconnect = outputFromObservable(toObservable(this.statusService.status).pipe(filter((status) => status.state === 'reconnection-release'), map((status) => {
|
|
2411
2690
|
const connection = statusToConnection(status, this.isStrictMode());
|
|
2412
2691
|
const oldEdge = status.payload.oldEdge.edge;
|
|
2413
2692
|
return { connection, oldEdge };
|
|
2414
|
-
}), tap((
|
|
2415
|
-
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2693
|
+
}), tap(({ connection }) => {
|
|
2694
|
+
// We are 99% sure that status is FlowStatusReconnectionRelease here
|
|
2695
|
+
const status = this.statusService.status();
|
|
2696
|
+
this.statusService.setReconnectionReleaseValidatedStatus(status.payload.source, status.payload.target, status.payload.sourceHandle, status.payload.targetHandle, status.payload.oldEdge, this.flowEntitiesService.connection().validator(connection));
|
|
2697
|
+
}), filter(({ connection }) => this.flowEntitiesService.connection().validator(connection))));
|
|
2698
|
+
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
2699
|
this.isStrictMode = computed(() => this.flowEntitiesService.connection().mode === 'strict');
|
|
2421
2700
|
}
|
|
2422
2701
|
startConnection(handle) {
|
|
@@ -2451,6 +2730,8 @@ class ConnectionControllerDirective {
|
|
|
2451
2730
|
target: target.rawNode.id,
|
|
2452
2731
|
sourceHandle: sourceHandle.rawHandle.id,
|
|
2453
2732
|
targetHandle: targetHandle.rawHandle.id,
|
|
2733
|
+
sourceHandleType: sourceHandle.rawHandle.type,
|
|
2734
|
+
targetHandleType: targetHandle.rawHandle.type,
|
|
2454
2735
|
});
|
|
2455
2736
|
// TODO: check how react flow handles highlight of handle
|
|
2456
2737
|
// if direction changes
|
|
@@ -2482,17 +2763,17 @@ class ConnectionControllerDirective {
|
|
|
2482
2763
|
const target = status.payload.target;
|
|
2483
2764
|
const targetHandle = status.payload.targetHandle;
|
|
2484
2765
|
isReconnection
|
|
2485
|
-
? this.statusService.
|
|
2486
|
-
: this.statusService.
|
|
2766
|
+
? this.statusService.setReconnectionReleaseStatus(source, target, sourceHandle, targetHandle, status.payload.oldEdge)
|
|
2767
|
+
: this.statusService.setConnectionReleaseStatus(source, target, sourceHandle, targetHandle);
|
|
2487
2768
|
}
|
|
2488
2769
|
}
|
|
2489
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2490
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2770
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2771
|
+
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
2772
|
}
|
|
2492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2773
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionControllerDirective, decorators: [{
|
|
2493
2774
|
type: Directive,
|
|
2494
2775
|
args: [{
|
|
2495
|
-
selector: '[
|
|
2776
|
+
selector: '[connectStart], [connect], [connectEnd], [reconnectStart], [reconnect], [reconnectEnd]',
|
|
2496
2777
|
standalone: true,
|
|
2497
2778
|
}]
|
|
2498
2779
|
}] });
|
|
@@ -2522,6 +2803,8 @@ function statusToConnection(status, isStrictMode) {
|
|
|
2522
2803
|
target: targetId,
|
|
2523
2804
|
sourceHandle: sourceHandleId,
|
|
2524
2805
|
targetHandle: targetHandleId,
|
|
2806
|
+
sourceHandleType: sourceHandle.rawHandle.type,
|
|
2807
|
+
targetHandleType: targetHandle.rawHandle.type,
|
|
2525
2808
|
};
|
|
2526
2809
|
}
|
|
2527
2810
|
|
|
@@ -2554,10 +2837,10 @@ class EdgeRenderingService {
|
|
|
2554
2837
|
// pull node
|
|
2555
2838
|
edge.renderOrder.set(this.maxOrder() + 1);
|
|
2556
2839
|
}
|
|
2557
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2558
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2840
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeRenderingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2841
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeRenderingService }); }
|
|
2559
2842
|
}
|
|
2560
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2843
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeRenderingService, decorators: [{
|
|
2561
2844
|
type: Injectable
|
|
2562
2845
|
}] });
|
|
2563
2846
|
|
|
@@ -2617,10 +2900,10 @@ class PointerDirective {
|
|
|
2617
2900
|
this.wasPointerOver = false;
|
|
2618
2901
|
}
|
|
2619
2902
|
}
|
|
2620
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2621
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2903
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PointerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2904
|
+
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
2905
|
}
|
|
2623
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2906
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PointerDirective, decorators: [{
|
|
2624
2907
|
type: Directive,
|
|
2625
2908
|
args: [{
|
|
2626
2909
|
standalone: true,
|
|
@@ -2676,15 +2959,15 @@ class EdgeComponent {
|
|
|
2676
2959
|
event.stopPropagation();
|
|
2677
2960
|
this.connectionController?.startReconnection(handle, this.model());
|
|
2678
2961
|
}
|
|
2679
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2680
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2962
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2963
|
+
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
2964
|
}
|
|
2682
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EdgeComponent, decorators: [{
|
|
2683
2966
|
type: Component,
|
|
2684
|
-
args: [{
|
|
2967
|
+
args: [{ selector: 'g[edge]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
2685
2968
|
class: 'selectable',
|
|
2686
2969
|
'[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().
|
|
2970
|
+
}, 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
2971
|
}] });
|
|
2689
2972
|
|
|
2690
2973
|
class HandleService {
|
|
@@ -2703,13 +2986,13 @@ class HandleService {
|
|
|
2703
2986
|
node.handles.update((handles) => handles.filter((handle) => handle !== handleToDestoy));
|
|
2704
2987
|
}
|
|
2705
2988
|
}
|
|
2706
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2707
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2989
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2990
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleService }); }
|
|
2708
2991
|
}
|
|
2709
2992
|
__decorate([
|
|
2710
2993
|
Microtask // TODO fixes rendering of handle for group node
|
|
2711
2994
|
], HandleService.prototype, "createHandle", null);
|
|
2712
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2995
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleService, decorators: [{
|
|
2713
2996
|
type: Injectable
|
|
2714
2997
|
}], propDecorators: { createHandle: [] } });
|
|
2715
2998
|
|
|
@@ -2729,10 +3012,10 @@ class HandleSizeControllerDirective {
|
|
|
2729
3012
|
height: rect.height + stroke,
|
|
2730
3013
|
});
|
|
2731
3014
|
}
|
|
2732
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2733
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
3015
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleSizeControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3016
|
+
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
3017
|
}
|
|
2735
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3018
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleSizeControllerDirective, decorators: [{
|
|
2736
3019
|
type: Directive,
|
|
2737
3020
|
args: [{
|
|
2738
3021
|
standalone: true,
|
|
@@ -2756,10 +3039,10 @@ class DefaultNodeComponent {
|
|
|
2756
3039
|
constructor() {
|
|
2757
3040
|
this.selected = input(false);
|
|
2758
3041
|
}
|
|
2759
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2760
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
3042
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefaultNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3043
|
+
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
3044
|
}
|
|
2762
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3045
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefaultNodeComponent, decorators: [{
|
|
2763
3046
|
type: Component,
|
|
2764
3047
|
args: [{ standalone: true, selector: 'default-node', host: {
|
|
2765
3048
|
'[class.selected]': 'selected()',
|
|
@@ -2946,15 +3229,15 @@ class ResizableComponent {
|
|
|
2946
3229
|
}
|
|
2947
3230
|
}
|
|
2948
3231
|
}
|
|
2949
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2950
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
3232
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ResizableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3233
|
+
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
3234
|
}
|
|
2952
3235
|
__decorate([
|
|
2953
3236
|
Microtask
|
|
2954
3237
|
], ResizableComponent.prototype, "ngAfterViewInit", null);
|
|
2955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ResizableComponent, decorators: [{
|
|
2956
3239
|
type: Component,
|
|
2957
|
-
args: [{
|
|
3240
|
+
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
3241
|
}], ctorParameters: () => [], propDecorators: { ngAfterViewInit: [] } });
|
|
2959
3242
|
function calcOffset(movementX, movementY, zoom) {
|
|
2960
3243
|
return {
|
|
@@ -3159,10 +3442,10 @@ class HandleComponent {
|
|
|
3159
3442
|
}
|
|
3160
3443
|
});
|
|
3161
3444
|
}
|
|
3162
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3163
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
3445
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3446
|
+
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
3447
|
}
|
|
3165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3448
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: HandleComponent, decorators: [{
|
|
3166
3449
|
type: Component,
|
|
3167
3450
|
args: [{ standalone: true, selector: 'handle', changeDetection: ChangeDetectionStrategy.OnPush, template: "" }]
|
|
3168
3451
|
}] });
|
|
@@ -3183,10 +3466,10 @@ class NodeHandlesControllerDirective {
|
|
|
3183
3466
|
}), takeUntilDestroyed(this.destroyRef))
|
|
3184
3467
|
.subscribe();
|
|
3185
3468
|
}
|
|
3186
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3187
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3469
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeHandlesControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3470
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: NodeHandlesControllerDirective, isStandalone: true, selector: "[nodeHandlesController]", ngImport: i0 }); }
|
|
3188
3471
|
}
|
|
3189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3472
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeHandlesControllerDirective, decorators: [{
|
|
3190
3473
|
type: Directive,
|
|
3191
3474
|
args: [{
|
|
3192
3475
|
selector: '[nodeHandlesController]',
|
|
@@ -3214,10 +3497,10 @@ class NodeResizeControllerDirective {
|
|
|
3214
3497
|
}), takeUntilDestroyed(this.destroyRef))
|
|
3215
3498
|
.subscribe();
|
|
3216
3499
|
}
|
|
3217
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3218
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3500
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeResizeControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3501
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: NodeResizeControllerDirective, isStandalone: true, selector: "[nodeResizeController]", ngImport: i0 }); }
|
|
3219
3502
|
}
|
|
3220
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3503
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeResizeControllerDirective, decorators: [{
|
|
3221
3504
|
type: Directive,
|
|
3222
3505
|
args: [{
|
|
3223
3506
|
selector: '[nodeResizeController]',
|
|
@@ -3290,12 +3573,12 @@ class NodeComponent {
|
|
|
3290
3573
|
this.selectionService.select(this.model());
|
|
3291
3574
|
}
|
|
3292
3575
|
}
|
|
3293
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3294
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3576
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3577
|
+
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
3578
|
}
|
|
3296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeComponent, decorators: [{
|
|
3297
3580
|
type: Component,
|
|
3298
|
-
args: [{
|
|
3581
|
+
args: [{ selector: 'g[node]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [HandleService, NodeAccessorService], host: {
|
|
3299
3582
|
class: 'vflow-node',
|
|
3300
3583
|
}, imports: [
|
|
3301
3584
|
PointerDirective,
|
|
@@ -3398,8 +3681,8 @@ class ConnectionComponent {
|
|
|
3398
3681
|
allNodes: this.flowEntitiesService.rawNodes(),
|
|
3399
3682
|
};
|
|
3400
3683
|
}
|
|
3401
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3402
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3684
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3685
|
+
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
3686
|
@if (model().type === 'default') {
|
|
3404
3687
|
@if (path(); as path) {
|
|
3405
3688
|
<svg:path
|
|
@@ -3418,10 +3701,9 @@ class ConnectionComponent {
|
|
|
3418
3701
|
}
|
|
3419
3702
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3420
3703
|
}
|
|
3421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ConnectionComponent, decorators: [{
|
|
3422
3705
|
type: Component,
|
|
3423
3706
|
args: [{
|
|
3424
|
-
standalone: true,
|
|
3425
3707
|
selector: 'g[connection]',
|
|
3426
3708
|
template: `
|
|
3427
3709
|
@if (model().type === 'default') {
|
|
@@ -3560,10 +3842,10 @@ class BackgroundComponent {
|
|
|
3560
3842
|
}
|
|
3561
3843
|
});
|
|
3562
3844
|
}
|
|
3563
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3564
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3845
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3846
|
+
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
3847
|
}
|
|
3566
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: BackgroundComponent, decorators: [{
|
|
3567
3849
|
type: Component,
|
|
3568
3850
|
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
3851
|
}], ctorParameters: () => [] });
|
|
@@ -3580,12 +3862,12 @@ class DefsComponent {
|
|
|
3580
3862
|
this.markers = input.required();
|
|
3581
3863
|
this.defaultColor = 'rgb(177, 177, 183)';
|
|
3582
3864
|
}
|
|
3583
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3584
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3865
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3866
|
+
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
3867
|
}
|
|
3586
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DefsComponent, decorators: [{
|
|
3587
3869
|
type: Component,
|
|
3588
|
-
args: [{
|
|
3870
|
+
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
3871
|
}] });
|
|
3590
3872
|
|
|
3591
3873
|
class FlowSizeControllerDirective {
|
|
@@ -3607,10 +3889,10 @@ class FlowSizeControllerDirective {
|
|
|
3607
3889
|
}), takeUntilDestroyed())
|
|
3608
3890
|
.subscribe();
|
|
3609
3891
|
}
|
|
3610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3611
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3892
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowSizeControllerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3893
|
+
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
3894
|
}
|
|
3613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3895
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowSizeControllerDirective, decorators: [{
|
|
3614
3896
|
type: Directive,
|
|
3615
3897
|
args: [{
|
|
3616
3898
|
standalone: true,
|
|
@@ -3630,14 +3912,17 @@ class RootSvgContextDirective {
|
|
|
3630
3912
|
// TODO: check for multiple instances on page
|
|
3631
3913
|
resetConnection() {
|
|
3632
3914
|
const status = this.flowStatusService.status();
|
|
3633
|
-
if (status.state === 'connection-start'
|
|
3634
|
-
this.flowStatusService.
|
|
3915
|
+
if (status.state === 'connection-start') {
|
|
3916
|
+
this.flowStatusService.setConnectionDroppedStatus(status.payload.source, status.payload.sourceHandle);
|
|
3917
|
+
}
|
|
3918
|
+
if (status.state === 'reconnection-start') {
|
|
3919
|
+
this.flowStatusService.setReconnectionDroppedStatus(status.payload.source, status.payload.sourceHandle, status.payload.oldEdge);
|
|
3635
3920
|
}
|
|
3636
3921
|
}
|
|
3637
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3638
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
3922
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootSvgContextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3923
|
+
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
3924
|
}
|
|
3640
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: RootSvgContextDirective, decorators: [{
|
|
3641
3926
|
type: Directive,
|
|
3642
3927
|
args: [{
|
|
3643
3928
|
standalone: true,
|
|
@@ -3680,10 +3965,10 @@ function getSpacePoints(point, groups) {
|
|
|
3680
3965
|
}
|
|
3681
3966
|
|
|
3682
3967
|
class PreviewFlowRenderStrategyService {
|
|
3683
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3684
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3968
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowRenderStrategyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3969
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowRenderStrategyService }); }
|
|
3685
3970
|
}
|
|
3686
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3971
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowRenderStrategyService, decorators: [{
|
|
3687
3972
|
type: Injectable
|
|
3688
3973
|
}] });
|
|
3689
3974
|
class ViewportPreviewFlowRenderStrategyService extends PreviewFlowRenderStrategyService {
|
|
@@ -3691,10 +3976,10 @@ class ViewportPreviewFlowRenderStrategyService extends PreviewFlowRenderStrategy
|
|
|
3691
3976
|
// Do not render preview node if the real node is visible
|
|
3692
3977
|
return !node.isVisible();
|
|
3693
3978
|
}
|
|
3694
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3695
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
3979
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportPreviewFlowRenderStrategyService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3980
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportPreviewFlowRenderStrategyService }); }
|
|
3696
3981
|
}
|
|
3697
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3982
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ViewportPreviewFlowRenderStrategyService, decorators: [{
|
|
3698
3983
|
type: Injectable
|
|
3699
3984
|
}] });
|
|
3700
3985
|
|
|
@@ -3841,10 +4126,10 @@ class PreviewFlowComponent {
|
|
|
3841
4126
|
this.ctx.restore();
|
|
3842
4127
|
});
|
|
3843
4128
|
}
|
|
3844
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3845
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
4129
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4130
|
+
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
4131
|
}
|
|
3847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: PreviewFlowComponent, decorators: [{
|
|
3848
4133
|
type: Component,
|
|
3849
4134
|
args: [{
|
|
3850
4135
|
standalone: true,
|
|
@@ -3866,10 +4151,10 @@ class FlowRenderingService {
|
|
|
3866
4151
|
this.flowInitialized.set(true);
|
|
3867
4152
|
});
|
|
3868
4153
|
}
|
|
3869
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3870
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
4154
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowRenderingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4155
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowRenderingService }); }
|
|
3871
4156
|
}
|
|
3872
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FlowRenderingService, decorators: [{
|
|
3873
4158
|
type: Injectable
|
|
3874
4159
|
}], ctorParameters: () => [] });
|
|
3875
4160
|
// TODO may break on edge cases
|
|
@@ -3984,46 +4269,111 @@ class AlignmentHelperComponent {
|
|
|
3984
4269
|
}), takeUntilDestroyed())
|
|
3985
4270
|
.subscribe();
|
|
3986
4271
|
}
|
|
3987
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3988
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4272
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AlignmentHelperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4273
|
+
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
4274
|
}
|
|
3990
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4275
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AlignmentHelperComponent, decorators: [{
|
|
3991
4276
|
type: Component,
|
|
3992
4277
|
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
4278
|
}], ctorParameters: () => [] });
|
|
3994
4279
|
|
|
4280
|
+
const EDGE = 48; // px from edge to trigger pan
|
|
4281
|
+
const BASE_SPEED = 10;
|
|
4282
|
+
const START_STATES = ['node-drag-start', 'connection-start', 'reconnection-start'];
|
|
4283
|
+
class AutoPanDirective {
|
|
4284
|
+
constructor() {
|
|
4285
|
+
this.statusService = inject(FlowStatusService);
|
|
4286
|
+
this.viewportService = inject(ViewportService);
|
|
4287
|
+
this.flowSettingsService = inject(FlowSettingsService);
|
|
4288
|
+
this.rootSvg = inject(RootSvgReferenceDirective).element;
|
|
4289
|
+
this.injector = inject(Injector);
|
|
4290
|
+
this.destroyRef = inject(DestroyRef);
|
|
4291
|
+
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 }));
|
|
4292
|
+
}
|
|
4293
|
+
ngOnInit() {
|
|
4294
|
+
if (this.flowSettingsService.autoPan()) {
|
|
4295
|
+
toObservable(this.statusService.status, { injector: this.injector })
|
|
4296
|
+
.pipe(switchMap((status) => START_STATES.includes(status.state)
|
|
4297
|
+
? this.documentPoint$.pipe(take(1), switchMap(() => animationFrames().pipe(withLatestFrom(this.documentPoint$), map(([, point]) => point), tap((point) => this.pan(point)))))
|
|
4298
|
+
: EMPTY), takeUntilDestroyed(this.destroyRef))
|
|
4299
|
+
.subscribe();
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
toViewportPoint(event) {
|
|
4303
|
+
const rect = this.rootSvg.getBoundingClientRect();
|
|
4304
|
+
return {
|
|
4305
|
+
x: event.x - rect.left,
|
|
4306
|
+
y: event.y - rect.top,
|
|
4307
|
+
};
|
|
4308
|
+
}
|
|
4309
|
+
pan(point) {
|
|
4310
|
+
const viewport = this.viewportService.readableViewport();
|
|
4311
|
+
const { x, y, zoom } = viewport;
|
|
4312
|
+
const width = this.flowSettingsService.computedFlowWidth();
|
|
4313
|
+
const height = this.flowSettingsService.computedFlowHeight();
|
|
4314
|
+
const dL = point.x;
|
|
4315
|
+
const dR = width - point.x;
|
|
4316
|
+
const dT = point.y;
|
|
4317
|
+
const dB = height - point.y;
|
|
4318
|
+
let deltaX = 0;
|
|
4319
|
+
let deltaY = 0;
|
|
4320
|
+
// Left edge: pan right (increase x)
|
|
4321
|
+
if (dL < EDGE) {
|
|
4322
|
+
const speedL = BASE_SPEED * edgeFactor(dL);
|
|
4323
|
+
deltaX += speedL;
|
|
4324
|
+
}
|
|
4325
|
+
// Right edge: pan left (decrease x)
|
|
4326
|
+
if (dR < EDGE) {
|
|
4327
|
+
const speedR = BASE_SPEED * edgeFactor(dR);
|
|
4328
|
+
deltaX -= speedR;
|
|
4329
|
+
}
|
|
4330
|
+
// Top edge: pan down (increase y)
|
|
4331
|
+
if (dT < EDGE) {
|
|
4332
|
+
const speedT = BASE_SPEED * edgeFactor(dT);
|
|
4333
|
+
deltaY += speedT;
|
|
4334
|
+
}
|
|
4335
|
+
// Bottom edge: pan up (decrease y)
|
|
4336
|
+
if (dB < EDGE) {
|
|
4337
|
+
const speedB = BASE_SPEED * edgeFactor(dB);
|
|
4338
|
+
deltaY -= speedB;
|
|
4339
|
+
}
|
|
4340
|
+
if (deltaX !== 0 || deltaY !== 0) {
|
|
4341
|
+
this.viewportService.writableViewport.set({
|
|
4342
|
+
changeType: 'absolute',
|
|
4343
|
+
state: { x: x + deltaX, y: y + deltaY, zoom },
|
|
4344
|
+
duration: 0,
|
|
4345
|
+
});
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AutoPanDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4349
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: AutoPanDirective, isStandalone: true, selector: "[autoPan]", ngImport: i0 }); }
|
|
4350
|
+
}
|
|
4351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: AutoPanDirective, decorators: [{
|
|
4352
|
+
type: Directive,
|
|
4353
|
+
args: [{ selector: '[autoPan]', standalone: true }]
|
|
4354
|
+
}] });
|
|
4355
|
+
function clamp01(n) {
|
|
4356
|
+
return Math.max(0, Math.min(1, n));
|
|
4357
|
+
}
|
|
4358
|
+
function edgeFactor(distance) {
|
|
4359
|
+
const t = clamp01((EDGE - distance) / EDGE);
|
|
4360
|
+
return t * t; // ease-in: t^2
|
|
4361
|
+
}
|
|
4362
|
+
|
|
3995
4363
|
const changesControllerHostDirective = {
|
|
3996
4364
|
directive: ChangesControllerDirective,
|
|
3997
4365
|
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',
|
|
4366
|
+
'nodesChanges',
|
|
4367
|
+
'nodesChanges.position',
|
|
4368
|
+
'nodesChanges.size',
|
|
4369
|
+
'nodesChanges.add',
|
|
4370
|
+
'nodesChanges.remove',
|
|
4371
|
+
'nodesChanges.select',
|
|
4372
|
+
'edgesChanges',
|
|
4373
|
+
'edgesChanges.detached',
|
|
4374
|
+
'edgesChanges.add',
|
|
4375
|
+
'edgesChanges.remove',
|
|
4376
|
+
'edgesChanges.select',
|
|
4027
4377
|
],
|
|
4028
4378
|
};
|
|
4029
4379
|
class VflowComponent {
|
|
@@ -4049,10 +4399,8 @@ class VflowComponent {
|
|
|
4049
4399
|
// #region OUTPUTS
|
|
4050
4400
|
/**
|
|
4051
4401
|
* Event that accumulates all custom node events
|
|
4052
|
-
*
|
|
4053
|
-
* @experimental
|
|
4054
4402
|
*/
|
|
4055
|
-
this.
|
|
4403
|
+
this.componentNodeEvent = outputFromObservable(this.componentEventBusService.event$); // TODO: research how to remove any
|
|
4056
4404
|
// #endregion
|
|
4057
4405
|
// #region TEMPLATES
|
|
4058
4406
|
this.nodeTemplateDirective = contentChild(NodeHtmlTemplateDirective);
|
|
@@ -4148,6 +4496,14 @@ class VflowComponent {
|
|
|
4148
4496
|
set entitiesSelectable(value) {
|
|
4149
4497
|
this.flowSettingsService.entitiesSelectable.set(value);
|
|
4150
4498
|
}
|
|
4499
|
+
/**
|
|
4500
|
+
* Selection mode strategy
|
|
4501
|
+
* - 'default': library manages selection automatically
|
|
4502
|
+
* - 'manual': library does not manage selection, user controls it via node.selected signal
|
|
4503
|
+
*/
|
|
4504
|
+
set selectionMode(value) {
|
|
4505
|
+
this.flowSettingsService.selectionMode.set(value);
|
|
4506
|
+
}
|
|
4151
4507
|
set keyboardShortcuts(value) {
|
|
4152
4508
|
this.keyboardService.setShortcuts(value);
|
|
4153
4509
|
}
|
|
@@ -4180,6 +4536,12 @@ class VflowComponent {
|
|
|
4180
4536
|
set elevateEdgesOnSelect(value) {
|
|
4181
4537
|
this.flowSettingsService.elevateEdgesOnSelect.set(value);
|
|
4182
4538
|
}
|
|
4539
|
+
/**
|
|
4540
|
+
* Enable auto-pan
|
|
4541
|
+
*/
|
|
4542
|
+
set autoPan(value) {
|
|
4543
|
+
this.flowSettingsService.autoPan.set(value);
|
|
4544
|
+
}
|
|
4183
4545
|
// #endregion
|
|
4184
4546
|
// #region MAIN_INPUTS
|
|
4185
4547
|
/**
|
|
@@ -4301,8 +4663,8 @@ class VflowComponent {
|
|
|
4301
4663
|
trackEdges(idx, { edge }) {
|
|
4302
4664
|
return edge;
|
|
4303
4665
|
}
|
|
4304
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4305
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4666
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: VflowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4667
|
+
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
4668
|
DraggableService,
|
|
4307
4669
|
ViewportService,
|
|
4308
4670
|
FlowStatusService,
|
|
@@ -4318,11 +4680,11 @@ class VflowComponent {
|
|
|
4318
4680
|
OverlaysService,
|
|
4319
4681
|
{ provide: PreviewFlowRenderStrategyService, useClass: ViewportPreviewFlowRenderStrategyService },
|
|
4320
4682
|
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: ["
|
|
4683
|
+
], 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
4684
|
}
|
|
4323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4685
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: VflowComponent, decorators: [{
|
|
4324
4686
|
type: Component,
|
|
4325
|
-
args: [{
|
|
4687
|
+
args: [{ selector: 'vflow', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
4326
4688
|
DraggableService,
|
|
4327
4689
|
ViewportService,
|
|
4328
4690
|
FlowStatusService,
|
|
@@ -4353,7 +4715,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
4353
4715
|
NgTemplateOutlet,
|
|
4354
4716
|
PreviewFlowComponent,
|
|
4355
4717
|
AlignmentHelperComponent,
|
|
4356
|
-
|
|
4718
|
+
AutoPanDirective,
|
|
4719
|
+
], 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
4720
|
}], propDecorators: { view: [{
|
|
4358
4721
|
type: Input
|
|
4359
4722
|
}], minZoom: [{
|
|
@@ -4366,6 +4729,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
4366
4729
|
type: Input
|
|
4367
4730
|
}], entitiesSelectable: [{
|
|
4368
4731
|
type: Input
|
|
4732
|
+
}], selectionMode: [{
|
|
4733
|
+
type: Input
|
|
4369
4734
|
}], keyboardShortcuts: [{
|
|
4370
4735
|
type: Input
|
|
4371
4736
|
}], connection: [{
|
|
@@ -4379,6 +4744,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
4379
4744
|
type: Input
|
|
4380
4745
|
}], elevateEdgesOnSelect: [{
|
|
4381
4746
|
type: Input
|
|
4747
|
+
}], autoPan: [{
|
|
4748
|
+
type: Input
|
|
4382
4749
|
}], nodes: [{
|
|
4383
4750
|
type: Input,
|
|
4384
4751
|
args: [{ required: true }]
|
|
@@ -4397,10 +4764,10 @@ class DragHandleDirective {
|
|
|
4397
4764
|
this.model.dragHandlesCount.update((count) => count - 1);
|
|
4398
4765
|
});
|
|
4399
4766
|
}
|
|
4400
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4401
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
4767
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DragHandleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4768
|
+
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
4769
|
}
|
|
4403
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: DragHandleDirective, decorators: [{
|
|
4404
4771
|
type: Directive,
|
|
4405
4772
|
args: [{
|
|
4406
4773
|
standalone: true,
|
|
@@ -4440,10 +4807,10 @@ class SelectableDirective {
|
|
|
4440
4807
|
getEvent$() {
|
|
4441
4808
|
return fromEvent(this.host.nativeElement, 'click');
|
|
4442
4809
|
}
|
|
4443
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4444
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
4810
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4811
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: SelectableDirective, isStandalone: true, selector: "[selectable]", ngImport: i0 }); }
|
|
4445
4812
|
}
|
|
4446
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4813
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SelectableDirective, decorators: [{
|
|
4447
4814
|
type: Directive,
|
|
4448
4815
|
args: [{
|
|
4449
4816
|
standalone: true,
|
|
@@ -4548,12 +4915,12 @@ class MiniMapComponent {
|
|
|
4548
4915
|
trackNodes(idx, { rawNode }) {
|
|
4549
4916
|
return rawNode;
|
|
4550
4917
|
}
|
|
4551
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4552
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
4918
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MiniMapComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4919
|
+
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
4920
|
}
|
|
4554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: MiniMapComponent, decorators: [{
|
|
4555
4922
|
type: Component,
|
|
4556
|
-
args: [{
|
|
4923
|
+
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
4924
|
}] });
|
|
4558
4925
|
|
|
4559
4926
|
class ToolbarModel {
|
|
@@ -4607,8 +4974,8 @@ class NodeToolbarComponent {
|
|
|
4607
4974
|
ngOnDestroy() {
|
|
4608
4975
|
this.overlaysService.removeToolbar(this.model);
|
|
4609
4976
|
}
|
|
4610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4611
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
4977
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4978
|
+
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
4979
|
<ng-template #toolbar>
|
|
4613
4980
|
<div class="wrapper" nodeToolbarWrapper [model]="model">
|
|
4614
4981
|
<ng-content />
|
|
@@ -4616,9 +4983,9 @@ class NodeToolbarComponent {
|
|
|
4616
4983
|
</ng-template>
|
|
4617
4984
|
`, isInline: true, styles: [".wrapper{width:max-content}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => NodeToolbarWrapperDirective), selector: "[nodeToolbarWrapper]", inputs: ["model"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4618
4985
|
}
|
|
4619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarComponent, decorators: [{
|
|
4620
4987
|
type: Component,
|
|
4621
|
-
args: [{
|
|
4988
|
+
args: [{ selector: 'node-toolbar', template: `
|
|
4622
4989
|
<ng-template #toolbar>
|
|
4623
4990
|
<div class="wrapper" nodeToolbarWrapper [model]="model">
|
|
4624
4991
|
<ng-content />
|
|
@@ -4644,10 +5011,10 @@ class NodeToolbarWrapperDirective {
|
|
|
4644
5011
|
height: this.element.nativeElement.clientHeight,
|
|
4645
5012
|
});
|
|
4646
5013
|
}
|
|
4647
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4648
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
5014
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarWrapperDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5015
|
+
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
5016
|
}
|
|
4650
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5017
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: NodeToolbarWrapperDirective, decorators: [{
|
|
4651
5018
|
type: Directive,
|
|
4652
5019
|
args: [{
|
|
4653
5020
|
selector: '[nodeToolbarWrapper]',
|
|
@@ -4668,10 +5035,10 @@ class CustomTemplateEdgeComponent {
|
|
|
4668
5035
|
this.edgeRenderingService.pull(this.model);
|
|
4669
5036
|
}
|
|
4670
5037
|
}
|
|
4671
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4672
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
5038
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomTemplateEdgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5039
|
+
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
5040
|
}
|
|
4674
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
5041
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: CustomTemplateEdgeComponent, decorators: [{
|
|
4675
5042
|
type: Component,
|
|
4676
5043
|
args: [{ selector: 'g[customTemplateEdge]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, host: {
|
|
4677
5044
|
'(mousedown)': 'pull()',
|
|
@@ -4704,5 +5071,5 @@ const Vflow = [
|
|
|
4704
5071
|
* Generated bundle index. Do not edit.
|
|
4705
5072
|
*/
|
|
4706
5073
|
|
|
4707
|
-
export { ChangesControllerDirective, ConnectionControllerDirective, ConnectionTemplateDirective,
|
|
5074
|
+
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
5075
|
//# sourceMappingURL=ngx-vflow.mjs.map
|