Skip to content

Commit 9e7e05c

Browse files
authored
0.37.1. (#216)
1 parent dd18bac commit 9e7e05c

15 files changed

Lines changed: 86 additions & 65 deletions

File tree

CHANGELOG.md

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.37.1
2+
3+
This version adds a new property, `branchNameLabelResolver`, to the `SwitchStepExtensionConfiguration` interface. This property allows you to override the default labels of the switch step branches.
4+
15
# 0.37.0
26

37
This version introduces a small internal refactor that allows exposing new events in the Designer class: `onRootComponentUpdated` and `onPreferencesChanged`.
@@ -67,8 +71,8 @@ const configuration = {
6771
steps: {
6872
canUnselectStep: (step, parentSequence) => {
6973
return areChangesSaved() === true;
70-
}
71-
}
74+
},
75+
},
7276
// ...
7377
};
7478

@@ -113,9 +117,9 @@ import { StepsDesignerExtension } from 'sequential-workflow-designer';
113117
const extensions = [
114118
StepsDesignerExtension.create({
115119
switch: {
116-
branchNamesResolver: step => Object.keys(step.branches)
117-
}
118-
})
120+
branchNamesResolver: step => Object.keys(step.branches),
121+
},
122+
}),
119123
];
120124
```
121125

@@ -264,7 +268,7 @@ const configuration = {
264268
}
265269
}
266270
return defaultValue;
267-
}
271+
},
268272
// ...
269273
};
270274
```
@@ -344,9 +348,9 @@ const configuration = {
344348
// globalEditorProvider: () => {}, is not supported anymore, use `rootEditorProvider` instead.
345349
rootEditorProvider: (definition, rootContext, isReadonly) => {
346350
/* ... */
347-
}
351+
},
348352
// ...
349-
}
353+
},
350354
};
351355
```
352356

@@ -380,7 +384,7 @@ This version adds a possibility to disable keyboard shortcuts. Additionally you
380384
```js
381385
// Disabled shortcuts
382386
const configuration = {
383-
keyboard: false
387+
keyboard: false,
384388
// ...
385389
};
386390
```
@@ -418,9 +422,9 @@ This version introduces the `isAutoSelectDisabled` option. Now it's possible to
418422
```js
419423
const configuration = {
420424
steps: {
421-
isAutoSelectDisabled: true
425+
isAutoSelectDisabled: true,
422426
// ...
423-
}
427+
},
424428
};
425429
```
426430

@@ -429,7 +433,7 @@ Additionally, this version introduces possibility to initialize the designer wit
429433
```js
430434
const configuration = {
431435
undoStackSize: 10,
432-
undoStack: myUndoStack
436+
undoStack: myUndoStack,
433437
// ...
434438
};
435439
```
@@ -509,7 +513,7 @@ This version introduces the context menu, providing a new and interactive way to
509513

510514
```ts
511515
const configuration = {
512-
contextMenu: false
516+
contextMenu: false,
513517
// ...
514518
};
515519
```
@@ -521,8 +525,8 @@ const configuration = {
521525
steps: {
522526
isDuplicable: (step, parentSequence) => {
523527
return true;
524-
}
525-
}
528+
},
529+
},
526530
// ...
527531
};
528532
```
@@ -564,9 +568,9 @@ This version introduces 4 new features:
564568
```js
565569
const configuration = {
566570
toolbox: {
567-
labelProvider: step => `** ${step.name} **`
571+
labelProvider: step => `** ${step.name} **`,
568572
// ...
569-
}
573+
},
570574
// ...
571575
};
572576
```
@@ -576,9 +580,9 @@ const configuration = {
576580
```js
577581
const configuration = {
578582
toolbox: {
579-
isCollapsed: true // or false
583+
isCollapsed: true, // or false
580584
// ...
581-
}
585+
},
582586
// ...
583587
};
584588

@@ -591,9 +595,9 @@ designer.setIsToolboxCollapsed(true);
591595
```js
592596
const configuration = {
593597
editors: {
594-
isCollapsed: true // or false
598+
isCollapsed: true, // or false
595599
// ...
596-
}
600+
},
597601
// ...
598602
};
599603

@@ -605,7 +609,7 @@ designer.setIsEditorCollapsed(true);
605609

606610
```js
607611
const configuration = {
608-
uidGenerator: () => Math.random().toString()
612+
uidGenerator: () => Math.random().toString(),
609613
// ...
610614
};
611615
```
@@ -708,7 +712,7 @@ This version changes the main configuration. The "isHidden" properties are prohi
708712
const configuration = {
709713
toolbox: false,
710714
editors: false,
711-
controlBar: false
715+
controlBar: false,
712716
// ...
713717
};
714718
```
@@ -720,17 +724,17 @@ const configuration = {
720724
toolbox: {
721725
groups: [
722726
/* ... */
723-
]
727+
],
724728
},
725729
editors: {
726730
globalEditorProvider: () => {
727731
/* ... */
728732
},
729733
stepEditorProvider: () => {
730734
/* ... */
731-
}
735+
},
732736
},
733-
controlBar: true
737+
controlBar: true,
734738
// ...
735739
};
736740
```
@@ -872,7 +876,7 @@ Support undo and redo. This feature is disabled by default. To enable it add the
872876

873877
```js
874878
const config = {
875-
undoStackSize: 10
879+
undoStackSize: 10,
876880
// ...
877881
};
878882
```
@@ -905,8 +909,8 @@ const config = {
905909
// ...
906910
context.notifyPropertiesChanged();
907911
// ...
908-
}
909-
}
912+
},
913+
},
910914
};
911915
```
912916

@@ -938,9 +942,9 @@ const config = {
938942
},
939943
canDeleteStep: (step, parentSequence) => {
940944
return step.name !== 'x';
941-
}
945+
},
942946
// ...
943-
}
947+
},
944948
};
945949
```
946950

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ Add the below code to your head section in HTML document.
106106
```html
107107
<head>
108108
...
109-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.0/css/designer.css" rel="stylesheet" />
110-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.0/css/designer-light.css" rel="stylesheet" />
111-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.0/css/designer-dark.css" rel="stylesheet" />
112-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.0/dist/index.umd.js"></script>
109+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.1/css/designer.css" rel="stylesheet" />
110+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.1/css/designer-light.css" rel="stylesheet" />
111+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.1/css/designer-dark.css" rel="stylesheet" />
112+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.37.1/dist/index.umd.js"></script>
113113
</head>
114114
```
115115

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.37.0",
4+
"version": "0.37.1",
55
"author": {
66
"name": "NoCode JS",
77
"url": "https://nocode-js.com/"
@@ -15,7 +15,7 @@
1515
"peerDependencies": {
1616
"@angular/common": "12 - 20",
1717
"@angular/core": "12 - 20",
18-
"sequential-workflow-designer": "^0.37.0"
18+
"sequential-workflow-designer": "^0.37.1"
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.37.0",
30-
"sequential-workflow-designer-angular": "^0.37.0",
29+
"sequential-workflow-designer": "^0.37.1",
30+
"sequential-workflow-designer-angular": "^0.37.1",
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 @@ send@0.18.0:
67446744
range-parser "~1.2.1"
67456745
statuses "2.0.1"
67466746

6747-
sequential-workflow-designer-angular@^0.37.0:
6748-
version "0.37.0"
6749-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.37.0.tgz#4b2719e44c7dd7c61d7f4eb0c18357eb4af07dff"
6750-
integrity sha512-OPyAZWkB7EjILICdsRlyKoqrkRepTD4NRh4m/FxEW1r6hWF0zSw5pIySiR4Q28KzHaV99dLHptX0U7/g7lK8cQ==
6747+
sequential-workflow-designer-angular@^0.37.1:
6748+
version "0.37.1"
6749+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.37.1.tgz#b0e012e2313c898b1917cb82deed50eca82713e6"
6750+
integrity sha512-KZq1FXII2k4IAn8enDynlsrBb52TNmy8pHPVK2qEbJI3F5144e8yEMhkktVt8YGT+FojD5Ho8XiFH4P1JOdAgA==
67516751
dependencies:
67526752
tslib "^2.3.0"
67536753

6754-
sequential-workflow-designer@^0.37.0:
6755-
version "0.37.0"
6756-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.37.0.tgz#49229a6dd9771de56d1649796b8a2a954f2ba248"
6757-
integrity sha512-5YWGW+LNEstma95LcwsqXMC9kDhCbvjUslEnkUBZRnulHIBqlCESGjBhU9/VT1Vr4zg1906ZIAjhl84ghiuVHQ==
6754+
sequential-workflow-designer@^0.37.1:
6755+
version "0.37.1"
6756+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.37.1.tgz#93d87c2e7fb21b75d5c5782960699989c0b24260"
6757+
integrity sha512-IdS31OpgnrqMIOIWhiKqMKJf5D+pPdVNVkPQh1OV4IuGcYnmhEDU38dk4H5QWA0IObKvLNgQG+tcys4y884sHQ==
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.37.0",
10-
"sequential-workflow-designer-react": "^0.37.0"
9+
"sequential-workflow-designer": "^0.37.1",
10+
"sequential-workflow-designer-react": "^0.37.1"
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.37.0",
20-
"sequential-workflow-designer-svelte": "^0.37.0"
19+
"sequential-workflow-designer": "^0.37.1",
20+
"sequential-workflow-designer-svelte": "^0.37.1"
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.37.0",
4+
"version": "0.37.1",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",

designer/src/workspace/switch-step/switch-step-component-view.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('SwitchStepComponentView', () => {
5454
branchNameLabel: labelViewCfg,
5555
nameLabel: labelViewCfg
5656
},
57+
undefined,
5758
undefined
5859
);
5960
factory(parent, stepContext, viewContext);

designer/src/workspace/switch-step/switch-step-component-view.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { InputView } from '../common-views/input-view';
77
import { ClickDetails, StepComponentView, ClickCommand, SequenceComponent } from '../component';
88
import { RegionView, StepComponentViewContext, StepComponentViewFactory, StepContext } from '../../designer-extension';
99
import { SwitchStepComponentViewConfiguration } from './switch-step-component-view-configuration';
10-
import { BranchNamesResolver } from './switch-step-extension-configuration';
10+
import { BranchNameLabelResolver, BranchNamesResolver } from './switch-step-extension-configuration';
1111

1212
const COMPONENT_CLASS_NAME = 'switch';
1313

@@ -64,7 +64,11 @@ function createView(
6464
}
6565

6666
export const createSwitchStepComponentViewFactory =
67-
(cfg: SwitchStepComponentViewConfiguration, branchNameResolver: BranchNamesResolver | undefined): StepComponentViewFactory =>
67+
(
68+
cfg: SwitchStepComponentViewConfiguration,
69+
branchNameResolver: BranchNamesResolver | undefined,
70+
branchNameLabelResolver: BranchNameLabelResolver | undefined
71+
): StepComponentViewFactory =>
6872
(parent: SVGElement, stepContext: StepContext<BranchedStep>, viewContext: StepComponentViewContext): StepComponentView => {
6973
return viewContext.createRegionComponentView(parent, COMPONENT_CLASS_NAME, (g, regionViewBuilder) => {
7074
const step = stepContext.step;
@@ -95,9 +99,11 @@ export const createSwitchStepComponentViewFactory =
9599
let maxBranchesHeight = 0;
96100

97101
branchNames.forEach((branchName, i) => {
102+
const label = branchNameLabelResolver ? branchNameLabelResolver(branchName, step) : branchName;
103+
const translatedLabel = viewContext.i18n(`stepComponent.${step.type}.branchName`, label);
104+
98105
const labelY = paddingTop + cfg.nameLabel.height + cfg.connectionHeight;
99-
const translatedBranchName = viewContext.i18n(`stepComponent.${step.type}.branchName`, branchName);
100-
const labelView = LabelView.create(g, labelY, cfg.branchNameLabel, translatedBranchName, 'secondary');
106+
const labelView = LabelView.create(g, labelY, cfg.branchNameLabel, translatedLabel, 'secondary');
101107

102108
const component = viewContext.createSequenceComponent(g, step.branches[branchName]);
103109

0 commit comments

Comments
 (0)