@object-ui/plugin-workflow 2.0.0 β 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -0
- package/package.json +11 -11
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# @object-ui/plugin-workflow
|
|
2
|
+
|
|
3
|
+
Workflow and approval components for Object UI β visual workflow designer and approval process handler.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- π **Workflow Designer** - Visual workflow builder with drag-and-drop nodes and edges
|
|
8
|
+
- β
**Approval Process** - Multi-step approval handling with history and comments
|
|
9
|
+
- πΊοΈ **Minimap** - Overview minimap for complex workflows
|
|
10
|
+
- π οΈ **Toolbar** - Built-in toolbar for node creation and editing
|
|
11
|
+
- π **Approval History** - View full approval chain and decision history
|
|
12
|
+
- π¬ **Comments** - Add comments to approval steps
|
|
13
|
+
- π¦ **Auto-registered** - Components register with `ComponentRegistry` on import
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @object-ui/plugin-workflow
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Peer Dependencies:**
|
|
22
|
+
- `react` ^18.0.0 || ^19.0.0
|
|
23
|
+
- `react-dom` ^18.0.0 || ^19.0.0
|
|
24
|
+
- `@object-ui/core`
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { WorkflowDesigner, ApprovalProcess } from '@object-ui/plugin-workflow';
|
|
30
|
+
|
|
31
|
+
function WorkflowEditor() {
|
|
32
|
+
return (
|
|
33
|
+
<WorkflowDesigner
|
|
34
|
+
workflow={workflowDefinition}
|
|
35
|
+
showToolbar
|
|
36
|
+
showMinimap
|
|
37
|
+
readOnly={false}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function ApprovalView() {
|
|
43
|
+
return (
|
|
44
|
+
<ApprovalProcess
|
|
45
|
+
workflowId="wf-001"
|
|
46
|
+
instanceId="inst-001"
|
|
47
|
+
currentNodeId="review-step"
|
|
48
|
+
showHistory
|
|
49
|
+
showComments
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## API
|
|
56
|
+
|
|
57
|
+
### WorkflowDesigner
|
|
58
|
+
|
|
59
|
+
Visual workflow builder with nodes, edges, and conditions:
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<WorkflowDesigner
|
|
63
|
+
workflow={workflowDefinition}
|
|
64
|
+
readOnly={false}
|
|
65
|
+
showToolbar
|
|
66
|
+
showMinimap={false}
|
|
67
|
+
/>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### ApprovalProcess
|
|
71
|
+
|
|
72
|
+
Approval process handler with history and actions:
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
<ApprovalProcess
|
|
76
|
+
workflowId="wf-001"
|
|
77
|
+
instanceId="inst-001"
|
|
78
|
+
currentNodeId="manager-approval"
|
|
79
|
+
approvalRule={approvalRuleConfig}
|
|
80
|
+
history={approvalHistory}
|
|
81
|
+
showHistory
|
|
82
|
+
showComments
|
|
83
|
+
/>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Schema-Driven Usage
|
|
87
|
+
|
|
88
|
+
Components auto-register with `ComponentRegistry`:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"type": "workflow-designer",
|
|
93
|
+
"workflow": { "nodes": [], "edges": [] },
|
|
94
|
+
"showToolbar": true,
|
|
95
|
+
"showMinimap": false
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"type": "approval-process",
|
|
102
|
+
"workflowId": "wf-001",
|
|
103
|
+
"instanceId": "inst-001",
|
|
104
|
+
"currentNodeId": "review-step",
|
|
105
|
+
"showHistory": true,
|
|
106
|
+
"showComments": true
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-workflow",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.umd.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,21 +18,21 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "^18.0.0 || ^19.0.0",
|
|
20
20
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
21
|
-
"@object-ui/
|
|
22
|
-
"@object-ui/
|
|
23
|
-
"@object-ui/
|
|
24
|
-
"@object-ui/
|
|
21
|
+
"@object-ui/components": "3.0.0",
|
|
22
|
+
"@object-ui/core": "3.0.0",
|
|
23
|
+
"@object-ui/react": "3.0.0",
|
|
24
|
+
"@object-ui/types": "3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"clsx": "^2.1.
|
|
27
|
+
"clsx": "^2.1.1",
|
|
28
28
|
"lucide-react": "^0.344.0",
|
|
29
|
-
"tailwind-merge": "^2.
|
|
29
|
+
"tailwind-merge": "^2.6.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^25.2.
|
|
33
|
-
"@types/react": "
|
|
34
|
-
"@types/react-dom": "
|
|
35
|
-
"@vitejs/plugin-react": "^5.1.
|
|
32
|
+
"@types/node": "^25.2.3",
|
|
33
|
+
"@types/react": "19.2.13",
|
|
34
|
+
"@types/react-dom": "19.2.3",
|
|
35
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
36
36
|
"vite": "^7.3.1",
|
|
37
37
|
"vite-plugin-dts": "^4.5.4",
|
|
38
38
|
"vitest": "^4.0.18"
|