Skip to content

Commit 26f3a38

Browse files
authored
Merge pull request #23 from nocode-js/develop
0.7.0.
2 parents f2b6cf8 + 1ea297c commit 26f3a38

File tree

61 files changed

+645
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+645
-253
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 0.7.0
2+
3+
* The step validator has two parameters from now: `step` and `parentSequence`.
4+
* Added new editing restrictions: `isDraggable` and `isDeletable`.
5+
6+
#### Breaking Changes
7+
8+
* Refactored step components by introducing the `StepContext` interface.
9+
* Renamed `.sqd-step-start-stop*` CSS selectors to `.sqd-root-start-stop*`.
10+
111
## 0.6.0
212

313
Fixed support for touchpad.

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Features:
2929
* [📐 Simple Flow](https://nocode-js.github.io/sequential-workflow-designer/examples/simple-flow.html)
3030
* [🌻 Rendering Test](https://nocode-js.github.io/sequential-workflow-designer/examples/rendering-test.html)
3131
* [🚄 Stress Test](https://nocode-js.github.io/sequential-workflow-designer/examples/stress-test.html)
32+
* [🚪 Editing Restrictions](https://nocode-js.github.io/sequential-workflow-designer/examples/editing-restrictions.html)
3233

3334
Pro:
3435

@@ -75,10 +76,10 @@ Add the below code to your head section in HTML document.
7576
```html
7677
<head>
7778
...
78-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.6.0/css/designer.css" rel="stylesheet">
79-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.6.0/css/designer-light.css" rel="stylesheet">
80-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.6.0/css/designer-dark.css" rel="stylesheet">
81-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.6.0/dist/index.umd.js"></script>
79+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/css/designer.css" rel="stylesheet">
80+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/css/designer-light.css" rel="stylesheet">
81+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/css/designer-dark.css" rel="stylesheet">
82+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/dist/index.umd.js"></script>
8283
```
8384

8485
Call the designer by:
@@ -131,12 +132,20 @@ const configuration = {
131132
},
132133

133134
steps: {
135+
// all properties in this section are optional
136+
134137
iconUrlProvider: (componentType, type) => {
135138
return `icon-${componentType}-${type}.svg`;
136139
},
137-
validator: (step) => {
140+
validator: (step, sourceSequence) => {
138141
return /^[a-z]+$/.test(step.name);
139142
},
143+
isDraggable: (step, parentSequence) => {
144+
return step.name !== 'y';
145+
},
146+
isDeletable: (step, parentSequence) => {
147+
return step.properties['isDeletable'];
148+
},
140149
canInsertStep: (step, targetSequence, targetIndex) => {
141150
return targetSequence.length < 5;
142151
},

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.6.0",
4+
"version": "0.7.0",
55
"author": "N4NO.com",
66
"license": "MIT",
77
"repository": {
@@ -11,7 +11,7 @@
1111
"peerDependencies": {
1212
"@angular/common": "^15.1.0",
1313
"@angular/core": "^15.1.0",
14-
"sequential-workflow-designer": "^0.6.0"
14+
"sequential-workflow-designer": "^0.7.0"
1515
},
1616
"dependencies": {
1717
"tslib": "^2.3.0"

demos/angular-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"rxjs": "~7.8.0",
2626
"tslib": "^2.3.0",
2727
"zone.js": "~0.12.0",
28-
"sequential-workflow-designer": "^0.6.0",
29-
"sequential-workflow-designer-angular": "^0.6.0"
28+
"sequential-workflow-designer": "^0.7.0",
29+
"sequential-workflow-designer-angular": "^0.7.0"
3030
},
3131
"devDependencies": {
3232
"@angular-devkit/build-angular": "^15.1.1",

demos/react-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dependencies": {
66
"react": "^18.2.0",
77
"react-dom": "^18.2.0",
8-
"sequential-workflow-designer": "^0.6.0",
9-
"sequential-workflow-designer-react": "^0.6.0"
8+
"sequential-workflow-designer": "^0.7.0",
9+
"sequential-workflow-designer-react": "^0.7.0"
1010
},
1111
"devDependencies": {
1212
"@types/jest": "^29.2.5",

designer/css/designer-dark.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@
113113
fill: #FFF;
114114
}
115115

116-
/* dark > .sqd-step-start-stop */
116+
/* dark > .sqd-root-start-stop */
117117

118-
.sqd-theme-dark .sqd-step-start-stop-circle {
118+
.sqd-theme-dark .sqd-root-start-stop-circle {
119119
fill: #2C18DF;
120120
}
121-
.sqd-theme-dark .sqd-step-start-stop-icon {
121+
.sqd-theme-dark .sqd-root-start-stop-icon {
122122
fill: #FFF;
123123
}
124124

designer/css/designer-light.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@
113113
fill: #FFF;
114114
}
115115

116-
/* light > .sqd-step-start-stop */
116+
/* light > .sqd-root-start-stop */
117117

118-
.sqd-theme-light .sqd-step-start-stop-circle {
118+
.sqd-theme-light .sqd-root-start-stop-circle {
119119
fill: #2C18DF;
120120
}
121-
.sqd-theme-light .sqd-step-start-stop-icon {
121+
.sqd-theme-light .sqd-root-start-stop-icon {
122122
fill: #FFF;
123123
}
124124

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",
33
"description": "Customizable no-code component for building flow-based programming applications.",
4-
"version": "0.6.0",
4+
"version": "0.7.0",
55
"main": "./lib/index.mjs",
66
"types": "./lib/index.d.ts",
77
"repository": {
@@ -54,4 +54,4 @@
5454
"lowcode",
5555
"flow"
5656
]
57-
}
57+
}

designer/src/behaviors/click-behavior-resolver.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ export class ClickBehaviorResolver {
2424

2525
switch (result.action.type) {
2626
case ClickBehaviorType.selectStep: {
27-
const isDragDisabled = forceDisableDrag || this.state.isDragDisabled;
27+
const isDragDisabled =
28+
forceDisableDrag ||
29+
this.state.isDragDisabled ||
30+
!this.designerContext.definitionModifier.isDraggable(result.component.step, result.component.parentSequence);
2831
return SelectStepBehavior.create(result.component, isDragDisabled, this.designerContext);
2932
}
3033

designer/src/behaviors/drag-step-behavior-view.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ describe('DragStepView', () => {
77

88
const step = createStepStub();
99
const configuration = createDesignerConfigurationStub();
10-
const context = createComponentContextStub();
10+
const componentContext = createComponentContextStub();
1111

12-
const component = DragStepView.create(step, configuration, context);
12+
const component = DragStepView.create(step, configuration, componentContext);
1313

1414
expect(component).toBeDefined();
1515
expect(appendChildSpy).toHaveBeenCalled();

0 commit comments

Comments
 (0)