Skip to content

Commit 40917b1

Browse files
authored
0.14.4. (#48)
1 parent 885fdca commit 40917b1

10 files changed

+49
-22
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.14.4
2+
3+
This version exposes the `ToolboxGroup` interface in the `sequential-workflow-editor` package [#46](https://github.com/nocode-js/sequential-workflow-editor/issues/46#issuecomment-2439817733).
4+
15
## 0.14.3
26

37
This version provides the ability to sort the steps in the toolbox in a custom way. By default, the steps are sorted alphabetically.

demos/webpack-app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"sequential-workflow-model": "^0.2.0",
1919
"sequential-workflow-designer": "^0.21.2",
2020
"sequential-workflow-machine": "^0.4.0",
21-
"sequential-workflow-editor-model": "^0.14.3",
22-
"sequential-workflow-editor": "^0.14.3"
21+
"sequential-workflow-editor-model": "^0.14.4",
22+
"sequential-workflow-editor": "^0.14.4"
2323
},
2424
"devDependencies": {
2525
"ts-loader": "^9.4.2",

editor/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sequential-workflow-editor",
3-
"version": "0.14.3",
3+
"version": "0.14.4",
44
"type": "module",
55
"main": "./lib/esm/index.js",
66
"types": "./lib/index.d.ts",
@@ -46,11 +46,11 @@
4646
"prettier:fix": "prettier --write ./src ./css"
4747
},
4848
"dependencies": {
49-
"sequential-workflow-editor-model": "^0.14.3",
49+
"sequential-workflow-editor-model": "^0.14.4",
5050
"sequential-workflow-model": "^0.2.0"
5151
},
5252
"peerDependencies": {
53-
"sequential-workflow-editor-model": "^0.14.3",
53+
"sequential-workflow-editor-model": "^0.14.4",
5454
"sequential-workflow-model": "^0.2.0"
5555
},
5656
"devDependencies": {

editor/src/core/sort-toolbox-groups.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Step } from 'sequential-workflow-model';
2-
import { ToolboxGroup } from '../external-types';
32
import { sortToolboxGroups } from './sort-toolbox-groups';
3+
import { ToolboxGroup } from '../editor-provider-configuration';
44

55
function createStep(name: string): Step {
66
return {

editor/src/core/sort-toolbox-groups.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { EditorToolboxSorter } from '../editor-provider-configuration';
2-
import { ToolboxGroup } from '../external-types';
1+
import { EditorToolboxSorter, ToolboxGroup } from '../editor-provider-configuration';
32

43
export const sortToolboxGroups: EditorToolboxSorter = (groups: ToolboxGroup[]) => {
54
groups.forEach(group => {
+33-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,49 @@
11
import { I18n, UidGenerator } from 'sequential-workflow-editor-model';
2-
import { DefinitionWalker } from 'sequential-workflow-model';
2+
import { DefinitionWalker, Step } from 'sequential-workflow-model';
33
import { EditorExtension } from './editor-extension';
4-
import { ToolboxGroup } from './external-types';
54

65
export interface EditorProviderConfiguration {
6+
/**
7+
* A generator of unique identifiers.
8+
*/
79
uidGenerator: UidGenerator;
10+
11+
/**
12+
* The definition walker. If it's not set the editor uses the default definition walker from the `sequential-workflow-model` package.
13+
*/
814
definitionWalker?: DefinitionWalker;
15+
16+
/**
17+
* The translation service for the editor.
18+
*/
919
i18n?: I18n;
20+
21+
/**
22+
* Determines whether the header of the editor is hidden.
23+
*/
1024
isHeaderHidden?: boolean;
11-
extensions?: EditorExtension[];
1225

1326
/**
1427
* Sorter for the toolbox groups. By default, the groups are sorted alphabetically.
1528
*/
1629
toolboxSorter?: EditorToolboxSorter;
30+
31+
/**
32+
* Extensions for the editor.
33+
*/
34+
extensions?: EditorExtension[];
35+
}
36+
37+
export interface ToolboxGroup {
38+
/**
39+
* The name of the group.
40+
*/
41+
name: string;
42+
43+
/**
44+
* The steps in the group.
45+
*/
46+
steps: Step[];
1747
}
1848

1949
export type EditorToolboxSorter = (groups: ToolboxGroup[]) => void;

editor/src/editor-provider.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ import {
1818
StepEditorContext,
1919
StepEditorProvider,
2020
StepLabelProvider,
21-
StepValidator,
22-
ToolboxGroup
21+
StepValidator
2322
} from './external-types';
24-
import { EditorProviderConfiguration } from './editor-provider-configuration';
23+
import { EditorProviderConfiguration, ToolboxGroup } from './editor-provider-configuration';
2524
import { EditorHeaderData } from './editor-header';
2625
import { sortToolboxGroups } from './core/sort-toolbox-groups';
2726

editor/src/external-types.ts

-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@ export type StepLabelProvider = (step: { type: string }) => string;
1717

1818
export type StepValidator = (step: Step, _: unknown, definition: Definition) => boolean;
1919
export type RootValidator = (definition: Definition) => boolean;
20-
21-
export interface ToolboxGroup {
22-
name: string;
23-
steps: Step[];
24-
}

model/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sequential-workflow-editor-model",
3-
"version": "0.14.3",
3+
"version": "0.14.4",
44
"homepage": "https://nocode-js.com/",
55
"author": {
66
"name": "NoCode JS",

model/src/builders/step-model-builder.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class StepModelBuilder<TStep extends Step> {
7979

8080
/**
8181
* @returns The builder for the `name` property.
82-
* @example `builder.name().value(stringValueModel({ defaultValue: 'Some name' })).label('Name');`
82+
* @example `builder.name().value(createStringValueModel({ defaultValue: 'Some name' })).label('Name');`
8383
*/
8484
public name(): PropertyModelBuilder<string, TStep['properties']> {
8585
return this.nameBuilder;
@@ -88,7 +88,7 @@ export class StepModelBuilder<TStep extends Step> {
8888
/**
8989
* @param propertyName Name of the property in the step.
9090
* @returns The builder for the property.
91-
* @example `builder.property('foo').value(stringValueModel({ defaultValue: 'Some value' })).label('Foo');`
91+
* @example `builder.property('foo').value(createStringValueModel({ defaultValue: 'Some value' })).label('Foo');`
9292
*/
9393
public property<Key extends keyof TStep['properties']>(
9494
propertyName: Key

0 commit comments

Comments
 (0)