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

This version fixes a bug in the calculation of the placeholder position when dragging a step component.

# 0.35.0

This version changes the behavior of the drag step component. The dragged component is now scaled according to the current zoom level of the designer [#206](https://github.com/nocode-js/sequential-workflow-designer/issues/206).
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,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.35.0",
"version": "0.35.1",
"author": {
"name": "NoCode JS",
"url": "https://nocode-js.com/"
Expand All @@ -15,7 +15,7 @@
"peerDependencies": {
"@angular/common": "12 - 19",
"@angular/core": "12 - 19",
"sequential-workflow-designer": "^0.35.0"
"sequential-workflow-designer": "^0.35.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": "^17.3.9",
"@angular/router": "^17.3.9",
"rxjs": "~7.8.0",
"sequential-workflow-designer": "^0.35.0",
"sequential-workflow-designer-angular": "^0.35.0",
"sequential-workflow-designer": "^0.35.1",
"sequential-workflow-designer-angular": "^0.35.1",
"tslib": "^2.3.0",
"zone.js": "~0.14.6"
},
Expand Down
16 changes: 8 additions & 8 deletions demos/angular-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6744,17 +6744,17 @@ [email protected]:
range-parser "~1.2.1"
statuses "2.0.1"

sequential-workflow-designer-angular@^0.35.0:
version "0.35.0"
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.35.0.tgz#52e266a88161f0d11d82ec6e97faf6804d2fcd82"
integrity sha512-tDj4Ccmga4j1Ujb7DVyZ6YLxa2VLylyHLbPb9erktdfL2ipR02FT6IbRZN9BR7ROpOqMjxSCMbWug3B3wjGzMg==
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==
dependencies:
tslib "^2.3.0"

sequential-workflow-designer@^0.35.0:
version "0.35.0"
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.35.0.tgz#1849d3c5134338138cee7dadb2e5e5c772fe7c74"
integrity sha512-AEHfvWhZL/DekiW5nO1f2IA9RWu8X6Rn6g7TLFG1yttvzKPMO3HGFUc7jpHOsCxYX8XLzJ7YO0Q33n8rHhUj5A==
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==
dependencies:
sequential-workflow-model "^0.2.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.35.0",
"sequential-workflow-designer-react": "^0.35.0"
"sequential-workflow-designer": "^0.35.1",
"sequential-workflow-designer-react": "^0.35.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.35.0",
"sequential-workflow-designer-svelte": "^0.35.0"
"sequential-workflow-designer": "^0.35.1",
"sequential-workflow-designer-svelte": "^0.35.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.35.0",
"version": "0.35.1",
"type": "module",
"main": "./lib/esm/index.js",
"types": "./lib/index.d.ts",
Expand Down
7 changes: 6 additions & 1 deletion designer/src/behaviors/drag-step-behavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ export class DragStepBehavior implements Behavior {
const newPosition = this.state.startPosition.subtract(delta).subtract(this.state.offset);
this.view.setPosition(newPosition);

const placeholder = this.state.finder.find(newPosition, this.view.component.width, this.view.component.height);
const placeholder = this.state.finder.find(
newPosition,
this.view.component.width,
this.view.component.height,
this.view.component.scale
);

if (this.currentPlaceholder !== placeholder) {
if (this.currentPlaceholder) {
Expand Down
6 changes: 3 additions & 3 deletions designer/src/behaviors/placeholder-finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class PlaceholderFinder {
private readonly state: DesignerState
) {}

public find(vLt: Vector, vWidth: number, vHeight: number): Placeholder | undefined {
public find(vLt: Vector, vWidth: number, vHeight: number, vScale: number): Placeholder | undefined {
if (!this.cache) {
const scroll = new Vector(window.scrollX, window.scrollY);

Expand All @@ -39,8 +39,8 @@ export class PlaceholderFinder {
});
this.cache.sort((a, b) => a.diagSq - b.diagSq);
}
const vR = vLt.x + vWidth;
const vB = vLt.y + vHeight;
const vR = vLt.x + vWidth * vScale;
const vB = vLt.y + vHeight * vScale;
return this.cache.find(p => {
return Math.max(vLt.x, p.lt.x) < Math.min(vR, p.br.x) && Math.max(vLt.y, p.lt.y) < Math.min(vB, p.br.y);
})?.placeholder;
Expand Down
2 changes: 1 addition & 1 deletion examples/assets/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function embedStylesheet(url) {
document.write(`<link href="${url}" rel="stylesheet">`);
}

const baseUrl = isTestEnv() ? '../designer' : '//cdn.jsdelivr.net/npm/[email protected].0';
const baseUrl = isTestEnv() ? '../designer' : '//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.35.0",
"version": "0.35.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.35.0"
"sequential-workflow-designer": "^0.35.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^16.0.1",
Expand All @@ -63,7 +63,7 @@
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sequential-workflow-designer": "^0.35.0",
"sequential-workflow-designer": "^0.35.1",
"rollup": "^4.40.0",
"rollup-plugin-dts": "^6.2.1",
"rollup-plugin-typescript2": "^0.36.0",
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.35.0",
"version": "0.35.1",
"license": "MIT",
"scripts": {
"prepare": "cp ../LICENSE LICENSE",
Expand All @@ -28,10 +28,10 @@
],
"peerDependencies": {
"svelte": "^4.0.0",
"sequential-workflow-designer": "^0.35.0"
"sequential-workflow-designer": "^0.35.1"
},
"devDependencies": {
"sequential-workflow-designer": "^0.35.0",
"sequential-workflow-designer": "^0.35.1",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"@sveltejs/package": "^2.0.0",
Expand Down