Skip to content

Commit ad3b4b0

Browse files
authored
0.24.3. (#164)
1 parent 1001a02 commit ad3b4b0

File tree

17 files changed

+46
-37
lines changed

17 files changed

+46
-37
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.24.3
2+
3+
Fixed the placement of the context menu in the `documentBody` element if specified in the configuration.
4+
15
# 0.24.2
26

37
This version reverts the changes introduced in version 0.24.1. To modify the DOM attachment check, you should now pass the `documentBody` property in the configuration, which should reference the document's body element.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ Add the below code to your head section in HTML document.
103103
```html
104104
<head>
105105
...
106-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.2/css/designer.css" rel="stylesheet">
107-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.2/css/designer-light.css" rel="stylesheet">
108-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.2/css/designer-dark.css" rel="stylesheet">
109-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.2/dist/index.umd.js"></script>
106+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.3/css/designer.css" rel="stylesheet">
107+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.3/css/designer-light.css" rel="stylesheet">
108+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.3/css/designer-dark.css" rel="stylesheet">
109+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.3/dist/index.umd.js"></script>
110110
```
111111

112112
Call the designer by:

angular/designer/package.json

+2-2
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.24.2",
4+
"version": "0.24.3",
55
"author": {
66
"name": "NoCode JS",
77
"url": "https://nocode-js.com/"
@@ -15,7 +15,7 @@
1515
"peerDependencies": {
1616
"@angular/common": "12 - 18",
1717
"@angular/core": "12 - 18",
18-
"sequential-workflow-designer": "^0.24.2"
18+
"sequential-workflow-designer": "^0.24.3"
1919
},
2020
"dependencies": {
2121
"tslib": "^2.3.0"

demos/angular-app/package.json

+2-2
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.24.2",
30-
"sequential-workflow-designer-angular": "^0.24.2",
29+
"sequential-workflow-designer": "^0.24.3",
30+
"sequential-workflow-designer-angular": "^0.24.3",
3131
"tslib": "^2.3.0",
3232
"zone.js": "~0.14.6"
3333
},

demos/angular-app/yarn.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -6744,17 +6744,17 @@ send@0.18.0:
67446744
range-parser "~1.2.1"
67456745
statuses "2.0.1"
67466746

6747-
sequential-workflow-designer-angular@^0.24.2:
6748-
version "0.24.2"
6749-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.24.2.tgz#def1c1ed8bf58942653be1dd4a5e8d5eb8e77cb5"
6750-
integrity sha512-o3oi6ogatAm53Drn44IoupcQHxgi2e3/8tf22J2AyOrFrIvzGbxVyZMKF2t99zYBDjmJkQ7p2jp58kwk0e363Q==
6747+
sequential-workflow-designer-angular@^0.24.3:
6748+
version "0.24.3"
6749+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.24.3.tgz#9f130a321189a95a6ae735793bb906bce958d7fb"
6750+
integrity sha512-YRfm+cSrWAqHKvNRvuVOJxRtcmEKyX9alUGn+e6q8mW9czVKVZ5t+1jMZFPmkIYrUa/XwbzrR3zXgDXNO5l2oQ==
67516751
dependencies:
67526752
tslib "^2.3.0"
67536753

6754-
sequential-workflow-designer@^0.24.2:
6755-
version "0.24.2"
6756-
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.24.2.tgz#628b3d1e317c0a40b9b4c7c3b1b2703e17b3b741"
6757-
integrity sha512-dfnf23keTXvXlAq0XBNbOi2pyrJXKB4j41IPIV0UpFEbKZ54QkxPq4UYubA/TWGjSgIOG+jnrZuNrEzs61UVRw==
6754+
sequential-workflow-designer@^0.24.3:
6755+
version "0.24.3"
6756+
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.24.3.tgz#0e72b89003eb69f3172396ac29a729924e5ffbae"
6757+
integrity sha512-Y11VuUpa+Uo9tNFWoBdKg9w53Q0UhWfKeFCrHfuWrEDogCcY5hp52SiRsdCBW8qOHEBIG58KvMwfr9vxBtmjJQ==
67586758
dependencies:
67596759
sequential-workflow-model "^0.2.0"
67606760

demos/react-app/package.json

+2-2
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.24.2",
10-
"sequential-workflow-designer-react": "^0.24.2"
9+
"sequential-workflow-designer": "^0.24.3",
10+
"sequential-workflow-designer-react": "^0.24.3"
1111
},
1212
"devDependencies": {
1313
"@types/jest": "^29.2.5",

demos/svelte-app/package.json

+2-2
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.24.2",
20-
"sequential-workflow-designer-svelte": "^0.24.2"
19+
"sequential-workflow-designer": "^0.24.3",
20+
"sequential-workflow-designer-svelte": "^0.24.3"
2121
},
2222
"devDependencies": {
2323
"@sveltejs/adapter-static": "^2.0.3",

designer/package.json

+1-1
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.24.2",
4+
"version": "0.24.3",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",

designer/src/designer-context.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import { PlaceholderController } from './designer-extension';
1616

1717
export class DesignerContext {
1818
public static create(
19+
documentBody: Node,
1920
parent: HTMLElement,
2021
startDefinition: Definition,
2122
configuration: DesignerConfiguration,
22-
services: Services,
23-
documentBody: Node
23+
services: Services
2424
): DesignerContext {
2525
const definition = ObjectCloner.deepClone(startDefinition);
2626

@@ -60,6 +60,7 @@ export class DesignerContext {
6060
);
6161

6262
return new DesignerContext(
63+
documentBody,
6364
theme,
6465
state,
6566
configuration,
@@ -78,6 +79,7 @@ export class DesignerContext {
7879
}
7980

8081
public constructor(
82+
public readonly documentBody: Node,
8183
public readonly theme: string,
8284
public readonly state: DesignerState,
8385
public readonly configuration: DesignerConfiguration,

designer/src/designer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class Designer<TDefinition extends Definition = Definition> {
4242
}
4343

4444
const services = ServicesResolver.resolve(configuration.extensions, config);
45-
const designerContext = DesignerContext.create(placeholder, startDefinition, config, services, documentBody);
45+
const designerContext = DesignerContext.create(documentBody, placeholder, startDefinition, config, services);
4646
const designerApi = DesignerApi.create(designerContext);
4747

4848
const view = DesignerView.create(placeholder, designerContext, designerApi);

designer/src/test-tools/stubs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function createDesignerContextStub(): DesignerContext {
4949
const configuration = createDesignerConfigurationStub();
5050
const services = ServicesResolver.resolve([], configuration);
5151
const documentBody = document.body;
52-
return DesignerContext.create(parent, createDefinitionStub(), createDesignerConfigurationStub(), services, documentBody);
52+
return DesignerContext.create(documentBody, parent, createDefinitionStub(), createDesignerConfigurationStub(), services);
5353
}
5454

5555
export function createComponentContextStub(): ComponentContext {

designer/src/workspace/context-menu/context-menu-controller.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export class ContextMenuController {
88
private current?: ContextMenu;
99

1010
public constructor(
11+
private readonly documentBody: Node,
1112
private readonly theme: string,
1213
private readonly configuration: DesignerConfiguration,
1314
private readonly itemsBuilder: ContextMenuItemsBuilder
@@ -24,7 +25,7 @@ export class ContextMenuController {
2425
}
2526

2627
const items = this.itemsBuilder.build(commandOrNull);
27-
this.current = ContextMenu.create(position, this.theme, items);
28+
this.current = ContextMenu.create(this.documentBody, position, this.theme, items);
2829
}
2930

3031
public destroy() {

designer/src/workspace/context-menu/context-menu.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Vector } from '../../core';
22
import { ContextMenuItem } from '../../designer-extension';
33

44
export class ContextMenu {
5-
public static create(position: Vector, theme: string, items: ContextMenuItem[]) {
5+
public static create(documentBody: Node, position: Vector, theme: string, items: ContextMenuItem[]) {
66
const menu = document.createElement('div');
77
menu.style.left = `${position.x}px`;
88
menu.style.top = `${position.y}px`;
@@ -25,18 +25,19 @@ export class ContextMenu {
2525
menu.appendChild(element);
2626
}
2727

28-
const instance = new ContextMenu(menu, elements, items, Date.now());
28+
const instance = new ContextMenu(documentBody, menu, elements, items, Date.now());
2929
document.addEventListener('mousedown', instance.mouseDown, false);
3030
document.addEventListener('mouseup', instance.mouseUp, false);
3131
document.addEventListener('touchstart', instance.mouseDown, false);
3232
document.addEventListener('touchend', instance.mouseUp, false);
33-
document.body.appendChild(menu);
33+
documentBody.appendChild(menu);
3434
return instance;
3535
}
3636

3737
private isAttached = true;
3838

3939
private constructor(
40+
private readonly documentBody: Node,
4041
private readonly menu: HTMLElement,
4142
private readonly elements: HTMLElement[],
4243
private readonly items: ContextMenuItem[],
@@ -85,7 +86,7 @@ export class ContextMenu {
8586

8687
public tryDestroy() {
8788
if (this.isAttached) {
88-
document.body.removeChild(this.menu);
89+
this.documentBody.removeChild(this.menu);
8990
document.removeEventListener('mousedown', this.mouseDown, false);
9091
document.removeEventListener('mouseup', this.mouseUp, false);
9192
document.removeEventListener('touchstart', this.mouseDown, false);

designer/src/workspace/workspace.ts

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class Workspace implements WorkspaceController {
3737
: undefined
3838
);
3939
const contextMenuController = new ContextMenuController(
40+
designerContext.documentBody,
4041
designerContext.theme,
4142
designerContext.configuration,
4243
contextMenuItemsBuilder

examples/assets/lib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function embedStylesheet(url) {
1313
document.write(`<link href="${url}" rel="stylesheet">`);
1414
}
1515

16-
const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.2';
16+
const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/sequential-workflow-designer@0.24.3';
1717

1818
embedScript(`${baseUrl}/dist/index.umd.js`);
1919
embedStylesheet(`${baseUrl}/css/designer.css`);

react/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer-react",
33
"description": "React wrapper for Sequential Workflow Designer component.",
4-
"version": "0.24.2",
4+
"version": "0.24.3",
55
"type": "module",
66
"main": "./lib/esm/index.js",
77
"types": "./lib/index.d.ts",
@@ -47,7 +47,7 @@
4747
"peerDependencies": {
4848
"react": "^18.2.0",
4949
"react-dom": "^18.2.0",
50-
"sequential-workflow-designer": "^0.24.2"
50+
"sequential-workflow-designer": "^0.24.3"
5151
},
5252
"devDependencies": {
5353
"@rollup/plugin-node-resolve": "^15.0.1",
@@ -63,7 +63,7 @@
6363
"prettier": "^3.2.5",
6464
"react": "^18.2.0",
6565
"react-dom": "^18.2.0",
66-
"sequential-workflow-designer": "^0.24.2",
66+
"sequential-workflow-designer": "^0.24.3",
6767
"rollup": "^3.18.0",
6868
"rollup-plugin-dts": "^5.2.0",
6969
"rollup-plugin-typescript2": "^0.34.1",

svelte/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sequential-workflow-designer-svelte",
33
"description": "Svelte wrapper for Sequential Workflow Designer component.",
4-
"version": "0.24.2",
4+
"version": "0.24.3",
55
"license": "MIT",
66
"scripts": {
77
"prepare": "cp ../LICENSE LICENSE",
@@ -28,10 +28,10 @@
2828
],
2929
"peerDependencies": {
3030
"svelte": "^4.0.0",
31-
"sequential-workflow-designer": "^0.24.2"
31+
"sequential-workflow-designer": "^0.24.3"
3232
},
3333
"devDependencies": {
34-
"sequential-workflow-designer": "^0.24.2",
34+
"sequential-workflow-designer": "^0.24.3",
3535
"@sveltejs/adapter-static": "^2.0.3",
3636
"@sveltejs/kit": "^1.20.4",
3737
"@sveltejs/package": "^2.0.0",

0 commit comments

Comments
 (0)