Skip to content
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

0.19.1. #125

Merged
merged 1 commit into from
Feb 19, 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.19.1

Fixed the bug with refreshing the state modifier dependencies.

## 0.19.0

* Added the `isSelectable` callback to the `StepsConfiguration` interface. Now it's possible to disable the selection of steps.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ Add the below code to your head section in HTML document.
```html
<head>
...
<link href="https://cdn.jsdelivr.net/npm/[email protected].0/css/designer.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].0/css/designer-light.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].0/css/designer-dark.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected].0/dist/index.umd.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected].1/css/designer.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].1/css/designer-light.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].1/css/designer-dark.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/index.umd.js"></script>
```

Call the designer by:
Expand Down
4 changes: 2 additions & 2 deletions angular/designer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sequential-workflow-designer-angular",
"description": "Angular wrapper for Sequential Workflow Designer component.",
"version": "0.19.0",
"version": "0.19.1",
"author": {
"name": "NoCode JS",
"url": "https://nocode-js.com/"
Expand All @@ -15,7 +15,7 @@
"peerDependencies": {
"@angular/common": "12 - 16",
"@angular/core": "12 - 16",
"sequential-workflow-designer": "^0.19.0"
"sequential-workflow-designer": "^0.19.1"
},
"dependencies": {
"tslib": "^2.3.0"
Expand Down
4 changes: 2 additions & 2 deletions demos/angular-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"@angular/platform-browser-dynamic": "^15.2.9",
"@angular/router": "^15.2.9",
"rxjs": "~7.8.0",
"sequential-workflow-designer": "^0.19.0",
"sequential-workflow-designer-angular": "^0.19.0",
"sequential-workflow-designer": "^0.19.1",
"sequential-workflow-designer-angular": "^0.19.1",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
Expand Down
4 changes: 2 additions & 2 deletions demos/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sequential-workflow-designer": "^0.19.0",
"sequential-workflow-designer-react": "^0.19.0"
"sequential-workflow-designer": "^0.19.1",
"sequential-workflow-designer-react": "^0.19.1"
},
"devDependencies": {
"@types/jest": "^29.2.5",
Expand Down
4 changes: 2 additions & 2 deletions demos/svelte-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"eslint": "eslint ./src --ext .ts"
},
"dependencies": {
"sequential-workflow-designer": "^0.19.0",
"sequential-workflow-designer-svelte": "^0.19.0"
"sequential-workflow-designer": "^0.19.1",
"sequential-workflow-designer-svelte": "^0.19.1"
},
"devDependencies": {
"@sveltejs/adapter-static": "^2.0.3",
Expand Down
2 changes: 1 addition & 1 deletion designer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sequential-workflow-designer",
"description": "Customizable no-code component for building flow-based programming applications.",
"version": "0.19.0",
"version": "0.19.1",
"type": "module",
"main": "./lib/esm/index.js",
"types": "./lib/index.d.ts",
Expand Down
31 changes: 22 additions & 9 deletions designer/src/custom-action-controller.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { Sequence, Step } from './definition';
import { CustomAction, DefinitionChangeType, DesignerConfiguration } from './designer-configuration';
import { DesignerState } from './designer-state';
import { StateModifier } from './modifier/state-modifier';

export class CustomActionController {
public constructor(private readonly configuration: DesignerConfiguration, private readonly state: DesignerState) {}
public constructor(
private readonly configuration: DesignerConfiguration,
private readonly state: DesignerState,
private readonly stateModifier: StateModifier
) {}

public trigger(action: CustomAction, step: Step | null, sequence: Sequence) {
const handler = this.configuration.customActionHandler;
Expand All @@ -12,20 +17,28 @@ export class CustomActionController {
return;
}

const context = {
notifyStepNameChanged: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepNameChanged, stepId),
notifyStepPropertiesChanged: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepPropertyChanged, stepId),
notifyStepInserted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepInserted, stepId),
notifyStepMoved: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepMoved, stepId),
notifyStepDeleted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepDeleted, stepId)
};
const context = this.createCustomActionHandlerContext();
handler(action, step, sequence, context);
}

private notifyStepChanged(changeType: DefinitionChangeType, stepId: string) {
private createCustomActionHandlerContext() {
return {
notifyStepNameChanged: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepNameChanged, stepId, false),
notifyStepPropertiesChanged: (stepId: string) =>
this.notifyStepChanged(DefinitionChangeType.stepPropertyChanged, stepId, false),
notifyStepInserted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepInserted, stepId, true),
notifyStepMoved: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepMoved, stepId, true),
notifyStepDeleted: (stepId: string) => this.notifyStepChanged(DefinitionChangeType.stepDeleted, stepId, true)
};
}

private notifyStepChanged(changeType: DefinitionChangeType, stepId: string, updateDependencies: boolean) {
if (!stepId) {
throw new Error('Step id is empty');
}
this.state.notifyDefinitionChanged(changeType, stepId);
if (updateDependencies) {
this.stateModifier.updateDependencies();
}
}
}
2 changes: 1 addition & 1 deletion designer/src/designer-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export class DesignerContext {
const state = new DesignerState(definition, isReadonly, isToolboxCollapsed, isEditorCollapsed);
const workspaceController = new WorkspaceControllerWrapper();
const behaviorController = new BehaviorController();
const customActionController = new CustomActionController(configuration, state);
const stepExtensionResolver = StepExtensionResolver.create(services);
const definitionWalker = configuration.definitionWalker ?? new DefinitionWalker();
const stateModifier = StateModifier.create(definitionWalker, state, configuration);
const customActionController = new CustomActionController(configuration, state, stateModifier);

let historyController: HistoryController | undefined = undefined;
if (configuration.undoStackSize) {
Expand Down
2 changes: 1 addition & 1 deletion examples/assets/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function embedStylesheet(url) {

const baseUrl = isTestEnv()
? '../designer'
: '//cdn.jsdelivr.net/npm/[email protected].0';
: '//cdn.jsdelivr.net/npm/[email protected].1';

embedScript(`${baseUrl}/dist/index.umd.js`);
embedStylesheet(`${baseUrl}/css/designer.css`);
Expand Down
6 changes: 3 additions & 3 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sequential-workflow-designer-react",
"description": "React wrapper for Sequential Workflow Designer component.",
"version": "0.19.0",
"version": "0.19.1",
"type": "module",
"main": "./lib/esm/index.js",
"types": "./lib/index.d.ts",
Expand Down Expand Up @@ -47,7 +47,7 @@
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sequential-workflow-designer": "^0.19.0"
"sequential-workflow-designer": "^0.19.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.0.1",
Expand All @@ -63,7 +63,7 @@
"prettier": "^2.8.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sequential-workflow-designer": "^0.19.0",
"sequential-workflow-designer": "^0.19.1",
"rollup": "^3.18.0",
"rollup-plugin-dts": "^5.2.0",
"rollup-plugin-typescript2": "^0.34.1",
Expand Down
6 changes: 3 additions & 3 deletions svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sequential-workflow-designer-svelte",
"description": "Svelte wrapper for Sequential Workflow Designer component.",
"version": "0.19.0",
"version": "0.19.1",
"license": "MIT",
"scripts": {
"prepare": "cp ../LICENSE LICENSE",
Expand All @@ -28,10 +28,10 @@
],
"peerDependencies": {
"svelte": "^4.0.0",
"sequential-workflow-designer": "^0.19.0"
"sequential-workflow-designer": "^0.19.1"
},
"devDependencies": {
"sequential-workflow-designer": "^0.19.0",
"sequential-workflow-designer": "^0.19.1",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"@sveltejs/package": "^2.0.0",
Expand Down
Loading