Skip to content

Commit

Permalink
0.19.4. (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
b4rtaz authored Apr 30, 2024
1 parent 220f1a1 commit 286a0a3
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 38 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.19.4

This version adds the data-step-id attribute to the root `<g>` elements of step components on the canvas. This attribute contains the ID of the step, enabling the use of CSS selectors to style step components [#135](https://github.com/nocode-js/sequential-workflow-designer/issues/135).

## 0.19.3

This version improves the experience of scrolling in the toolbox via the touchpad.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ Add the below code to your head section in HTML document.
```html
<head>
...
<link href="https://cdn.jsdelivr.net/npm/[email protected].3/css/designer.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].3/css/designer-light.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].3/css/designer-dark.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/index.umd.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected].4/css/designer.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].4/css/designer-light.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected].4/css/designer-dark.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected].4/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.3",
"version": "0.19.4",
"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.3"
"sequential-workflow-designer": "^0.19.4"
},
"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.3",
"sequential-workflow-designer-angular": "^0.19.3",
"sequential-workflow-designer": "^0.19.4",
"sequential-workflow-designer-angular": "^0.19.4",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
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 @@ -5956,17 +5956,17 @@ [email protected]:
range-parser "~1.2.1"
statuses "2.0.1"

sequential-workflow-designer-angular@^0.19.3:
version "0.19.3"
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.19.3.tgz#5b69f09f5d600034202ec04c42f473eb2be34841"
integrity sha512-H7J+Vr923SeNvnG8Uxup3Hu+lSjNodMZEILoum+uVTZP3xUZyETd4bprd5MdEE6/wlUai8cLOk69+QojQAuqUQ==
sequential-workflow-designer-angular@^0.19.4:
version "0.19.4"
resolved "https://registry.yarnpkg.com/sequential-workflow-designer-angular/-/sequential-workflow-designer-angular-0.19.4.tgz#80449ac17015cd2e58a7b8b0b5169f3148083c88"
integrity sha512-svUfsbISuYe5CEAjuu3Z3IyjoOvvWI0ADP1KrNf9UpHWD+QXCX/yvviUJfDvMGY5YtniI3ylkNfDjUBPPXnm4A==
dependencies:
tslib "^2.3.0"

sequential-workflow-designer@^0.19.3:
version "0.19.3"
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.19.3.tgz#967967f5772e6cbd592def584e6ba78331a837bc"
integrity sha512-lDDclYAsbg8DXfVa4ZiFnCmnvbgO1A7bey2TO2Q6DfmiVqqQ8VhsDEpMXcSxT72O3nkQxn1YDVG2XZzpJBTxyA==
sequential-workflow-designer@^0.19.4:
version "0.19.4"
resolved "https://registry.yarnpkg.com/sequential-workflow-designer/-/sequential-workflow-designer-0.19.4.tgz#1ef69541e17c3daaf1e06d3c7984771e14f9b2c0"
integrity sha512-pCv27HahJajaiyJo7UUd4qkXyH0OtauGFpPksorGWr+EzoYEtcMsR/53x+1t+e6qZ4++FboGLQ85+63+XIGBvg==
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.19.3",
"sequential-workflow-designer-react": "^0.19.3"
"sequential-workflow-designer": "^0.19.4",
"sequential-workflow-designer-react": "^0.19.4"
},
"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.3",
"sequential-workflow-designer-svelte": "^0.19.3"
"sequential-workflow-designer": "^0.19.4",
"sequential-workflow-designer-svelte": "^0.19.4"
},
"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.3",
"version": "0.19.4",
"type": "module",
"main": "./lib/esm/index.js",
"types": "./lib/index.d.ts",
Expand Down
11 changes: 11 additions & 0 deletions designer/src/workspace/common-views/component-dom.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ComponentDom } from './component-dom';

describe('ComponentDom', () => {
it('stepG() creates <g> element', () => {
const view = ComponentDom.stepG('container', 'foreach', 'some-id');

expect(view.tagName.toLowerCase()).toBe('g');
expect(view.getAttribute('class')).toBe('sqd-step-container sqd-type-foreach');
expect(view.getAttribute('data-step-id')).toBe('some-id');
});
});
10 changes: 10 additions & 0 deletions designer/src/workspace/common-views/component-dom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Dom } from '../../core';

export class ComponentDom {
public static stepG(componentClassName: string, type: string, id: string): SVGGElement {
return Dom.svg('g', {
class: `sqd-step-${componentClassName} sqd-type-${type}`,
'data-step-id': id
});
}
}
2 changes: 1 addition & 1 deletion designer/src/workspace/common-views/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './component-dom';
export * from './input-view';
export * from './join-view';
export * from './label-view';
export * from './output-view';
export * from './region-view';
export * from '../placeholder/rect-placeholder-view';
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import { LabelView } from '../common-views/label-view';
import { RegionView } from '../common-views/region-view';
import { StepComponentViewContext, StepComponentViewFactory, StepContext } from '../../designer-extension';
import { ContainerStepComponentViewConfiguration } from './container-step-component-view-configuration';
import { ComponentDom } from '../common-views/component-dom';

export const createContainerStepComponentViewFactory =
(cfg: ContainerStepComponentViewConfiguration): StepComponentViewFactory =>
(parentElement: SVGElement, stepContext: StepContext<SequentialStep>, viewContext: StepComponentViewContext): StepComponentView => {
const { step } = stepContext;
const g = Dom.svg('g', {
class: `sqd-step-container sqd-type-${step.type}`
});
const g = ComponentDom.stepG('container', step.type, step.id);
parentElement.appendChild(g);

const labelView = LabelView.create(g, cfg.paddingTop, cfg.label, step.name, 'primary');
Expand Down
1 change: 1 addition & 0 deletions designer/src/workspace/placeholder/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './rect-placeholder';
export * from './rect-placeholder-view';
export * from './rect-placeholder-configuration';
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import { InputView } from '../common-views/input-view';
import { ClickDetails, StepComponentView } from '../component';
import { StepComponentViewContext, StepComponentViewFactory, StepContext } from '../../designer-extension';
import { SwitchStepComponentViewConfiguration } from './switch-step-component-view-configuration';
import { ComponentDom } from '../common-views/component-dom';

export const createSwitchStepComponentViewFactory =
(cfg: SwitchStepComponentViewConfiguration): StepComponentViewFactory =>
(parent: SVGElement, stepContext: StepContext<BranchedStep>, viewContext: StepComponentViewContext): StepComponentView => {
const { step } = stepContext;
const g = Dom.svg('g', {
class: `sqd-step-switch sqd-type-${step.type}`
});
const g = ComponentDom.stepG('switch', step.type, step.id);
parent.appendChild(g);

const branchNames = Object.keys(step.branches);
Expand Down
5 changes: 2 additions & 3 deletions designer/src/workspace/task-step/task-step-component-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getAbsolutePosition } from '../../core/get-absolute-position';
import { Vector } from '../../core/vector';
import { Step } from '../../definition';
import { StepComponentViewContext, StepComponentViewFactory, StepContext } from '../../designer-extension';
import { ComponentDom } from '../common-views/component-dom';
import { InputView } from '../common-views/input-view';
import { OutputView } from '../common-views/output-view';
import { ClickDetails, StepComponentView } from '../component';
Expand All @@ -12,9 +13,7 @@ export const createTaskStepComponentViewFactory =
(isInterrupted: boolean, cfg: TaskStepComponentViewConfiguration): StepComponentViewFactory =>
(parentElement: SVGElement, stepContext: StepContext<Step>, viewContext: StepComponentViewContext): StepComponentView => {
const { step } = stepContext;
const g = Dom.svg('g', {
class: `sqd-step-task sqd-type-${step.type}`
});
const g = ComponentDom.stepG('task', step.type, step.id);
parentElement.appendChild(g);

const boxHeight = cfg.paddingY * 2 + cfg.iconSize;
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].3';
: '//cdn.jsdelivr.net/npm/[email protected].4';

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.3",
"version": "0.19.4",
"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.3"
"sequential-workflow-designer": "^0.19.4"
},
"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.3",
"sequential-workflow-designer": "^0.19.4",
"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.3",
"version": "0.19.4",
"license": "MIT",
"scripts": {
"prepare": "cp ../LICENSE LICENSE",
Expand All @@ -28,10 +28,10 @@
],
"peerDependencies": {
"svelte": "^4.0.0",
"sequential-workflow-designer": "^0.19.3"
"sequential-workflow-designer": "^0.19.4"
},
"devDependencies": {
"sequential-workflow-designer": "^0.19.3",
"sequential-workflow-designer": "^0.19.4",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"@sveltejs/package": "^2.0.0",
Expand Down

0 comments on commit 286a0a3

Please sign in to comment.