@hrspd-gss/bole-clickwizard-designer 1.0.1
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/dist/WorkflowEditor.d.ts +7 -0
- package/dist/bole-clickwizard-designer.css +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/index.mjs +1221 -0
- package/dist/types.d.ts +91 -0
- package/package.json +38 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export interface Variable {
|
|
2
|
+
name: string;
|
|
3
|
+
type: 'string' | 'number' | 'boolean' | 'object';
|
|
4
|
+
value?: any;
|
|
5
|
+
}
|
|
6
|
+
export type CoreNodeType = 'start' | 'end';
|
|
7
|
+
export type NodeType = CoreNodeType | string;
|
|
8
|
+
export interface NodePosition {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
export interface NodeTypeConfig {
|
|
13
|
+
type: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
defaultParameters: Record<string, any>;
|
|
16
|
+
renderProperties?: (parameters: Record<string, any>, onChange: (field: string, value: any) => void) => React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface BaseNode {
|
|
19
|
+
id: string;
|
|
20
|
+
type: NodeType;
|
|
21
|
+
name: string;
|
|
22
|
+
position: NodePosition;
|
|
23
|
+
inputs?: Variable[];
|
|
24
|
+
outputs?: Variable[];
|
|
25
|
+
}
|
|
26
|
+
export type StartNodeInputData = Record<string, any> | Record<string, any>[];
|
|
27
|
+
export interface StartNodeParameters {
|
|
28
|
+
inputData?: StartNodeInputData;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
export interface EndNodeParameters {
|
|
32
|
+
autoCloseTab?: boolean;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export interface ScriptNodeParameters {
|
|
36
|
+
script?: string;
|
|
37
|
+
outputVariable?: string;
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
40
|
+
export interface SandboxScriptNodeParameters {
|
|
41
|
+
script?: string;
|
|
42
|
+
outputVariable?: string;
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}
|
|
45
|
+
export type Node = BaseNode & ({
|
|
46
|
+
type: 'start';
|
|
47
|
+
parameters?: StartNodeParameters;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'end';
|
|
50
|
+
parameters?: EndNodeParameters;
|
|
51
|
+
} | {
|
|
52
|
+
type: 'script';
|
|
53
|
+
parameters?: ScriptNodeParameters;
|
|
54
|
+
} | {
|
|
55
|
+
type: 'sandboxScript';
|
|
56
|
+
parameters?: SandboxScriptNodeParameters;
|
|
57
|
+
} | {
|
|
58
|
+
type: string;
|
|
59
|
+
parameters?: Record<string, any>;
|
|
60
|
+
});
|
|
61
|
+
export interface ConditionValueSpec {
|
|
62
|
+
source: 'result' | 'variable' | 'nodeResult' | 'literal';
|
|
63
|
+
path?: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
nodeId?: string;
|
|
66
|
+
value?: any;
|
|
67
|
+
}
|
|
68
|
+
export interface EdgeCondition {
|
|
69
|
+
type: 'success' | 'failure' | 'compare' | 'expression' | 'none' | 'else';
|
|
70
|
+
left?: ConditionValueSpec | any;
|
|
71
|
+
right?: ConditionValueSpec | any;
|
|
72
|
+
operator?: '==' | '===' | '!=' | '!==' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'matches' | 'eq' | 'strictEq' | 'ne' | 'strictNe' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
73
|
+
expression?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface Edge {
|
|
76
|
+
id: string;
|
|
77
|
+
sourceNodeId: string;
|
|
78
|
+
targetNodeId: string;
|
|
79
|
+
condition?: EdgeCondition;
|
|
80
|
+
}
|
|
81
|
+
export interface Workflow {
|
|
82
|
+
nodes: Node[];
|
|
83
|
+
edges: Edge[];
|
|
84
|
+
globalVariables?: Variable[];
|
|
85
|
+
}
|
|
86
|
+
export interface WorkflowEditorProps {
|
|
87
|
+
initialWorkflow: Workflow;
|
|
88
|
+
onChange?: (workflow: Workflow) => void;
|
|
89
|
+
className?: string;
|
|
90
|
+
nodeTypeConfigs?: NodeTypeConfig[];
|
|
91
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hrspd-gss/bole-clickwizard-designer",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Workflow designer",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./dist/bole-clickwizard-designer.css": "./dist/bole-clickwizard-designer.css"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"build": "vite build",
|
|
23
|
+
"preview": "vite preview"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": ">=18.0.0",
|
|
27
|
+
"react-dom": ">=18.0.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^20.0.0",
|
|
31
|
+
"@types/react": "^18.2.0",
|
|
32
|
+
"@types/react-dom": "^18.2.0",
|
|
33
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
34
|
+
"typescript": "^5.3.0",
|
|
35
|
+
"vite": "^5.1.0",
|
|
36
|
+
"vite-plugin-dts": "^3.7.0"
|
|
37
|
+
}
|
|
38
|
+
}
|