Skip to content

Commit ee9035f

Browse files
authored
0.11.1. (#27)
1 parent 6764267 commit ee9035f

16 files changed

+294
-61
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.11.1
2+
3+
This version improves support for UMD bundles.
4+
15
## 0.11.0
26

37
This version normalizes names of functions in `ValueContext` and `PropertyValidatorContext` classes.

demos/vanilla-js-app/umd-example.html

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>🚢 UMD Example - Sequential Workflow Editor</title>
6+
<style>
7+
body {
8+
font: 14px/1.5 Arial, Tahoma, Serif;
9+
}
10+
a {
11+
color: blue;
12+
text-decoration: underline;
13+
}
14+
a:hover {
15+
text-decoration: none;
16+
}
17+
#placeholder {
18+
display: block;
19+
border: 1px solid #ccc;
20+
padding: 10px;
21+
}
22+
</style>
23+
24+
<script src="../../model/dist/index.umd.js"></script>
25+
<script src="../../editor/dist/index.umd.js"></script>
26+
</head>
27+
<body>
28+
<h1>🚢 UMD Example - Sequential Workflow Editor</h1>
29+
30+
<p>
31+
This demo shows basic usage of
32+
<a href="https://github.com/nocode-js/sequential-workflow-editor" target="_blank">Sequential Workflow Editor</a>
33+
in a browser using UMD bundles.
34+
</p>
35+
36+
<div id="placeholder"></div>
37+
38+
<script>
39+
const fooModel = sequentialWorkflowEditorModel.createStepModel('foo', 'task', step => {
40+
step.property('isEnabled').value(sequentialWorkflowEditorModel.createBooleanValueModel({}));
41+
});
42+
43+
const definitionModel = sequentialWorkflowEditorModel.createDefinitionModel(model => {
44+
model.valueTypes(['string']);
45+
model.root(() => {});
46+
model.steps([fooModel]);
47+
});
48+
49+
const editorProvider = sequentialWorkflowEditor.EditorProvider.create(definitionModel, {
50+
uidGenerator: () => String(Math.random())
51+
});
52+
53+
const step = {
54+
id: '0x1',
55+
name: 'test',
56+
type: 'foo',
57+
componentType: 'task',
58+
properties: { isEnabled: true }
59+
};
60+
const definition = {
61+
properties: {},
62+
sequence: [step]
63+
};
64+
65+
const placeholder = document.getElementById('placeholder');
66+
const context = {
67+
notifyPropertiesChanged() {},
68+
notifyNameChanged() {}
69+
};
70+
const editor = editorProvider.createStepEditorProvider()(step, context, definition);
71+
placeholder.appendChild(editor);
72+
</script>
73+
</body>
74+
</html>

demos/webpack-app/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
"sequential-workflow-model": "^0.2.0",
1919
"sequential-workflow-designer": "^0.17.0",
2020
"sequential-workflow-machine": "^0.4.0",
21-
"sequential-workflow-editor-model": "^0.11.0",
22-
"sequential-workflow-editor": "^0.11.0"
21+
"sequential-workflow-editor-model": "^0.11.1",
22+
"sequential-workflow-editor": "^0.11.1"
2323
},
2424
"devDependencies": {
2525
"ts-loader": "^9.4.2",
2626
"style-loader": "^3.3.1",
2727
"css-loader": "^6.7.3",
28-
"typescript": "^4.9.4",
28+
"typescript": "^4.9.5",
2929
"webpack": "^5.75.0",
3030
"webpack-cli": "^5.0.1",
3131
"prettier": "^2.8.7",
3232
"@typescript-eslint/eslint-plugin": "^5.47.0",
3333
"@typescript-eslint/parser": "^5.47.0",
3434
"eslint": "^8.30.0"
3535
}
36-
}
36+
}

editor/css/editor.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@
139139
padding: 8px;
140140
border-radius: 5px;
141141
cursor: pointer;
142-
transition: border-color 150ms, background 150ms;
142+
transition:
143+
border-color 150ms,
144+
background 150ms;
143145
}
144146
.swe-button:hover {
145147
background: #e5e5e5;

editor/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sequential-workflow-editor",
3-
"version": "0.11.0",
3+
"version": "0.11.1",
44
"type": "module",
55
"main": "./lib/esm/index.js",
66
"types": "./lib/index.d.ts",
@@ -46,20 +46,20 @@
4646
"prettier:fix": "prettier --write ./src ./css"
4747
},
4848
"dependencies": {
49-
"sequential-workflow-editor-model": "^0.11.0",
49+
"sequential-workflow-editor-model": "^0.11.1",
5050
"sequential-workflow-model": "^0.2.0"
5151
},
5252
"peerDependencies": {
53-
"sequential-workflow-editor-model": "^0.11.0",
53+
"sequential-workflow-editor-model": "^0.11.1",
5454
"sequential-workflow-model": "^0.2.0"
5555
},
5656
"devDependencies": {
57-
"rollup": "^3.20.2",
58-
"rollup-plugin-dts": "^5.3.0",
59-
"rollup-plugin-typescript2": "^0.34.1",
60-
"@rollup/plugin-node-resolve": "^15.0.2",
61-
"typescript": "^4.9.4",
62-
"prettier": "^2.8.7",
57+
"rollup": "^4.4.0",
58+
"rollup-plugin-dts": "^6.1.0",
59+
"rollup-plugin-typescript2": "^0.36.0",
60+
"@rollup/plugin-node-resolve": "^15.2.3",
61+
"typescript": "^4.9.5",
62+
"prettier": "^3.1.0",
6363
"@typescript-eslint/eslint-plugin": "^5.47.0",
6464
"@typescript-eslint/parser": "^5.47.0",
6565
"eslint": "^8.30.0",
@@ -79,4 +79,4 @@
7979
"lowcode",
8080
"flow"
8181
]
82-
}
82+
}

editor/rollup.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export default [
4545
}),
4646
ts
4747
],
48+
external: [
49+
'sequential-workflow-editor-model'
50+
],
4851
output: [
4952
{
5053
file: './dist/index.umd.js',

model/package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sequential-workflow-editor-model",
3-
"version": "0.11.0",
3+
"version": "0.11.1",
44
"homepage": "https://nocode-js.com/",
55
"author": {
66
"name": "NoCode JS",
@@ -28,7 +28,8 @@
2828
"url": "https://github.com/nocode-js/sequential-workflow-editor.git"
2929
},
3030
"files": [
31-
"lib/"
31+
"lib/",
32+
"dist/"
3233
],
3334
"publishConfig": {
3435
"registry": "https://registry.npmjs.org/"
@@ -51,11 +52,12 @@
5152
"sequential-workflow-model": "^0.2.0"
5253
},
5354
"devDependencies": {
55+
"rollup": "^4.4.0",
56+
"rollup-plugin-dts": "^6.1.0",
57+
"rollup-plugin-typescript2": "^0.36.0",
58+
"@rollup/plugin-node-resolve": "^15.2.3",
5459
"typescript": "^4.9.5",
55-
"rollup-plugin-dts": "^5.2.0",
56-
"rollup-plugin-typescript2": "^0.34.1",
57-
"rollup": "^3.18.0",
58-
"prettier": "^2.8.7",
60+
"prettier": "^3.1.0",
5961
"@typescript-eslint/eslint-plugin": "^5.47.0",
6062
"@typescript-eslint/parser": "^5.47.0",
6163
"eslint": "^8.30.0",
@@ -70,4 +72,4 @@
7072
"lowcode",
7173
"flow"
7274
]
73-
}
75+
}

model/rollup.config.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import dts from 'rollup-plugin-dts';
22
import typescript from 'rollup-plugin-typescript2';
3+
import { nodeResolve } from '@rollup/plugin-node-resolve';
34
import fs from 'fs';
45

56
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
67
const external = Object.keys(packageJson.dependencies);
78

9+
const ts = typescript({
10+
useTsconfigDeclarationDir: true
11+
});
12+
813
export default [
914
{
1015
input: './src/index.ts',
@@ -35,5 +40,21 @@ export default [
3540
}
3641
],
3742
plugins: [dts()],
43+
},
44+
{
45+
input: './src/index.ts',
46+
plugins: [
47+
nodeResolve({
48+
browser: true,
49+
}),
50+
ts
51+
],
52+
output: [
53+
{
54+
file: './dist/index.umd.js',
55+
format: 'umd',
56+
name: 'sequentialWorkflowEditorModel'
57+
}
58+
]
3859
}
3960
];

model/src/activator/model-activator.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ export class ModelActivator<TDefinition extends Definition = Definition> {
1212
return new ModelActivator(definitionModel, uidGenerator);
1313
}
1414

15-
private constructor(private readonly definitionModel: DefinitionModel, private readonly uidGenerator: UidGenerator) {}
15+
private constructor(
16+
private readonly definitionModel: DefinitionModel,
17+
private readonly uidGenerator: UidGenerator
18+
) {}
1619

1720
public readonly activateDefinition = (): TDefinition => {
1821
const definition: Omit<Definition, 'sequence'> = {

model/src/builders/property-model-builder.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export class PropertyModelBuilder<TValue extends PropertyValue = PropertyValue,
1111
private _dependencies: Path[] = [];
1212
private _validator?: PropertyValidator;
1313

14-
public constructor(private readonly path: Path, private readonly circularDependencyDetector: CircularDependencyDetector) {}
14+
public constructor(
15+
private readonly path: Path,
16+
private readonly circularDependencyDetector: CircularDependencyDetector
17+
) {}
1518

1619
/**
1720
* @returns `true` if the model of the value is set, otherwise `false`.

0 commit comments

Comments
 (0)