Skip to content

Commit

Permalink
0.14.4. (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
b4rtaz authored Oct 27, 2024
1 parent 885fdca commit 40917b1
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.14.4

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).

## 0.14.3

This version provides the ability to sort the steps in the toolbox in a custom way. By default, the steps are sorted alphabetically.
Expand Down
4 changes: 2 additions & 2 deletions demos/webpack-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"sequential-workflow-model": "^0.2.0",
"sequential-workflow-designer": "^0.21.2",
"sequential-workflow-machine": "^0.4.0",
"sequential-workflow-editor-model": "^0.14.3",
"sequential-workflow-editor": "^0.14.3"
"sequential-workflow-editor-model": "^0.14.4",
"sequential-workflow-editor": "^0.14.4"
},
"devDependencies": {
"ts-loader": "^9.4.2",
Expand Down
6 changes: 3 additions & 3 deletions editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sequential-workflow-editor",
"version": "0.14.3",
"version": "0.14.4",
"type": "module",
"main": "./lib/esm/index.js",
"types": "./lib/index.d.ts",
Expand Down Expand Up @@ -46,11 +46,11 @@
"prettier:fix": "prettier --write ./src ./css"
},
"dependencies": {
"sequential-workflow-editor-model": "^0.14.3",
"sequential-workflow-editor-model": "^0.14.4",
"sequential-workflow-model": "^0.2.0"
},
"peerDependencies": {
"sequential-workflow-editor-model": "^0.14.3",
"sequential-workflow-editor-model": "^0.14.4",
"sequential-workflow-model": "^0.2.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion editor/src/core/sort-toolbox-groups.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Step } from 'sequential-workflow-model';
import { ToolboxGroup } from '../external-types';
import { sortToolboxGroups } from './sort-toolbox-groups';
import { ToolboxGroup } from '../editor-provider-configuration';

function createStep(name: string): Step {
return {
Expand Down
3 changes: 1 addition & 2 deletions editor/src/core/sort-toolbox-groups.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EditorToolboxSorter } from '../editor-provider-configuration';
import { ToolboxGroup } from '../external-types';
import { EditorToolboxSorter, ToolboxGroup } from '../editor-provider-configuration';

export const sortToolboxGroups: EditorToolboxSorter = (groups: ToolboxGroup[]) => {
groups.forEach(group => {
Expand Down
36 changes: 33 additions & 3 deletions editor/src/editor-provider-configuration.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
import { I18n, UidGenerator } from 'sequential-workflow-editor-model';
import { DefinitionWalker } from 'sequential-workflow-model';
import { DefinitionWalker, Step } from 'sequential-workflow-model';
import { EditorExtension } from './editor-extension';
import { ToolboxGroup } from './external-types';

export interface EditorProviderConfiguration {
/**
* A generator of unique identifiers.
*/
uidGenerator: UidGenerator;

/**
* The definition walker. If it's not set the editor uses the default definition walker from the `sequential-workflow-model` package.
*/
definitionWalker?: DefinitionWalker;

/**
* The translation service for the editor.
*/
i18n?: I18n;

/**
* Determines whether the header of the editor is hidden.
*/
isHeaderHidden?: boolean;
extensions?: EditorExtension[];

/**
* Sorter for the toolbox groups. By default, the groups are sorted alphabetically.
*/
toolboxSorter?: EditorToolboxSorter;

/**
* Extensions for the editor.
*/
extensions?: EditorExtension[];
}

export interface ToolboxGroup {
/**
* The name of the group.
*/
name: string;

/**
* The steps in the group.
*/
steps: Step[];
}

export type EditorToolboxSorter = (groups: ToolboxGroup[]) => void;
5 changes: 2 additions & 3 deletions editor/src/editor-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ import {
StepEditorContext,
StepEditorProvider,
StepLabelProvider,
StepValidator,
ToolboxGroup
StepValidator
} from './external-types';
import { EditorProviderConfiguration } from './editor-provider-configuration';
import { EditorProviderConfiguration, ToolboxGroup } from './editor-provider-configuration';
import { EditorHeaderData } from './editor-header';
import { sortToolboxGroups } from './core/sort-toolbox-groups';

Expand Down
5 changes: 0 additions & 5 deletions editor/src/external-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,3 @@ export type StepLabelProvider = (step: { type: string }) => string;

export type StepValidator = (step: Step, _: unknown, definition: Definition) => boolean;
export type RootValidator = (definition: Definition) => boolean;

export interface ToolboxGroup {
name: string;
steps: Step[];
}
2 changes: 1 addition & 1 deletion model/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sequential-workflow-editor-model",
"version": "0.14.3",
"version": "0.14.4",
"homepage": "https://nocode-js.com/",
"author": {
"name": "NoCode JS",
Expand Down
4 changes: 2 additions & 2 deletions model/src/builders/step-model-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class StepModelBuilder<TStep extends Step> {

/**
* @returns The builder for the `name` property.
* @example `builder.name().value(stringValueModel({ defaultValue: 'Some name' })).label('Name');`
* @example `builder.name().value(createStringValueModel({ defaultValue: 'Some name' })).label('Name');`
*/
public name(): PropertyModelBuilder<string, TStep['properties']> {
return this.nameBuilder;
Expand All @@ -88,7 +88,7 @@ export class StepModelBuilder<TStep extends Step> {
/**
* @param propertyName Name of the property in the step.
* @returns The builder for the property.
* @example `builder.property('foo').value(stringValueModel({ defaultValue: 'Some value' })).label('Foo');`
* @example `builder.property('foo').value(createStringValueModel({ defaultValue: 'Some value' })).label('Foo');`
*/
public property<Key extends keyof TStep['properties']>(
propertyName: Key
Expand Down

0 comments on commit 40917b1

Please sign in to comment.