Skip to content

Commit 9a3b967

Browse files
Merge pull request #6 from CarstenWickner/compatibility-fixes
2 parents e1d8882 + cf5b5a1 commit 9a3b967

3 files changed

Lines changed: 24 additions & 27 deletions

File tree

.storybook/webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ module.exports = async ({ config }) => {
1616
test: /\.tsx?$/,
1717
use: [
1818
{
19-
loader: "awesome-typescript-loader"
19+
loader: "awesome-typescript-loader",
20+
options: {
21+
useBabel: true,
22+
babelOptions: { presets: ["@babel/env"] },
23+
babelCore: "@babel/core"
24+
}
2025
}, {
2126
loader: "react-docgen-typescript-loader",
2227
options: {

src/component/FlowModeler.scss

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
}
6868
& .arrow,
6969
& .stroke-horizontal,
70-
& .stroke-vertical > *,
70+
& .stroke-vertical::before,
7171
& .centered-line-wrapper::before {
7272
background-color: $strokeColor;
7373
}
@@ -77,7 +77,7 @@
7777
position: relative;
7878
margin-right: $arrowSize;
7979

80-
&:after {
80+
&::after {
8181
content: "";
8282
height: 0;
8383
width: 0;
@@ -103,22 +103,27 @@
103103
}
104104
}
105105
& .stroke-vertical {
106+
position: relative;
106107
display: flex;
107108
flex-direction: column;
108109
align-self: stretch;
109110
width: $strokeStrength;
110-
& .center {
111-
height: $strokeStrength;
111+
&::before {
112+
position: absolute;
113+
content: "";
112114
width: $strokeStrength;
113115
}
114-
& .top,
115-
& .bottom {
116-
flex-grow: 1;
117-
width: $strokeStrength;
116+
&.top-half::before {
117+
height: calc(50% + #{$strokeStrength / 2});
118+
top: 0;
119+
}
120+
&.full-height::before {
121+
height: 100%;
122+
top: 0;
118123
}
119-
&.bottom-half .top,
120-
&.top-half .bottom {
121-
background-color: transparent;
124+
&.bottom-half::before {
125+
height: calc(50% + #{$strokeStrength / 2});
126+
bottom: 0;
122127
}
123128
& + .arrow {
124129
margin-left: -$strokeStrength;

src/component/HorizontalStroke.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,12 @@ export class HorizontalStroke extends React.Component<
3636
}
3737
}
3838

39-
renderVerticalStroke(connectionType: ConnectionType, classNameSuffix: string): React.ReactNode {
40-
if (connectionType) {
41-
return (
42-
<div className={`stroke-vertical ${getConnectionClassName(connectionType)}${classNameSuffix}`}>
43-
<div className="top" />
44-
<div className="center" />
45-
<div className="bottom" />
46-
</div>
47-
);
48-
}
49-
return null;
50-
}
51-
5239
render(): React.ReactNode {
5340
const { className, incomingConnection, outgoingConnection, children } = this.props;
5441
const classNameSuffix = className ? ` ${className}` : "";
5542
return (
5643
<>
57-
{this.renderVerticalStroke(incomingConnection, classNameSuffix)}
44+
{incomingConnection && <div className={`stroke-vertical ${getConnectionClassName(incomingConnection)}${classNameSuffix}`} />}
5845
{!children && <div className={`stroke-horizontal${classNameSuffix}`} />}
5946
{children && (
6047
<div className={`centered-line-wrapper${classNameSuffix}`}>
@@ -67,7 +54,7 @@ export class HorizontalStroke extends React.Component<
6754
/>
6855
</div>
6956
)}
70-
{this.renderVerticalStroke(outgoingConnection, classNameSuffix)}
57+
{outgoingConnection && <div className={`stroke-vertical ${getConnectionClassName(outgoingConnection)}${classNameSuffix}`} />}
7158
</>
7259
);
7360
}

0 commit comments

Comments
 (0)