Skip to content

Commit 392862b

Browse files
committed
readme.md.
1 parent dfd202b commit 392862b

File tree

1 file changed

+89
-3
lines changed

1 file changed

+89
-3
lines changed

README.md

Lines changed: 89 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
# Sequential Workflow Designer
44

5-
Sequential workflow designer with no dependencies.
5+
Sequential workflow designer with no dependencies for web. It's written in pure TypeScript and uses SVG for rendering. This designer is not associated with any workflow engine. It's full generic. You may create any kind application by this, from graphical programming languages to workflow designers.
66

7-
TODO
7+
Features:
8+
9+
* no dependencies,
10+
* full generic & configurable,
11+
* light/dark themes,
12+
* modern browsers support,
13+
* ~~mobile support~~ (TODO).
814

915
## 👀 Examples
1016

@@ -16,6 +22,8 @@ TODO
1622

1723
## 🚀 Installation
1824

25+
To use the designer you should add JS/TS files and CSS-files to your project.
26+
1927
### NPM
2028

2129
Install this package by [NPM](https://www.npmjs.com/) command:
@@ -36,6 +44,13 @@ import 'sequential-workflow-designer/css/designer-light.css';
3644
import 'sequential-workflow-designer/css/designer-dark.css';
3745
```
3846

47+
To create the designer write the below code:
48+
49+
```ts
50+
// ...
51+
Designer.create(placeholder, definition, configuration);
52+
```
53+
3954
### CDN
4055

4156
Add the below code to your head section in HTML document.
@@ -52,5 +67,76 @@ Add the below code to your head section in HTML document.
5267
Call the designer by:
5368

5469
```js
55-
sequentialWorkflowDesigner.create(...);
70+
sequentialWorkflowDesigner.create(placeholder, definition, configuration);
5671
```
72+
73+
## 🎬 Usage
74+
75+
Check [examples](/examples) directory.
76+
77+
```ts
78+
import Designer from 'sequential-workflow-designer';
79+
80+
const placeholder = document.getElementById('placeholder');
81+
82+
const definition = {
83+
properties: {
84+
// global properties
85+
},
86+
sequence: [
87+
// root steps
88+
]
89+
};
90+
91+
const configuration = {
92+
theme: 'light',
93+
isReadonly: false,
94+
95+
toolbox: {
96+
isHidden: false,
97+
groups: [
98+
{
99+
name: 'Files',
100+
steps: [
101+
// steps for the toolbox's group
102+
]
103+
},
104+
{
105+
name: 'Notification',
106+
steps: [
107+
// steps for the toolbox's group
108+
]
109+
}
110+
]
111+
},
112+
113+
steps: {
114+
iconUrlProvider: (componentType, type) => {
115+
return `icon-${componentType}-${type}.svg`;
116+
},
117+
validator: (step) => {
118+
return step.name.toLowerCase() === step.name;
119+
}
120+
},
121+
122+
editors: {
123+
isHidden: false,
124+
globalEditorProvider: (definition) => {
125+
const container = document.createElement('div');
126+
// ...
127+
return container;
128+
},
129+
stepEditorProvider: (step) => {
130+
const container = document.createElement('div');
131+
// ...
132+
return container;
133+
}
134+
}
135+
};
136+
137+
Designer.create(placeholder, definition, configuration);
138+
```
139+
140+
## 💡 License
141+
142+
This project is released under the MIT license.

0 commit comments

Comments
 (0)