@bpmn-nova/studio 0.3.0-preview → 0.3.1-preview
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 +202 -19
- package/dist/canvas.js +5 -3
- package/dist/context-menu.js +1 -1
- package/dist/controller.js +2 -2
- package/dist/index.d.ts +76 -35
- package/dist/index.js +12 -11
- package/dist/interactions.js +1 -1
- package/dist/modules/bpmn-model/index.d.ts +11 -0
- package/dist/modules/bpmn-model/index.js +703 -0
- package/dist/modules/core/containment.js +590 -0
- package/dist/modules/core/gateway.js +72 -0
- package/dist/modules/core/history.js +32 -0
- package/dist/modules/core/index.d.ts +268 -0
- package/dist/modules/core/index.js +7 -0
- package/dist/modules/core/layout.js +644 -0
- package/dist/modules/core/model.js +287 -0
- package/dist/modules/core/runtime-transition-route.js +360 -0
- package/dist/modules/core/scope.js +99 -0
- package/dist/modules/designer/index.d.ts +79 -0
- package/dist/modules/designer/index.js +607 -0
- package/dist/modules/engine-activiti/index.d.ts +19 -0
- package/dist/modules/engine-activiti/index.js +160 -0
- package/dist/modules/engine-flowable/index.d.ts +19 -0
- package/dist/modules/engine-flowable/index.js +160 -0
- package/dist/modules/export-svg/index.d.ts +112 -0
- package/dist/modules/export-svg/index.js +2 -0
- package/dist/modules/export-svg/preview.js +327 -0
- package/dist/modules/export-svg/render.js +718 -0
- package/dist/modules/icons/index.d.ts +24 -0
- package/dist/modules/icons/index.js +264 -0
- package/dist/modules/palette/index.d.ts +62 -0
- package/dist/modules/palette/index.js +99 -0
- package/dist/modules/palette/panel.js +99 -0
- package/dist/modules/properties/index.d.ts +20 -0
- package/dist/modules/properties/index.js +19 -0
- package/dist/modules/properties-activiti/index.d.ts +3 -0
- package/dist/modules/properties-activiti/index.js +97 -0
- package/dist/modules/properties-bpmn/index.d.ts +3 -0
- package/dist/modules/properties-bpmn/index.js +516 -0
- package/dist/modules/properties-core/index.d.ts +124 -0
- package/dist/modules/properties-core/index.js +312 -0
- package/dist/modules/properties-flowable/index.d.ts +3 -0
- package/dist/modules/properties-flowable/index.js +114 -0
- package/dist/modules/properties-renderer/index.d.ts +25 -0
- package/dist/modules/properties-renderer/index.js +491 -0
- package/dist/modules/renderer-svg/index.d.ts +117 -0
- package/dist/modules/renderer-svg/index.js +1460 -0
- package/dist/modules/runtime/index.d.ts +169 -0
- package/dist/modules/runtime/index.js +535 -0
- package/dist/modules/theme/index.d.ts +95 -0
- package/dist/modules/theme/index.js +368 -0
- package/dist/modules/viewer/index.d.ts +265 -0
- package/dist/modules/viewer/index.js +1011 -0
- package/dist/modules/viewer/runtime-content.js +123 -0
- package/dist/modules/viewer/runtime-details-motion.js +228 -0
- package/dist/modules/viewer/runtime-trace.js +574 -0
- package/dist/modules/viewer/timeline.js +276 -0
- package/dist/selection-layout.js +1 -1
- package/dist/shell.js +82 -9
- package/dist/styles.css +108 -7
- package/package.json +36 -15
package/README.md
CHANGED
|
@@ -1,26 +1,39 @@
|
|
|
1
1
|
# @bpmn-nova/studio
|
|
2
2
|
|
|
3
|
-
BPMN Nova
|
|
3
|
+
BPMN Nova 的 Vanilla JavaScript / TypeScript 完整入口,提供流程设计、只读展示、审批轨迹、主题、属性面板和纯 SVG 导出。
|
|
4
4
|
|
|
5
|
-
> **English summary:** The
|
|
5
|
+
> **English summary:** The complete framework-neutral BPMN Nova package for process design, viewing, approval traces, themes, properties, and pure SVG export.
|
|
6
6
|
|
|
7
|
-
> 当前版本为 `0.3.
|
|
7
|
+
> 当前版本为 `0.3.1-preview`。请使用 `@preview` 安装,并在生产接入前验证目标 BPMN XML 与引擎扩展。
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## 什么时候使用
|
|
12
|
+
|
|
13
|
+
- Vanilla JavaScript 或 TypeScript 项目安装本包。
|
|
14
|
+
- React 18+ 项目安装 `@bpmn-nova/react`。
|
|
15
|
+
- Vue 3.3+ 项目安装 `@bpmn-nova/vue`。
|
|
16
|
+
- 一个项目只需要选择一个公开包,不需要安装 Core、Viewer、Runtime、Theme 等内部 Module。
|
|
8
17
|
|
|
9
18
|
## 安装
|
|
10
19
|
|
|
11
20
|
```bash
|
|
12
|
-
npm install @bpmn-nova/studio
|
|
21
|
+
npm install @bpmn-nova/studio@preview
|
|
13
22
|
```
|
|
14
23
|
|
|
15
24
|
```js
|
|
16
25
|
import '@bpmn-nova/studio/styles.css'
|
|
17
26
|
```
|
|
18
27
|
|
|
19
|
-
JavaScript
|
|
28
|
+
BPMN Nova 不会在 JavaScript 中隐式注入 CSS。视觉容器必须有明确高度。
|
|
20
29
|
|
|
21
|
-
##
|
|
30
|
+
## 流程设计
|
|
22
31
|
|
|
23
|
-
```
|
|
32
|
+
```html
|
|
33
|
+
<div id="studio" style="height: 720px"></div>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```js
|
|
24
37
|
import {
|
|
25
38
|
createEmptyProcess,
|
|
26
39
|
createStudioController,
|
|
@@ -29,31 +42,201 @@ import {
|
|
|
29
42
|
import '@bpmn-nova/studio/styles.css'
|
|
30
43
|
|
|
31
44
|
const model = createEmptyProcess('flowable')
|
|
45
|
+
model.id = 'Process_PurchaseApproval'
|
|
46
|
+
model.name = '采购申请审批流程'
|
|
47
|
+
|
|
32
48
|
const studio = createStudioController({ model })
|
|
33
|
-
const shell = createStudioShell({
|
|
49
|
+
const shell = createStudioShell({
|
|
50
|
+
container: document.querySelector('#studio'),
|
|
51
|
+
studio,
|
|
52
|
+
theme: 'auto',
|
|
53
|
+
})
|
|
34
54
|
|
|
35
55
|
const xml = studio.exportXml()
|
|
56
|
+
|
|
57
|
+
// 页面卸载时释放实例。
|
|
36
58
|
shell.destroy()
|
|
37
59
|
studio.destroy()
|
|
38
60
|
```
|
|
39
61
|
|
|
40
|
-
##
|
|
62
|
+
## 只读 Viewer
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
import { importBpmn } from '@bpmn-nova/studio'
|
|
66
|
+
import { BpmnViewer } from '@bpmn-nova/studio/viewer'
|
|
67
|
+
import '@bpmn-nova/studio/styles.css'
|
|
68
|
+
|
|
69
|
+
const viewer = new BpmnViewer({
|
|
70
|
+
container: document.querySelector('#viewer'),
|
|
71
|
+
model: importBpmn(xml, 'flowable'),
|
|
72
|
+
projection: 'standard',
|
|
73
|
+
theme: 'auto',
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
viewer.fitView()
|
|
77
|
+
viewer.destroy()
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
也可以从 `@bpmn-nova/studio` 根入口导入所有公开 Interface;子路径用于明确表达接入场景。
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
## 审批轨迹
|
|
85
|
+
|
|
86
|
+
Viewer 接收引擎中立的 Runtime Snapshot。三种投影使用相同数据:
|
|
87
|
+
|
|
88
|
+
| 投影 | 配置 | 适用场景 |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| 实际路径 | `projection: 'approval'` | 只展示实际发生的有效路径 |
|
|
91
|
+
| 移动时间线 | `projection: 'compact'` | 按访问轮次展示动作、图片和附件 |
|
|
92
|
+
| 完整 BPMN | `projection: 'standard'` + `runtime` | 完整结构叠加运行状态 |
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
const runtime = {
|
|
96
|
+
processInstanceId: 'purchase-20260824',
|
|
97
|
+
status: 'running',
|
|
98
|
+
activities: [{
|
|
99
|
+
id: 'activity-manager-1',
|
|
100
|
+
elementId: 'UserTask_Manager',
|
|
101
|
+
visitId: 'visit-manager-1',
|
|
102
|
+
status: 'completed',
|
|
103
|
+
assignee: '李经理',
|
|
104
|
+
endTime: '2026-08-24T10:12:00+08:00',
|
|
105
|
+
}],
|
|
106
|
+
actions: [{
|
|
107
|
+
id: 'action-manager-approve',
|
|
108
|
+
type: 'approve',
|
|
109
|
+
elementId: 'UserTask_Manager',
|
|
110
|
+
visitId: 'visit-manager-1',
|
|
111
|
+
activityId: 'activity-manager-1',
|
|
112
|
+
actor: { id: 'manager-li', name: '李经理' },
|
|
113
|
+
occurredAt: '2026-08-24T10:12:00+08:00',
|
|
114
|
+
content: {
|
|
115
|
+
plainText: '资料完整,同意提交总经理审批。',
|
|
116
|
+
blocks: [
|
|
117
|
+
{ type: 'paragraph', text: '资料完整,同意提交总经理审批。' },
|
|
118
|
+
{ type: 'image', assetId: 'quotation-preview' },
|
|
119
|
+
{ type: 'file', assetId: 'purchase-checklist' },
|
|
120
|
+
],
|
|
121
|
+
assets: [
|
|
122
|
+
{
|
|
123
|
+
id: 'quotation-preview',
|
|
124
|
+
name: '现场报价单.png',
|
|
125
|
+
mediaType: 'image/png',
|
|
126
|
+
width: 1280,
|
|
127
|
+
height: 720,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: 'purchase-checklist',
|
|
131
|
+
name: '采购核验清单.txt',
|
|
132
|
+
mediaType: 'text/plain',
|
|
133
|
+
size: 248,
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
}],
|
|
138
|
+
visitedEdges: [],
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const runtimeAssetResolver = async (asset, { purpose, signal }) => {
|
|
142
|
+
const response = await fetch(
|
|
143
|
+
`/api/runtime-assets/${encodeURIComponent(asset.id)}?purpose=${purpose}`,
|
|
144
|
+
{ signal },
|
|
145
|
+
)
|
|
146
|
+
if (!response.ok) return null
|
|
147
|
+
return response.url
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
viewer.setRuntime(runtime)
|
|
151
|
+
viewer.setProjection('compact')
|
|
152
|
+
viewer.setDisplayOptions({ runtimeAssetResolver })
|
|
153
|
+
```
|
|
41
154
|
|
|
42
|
-
|
|
43
|
-
- `createStudioShell / BpmnStudioShell`
|
|
44
|
-
- `BpmnCanvas 与 InteractionController`
|
|
45
|
-
- `ContextMenu、Template、Palette、Properties Registries`
|
|
46
|
-
- `Studio 聚合导出的 Core、XML、Runtime、Theme、Designer 与 Viewer API`
|
|
155
|
+
Snapshot 只保存资源引用,不保存 URL、Base64、Blob 或 HTML。上传、权限签发和资源存储由宿主业务系统负责。
|
|
47
156
|
|
|
48
|
-
|
|
157
|
+
| 实际路径 | 移动时间线 |
|
|
158
|
+
| --- | --- |
|
|
159
|
+
|  |  |
|
|
49
160
|
|
|
50
|
-
|
|
161
|
+

|
|
51
162
|
|
|
163
|
+
## 主题与运行态配色
|
|
164
|
+
|
|
165
|
+
```js
|
|
166
|
+
shell.setTheme({
|
|
167
|
+
mode: 'auto',
|
|
168
|
+
dark: {
|
|
169
|
+
colors: {
|
|
170
|
+
canvas: '#0b1018',
|
|
171
|
+
surface: '#18202b',
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
shell.setRuntimeAppearance({
|
|
177
|
+
statuses: { completed: 'success', active: 'primary' },
|
|
178
|
+
actions: {
|
|
179
|
+
approve: { label: '通过', tone: 'success' },
|
|
180
|
+
reject: { label: '驳回', tone: 'danger' },
|
|
181
|
+
},
|
|
182
|
+
})
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
主题限定在实例根节点;`auto` 会跟随并监听浏览器系统主题变化,不修改宿主页面的 `<html>`。
|
|
186
|
+
|
|
187
|
+

|
|
188
|
+
|
|
189
|
+
## SVG 导出
|
|
190
|
+
|
|
191
|
+
```js
|
|
192
|
+
// 打开确认预览,用户确认后下载。
|
|
193
|
+
shell.openSvgExportPreview({
|
|
194
|
+
theme: 'current',
|
|
195
|
+
transparentBackground: false,
|
|
196
|
+
filename: '采购申请审批流程.svg',
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
// 或只创建 Artifact,不触发下载。
|
|
200
|
+
const artifact = await shell.exportSvg({ theme: 'dark' })
|
|
201
|
+
console.log(artifact.svg, artifact.warnings)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
导出完整业务内容,不受当前缩放、平移或滚动影响。图片会通过 Resolver 嵌入 SVG,普通附件只展示摘要。
|
|
205
|
+
|
|
206
|
+

|
|
207
|
+
|
|
208
|
+
## 支持的子路径
|
|
209
|
+
|
|
210
|
+
```js
|
|
211
|
+
import { BpmnDesigner } from '@bpmn-nova/studio/designer'
|
|
212
|
+
import { BpmnViewer } from '@bpmn-nova/studio/viewer'
|
|
213
|
+
import { createRuntimePresentation } from '@bpmn-nova/studio/runtime'
|
|
214
|
+
import { createThemeController } from '@bpmn-nova/studio/theme'
|
|
215
|
+
import { exportDiagramSvg } from '@bpmn-nova/studio/export-svg'
|
|
216
|
+
import { flowableProfile } from '@bpmn-nova/studio/flowable'
|
|
217
|
+
import { activitiProfile } from '@bpmn-nova/studio/activiti'
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## 常见问题
|
|
221
|
+
|
|
222
|
+
- **界面为空或高度为 0:** 为 Studio/Viewer 的父容器设置明确高度。
|
|
223
|
+
- **界面没有样式:** 导入一次 `@bpmn-nova/studio/styles.css`。
|
|
224
|
+
- **附件不可用:** 提供 `runtimeAssetResolver`,并为不同 purpose 返回当前有效地址。
|
|
225
|
+
- **SSR 报错:** 在浏览器挂载阶段创建实例,服务端只准备 XML 和 Runtime 数据。
|
|
226
|
+
- **重复安装:** 不直接安装任何未列出的 `@bpmn-nova/*` 内部 Module。
|
|
227
|
+
|
|
228
|
+
## 文档与 AI
|
|
229
|
+
|
|
230
|
+
- [项目首页](https://github.com/daxiangme/bpmn-nova)
|
|
52
231
|
- [快速开始](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/GETTING-STARTED.md)
|
|
53
|
-
- [
|
|
54
|
-
- [API](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/API.md)
|
|
232
|
+
- [公开 Interface](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/API.md)
|
|
55
233
|
- [自定义指南](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/CUSTOMIZATION.md)
|
|
56
|
-
- [
|
|
234
|
+
- [AI 接入入口](https://raw.githubusercontent.com/daxiangme/bpmn-nova/dev/llms.txt)
|
|
235
|
+
- [AI 完整上下文](https://raw.githubusercontent.com/daxiangme/bpmn-nova/dev/llms-full.txt)
|
|
236
|
+
|
|
237
|
+
## 能力边界
|
|
238
|
+
|
|
239
|
+
BPMN Nova 负责建模、展示、审批轨迹、主题和 SVG 导出;不负责流程引擎执行、审批提交、附件上传存储、权限签发或 PNG/PDF 导出。当前 Preview 不声明 BPMN Schema 100% 覆盖。
|
|
57
240
|
|
|
58
241
|
## License
|
|
59
242
|
|
package/dist/canvas.js
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
NODE_DEFINITIONS,
|
|
9
9
|
resolveContainment,
|
|
10
10
|
snapNodePosition,
|
|
11
|
-
} from '
|
|
12
|
-
import { DiagramRenderer } from '
|
|
13
|
-
import { hydrateIcons } from '
|
|
11
|
+
} from './modules/core/index.js';
|
|
12
|
+
import { DiagramRenderer } from './modules/renderer-svg/index.js';
|
|
13
|
+
import { hydrateIcons } from './modules/icons/index.js';
|
|
14
14
|
import { canCreateSequenceFlow } from './controller.js';
|
|
15
15
|
import { createDefaultContextMenuRegistry } from './context-menu.js';
|
|
16
16
|
import { CREATE_INTENT_MIME } from './interactions.js';
|
|
@@ -904,6 +904,8 @@ export class BpmnCanvas {
|
|
|
904
904
|
startConnect(nodeId) { this.renderer.closeTransientOverlays?.(); return this.studio.startConnect(nodeId); }
|
|
905
905
|
editEdgeName(edgeId) { return this.renderer.editEdgeName?.(edgeId) || false; }
|
|
906
906
|
fitView(padding, options) { this.renderer.fitView(padding, { minZoom: 0.7, ...(options || {}) }); }
|
|
907
|
+
exportSvg(options) { return this.renderer.exportSvg(options); }
|
|
908
|
+
openSvgExportPreview(options) { return this.renderer.openSvgExportPreview(options); }
|
|
907
909
|
fitSelection(padding = 72) {
|
|
908
910
|
const bounds = this.studio.getSelectionBounds();
|
|
909
911
|
if (!bounds) return false;
|
package/dist/context-menu.js
CHANGED
package/dist/controller.js
CHANGED
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
resolveSwimlaneLabelPlacement,
|
|
25
25
|
scopeExists,
|
|
26
26
|
validateParallelGateway,
|
|
27
|
-
} from '
|
|
28
|
-
import { exportBpmn, importBpmn } from '
|
|
27
|
+
} from './modules/core/index.js';
|
|
28
|
+
import { exportBpmn, importBpmn } from './modules/bpmn-model/index.js';
|
|
29
29
|
import {
|
|
30
30
|
applySelectionArrangement,
|
|
31
31
|
mergeSelectionRefs,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
1
|
+
export * from './modules/core/index.js'
|
|
2
|
+
export * from './modules/bpmn-model/index.js'
|
|
3
|
+
export * from './modules/runtime/index.js'
|
|
4
|
+
export * from './modules/theme/index.js'
|
|
5
|
+
export * from './modules/export-svg/index.js'
|
|
6
|
+
export * from './modules/designer/index.js'
|
|
7
|
+
export * from './modules/viewer/index.js'
|
|
8
|
+
export * from './modules/engine-flowable/index.js'
|
|
9
|
+
export * from './modules/engine-activiti/index.js'
|
|
10
|
+
export * from './modules/properties/index.js'
|
|
11
|
+
export * from './modules/icons/index.js'
|
|
12
|
+
export * from './modules/palette/index.js'
|
|
12
13
|
|
|
13
14
|
import type {
|
|
14
15
|
BpmnEdge,
|
|
@@ -20,20 +21,21 @@ import type {
|
|
|
20
21
|
Point,
|
|
21
22
|
ProcessModel,
|
|
22
23
|
SelectionRect,
|
|
23
|
-
} from '
|
|
24
|
-
import type { IconRegistry } from '
|
|
25
|
-
import type { PaletteRegistry } from '
|
|
26
|
-
import type { PropertiesRegistry } from '
|
|
27
|
-
import type { DiagramNodeRenderer, DiagramRendererOptions } from '
|
|
24
|
+
} from './modules/core/index.js'
|
|
25
|
+
import type { IconRegistry } from './modules/icons/index.js'
|
|
26
|
+
import type { PaletteRegistry } from './modules/palette/index.js'
|
|
27
|
+
import type { PropertiesRegistry } from './modules/properties/index.js'
|
|
28
|
+
import type { DiagramNodeRenderer, DiagramRendererOptions } from './modules/renderer-svg/index.js'
|
|
29
|
+
import type { RuntimeTimelineSvgRenderer, SvgExportArtifact, SvgExportOptions, SvgExportPreviewController, SvgNodeRenderer } from './modules/export-svg/index.js'
|
|
28
30
|
import type {
|
|
29
31
|
ActivityInstance as RuntimeActivityInstance,
|
|
30
32
|
ProcessInstanceSnapshot as RuntimeProcessInstanceSnapshot,
|
|
31
|
-
} from '
|
|
32
|
-
import type { NovaThemeInput, NovaThemeMode, NovaThemeState, RuntimeAppearanceOptions, RuntimeAppearanceResolver } from '
|
|
33
|
+
} from './modules/runtime/index.js'
|
|
34
|
+
import type { NovaThemeInput, NovaThemeMode, NovaThemeState, RuntimeAppearanceOptions, RuntimeAppearanceResolver } from './modules/theme/index.js'
|
|
33
35
|
import type {
|
|
34
36
|
RuntimeDetailsRenderer,
|
|
35
37
|
RuntimeTransitionDetailsRenderer,
|
|
36
|
-
} from '
|
|
38
|
+
} from './modules/viewer/index.js'
|
|
37
39
|
|
|
38
40
|
// Aggregate compatibility surface. Studio re-exports the package-level types,
|
|
39
41
|
// and keeps these frequently consumed declarations visible at its own entry.
|
|
@@ -84,12 +86,12 @@ export interface RuntimeTransitionRoute {
|
|
|
84
86
|
anchorStrategy: 'outer-same-side' | 'flow-axis-fallback'
|
|
85
87
|
portConflicts: number
|
|
86
88
|
}
|
|
87
|
-
export function routeRuntimeTransition(model: ProcessModel, transition: import('
|
|
89
|
+
export function routeRuntimeTransition(model: ProcessModel, transition: import('./modules/runtime/index.js').RuntimeTransition, options?: RuntimeTransitionRouteOptions): RuntimeTransitionRoute | null
|
|
88
90
|
|
|
89
|
-
export type RuntimeParticipant = import('
|
|
90
|
-
export type RuntimeTransition = import('
|
|
91
|
-
export type NodeRuntimePresentation = import('
|
|
92
|
-
export type RuntimePresentation = import('
|
|
91
|
+
export type RuntimeParticipant = import('./modules/runtime/index.js').RuntimeParticipant
|
|
92
|
+
export type RuntimeTransition = import('./modules/runtime/index.js').RuntimeTransition
|
|
93
|
+
export type NodeRuntimePresentation = import('./modules/runtime/index.js').NodeRuntimePresentation
|
|
94
|
+
export type RuntimePresentation = import('./modules/runtime/index.js').RuntimePresentation
|
|
93
95
|
export interface ActivityInstance extends RuntimeActivityInstance {
|
|
94
96
|
visitId?: string
|
|
95
97
|
multiInstanceId?: string
|
|
@@ -104,18 +106,18 @@ export interface ProcessInstanceSnapshot extends RuntimeProcessInstanceSnapshot
|
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
export type ViewerProjection = 'auto' | 'standard' | 'approval' | 'compact'
|
|
107
|
-
export type RuntimeTraceProjection = import('
|
|
108
|
-
export type RuntimeTraceItem = import('
|
|
109
|
-
export type RuntimeTraceLink = import('
|
|
110
|
-
export type RuntimeTraceGroup = import('
|
|
109
|
+
export type RuntimeTraceProjection = import('./modules/viewer/index.js').RuntimeTraceProjection
|
|
110
|
+
export type RuntimeTraceItem = import('./modules/viewer/index.js').RuntimeTraceItem
|
|
111
|
+
export type RuntimeTraceLink = import('./modules/viewer/index.js').RuntimeTraceLink
|
|
112
|
+
export type RuntimeTraceGroup = import('./modules/viewer/index.js').RuntimeTraceGroup
|
|
111
113
|
export interface RuntimeTraceProjectionOptions {
|
|
112
114
|
includePredicted?: boolean
|
|
113
115
|
showStartMilestone?: boolean
|
|
114
116
|
showEndMilestone?: boolean
|
|
115
117
|
}
|
|
116
118
|
export interface ViewerTimelineOptions {
|
|
117
|
-
title?: string | null | ((context: import('
|
|
118
|
-
description?: string | null | ((context: import('
|
|
119
|
+
title?: string | null | ((context: import('./modules/viewer/index.js').ViewerTimelineContext) => string | null)
|
|
120
|
+
description?: string | null | ((context: import('./modules/viewer/index.js').ViewerTimelineContext) => string | null)
|
|
119
121
|
}
|
|
120
122
|
export interface RuntimeDetailsLayoutOptions {
|
|
121
123
|
placement?: 'popover' | 'center' | 'bottom'
|
|
@@ -129,13 +131,15 @@ export interface RuntimeDetailsOptions {
|
|
|
129
131
|
desktop?: RuntimeDetailsLayoutOptions
|
|
130
132
|
mobile?: RuntimeDetailsLayoutOptions
|
|
131
133
|
}
|
|
132
|
-
export type RuntimeTimelineRenderer = import('
|
|
133
|
-
export type RuntimeTraceClickEvent = import('
|
|
134
|
+
export type RuntimeTimelineRenderer = import('./modules/viewer/index.js').RuntimeTimelineRenderer
|
|
135
|
+
export type RuntimeTraceClickEvent = import('./modules/viewer/index.js').RuntimeTraceClickEvent
|
|
134
136
|
export interface ViewerOptions {
|
|
135
137
|
container: HTMLElement
|
|
136
138
|
model: ProcessModel
|
|
137
139
|
runtime?: ProcessInstanceSnapshot | null
|
|
138
140
|
iconRegistry?: IconRegistry
|
|
141
|
+
nodeRenderers?: Record<string, Function>
|
|
142
|
+
nodeRenderer?: Function
|
|
139
143
|
projection?: ViewerProjection
|
|
140
144
|
responsive?: boolean
|
|
141
145
|
timeline?: ViewerTimelineOptions
|
|
@@ -143,15 +147,47 @@ export interface ViewerOptions {
|
|
|
143
147
|
runtimeTraceOptions?: RuntimeTraceProjectionOptions
|
|
144
148
|
onTraceClick?: (event: RuntimeTraceClickEvent) => void
|
|
145
149
|
runtimePresenter?: (context: { model: ProcessModel; runtime: ProcessInstanceSnapshot | null; appearance: RuntimeAppearanceResolver }) => RuntimePresentation
|
|
150
|
+
runtimeTraceProjector?: import('./modules/viewer/index.js').ViewerOptions['runtimeTraceProjector']
|
|
151
|
+
runtimeAssetResolver?: import('./modules/viewer/index.js').RuntimeAssetResolver
|
|
152
|
+
theme?: NovaThemeInput
|
|
153
|
+
runtimeAppearance?: RuntimeAppearanceOptions
|
|
154
|
+
svgExport?: SvgExportOptions & { label?: string; nodeRenderers?: Record<string, SvgNodeRenderer>; runtimeTimelineRenderer?: RuntimeTimelineSvgRenderer }
|
|
155
|
+
onThemeChange?: (state: NovaThemeState) => void
|
|
156
|
+
runtimeTimelineRenderer?: RuntimeTimelineRenderer
|
|
157
|
+
onRuntimeTraceItemClick?: import('./modules/viewer/index.js').ViewerOptions['onRuntimeTraceItemClick']
|
|
158
|
+
onProjectionChange?: import('./modules/viewer/index.js').ViewerOptions['onProjectionChange']
|
|
146
159
|
runtimeDetailsRenderer?: RuntimeDetailsRenderer | null
|
|
147
|
-
onRuntimeDetailsOpen?:
|
|
160
|
+
onRuntimeDetailsOpen?: import('./modules/viewer/index.js').ViewerOptions['onRuntimeDetailsOpen']
|
|
148
161
|
runtimeTransitionDetailsRenderer?: RuntimeTransitionDetailsRenderer | null
|
|
149
|
-
onRuntimeTransitionDetailsOpen?:
|
|
162
|
+
onRuntimeTransitionDetailsOpen?: import('./modules/viewer/index.js').ViewerOptions['onRuntimeTransitionDetailsOpen']
|
|
163
|
+
onElementClick?: import('./modules/viewer/index.js').ViewerOptions['onElementClick']
|
|
150
164
|
}
|
|
151
165
|
export class BpmnViewer {
|
|
152
166
|
constructor(options: ViewerOptions)
|
|
153
|
-
|
|
167
|
+
model: ProcessModel
|
|
168
|
+
runtime: ProcessInstanceSnapshot | null
|
|
169
|
+
projection: ViewerProjection
|
|
170
|
+
responsive: boolean
|
|
171
|
+
activeProjection: Exclude<ViewerProjection, 'auto'>
|
|
172
|
+
traceProjection: RuntimeTraceProjection | null
|
|
173
|
+
setModel(model: ProcessModel): void
|
|
174
|
+
setRuntime(runtime: ProcessInstanceSnapshot | null): void
|
|
175
|
+
setDisplayOptions(options: { timeline?: ViewerTimelineOptions; runtimeDetails?: RuntimeDetailsOptions; runtimeTraceOptions?: RuntimeTraceProjectionOptions; runtimeAssetResolver?: import('./modules/viewer/index.js').RuntimeAssetResolver | null }): void
|
|
176
|
+
setProjection(projection: ViewerProjection): void
|
|
177
|
+
setTheme(theme: NovaThemeInput): NovaThemeState
|
|
178
|
+
setThemeMode(mode: NovaThemeMode): NovaThemeState
|
|
179
|
+
getThemeState(): NovaThemeState
|
|
180
|
+
exportSvg(options?: SvgExportOptions): Promise<SvgExportArtifact>
|
|
181
|
+
openSvgExportPreview(options?: SvgExportOptions & { previewTitle?: string; onDownload?: (artifact: SvgExportArtifact) => void }): SvgExportPreviewController
|
|
182
|
+
setRuntimeAppearance(options: RuntimeAppearanceOptions | null): void
|
|
154
183
|
fitView(): void
|
|
184
|
+
zoomBy(delta: number): void
|
|
185
|
+
clearSelection(): void
|
|
186
|
+
openRuntimeDetails(node: BpmnNode, presentation?: NodeRuntimePresentation, anchor?: Element | null): boolean
|
|
187
|
+
openRuntimeTransitionDetails(transition: import('./modules/runtime/index.js').RuntimeTransitionPresentation | string, anchor?: Element | null): boolean
|
|
188
|
+
closeRuntimeAssetPreview(): void
|
|
189
|
+
closeRuntimeDetails(): void
|
|
190
|
+
refresh(): void
|
|
155
191
|
destroy(): void
|
|
156
192
|
}
|
|
157
193
|
|
|
@@ -387,6 +423,8 @@ export class BpmnCanvas {
|
|
|
387
423
|
setTheme(theme: NovaThemeInput): NovaThemeState
|
|
388
424
|
setThemeMode(mode: NovaThemeMode): NovaThemeState
|
|
389
425
|
getThemeState(): NovaThemeState
|
|
426
|
+
exportSvg(options?: SvgExportOptions): Promise<SvgExportArtifact>
|
|
427
|
+
openSvgExportPreview(options?: SvgExportOptions & { previewTitle?: string; onDownload?: (artifact: SvgExportArtifact) => void }): SvgExportPreviewController
|
|
390
428
|
closeContextMenu(): void
|
|
391
429
|
destroy(): void
|
|
392
430
|
}
|
|
@@ -426,6 +464,7 @@ export interface StudioShellOptions {
|
|
|
426
464
|
rightWidth?: number
|
|
427
465
|
theme?: NovaThemeInput
|
|
428
466
|
runtimeAppearance?: RuntimeAppearanceOptions
|
|
467
|
+
svgExport?: SvgExportOptions & { label?: string; nodeRenderers?: Record<string, SvgNodeRenderer>; runtimeTimelineRenderer?: RuntimeTimelineSvgRenderer }
|
|
429
468
|
onThemeChange?: (state: NovaThemeState) => void
|
|
430
469
|
}
|
|
431
470
|
export class BpmnStudioShell {
|
|
@@ -442,6 +481,8 @@ export class BpmnStudioShell {
|
|
|
442
481
|
setRuntimeAppearance(options: RuntimeAppearanceOptions | null): void
|
|
443
482
|
fitView(): void
|
|
444
483
|
zoomBy(factor: number): void
|
|
484
|
+
exportSvg(options?: SvgExportOptions): Promise<SvgExportArtifact>
|
|
485
|
+
openSvgExportPreview(options?: SvgExportOptions & { previewTitle?: string; onDownload?: (artifact: SvgExportArtifact) => void }): SvgExportPreviewController | null
|
|
445
486
|
destroy(): void
|
|
446
487
|
}
|
|
447
488
|
export function createStudioShell(options: StudioShellOptions): BpmnStudioShell
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
1
|
+
export * from './modules/core/index.js';
|
|
2
|
+
export * from './modules/bpmn-model/index.js';
|
|
3
|
+
export * from './modules/runtime/index.js';
|
|
4
|
+
export * from './modules/theme/index.js';
|
|
5
|
+
export * from './modules/export-svg/index.js';
|
|
6
|
+
export * from './modules/designer/index.js';
|
|
7
|
+
export * from './modules/viewer/index.js';
|
|
8
|
+
export * from './modules/engine-flowable/index.js';
|
|
9
|
+
export * from './modules/engine-activiti/index.js';
|
|
10
|
+
export * from './modules/properties/index.js';
|
|
10
11
|
export * from './controller.js';
|
|
11
12
|
export * from './interactions.js';
|
|
12
13
|
export * from './canvas.js';
|
|
13
14
|
export * from './context-menu.js';
|
|
14
15
|
export * from './shell.js';
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
16
|
+
export * from './modules/icons/index.js';
|
|
17
|
+
export * from './modules/palette/index.js';
|
package/dist/interactions.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EngineId, ProcessModel } from '../core/index.js'
|
|
2
|
+
import type { FlowableEngineProfile } from '../engine-flowable/index.js'
|
|
3
|
+
import type { ActivitiEngineProfile } from '../engine-activiti/index.js'
|
|
4
|
+
|
|
5
|
+
export const engineProfiles: {
|
|
6
|
+
flowable: FlowableEngineProfile
|
|
7
|
+
activiti: ActivitiEngineProfile
|
|
8
|
+
}
|
|
9
|
+
export function detectEngineFromXml(xml: string): EngineId
|
|
10
|
+
export function importBpmn(xml: string, engineHint?: EngineId): ProcessModel
|
|
11
|
+
export function exportBpmn(model: ProcessModel, engineOverride?: EngineId): string
|