@bpmn-nova/vue 0.3.4-preview → 0.3.6-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 +14 -267
- package/dist/index.d.ts +86 -1
- package/dist/index.js +73 -9
- package/dist/styles.css +72 -12
- package/llms-full.txt +3924 -826
- package/llms.txt +64 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ BPMN Nova 的 Vue 3.3+ Adapter,提供 Studio、Designer、Viewer、审批轨
|
|
|
4
4
|
|
|
5
5
|
> **English summary:** Vue 3.3+ components and exposed instance methods for BPMN Nova process design, viewing, approval traces, properties, themes, and SVG export.
|
|
6
6
|
|
|
7
|
-
> 当前版本为 `0.3.
|
|
7
|
+
> 当前版本为 `0.3.6-preview`。Vue 由宿主工程提供,本包不会替应用选择或升级框架版本。
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -14,29 +14,11 @@ BPMN Nova 的 Vue 3.3+ Adapter,提供 Studio、Designer、Viewer、审批轨
|
|
|
14
14
|
npm install @bpmn-nova/vue@preview
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
import '@bpmn-nova/vue/styles.css'
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
只安装本包;`@bpmn-nova/studio` 会作为内部依赖自动解析。容器必须有明确高度。
|
|
22
|
-
|
|
23
|
-
TypeScript 类型也从 Vue 入口导入,不要为了模型类型额外声明 Studio 直依赖:
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
import type {
|
|
27
|
-
BpmnNode,
|
|
28
|
-
EdgeType,
|
|
29
|
-
ElementSelection,
|
|
30
|
-
NodeType,
|
|
31
|
-
ProcessModel,
|
|
32
|
-
} from '@bpmn-nova/vue'
|
|
33
|
-
```
|
|
17
|
+
只安装本包;匹配版本的 `@bpmn-nova/studio` 会作为依赖自动解析。公共 TypeScript 类型直接从 `@bpmn-nova/vue` 导入,不需要为类型额外添加 Studio 直依赖。
|
|
34
18
|
|
|
35
|
-
|
|
19
|
+
CSS 必须显式导入 `@bpmn-nova/vue/styles.css`;视觉容器及其父级需要具有可计算高度。
|
|
36
20
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
## 流程设计
|
|
21
|
+
## 最小用法
|
|
40
22
|
|
|
41
23
|
```vue
|
|
42
24
|
<script setup>
|
|
@@ -46,6 +28,7 @@ import '@bpmn-nova/vue/styles.css'
|
|
|
46
28
|
|
|
47
29
|
const props = defineProps({ initialXml: String })
|
|
48
30
|
const studioRef = ref(null)
|
|
31
|
+
const studioConfig = { ui: { controlSize: 'medium' } }
|
|
49
32
|
|
|
50
33
|
function handleChange(model, reason, nextXml) {
|
|
51
34
|
console.log(reason, nextXml)
|
|
@@ -58,6 +41,7 @@ function handleChange(model, reason, nextXml) {
|
|
|
58
41
|
ref="studioRef"
|
|
59
42
|
:xml="props.initialXml"
|
|
60
43
|
engine="flowable"
|
|
44
|
+
:config="studioConfig"
|
|
61
45
|
mode="design"
|
|
62
46
|
:allowed-modes="['design']"
|
|
63
47
|
theme="auto"
|
|
@@ -67,254 +51,17 @@ function handleChange(model, reason, nextXml) {
|
|
|
67
51
|
</template>
|
|
68
52
|
```
|
|
69
53
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
`xml`/`model` 是外部替换输入,`change` 的 XML 是草稿输出。宿主回写完全相同的导出 XML 不会重新导入或清空撤销历史;切换服务器 revision 或流程时传入不同 XML 会替换模型。Activiti 宿主应显式使用 `engine="activiti"`。
|
|
73
|
-
|
|
74
|
-
## 组合宿主头部与业务属性面板
|
|
75
|
-
|
|
76
|
-
默认 `BpmnStudio` 是包含 Header、Palette、Canvas、Properties 和 Statusbar 的完整工作台。下面的接入显式隐藏 Nova Properties,保留 Nova Palette,并只替换 Header 左侧品牌区:
|
|
77
|
-
|
|
78
|
-
```vue
|
|
79
|
-
<script setup>
|
|
80
|
-
import { ref } from 'vue'
|
|
81
|
-
import { BpmnStudio } from '@bpmn-nova/vue'
|
|
82
|
-
import '@bpmn-nova/vue/styles.css'
|
|
83
|
-
|
|
84
|
-
const studioRef = ref(null)
|
|
85
|
-
const selectedElement = ref(null)
|
|
86
|
-
const supportedNodeTypes = ['startEvent', 'userTask', 'exclusiveGateway', 'endEvent']
|
|
87
|
-
|
|
88
|
-
function handleSelectionChange(selection, element) {
|
|
89
|
-
selectedElement.value = selection ? element : null
|
|
90
|
-
}
|
|
91
|
-
</script>
|
|
92
|
-
|
|
93
|
-
<template>
|
|
94
|
-
<div class="process-design-workbench">
|
|
95
|
-
<BpmnStudio
|
|
96
|
-
ref="studioRef"
|
|
97
|
-
:xml="xml"
|
|
98
|
-
engine="activiti"
|
|
99
|
-
mode="design"
|
|
100
|
-
:allowed-modes="['design']"
|
|
101
|
-
:allowed-node-types="supportedNodeTypes"
|
|
102
|
-
:allowed-edge-types="['sequenceFlow']"
|
|
103
|
-
:regions="{ right: 'hidden' }"
|
|
104
|
-
theme="auto"
|
|
105
|
-
@change="handleChange"
|
|
106
|
-
@selection-change="handleSelectionChange"
|
|
107
|
-
@validation="handleValidation"
|
|
108
|
-
>
|
|
109
|
-
<template #header-start="{ state, actions }">
|
|
110
|
-
<button type="button" @click="back">← 返回审批列表</button>
|
|
111
|
-
<ApprovalIcon :icon="icon" />
|
|
112
|
-
<strong>{{ processName }}</strong>
|
|
113
|
-
<span>{{ processType }}</span>
|
|
114
|
-
</template>
|
|
115
|
-
<template #header-actions="{ actions, mode }">
|
|
116
|
-
<button type="button" :disabled="mode !== 'design'" @click="actions.validate()">校验</button>
|
|
117
|
-
<button type="button" :disabled="mode !== 'design'" @click="saveDraft(actions.exportXml())">保存</button>
|
|
118
|
-
<button type="button" :disabled="mode !== 'design'" @click="publishProcess(actions)">发布</button>
|
|
119
|
-
</template>
|
|
120
|
-
</BpmnStudio>
|
|
121
|
-
|
|
122
|
-
<DxProcessProperties
|
|
123
|
-
v-if="selectedElement"
|
|
124
|
-
:element-id="selectedElement.id"
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
</template>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
`header-start` 与 `header-actions` 使用 Vue Teleport 在当前应用内渲染,因此保留 provide/inject、响应式状态与组件生命周期。`header-actions` 只替换默认“校验 / 导入 / 导出”动作组,完整 `header` 的优先级更高。默认 Header 的最佳视图只保留在底部缩放区;若整个 Header 都不需要,配置 `regions.header = 'hidden'`。
|
|
131
|
-
|
|
132
|
-
`actions.validate()` 以 `toolbar` 来源先更新 Nova 默认状态栏,再发送 `validation` 事件并返回 issues;Expose `validate()` 使用 `api` 来源。事件的 `valid` 仅在存在 error 时为 `false`,warning 不默认阻止发布。保存与发布仍由宿主负责。
|
|
133
|
-
|
|
134
|
-
```js
|
|
135
|
-
async function publishProcess(actions) {
|
|
136
|
-
const issues = actions.validate()
|
|
137
|
-
if (issues.some((issue) => issue.level === 'error')) return
|
|
138
|
-
await publishXml(actions.exportXml())
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
编辑器属性面板应订阅 `selection-change`,该事件覆盖节点、连线、多选、清空和键盘选择。`element-click` 是点击观察事件,不能代替选择状态。宿主使用稳定 BPMN Element ID 关联业务配置,并自行拥有保存、发布、权限和服务端事务。
|
|
143
|
-
|
|
144
|
-
## Mode 双向同步与副标题刷新
|
|
145
|
-
|
|
146
|
-
```vue
|
|
147
|
-
<script setup>
|
|
148
|
-
import { ref } from 'vue'
|
|
149
|
-
|
|
150
|
-
const studioRef = ref(null)
|
|
151
|
-
const mode = ref('design')
|
|
152
|
-
const summaries = new Map()
|
|
153
|
-
const resolveSubtitle = ({ node }) => summaries.has(node.id)
|
|
154
|
-
? summaries.get(node.id)
|
|
155
|
-
: undefined
|
|
156
|
-
|
|
157
|
-
function updateSummary() {
|
|
158
|
-
summaries.set('ServiceTask_Archive', '归档到采购系统')
|
|
159
|
-
studioRef.value?.refreshPresentation()
|
|
160
|
-
}
|
|
161
|
-
</script>
|
|
162
|
-
|
|
163
|
-
<template>
|
|
164
|
-
<BpmnStudio
|
|
165
|
-
ref="studioRef"
|
|
166
|
-
v-model:mode="mode"
|
|
167
|
-
:allowed-modes="['design', 'viewer']"
|
|
168
|
-
:node-subtitle-resolver="resolveSubtitle"
|
|
169
|
-
@mode-change="event => console.log(event.source)"
|
|
170
|
-
>
|
|
171
|
-
<template #header-start="{ mode: actualMode }">
|
|
172
|
-
<HostHeader :mode="actualMode" />
|
|
173
|
-
</template>
|
|
174
|
-
</BpmnStudio>
|
|
175
|
-
</template>
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
Expose 的 `getMode()` / `setMode()` 使用 Shell 实际状态。Resolver 返回 `undefined` 保留默认值、`null` 移除副标题行、字符串替换显示;函数引用变化会自动刷新,稳定闭包内部数据变化需显式调用 `refreshPresentation()`。Resolver 只影响 Design/Viewer 标准卡片和 SVG,不覆盖 Instance Runtime Presentation,也不修改 XML、History、Selection 或 Viewport。
|
|
179
|
-
|
|
180
|
-
## 只读展示与审批轨迹
|
|
181
|
-
|
|
182
|
-
```vue
|
|
183
|
-
<script setup>
|
|
184
|
-
import { BpmnViewer } from '@bpmn-nova/vue'
|
|
185
|
-
import '@bpmn-nova/vue/styles.css'
|
|
186
|
-
|
|
187
|
-
defineProps({
|
|
188
|
-
xml: String,
|
|
189
|
-
runtime: Object,
|
|
190
|
-
runtimeAssetResolver: Function,
|
|
191
|
-
})
|
|
192
|
-
</script>
|
|
193
|
-
|
|
194
|
-
<template>
|
|
195
|
-
<div style="height: 720px">
|
|
196
|
-
<BpmnViewer
|
|
197
|
-
:xml="xml"
|
|
198
|
-
engine="flowable"
|
|
199
|
-
:runtime="runtime"
|
|
200
|
-
projection="compact"
|
|
201
|
-
responsive
|
|
202
|
-
theme="auto"
|
|
203
|
-
:runtime-asset-resolver="runtimeAssetResolver"
|
|
204
|
-
@trace-click="event => console.log(event)"
|
|
205
|
-
/>
|
|
206
|
-
</div>
|
|
207
|
-
</template>
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
- `approval`:实际发生的有效路径。
|
|
211
|
-
- `compact`:移动时间线、审批动作、图片和附件。
|
|
212
|
-
- `standard`:完整 BPMN 叠加运行状态。
|
|
213
|
-
|
|
214
|
-

|
|
215
|
-
|
|
216
|
-
## Runtime Action 与附件
|
|
217
|
-
|
|
218
|
-
```js
|
|
219
|
-
const runtime = {
|
|
220
|
-
processInstanceId: 'purchase-20260824',
|
|
221
|
-
status: 'running',
|
|
222
|
-
activities: [{
|
|
223
|
-
id: 'activity-manager-1',
|
|
224
|
-
elementId: 'UserTask_Manager',
|
|
225
|
-
visitId: 'visit-manager-1',
|
|
226
|
-
status: 'completed',
|
|
227
|
-
assignee: '李经理',
|
|
228
|
-
}],
|
|
229
|
-
actions: [{
|
|
230
|
-
id: 'approve-manager-1',
|
|
231
|
-
type: 'approve',
|
|
232
|
-
elementId: 'UserTask_Manager',
|
|
233
|
-
visitId: 'visit-manager-1',
|
|
234
|
-
occurredAt: '2026-08-24T10:12:00+08:00',
|
|
235
|
-
actor: { id: 'manager-li', name: '李经理' },
|
|
236
|
-
content: {
|
|
237
|
-
plainText: '资料完整,同意提交总经理审批。',
|
|
238
|
-
blocks: [{ type: 'file', assetId: 'purchase-checklist' }],
|
|
239
|
-
assets: [{
|
|
240
|
-
id: 'purchase-checklist',
|
|
241
|
-
name: '采购核验清单.txt',
|
|
242
|
-
mediaType: 'text/plain',
|
|
243
|
-
size: 248,
|
|
244
|
-
}],
|
|
245
|
-
},
|
|
246
|
-
}],
|
|
247
|
-
visitedEdges: [],
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const runtimeAssetResolver = async (asset, { purpose, signal }) => {
|
|
251
|
-
const response = await fetch(
|
|
252
|
-
`/api/runtime-assets/${encodeURIComponent(asset.id)}?purpose=${purpose}`,
|
|
253
|
-
{ signal },
|
|
254
|
-
)
|
|
255
|
-
return response.ok ? response.url : null
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
Runtime Snapshot 只保存资源引用;上传、存储和权限签发由宿主负责。
|
|
260
|
-
|
|
261
|
-
## 主题和 SVG 导出
|
|
262
|
-
|
|
263
|
-
```vue
|
|
264
|
-
<BpmnStudio
|
|
265
|
-
ref="studioRef"
|
|
266
|
-
:xml="xml"
|
|
267
|
-
:theme="{
|
|
268
|
-
mode: 'auto',
|
|
269
|
-
dark: {
|
|
270
|
-
colors: {
|
|
271
|
-
canvas: '#0b1018',
|
|
272
|
-
surface: '#18202b',
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
}"
|
|
276
|
-
/>
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
```js
|
|
280
|
-
studioRef.value?.openSvgExportPreview({
|
|
281
|
-
theme: 'current',
|
|
282
|
-
filename: '采购申请审批流程.svg',
|
|
283
|
-
})
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
主题属性变化会更新现有实例,不会重新挂载画布、清除选择或关闭详情。
|
|
287
|
-
|
|
288
|
-
## Properties 与自定义 Renderer
|
|
289
|
-
|
|
290
|
-
本包还导出:
|
|
291
|
-
|
|
292
|
-
- `BpmnDesigner`、`BpmnCanvas`、`BpmnPalettePanel`、`BpmnPropertiesPanel`
|
|
293
|
-
- `useBpmnStudio`
|
|
294
|
-
- `createVuePropertyComponent`
|
|
295
|
-
- `createVueRuntimeDetailsComponent`
|
|
296
|
-
- `createVueRuntimeTransitionDetailsComponent`
|
|
297
|
-
- `createVueRuntimeTimelineComponent`
|
|
298
|
-
- `createStudioController`、`createEmptyProcess`、`importBpmn`、`exportBpmn`
|
|
299
|
-
- Palette、Properties、Context Menu、Icon 和 Template Registry 的公开创建函数
|
|
300
|
-
|
|
301
|
-
完整工作台可通过 `allowedNodeTypes` 与 `allowedEdgeTypes` 限制宿主支持的图元类型,通过 `allowedModes` 限制可切换的工作台模式。图元限制同时作用于 XML 导入、Palette、连接、快捷新增、模板和节点类型转换。
|
|
302
|
-
|
|
303
|
-
## 常见问题
|
|
54
|
+
`initialXml` 由宿主提供。组件负责实例生命周期;SSR 应用只在客户端挂载。`xml` / `model` 用于外部替换输入,事件中的 XML 是草稿输出。
|
|
304
55
|
|
|
305
|
-
|
|
306
|
-
- **无样式:** 导入一次 `@bpmn-nova/vue/styles.css`。
|
|
307
|
-
- **Vue 重复:** Vue 应由宿主提供并保持单实例。
|
|
308
|
-
- **SSR:** 将可视组件放到客户端挂载阶段。
|
|
309
|
-
- **包选择:** Vue 项目只直接安装 `@bpmn-nova/vue`。
|
|
56
|
+
## 完整文档
|
|
310
57
|
|
|
311
|
-
|
|
58
|
+
- [官网与文档](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/src/index.md)
|
|
59
|
+
- [Vue 接入、宿主组合和完整示例](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/src/guide/vue.md)
|
|
60
|
+
- [组件参数与事件](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/src/components/index.md)、[公开 API](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/src/api/index.md)
|
|
61
|
+
- [审批轨迹接入](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/src/guide/runtime.md)、[自定义扩展](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/src/customization/index.md)
|
|
62
|
+
- [更新日志](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/src/changelog.md)
|
|
312
63
|
|
|
313
|
-
|
|
314
|
-
- npm 包内 `llms-full.txt`:完整 AI 上下文
|
|
315
|
-
- [完整项目能力](https://github.com/daxiangme/bpmn-nova)
|
|
316
|
-
- [React/Vue 组件说明](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/COMPONENTS.md)
|
|
317
|
-
- [公开 Interface](https://github.com/daxiangme/bpmn-nova/blob/dev/docs/API.md)
|
|
64
|
+
官网尚未部署,以上链接暂指向仓库文档。AI 接入从随包的 `llms.txt` 开始;`llms-full.txt` 提供完整离线上下文,两份文件都包含在 npm tarball 中。
|
|
318
65
|
|
|
319
66
|
## License
|
|
320
67
|
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type { ProcessInstanceSnapshot } from '@bpmn-nova/studio/runtime'
|
|
|
14
14
|
import type { SvgExportArtifact, SvgExportOptions, SvgExportPreviewController } from '@bpmn-nova/studio/export-svg'
|
|
15
15
|
import type {
|
|
16
16
|
BpmnCanvas as CanvasInstance,
|
|
17
|
+
BpmnStudioConfig,
|
|
17
18
|
BpmnStudioController,
|
|
18
19
|
BpmnStudioShell,
|
|
19
20
|
ContextMenuRegistry,
|
|
@@ -22,6 +23,10 @@ import type {
|
|
|
22
23
|
StudioCommands,
|
|
23
24
|
StudioMode,
|
|
24
25
|
StudioModeChangeEvent,
|
|
26
|
+
StudioPanelSelection,
|
|
27
|
+
StudioSidebarChangeEvent,
|
|
28
|
+
StudioSidebarSide,
|
|
29
|
+
StudioSidebarState,
|
|
25
30
|
StudioValidationEvent,
|
|
26
31
|
StudioValidationIssue,
|
|
27
32
|
StudioShellActions,
|
|
@@ -29,6 +34,7 @@ import type {
|
|
|
29
34
|
StudioShellRegions,
|
|
30
35
|
StudioShellSlots,
|
|
31
36
|
StudioState,
|
|
37
|
+
StudioUiContext,
|
|
32
38
|
TemplateRegistry,
|
|
33
39
|
} from '@bpmn-nova/studio'
|
|
34
40
|
import type { NovaThemeInput, NovaThemeState, RuntimeAppearanceOptions } from '@bpmn-nova/studio/theme'
|
|
@@ -53,13 +59,58 @@ export type {
|
|
|
53
59
|
ProcessModel,
|
|
54
60
|
} from '@bpmn-nova/studio'
|
|
55
61
|
export type {
|
|
62
|
+
BpmnStudioConfig,
|
|
56
63
|
NodeSubtitleResolver,
|
|
57
64
|
NodeSubtitleResolverContext,
|
|
65
|
+
StudioControlSize,
|
|
66
|
+
StudioModelingConfig,
|
|
67
|
+
StudioPanelSelection,
|
|
68
|
+
StudioRightPanelConfig,
|
|
69
|
+
StudioSidebarChangeEvent,
|
|
70
|
+
StudioSidebarChangeSource,
|
|
71
|
+
StudioSidebarConfig,
|
|
72
|
+
StudioSidebarSide,
|
|
73
|
+
StudioSidebarState,
|
|
74
|
+
StudioSvgExportOptions,
|
|
75
|
+
StudioUiConfig,
|
|
76
|
+
StudioUiContext,
|
|
58
77
|
StudioValidationEvent,
|
|
59
78
|
StudioValidationIssue,
|
|
60
79
|
StudioValidationSource,
|
|
80
|
+
StudioViewerConfig,
|
|
61
81
|
} from '@bpmn-nova/studio'
|
|
62
82
|
|
|
83
|
+
/** Runtime integration facade. Types since 0.3.5-preview; inspectRuntime / formatRuntimeInstant since 0.3.6-preview. */
|
|
84
|
+
export type {
|
|
85
|
+
ActivityInstance,
|
|
86
|
+
ActivityStatus,
|
|
87
|
+
ActivityVisitState,
|
|
88
|
+
ProcessInstanceSnapshot,
|
|
89
|
+
RuntimeApprovalAction,
|
|
90
|
+
RuntimeApprovalActionType,
|
|
91
|
+
RuntimeApprovalContent,
|
|
92
|
+
RuntimeApprovalContentBlock,
|
|
93
|
+
RuntimeAssetRef,
|
|
94
|
+
RuntimeDiagnostic,
|
|
95
|
+
RuntimeEdgeVisit,
|
|
96
|
+
RuntimeInstant,
|
|
97
|
+
RuntimeParticipant,
|
|
98
|
+
RuntimeTransition,
|
|
99
|
+
} from '@bpmn-nova/studio/runtime'
|
|
100
|
+
export {
|
|
101
|
+
activityState,
|
|
102
|
+
createRuntimePresentation,
|
|
103
|
+
formatRuntimeInstant,
|
|
104
|
+
inspectRuntime,
|
|
105
|
+
normalizeRuntime,
|
|
106
|
+
parseRuntimeInstant,
|
|
107
|
+
} from '@bpmn-nova/studio/runtime'
|
|
108
|
+
export type {
|
|
109
|
+
RuntimeAssetPurpose,
|
|
110
|
+
RuntimeAssetResolver,
|
|
111
|
+
RuntimeTraceClickEvent,
|
|
112
|
+
} from '@bpmn-nova/studio/viewer'
|
|
113
|
+
|
|
63
114
|
export {
|
|
64
115
|
createContextMenuRegistry,
|
|
65
116
|
createDefaultContextMenuRegistry,
|
|
@@ -86,7 +137,16 @@ export interface BpmnNovaVisualProps {
|
|
|
86
137
|
onThemeChange?: (state: NovaThemeState) => void
|
|
87
138
|
}
|
|
88
139
|
export interface BpmnModelProps { model?: ProcessModel; xml?: string; engine?: EngineId }
|
|
89
|
-
export interface UseBpmnStudioOptions extends BpmnModelProps {
|
|
140
|
+
export interface UseBpmnStudioOptions extends BpmnModelProps {
|
|
141
|
+
studio?: BpmnStudioController
|
|
142
|
+
config?: BpmnStudioConfig
|
|
143
|
+
/** @deprecated Use config.modeling.propertiesProfile. */
|
|
144
|
+
propertiesProfile?: 'business' | 'developer'
|
|
145
|
+
/** @deprecated Use config.modeling.allowedNodeTypes. */
|
|
146
|
+
allowedNodeTypes?: NodeType[]
|
|
147
|
+
/** @deprecated Use config.modeling.allowedEdgeTypes. */
|
|
148
|
+
allowedEdgeTypes?: EdgeType[]
|
|
149
|
+
}
|
|
90
150
|
export interface UseBpmnStudioResult { studio: BpmnStudioController; state: StudioState; commands: StudioCommands }
|
|
91
151
|
export function useBpmnStudio(options?: UseBpmnStudioOptions): UseBpmnStudioResult
|
|
92
152
|
|
|
@@ -130,8 +190,12 @@ export const BpmnPalettePanel: DefineComponent<BpmnPalettePanelProps>
|
|
|
130
190
|
|
|
131
191
|
export interface BpmnStudioProps extends BpmnNovaVisualProps, BpmnModelProps {
|
|
132
192
|
studio?: BpmnStudioController
|
|
193
|
+
config?: BpmnStudioConfig
|
|
194
|
+
/** @deprecated Use config.modeling.propertiesProfile. */
|
|
133
195
|
propertiesProfile?: 'business' | 'developer'
|
|
196
|
+
/** @deprecated Use config.modeling.allowedNodeTypes. */
|
|
134
197
|
allowedNodeTypes?: NodeType[]
|
|
198
|
+
/** @deprecated Use config.modeling.allowedEdgeTypes. */
|
|
135
199
|
allowedEdgeTypes?: EdgeType[]
|
|
136
200
|
iconRegistry?: IconRegistry
|
|
137
201
|
paletteRegistry?: PaletteRegistry
|
|
@@ -143,39 +207,56 @@ export interface BpmnStudioProps extends BpmnNovaVisualProps, BpmnModelProps {
|
|
|
143
207
|
nodeSubtitleResolver?: NodeSubtitleResolver
|
|
144
208
|
slotsConfig?: StudioShellSlots
|
|
145
209
|
layout?: StudioShellOptions['layout']
|
|
210
|
+
/** @deprecated Use config.ui.regions. */
|
|
146
211
|
regions?: StudioShellRegions
|
|
212
|
+
/** @deprecated Use config.ui.sidebarWidth.left. */
|
|
147
213
|
leftWidth?: number
|
|
214
|
+
/** @deprecated Use config.ui.sidebarWidth.right. */
|
|
148
215
|
rightWidth?: number
|
|
149
216
|
runtime?: ProcessInstanceSnapshot | null
|
|
150
217
|
runtimePresenter?: ViewerOptions['runtimePresenter']
|
|
151
218
|
runtimeTraceProjector?: ViewerOptions['runtimeTraceProjector']
|
|
152
219
|
runtimeAssetResolver?: ViewerOptions['runtimeAssetResolver']
|
|
153
220
|
runtimeTimelineRenderer?: RuntimeTimelineRenderer
|
|
221
|
+
/** @deprecated Use config.export. */
|
|
154
222
|
svgExport?: ViewerOptions['svgExport']
|
|
155
223
|
onRuntimeTraceItemClick?: ViewerOptions['onRuntimeTraceItemClick']
|
|
156
224
|
runtimeDetailsRenderer?: RuntimeDetailsRenderer | null
|
|
157
225
|
onRuntimeDetailsOpen?: ViewerOptions['onRuntimeDetailsOpen']
|
|
158
226
|
runtimeTransitionDetailsRenderer?: RuntimeTransitionDetailsRenderer | null
|
|
159
227
|
onRuntimeTransitionDetailsOpen?: ViewerOptions['onRuntimeTransitionDetailsOpen']
|
|
228
|
+
/** @deprecated Use config.viewer.timeline. */
|
|
160
229
|
timeline?: ViewerOptions['timeline']
|
|
230
|
+
/** @deprecated Use config.viewer.runtimeDetails. */
|
|
161
231
|
runtimeDetails?: ViewerOptions['runtimeDetails']
|
|
232
|
+
/** @deprecated Use config.viewer.runtimeTraceOptions. */
|
|
162
233
|
runtimeTraceOptions?: ViewerOptions['runtimeTraceOptions']
|
|
163
234
|
onTraceClick?: (event: RuntimeTraceClickEvent) => void
|
|
164
235
|
onElementClick?: ViewerOptions['onElementClick']
|
|
165
236
|
mode?: StudioMode
|
|
166
237
|
allowedModes?: readonly StudioMode[]
|
|
167
238
|
projection?: ViewerProjection
|
|
239
|
+
/** @deprecated Use config.viewer.responsive. */
|
|
168
240
|
responsive?: boolean
|
|
241
|
+
/** @deprecated Use config.viewer.projectionOptions. */
|
|
169
242
|
projectionOptions?: Array<{ value: ViewerProjection; label: string }>
|
|
243
|
+
onSidebarChange?: (event: StudioSidebarChangeEvent) => void
|
|
170
244
|
}
|
|
171
245
|
export interface BpmnStudioExposed {
|
|
172
246
|
getStudio(): BpmnStudioController
|
|
173
247
|
getShell(): BpmnStudioShell | null
|
|
174
248
|
getActions(): StudioShellActions | null
|
|
249
|
+
getConfig(): Readonly<BpmnStudioConfig> | undefined
|
|
250
|
+
setConfig(config?: BpmnStudioConfig): Readonly<BpmnStudioConfig> | undefined
|
|
175
251
|
getMode(): StudioMode | undefined
|
|
176
252
|
getAllowedModes(): readonly StudioMode[]
|
|
177
253
|
setMode(mode: StudioMode): boolean
|
|
178
254
|
setAllowedModes(modes: readonly StudioMode[]): readonly StudioMode[]
|
|
255
|
+
getSidebarState(): StudioSidebarState | undefined
|
|
256
|
+
setSidebarCollapsed(side: StudioSidebarSide, collapsed: boolean): boolean
|
|
257
|
+
subscribeSidebarChange(listener: (event: StudioSidebarChangeEvent) => void): () => void
|
|
258
|
+
getPanelSelection(): StudioPanelSelection | undefined
|
|
259
|
+
subscribePanelSelection(listener: (selection: StudioPanelSelection) => void): () => void
|
|
179
260
|
refreshPresentation(): void
|
|
180
261
|
validate(): StudioValidationIssue[]
|
|
181
262
|
exportXml(engine?: EngineId): string
|
|
@@ -190,11 +271,14 @@ export interface BpmnStudioSlotContext {
|
|
|
190
271
|
readonly actions: StudioShellActions
|
|
191
272
|
readonly state: Readonly<StudioState>
|
|
192
273
|
readonly mode: StudioMode
|
|
274
|
+
readonly ui: StudioUiContext
|
|
275
|
+
readonly panelSelection: StudioPanelSelection
|
|
193
276
|
}
|
|
194
277
|
export interface BpmnStudioSlots {
|
|
195
278
|
'header-start'?(context: BpmnStudioSlotContext): VNodeChild
|
|
196
279
|
'header-actions'?(context: BpmnStudioSlotContext): VNodeChild
|
|
197
280
|
header?(context: BpmnStudioSlotContext): VNodeChild
|
|
281
|
+
right?(context: BpmnStudioSlotContext): VNodeChild
|
|
198
282
|
}
|
|
199
283
|
export const BpmnStudio: DefineComponent<BpmnStudioProps> & {
|
|
200
284
|
new(): { $slots: BpmnStudioSlots }
|
|
@@ -263,6 +347,7 @@ export interface BpmnStudioEmits {
|
|
|
263
347
|
'update:mode': [mode: StudioMode]
|
|
264
348
|
'mode-change': [event: StudioModeChangeEvent]
|
|
265
349
|
validation: [event: StudioValidationEvent]
|
|
350
|
+
'sidebar-change': [event: StudioSidebarChangeEvent]
|
|
266
351
|
}
|
|
267
352
|
export interface BpmnDesignerEmits {
|
|
268
353
|
change: [model: ProcessModel, reason: string, xml: string]
|