Skip to content

Commit 48b4a4a

Browse files
authored
0.16.8. (#96)
1 parent 2da7f84 commit 48b4a4a

File tree

17 files changed

+173
-144
lines changed

17 files changed

+173
-144
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## 0.16.8
2+
3+
Svelte package supports now native editors. If you want to use JavaScript/TypeScript code to create editors, you can do it now. Of course, you can still use Svelte components as editors.
4+
5+
```svelte
6+
<SequentialWorkflowDesigner ...
7+
stepEditor={StepEditor}
8+
rootEditor={RootEditor} />
9+
10+
<SequentialWorkflowDesigner ...
11+
nativeStepEditor={nativeStepEditor}
12+
nativeRootEditor={nativeRootEditor} />
13+
```
14+
115
## 0.16.7
216

317
Added two events to the Svelte package: `on:isToolboxCollapsedChanged` and `on:isEditorCollapsedChanged`.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ Add the below code to your head section in HTML document.
9696
```html
9797
<head>
9898
...
99-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.7/css/designer.css" rel="stylesheet">
100-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.7/css/designer-light.css" rel="stylesheet">
101-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.7/css/designer-dark.css" rel="stylesheet">
102-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.7/dist/index.umd.js"></script>
99+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.8/css/designer.css" rel="stylesheet">
100+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.8/css/designer-light.css" rel="stylesheet">
101+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.8/css/designer-dark.css" rel="stylesheet">
102+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.8/dist/index.umd.js"></script>
103103
```
104104

105105
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.16.7",
4+
"version": "0.16.8",
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.16.7"
18+
"sequential-workflow-designer": "^0.16.8"
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.16.7",
30-
"sequential-workflow-designer-angular": "^0.16.7",
29+
"sequential-workflow-designer": "^0.16.8",
30+
"sequential-workflow-designer-angular": "^0.16.8",
3131
"tslib": "^2.3.0",
3232
"zone.js": "~0.13.0"
3333
},

demos/angular-app/yarn.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -5956,17 +5956,17 @@ send@0.18.0:
59565956
range-parser "~1.2.1"
59575957
statuses "2.0.1"
59585958

5959-
sequential-workflow-designer-angular@^0.16.7:
5960-
version "0.16.7"
5961-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.16.7.tgz#e9adb618d59db25d59ea2b53fcb4c395245fde61"
5962-
integrity sha512-sZ6r6picLJbsRvGrZ/vLzpvSCrlCpahLaum7iJB/0u4+1yq329EnhGgg2avgZ+ykQTSpPp7ODnPFpkyJRpbRxw==
5959+
sequential-workflow-designer-angular@^0.16.8:
5960+
version "0.16.8"
5961+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.16.8.tgz#80fe67bda35e676c7823a86341a48ca318d92cc6"
5962+
integrity sha512-9ewvSBVQXQ9hnIilh+V8flCmF3ZjLmZgVrxEYGhJ5okYAOeAla8mbqr+c87YDacemPOd4FFRbgMDBptlcjtEmw==
59635963
dependencies:
59645964
tslib "^2.3.0"
59655965

5966-
sequential-workflow-designer@^0.16.7:
5967-
version "0.16.7"
5968-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.16.7.tgz#dd3d4f812682d97c3b3a472d99ac04d1a7ddf844"
5969-
integrity sha512-xY2YD4r0CHVZrzzC7wjUHwSSeSDtWt49v7k+Y/wzesYZN1Fdd2i0cLxHBFCQBaMSvwD1EIft4zC7OB/eGi9sNQ==
5966+
sequential-workflow-designer@^0.16.8:
5967+
version "0.16.8"
5968+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.16.8.tgz#75c0d10bda354b9f31c40c65bb61474e1a91de9f"
5969+
integrity sha512-YinakcQ5lvI+otxFlDkH+IRCijXJDav6IeCPesvWPb0vjFy0G8xtfMDVHzY3rL5l4uWwQmzUIZg/xLxnnp7BFw==
59705970
dependencies:
59715971
sequential-workflow-model "^0.2.0"
59725972

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.16.7",
10-
"sequential-workflow-designer-react": "^0.16.7"
9+
"sequential-workflow-designer": "^0.16.8",
10+
"sequential-workflow-designer-react": "^0.16.8"
1111
},
1212
"devDependencies": {
1313
"@types/jest": "^29.2.5",

demos/svelte-app/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1212
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
1313
"test:single": "echo \"No tests yet\"",
14-
"prettier": "prettier --check ./src",
15-
"prettier:fix": "prettier --write ./src",
14+
"prettier": "prettier --plugin prettier-plugin-svelte --check ./src",
15+
"prettier:fix": "prettier --plugin prettier-plugin-svelte --write ./src",
1616
"eslint": "eslint ./src --ext .ts"
1717
},
1818
"dependencies": {
19-
"sequential-workflow-designer": "^0.16.7",
20-
"sequential-workflow-designer-svelte": "^0.16.7"
19+
"sequential-workflow-designer": "^0.16.8",
20+
"sequential-workflow-designer-svelte": "^0.16.8"
2121
},
2222
"devDependencies": {
2323
"@sveltejs/adapter-static": "^2.0.3",
@@ -28,6 +28,7 @@
2828
"typescript": "^5.0.0",
2929
"vite": "^4.4.2",
3030
"prettier": "^2.8.2",
31+
"prettier-plugin-svelte": "^2.8.0",
3132
"@typescript-eslint/eslint-plugin": "^5.47.0",
3233
"@typescript-eslint/parser": "^5.47.0",
3334
"eslint": "^8.30.0"

demos/svelte-app/src/routes/+page.svelte

+18-19
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
let isValid: boolean | null = null;
1414
const steps: StepsConfiguration = {};
1515
const validator: ValidatorConfiguration = {
16-
step: (step) => step.name.length > 0
16+
step: step => step.name.length > 0
1717
};
1818
const toolbox: ToolboxConfiguration = {
1919
groups: [
@@ -25,7 +25,7 @@
2525
};
2626
2727
function randId() {
28-
return Math.round((Math.random() * 1000000)).toString(16);
28+
return Math.round(Math.random() * 1000000).toString(16);
2929
}
3030
3131
function createStep() {
@@ -37,22 +37,19 @@
3737
properties: {
3838
comment: 'Some comment'
3939
}
40-
}
40+
};
4141
}
4242
4343
function createDefinition(): Definition {
4444
return {
4545
properties: {
4646
velocity: 20
4747
},
48-
sequence: [
49-
createStep(),
50-
createStep()
51-
]
48+
sequence: [createStep(), createStep()]
5249
};
5350
}
5451
55-
function onDefinitionChanged({ detail }: { detail: { definition: Definition, isValid: boolean } }) {
52+
function onDefinitionChanged({ detail }: { detail: { definition: Definition; isValid: boolean } }) {
5653
definition = detail.definition;
5754
isValid = detail.isValid;
5855
}
@@ -95,20 +92,21 @@
9592
</script>
9693

9794
<SequentialWorkflowDesigner
98-
definition={definition}
95+
{definition}
9996
on:definitionChanged={onDefinitionChanged}
100-
steps={steps}
101-
validator={validator}
102-
toolbox={toolbox}
97+
{steps}
98+
{validator}
99+
{toolbox}
103100
stepEditor={StepEditor}
104101
rootEditor={RootEditor}
105-
selectedStepId={selectedStepId}
102+
{selectedStepId}
106103
on:selectedStepIdChanged={onSelectedStepIdChanged}
107-
isToolboxCollapsed={isToolboxCollapsed}
104+
{isToolboxCollapsed}
108105
on:isToolboxCollapsedChanged={onIsToolboxCollapsedChanged}
109-
isEditorCollapsed={isEditorCollapsed}
106+
{isEditorCollapsed}
110107
on:isEditorCollapsedChanged={onIsEditorCollapsedChanged}
111-
isReadonly={isReadonly} />
108+
{isReadonly}
109+
/>
112110

113111
<div class="block">
114112
<button on:click={toggleReadonly}>{isReadonly ? 'Enable editing' : 'Disable editing'}</button>
@@ -123,10 +121,11 @@
123121
</div>
124122

125123
<div class="block">
126-
Is valid: <strong>{isValid}</strong> &nbsp;
127-
Selected step: <strong>{selectedStepId}</strong>
124+
Is valid: <strong>{isValid}</strong> &nbsp; Selected step: <strong>{selectedStepId}</strong>
128125
</div>
129126

130127
<div class="block">
131-
This demo uses Svelte and <a href="https://github.com/nocode-js/sequential-workflow-designer/tree/main/svelte">Sequential Workflow Designer for Svelte</a>.
128+
This demo uses Svelte and <a href="https://github.com/nocode-js/sequential-workflow-designer/tree/main/svelte"
129+
>Sequential Workflow Designer for Svelte</a
130+
>.
132131
</div>

demos/svelte-app/src/routes/root-editor.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
2-
import type { GlobalEditorContext, Definition } from 'sequential-workflow-designer';
2+
import type { RootEditorContext, Definition } from 'sequential-workflow-designer';
33
4-
export let context: GlobalEditorContext;
4+
export let context: RootEditorContext;
55
export let definition: Definition;
66
77
let velocity = definition.properties.velocity;

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.16.7",
4+
"version": "0.16.8",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",

designer/src/designer-configuration.ts

+6
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,21 @@ export type StepEditorProvider<TDefinition extends Definition = Definition> = (
176176
definition: TDefinition
177177
) => HTMLElement;
178178

179+
// TODO: GlobalEditorContext should be renamed to RootEditorContext.
179180
export interface GlobalEditorContext {
180181
notifyPropertiesChanged(): void;
181182
}
182183

184+
export type RootEditorContext = GlobalEditorContext;
185+
186+
// TODO: GlobalEditorProvider should be renamed to RootEditorProvider.
183187
export type GlobalEditorProvider<TDefinition extends Definition = Definition> = (
184188
definition: TDefinition,
185189
context: GlobalEditorContext
186190
) => HTMLElement;
187191

192+
export type RootEditorProvider = GlobalEditorProvider;
193+
188194
export interface UndoStack {
189195
index: number;
190196
items: UndoStackItem[];

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.16.7';
22+
: '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.16.8';
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.16.7",
4+
"version": "0.16.8",
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.16.7"
50+
"sequential-workflow-designer": "^0.16.8"
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.16.7",
66+
"sequential-workflow-designer": "^0.16.8",
6767
"rollup": "^3.18.0",
6868
"rollup-plugin-dts": "^5.2.0",
6969
"rollup-plugin-typescript2": "^0.34.1",

svelte/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ The global editor:
7979

8080
```svelte
8181
<script lang="ts">
82-
import type { GlobalEditorContext, Definition } from 'sequential-workflow-designer';
82+
import type { RootEditorContext, Definition } from 'sequential-workflow-designer';
8383
84-
export let context: GlobalEditorContext;
84+
export let context: RootEditorContext;
8585
export let definition: Definition;
8686
let velocity = definition.properties.velocity;
8787

svelte/package.json

+6-5
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.16.7",
4+
"version": "0.16.8",
55
"license": "MIT",
66
"scripts": {
77
"prepare": "cp ../LICENSE LICENSE",
@@ -11,8 +11,8 @@
1111
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1212
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
1313
"test:single": "echo \"No tests yet\"",
14-
"prettier": "prettier --check ./src",
15-
"prettier:fix": "prettier --write ./src",
14+
"prettier": "prettier --plugin prettier-plugin-svelte --check ./src",
15+
"prettier:fix": "prettier --plugin prettier-plugin-svelte --write ./src",
1616
"eslint": "eslint ./src --ext .ts"
1717
},
1818
"exports": {
@@ -28,10 +28,10 @@
2828
],
2929
"peerDependencies": {
3030
"svelte": "^4.0.0",
31-
"sequential-workflow-designer": "^0.16.7"
31+
"sequential-workflow-designer": "^0.16.8"
3232
},
3333
"devDependencies": {
34-
"sequential-workflow-designer": "^0.16.7",
34+
"sequential-workflow-designer": "^0.16.8",
3535
"@sveltejs/adapter-static": "^2.0.3",
3636
"@sveltejs/kit": "^1.20.4",
3737
"@sveltejs/package": "^2.0.0",
@@ -41,6 +41,7 @@
4141
"typescript": "^5.0.0",
4242
"vite": "^4.4.2",
4343
"prettier": "^2.8.2",
44+
"prettier-plugin-svelte": "^2.8.0",
4445
"@typescript-eslint/eslint-plugin": "^5.47.0",
4546
"@typescript-eslint/parser": "^5.47.0",
4647
"eslint": "^8.30.0"

0 commit comments

Comments
 (0)