anx-esop-engine 1.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 +66 -0
- package/dist/BpmnLayout-27HW6WAW.mjs +6 -0
- package/dist/chunk-ZM2PR2CO.mjs +179 -0
- package/dist/index.d.mts +233 -0
- package/dist/index.d.ts +233 -0
- package/dist/index.js +6703 -0
- package/dist/index.mjs +6502 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# convert-bpmn-to-react-flow
|
|
2
|
+
|
|
3
|
+
Convert BPMN XML to a React Flow friendly domain model and export it back to BPMN XML.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install convert-bpmn-to-react-flow
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import {
|
|
15
|
+
BpmnImporter,
|
|
16
|
+
BpmnExporter,
|
|
17
|
+
BpmnValidator,
|
|
18
|
+
type DomainWorkflow,
|
|
19
|
+
} from 'convert-bpmn-to-react-flow';
|
|
20
|
+
|
|
21
|
+
const workflow: DomainWorkflow = await BpmnImporter.importXml(xmlString);
|
|
22
|
+
|
|
23
|
+
const validation = BpmnValidator.validateWorkflow(workflow.nodes, workflow.edges);
|
|
24
|
+
|
|
25
|
+
const exportedXml = await BpmnExporter.exportToXml(workflow);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
- `BpmnImporter.importXml(xml: string): Promise<DomainWorkflow>`
|
|
31
|
+
- `BpmnExporter.exportToXml(workflow: DomainWorkflow): Promise<string>`
|
|
32
|
+
- `BpmnLayout.applyAutoLayout(nodes, edges, direction?)`
|
|
33
|
+
- `BpmnValidator.canConnect(source, target, connectionType)`
|
|
34
|
+
- `BpmnValidator.validateWorkflow(nodes, edges)`
|
|
35
|
+
- `REPLACE_OPTIONS`
|
|
36
|
+
|
|
37
|
+
## Publish Checklist
|
|
38
|
+
|
|
39
|
+
1. Update package name/version in package.json.
|
|
40
|
+
2. Ensure repository URL points to your GitHub repo.
|
|
41
|
+
3. Login with `npm login`.
|
|
42
|
+
4. Run `npm run publish:dry` to verify.
|
|
43
|
+
5. Run `npm run publish:ps1` to publish.
|
|
44
|
+
|
|
45
|
+
## PowerShell Publish Script
|
|
46
|
+
|
|
47
|
+
The project includes [scripts/publish.ps1](scripts/publish.ps1) with these options:
|
|
48
|
+
|
|
49
|
+
- `-DryRun`: publish dry-run
|
|
50
|
+
- `-Tag <tag>`: publish tag, default `latest`
|
|
51
|
+
- `-Access <public|restricted>`: npm access, default `public`
|
|
52
|
+
- `-Otp <code>`: OTP for 2FA publish
|
|
53
|
+
- `-SkipChecks`: skip `npm whoami`, build, and pack checks
|
|
54
|
+
|
|
55
|
+
Examples:
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
# Dry run with checks
|
|
59
|
+
powershell -ExecutionPolicy Bypass -File .\scripts\publish.ps1 -DryRun
|
|
60
|
+
|
|
61
|
+
# Real publish
|
|
62
|
+
powershell -ExecutionPolicy Bypass -File .\scripts\publish.ps1
|
|
63
|
+
|
|
64
|
+
# Publish with beta tag
|
|
65
|
+
powershell -ExecutionPolicy Bypass -File .\scripts\publish.ps1 -Tag beta
|
|
66
|
+
```
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __esm = (fn, res) => function __init() {
|
|
6
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
7
|
+
};
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/utils/bpmn/BpmnLayout.ts
|
|
23
|
+
var BpmnLayout = class {
|
|
24
|
+
/**
|
|
25
|
+
* Applies an automatic layout to nodes and edges using Dagre if available,
|
|
26
|
+
* otherwise falling back to a structured grid layout.
|
|
27
|
+
*/
|
|
28
|
+
static async applyAutoLayout(nodes, edges, direction = "LR") {
|
|
29
|
+
if (nodes.length === 0) return [];
|
|
30
|
+
try {
|
|
31
|
+
const dagre = (await import("@dagrejs/dagre")).default;
|
|
32
|
+
const g = new dagre.graphlib.Graph();
|
|
33
|
+
g.setGraph({ rankdir: direction, align: "UL", nodesep: 70, edgesep: 50, ranksep: 100 });
|
|
34
|
+
g.setDefaultEdgeLabel(() => ({}));
|
|
35
|
+
const getDims = (node) => {
|
|
36
|
+
if (node.isExpanded) {
|
|
37
|
+
if (node.type === "boundaryEvent" || node.type === "start" || node.type === "end" || node.type === "intermediateCatch" || node.type === "intermediateThrow") {
|
|
38
|
+
return { w: 96, h: 96 };
|
|
39
|
+
}
|
|
40
|
+
if (["subProcess", "eventSubProcess", "transaction", "adhocSubProcess"].includes(node.type)) {
|
|
41
|
+
return { w: 260, h: 140 };
|
|
42
|
+
}
|
|
43
|
+
return { w: 244, h: 120 };
|
|
44
|
+
} else {
|
|
45
|
+
if (["start", "end", "boundaryEvent", "intermediateCatch", "intermediateThrow"].includes(node.type)) return { w: 44, h: 44 };
|
|
46
|
+
if (["exclusiveGateway", "parallelGateway", "inclusiveGateway"].includes(node.type)) return { w: 48, h: 48 };
|
|
47
|
+
return { w: 100, h: 80 };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
nodes.forEach((node) => {
|
|
51
|
+
if (node.type === "pool" || node.type === "lane") return;
|
|
52
|
+
const { w, h } = getDims(node);
|
|
53
|
+
g.setNode(node.id, { width: w, height: h });
|
|
54
|
+
});
|
|
55
|
+
edges.forEach((edge) => {
|
|
56
|
+
if (edge.semantic === "control" && g.hasNode(edge.source) && g.hasNode(edge.target)) {
|
|
57
|
+
g.setEdge(edge.source, edge.target);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
dagre.layout(g);
|
|
61
|
+
let laidOutNodes = nodes.map((node) => {
|
|
62
|
+
if (node.type === "pool" || node.type === "lane") {
|
|
63
|
+
return { ...node };
|
|
64
|
+
}
|
|
65
|
+
const layoutNode = g.node(node.id);
|
|
66
|
+
if (layoutNode) {
|
|
67
|
+
const { w, h } = getDims(node);
|
|
68
|
+
return {
|
|
69
|
+
...node,
|
|
70
|
+
position: {
|
|
71
|
+
x: Math.round(layoutNode.x - w / 2),
|
|
72
|
+
y: Math.round(layoutNode.y - h / 2)
|
|
73
|
+
},
|
|
74
|
+
width: w,
|
|
75
|
+
height: h
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return { ...node };
|
|
79
|
+
});
|
|
80
|
+
const LANE_PADDING = 40;
|
|
81
|
+
const POOL_HEADER_W = 32;
|
|
82
|
+
laidOutNodes = laidOutNodes.map((node) => {
|
|
83
|
+
if (node.type !== "lane") return node;
|
|
84
|
+
const children = laidOutNodes.filter((n) => n.parentId === node.id);
|
|
85
|
+
if (children.length === 0) return node;
|
|
86
|
+
const minX = Math.min(...children.map((c) => c.position.x));
|
|
87
|
+
const maxX = Math.max(...children.map((c) => c.position.x + (c.width || 100)));
|
|
88
|
+
const minY = Math.min(...children.map((c) => c.position.y));
|
|
89
|
+
const maxY = Math.max(...children.map((c) => c.position.y + (c.height || 80)));
|
|
90
|
+
return {
|
|
91
|
+
...node,
|
|
92
|
+
position: { x: minX - LANE_PADDING, y: minY - LANE_PADDING },
|
|
93
|
+
width: maxX - minX + LANE_PADDING * 2,
|
|
94
|
+
height: maxY - minY + LANE_PADDING * 2
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
laidOutNodes = laidOutNodes.map((node) => {
|
|
98
|
+
if (node.type !== "pool") return node;
|
|
99
|
+
const lanes = laidOutNodes.filter((n) => n.parentId === node.id && n.type === "lane");
|
|
100
|
+
const directChildren = laidOutNodes.filter((n) => n.parentId === node.id && n.type !== "lane");
|
|
101
|
+
const candidates = lanes.length > 0 ? lanes : directChildren;
|
|
102
|
+
if (candidates.length === 0) return node;
|
|
103
|
+
const minX = Math.min(...candidates.map((c) => c.position.x));
|
|
104
|
+
const maxX = Math.max(...candidates.map((c) => c.position.x + c.width));
|
|
105
|
+
const minY = Math.min(...candidates.map((c) => c.position.y));
|
|
106
|
+
const maxY = Math.max(...candidates.map((c) => c.position.y + (c.height || 80)));
|
|
107
|
+
return {
|
|
108
|
+
...node,
|
|
109
|
+
position: { x: minX - POOL_HEADER_W, y: minY },
|
|
110
|
+
width: maxX - minX + POOL_HEADER_W,
|
|
111
|
+
height: maxY - minY
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
const absolutePositions = /* @__PURE__ */ new Map();
|
|
115
|
+
laidOutNodes.forEach((n) => absolutePositions.set(n.id, { x: n.position.x, y: n.position.y }));
|
|
116
|
+
return laidOutNodes.map((node) => {
|
|
117
|
+
if (node.parentId) {
|
|
118
|
+
const parentPos = absolutePositions.get(node.parentId);
|
|
119
|
+
if (parentPos) {
|
|
120
|
+
return {
|
|
121
|
+
...node,
|
|
122
|
+
position: {
|
|
123
|
+
x: node.position.x - parentPos.x,
|
|
124
|
+
y: node.position.y - parentPos.y
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return node;
|
|
130
|
+
});
|
|
131
|
+
} catch (e) {
|
|
132
|
+
console.warn("Dagre layout failed or unavailable, falling back to grid layout:", e);
|
|
133
|
+
return this.applyGridLayout(nodes);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Simple grid-based fallback layout when Dagre is unavailable
|
|
138
|
+
*/
|
|
139
|
+
static applyGridLayout(nodes) {
|
|
140
|
+
const spacingX = 200;
|
|
141
|
+
const spacingY = 150;
|
|
142
|
+
const itemsPerRow = 5;
|
|
143
|
+
const laidOutNodes = nodes.map((node, index) => {
|
|
144
|
+
const row = Math.floor(index / itemsPerRow);
|
|
145
|
+
const col = index % itemsPerRow;
|
|
146
|
+
return {
|
|
147
|
+
...node,
|
|
148
|
+
position: {
|
|
149
|
+
x: col * spacingX + 50,
|
|
150
|
+
y: row * spacingY + 50
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
const absolutePositions = /* @__PURE__ */ new Map();
|
|
155
|
+
laidOutNodes.forEach((n) => absolutePositions.set(n.id, { x: n.position.x, y: n.position.y }));
|
|
156
|
+
return laidOutNodes.map((node) => {
|
|
157
|
+
if (node.parentId) {
|
|
158
|
+
const parentPos = absolutePositions.get(node.parentId);
|
|
159
|
+
if (parentPos) {
|
|
160
|
+
return {
|
|
161
|
+
...node,
|
|
162
|
+
position: {
|
|
163
|
+
x: node.position.x - parentPos.x,
|
|
164
|
+
y: node.position.y - parentPos.y
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return node;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export {
|
|
175
|
+
__esm,
|
|
176
|
+
__export,
|
|
177
|
+
__toCommonJS,
|
|
178
|
+
BpmnLayout
|
|
179
|
+
};
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as zustand from 'zustand';
|
|
3
|
+
|
|
4
|
+
interface DomainNode {
|
|
5
|
+
id: string;
|
|
6
|
+
type: 'start' | 'end' | 'task' | 'userTask' | 'serviceTask' | 'scriptTask' | 'manualTask' | 'exclusiveGateway' | 'parallelGateway' | 'inclusiveGateway' | 'subProcess' | 'eventSubProcess' | 'transaction' | 'adhocSubProcess' | 'boundaryEvent' | 'intermediateCatch' | 'intermediateThrow' | 'textAnnotation' | 'dataStoreReference' | 'dataObjectReference' | 'pool' | 'lane' | 'custom';
|
|
7
|
+
label: string;
|
|
8
|
+
bpmnType: string;
|
|
9
|
+
documentation?: string;
|
|
10
|
+
position: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
parentId?: string;
|
|
17
|
+
attachedTo?: string;
|
|
18
|
+
eventType?: string;
|
|
19
|
+
isExpanded: boolean;
|
|
20
|
+
properties: Record<string, any>;
|
|
21
|
+
}
|
|
22
|
+
interface DomainEdge {
|
|
23
|
+
id: string;
|
|
24
|
+
source: string;
|
|
25
|
+
target: string;
|
|
26
|
+
sourceHandle?: string;
|
|
27
|
+
targetHandle?: string;
|
|
28
|
+
sourceSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
29
|
+
targetSide?: 'top' | 'right' | 'bottom' | 'left';
|
|
30
|
+
label?: string;
|
|
31
|
+
bpmnType: string;
|
|
32
|
+
conditionExpression?: string;
|
|
33
|
+
semantic: 'control' | 'message' | 'data' | 'annotation';
|
|
34
|
+
isDefault?: boolean;
|
|
35
|
+
isConditional?: boolean;
|
|
36
|
+
associationDirection?: 'none' | 'one' | 'both';
|
|
37
|
+
waypoints?: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}[];
|
|
41
|
+
properties?: Record<string, any>;
|
|
42
|
+
}
|
|
43
|
+
interface DomainPool {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
position: {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
};
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
lanes: DomainLane[];
|
|
53
|
+
}
|
|
54
|
+
interface DomainLane {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
position: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
};
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
}
|
|
64
|
+
interface DomainWorkflow {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
nodes: DomainNode[];
|
|
68
|
+
edges: DomainEdge[];
|
|
69
|
+
pools?: DomainPool[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare class BpmnImporter {
|
|
73
|
+
/**
|
|
74
|
+
* Imports a BPMN XML string and converts it to a clean DomainWorkflow model.
|
|
75
|
+
* Leverages bpmn-moddle with automatic fallback to DOMParser.
|
|
76
|
+
*/
|
|
77
|
+
static importXml(xml: string): Promise<DomainWorkflow>;
|
|
78
|
+
private static parseWithBpmnModdle;
|
|
79
|
+
private static parseWithDOMParser;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare class BpmnExporter {
|
|
83
|
+
/**
|
|
84
|
+
* Serializes a BPMN DomainWorkflow back to standard BPMN 2.0 XML string.
|
|
85
|
+
*/
|
|
86
|
+
static exportToXml(workflow: DomainWorkflow): Promise<string>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare class BpmnLayout {
|
|
90
|
+
/**
|
|
91
|
+
* Applies an automatic layout to nodes and edges using Dagre if available,
|
|
92
|
+
* otherwise falling back to a structured grid layout.
|
|
93
|
+
*/
|
|
94
|
+
static applyAutoLayout(nodes: DomainNode[], edges: DomainEdge[], direction?: 'LR' | 'TB'): Promise<DomainNode[]>;
|
|
95
|
+
/**
|
|
96
|
+
* Simple grid-based fallback layout when Dagre is unavailable
|
|
97
|
+
*/
|
|
98
|
+
private static applyGridLayout;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface ValidationError {
|
|
102
|
+
elementId: string;
|
|
103
|
+
severity: 'error' | 'warning';
|
|
104
|
+
message: string;
|
|
105
|
+
}
|
|
106
|
+
declare class BpmnValidator {
|
|
107
|
+
/**
|
|
108
|
+
* Evaluates if a connection is semantically valid under BPMN 2.0 specifications.
|
|
109
|
+
* Checks source/target node types against the connection type.
|
|
110
|
+
*/
|
|
111
|
+
static canConnect(source: DomainNode, target: DomainNode, connectionType: 'control' | 'message' | 'data' | 'annotation'): {
|
|
112
|
+
isValid: boolean;
|
|
113
|
+
reason?: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Validates the graph structure of a DomainWorkflow and returns warnings/errors.
|
|
117
|
+
*/
|
|
118
|
+
static validateWorkflow(nodes: DomainNode[], edges: DomainEdge[]): ValidationError[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface ReplaceOption {
|
|
122
|
+
label: string;
|
|
123
|
+
actionName: string;
|
|
124
|
+
className: string;
|
|
125
|
+
target: {
|
|
126
|
+
type: DomainNode['type'];
|
|
127
|
+
bpmnType: string;
|
|
128
|
+
isExpanded?: boolean;
|
|
129
|
+
isInterrupting?: boolean;
|
|
130
|
+
triggeredByEvent?: boolean;
|
|
131
|
+
cancelActivity?: boolean;
|
|
132
|
+
eventDefinitionType?: string;
|
|
133
|
+
instantiate?: boolean;
|
|
134
|
+
eventGatewayType?: string;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
declare const REPLACE_OPTIONS: Record<string, ReplaceOption[]>;
|
|
138
|
+
|
|
139
|
+
declare function BpmnModeler({ displayLeftPanel, editMode }: {
|
|
140
|
+
displayLeftPanel: boolean;
|
|
141
|
+
editMode: boolean;
|
|
142
|
+
}): React.JSX.Element;
|
|
143
|
+
|
|
144
|
+
declare const BpmnNode: ({ data, id, selected }: any) => React.JSX.Element;
|
|
145
|
+
|
|
146
|
+
declare const BpmnEdge: ({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, data, selected, label, }: any) => React.JSX.Element;
|
|
147
|
+
|
|
148
|
+
declare const BpmnPalette: () => React.JSX.Element;
|
|
149
|
+
|
|
150
|
+
declare const BpmnPropertiesPanel: () => React.JSX.Element;
|
|
151
|
+
|
|
152
|
+
declare const BpmnContextPad: () => null;
|
|
153
|
+
|
|
154
|
+
interface BpmnQuickAppendProps {
|
|
155
|
+
onSelect: (option: ReplaceOption) => void;
|
|
156
|
+
trigger?: React.ReactNode;
|
|
157
|
+
tooltip?: string;
|
|
158
|
+
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
159
|
+
size?: 'small' | 'medium';
|
|
160
|
+
}
|
|
161
|
+
declare const BpmnQuickAppend: React.FC<BpmnQuickAppendProps>;
|
|
162
|
+
|
|
163
|
+
declare const BPMN_ICON_PATHS: {
|
|
164
|
+
TASK_ICON_COMMERCIAL: string;
|
|
165
|
+
TASK_ICON_CUSTOMER_SERVICE: string;
|
|
166
|
+
TASK_ICON_FINANCE: string;
|
|
167
|
+
TASK_ICON_EQUIPMENT: string;
|
|
168
|
+
TASK_ICON_LOGISTICS: string;
|
|
169
|
+
TASK_ICON_MARINE: string;
|
|
170
|
+
TASK_ICON_DOCUMENT: string;
|
|
171
|
+
DATA_OBJECT: string;
|
|
172
|
+
DATA_STORE: string;
|
|
173
|
+
MARKER_PARALLEL: string;
|
|
174
|
+
MARKER_SEQUENTIAL: string;
|
|
175
|
+
MARKER_LOOP: string;
|
|
176
|
+
TIMER: string;
|
|
177
|
+
MESSAGE: string;
|
|
178
|
+
SIGNAL: string;
|
|
179
|
+
ERROR: string;
|
|
180
|
+
ESCALATION: string;
|
|
181
|
+
CONDITIONAL: string;
|
|
182
|
+
COMPENSATION: string;
|
|
183
|
+
LINK: string;
|
|
184
|
+
TERMINATE: string;
|
|
185
|
+
CANCEL: string;
|
|
186
|
+
GATEWAY_EXCLUSIVE: string;
|
|
187
|
+
GATEWAY_PARALLEL: string;
|
|
188
|
+
GATEWAY_INCLUSIVE: string;
|
|
189
|
+
GATEWAY_COMPLEX: string;
|
|
190
|
+
GATEWAY_EVENT_BASED: string;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
interface BpmnState {
|
|
194
|
+
workflow: DomainWorkflow;
|
|
195
|
+
past: DomainWorkflow[];
|
|
196
|
+
future: DomainWorkflow[];
|
|
197
|
+
errors: ValidationError[];
|
|
198
|
+
clipboard: {
|
|
199
|
+
nodes: DomainNode[];
|
|
200
|
+
edges: DomainEdge[];
|
|
201
|
+
};
|
|
202
|
+
selectedNodeId: string | null;
|
|
203
|
+
selectedEdgeId: string | null;
|
|
204
|
+
editingNodeId: string | null;
|
|
205
|
+
activeTool: 'hand' | 'lasso' | 'space' | 'connection';
|
|
206
|
+
setWorkflow: (workflow: DomainWorkflow) => void;
|
|
207
|
+
addNode: (node: DomainNode) => void;
|
|
208
|
+
removeNode: (nodeId: string) => void;
|
|
209
|
+
updateNode: (nodeId: string, updates: Partial<DomainNode>) => void;
|
|
210
|
+
updateNodes: (updates: {
|
|
211
|
+
id: string;
|
|
212
|
+
changes: Partial<DomainNode>;
|
|
213
|
+
}[]) => void;
|
|
214
|
+
addEdge: (edge: DomainEdge) => void;
|
|
215
|
+
removeEdge: (edgeId: string) => void;
|
|
216
|
+
updateEdge: (edgeId: string, updates: Partial<DomainEdge>) => void;
|
|
217
|
+
setSelectedNodeId: (id: string | null) => void;
|
|
218
|
+
setSelectedEdgeId: (id: string | null) => void;
|
|
219
|
+
setEditingNodeId: (id: string | null) => void;
|
|
220
|
+
setActiveTool: (tool: 'hand' | 'lasso' | 'space' | 'connection') => void;
|
|
221
|
+
copySelection: (nodeIds: string[]) => void;
|
|
222
|
+
pasteSelection: (positionOffset?: {
|
|
223
|
+
x: number;
|
|
224
|
+
y: number;
|
|
225
|
+
}) => void;
|
|
226
|
+
undo: () => void;
|
|
227
|
+
redo: () => void;
|
|
228
|
+
clearHistory: () => void;
|
|
229
|
+
applyLayout: (direction: 'LR' | 'TB') => Promise<void>;
|
|
230
|
+
}
|
|
231
|
+
declare const useBpmnStore: zustand.UseBoundStore<zustand.StoreApi<BpmnState>>;
|
|
232
|
+
|
|
233
|
+
export { BPMN_ICON_PATHS, BpmnContextPad, BpmnEdge, BpmnExporter, BpmnImporter, BpmnLayout, BpmnModeler, BpmnNode, BpmnPalette, BpmnPropertiesPanel, BpmnQuickAppend, type BpmnQuickAppendProps, type BpmnState, BpmnValidator, type DomainEdge, type DomainLane, type DomainNode, type DomainPool, type DomainWorkflow, REPLACE_OPTIONS, type ReplaceOption, type ValidationError, useBpmnStore };
|