Skip to content

Commit 3fbba96

Browse files
authored
0.26.1. (#172)
1 parent a78241e commit 3fbba96

File tree

13 files changed

+53
-48
lines changed

13 files changed

+53
-48
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.26.1
2+
3+
This version fixes the bug with scaling in the pinch-to-zoom feature. Additionally, this version improves the rendering of lines that join steps.
4+
15
# 0.26.0
26

37
This version introduces a few internal changes to support the double-click feature in the pro version.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ Add the below code to your head section in HTML document.
104104
```html
105105
<head>
106106
...
107-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.0/css/designer.css" rel="stylesheet">
108-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.0/css/designer-light.css" rel="stylesheet">
109-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.0/css/designer-dark.css" rel="stylesheet">
110-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.0/dist/index.umd.js"></script>
107+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.1/css/designer.css" rel="stylesheet">
108+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.1/css/designer-light.css" rel="stylesheet">
109+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.1/css/designer-dark.css" rel="stylesheet">
110+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.1/dist/index.umd.js"></script>
111111
```
112112

113113
Call the designer by:

angular/designer/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer-angular",
33
"description": "Angular wrapper for Sequential Workflow Designer component.",
4-
"version": "0.26.0",
4+
"version": "0.26.1",
55
"author": {
66
"name": "NoCode JS",
77
"url": "https://nocode-js.com/"
@@ -15,7 +15,7 @@
1515
"peerDependencies": {
1616
"@angular/common": "12 - 18",
1717
"@angular/core": "12 - 18",
18-
"sequential-workflow-designer": "^0.26.0"
18+
"sequential-workflow-designer": "^0.26.1"
1919
},
2020
"dependencies": {
2121
"tslib": "^2.3.0"

demos/angular-app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"@angular/platform-browser-dynamic": "^17.3.9",
2727
"@angular/router": "^17.3.9",
2828
"rxjs": "~7.8.0",
29-
"sequential-workflow-designer": "^0.26.0",
30-
"sequential-workflow-designer-angular": "^0.26.0",
29+
"sequential-workflow-designer": "^0.26.1",
30+
"sequential-workflow-designer-angular": "^0.26.1",
3131
"tslib": "^2.3.0",
3232
"zone.js": "~0.14.6"
3333
},

demos/angular-app/yarn.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -6744,17 +6744,17 @@ send@0.18.0:
67446744
range-parser "~1.2.1"
67456745
statuses "2.0.1"
67466746

6747-
sequential-workflow-designer-angular@^0.26.0:
6748-
version "0.26.0"
6749-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.26.0.tgz#f27885071efaf6e20e6884129f0666aefcb66ba6"
6750-
integrity sha512-UkWmksYIXggsDGWTHcjDW6RVpEpi3gKkBKBtMsyYTtZsE8PtMm0W5PF6gTHL3t1JBDw40jHCVLeEFNfjOp6jKg==
6747+
sequential-workflow-designer-angular@^0.26.1:
6748+
version "0.26.1"
6749+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.26.1.tgz#a7958048852b1fad66e2dde71a7cc6c740f8ccdc"
6750+
integrity sha512-eggkWg0FIxhAC4Awuee3ysTcSQUerRj14+G802QpzIFblYqgElK0TQBEjRgEjRnjoljaZIf4RipMQhFIIQZS7w==
67516751
dependencies:
67526752
tslib "^2.3.0"
67536753

6754-
sequential-workflow-designer@^0.26.0:
6755-
version "0.26.0"
6756-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.26.0.tgz#6ea3148d663e8fda9939b50af575568a19d2c157"
6757-
integrity sha512-PIHiMBti6TWhou5gz7DXMe6HF7AEX9ZkRvXOBLhn07hZn+rk9MPFkV83h7sZDdiTrH6VoMw7rZ7f/th/knm/0A==
6754+
sequential-workflow-designer@^0.26.1:
6755+
version "0.26.1"
6756+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.26.1.tgz#5a3fc4e992f76c46bc746547cf040fef8768dc29"
6757+
integrity sha512-R3zqYzZrj3wJ7zPgn9+7bvtNTB2kaTP31wW9MJD3ZgOUrTfvfpz+voIwKhknT9t4/cL7YH+TJF//QkwSp6BUlw==
67586758
dependencies:
67596759
sequential-workflow-model "^0.2.0"
67606760

demos/react-app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"dependencies": {
77
"react": "^18.2.0",
88
"react-dom": "^18.2.0",
9-
"sequential-workflow-designer": "^0.26.0",
10-
"sequential-workflow-designer-react": "^0.26.0"
9+
"sequential-workflow-designer": "^0.26.1",
10+
"sequential-workflow-designer-react": "^0.26.1"
1111
},
1212
"devDependencies": {
1313
"@types/jest": "^29.2.5",

demos/svelte-app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"eslint": "eslint ./src --ext .ts"
1717
},
1818
"dependencies": {
19-
"sequential-workflow-designer": "^0.26.0",
20-
"sequential-workflow-designer-svelte": "^0.26.0"
19+
"sequential-workflow-designer": "^0.26.1",
20+
"sequential-workflow-designer-svelte": "^0.26.1"
2121
},
2222
"devDependencies": {
2323
"@sveltejs/adapter-static": "^2.0.3",

designer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer",
33
"description": "Customizable no-code component for building flow-based programming applications.",
4-
"version": "0.26.0",
4+
"version": "0.26.1",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",

designer/src/workspace/common-views/join-view.ts

+20-16
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,69 @@
11
import { Dom } from '../../core/dom';
22
import { Vector } from '../../core/vector';
33

4+
const EPS = 0.5; // Epsilon, a tiny offset to avoid rendering issues
5+
46
export class JoinView {
57
public static createStraightJoin(parent: SVGElement, start: Vector, height: number) {
8+
const dy = Math.sign(height);
69
const join = Dom.svg('line', {
710
class: 'sqd-join',
811
x1: start.x,
9-
y1: start.y,
12+
y1: start.y - EPS * dy,
1013
x2: start.x,
11-
y2: start.y + height
14+
y2: start.y + height + EPS * dy
1215
});
1316
parent.insertBefore(join, parent.firstChild);
1417
}
1518

1619
public static createJoins(parent: SVGElement, start: Vector, targets: Vector[]) {
1720
const firstTarget = targets[0];
1821
const h = Math.abs(firstTarget.y - start.y) / 2; // half height
19-
const y = Math.sign(firstTarget.y - start.y); // y direction
22+
const dy = Math.sign(firstTarget.y - start.y); // direction y
2023

2124
switch (targets.length) {
2225
case 1:
2326
if (start.x === targets[0].x) {
24-
JoinView.createStraightJoin(parent, start, firstTarget.y * y);
27+
JoinView.createStraightJoin(parent, start, firstTarget.y * dy);
2528
} else {
26-
appendCurvedJoins(parent, start, targets, h, y);
29+
appendCurvedJoins(parent, start, targets, h, dy);
2730
}
2831
break;
2932

3033
case 2:
31-
appendCurvedJoins(parent, start, targets, h, y);
34+
appendCurvedJoins(parent, start, targets, h, dy);
3235
break;
3336

3437
default:
3538
{
3639
const f = targets[0]; // first
3740
const l = targets[targets.length - 1]; // last
41+
const eps = EPS * dy;
3842
appendJoin(
3943
parent,
40-
`M ${f.x} ${f.y} q ${h * 0.3} ${h * -y * 0.8} ${h} ${h * -y} ` +
41-
`l ${l.x - f.x - h * 2} 0 q ${h * 0.8} ${-h * -y * 0.3} ${h} ${-h * -y}`
44+
`M ${f.x} ${f.y + eps} l 0 ${-eps} q ${h * 0.3} ${h * -dy * 0.8} ${h} ${h * -dy} ` +
45+
`l ${l.x - f.x - h * 2} 0 q ${h * 0.8} ${-h * -dy * 0.3} ${h} ${-h * -dy} l 0 ${eps}`
4246
);
4347

4448
for (let i = 1; i < targets.length - 1; i++) {
45-
JoinView.createStraightJoin(parent, targets[i], h * -y);
49+
JoinView.createStraightJoin(parent, targets[i], h * -dy);
4650
}
47-
JoinView.createStraightJoin(parent, start, h * y);
51+
JoinView.createStraightJoin(parent, start, h * dy);
4852
}
4953
break;
5054
}
5155
}
5256
}
5357

54-
function appendCurvedJoins(parent: SVGElement, start: Vector, targets: Vector[], h: number, y: number) {
58+
function appendCurvedJoins(parent: SVGElement, start: Vector, targets: Vector[], h: number, dy: number) {
59+
const eps = EPS * dy;
5560
for (const target of targets) {
56-
const l = Math.abs(target.x - start.x) - h * 2; // line size
57-
const x = Math.sign(target.x - start.x); // x direction
58-
61+
const l = Math.abs(target.x - start.x) - h * 2; // straight line length
62+
const dx = Math.sign(target.x - start.x); // direction x
5963
appendJoin(
6064
parent,
61-
`M ${start.x} ${start.y} q ${x * h * 0.3} ${y * h * 0.8} ${x * h} ${y * h} ` +
62-
`l ${x * l} 0 q ${x * h * 0.7} ${y * h * 0.2} ${x * h} ${y * h}`
65+
`M ${start.x} ${start.y - eps} l 0 ${eps} q ${dx * h * 0.3} ${dy * h * 0.8} ${dx * h} ${dy * h} ` +
66+
`l ${dx * l} 0 q ${dx * h * 0.7} ${dy * h * 0.2} ${dx * h} ${dy * h} l 0 ${eps}`
6367
);
6468
}
6569
}

designer/src/workspace/viewport/pinch-to-zoom-controller.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ export class PinchToZoomController {
7777
.divideByScalar(this.state.lastViewport.scale)
7878
.subtract(this.state.lastViewport.position.divideByScalar(this.state.lastViewport.scale));
7979

80-
const position = zoomRealPoint
81-
.multiplyByScalar(-scale)
82-
.add(zoomPoint)
83-
.add(deltaCenterPoint.divideByScalar(this.state.lastViewport.scale));
80+
const position = zoomRealPoint.multiplyByScalar(-scale).add(zoomPoint).add(deltaCenterPoint);
8481

8582
const newViewport: Viewport = {
8683
position,

examples/assets/lib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function embedStylesheet(url) {
1313
document.write(`<link href="${url}" rel="stylesheet">`);
1414
}
1515

16-
const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.0';
16+
const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.26.1';
1717

1818
embedScript(`${baseUrl}/dist/index.umd.js`);
1919
embedStylesheet(`${baseUrl}/css/designer.css`);

react/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer-react",
33
"description": "React wrapper for Sequential Workflow Designer component.",
4-
"version": "0.26.0",
4+
"version": "0.26.1",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",
@@ -47,7 +47,7 @@
4747
"peerDependencies": {
4848
"react": "^18.2.0",
4949
"react-dom": "^18.2.0",
50-
"sequential-workflow-designer": "^0.26.0"
50+
"sequential-workflow-designer": "^0.26.1"
5151
},
5252
"devDependencies": {
5353
"@rollup/plugin-node-resolve": "^15.0.1",
@@ -63,7 +63,7 @@
6363
"prettier": "^3.2.5",
6464
"react": "^18.2.0",
6565
"react-dom": "^18.2.0",
66-
"sequential-workflow-designer": "^0.26.0",
66+
"sequential-workflow-designer": "^0.26.1",
6767
"rollup": "^3.18.0",
6868
"rollup-plugin-dts": "^5.2.0",
6969
"rollup-plugin-typescript2": "^0.34.1",

svelte/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer-svelte",
33
"description": "Svelte wrapper for Sequential Workflow Designer component.",
4-
"version": "0.26.0",
4+
"version": "0.26.1",
55
"license": "MIT",
66
"scripts": {
77
"prepare": "cp ../LICENSE LICENSE",
@@ -28,10 +28,10 @@
2828
],
2929
"peerDependencies": {
3030
"svelte": "^4.0.0",
31-
"sequential-workflow-designer": "^0.26.0"
31+
"sequential-workflow-designer": "^0.26.1"
3232
},
3333
"devDependencies": {
34-
"sequential-workflow-designer": "^0.26.0",
34+
"sequential-workflow-designer": "^0.26.1",
3535
"@sveltejs/adapter-static": "^2.0.3",
3636
"@sveltejs/kit": "^1.20.4",
3737
"@sveltejs/package": "^2.0.0",

0 commit comments

Comments
 (0)