Skip to content

Commit 0298467

Browse files
authored
0.20.0. (#141)
1 parent 286a0a3 commit 0298467

Some content is hidden

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

42 files changed

+360
-93
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 0.20.0
2+
3+
This version introduces the localization feature. Now you can localize the designer to any language you want.
4+
5+
```js
6+
const configuration = {
7+
i18n: (key, defaultValue) => {
8+
if (currentLang === 'pl') {
9+
if (key === 'controlBar.undo') {
10+
return 'Cofnij';
11+
}
12+
}
13+
return defaultValue;
14+
}
15+
// ...
16+
};
17+
```
18+
119
## 0.19.4
220

321
This version adds the data-step-id attribute to the root `<g>` elements of step components on the canvas. This attribute contains the ID of the step, enabling the use of CSS selectors to style step components [#135](https://github.com/nocode-js/sequential-workflow-designer/issues/135).

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Features:
2525
* [❎ Fullscreen](https://nocode-js.github.io/sequential-workflow-designer/examples/fullscreen.html)
2626
* [🌅 Image Filter](https://nocode-js.github.io/sequential-workflow-designer/examples/image-filter.html)
2727
* [🔴 Particles](https://nocode-js.github.io/sequential-workflow-designer/examples/particles.html)
28+
* [🇪🇸 Internationalization](https://nocode-js.github.io/sequential-workflow-designer/examples/i18n.html)
2829
* [⛅ Light Dark](https://nocode-js.github.io/sequential-workflow-designer/examples/light-dark.html)
2930
* [🤖 Code Generator](https://nocode-js.github.io/sequential-workflow-designer/examples/code-generator.html)
3031
* [🌻 Rendering Test](https://nocode-js.github.io/sequential-workflow-designer/examples/rendering-test.html)
@@ -100,10 +101,10 @@ Add the below code to your head section in HTML document.
100101
```html
101102
<head>
102103
...
103-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/css/designer.css" rel="stylesheet">
104-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/css/designer-light.css" rel="stylesheet">
105-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/css/designer-dark.css" rel="stylesheet">
106-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.19.4/dist/index.umd.js"></script>
104+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.20.0/css/designer.css" rel="stylesheet">
105+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.20.0/css/designer-light.css" rel="stylesheet">
106+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.20.0/css/designer-dark.css" rel="stylesheet">
107+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.20.0/dist/index.umd.js"></script>
107108
```
108109

109110
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.19.4",
4+
"version": "0.20.0",
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.4"
18+
"sequential-workflow-designer": "^0.20.0"
1919
},
2020
"dependencies": {
2121
"tslib": "^2.3.0"

angular/designer/src/designer.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import {
2828
StepsConfiguration,
2929
ToolboxConfiguration,
3030
UidGenerator,
31-
ValidatorConfiguration
31+
ValidatorConfiguration,
32+
I18n
3233
} from 'sequential-workflow-designer';
3334

3435
export interface RootEditorWrapper {
@@ -77,6 +78,8 @@ export class DesignerComponent implements AfterViewInit, OnChanges, OnDestroy {
7778
public keyboard?: boolean | KeyboardConfiguration;
7879
@Input('extensions')
7980
public extensions?: DesignerExtension[];
81+
@Input('i18n')
82+
public i18n?: I18n;
8083
@Input('customActionHandler')
8184
public customActionHandler?: CustomActionHandler;
8285
@Input('isReadonly')
@@ -216,6 +219,7 @@ export class DesignerComponent implements AfterViewInit, OnChanges, OnDestroy {
216219
keyboard: this.keyboard,
217220
extensions: this.extensions,
218221
isReadonly: this.isReadonly,
222+
i18n: this.i18n,
219223
uidGenerator: this.uidGenerator,
220224
customActionHandler
221225
});

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": "^15.2.9",
2727
"@angular/router": "^15.2.9",
2828
"rxjs": "~7.8.0",
29-
"sequential-workflow-designer": "^0.19.4",
30-
"sequential-workflow-designer-angular": "^0.19.4",
29+
"sequential-workflow-designer": "^0.20.0",
30+
"sequential-workflow-designer-angular": "^0.20.0",
3131
"tslib": "^2.3.0",
3232
"zone.js": "~0.13.0"
3333
},

demos/angular-app/yarn.lock

Lines changed: 8 additions & 8 deletions
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.19.4:
5960-
version "0.19.4"
5961-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.19.4.tgz#80449ac17015cd2e58a7b8b0b5169f3148083c88"
5962-
integrity sha512-svUfsbISuYe5CEAjuu3Z3IyjoOvvWI0ADP1KrNf9UpHWD+QXCX/yvviUJfDvMGY5YtniI3ylkNfDjUBPPXnm4A==
5959+
sequential-workflow-designer-angular@^0.20.0:
5960+
version "0.20.0"
5961+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.20.0.tgz#abe658c0fe0911acc04506c32030fe5e1a0c6db2"
5962+
integrity sha512-dAV0U+Iw+xJUJfH5lva4Y0hNd3jcs8FfUDVQgohr8TTSYpnQRQlCDUN8oiI1zmZd59GInX3ckWR7Vfl0hE764Q==
59635963
dependencies:
59645964
tslib "^2.3.0"
59655965

5966-
sequential-workflow-designer@^0.19.4:
5967-
version "0.19.4"
5968-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.19.4.tgz#1ef69541e17c3daaf1e06d3c7984771e14f9b2c0"
5969-
integrity sha512-pCv27HahJajaiyJo7UUd4qkXyH0OtauGFpPksorGWr+EzoYEtcMsR/53x+1t+e6qZ4++FboGLQ85+63+XIGBvg==
5966+
sequential-workflow-designer@^0.20.0:
5967+
version "0.20.0"
5968+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.20.0.tgz#fb6a1fc15969e62e060251e57c9977c0b22cecd3"
5969+
integrity sha512-nndGqJuOR7KAmY5OasPBYt842KWeDC05DgJ3J/M+tQNxddqCHWlafy6rwHfO1cPB3Ui1m0b0sOrNNJmv1r6dWA==
59705970
dependencies:
59715971
sequential-workflow-model "^0.2.0"
59725972

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.19.4",
10-
"sequential-workflow-designer-react": "^0.19.4"
9+
"sequential-workflow-designer": "^0.20.0",
10+
"sequential-workflow-designer-react": "^0.20.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.19.4",
20-
"sequential-workflow-designer-svelte": "^0.19.4"
19+
"sequential-workflow-designer": "^0.20.0",
20+
"sequential-workflow-designer-svelte": "^0.20.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.19.4",
4+
"version": "0.20.0",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",

designer/src/api/designer-api.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ import { ToolboxDataProvider } from '../toolbox/toolbox-data-provider';
77
import { ViewportApi } from './viewport-api';
88
import { WorkspaceApi } from './workspace-api';
99
import { DefinitionWalker } from '../definition';
10+
import { I18n } from '../designer-configuration';
1011

1112
export class DesignerApi {
1213
public static create(context: DesignerContext): DesignerApi {
1314
const workspace = new WorkspaceApi(context.state, context.workspaceController);
1415
const viewportController = context.services.viewportController.create(workspace);
1516
const viewport = new ViewportApi(context.workspaceController, viewportController);
16-
const toolboxDataProvider = new ToolboxDataProvider(context.componentContext.iconProvider, context.configuration.toolbox);
17+
const toolboxDataProvider = new ToolboxDataProvider(
18+
context.componentContext.iconProvider,
19+
context.i18n,
20+
context.configuration.toolbox
21+
);
1722

1823
return new DesignerApi(
1924
ControlBarApi.create(context.state, context.historyController, context.stateModifier, viewport),
@@ -22,7 +27,8 @@ export class DesignerApi {
2227
workspace,
2328
viewport,
2429
new PathBarApi(context.state, context.definitionWalker),
25-
context.definitionWalker
30+
context.definitionWalker,
31+
context.i18n
2632
);
2733
}
2834

@@ -33,6 +39,7 @@ export class DesignerApi {
3339
public readonly workspace: WorkspaceApi,
3440
public readonly viewport: ViewportApi,
3541
public readonly pathBar: PathBarApi,
36-
public readonly definitionWalker: DefinitionWalker
42+
public readonly definitionWalker: DefinitionWalker,
43+
public readonly i18n: I18n
3744
) {}
3845
}

0 commit comments

Comments
 (0)