Skip to content

Commit e512cc9

Browse files
committed
Merge remote-tracking branch 'origin/next' into feature/prepareFinalNext-CMEM-6943
2 parents d63253b + 8192a7e commit e512cc9

5 files changed

Lines changed: 37 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ This is a major release, and it might be not compatible with your current usage
2929
- use `curvature` property in the edge `data` object to define the bezier layout (0..1, default: 0.25)
3030
- `<EdgeDefaultV12 />`
3131
- the `data` object provides `markerAppearance` to set and remove the edge arrows
32+
- `<EdgeDefault />`
33+
- introduced the new `arrowDirection` property, including support for bidirectional edges - supported only for `<EdgeDefaultV12 />`
3234
- `<EdgeNew />`
3335
- component for React Flow v12, displaying new connection lines
3436
- `<VisualTour />`
@@ -68,6 +70,8 @@ This is a major release, and it might be not compatible with your current usage
6870
- SCSS variables `$eccgui-color-application-text` and `$eccgui-color-application-background` were removed
6971
- use `$eccgui-color-workspace-text` and `$eccgui-color-workspace-background`
7072
- support for React Flow v10 was completely removed
73+
- `<EdgeDefault />`
74+
- removed `inversePath` property, can be replaced with `arrowDirection: "inversed"` property
7175

7276
### Fixed
7377

src/extensions/react-flow/edges/EdgeDefault.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ export interface EdgeDefaultDataProps {
2828
* Size of the "glow" effect when the edge is hovered.
2929
*/
3030
pathGlowWidth?: number;
31-
/*
32-
* Direction of the SVG path is inversed.
33-
* This is important for the placement of the markers and the animation movement.
31+
/**
32+
* Controls where arrow heads appear on the edge.
33+
* - `normal`: arrow at the end (target)
34+
* - `inversed`: arrow at the start (source)
35+
* - `bidirectional`: arrows at both start and end
3436
*/
35-
inversePath?: boolean; // FIXME: diection of animation is not inverted
37+
arrowDirection?: "normal" | "inversed" | "bidirectional"; // FIXME: direction of animation is not inverted
3638
/**
3739
* Callback handler that returns a React element used as edge title.
3840
*/

src/extensions/react-flow/edges/EdgeDefaultV12.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ export const EdgeDefaultV12 = memo(
5353
getPath = getStraightPath,
5454
...edgeOriginalProperties
5555
}: EdgeDefaultV12Props) => {
56-
const { pathGlowWidth = 10, highlightColor, renderLabel, edgeSvgProps, intent, inversePath, strokeType } = data;
56+
const {
57+
pathGlowWidth = 10,
58+
highlightColor,
59+
renderLabel,
60+
edgeSvgProps,
61+
intent,
62+
arrowDirection = "normal",
63+
strokeType,
64+
} = data;
5765

5866
const [edgePath, labelX, labelY] = getPath({
5967
sourceX,
@@ -90,12 +98,14 @@ export const EdgeDefaultV12 = memo(
9098
const marker =
9199
appearance !== "none"
92100
? {
93-
markerStart: inversePath
94-
? `url(#react-flow__marker--${appearance}${intent ? `-${intent}` : "-none"}-reverse)`
95-
: undefined,
96-
markerEnd: !inversePath
97-
? `url(#react-flow__marker--${appearance}${intent ? `-${intent}` : "-none"}`
98-
: undefined,
101+
markerStart:
102+
arrowDirection === "inversed" || arrowDirection === "bidirectional"
103+
? `url(#react-flow__marker--${appearance}${intent ? `-${intent}` : "-none"}-reverse)`
104+
: undefined,
105+
markerEnd:
106+
arrowDirection === "normal" || arrowDirection === "bidirectional"
107+
? `url(#react-flow__marker--${appearance}${intent ? `-${intent}` : "-none"}`
108+
: undefined,
99109
}
100110
: {};
101111

src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ InverseEdge.args = {
117117
id: "inverse",
118118
arrowHeadType: undefined,
119119
data: {
120-
inversePath: true,
121120
markerStart: getMarkerEnd(`${ArrowHeadType.ArrowClosed}-inverse` as ArrowHeadType),
122121
},
123122
};

src/extensions/react-flow/edges/stories/EdgeDefaultV12.stories.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,16 @@ InverseEdge.args = {
152152
...Default.args,
153153
id: "inverse",
154154
data: {
155-
inversePath: true,
155+
arrowDirection: "inversed",
156+
},
157+
};
158+
159+
export const Bidirectional = Template.bind({});
160+
Bidirectional.args = {
161+
...Default.args,
162+
id: "bidirectional",
163+
data: {
164+
arrowDirection: "bidirectional",
156165
},
157166
};
158167

0 commit comments

Comments
 (0)