Skip to content

Commit a60cce8

Browse files
refactor(components): rename and restructure connection-related files
- Renamed multiple files for better clarity and organization. - Updated import paths to reflect new file locations. - Consolidated exports in index files for easier access. - Removed deprecated components and requests. - Enhanced the structure of connection control points and related logic. Signed-off-by: Siarhei Huzarevich <shuzarevich@gmail.com>
1 parent 27d40b6 commit a60cce8

File tree

225 files changed

+2831
-1715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+2831
-1715
lines changed

projects/f-examples/connections/connection-content/connection-content.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@
3333
Any Content
3434
</div>
3535
</f-connection>
36+
<f-connection
37+
[fReassignDisabled]="true"
38+
fOutputId="7"
39+
fInputId="8"
40+
fBehavior="fixed"
41+
fType="adaptive-curve"
42+
>
43+
<div fConnectionContent [position]="position()" [align]="align()" [offset]="offset()">
44+
Any Content
45+
</div>
46+
</f-connection>
3647
<div
3748
fNode
3849
fDragHandle
@@ -93,6 +104,26 @@
93104
>
94105
Node 6
95106
</div>
107+
<div
108+
fNode
109+
fDragHandle
110+
[fNodePosition]="{ x: 0, y: 450 }"
111+
fNodeOutput
112+
fOutputId="7"
113+
fOutputConnectableSide="bottom"
114+
>
115+
Node 7
116+
</div>
117+
<div
118+
fNode
119+
fDragHandle
120+
[fNodePosition]="{ x: 300, y: 450 }"
121+
fNodeInput
122+
fInputId="8"
123+
fInputConnectableSide="top"
124+
>
125+
Node 8
126+
</div>
96127
</f-canvas>
97128
</f-flow>
98129
<div class="examples-toolbar">

projects/f-examples/connections/connection-types/connection-types.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<f-flow fDraggable (fLoaded)="loaded()">
22
<f-canvas>
3-
<f-connection [fReassignDisabled]="true" fType="straight" fOutputId="1" fInputId="2" />
3+
<f-connection [fReassignDisabled]="true" fType="straight" fOutputId="1" fInputId="2">
4+
<f-connection-control-points />
5+
</f-connection>
46
<div
57
fNode
68
fDragHandle
@@ -22,7 +24,9 @@
2224
Node
2325
</div>
2426

25-
<f-connection [fReassignDisabled]="true" fType="segment" fOutputId="3" fInputId="4" />
27+
<f-connection [fReassignDisabled]="true" fType="segment" fOutputId="3" fInputId="4">
28+
<f-connection-control-points />
29+
</f-connection>
2630
<div
2731
fNode
2832
fDragHandle
@@ -44,7 +48,9 @@
4448
Node
4549
</div>
4650

47-
<f-connection [fReassignDisabled]="true" fType="bezier" fOutputId="5" fInputId="6" />
51+
<f-connection [fReassignDisabled]="true" fType="bezier" fOutputId="5" fInputId="6">
52+
<f-connection-control-points />
53+
</f-connection>
4854
<div
4955
fNode
5056
fDragHandle
@@ -65,7 +71,10 @@
6571
>
6672
Node
6773
</div>
68-
<f-connection [fReassignDisabled]="true" fType="adaptive-curve" fOutputId="7" fInputId="8" />
74+
75+
<f-connection [fReassignDisabled]="true" fType="adaptive-curve" fOutputId="7" fInputId="8">
76+
<f-connection-control-points />
77+
</f-connection>
6978
<div
7079
fNode
7180
fDragHandle

projects/f-flow/src/domain/css-cls.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,4 @@ export const F_CSS_CLASS = {
2323

2424
CONNECTABLE: 'f-connector-connectable',
2525
},
26-
27-
CONNECTION: {
28-
DRAG_HANDLE: 'f-connection-drag-handle',
29-
},
3026
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { FMarkerBase } from '../../../f-connection';
1+
import { FConnectionMarkerBase } from '../../../f-connection-v2';
22

33
export class AddConnectionMarkerToStoreRequest {
44
static readonly fToken = Symbol('AddConnectionMarkerToStoreRequest');
55

6-
constructor(public readonly component: FMarkerBase) {}
6+
constructor(public readonly component: FConnectionMarkerBase) {}
77
}

projects/f-flow/src/domain/f-connection/calculate-connection-line-by-behavior/calculate-connection-line-by-behavior-request.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

projects/f-flow/src/domain/f-connection/calculate-connection-line-by-behavior/index.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

projects/f-flow/src/domain/f-connection/create-connection-markers/create-connection-markers.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { inject, Injectable } from '@angular/core';
22
import { CreateConnectionMarkersRequest } from './create-connection-markers-request';
3-
import { FConnectionBase, FMarkerBase } from '../../../f-connection';
3+
import { FConnectionBase } from '../../../f-connection';
44
import { FExecutionRegister, IExecution } from '@foblex/mediator';
55
import { BrowserService } from '@foblex/platform';
66
import { normalizeDomElementId } from '@foblex/utils';
77
import { FComponentsStore } from '../../../f-storage';
8+
import { FConnectionMarkerBase } from '../../../f-connection-v2';
89

910
/**
1011
* Execution that creates connection markers for a given connection.
@@ -39,7 +40,7 @@ export class CreateConnectionMarkers implements IExecution<CreateConnectionMarke
3940
this._makeSafariCompatible(connection);
4041
}
4142

42-
public _findConnectionMarkers(connection: FConnectionBase): FMarkerBase[] {
43+
public _findConnectionMarkers(connection: FConnectionBase): FConnectionMarkerBase[] {
4344
return this._store.fMarkers.filter((x) => connection.hostElement.contains(x.hostElement));
4445
}
4546

@@ -50,7 +51,7 @@ export class CreateConnectionMarkers implements IExecution<CreateConnectionMarke
5051
}
5152

5253
function createMarkerElement(
53-
marker: FMarkerBase,
54+
marker: FConnectionMarkerBase,
5455
connectionId: string,
5556
browser: BrowserService,
5657
): SVGElement {

projects/f-flow/src/domain/f-connection/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export * from './add-snap-connection-to-store';
88

99
export * from './create-connection-markers';
1010

11-
export * from './calculate-connection-line-by-behavior';
12-
1311
export * from './redraw-connections';
1412

1513
export * from './remove-connection-for-create-from-store';

projects/f-flow/src/domain/f-connection/providers.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { RemoveSnapConnectionFromStore } from './remove-snap-connection-from-sto
88
import { AddConnectionMarkerToStore } from './add-connection-marker-to-store';
99
import { RemoveConnectionMarkerFromStore } from './remove-connection-marker-from-store';
1010
import { RedrawConnections } from './redraw-connections';
11-
import { CalculateConnectionLineByBehavior } from './calculate-connection-line-by-behavior';
1211

1312
/**
1413
* This file exports all the connection-related features for the F-Flow domain.
@@ -24,8 +23,6 @@ export const F_CONNECTION_FEATURES = [
2423

2524
CreateConnectionMarkers,
2625

27-
CalculateConnectionLineByBehavior,
28-
2926
RedrawConnections,
3027

3128
RemoveConnectionForCreateFromStore,

projects/f-flow/src/domain/f-connection/redraw-connections/redraw-connections.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import { ILine, IRoundedRect } from '@foblex/2d';
22
import { inject, Injectable } from '@angular/core';
33
import { RedrawConnectionsRequest } from './redraw-connections-request';
44
import { FComponentsStore } from '../../../f-storage';
5-
import { CalculateConnectionLineByBehaviorRequest } from '../calculate-connection-line-by-behavior';
65
import { FConnectorBase } from '../../../f-connectors';
76
import { FConnectionBase } from '../../../f-connection';
87
import { FExecutionRegister, FMediator, IExecution } from '@foblex/mediator';
98
import { CreateConnectionMarkersRequest } from '../create-connection-markers';
109
import { GetNormalizedConnectorRectRequest } from '../../get-normalized-connector-rect';
1110
import { DragRectCache } from '../../drag-rect-cache';
11+
import {
12+
ConnectionBehaviourBuilder,
13+
ConnectionBehaviourBuilderRequest,
14+
} from '../../../f-connection-v2';
1215

1316
/**
1417
* Execution that redraws connections in the FComponentsStore.
@@ -20,6 +23,7 @@ import { DragRectCache } from '../../drag-rect-cache';
2023
export class RedrawConnections implements IExecution<RedrawConnectionsRequest, void> {
2124
private readonly _mediator = inject(FMediator);
2225
private readonly _store = inject(FComponentsStore);
26+
private readonly _connectionBehaviour = inject(ConnectionBehaviourBuilder);
2327

2428
public handle(_request: RedrawConnectionsRequest): void {
2529
this._resetConnectors();
@@ -86,8 +90,8 @@ export class RedrawConnections implements IExecution<RedrawConnectionsRequest, v
8690
target: FConnectorBase,
8791
connection: FConnectionBase,
8892
): ILine {
89-
return this._mediator.execute(
90-
new CalculateConnectionLineByBehaviorRequest(
93+
return this._connectionBehaviour.handle(
94+
new ConnectionBehaviourBuilderRequest(
9195
this._calculateConnectorRect(source),
9296
this._calculateConnectorRect(target),
9397
connection,

0 commit comments

Comments
 (0)