Skip to content

Commit 018a2de

Browse files
committed
Fix stylings
1 parent bc64e27 commit 018a2de

5 files changed

Lines changed: 47 additions & 20 deletions

File tree

src/extensions/react-flow/_react-flow.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@import "edges/edges";
44
@import "handles/handles";
55
@import "minimap/minimap";
6-
@import "@xyflow/react/dist/style.css";
6+
@import "react-flow_v12";
77

88
.react-flow__background {
99
border: solid 1px $eccgui-color-separation-divider;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.react-flow .react-flow__edges svg {
2+
overflow: visible;
3+
position: absolute;
4+
pointer-events: none;
5+
}

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

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,29 @@ export const EdgeDefaultV12 = memo(
102102
) : null);
103103

104104
return (
105-
<>
106-
<g
107-
{...edgeSvgProps}
108-
className={edgeDefaultUtils.createEdgeDefaultClassName({ intent }, edgeSvgProps?.className ?? "")}
109-
style={{
110-
...edgeSvgProps?.style,
111-
...edgeStyle,
112-
color: edgeStyle.color || edgeStyle.stroke,
113-
}}
114-
>
105+
<g
106+
className={
107+
"react-flow__edge " +
108+
edgeDefaultUtils.createEdgeDefaultClassName(
109+
{ intent },
110+
`${edgeOriginalProperties.selected ? "selected" : ""}`
111+
)
112+
}
113+
tabIndex={0}
114+
role="button"
115+
data-id={id}
116+
aria-label={`Edge from ${edgeOriginalProperties.source} to ${edgeOriginalProperties.target}`}
117+
aria-describedby={`react-flow__edge-desc-${id}`}
118+
>
119+
<g className={edgeSvgProps?.className ?? ""}>
115120
{highlightColor && (
116121
<path
117122
d={edgePath}
118123
className={edgeDefaultUtils.createEdgeDefaultClassName(
119124
{ highlightColor },
120125
"react-flow__edge-path-highlight"
121126
)}
122-
strokeWidth={pathGlowWidth}
127+
strokeWidth={10}
123128
style={{
124129
...highlightCustomPropertySettings,
125130
}}
@@ -131,10 +136,17 @@ export const EdgeDefaultV12 = memo(
131136
path={edgePath}
132137
markerStart={inversePath ? "url(#arrow-closed-reverse)" : undefined}
133138
markerEnd={!inversePath ? "url(#arrow-closed)" : undefined}
139+
className="react-flow__edge-path"
140+
interactionWidth={pathGlowWidth}
141+
style={{
142+
...edgeSvgProps?.style,
143+
...edgeStyle,
144+
color: edgeStyle.color || edgeStyle.stroke,
145+
}}
134146
/>
135147
</g>
136148
{renderedLabel}
137-
</>
149+
</g>
138150
);
139151
}
140152
);

src/extensions/react-flow/edges/_edges.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
stroke-opacity: $reactflow-edge-stroke-opacity-selected;
4646
}
4747

48+
// Edge interaction path with reduced opacity for selected state
49+
// The same as path.react-flow__edge-path-glow - in v12 we have a special class for edge-interaction
50+
path[class*="react-flow__edge-interaction"] {
51+
stroke-opacity: $reactflow-edge-stroke-opacity-selected * 0.2;
52+
}
53+
4854
text[class*="react-flow__edge"] {
4955
opacity: $reactflow-edge-stroke-opacity-selected;
5056
}

src/extensions/react-flow/nodes/NodeContent.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,23 @@ export interface NodeContentProps<NODE_DATA, NODE_CONTENT_PROPS = any>
229229

230230
interface MemoHandlerLegacyProps extends HandleProps {
231231
posdirection: string;
232-
style: {
233-
[key: string]: string | undefined;
234-
};
232+
style: React.CSSProperties;
233+
flowVersion: "legacy";
235234
}
236235

237236
interface MemoHandlerNextProps extends HandleNextProps {
238237
posdirection: string;
239-
style: {
240-
[key: string]: string | undefined;
241-
};
238+
style: React.CSSProperties;
239+
flowVersion: "next";
240+
}
241+
242+
interface MemoHandlerV12Props extends HandleV12Props {
243+
posdirection: string;
244+
style: React.CSSProperties;
245+
flowVersion: "v12";
242246
}
243247

244-
type MemoHandlerProps = MemoHandlerLegacyProps | MemoHandlerNextProps;
248+
type MemoHandlerProps = MemoHandlerLegacyProps | MemoHandlerNextProps | MemoHandlerV12Props;
245249

246250
const defaultHandles = (flowVersion: ReacFlowVersionSupportProps["flowVersion"]): NodeContentHandleProps[] => {
247251
switch (flowVersion) {

0 commit comments

Comments
 (0)