|
4 | 4 |
|
5 | 5 | [](https://actions-badge.atrox.dev/b4rtaz/sequential-workflow-designer/goto?ref=main) [](/LICENSE) [](https://npmjs.org/package/sequential-workflow-designer)
|
6 | 6 |
|
7 |
| -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. |
| 7 | +Sequential workflow designer with 0 external 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. |
8 | 8 |
|
9 | 9 | Features:
|
10 | 10 |
|
11 |
| -* no dependencies, |
| 11 | +* 0 external dependencies, |
12 | 12 | * full generic & configurable,
|
13 | 13 | * light/dark themes,
|
14 | 14 | * works on modern browsers,
|
15 | 15 | * works on mobile,
|
16 | 16 | * the definition is stored as JSON,
|
17 | 17 | * has support for [React](./react/) and [Angular](./angular/designer/).
|
18 | 18 |
|
| 19 | +📝 Check the [documentation](https://nocode-js.com/docs/category/sequential-workflow-designer) for more details. |
| 20 | + |
19 | 21 | 🤩 Don't miss [the pro version](https://github.com/nocode-js/sequential-workflow-designer-pro-demo).
|
20 | 22 |
|
21 | 23 | ## 👀 Examples
|
|
38 | 40 | * [📁 Folders](https://nocode-js.github.io/sequential-workflow-designer-pro-demo/examples/webpack/public/folders.html)
|
39 | 41 | * [⭕ Wheel Mode](https://nocode-js.github.io/sequential-workflow-designer-pro-demo/examples/webpack/public/wheel-mode.html)
|
40 | 42 |
|
| 43 | +## 👩💻 Integrations |
| 44 | + |
| 45 | +* [🚚 Sequential Workflow Machine](https://github.com/nocode-js/sequential-workflow-machine) - JavaScript workflow engine, powered by the xstate library. |
| 46 | + |
41 | 47 | ## 🚀 Installation
|
42 | 48 |
|
43 | 49 | To use the designer you should add JS/TS files and CSS files to your project.
|
@@ -76,10 +82,10 @@ Add the below code to your head section in HTML document.
|
76 | 82 | ```html
|
77 | 83 | <head>
|
78 | 84 | ...
|
79 |
| -<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/css/designer.css" rel="stylesheet"> |
80 |
| -<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/css/designer-light.css" rel="stylesheet"> |
81 |
| -<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/css/designer-dark.css" rel="stylesheet"> |
82 |
| -<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.7.0/dist/index.umd.js"></script> |
| 85 | +<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.8.0/css/designer.css" rel="stylesheet"> |
| 86 | +<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.8.0/css/designer-light.css" rel="stylesheet"> |
| 87 | +<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.8.0/css/designer-dark.css" rel="stylesheet"> |
| 88 | +<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.8.0/dist/index.umd.js"></script> |
83 | 89 | ```
|
84 | 90 |
|
85 | 91 | Call the designer by:
|
@@ -179,113 +185,6 @@ designer.onDefinitionChanged.subscribe((newDefinition) => {
|
179 | 185 | });
|
180 | 186 | ```
|
181 | 187 |
|
182 |
| -### 📝 Editors |
183 |
| - |
184 |
| -The designer doesn't provide editors for steps. Why? Because this part usually is strongly dependent on a project type. So you must create editors by your own and set them in the start configuration. |
185 |
| - |
186 |
| -The designer supports two types of editors. |
187 |
| - |
188 |
| -* Global editor - it appears when no step is selected. This editor should configure a global settings of your definition. You should set your configuration to the `definition.properties` object. |
189 |
| -* Step editor - it appears when some step is selected. This editor can change the step's name (`step.name`) and step's property values (`step.properties`). Also, it can change children, but you must be careful and don't mix responsibilities. |
190 |
| - |
191 |
| -You need to notify the designer when your editor changes the definition. To do it you need to call one of the editor context methods. |
192 |
| - |
193 |
| -```js |
194 |
| -const editorsConfiguration = { |
195 |
| - globalEditorProvider: (definition, globalContext) => { |
196 |
| - // ... |
197 |
| - input.addEventListener('changed', () => { |
198 |
| - definition.properties['a'] = newA; |
199 |
| - globalContext.notifyPropertiesChanged(); |
200 |
| - }); |
201 |
| - // ... |
202 |
| - }, |
203 |
| - |
204 |
| - stepEditorProvider: (step, stepContext) => { |
205 |
| - // ... |
206 |
| - input.addEventListener('changed', () => { |
207 |
| - step.name = newName; |
208 |
| - stepContext.notifyNameChanged(); |
209 |
| - |
210 |
| - step.properties['x'] = newX; |
211 |
| - stepContext.notifyPropertiesChanged(); |
212 |
| - |
213 |
| - step.branches['newBranch'] = []; |
214 |
| - stepContext.notifyChildrenChanged(); |
215 |
| - }); |
216 |
| - // ... |
217 |
| - } |
218 |
| -} |
219 |
| -``` |
220 |
| - |
221 |
| -## 🚧 Supported Components |
222 |
| - |
223 |
| -### Task |
224 |
| - |
225 |
| -Any atomic task. |
226 |
| - |
227 |
| -```js |
228 |
| -const taskStep = { |
229 |
| - componentType: 'task', |
230 |
| - id: 'my-unique-id', |
231 |
| - type: 'my-type', // e.g. 'save-file', 'send-email', ... |
232 |
| - name: 'my-name', |
233 |
| - properties: { |
234 |
| - 'myProperty': 'my-value', |
235 |
| - // ... |
236 |
| - } |
237 |
| -}; |
238 |
| -``` |
239 |
| - |
240 |
| -### Container |
241 |
| - |
242 |
| -This component is mainly designed for `for/while/foreach` loops. It could be used as a context container too. |
243 |
| - |
244 |
| -```ts |
245 |
| -const containerStep = { |
246 |
| - componentType: 'container', |
247 |
| - id: 'my-unique-id', |
248 |
| - type: 'my-type', // e.g. 'for', 'while', 'foreach'... |
249 |
| - name: 'my-name', |
250 |
| - properties: { |
251 |
| - 'myProperty': 'my-value', |
252 |
| - // ... |
253 |
| - }, |
254 |
| - sequence: [ |
255 |
| - // steps... |
256 |
| - ] |
257 |
| -}; |
258 |
| -``` |
259 |
| - |
260 |
| -### Switch |
261 |
| - |
262 |
| -This component is designed for `if/else` expressions, but you may use it for `switch/case` expressions too. This component must have minimum 2 branches. |
263 |
| - |
264 |
| -```js |
265 |
| -const switchStep = { |
266 |
| - componentType: 'switch', |
267 |
| - id: 'my-unique-id', |
268 |
| - type: 'my-type', // e.g. 'if', 'switch'... |
269 |
| - name: 'my-name', |
270 |
| - properties: { |
271 |
| - 'myProperty': 'my-value', |
272 |
| - // ... |
273 |
| - }, |
274 |
| - branches: { |
275 |
| - 'true': [ |
276 |
| - // steps... |
277 |
| - ], |
278 |
| - 'false': [ |
279 |
| - // steps... |
280 |
| - ], |
281 |
| - // ... |
282 |
| - 'next': [ |
283 |
| - // steps... |
284 |
| - ] |
285 |
| - } |
286 |
| -}; |
287 |
| -``` |
288 |
| - |
289 | 188 | ## 💡 License
|
290 | 189 |
|
291 | 190 | This project is released under the MIT license.
|
0 commit comments