Skip to content

Commit fd03328

Browse files
authored
0.30.3. (#198)
1 parent 8ffc75f commit fd03328

File tree

14 files changed

+67
-30
lines changed

14 files changed

+67
-30
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.30.3
2+
3+
This version adds a new argument to the `canCreate` and `canShow` callbacks in the placeholder configuration, providing access to the current definition.
4+
15
# 0.30.2
26

37
This version fixes a bug related to identifying the touched element [#195](https://github.com/nocode-js/sequential-workflow-designer/issues/195).

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ Add the below code to your head section in HTML document.
106106
```html
107107
<head>
108108
...
109-
<link href="https://cdn.jsdelivr.net/npm/[email protected].2/css/designer.css" rel="stylesheet">
110-
<link href="https://cdn.jsdelivr.net/npm/[email protected].2/css/designer-light.css" rel="stylesheet">
111-
<link href="https://cdn.jsdelivr.net/npm/[email protected].2/css/designer-dark.css" rel="stylesheet">
112-
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/index.umd.js"></script>
109+
<link href="https://cdn.jsdelivr.net/npm/[email protected].3/css/designer.css" rel="stylesheet">
110+
<link href="https://cdn.jsdelivr.net/npm/[email protected].3/css/designer-light.css" rel="stylesheet">
111+
<link href="https://cdn.jsdelivr.net/npm/[email protected].3/css/designer-dark.css" rel="stylesheet">
112+
<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/index.umd.js"></script>
113113
```
114114

115115
Call the designer by:

angular/designer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer-angular",
33
"description": "Angular wrapper for Sequential Workflow Designer component.",
4-
"version": "0.30.2",
4+
"version": "0.30.3",
55
"author": {
66
"name": "NoCode JS",
77
"url": "https://nocode-js.com/"
@@ -15,7 +15,7 @@
1515
"peerDependencies": {
1616
"@angular/common": "12 - 19",
1717
"@angular/core": "12 - 19",
18-
"sequential-workflow-designer": "^0.30.2"
18+
"sequential-workflow-designer": "^0.30.3"
1919
},
2020
"dependencies": {
2121
"tslib": "^2.3.0"

demos/angular-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"@angular/platform-browser-dynamic": "^17.3.9",
2727
"@angular/router": "^17.3.9",
2828
"rxjs": "~7.8.0",
29-
"sequential-workflow-designer": "^0.30.2",
30-
"sequential-workflow-designer-angular": "^0.30.2",
29+
"sequential-workflow-designer": "^0.30.3",
30+
"sequential-workflow-designer-angular": "^0.30.3",
3131
"tslib": "^2.3.0",
3232
"zone.js": "~0.14.6"
3333
},

demos/react-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"dependencies": {
77
"react": "^18.2.0",
88
"react-dom": "^18.2.0",
9-
"sequential-workflow-designer": "^0.30.2",
10-
"sequential-workflow-designer-react": "^0.30.2"
9+
"sequential-workflow-designer": "^0.30.3",
10+
"sequential-workflow-designer-react": "^0.30.3"
1111
},
1212
"devDependencies": {
1313
"@types/jest": "^29.2.5",

demos/react-app/src/playground/Playground.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { useEffect, useMemo, useState } from 'react';
2-
import { ObjectCloner, Step, StepsConfiguration, ToolboxConfiguration, ValidatorConfiguration } from 'sequential-workflow-designer';
2+
import {
3+
ObjectCloner,
4+
PlaceholderConfiguration,
5+
Step,
6+
StepsConfiguration,
7+
ToolboxConfiguration,
8+
ValidatorConfiguration
9+
} from 'sequential-workflow-designer';
310
import { SequentialWorkflowDesigner, wrapDefinition } from 'sequential-workflow-designer-react';
411
import { RootEditor } from './RootEditor';
512
import { StepEditor } from './StepEditor';
@@ -35,6 +42,14 @@ export function Playground() {
3542
}),
3643
[]
3744
);
45+
const placeholderConfiguration: PlaceholderConfiguration = useMemo(
46+
() => ({
47+
canShow() {
48+
return true;
49+
}
50+
}),
51+
[]
52+
);
3853

3954
const [isVisible, setIsVisible] = useState(true);
4055
const [isToolboxCollapsed, setIsToolboxCollapsed] = useState(false);
@@ -133,6 +148,7 @@ export function Playground() {
133148
onIsToolboxCollapsedChanged={setIsToolboxCollapsed}
134149
stepsConfiguration={stepsConfiguration}
135150
validatorConfiguration={validatorConfiguration}
151+
placeholderConfiguration={placeholderConfiguration}
136152
controlBar={true}
137153
rootEditor={<RootEditor />}
138154
stepEditor={<StepEditor />}

demos/svelte-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"eslint": "eslint ./src --ext .ts"
1717
},
1818
"dependencies": {
19-
"sequential-workflow-designer": "^0.30.2",
20-
"sequential-workflow-designer-svelte": "^0.30.2"
19+
"sequential-workflow-designer": "^0.30.3",
20+
"sequential-workflow-designer-svelte": "^0.30.3"
2121
},
2222
"devDependencies": {
2323
"@sveltejs/adapter-static": "^2.0.3",

designer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer",
33
"description": "Customizable no-code component for building flow-based programming applications.",
4-
"version": "0.30.2",
4+
"version": "0.30.3",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",

designer/src/designer-configuration.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,14 @@ export interface StepsConfiguration {
184184
export type StepIconUrlProvider = (componentType: ComponentType, type: string) => string | null;
185185

186186
export interface PlaceholderConfiguration {
187-
canCreate?: (sequence: Sequence, index: number) => boolean;
188-
canShow?: (sequence: Sequence, index: number, draggingStepComponentType: ComponentType, draggingStepType: string) => boolean;
187+
canCreate?: (sequence: Sequence, index: number, definition: Definition) => boolean;
188+
canShow?: (
189+
sequence: Sequence,
190+
index: number,
191+
draggingStepComponentType: ComponentType,
192+
draggingStepType: string,
193+
definition: Definition
194+
) => boolean;
189195
}
190196

191197
export interface ValidatorConfiguration {

designer/src/designer-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class DesignerContext {
3535
const workspaceController = new WorkspaceControllerWrapper();
3636
const behaviorController = BehaviorController.create(configuration.shadowRoot);
3737
const stepExtensionResolver = StepExtensionResolver.create(services);
38-
const placeholderController = PlaceholderController.create(configuration.placeholder);
38+
const placeholderController = PlaceholderController.create(state, configuration.placeholder);
3939
const definitionWalker = configuration.definitionWalker ?? new DefinitionWalker();
4040
const i18n: I18n = configuration.i18n ?? ((_, defaultValue) => defaultValue);
4141
const uidGenerator = configuration.uidGenerator ?? Uid.next;

0 commit comments

Comments
 (0)