Skip to content

Commit db49623

Browse files
authored
0.19.1. (#125)
1 parent 0a631ed commit db49623

File tree

12 files changed

+47
-30
lines changed

12 files changed

+47
-30
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.19.1
2+
3+
Fixed the bug with refreshing the state modifier dependencies.
4+
15
## 0.19.0
26

37
* Added the `isSelectable` callback to the `StepsConfiguration` interface. Now it's possible to disable the selection of steps.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ Add the below code to your head section in HTML document.
9999
```html
100100
<head>
101101
...
102-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.0/css/designer.css" rel="stylesheet">
103-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.0/css/designer-light.css" rel="stylesheet">
104-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.0/css/designer-dark.css" rel="stylesheet">
105-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.0/dist/index.umd.js"></script>
102+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.1/css/designer.css" rel="stylesheet">
103+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.1/css/designer-light.css" rel="stylesheet">
104+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.1/css/designer-dark.css" rel="stylesheet">
105+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.1/dist/index.umd.js"></script>
106106
```
107107

108108
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.19.0",
4+
"version": "0.19.1",
55
"author": {
66
"name": "NoCode JS",
77
"url": "https://nocode-js.com/"
@@ -15,7 +15,7 @@
1515
"peerDependencies": {
1616
"@angular/common": "12 - 16",
1717
"@angular/core": "12 - 16",
18-
"sequential-workflow-designer": "^0.19.0"
18+
"sequential-workflow-designer": "^0.19.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": "^15.2.9",
2727
"@angular/router": "^15.2.9",
2828
"rxjs": "~7.8.0",
29-
"sequential-workflow-designer": "^0.19.0",
30-
"sequential-workflow-designer-angular": "^0.19.0",
29+
"sequential-workflow-designer": "^0.19.1",
30+
"sequential-workflow-designer-angular": "^0.19.1",
3131
"tslib": "^2.3.0",
3232
"zone.js": "~0.13.0"
3333
},

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.19.0",
10-
"sequential-workflow-designer-react": "^0.19.0"
9+
"sequential-workflow-designer": "^0.19.1",
10+
"sequential-workflow-designer-react": "^0.19.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.19.0",
20-
"sequential-workflow-designer-svelte": "^0.19.0"
19+
"sequential-workflow-designer": "^0.19.1",
20+
"sequential-workflow-designer-svelte": "^0.19.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.19.0",
4+
"version": "0.19.1",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",
+22-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { Sequence, Step } from './definition';
22
import { CustomAction, DefinitionChangeType, DesignerConfiguration } from './designer-configuration';
33
import { DesignerState } from './designer-state';
4+
import { StateModifier } from './modifier/state-modifier';
45

56
export class CustomActionController {
6-
public constructor(private readonly configuration: DesignerConfiguration, private readonly state: DesignerState) {}
7+
public constructor(
8+
private readonly configuration: DesignerConfiguration,
9+
private readonly state: DesignerState,
10+
private readonly stateModifier: StateModifier
11+
) {}
712

813
public trigger(action: CustomAction, step: Step | null, sequence: Sequence) {
914
const handler = this.configuration.customActionHandler;
@@ -12,20 +17,28 @@ export class CustomActionController {
1217
return;
1318
}
1419

15-
const context = {
16-
notifyStepNameChanged: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepNameChanged, stepId),
17-
notifyStepPropertiesChanged: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepPropertyChanged, stepId),
18-
notifyStepInserted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepInserted, stepId),
19-
notifyStepMoved: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepMoved, stepId),
20-
notifyStepDeleted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepDeleted, stepId)
21-
};
20+
const context = this.createCustomActionHandlerContext();
2221
handler(action, step, sequence, context);
2322
}
2423

25-
private notifyStepChanged(changeType: DefinitionChangeType, stepId: string) {
24+
private createCustomActionHandlerContext() {
25+
return {
26+
notifyStepNameChanged: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepNameChanged, stepId, false),
27+
notifyStepPropertiesChanged: (stepId: string) =>
28+
this.notifyStepChanged(DefinitionChangeType.stepPropertyChanged, stepId, false),
29+
notifyStepInserted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepInserted, stepId, true),
30+
notifyStepMoved: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepMoved, stepId, true),
31+
notifyStepDeleted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepDeleted, stepId, true)
32+
};
33+
}
34+
35+
private notifyStepChanged(changeType: DefinitionChangeType, stepId: string, updateDependencies: boolean) {
2636
if (!stepId) {
2737
throw new Error('Step id is empty');
2838
}
2939
this.state.notifyDefinitionChanged(changeType, stepId);
40+
if (updateDependencies) {
41+
this.stateModifier.updateDependencies();
42+
}
3043
}
3144
}

designer/src/designer-context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export class DesignerContext {
3131
const state = new DesignerState(definition, isReadonly, isToolboxCollapsed, isEditorCollapsed);
3232
const workspaceController = new WorkspaceControllerWrapper();
3333
const behaviorController = new BehaviorController();
34-
const customActionController = new CustomActionController(configuration, state);
3534
const stepExtensionResolver = StepExtensionResolver.create(services);
3635
const definitionWalker = configuration.definitionWalker ?? new DefinitionWalker();
3736
const stateModifier = StateModifier.create(definitionWalker, state, configuration);
37+
const customActionController = new CustomActionController(configuration, state, stateModifier);
3838

3939
let historyController: HistoryController | undefined = undefined;
4040
if (configuration.undoStackSize) {

examples/assets/lib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function embedStylesheet(url) {
1919

2020
const baseUrl = isTestEnv()
2121
? '../designer'
22-
: '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.0';
22+
: '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.1';
2323

2424
embedScript(`${baseUrl}/dist/index.umd.js`);
2525
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.19.0",
4+
"version": "0.19.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.19.0"
50+
"sequential-workflow-designer": "^0.19.1"
5151
},
5252
"devDependencies": {
5353
"@rollup/plugin-node-resolve": "^15.0.1",
@@ -63,7 +63,7 @@
6363
"prettier": "^2.8.2",
6464
"react": "^18.2.0",
6565
"react-dom": "^18.2.0",
66-
"sequential-workflow-designer": "^0.19.0",
66+
"sequential-workflow-designer": "^0.19.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.19.0",
4+
"version": "0.19.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.19.0"
31+
"sequential-workflow-designer": "^0.19.1"
3232
},
3333
"devDependencies": {
34-
"sequential-workflow-designer": "^0.19.0",
34+
"sequential-workflow-designer": "^0.19.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)