Skip to content

0.14.4. #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading