Skip to content

Commit 698d859

Browse files
committed
0.26.0.
1 parent 3496dce commit 698d859

24 files changed

+179
-40
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.26.0
2+
3+
This version introduces a few internal changes to support the double-click feature in the pro version.
4+
15
# 0.25.0
26

37
This version introduces the pinch-to-zoom feature. Now you can zoom in and out using the pinch gesture on touch devices.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Pro:
5555
* [👋 Custom Dragged Component](https://nocode-js.com/examples/sequential-workflow-designer-pro/webpack-pro-app/public/custom-dragged-component.html)
5656
* [🔰 Badges](https://nocode-js.com/examples/sequential-workflow-designer-pro/webpack-pro-app/public/badges.html)
5757
* [🎩 Custom Viewport](https://nocode-js.com/examples/sequential-workflow-designer-pro/webpack-pro-app/public/custom-viewport.html)
58+
* [👊 Double Click](https://nocode-js.com/examples/sequential-workflow-designer-pro/webpack-pro-app/public/double-click.html)
5859
* [🛎 Clickable Placeholder](https://nocode-js.com/examples/sequential-workflow-designer-pro/webpack-pro-app/public/clickable-placeholder.html)
5960
* [📮 Conditional Placeholders](https://nocode-js.com/examples/sequential-workflow-designer-pro/webpack-pro-app/public/conditional-placeholders.html)
6061
* [React Pro Demo](https://nocode-js.com/examples/sequential-workflow-designer-pro/react-pro-app/build/index.html)
@@ -103,10 +104,10 @@ Add the below code to your head section in HTML document.
103104
```html
104105
<head>
105106
...
106-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.25.0/css/designer.css" rel="stylesheet">
107-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.25.0/css/designer-light.css" rel="stylesheet">
108-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.25.0/css/designer-dark.css" rel="stylesheet">
109-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.25.0/dist/index.umd.js"></script>
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>
110111
```
111112

112113
Call the designer by:

angular/designer/package.json

Lines changed: 2 additions & 2 deletions
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.25.0",
4+
"version": "0.26.0",
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.25.0"
18+
"sequential-workflow-designer": "^0.26.0"
1919
},
2020
"dependencies": {
2121
"tslib": "^2.3.0"

demos/angular-app/package.json

Lines changed: 2 additions & 2 deletions
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.25.0",
30-
"sequential-workflow-designer-angular": "^0.25.0",
29+
"sequential-workflow-designer": "^0.26.0",
30+
"sequential-workflow-designer-angular": "^0.26.0",
3131
"tslib": "^2.3.0",
3232
"zone.js": "~0.14.6"
3333
},

demos/angular-app/yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6744,17 +6744,17 @@ [email protected]:
67446744
range-parser "~1.2.1"
67456745
statuses "2.0.1"
67466746

6747-
sequential-workflow-designer-angular@^0.25.0:
6748-
version "0.25.0"
6749-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.25.0.tgz#eb65370283a408c10eeb7b71b67dae2af9d6196b"
6750-
integrity sha512-E100P2es8Gn5th0f0ErfjRr9TWWcgocz16kZocWvCHeOn5/iLo+oCuvSSZjewpnYTVA6oDcHH//KJnq5sPN69g==
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==
67516751
dependencies:
67526752
tslib "^2.3.0"
67536753

6754-
sequential-workflow-designer@^0.25.0:
6755-
version "0.25.0"
6756-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.25.0.tgz#db8d35441a68f0b05f169e458f12f5457f9beca9"
6757-
integrity sha512-KNOTA4zx/TkpL0LHQFvNe2S07vejA4YjRcl6UNpLjG4fODQKfiZ8zj5RypcG54O6TArBU8eDEUwtXgnuopGEYQ==
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==
67586758
dependencies:
67596759
sequential-workflow-model "^0.2.0"
67606760

demos/react-app/package.json

Lines changed: 2 additions & 2 deletions
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.25.0",
10-
"sequential-workflow-designer-react": "^0.25.0"
9+
"sequential-workflow-designer": "^0.26.0",
10+
"sequential-workflow-designer-react": "^0.26.0"
1111
},
1212
"devDependencies": {
1313
"@types/jest": "^29.2.5",

demos/svelte-app/package.json

Lines changed: 2 additions & 2 deletions
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.25.0",
20-
"sequential-workflow-designer-svelte": "^0.25.0"
19+
"sequential-workflow-designer": "^0.26.0",
20+
"sequential-workflow-designer-svelte": "^0.26.0"
2121
},
2222
"devDependencies": {
2323
"@sveltejs/adapter-static": "^2.0.3",

designer/package.json

Lines changed: 1 addition & 1 deletion
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.25.0",
4+
"version": "0.26.0",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { Vector } from '../core';
2+
import { Behavior } from './behavior';
3+
import { BehaviorController } from './behavior-controller';
4+
import { SelectStepBehaviorEndToken } from './select-step-behavior-end-token';
5+
6+
describe('BehaviorController', () => {
7+
it('passes the last end token to a next behavior', done => {
8+
const controller = BehaviorController.create(undefined);
9+
const baseBehavior = {
10+
onStart(position: Vector) {
11+
expect(position.x).toBe(1);
12+
expect(position.y).toBe(2);
13+
},
14+
onMove() {
15+
/* ... */
16+
}
17+
};
18+
19+
function stage0() {
20+
const behavior0: Behavior = {
21+
...baseBehavior,
22+
onEnd() {
23+
setTimeout(stage1);
24+
return new SelectStepBehaviorEndToken('step-id', 12345);
25+
}
26+
};
27+
28+
controller.start(new Vector(1, 2), behavior0);
29+
window.dispatchEvent(new MouseEvent('mouseup'));
30+
}
31+
32+
function stage1() {
33+
const behavior1: Behavior = {
34+
...baseBehavior,
35+
onEnd(_0, _1, previousEndToken) {
36+
if (SelectStepBehaviorEndToken.is(previousEndToken)) {
37+
expect(previousEndToken.stepId).toBe('step-id');
38+
expect(previousEndToken.time).toBe(12345);
39+
done();
40+
return;
41+
}
42+
fail('Invalid end token');
43+
}
44+
};
45+
controller.start(new Vector(1, 2), behavior1);
46+
window.dispatchEvent(new MouseEvent('mouseup'));
47+
}
48+
49+
stage0();
50+
});
51+
});

designer/src/behaviors/behavior-controller.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Vector } from '../core/vector';
2-
import { Behavior } from './behavior';
2+
import { Behavior, BehaviorEndToken } from './behavior';
33
import { readMousePosition, readTouchPosition } from '../core/event-readers';
44

55
const notInitializedError = 'State is not initialized';
@@ -13,11 +13,12 @@ export class BehaviorController {
1313
return new BehaviorController(shadowRoot ?? document, shadowRoot);
1414
}
1515

16-
private state?: {
16+
private previousEndToken: BehaviorEndToken | null = null;
17+
private state: {
1718
startPosition: Vector;
1819
behavior: Behavior;
1920
lastPosition?: Vector;
20-
};
21+
} | null = null;
2122

2223
private constructor(
2324
private readonly dom: Document | ShadowRoot,
@@ -106,7 +107,7 @@ export class BehaviorController {
106107
const delta = this.state.startPosition.subtract(position);
107108
const newBehavior = this.state.behavior.onMove(delta);
108109
if (newBehavior) {
109-
this.state.behavior.onEnd(true, null);
110+
this.state.behavior.onEnd(true, null, null);
110111

111112
this.state.behavior = newBehavior;
112113
this.state.startPosition = position;
@@ -124,7 +125,8 @@ export class BehaviorController {
124125
}
125126
this.unbind(window);
126127

127-
this.state.behavior.onEnd(interrupt, element);
128-
this.state = undefined;
128+
const endToken = this.state.behavior.onEnd(interrupt, element, this.previousEndToken);
129+
this.state = null;
130+
this.previousEndToken = endToken || null;
129131
}
130132
}

0 commit comments

Comments
 (0)