diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c70338..9c1ee50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.35.2 + +This version introduces a configurable `componentType` for step extensions. + # 0.35.1 This version fixes a bug in the calculation of the placeholder position when dragging a step component. diff --git a/README.md b/README.md index 8ad07da..5db02ff 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,10 @@ Add the below code to your head section in HTML document. ```html ... - - - - + + + + ``` Call the designer by: diff --git a/angular/designer/package.json b/angular/designer/package.json index 574cbe6..7048bca 100644 --- a/angular/designer/package.json +++ b/angular/designer/package.json @@ -1,7 +1,7 @@ { "name": "sequential-workflow-designer-angular", "description": "Angular wrapper for Sequential Workflow Designer component.", - "version": "0.35.1", + "version": "0.35.2", "author": { "name": "NoCode JS", "url": "https://nocode-js.com/" @@ -15,7 +15,7 @@ "peerDependencies": { "@angular/common": "12 - 19", "@angular/core": "12 - 19", - "sequential-workflow-designer": "^0.35.1" + "sequential-workflow-designer": "^0.35.2" }, "dependencies": { "tslib": "^2.3.0" diff --git a/demos/angular-app/package.json b/demos/angular-app/package.json index 42f533d..37b068f 100644 --- a/demos/angular-app/package.json +++ b/demos/angular-app/package.json @@ -26,8 +26,8 @@ "@angular/platform-browser-dynamic": "^17.3.9", "@angular/router": "^17.3.9", "rxjs": "~7.8.0", - "sequential-workflow-designer": "^0.35.1", - "sequential-workflow-designer-angular": "^0.35.1", + "sequential-workflow-designer": "^0.35.2", + "sequential-workflow-designer-angular": "^0.35.2", "tslib": "^2.3.0", "zone.js": "~0.14.6" }, diff --git a/demos/angular-app/yarn.lock b/demos/angular-app/yarn.lock index 5ae630b..b038680 100644 --- a/demos/angular-app/yarn.lock +++ b/demos/angular-app/yarn.lock @@ -6744,17 +6744,17 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" -sequential-workflow-designer-angular@^0.35.1: - version "0.35.1" - resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.35.1.tgz#2d29e3da2d098d6a59aa3b1625feba8d597fdd1c" - integrity sha512-anB5bS+KMvjJROO7Srcfn0wECDFXt/VL414UG7BzduIGzcN8dXSxLotUc1eTHyq6JXr3xoBuhDO0QoTluW+3Hg== +sequential-workflow-designer-angular@^0.35.2: + version "0.35.2" + resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.35.2.tgz#b9530c4d17c30f5e2ee2eedab10423d28e2cbf41" + integrity sha512-8rhBMtfX0n8o2TN9UTPZAvc/eSD61fdE3bp/vaQWBJuhfJeZXZzT7yUx1xDmX/cLoq6uaTnzNVQSgSZ1DmJNDQ== dependencies: tslib "^2.3.0" -sequential-workflow-designer@^0.35.1: - version "0.35.1" - resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.35.1.tgz#b62386eff4b1ce88110ab6cd13ef0b45aba9de25" - integrity sha512-BwnxWkHyMCSn5kCheWE6mdfLD53gaNp4Goz9T7ma5IqqS5YSNen3MDQbgo2hH4DJNMnPEz0S4Cx0nQ0oKsuXzw== +sequential-workflow-designer@^0.35.2: + version "0.35.2" + resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.35.2.tgz#b4453cb63e293525aa7502bf89831ca59a2ab20e" + integrity sha512-1BvqmcRgelq/m2W2/b+87RzX+jzQsVhRse2tgipUNGJ+HPPKH8uR2x+oj86+mYlFtv7al46JDO/ODy0vNxu+wA== dependencies: sequential-workflow-model "^0.2.0" diff --git a/demos/react-app/package.json b/demos/react-app/package.json index 7e265a7..29f6bef 100644 --- a/demos/react-app/package.json +++ b/demos/react-app/package.json @@ -6,8 +6,8 @@ "dependencies": { "react": "^18.2.0", "react-dom": "^18.2.0", - "sequential-workflow-designer": "^0.35.1", - "sequential-workflow-designer-react": "^0.35.1" + "sequential-workflow-designer": "^0.35.2", + "sequential-workflow-designer-react": "^0.35.2" }, "devDependencies": { "@types/jest": "^29.2.5", diff --git a/demos/svelte-app/package.json b/demos/svelte-app/package.json index 0878ff4..854bd48 100644 --- a/demos/svelte-app/package.json +++ b/demos/svelte-app/package.json @@ -16,8 +16,8 @@ "eslint": "eslint ./src --ext .ts" }, "dependencies": { - "sequential-workflow-designer": "^0.35.1", - "sequential-workflow-designer-svelte": "^0.35.1" + "sequential-workflow-designer": "^0.35.2", + "sequential-workflow-designer-svelte": "^0.35.2" }, "devDependencies": { "@sveltejs/adapter-static": "^2.0.3", diff --git a/designer/package.json b/designer/package.json index 6d40065..b8e615d 100644 --- a/designer/package.json +++ b/designer/package.json @@ -1,7 +1,7 @@ { "name": "sequential-workflow-designer", "description": "Customizable no-code component for building flow-based programming applications.", - "version": "0.35.1", + "version": "0.35.2", "type": "module", "main": "./lib/esm/index.js", "types": "./lib/index.d.ts", diff --git a/designer/src/workspace/container-step/container-step-extension-configuration.ts b/designer/src/workspace/container-step/container-step-extension-configuration.ts index 24b284d..0b7b09c 100644 --- a/designer/src/workspace/container-step/container-step-extension-configuration.ts +++ b/designer/src/workspace/container-step/container-step-extension-configuration.ts @@ -1,5 +1,6 @@ import { ContainerStepComponentViewConfiguration } from './container-step-component-view-configuration'; export interface ContainerStepExtensionConfiguration { - view: ContainerStepComponentViewConfiguration; + componentType?: string; + view?: ContainerStepComponentViewConfiguration; } diff --git a/designer/src/workspace/container-step/container-step-extension.ts b/designer/src/workspace/container-step/container-step-extension.ts index 386520c..d1113b0 100644 --- a/designer/src/workspace/container-step/container-step-extension.ts +++ b/designer/src/workspace/container-step/container-step-extension.ts @@ -1,34 +1,33 @@ import { SequentialStep } from '../../definition'; import { StepExtension } from '../../designer-extension'; import { createContainerStepComponentViewFactory } from './container-step-component-view'; +import { ContainerStepComponentViewConfiguration } from './container-step-component-view-configuration'; import { ContainerStepExtensionConfiguration } from './container-step-extension-configuration'; -const defaultConfiguration: ContainerStepExtensionConfiguration = { - view: { - paddingTop: 20, - paddingX: 20, - inputSize: 18, - inputRadius: 4, - inputIconSize: 14, - autoHideInputOnDrag: true, - isRegionClickable: true, - label: { - height: 22, - paddingX: 10, - minWidth: 50, - radius: 10 - } +const defaultViewConfiguration: ContainerStepComponentViewConfiguration = { + paddingTop: 20, + paddingX: 20, + inputSize: 18, + inputRadius: 4, + inputIconSize: 14, + autoHideInputOnDrag: true, + isRegionClickable: true, + label: { + height: 22, + paddingX: 10, + minWidth: 50, + radius: 10 } }; export class ContainerStepExtension implements StepExtension { public static create(configuration?: ContainerStepExtensionConfiguration): ContainerStepExtension { - return new ContainerStepExtension(configuration ?? defaultConfiguration); + return new ContainerStepExtension(configuration); } - public readonly componentType = 'container'; + public readonly componentType = this.configuration?.componentType ?? 'container'; - private constructor(private readonly configuration: ContainerStepExtensionConfiguration) {} + private constructor(private readonly configuration: ContainerStepExtensionConfiguration | undefined) {} - public readonly createComponentView = createContainerStepComponentViewFactory(this.configuration.view); + public readonly createComponentView = createContainerStepComponentViewFactory(this.configuration?.view ?? defaultViewConfiguration); } diff --git a/designer/src/workspace/launch-pad-step/launch-pad-step-extension-configuration.ts b/designer/src/workspace/launch-pad-step/launch-pad-step-extension-configuration.ts index 614c634..1d3630a 100644 --- a/designer/src/workspace/launch-pad-step/launch-pad-step-extension-configuration.ts +++ b/designer/src/workspace/launch-pad-step/launch-pad-step-extension-configuration.ts @@ -1,5 +1,6 @@ import { LaunchPadStepComponentViewConfiguration } from './launch-pad-step-component-view-configuration'; export interface LaunchPadStepExtensionConfiguration { + componentType?: string; view?: LaunchPadStepComponentViewConfiguration; } diff --git a/designer/src/workspace/launch-pad-step/launch-pad-step-extension.ts b/designer/src/workspace/launch-pad-step/launch-pad-step-extension.ts index 9c3938c..5dc5824 100644 --- a/designer/src/workspace/launch-pad-step/launch-pad-step-extension.ts +++ b/designer/src/workspace/launch-pad-step/launch-pad-step-extension.ts @@ -20,7 +20,7 @@ export class LaunchPadStepExtension implements StepExtension { return new LaunchPadStepExtension(configuration); } - public readonly componentType = 'launchPad'; + public readonly componentType = this.configuration?.componentType ?? 'launchPad'; private constructor(private readonly configuration: LaunchPadStepExtensionConfiguration | undefined) {} diff --git a/designer/src/workspace/switch-step/switch-step-extension-configuration.ts b/designer/src/workspace/switch-step/switch-step-extension-configuration.ts index e35cc59..97b63fc 100644 --- a/designer/src/workspace/switch-step/switch-step-extension-configuration.ts +++ b/designer/src/workspace/switch-step/switch-step-extension-configuration.ts @@ -4,6 +4,7 @@ import { SwitchStepComponentViewConfiguration } from './switch-step-component-vi export type BranchNamesResolver = (step: BranchedStep) => string[]; export interface SwitchStepExtensionConfiguration { + componentType?: string; view?: SwitchStepComponentViewConfiguration; /** diff --git a/designer/src/workspace/switch-step/switch-step-extension.ts b/designer/src/workspace/switch-step/switch-step-extension.ts index 08bea10..1d5768e 100644 --- a/designer/src/workspace/switch-step/switch-step-extension.ts +++ b/designer/src/workspace/switch-step/switch-step-extension.ts @@ -35,7 +35,7 @@ export class SwitchStepExtension implements StepExtension { return new SwitchStepExtension(configuration); } - public readonly componentType = 'switch'; + public readonly componentType = this.configuration?.componentType ?? 'switch'; private constructor(private readonly configuration: SwitchStepExtensionConfiguration | undefined) {} diff --git a/designer/src/workspace/task-step/task-step-extension-configuration.ts b/designer/src/workspace/task-step/task-step-extension-configuration.ts index c8c0d68..376c507 100644 --- a/designer/src/workspace/task-step/task-step-extension-configuration.ts +++ b/designer/src/workspace/task-step/task-step-extension-configuration.ts @@ -1,5 +1,6 @@ import { TaskStepComponentViewConfiguration } from './task-step-component-view-configuration'; export interface TaskStepExtensionConfiguration { - view: TaskStepComponentViewConfiguration; + componentType?: string; + view?: TaskStepComponentViewConfiguration; } diff --git a/designer/src/workspace/task-step/task-step-extension.ts b/designer/src/workspace/task-step/task-step-extension.ts index c4a4c38..b09ac05 100644 --- a/designer/src/workspace/task-step/task-step-extension.ts +++ b/designer/src/workspace/task-step/task-step-extension.ts @@ -1,30 +1,29 @@ import { Step } from '../../definition'; import { StepExtension } from '../../designer-extension'; import { createTaskStepComponentViewFactory } from './task-step-component-view'; +import { TaskStepComponentViewConfiguration } from './task-step-component-view-configuration'; import { TaskStepExtensionConfiguration } from './task-step-extension-configuration'; -const defaultConfiguration: TaskStepExtensionConfiguration = { - view: { - paddingLeft: 12, - paddingRight: 12, - paddingY: 10, - textMarginLeft: 12, - minTextWidth: 70, - iconSize: 22, - radius: 5, - inputSize: 14, - outputSize: 10 - } +const defaultViewConfiguration: TaskStepComponentViewConfiguration = { + paddingLeft: 12, + paddingRight: 12, + paddingY: 10, + textMarginLeft: 12, + minTextWidth: 70, + iconSize: 22, + radius: 5, + inputSize: 14, + outputSize: 10 }; export class TaskStepExtension implements StepExtension { public static create(configuration?: TaskStepExtensionConfiguration): TaskStepExtension { - return new TaskStepExtension(configuration ?? defaultConfiguration); + return new TaskStepExtension(configuration); } - public readonly componentType = 'task'; + public readonly componentType = this.configuration?.componentType ?? 'task'; - private constructor(private readonly configuration: TaskStepExtensionConfiguration) {} + private constructor(private readonly configuration: TaskStepExtensionConfiguration | undefined) {} - public readonly createComponentView = createTaskStepComponentViewFactory(false, this.configuration.view); + public readonly createComponentView = createTaskStepComponentViewFactory(false, this.configuration?.view ?? defaultViewConfiguration); } diff --git a/examples/assets/lib.js b/examples/assets/lib.js index 71df104..a631058 100644 --- a/examples/assets/lib.js +++ b/examples/assets/lib.js @@ -13,7 +13,7 @@ function embedStylesheet(url) { document.write(``); } -const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.1'; +const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.35.2'; embedScript(`${baseUrl}/dist/index.umd.js`); embedStylesheet(`${baseUrl}/css/designer.css`); diff --git a/react/package.json b/react/package.json index 414cc82..e24799e 100644 --- a/react/package.json +++ b/react/package.json @@ -1,7 +1,7 @@ { "name": "sequential-workflow-designer-react", "description": "React wrapper for Sequential Workflow Designer component.", - "version": "0.35.1", + "version": "0.35.2", "type": "module", "main": "./lib/esm/index.js", "types": "./lib/index.d.ts", @@ -47,7 +47,7 @@ "peerDependencies": { "react": ">=18.2.0", "react-dom": ">=18.2.0", - "sequential-workflow-designer": "^0.35.1" + "sequential-workflow-designer": "^0.35.2" }, "devDependencies": { "@rollup/plugin-node-resolve": "^16.0.1", @@ -63,7 +63,7 @@ "prettier": "^3.2.5", "react": "^18.2.0", "react-dom": "^18.2.0", - "sequential-workflow-designer": "^0.35.1", + "sequential-workflow-designer": "^0.35.2", "rollup": "^4.40.0", "rollup-plugin-dts": "^6.2.1", "rollup-plugin-typescript2": "^0.36.0", diff --git a/svelte/package.json b/svelte/package.json index d1a90d7..847bb19 100644 --- a/svelte/package.json +++ b/svelte/package.json @@ -1,7 +1,7 @@ { "name": "sequential-workflow-designer-svelte", "description": "Svelte wrapper for Sequential Workflow Designer component.", - "version": "0.35.1", + "version": "0.35.2", "license": "MIT", "scripts": { "prepare": "cp ../LICENSE LICENSE", @@ -28,10 +28,10 @@ ], "peerDependencies": { "svelte": "^4.0.0", - "sequential-workflow-designer": "^0.35.1" + "sequential-workflow-designer": "^0.35.2" }, "devDependencies": { - "sequential-workflow-designer": "^0.35.1", + "sequential-workflow-designer": "^0.35.2", "@sveltejs/adapter-static": "^2.0.3", "@sveltejs/kit": "^1.20.4", "@sveltejs/package": "^2.0.0",