@foblex/flow 1.5.5 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/domain/get-connection-vector/get-connection-vector.handler.d.ts +1 -1
  2. package/domain/get-element-rect-in-flow/get-element-rect-in-flow-request.d.ts +4 -0
  3. package/domain/{get-element-rect-in-flow.handler.d.ts → get-element-rect-in-flow/get-element-rect-in-flow.handler.d.ts} +4 -3
  4. package/domain/get-element-rect-in-flow/index.d.ts +2 -0
  5. package/domain/get-input-rect-in-flow/get-input-rect-in-flow-request.d.ts +4 -0
  6. package/domain/get-input-rect-in-flow/get-input-rect-in-flow-response.d.ts +7 -0
  7. package/domain/get-input-rect-in-flow/get-input-rect-in-flow.handler.d.ts +14 -0
  8. package/domain/get-input-rect-in-flow/index.d.ts +3 -0
  9. package/domain/get-nodes-rect/get-nodes-rect.handler.d.ts +11 -0
  10. package/domain/get-nodes-rect/get-nodes-rect.request.d.ts +2 -0
  11. package/domain/get-nodes-rect/index.d.ts +2 -0
  12. package/domain/get-output-rect-in-flow/get-output-rect-in-flow.handler.d.ts +3 -3
  13. package/domain/index.d.ts +3 -4
  14. package/domain/providers.d.ts +4 -4
  15. package/domain/redraw-connections/redraw-connections.handler.d.ts +1 -3
  16. package/errors/conflict-error.d.ts +6 -0
  17. package/errors/create-error-class.d.ts +1 -0
  18. package/errors/errors.d.ts +3 -0
  19. package/errors/index.d.ts +4 -0
  20. package/errors/not-found-error.d.ts +6 -0
  21. package/esm2022/domain/get-connection-vector/get-connection-vector.handler.mjs +3 -3
  22. package/esm2022/domain/get-element-rect-in-flow/get-element-rect-in-flow-request.mjs +6 -0
  23. package/esm2022/domain/get-element-rect-in-flow/get-element-rect-in-flow.handler.mjs +35 -0
  24. package/esm2022/domain/get-element-rect-in-flow/index.mjs +3 -0
  25. package/esm2022/domain/get-input-rect-in-flow/get-input-rect-in-flow-request.mjs +6 -0
  26. package/esm2022/domain/get-input-rect-in-flow/get-input-rect-in-flow-response.mjs +7 -0
  27. package/esm2022/domain/get-input-rect-in-flow/get-input-rect-in-flow.handler.mjs +34 -0
  28. package/esm2022/domain/get-input-rect-in-flow/index.mjs +4 -0
  29. package/esm2022/domain/get-nodes-rect/get-nodes-rect.handler.mjs +30 -0
  30. package/esm2022/domain/get-nodes-rect/get-nodes-rect.request.mjs +3 -0
  31. package/esm2022/domain/get-nodes-rect/index.mjs +3 -0
  32. package/esm2022/domain/get-output-rect-in-flow/get-output-rect-in-flow.handler.mjs +9 -8
  33. package/esm2022/domain/index.mjs +4 -5
  34. package/esm2022/domain/providers.mjs +6 -6
  35. package/esm2022/domain/redraw-connections/redraw-connections.handler.mjs +8 -9
  36. package/esm2022/errors/conflict-error.mjs +7 -0
  37. package/esm2022/errors/create-error-class.mjs +11 -0
  38. package/esm2022/errors/errors.mjs +12 -0
  39. package/esm2022/errors/index.mjs +5 -0
  40. package/esm2022/errors/not-found-error.mjs +7 -0
  41. package/esm2022/f-canvas/f-canvas.component.mjs +15 -8
  42. package/esm2022/f-connection/common/e-f-connection-behavior.mjs +2 -1
  43. package/esm2022/f-connectors/f-connector-base.mjs +2 -1
  44. package/esm2022/f-connectors/f-node-output/f-node-output-base.mjs +2 -2
  45. package/esm2022/f-connectors/f-node-output/f-node-output.directive.mjs +9 -2
  46. package/esm2022/f-draggable/connections/create-connection/create-connection.on-pointer-up.mjs +3 -3
  47. package/esm2022/f-draggable/connections/create-connection/create-connection.prepare-drag-sequence.mjs +9 -10
  48. package/esm2022/f-draggable/connections/find-inputs-under-pointer/find-inputs-under-pointer.handler.mjs +3 -3
  49. package/esm2022/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.mjs +5 -6
  50. package/esm2022/f-draggable/connections/reassign-connection/reassign-connection.prepare-drag-sequence.mjs +2 -2
  51. package/esm2022/f-draggable/external-item/external-item.on-pointer-up.mjs +9 -8
  52. package/esm2022/f-draggable/external-item/external-item.prepare-drag-sequence.mjs +4 -1
  53. package/esm2022/f-draggable/node/connection-source.drag-handler.mjs +4 -5
  54. package/esm2022/f-draggable/node/connection-target.drag-handler.mjs +4 -5
  55. package/esm2022/f-draggable/node/connection.drag-handler.mjs +4 -5
  56. package/esm2022/f-draggable/node/domain/is-connection-under-node/is-connection-under-node.handler.mjs +10 -7
  57. package/esm2022/f-draggable/node/node.prepare-drag-sequence.mjs +8 -9
  58. package/esm2022/f-draggable/selection-area/get-can-be-selected-items/get-can-be-selected-items.handler.mjs +9 -8
  59. package/esm2022/f-external-item/f-external-item-base.mjs +1 -1
  60. package/esm2022/f-external-item/f-external-item.directive.mjs +10 -6
  61. package/esm2022/f-flow/f-flow.component.mjs +16 -13
  62. package/esm2022/f-line-alignment/f-line-alignment.component.mjs +9 -8
  63. package/f-canvas/f-canvas.component.d.ts +3 -3
  64. package/f-connection/common/e-f-connection-behavior.d.ts +1 -0
  65. package/f-connectors/f-connector-base.d.ts +1 -0
  66. package/f-connectors/f-node-output/f-node-output-base.d.ts +1 -0
  67. package/f-connectors/f-node-output/f-node-output.directive.d.ts +3 -1
  68. package/f-draggable/connections/create-connection/create-connection.prepare-drag-sequence.d.ts +1 -3
  69. package/f-draggable/connections/providers.d.ts +1 -1
  70. package/f-draggable/connections/reassign-connection/reassign-connection.drag-handler.d.ts +1 -3
  71. package/f-draggable/external-item/external-item.on-pointer-up.d.ts +3 -3
  72. package/f-draggable/external-item/providers.d.ts +1 -1
  73. package/f-draggable/node/connection-source.drag-handler.d.ts +1 -3
  74. package/f-draggable/node/connection-target.drag-handler.d.ts +1 -3
  75. package/f-draggable/node/connection.drag-handler.d.ts +1 -3
  76. package/f-draggable/node/domain/is-connection-under-node/is-connection-under-node.handler.d.ts +4 -3
  77. package/f-draggable/node/node.prepare-drag-sequence.d.ts +2 -3
  78. package/f-draggable/node/providers.d.ts +1 -1
  79. package/f-draggable/selection-area/get-can-be-selected-items/get-can-be-selected-items.handler.d.ts +3 -3
  80. package/f-external-item/f-external-item-base.d.ts +7 -6
  81. package/f-external-item/f-external-item.directive.d.ts +6 -5
  82. package/f-flow/f-flow.component.d.ts +3 -4
  83. package/f-line-alignment/f-line-alignment.component.d.ts +3 -3
  84. package/fesm2022/foblex-flow.mjs +227 -153
  85. package/fesm2022/foblex-flow.mjs.map +1 -1
  86. package/package.json +1 -1
  87. package/domain/errors.d.ts +0 -3
  88. package/domain/get-all-nodes-rect.handler.d.ts +0 -10
  89. package/domain/get-input-rect-in-flow.handler.d.ts +0 -19
  90. package/esm2022/domain/errors.mjs +0 -10
  91. package/esm2022/domain/get-all-nodes-rect.handler.mjs +0 -23
  92. package/esm2022/domain/get-element-rect-in-flow.handler.mjs +0 -28
  93. package/esm2022/domain/get-input-rect-in-flow.handler.mjs +0 -25
@@ -346,6 +346,7 @@ class CalculateConnectorConnectableSideRequest {
346
346
  class FConnectorBase {
347
347
  constructor() {
348
348
  this.stateChanges = new Subject();
349
+ this.isSelfConnectable = true;
349
350
  this.fConnectableSide = EFConnectableSide.AUTO;
350
351
  this._fConnectableSide = EFConnectableSide.AUTO;
351
352
  }
@@ -546,7 +547,7 @@ class FNodeOutputBase extends FConnectorBase {
546
547
  this.isConnected = false;
547
548
  }
548
549
  get canBeConnected() {
549
- return !this.disabled && !this.isConnected;
550
+ return !this.disabled && (this.multiple ? true : !this.isConnected);
550
551
  }
551
552
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FNodeOutputBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
552
553
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.1", type: FNodeOutputBase, usesInheritance: true, ngImport: i0 }); }
@@ -580,9 +581,11 @@ class FNodeOutputDirective extends FNodeOutputBase {
580
581
  this.fNode = fNode;
581
582
  this.fComponentsStore = fComponentsStore;
582
583
  this.id = `f-node-output-${uniqueId$5++}`;
584
+ this.multiple = false;
583
585
  this.isDisabled = false;
584
586
  this._fConnectableSide = EFConnectableSide.AUTO;
585
587
  this.isConnected = false;
588
+ this.isSelfConnectable = true;
586
589
  }
587
590
  ngOnInit() {
588
591
  if (!this.fNode) {
@@ -600,7 +603,7 @@ class FNodeOutputDirective extends FNodeOutputBase {
600
603
  this.fComponentsStore.removeOutput(this);
601
604
  }
602
605
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FNodeOutputDirective, deps: [{ token: i0.ElementRef }, { token: F_NODE }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Directive }); }
603
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.1", type: FNodeOutputDirective, selector: "[fNodeOutput]", inputs: { id: ["fOutputId", "id"], disabled: ["fOutputDisabled", "disabled"], _fConnectableSide: ["fOutputConnectableSide", "_fConnectableSide"] }, host: { properties: { "attr.data-f-output-id": "id", "class.f-node-output-disabled": "disabled" }, classAttribute: "f-component f-node-output" }, providers: [{ provide: F_NODE_OUTPUT, useExisting: FNodeOutputDirective }], exportAs: ["fNodeOutput"], usesInheritance: true, ngImport: i0 }); }
606
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.1", type: FNodeOutputDirective, selector: "[fNodeOutput]", inputs: { id: ["fOutputId", "id"], multiple: ["fOutputMultiple", "multiple"], disabled: ["fOutputDisabled", "disabled"], _fConnectableSide: ["fOutputConnectableSide", "_fConnectableSide"], isSelfConnectable: "isSelfConnectable" }, host: { properties: { "attr.data-f-output-id": "id", "class.f-node-output-disabled": "disabled" }, classAttribute: "f-component f-node-output" }, providers: [{ provide: F_NODE_OUTPUT, useExisting: FNodeOutputDirective }], exportAs: ["fNodeOutput"], usesInheritance: true, ngImport: i0 }); }
604
607
  }
605
608
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FNodeOutputDirective, decorators: [{
606
609
  type: Directive,
@@ -620,12 +623,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
620
623
  }] }, { type: FComponentsStore }], propDecorators: { id: [{
621
624
  type: Input,
622
625
  args: ['fOutputId']
626
+ }], multiple: [{
627
+ type: Input,
628
+ args: ['fOutputMultiple']
623
629
  }], disabled: [{
624
630
  type: Input,
625
631
  args: ['fOutputDisabled']
626
632
  }], _fConnectableSide: [{
627
633
  type: Input,
628
634
  args: ['fOutputConnectableSide']
635
+ }], isSelfConnectable: [{
636
+ type: Input
629
637
  }] } });
630
638
 
631
639
  class FBezierPathBuilder extends FPathBuilderBase {
@@ -1311,6 +1319,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
1311
1319
  var EFConnectionBehavior;
1312
1320
  (function (EFConnectionBehavior) {
1313
1321
  EFConnectionBehavior["FIXED"] = "fixed";
1322
+ EFConnectionBehavior["FIXED_CENTER"] = "fixed_center";
1314
1323
  EFConnectionBehavior["FLOATING"] = "floating";
1315
1324
  })(EFConnectionBehavior || (EFConnectionBehavior = {}));
1316
1325
 
@@ -2165,6 +2174,39 @@ class FindInputsUnderPointerRequest {
2165
2174
  }
2166
2175
  }
2167
2176
 
2177
+ function createErrorClass(impl) {
2178
+ const _super = (instance) => {
2179
+ Error.call(instance);
2180
+ // instance.stack = new Error().stack;
2181
+ };
2182
+ const constructor = impl(_super);
2183
+ constructor.prototype = Object.create(Error.prototype);
2184
+ constructor.prototype.constructor = constructor;
2185
+ return constructor;
2186
+ }
2187
+
2188
+ const NotFoundError = createErrorClass((_super) => function error(message) {
2189
+ _super(this);
2190
+ this.message = message || 'The requested resource was not found.';
2191
+ this.code = 404;
2192
+ });
2193
+
2194
+ const ConflictError = createErrorClass((_super) => function error(message) {
2195
+ _super(this);
2196
+ this.message = message || 'Conflict error occurred.';
2197
+ this.code = 409;
2198
+ });
2199
+
2200
+ function OutputNotFound(id) {
2201
+ return new NotFoundError(`Output with fOutputId ${id} not found. Make sure there is no f-connection to a non-existent fOutput.`);
2202
+ }
2203
+ function InputNotFound(id) {
2204
+ return new NotFoundError(`Input with fInputId ${id} not found. Make sure there is no f-connection to a non-existent fInput.`);
2205
+ }
2206
+ function RequiredOutput() {
2207
+ return new ConflictError(`The fNode must contain at least one fOutput if there is an fOutlet`);
2208
+ }
2209
+
2168
2210
  class FindInputsUnderPointerHandler {
2169
2211
  get fNodes() {
2170
2212
  return this.fComponentsStore.fNodes;
@@ -2180,7 +2222,7 @@ class FindInputsUnderPointerHandler {
2180
2222
  if (!output) {
2181
2223
  throw OutputNotFound(payload.dragHandler.connection.fOutputId);
2182
2224
  }
2183
- return inputsUnderPointer.filter((x) => {
2225
+ return output.isSelfConnectable ? inputsUnderPointer : inputsUnderPointer.filter((x) => {
2184
2226
  const targetNode = this.fNodes.find((y) => y.isContains(x.hostElement));
2185
2227
  const sourceNode = this.fNodes.find((y) => y.isContains(output.hostElement));
2186
2228
  return sourceNode?.hostElement !== targetNode?.hostElement;
@@ -2226,7 +2268,7 @@ class CreateConnectionOnPointerUp {
2226
2268
  if (isOutlet) {
2227
2269
  output = this.findFirstCanBeConnectedOutputByOutletHandler.handle(output);
2228
2270
  if (!output) {
2229
- throw requiredOutput();
2271
+ throw RequiredOutput();
2230
2272
  }
2231
2273
  }
2232
2274
  this.fComponentsStore.fDraggable?.fCreateConnection.emit(new FCreateConnectionEvent(output.id, inputsUnderPointer[0]?.id));
@@ -2248,10 +2290,9 @@ class CreateConnectionPrepareDragSequence {
2248
2290
  get flowHost() {
2249
2291
  return this.fComponentsStore.fFlow.hostElement;
2250
2292
  }
2251
- constructor(fComponentsStore, fDraggableDataContext, getElementRectInFlowHandler, fMediator, findFirstCanBeConnectedOutputByOutletHandler) {
2293
+ constructor(fComponentsStore, fDraggableDataContext, fMediator, findFirstCanBeConnectedOutputByOutletHandler) {
2252
2294
  this.fComponentsStore = fComponentsStore;
2253
2295
  this.fDraggableDataContext = fDraggableDataContext;
2254
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
2255
2296
  this.fMediator = fMediator;
2256
2297
  this.findFirstCanBeConnectedOutputByOutletHandler = findFirstCanBeConnectedOutputByOutletHandler;
2257
2298
  }
@@ -2271,7 +2312,7 @@ class CreateConnectionPrepareDragSequence {
2271
2312
  const nodeOutputs = this.fComponentsStore.fOutputs.filter((x) => node.isContains(x.hostElement));
2272
2313
  outlet.setOutputs(nodeOutputs);
2273
2314
  if (outlet.canBeConnected) {
2274
- const outletCenter = this.getElementRectInFlowHandler.handle(outlet.hostElement).gravityCenter;
2315
+ const outletCenter = this.fMediator.send(new GetElementRectInFlowRequest(outlet.hostElement)).gravityCenter;
2275
2316
  if (outlet.isConnectionFromOutlet) {
2276
2317
  this.createConnectionHandler(pointerPositionInFlow, outlet, outletCenter);
2277
2318
  }
@@ -2292,7 +2333,7 @@ class CreateConnectionPrepareDragSequence {
2292
2333
  throw new Error('Output not found');
2293
2334
  }
2294
2335
  if (output.canBeConnected) {
2295
- const outputCenter = this.getElementRectInFlowHandler.handle(output.hostElement).gravityCenter;
2336
+ const outputCenter = this.fMediator.send(new GetElementRectInFlowRequest(output.hostElement)).gravityCenter;
2296
2337
  this.createConnectionHandler(pointerPositionInFlow, output, outputCenter);
2297
2338
  }
2298
2339
  }
@@ -2310,16 +2351,15 @@ class CreateConnectionPrepareDragSequence {
2310
2351
  const outlets = this.fComponentsStore.fOutlets.filter((x) => node.isContains(x.hostElement));
2311
2352
  return isNodeOutput(targetElement) && !outlets.length;
2312
2353
  }
2313
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: CreateConnectionPrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetElementRectInFlowHandler }, { token: FFlowMediator }, { token: FindFirstCanBeConnectedOutputByOutletHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
2354
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: CreateConnectionPrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }, { token: FindFirstCanBeConnectedOutputByOutletHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
2314
2355
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: CreateConnectionPrepareDragSequence }); }
2315
2356
  }
2316
2357
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: CreateConnectionPrepareDragSequence, decorators: [{
2317
2358
  type: Injectable
2318
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetElementRectInFlowHandler }, { type: FFlowMediator }, { type: FindFirstCanBeConnectedOutputByOutletHandler }] });
2359
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }, { type: FindFirstCanBeConnectedOutputByOutletHandler }] });
2319
2360
 
2320
2361
  class ReassignConnectionDragHandler {
2321
- constructor(getInputRectInFlowHandler, fMediator, connection) {
2322
- this.getInputRectInFlowHandler = getInputRectInFlowHandler;
2362
+ constructor(fMediator, connection) {
2323
2363
  this.fMediator = fMediator;
2324
2364
  this.connection = connection;
2325
2365
  this.type = EFDraggableType.REASSIGN_CONNECTION;
@@ -2330,7 +2370,7 @@ class ReassignConnectionDragHandler {
2330
2370
  }
2331
2371
  initialize() {
2332
2372
  const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
2333
- this.inputSide = this.getInputRectInFlowHandler.handle(this.connection.fInputId).fConnectableSide;
2373
+ this.inputSide = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId)).fConnectableSide;
2334
2374
  this.outputSide = fromConnector.fConnectableSide;
2335
2375
  this.onPointerDownFromConnectorRect = fromConnector.rect;
2336
2376
  this.onPointerDownToConnectorRect = RectExtensions.initialize(this.connection.vector.point2.x, this.connection.vector.point2.y, 0, 0);
@@ -2343,7 +2383,7 @@ class ReassignConnectionDragHandler {
2343
2383
  }
2344
2384
  complete() {
2345
2385
  const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
2346
- const toConnector = this.getInputRectInFlowHandler.handle(this.connection.fInputId);
2386
+ const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
2347
2387
  const vector = this.fMediator.send(new GetConnectionVectorRequest(fromConnector.rect, toConnector.rect, this.connection.fBehavior, fromConnector.fConnectableSide, toConnector.fConnectableSide));
2348
2388
  this.connection.setVector(vector.point1, fromConnector.fConnectableSide, vector.point2, toConnector.fConnectableSide);
2349
2389
  this.connection.redraw();
@@ -2422,7 +2462,7 @@ class ReassignConnectionPrepareDragSequence {
2422
2462
  this.fDraggableDataContext.onPointerDownScale = this.transform.scale;
2423
2463
  this.fDraggableDataContext.onPointerDownPosition = pointerPositionInFlow.div(this.transform.scale);
2424
2464
  this.fDraggableDataContext.draggableItems = [
2425
- new ReassignConnectionDragHandler(this.getInputRectInFlowHandler, this.fMediator, connectionToReassign)
2465
+ new ReassignConnectionDragHandler(this.fMediator, connectionToReassign)
2426
2466
  ];
2427
2467
  }
2428
2468
  }
@@ -2535,7 +2575,8 @@ class FExternalItemDirective extends FExternalItemBase {
2535
2575
  super();
2536
2576
  this.elementReference = elementReference;
2537
2577
  this.fExternalItemService = fExternalItemService;
2538
- this.id = `f-external-item-${uniqueId$1++}`;
2578
+ this.fExternalItemId = `f-external-item-${uniqueId$1++}`;
2579
+ this.fDisabled = false;
2539
2580
  }
2540
2581
  ngOnInit() {
2541
2582
  this.fExternalItemService.registerItem(this);
@@ -2544,7 +2585,7 @@ class FExternalItemDirective extends FExternalItemBase {
2544
2585
  this.fExternalItemService.removeItem(this);
2545
2586
  }
2546
2587
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FExternalItemDirective, deps: [{ token: i0.ElementRef }, { token: FExternalItemService }], target: i0.ɵɵFactoryTarget.Directive }); }
2547
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.1", type: FExternalItemDirective, selector: "[fExternalItem]", inputs: { id: "id", data: "data" }, host: { properties: { "attr.id": "id" }, classAttribute: "f-component f-external-item" }, providers: [
2588
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.1", type: FExternalItemDirective, selector: "[fExternalItem]", inputs: { fExternalItemId: "fExternalItemId", fData: "fData", fDisabled: "fDisabled" }, host: { properties: { "attr.id": "fExternalItemId", "class.f-external-item-disabled": "fDisabled" }, classAttribute: "f-component f-external-item" }, providers: [
2548
2589
  { provide: F_EXTERNAL_ITEM, useExisting: FExternalItemDirective }
2549
2590
  ], usesInheritance: true, ngImport: i0 }); }
2550
2591
  }
@@ -2553,16 +2594,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
2553
2594
  args: [{
2554
2595
  selector: "[fExternalItem]",
2555
2596
  host: {
2556
- '[attr.id]': 'id',
2597
+ '[attr.id]': 'fExternalItemId',
2557
2598
  class: "f-component f-external-item",
2599
+ '[class.f-external-item-disabled]': 'fDisabled',
2558
2600
  },
2559
2601
  providers: [
2560
2602
  { provide: F_EXTERNAL_ITEM, useExisting: FExternalItemDirective }
2561
2603
  ],
2562
2604
  }]
2563
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FExternalItemService }], propDecorators: { id: [{
2605
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FExternalItemService }], propDecorators: { fExternalItemId: [{
2606
+ type: Input
2607
+ }], fData: [{
2564
2608
  type: Input
2565
- }], data: [{
2609
+ }], fDisabled: [{
2566
2610
  type: Input
2567
2611
  }] } });
2568
2612
 
@@ -2584,6 +2628,9 @@ class ExternalItemPrepareDragSequence {
2584
2628
  if (!item) {
2585
2629
  throw new Error('External item not found');
2586
2630
  }
2631
+ if (item.fDisabled) {
2632
+ return;
2633
+ }
2587
2634
  const pointerPositionInFlow = Point.fromPoint(event.getPosition()).elementTransform(this.flowHost);
2588
2635
  this.fDraggableDataContext.onPointerDownScale = 1;
2589
2636
  this.fDraggableDataContext.onPointerDownPosition = pointerPositionInFlow.div(1);
@@ -2606,10 +2653,10 @@ class ExternalItemOnPointerUp {
2606
2653
  get fCreateNode() {
2607
2654
  return this.fComponentsStore.fDraggable.fCreateNode;
2608
2655
  }
2609
- constructor(fComponentsStore, fDraggableDataContext, getElementRectInFlowHandler) {
2656
+ constructor(fComponentsStore, fDraggableDataContext, fMediator) {
2610
2657
  this.fComponentsStore = fComponentsStore;
2611
2658
  this.fDraggableDataContext = fDraggableDataContext;
2612
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
2659
+ this.fMediator = fMediator;
2613
2660
  }
2614
2661
  handle(event) {
2615
2662
  const pointerPositionInFlow = Point.fromPoint(event.getPosition()).elementTransform(this.flowHost);
@@ -2620,18 +2667,18 @@ class ExternalItemOnPointerUp {
2620
2667
  dragHandler.move(difference);
2621
2668
  const isPointerInCanvasRect = document.elementsFromPoint(event.getPosition().x, event.getPosition().y).some((x) => x === this.flowHost);
2622
2669
  if (isPointerInCanvasRect) {
2623
- const rectInCanvas = this.getElementRectInFlowHandler.handle(dragHandler.placeholder);
2624
- this.fCreateNode.emit(new FCreateNodeEvent(rectInCanvas, dragHandler.externalItem.data));
2670
+ const rectInCanvas = this.fMediator.send(new GetElementRectInFlowRequest(dragHandler.placeholder));
2671
+ this.fCreateNode.emit(new FCreateNodeEvent(rectInCanvas, dragHandler.externalItem.fData));
2625
2672
  }
2626
2673
  dragHandler.complete();
2627
2674
  }
2628
2675
  }
2629
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ExternalItemOnPointerUp, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetElementRectInFlowHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
2676
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ExternalItemOnPointerUp, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
2630
2677
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ExternalItemOnPointerUp }); }
2631
2678
  }
2632
2679
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: ExternalItemOnPointerUp, decorators: [{
2633
2680
  type: Injectable
2634
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetElementRectInFlowHandler }] });
2681
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
2635
2682
 
2636
2683
  const EXTERNAL_ITEM_PROVIDERS = [
2637
2684
  ExternalItemOnPointerUp,
@@ -2645,10 +2692,10 @@ class IsConnectionUnderNodeHandler {
2645
2692
  get flowHost() {
2646
2693
  return this.fComponentsStore.fFlow.hostElement;
2647
2694
  }
2648
- constructor(fComponentsStore, fDraggableDataContext, getElementRectInFlowHandler, getOutgoingConnectionsHandler, getIncomingConnectionsHandler) {
2695
+ constructor(fComponentsStore, fDraggableDataContext, fMediator, getOutgoingConnectionsHandler, getIncomingConnectionsHandler) {
2649
2696
  this.fComponentsStore = fComponentsStore;
2650
2697
  this.fDraggableDataContext = fDraggableDataContext;
2651
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
2698
+ this.fMediator = fMediator;
2652
2699
  this.getOutgoingConnectionsHandler = getOutgoingConnectionsHandler;
2653
2700
  this.getIncomingConnectionsHandler = getIncomingConnectionsHandler;
2654
2701
  }
@@ -2672,6 +2719,7 @@ class IsConnectionUnderNodeHandler {
2672
2719
  if (outgoingConnections.length === 0 && incomingConnections.length === 0) {
2673
2720
  const connections = this.findConnectionsUnderNode(fNode);
2674
2721
  if (connections.length) {
2722
+ //TODO: need to implement
2675
2723
  }
2676
2724
  }
2677
2725
  }
@@ -2688,22 +2736,21 @@ class IsConnectionUnderNodeHandler {
2688
2736
  return this.fComponentsStore.fInputs.filter((x) => node.isContains(x.hostElement));
2689
2737
  }
2690
2738
  findConnectionsUnderNode(node) {
2691
- const nodeRect = this.getElementRectInFlowHandler.handle(node.hostElement);
2739
+ const nodeRect = this.fMediator.send(new GetElementRectInFlowRequest(node.hostElement));
2692
2740
  return this.fComponentsStore.fConnections.filter((x) => {
2693
2741
  const intersection = RectExtensions.intersectionWithVector(nodeRect, x.vector.point1, x.vector.point2);
2694
2742
  return (intersection || []).length > 0;
2695
2743
  });
2696
2744
  }
2697
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IsConnectionUnderNodeHandler, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetElementRectInFlowHandler }, { token: GetOutgoingConnectionsHandler }, { token: GetIncomingConnectionsHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
2745
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IsConnectionUnderNodeHandler, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }, { token: GetOutgoingConnectionsHandler }, { token: GetIncomingConnectionsHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
2698
2746
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IsConnectionUnderNodeHandler }); }
2699
2747
  }
2700
2748
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: IsConnectionUnderNodeHandler, decorators: [{
2701
2749
  type: Injectable
2702
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetElementRectInFlowHandler }, { type: GetOutgoingConnectionsHandler }, { type: GetIncomingConnectionsHandler }] });
2750
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }, { type: GetOutgoingConnectionsHandler }, { type: GetIncomingConnectionsHandler }] });
2703
2751
 
2704
2752
  class ConnectionDragHandler {
2705
- constructor(getInputRectInFlowHandler, fMediator, connection) {
2706
- this.getInputRectInFlowHandler = getInputRectInFlowHandler;
2753
+ constructor(fMediator, connection) {
2707
2754
  this.fMediator = fMediator;
2708
2755
  this.connection = connection;
2709
2756
  this.type = EFDraggableType.CONNECTION;
@@ -2714,7 +2761,7 @@ class ConnectionDragHandler {
2714
2761
  initialize() {
2715
2762
  const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
2716
2763
  this.fromConnectorSide = fromConnector.fConnectableSide;
2717
- const toConnector = this.getInputRectInFlowHandler.handle(this.connection.fInputId);
2764
+ const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
2718
2765
  this.toConnectorSide = toConnector.fConnectableSide;
2719
2766
  this.onPointerDownVector = this.fMediator.send(new GetConnectionVectorRequest(fromConnector.rect, toConnector.rect, this.connection.fBehavior, fromConnector.fConnectableSide, toConnector.fConnectableSide));
2720
2767
  }
@@ -2727,8 +2774,7 @@ class ConnectionDragHandler {
2727
2774
  }
2728
2775
 
2729
2776
  class ConnectionSourceDragHandler {
2730
- constructor(getInputRectInFlowHandler, fMediator, connection) {
2731
- this.getInputRectInFlowHandler = getInputRectInFlowHandler;
2777
+ constructor(fMediator, connection) {
2732
2778
  this.fMediator = fMediator;
2733
2779
  this.connection = connection;
2734
2780
  this.type = EFDraggableType.CONNECTION;
@@ -2741,7 +2787,7 @@ class ConnectionSourceDragHandler {
2741
2787
  const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
2742
2788
  this.fromConnectorRect = fromConnector.rect;
2743
2789
  this.fromConnectorSide = fromConnector.fConnectableSide;
2744
- const toConnector = this.getInputRectInFlowHandler.handle(this.connection.fInputId);
2790
+ const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
2745
2791
  this.toConnectorRect = toConnector.rect;
2746
2792
  this.toConnectorSide = toConnector.fConnectableSide;
2747
2793
  }
@@ -2754,8 +2800,7 @@ class ConnectionSourceDragHandler {
2754
2800
  }
2755
2801
 
2756
2802
  class ConnectionTargetDragHandler {
2757
- constructor(getInputRectInFlowHandler, fMediator, connection) {
2758
- this.getInputRectInFlowHandler = getInputRectInFlowHandler;
2803
+ constructor(fMediator, connection) {
2759
2804
  this.fMediator = fMediator;
2760
2805
  this.connection = connection;
2761
2806
  this.type = EFDraggableType.CONNECTION;
@@ -2768,7 +2813,7 @@ class ConnectionTargetDragHandler {
2768
2813
  const fromConnector = this.fMediator.send(new GetOutputRectInFlowRequest(this.connection.fOutputId));
2769
2814
  this.fromConnectorRect = fromConnector.rect;
2770
2815
  this.fromConnectorSide = fromConnector.fConnectableSide;
2771
- const toConnector = this.getInputRectInFlowHandler.handle(this.connection.fInputId);
2816
+ const toConnector = this.fMediator.send(new GetInputRectInFlowRequest(this.connection.fInputId));
2772
2817
  this.toConnectorRect = toConnector.rect;
2773
2818
  this.toConnectorSide = toConnector.fConnectableSide;
2774
2819
  }
@@ -2843,11 +2888,10 @@ class NodePrepareDragSequence {
2843
2888
  get flowHost() {
2844
2889
  return this.fComponentsStore.fFlow.hostElement;
2845
2890
  }
2846
- constructor(fComponentsStore, fDraggableDataContext, updateNodeLayerHandler, getInputRectInFlowHandler, getOutgoingConnectionsHandler, getIncomingConnectionsHandler, fMediator) {
2891
+ constructor(fComponentsStore, fDraggableDataContext, updateNodeLayerHandler, getOutgoingConnectionsHandler, getIncomingConnectionsHandler, fMediator) {
2847
2892
  this.fComponentsStore = fComponentsStore;
2848
2893
  this.fDraggableDataContext = fDraggableDataContext;
2849
2894
  this.updateNodeLayerHandler = updateNodeLayerHandler;
2850
- this.getInputRectInFlowHandler = getInputRectInFlowHandler;
2851
2895
  this.getOutgoingConnectionsHandler = getOutgoingConnectionsHandler;
2852
2896
  this.getIncomingConnectionsHandler = getIncomingConnectionsHandler;
2853
2897
  this.fMediator = fMediator;
@@ -2891,10 +2935,10 @@ class NodePrepareDragSequence {
2891
2935
  const outputConnections = this.getOutgoingConnectionsHandler.handle(this.getOutputsForNode(nodeHandler.fNode));
2892
2936
  outputConnections.forEach((c) => {
2893
2937
  if (allInputIds.includes(c.fInputId)) {
2894
- itemsToDrag.push(new ConnectionDragHandler(this.getInputRectInFlowHandler, this.fMediator, c));
2938
+ itemsToDrag.push(new ConnectionDragHandler(this.fMediator, c));
2895
2939
  }
2896
2940
  else {
2897
- itemsToDrag.push(new ConnectionSourceDragHandler(this.getInputRectInFlowHandler, this.fMediator, c));
2941
+ itemsToDrag.push(new ConnectionSourceDragHandler(this.fMediator, c));
2898
2942
  }
2899
2943
  });
2900
2944
  const inputConnections = this.getIncomingConnectionsHandler.handle(this.getInputsForNode(nodeHandler.fNode));
@@ -2902,11 +2946,11 @@ class NodePrepareDragSequence {
2902
2946
  if (allOutputIds.includes(c.fOutputId)) {
2903
2947
  const index = itemsToDrag.findIndex((x) => x.type === EFDraggableType.CONNECTION && x.connection.fConnectionId === c.fConnectionId);
2904
2948
  if (index !== -1) {
2905
- itemsToDrag.push(new ConnectionDragHandler(this.getInputRectInFlowHandler, this.fMediator, c));
2949
+ itemsToDrag.push(new ConnectionDragHandler(this.fMediator, c));
2906
2950
  }
2907
2951
  }
2908
2952
  else {
2909
- itemsToDrag.push(new ConnectionTargetDragHandler(this.getInputRectInFlowHandler, this.fMediator, c));
2953
+ itemsToDrag.push(new ConnectionTargetDragHandler(this.fMediator, c));
2910
2954
  }
2911
2955
  });
2912
2956
  });
@@ -2918,12 +2962,12 @@ class NodePrepareDragSequence {
2918
2962
  getOutputsForNode(node) {
2919
2963
  return this.fComponentsStore.fOutputs.filter((x) => node.isContains(x.hostElement));
2920
2964
  }
2921
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: NodePrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: UpdateNodeLayerHandler }, { token: GetInputRectInFlowHandler }, { token: GetOutgoingConnectionsHandler }, { token: GetIncomingConnectionsHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
2965
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: NodePrepareDragSequence, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: UpdateNodeLayerHandler }, { token: GetOutgoingConnectionsHandler }, { token: GetIncomingConnectionsHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
2922
2966
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: NodePrepareDragSequence }); }
2923
2967
  }
2924
2968
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: NodePrepareDragSequence, decorators: [{
2925
2969
  type: Injectable
2926
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: UpdateNodeLayerHandler }, { type: GetInputRectInFlowHandler }, { type: GetOutgoingConnectionsHandler }, { type: GetIncomingConnectionsHandler }, { type: FFlowMediator }] });
2970
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: UpdateNodeLayerHandler }, { type: GetOutgoingConnectionsHandler }, { type: GetIncomingConnectionsHandler }, { type: FFlowMediator }] });
2927
2971
 
2928
2972
  const NODE_PROVIDERS = [
2929
2973
  NodeOnPointerUp,
@@ -2941,10 +2985,10 @@ class GetCanBeSelectedItemsHandler {
2941
2985
  get transform() {
2942
2986
  return this.fComponentsStore.fCanvas.transform;
2943
2987
  }
2944
- constructor(fComponentsStore, fDraggableDataContext, getElementRectInFlowHandler) {
2988
+ constructor(fComponentsStore, fDraggableDataContext, fMediator) {
2945
2989
  this.fComponentsStore = fComponentsStore;
2946
2990
  this.fDraggableDataContext = fDraggableDataContext;
2947
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
2991
+ this.fMediator = fMediator;
2948
2992
  }
2949
2993
  handle() {
2950
2994
  const nodeRects = this.getNodesWithRects();
@@ -2956,7 +3000,7 @@ class GetCanBeSelectedItemsHandler {
2956
3000
  }
2957
3001
  getNodesWithRects() {
2958
3002
  return this.fNodes.map((x) => {
2959
- const rect = this.getElementRectInFlowHandler.handle(x.hostElement);
3003
+ const rect = this.fMediator.send(new GetElementRectInFlowRequest(x.hostElement));
2960
3004
  return {
2961
3005
  element: x,
2962
3006
  rect: RectExtensions.mult(rect, this.transform.scale)
@@ -2965,19 +3009,19 @@ class GetCanBeSelectedItemsHandler {
2965
3009
  }
2966
3010
  getConnectionsWithRects() {
2967
3011
  return this.fConnections.map((x) => {
2968
- const rect = this.getElementRectInFlowHandler.handle(x.boundingElement);
3012
+ const rect = this.fMediator.send(new GetElementRectInFlowRequest(x.boundingElement));
2969
3013
  return {
2970
3014
  element: x,
2971
3015
  rect: RectExtensions.mult(rect, this.transform.scale)
2972
3016
  };
2973
3017
  });
2974
3018
  }
2975
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetCanBeSelectedItemsHandler, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetElementRectInFlowHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
3019
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetCanBeSelectedItemsHandler, deps: [{ token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
2976
3020
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetCanBeSelectedItemsHandler }); }
2977
3021
  }
2978
3022
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetCanBeSelectedItemsHandler, decorators: [{
2979
3023
  type: Injectable
2980
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetElementRectInFlowHandler }] });
3024
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
2981
3025
 
2982
3026
  class SelectionAreaDragHandle {
2983
3027
  get canvasPosition() {
@@ -3461,7 +3505,7 @@ let GetConnectionVectorHandler = class GetConnectionVectorHandler {
3461
3505
  constructor() {
3462
3506
  this.behaviorHandlers = {
3463
3507
  [EFConnectionBehavior.FLOATING.toString()]: this.floatingBehavior,
3464
- // [EFConnectionBehavior.FIXED.toString()]: this.fixedBehavior,
3508
+ [EFConnectionBehavior.FIXED_CENTER.toString()]: this.fixedCenterBehavior,
3465
3509
  [EFConnectionBehavior.FIXED.toString()]: this.fixedOutboundBehaviour,
3466
3510
  };
3467
3511
  }
@@ -3477,7 +3521,7 @@ let GetConnectionVectorHandler = class GetConnectionVectorHandler {
3477
3521
  point2: toResult ? toResult[0] : payload.inputRect.gravityCenter,
3478
3522
  };
3479
3523
  }
3480
- fixedBehavior(payload) {
3524
+ fixedCenterBehavior(payload) {
3481
3525
  return {
3482
3526
  point1: payload.outputRect.gravityCenter,
3483
3527
  point2: payload.inputRect.gravityCenter,
@@ -3527,30 +3571,13 @@ const positionFixedOutbound = {
3527
3571
  },
3528
3572
  };
3529
3573
 
3530
- class GetOutputRectInFlowRequest {
3531
- constructor(fOutputId) {
3532
- this.fOutputId = fOutputId;
3533
- }
3534
- }
3535
-
3536
- function OutputNotFound(outputId) {
3537
- return new Error(`Output with id ${outputId} not found`);
3538
- }
3539
- function InputNotFound(inputId) {
3540
- return new Error(`Input with id ${inputId} not found`);
3541
- }
3542
- function requiredOutput() {
3543
- return new Error(`The node must contain at least one fOutput if there is an fOutlet`);
3544
- }
3545
-
3546
- class GetOutputRectInFlowResponse {
3547
- constructor(rect, fConnectableSide) {
3548
- this.rect = rect;
3549
- this.fConnectableSide = fConnectableSide;
3574
+ class GetElementRectInFlowRequest {
3575
+ constructor(element) {
3576
+ this.element = element;
3550
3577
  }
3551
3578
  }
3552
3579
 
3553
- class GetElementRectInFlowHandler {
3580
+ let GetElementRectInFlowHandler = class GetElementRectInFlowHandler {
3554
3581
  get transform() {
3555
3582
  return this.fComponentsStore.transform;
3556
3583
  }
@@ -3560,8 +3587,8 @@ class GetElementRectInFlowHandler {
3560
3587
  constructor(fComponentsStore) {
3561
3588
  this.fComponentsStore = fComponentsStore;
3562
3589
  }
3563
- handle(element) {
3564
- const systemRect = RectExtensions.fromElement(element);
3590
+ handle(request) {
3591
+ const systemRect = RectExtensions.fromElement(request.element);
3565
3592
  const position = Point.fromPoint(systemRect).elementTransform(this.flowHost).sub(this.transform.scaledPosition).sub(this.transform.position).div(this.transform.scale);
3566
3593
  const size = SizeExtensions.initialize(systemRect.width / this.transform.scale, systemRect.height / this.transform.scale);
3567
3594
  const result = RectExtensions.initialize(position.x, position.y, size.width, size.height);
@@ -3569,25 +3596,102 @@ class GetElementRectInFlowHandler {
3569
3596
  }
3570
3597
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetElementRectInFlowHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable }); }
3571
3598
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetElementRectInFlowHandler }); }
3572
- }
3599
+ };
3600
+ GetElementRectInFlowHandler = __decorate([
3601
+ FHandlerRegister(GetElementRectInFlowRequest)
3602
+ ], GetElementRectInFlowHandler);
3573
3603
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetElementRectInFlowHandler, decorators: [{
3574
3604
  type: Injectable
3575
3605
  }], ctorParameters: () => [{ type: FComponentsStore }] });
3576
3606
 
3607
+ class GetInputRectInFlowRequest {
3608
+ constructor(fInputId) {
3609
+ this.fInputId = fInputId;
3610
+ }
3611
+ }
3612
+
3613
+ class GetInputRectInFlowResponse {
3614
+ constructor(rect, fConnectableSide) {
3615
+ this.rect = rect;
3616
+ this.fConnectableSide = fConnectableSide;
3617
+ }
3618
+ }
3619
+
3620
+ let GetInputRectInFlowHandler = class GetInputRectInFlowHandler {
3621
+ constructor(fComponentsStore, fMediator) {
3622
+ this.fComponentsStore = fComponentsStore;
3623
+ this.fMediator = fMediator;
3624
+ }
3625
+ handle(request) {
3626
+ const input = this.fComponentsStore.fInputs.find((x) => x.id === request.fInputId);
3627
+ if (!input) {
3628
+ throw InputNotFound(request.fInputId);
3629
+ }
3630
+ const result = this.fMediator.send(new GetElementRectInFlowRequest(input.hostElement));
3631
+ return new GetInputRectInFlowResponse(result, input.fConnectableSide);
3632
+ }
3633
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetInputRectInFlowHandler, deps: [{ token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
3634
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetInputRectInFlowHandler }); }
3635
+ };
3636
+ GetInputRectInFlowHandler = __decorate([
3637
+ FHandlerRegister(GetInputRectInFlowRequest)
3638
+ ], GetInputRectInFlowHandler);
3639
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetInputRectInFlowHandler, decorators: [{
3640
+ type: Injectable
3641
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }] });
3642
+
3643
+ class GetNodesRectRequest {
3644
+ }
3645
+
3646
+ let GetNodesRectHandler = class GetNodesRectHandler {
3647
+ constructor(fComponentsStore) {
3648
+ this.fComponentsStore = fComponentsStore;
3649
+ }
3650
+ handle(request) {
3651
+ const fNodes = this.fComponentsStore.fNodes;
3652
+ const rects = fNodes.map((x) => {
3653
+ return RectExtensions.fromElement(x.hostElement);
3654
+ });
3655
+ const result = RectExtensions.union(rects);
3656
+ return result;
3657
+ }
3658
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetNodesRectHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable }); }
3659
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetNodesRectHandler }); }
3660
+ };
3661
+ GetNodesRectHandler = __decorate([
3662
+ FHandlerRegister(GetNodesRectRequest)
3663
+ ], GetNodesRectHandler);
3664
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetNodesRectHandler, decorators: [{
3665
+ type: Injectable
3666
+ }], ctorParameters: () => [{ type: FComponentsStore }] });
3667
+
3668
+ class GetOutputRectInFlowRequest {
3669
+ constructor(fOutputId) {
3670
+ this.fOutputId = fOutputId;
3671
+ }
3672
+ }
3673
+
3674
+ class GetOutputRectInFlowResponse {
3675
+ constructor(rect, fConnectableSide) {
3676
+ this.rect = rect;
3677
+ this.fConnectableSide = fConnectableSide;
3678
+ }
3679
+ }
3680
+
3577
3681
  let GetOutputRectInFlowHandler = class GetOutputRectInFlowHandler {
3578
- constructor(fComponentsStore, getElementRectInFlowHandler) {
3682
+ constructor(fComponentsStore, fMediator) {
3579
3683
  this.fComponentsStore = fComponentsStore;
3580
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
3684
+ this.fMediator = fMediator;
3581
3685
  }
3582
3686
  handle(request) {
3583
3687
  const output = this.fComponentsStore.fOutputs.find((x) => x.id === request.fOutputId);
3584
3688
  if (!output) {
3585
3689
  throw OutputNotFound(request.fOutputId);
3586
3690
  }
3587
- const result = this.getElementRectInFlowHandler.handle(output.hostElement);
3691
+ const result = this.fMediator.send(new GetElementRectInFlowRequest(output.hostElement));
3588
3692
  return new GetOutputRectInFlowResponse(result, output.fConnectableSide);
3589
3693
  }
3590
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetOutputRectInFlowHandler, deps: [{ token: FComponentsStore }, { token: GetElementRectInFlowHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
3694
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetOutputRectInFlowHandler, deps: [{ token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
3591
3695
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetOutputRectInFlowHandler }); }
3592
3696
  };
3593
3697
  GetOutputRectInFlowHandler = __decorate([
@@ -3595,7 +3699,7 @@ GetOutputRectInFlowHandler = __decorate([
3595
3699
  ], GetOutputRectInFlowHandler);
3596
3700
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetOutputRectInFlowHandler, decorators: [{
3597
3701
  type: Injectable
3598
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: GetElementRectInFlowHandler }] });
3702
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }] });
3599
3703
 
3600
3704
  class GetSelectionRequest {
3601
3705
  }
@@ -3633,9 +3737,8 @@ class RedrawConnectionsRequest {
3633
3737
  }
3634
3738
 
3635
3739
  let RedrawConnectionsHandler = class RedrawConnectionsHandler {
3636
- constructor(fComponentsStore, getElementRectInFlowHandler, fMediator) {
3740
+ constructor(fComponentsStore, fMediator) {
3637
3741
  this.fComponentsStore = fComponentsStore;
3638
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
3639
3742
  this.fMediator = fMediator;
3640
3743
  }
3641
3744
  handle(request) {
@@ -3662,11 +3765,11 @@ let RedrawConnectionsHandler = class RedrawConnectionsHandler {
3662
3765
  connection.initialize();
3663
3766
  }
3664
3767
  getVector(output, input, connection) {
3665
- const outputRect = this.getElementRectInFlowHandler.handle(output.hostElement);
3666
- const inputRect = this.getElementRectInFlowHandler.handle(input.hostElement);
3768
+ const outputRect = this.fMediator.send(new GetElementRectInFlowRequest(output.hostElement));
3769
+ const inputRect = this.fMediator.send(new GetElementRectInFlowRequest(input.hostElement));
3667
3770
  return this.fMediator.send(new GetConnectionVectorRequest(outputRect, inputRect, connection.fBehavior, output.fConnectableSide, input.fConnectableSide));
3668
3771
  }
3669
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RedrawConnectionsHandler, deps: [{ token: FComponentsStore }, { token: GetElementRectInFlowHandler }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
3772
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RedrawConnectionsHandler, deps: [{ token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Injectable }); }
3670
3773
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RedrawConnectionsHandler }); }
3671
3774
  };
3672
3775
  RedrawConnectionsHandler = __decorate([
@@ -3674,7 +3777,7 @@ RedrawConnectionsHandler = __decorate([
3674
3777
  ], RedrawConnectionsHandler);
3675
3778
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: RedrawConnectionsHandler, decorators: [{
3676
3779
  type: Injectable
3677
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: GetElementRectInFlowHandler }, { type: FFlowMediator }] });
3780
+ }], ctorParameters: () => [{ type: FComponentsStore }, { type: FFlowMediator }] });
3678
3781
 
3679
3782
  class SelectAllRequest {
3680
3783
  }
@@ -3709,25 +3812,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
3709
3812
  type: Injectable
3710
3813
  }], ctorParameters: () => [{ type: FComponentsStore }, { type: FDraggableDataContext }] });
3711
3814
 
3712
- class GetAllNodesRectHandler {
3713
- constructor(fComponentsStore) {
3714
- this.fComponentsStore = fComponentsStore;
3715
- }
3716
- handle() {
3717
- const fNodes = this.fComponentsStore.fNodes;
3718
- const rects = fNodes.map((x) => {
3719
- return RectExtensions.fromElement(x.hostElement);
3720
- });
3721
- const result = RectExtensions.union(rects);
3722
- return result;
3723
- }
3724
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetAllNodesRectHandler, deps: [{ token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Injectable }); }
3725
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetAllNodesRectHandler }); }
3726
- }
3727
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetAllNodesRectHandler, decorators: [{
3728
- type: Injectable
3729
- }], ctorParameters: () => [{ type: FComponentsStore }] });
3730
-
3731
3815
  class GetConnectionHandler {
3732
3816
  get fConnections() {
3733
3817
  return this.fComponentsStore.fConnections;
@@ -3786,26 +3870,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
3786
3870
  type: Injectable
3787
3871
  }], ctorParameters: () => [{ type: FComponentsStore }] });
3788
3872
 
3789
- class GetInputRectInFlowHandler {
3790
- constructor(fComponentsStore, getElementRectInFlowHandler) {
3791
- this.fComponentsStore = fComponentsStore;
3792
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
3793
- }
3794
- handle(inputId) {
3795
- const input = this.fComponentsStore.fInputs.find((x) => x.id === inputId);
3796
- if (!input) {
3797
- throw InputNotFound(inputId);
3798
- }
3799
- const result = this.getElementRectInFlowHandler.handle(input.hostElement);
3800
- return { rect: result, fConnectableSide: input.fConnectableSide };
3801
- }
3802
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetInputRectInFlowHandler, deps: [{ token: FComponentsStore }, { token: GetElementRectInFlowHandler }], target: i0.ɵɵFactoryTarget.Injectable }); }
3803
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetInputRectInFlowHandler }); }
3804
- }
3805
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: GetInputRectInFlowHandler, decorators: [{
3806
- type: Injectable
3807
- }], ctorParameters: () => [{ type: FComponentsStore }, { type: GetElementRectInFlowHandler }] });
3808
-
3809
3873
  class UpdateNodeLayerHandler {
3810
3874
  get fNodesContainer() {
3811
3875
  return this.fComponentsStore.fCanvas?.fNodesContainer?.nativeElement;
@@ -3861,13 +3925,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
3861
3925
  const COMMON_PROVIDERS = [
3862
3926
  ClearSelectionHandler,
3863
3927
  GetConnectionVectorHandler,
3928
+ GetElementRectInFlowHandler,
3929
+ GetNodesRectHandler,
3864
3930
  GetOutputRectInFlowHandler,
3865
3931
  GetSelectionHandler,
3866
3932
  RedrawConnectionsHandler,
3867
3933
  SelectAllHandler,
3868
- GetAllNodesRectHandler,
3869
3934
  GetConnectionHandler,
3870
- GetElementRectInFlowHandler,
3871
3935
  GetInputRectInFlowHandler,
3872
3936
  GetIncomingConnectionsHandler,
3873
3937
  GetOutgoingConnectionsHandler,
@@ -3900,10 +3964,10 @@ class FCanvasComponent extends FCanvasBase {
3900
3964
  get hostElement() {
3901
3965
  return this.elementReference.nativeElement;
3902
3966
  }
3903
- constructor(getAllNodesRectHandler, elementReference, fComponentsStore) {
3967
+ constructor(elementReference, fMediator, fComponentsStore) {
3904
3968
  super();
3905
- this.getAllNodesRectHandler = getAllNodesRectHandler;
3906
3969
  this.elementReference = elementReference;
3970
+ this.fMediator = fMediator;
3907
3971
  this.fComponentsStore = fComponentsStore;
3908
3972
  this.fCanvasChange = new EventEmitter();
3909
3973
  }
@@ -3922,7 +3986,10 @@ class FCanvasComponent extends FCanvasBase {
3922
3986
  }, 150);
3923
3987
  }
3924
3988
  fitToScreen(toCenter = PointExtensions.initialize(), animated = true) {
3925
- const fNodesRect = this.getAllNodesRectHandler.handle();
3989
+ const fNodesRect = this.fMediator.send(new GetNodesRectRequest());
3990
+ if (fNodesRect.width === 0 || fNodesRect.height === 0) {
3991
+ return;
3992
+ }
3926
3993
  const rect = RectExtensions.addPointToSize(fNodesRect, Point.fromPoint(toCenter).mult(2));
3927
3994
  this.fitToParent(rect, RectExtensions.fromElement(this.fComponentsStore.fFlow.hostElement), this.fNodes.map((x) => {
3928
3995
  return Point.fromPoint(x.position).sub(toCenter);
@@ -3931,14 +3998,17 @@ class FCanvasComponent extends FCanvasBase {
3931
3998
  this.completeDrag();
3932
3999
  }
3933
4000
  oneToOne() {
3934
- const fNodesRect = this.getAllNodesRectHandler.handle();
4001
+ const fNodesRect = this.fMediator.send(new GetNodesRectRequest());
4002
+ if (fNodesRect.width === 0 || fNodesRect.height === 0) {
4003
+ return;
4004
+ }
3935
4005
  this.oneToOneCentering(fNodesRect, RectExtensions.fromElement(this.fComponentsStore.fFlow.hostElement), this.fNodes.map((x) => {
3936
4006
  return Point.fromPoint(x.position).sub(new Point(0, 0));
3937
4007
  }));
3938
4008
  this.redrawWithAnimation();
3939
4009
  this.completeDrag();
3940
4010
  }
3941
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FCanvasComponent, deps: [{ token: GetAllNodesRectHandler }, { token: i0.ElementRef }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component }); }
4011
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FCanvasComponent, deps: [{ token: i0.ElementRef }, { token: FFlowMediator }, { token: FComponentsStore }], target: i0.ɵɵFactoryTarget.Component }); }
3942
4012
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.1", type: FCanvasComponent, selector: "f-canvas", inputs: { position: "position", scale: "scale" }, outputs: { fCanvasChange: "fCanvasChange" }, host: { classAttribute: "f-component f-canvas" }, providers: [{ provide: F_CANVAS, useExisting: FCanvasComponent }], viewQueries: [{ propertyName: "fNodesContainer", first: true, predicate: ["fNodesContainer"], descendants: true, static: true }, { propertyName: "fConnectionsContainer", first: true, predicate: ["fConnectionsContainer"], descendants: true, static: true }], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <div #fConnectionsContainer>\n <ng-content select=\"f-connection\"></ng-content>\n <ng-content select=\"f-connection-for-create\"></ng-content>\n </div>\n <div #fNodesContainer>\n <ng-content select=\"[fNode]\"></ng-content>\n </div>\n</ng-container>\n", styles: [":host{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3943
4013
  }
3944
4014
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FCanvasComponent, decorators: [{
@@ -3946,7 +4016,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
3946
4016
  args: [{ selector: 'f-canvas', exportAs: 'fComponent', host: {
3947
4017
  'class': 'f-component f-canvas',
3948
4018
  }, providers: [{ provide: F_CANVAS, useExisting: FCanvasComponent }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container>\n <div #fConnectionsContainer>\n <ng-content select=\"f-connection\"></ng-content>\n <ng-content select=\"f-connection-for-create\"></ng-content>\n </div>\n <div #fNodesContainer>\n <ng-content select=\"[fNode]\"></ng-content>\n </div>\n</ng-container>\n", styles: [":host{position:absolute;overflow:visible;width:100%;height:100%;left:0;top:0;transform-origin:0 0;pointer-events:none}\n"] }]
3949
- }], ctorParameters: () => [{ type: GetAllNodesRectHandler }, { type: i0.ElementRef }, { type: FComponentsStore }], propDecorators: { fCanvasChange: [{
4019
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FFlowMediator }, { type: FComponentsStore }], propDecorators: { fCanvasChange: [{
3950
4020
  type: Output
3951
4021
  }], position: [{
3952
4022
  type: Input
@@ -4133,12 +4203,12 @@ class FLineAlignmentComponent extends FLineAlignmentBase {
4133
4203
  get flowHost() {
4134
4204
  return this.fComponentsStore.fFlow.hostElement;
4135
4205
  }
4136
- constructor(elementReference, fComponentsStore, fDraggableDataContext, getElementRectInFlowHandler) {
4206
+ constructor(elementReference, fComponentsStore, fDraggableDataContext, fMediator) {
4137
4207
  super();
4138
4208
  this.elementReference = elementReference;
4139
4209
  this.fComponentsStore = fComponentsStore;
4140
4210
  this.fDraggableDataContext = fDraggableDataContext;
4141
- this.getElementRectInFlowHandler = getElementRectInFlowHandler;
4211
+ this.fMediator = fMediator;
4142
4212
  this.size = SizeExtensions.initialize();
4143
4213
  this.draggedNodeRect = RectExtensions.initialize();
4144
4214
  this.rects = [];
@@ -4151,14 +4221,14 @@ class FLineAlignmentComponent extends FLineAlignmentBase {
4151
4221
  this.size = this.flowHost.getBoundingClientRect();
4152
4222
  this.rects = [];
4153
4223
  const draggedNodeRects = currentNodes.map((x) => {
4154
- return this.getElementRectInFlowHandler.handle(x.hostElement);
4224
+ return this.fMediator.send(new GetElementRectInFlowRequest(x.hostElement));
4155
4225
  });
4156
4226
  this.draggedNodeRect = RectExtensions.union(draggedNodeRects);
4157
4227
  const allNodesExcludeCurrents = allNodes.filter((x) => {
4158
4228
  return !currentNodes.includes(x);
4159
4229
  });
4160
4230
  this.rects = allNodesExcludeCurrents.map((x) => {
4161
- return this.getElementRectInFlowHandler.handle(x.hostElement);
4231
+ return this.fMediator.send(new GetElementRectInFlowRequest(x.hostElement));
4162
4232
  });
4163
4233
  }
4164
4234
  handle(difference) {
@@ -4191,7 +4261,7 @@ class FLineAlignmentComponent extends FLineAlignmentBase {
4191
4261
  this.lineService.hideVerticalLine();
4192
4262
  this.lineService.hideHorizontalLine();
4193
4263
  }
4194
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FLineAlignmentComponent, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }, { token: FDraggableDataContext }, { token: GetElementRectInFlowHandler }], target: i0.ɵɵFactoryTarget.Component }); }
4264
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FLineAlignmentComponent, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }, { token: FDraggableDataContext }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Component }); }
4195
4265
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.1", type: FLineAlignmentComponent, selector: "f-line-alignment", host: { classAttribute: "f-line-alignment f-component" }, providers: [
4196
4266
  { provide: F_LINE_ALIGNMENT, useExisting: FLineAlignmentComponent }
4197
4267
  ], exportAs: ["fComponent"], usesInheritance: true, ngImport: i0, template: "", isInline: true, styles: [":host{display:block;position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }); }
@@ -4203,7 +4273,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
4203
4273
  }, providers: [
4204
4274
  { provide: F_LINE_ALIGNMENT, useExisting: FLineAlignmentComponent }
4205
4275
  ], styles: [":host{display:block;position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
4206
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FComponentsStore }, { type: FDraggableDataContext }, { type: GetElementRectInFlowHandler }] });
4276
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FComponentsStore }, { type: FDraggableDataContext }, { type: FFlowMediator }] });
4207
4277
 
4208
4278
  const F_SELECTION_AREA = new InjectionToken('F_SELECTION_AREA');
4209
4279
  class FSelectionAreaBase {
@@ -4263,10 +4333,9 @@ class FFlowComponent extends FFlowBase {
4263
4333
  get hostElement() {
4264
4334
  return this.elementReference.nativeElement;
4265
4335
  }
4266
- constructor(elementReference, getAllNodesRectHandler, fComponentsStore, fMediator) {
4336
+ constructor(elementReference, fComponentsStore, fMediator) {
4267
4337
  super();
4268
4338
  this.elementReference = elementReference;
4269
- this.getAllNodesRectHandler = getAllNodesRectHandler;
4270
4339
  this.fComponentsStore = fComponentsStore;
4271
4340
  this.fMediator = fMediator;
4272
4341
  this.subscription$ = new Subscription();
@@ -4290,11 +4359,16 @@ class FFlowComponent extends FFlowBase {
4290
4359
  }
4291
4360
  });
4292
4361
  }
4362
+ reset() {
4363
+ this.isLoaded = false;
4364
+ }
4293
4365
  getNodesRect() {
4294
- return this.getAllNodesRectHandler.handle();
4366
+ const result = this.fMediator.send(new GetNodesRectRequest());
4367
+ return result;
4295
4368
  }
4296
4369
  getSelection() {
4297
- return this.fMediator.send(new GetSelectionRequest());
4370
+ const result = this.fMediator.send(new GetSelectionRequest());
4371
+ return result;
4298
4372
  }
4299
4373
  selectAll() {
4300
4374
  this.fMediator.send(new SelectAllRequest());
@@ -4305,7 +4379,7 @@ class FFlowComponent extends FFlowBase {
4305
4379
  ngOnDestroy() {
4306
4380
  this.subscription$.unsubscribe();
4307
4381
  }
4308
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FFlowComponent, deps: [{ token: i0.ElementRef }, { token: GetAllNodesRectHandler }, { token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Component }); }
4382
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FFlowComponent, deps: [{ token: i0.ElementRef }, { token: FComponentsStore }, { token: FFlowMediator }], target: i0.ɵɵFactoryTarget.Component }); }
4309
4383
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.1", type: FFlowComponent, selector: "f-flow", inputs: { fFlowId: "fFlowId" }, outputs: { fLoaded: "fLoaded" }, host: { properties: { "attr.id": "fFlowId" }, classAttribute: "f-component f-flow" }, providers: [
4310
4384
  FFlowMediator,
4311
4385
  FComponentsStore,
@@ -4318,7 +4392,7 @@ class FFlowComponent extends FFlowBase {
4318
4392
  ...CONNECTIONS_PROVIDERS,
4319
4393
  ...COMMON_PROVIDERS,
4320
4394
  { provide: F_FLOW, useExisting: FFlowComponent },
4321
- ], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4395
+ ], usesInheritance: true, ngImport: i0, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n\n <ng-content select=\"f-mini-map\"></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4322
4396
  }
4323
4397
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImport: i0, type: FFlowComponent, decorators: [{
4324
4398
  type: Component,
@@ -4337,8 +4411,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
4337
4411
  ...CONNECTIONS_PROVIDERS,
4338
4412
  ...COMMON_PROVIDERS,
4339
4413
  { provide: F_FLOW, useExisting: FFlowComponent },
4340
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}\n"] }]
4341
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: GetAllNodesRectHandler }, { type: FComponentsStore }, { type: FFlowMediator }], propDecorators: { fFlowId: [{
4414
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container>\n <ng-content select=\"[fDefinitions]\"></ng-content>\n\n <ng-content select=\"f-background\"></ng-content>\n\n <ng-content select=\"f-line-alignment\"></ng-content>\n\n <ng-content select=\"f-canvas\"></ng-content>\n\n <ng-content select=\"f-selection-area\"></ng-content>\n\n <ng-content select=\"f-mini-map\"></ng-content>\n</ng-container>\n", styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:all;-webkit-user-select:none;user-select:none;touch-action:none}\n"] }]
4415
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: FComponentsStore }, { type: FFlowMediator }], propDecorators: { fFlowId: [{
4342
4416
  type: Input
4343
4417
  }], fLoaded: [{
4344
4418
  type: Output
@@ -4437,5 +4511,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.1", ngImpor
4437
4511
  * Generated bundle index. Do not edit.
4438
4512
  */
4439
4513
 
4440
- export { CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectorConnectableSideHandler, CalculateConnectorConnectableSideRequest, CanvasDragHandler, CanvasOnPointerUp, CanvasPrepareDragSequence, ClearSelectionHandler, ClearSelectionRequest, ConnectionDragHandler, ConnectionSourceDragHandler, ConnectionTargetDragHandler, CreateConnectionDragHandler, CreateConnectionOnPointerUp, CreateConnectionPrepareDragSequence, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFDraggableType, EFMarkerType, EXTERNAL_ITEM_PROVIDERS, ExternalItemDragHandler, ExternalItemOnPointerUp, ExternalItemPrepareDragSequence, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCellPatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionDragHandleComponent, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FCreateConnectionEvent, FCreateNodeEvent, FDragHandleDirective, FDraggableBase, FDraggableDataContext, FDraggableDirective, FExternalItemBase, FExternalItemDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowMediator, FFlowModule, FHandlerRegister, FLOW, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FNodeBase, FNodeDirective, FNodeInputBase, FNodeInputDirective, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FPathBuilderBase, FPathBuilderSelector, FReassignConnectionEvent, FResizeObserver, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FStraightPathBuilder, FZoomBase, FZoomDirective, F_BACKGROUND, F_BACKGROUND_PATTERN, F_CANVAS, F_CONNECTION_DRAG_HANDLE_CLASS, F_CONNECTION_IDENTIFIERS, F_DRAGGABLE, F_DRAG_HANDLE, F_EXTERNAL_ITEM, F_FLOW, F_LINE_ALIGNMENT, F_MARKER, F_NODE, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_SELECTED_CLASS, F_SELECTION_AREA, F_ZOOM, FindFirstCanBeConnectedOutputByOutletHandler, FindInputsUnderPointerHandler, FindInputsUnderPointerRequest, FirstNotConnectedInputOfNodeUnderPointerHandler, GetAllNodesRectHandler, GetCanBeSelectedItemsHandler, GetConnectionHandler, GetConnectionVectorHandler, GetConnectionVectorRequest, GetElementRectInFlowHandler, GetIncomingConnectionsHandler, GetInputRectInFlowHandler, GetOutgoingConnectionsHandler, GetOutputRectInFlowHandler, GetOutputRectInFlowRequest, GetOutputRectInFlowResponse, GetSelectionHandler, GetSelectionRequest, InputNotFound, InputsUnderPointerHandler, IsConnectionUnderNodeHandler, LineElement, LineService, MOUSE_EVENT_IGNORE_TIME, NODE_PROVIDERS, NearestCoordinateFinder, NodeDragHandler, NodeOnPointerUp, NodePrepareDragSequence, OutputNotFound, ReassignConnectionDragHandler, ReassignConnectionOnPointerUp, ReassignConnectionPrepareDragSequence, RedrawConnectionsHandler, RedrawConnectionsRequest, SELECTION_AREA_PROVIDERS, SINGLE_SELECT_PROVIDERS, SelectAllHandler, SelectAllRequest, SelectionAreaDragHandle, SelectionAreaOnPointerUp, SelectionAreaPrepareDragSequence, SingleSelectOnPointerDown, UpdateConnectionLayerHandler, UpdateNodeLayerHandler, castToConnectionBehavior, castToConnectionType, getExternalItem, getFlowUid, isExternalItem, isNode, isNodeDragHandle, isNodeInput, isNodeOutlet, isNodeOutput, mixinChangeConnectionSelection, mixinChangeConnectionVisibility, requiredOutput };
4514
+ export { CANVAS_PROVIDERS, COMMON_PROVIDERS, CONNECTIONS_PROVIDERS, CONNECTION_GRADIENT, CONNECTION_PATH, CONNECTION_TEXT, CalculateCenterBetweenPointsHandler, CalculateCenterBetweenPointsRequest, CalculateConnectionCenterHandler, CalculateConnectionCenterRequest, CalculateConnectorConnectableSideHandler, CalculateConnectorConnectableSideRequest, CanvasDragHandler, CanvasOnPointerUp, CanvasPrepareDragSequence, ClearSelectionHandler, ClearSelectionRequest, ConnectionDragHandler, ConnectionSourceDragHandler, ConnectionTargetDragHandler, CreateConnectionDragHandler, CreateConnectionOnPointerUp, CreateConnectionPrepareDragSequence, EFConnectableSide, EFConnectionBehavior, EFConnectionType, EFDraggableType, EFMarkerType, EXTERNAL_ITEM_PROVIDERS, ExternalItemDragHandler, ExternalItemOnPointerUp, ExternalItemPrepareDragSequence, FBackgroundBase, FBackgroundComponent, FBezierPathBuilder, FCanvasBase, FCanvasChangeEvent, FCanvasComponent, FCellPatternComponent, FComponentsStore, FConnectionBase, FConnectionCenterDirective, FConnectionComponent, FConnectionDragHandleComponent, FConnectionForCreateComponent, FConnectionGradientComponent, FConnectionPathComponent, FConnectionSelectionComponent, FConnectionTextComponent, FConnectionTextPathDirective, FConnectorBase, FCreateConnectionEvent, FCreateNodeEvent, FDragHandleDirective, FDraggableBase, FDraggableDataContext, FDraggableDirective, FExternalItemBase, FExternalItemDirective, FExternalItemService, FFlowBase, FFlowComponent, FFlowMediator, FFlowModule, FHandlerRegister, FLOW, FLineAlignmentBase, FLineAlignmentComponent, FMarkerBase, FMarkerDirective, FNodeBase, FNodeDirective, FNodeInputBase, FNodeInputDirective, FNodeOutletBase, FNodeOutletDirective, FNodeOutputBase, FNodeOutputDirective, FPathBuilderBase, FPathBuilderSelector, FReassignConnectionEvent, FResizeObserver, FSegmentPathBuilder, FSelectionAreaBase, FSelectionAreaComponent, FSelectionChangeEvent, FStraightPathBuilder, FZoomBase, FZoomDirective, F_BACKGROUND, F_BACKGROUND_PATTERN, F_CANVAS, F_CONNECTION_DRAG_HANDLE_CLASS, F_CONNECTION_IDENTIFIERS, F_DRAGGABLE, F_DRAG_HANDLE, F_EXTERNAL_ITEM, F_FLOW, F_LINE_ALIGNMENT, F_MARKER, F_NODE, F_NODE_INPUT, F_NODE_OUTLET, F_NODE_OUTPUT, F_SELECTED_CLASS, F_SELECTION_AREA, F_ZOOM, FindFirstCanBeConnectedOutputByOutletHandler, FindInputsUnderPointerHandler, FindInputsUnderPointerRequest, FirstNotConnectedInputOfNodeUnderPointerHandler, GetCanBeSelectedItemsHandler, GetConnectionHandler, GetConnectionVectorHandler, GetConnectionVectorRequest, GetElementRectInFlowHandler, GetElementRectInFlowRequest, GetIncomingConnectionsHandler, GetInputRectInFlowHandler, GetInputRectInFlowRequest, GetInputRectInFlowResponse, GetNodesRectHandler, GetNodesRectRequest, GetOutgoingConnectionsHandler, GetOutputRectInFlowHandler, GetOutputRectInFlowRequest, GetOutputRectInFlowResponse, GetSelectionHandler, GetSelectionRequest, InputsUnderPointerHandler, IsConnectionUnderNodeHandler, LineElement, LineService, MOUSE_EVENT_IGNORE_TIME, NODE_PROVIDERS, NearestCoordinateFinder, NodeDragHandler, NodeOnPointerUp, NodePrepareDragSequence, ReassignConnectionDragHandler, ReassignConnectionOnPointerUp, ReassignConnectionPrepareDragSequence, RedrawConnectionsHandler, RedrawConnectionsRequest, SELECTION_AREA_PROVIDERS, SINGLE_SELECT_PROVIDERS, SelectAllHandler, SelectAllRequest, SelectionAreaDragHandle, SelectionAreaOnPointerUp, SelectionAreaPrepareDragSequence, SingleSelectOnPointerDown, UpdateConnectionLayerHandler, UpdateNodeLayerHandler, castToConnectionBehavior, castToConnectionType, getExternalItem, getFlowUid, isExternalItem, isNode, isNodeDragHandle, isNodeInput, isNodeOutlet, isNodeOutput, mixinChangeConnectionSelection, mixinChangeConnectionVisibility };
4441
4515
  //# sourceMappingURL=foblex-flow.mjs.map