@bpmn-nova/react 0.3.2-preview → 0.3.3-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/llms.txt CHANGED
@@ -51,6 +51,8 @@ Choose the smallest Interface that owns the required experience:
51
51
 
52
52
  Use `engine="flowable"` or `engine="activiti"` explicitly from the host workflow engine. Do not infer the engine from BPMN XML namespace declarations alone.
53
53
 
54
+ Studio modes are presentation state: `design` means editable process design, `viewer` means read-only process viewing, and `instance` means approval trace. Observe the actual Shell state through `subscribeMode()` or framework mode events; never store it in the BPMN model.
55
+
54
56
  ## 4. Mount a minimal integration
55
57
 
56
58
  Every branch must import its own public `styles.css` exactly once and provide a height through the complete parent layout chain.
@@ -80,7 +82,7 @@ function handleChange(model, reason, xml) {
80
82
  engine="flowable"
81
83
  mode="design"
82
84
  :allowed-edge-types="['sequenceFlow']"
83
- :allowed-modes="['design']"
85
+ :allowed-modes="['design', 'viewer']"
84
86
  theme="auto"
85
87
  @change="handleChange"
86
88
  />
@@ -105,7 +107,7 @@ export function WorkflowEditor({ initialXml, saveDraft }) {
105
107
  engine="flowable"
106
108
  mode="design"
107
109
  allowedEdgeTypes={['sequenceFlow']}
108
- allowedModes={['design']}
110
+ allowedModes={['design', 'viewer']}
109
111
  theme="auto"
110
112
  onChange={(model, reason, xml) => saveDraft(xml)}
111
113
  />
@@ -132,7 +134,7 @@ const shell = createStudioShell({
132
134
  container: document.querySelector('#workflow-studio'),
133
135
  studio,
134
136
  mode: 'design',
135
- allowedModes: ['design'],
137
+ allowedModes: ['design', 'viewer'],
136
138
  theme: 'auto',
137
139
  })
138
140
 
@@ -172,17 +174,25 @@ This step is complete when the workbench is visible, the initial XML is rendered
172
174
  <template #header-start="{ state, actions }">
173
175
  <!-- Host back action, business icon, process name, and type -->
174
176
  </template>
177
+ <template #header-actions="{ actions, mode }">
178
+ <!-- Host Validate / Save / Publish actions. Validation calls actions.validate(). -->
179
+ </template>
175
180
  </BpmnStudio>
176
181
  ```
177
182
 
178
- - Vue uses native `#header-start` / `#header` slots. React uses `headerStart` / `header` render props. Core uses `slots.headerStart` / `slots.header`.
179
- - Header Start replaces only the Nova Brand. A complete Header replacement calls the public Actions Interface for undo, redo, layout, fit, validation, BPMN import/export, and SVG export.
183
+ - Vue uses native `#header-start` / `#header-actions` / `#header` slots. React uses `headerStart` / `headerActions` / `header` render props. Core uses matching DOM Slots.
184
+ - Vue supports `v-model:mode` and `mode-change`; React supports `mode` and `onModeChange`. Framework Header contexts expose the actual reactive `mode`. Core Slots use `getMode()` / `subscribeMode()`.
185
+ - Header Start replaces only the Nova Brand. Header Actions replaces only the default Validate / Import / Export group, so a host can compose Validate / Save / Publish without rebuilding the editing tools. A complete Header replacement calls the public Actions Interface.
186
+ - `actions.validate()` updates Nova's default status summary before emitting a read-only validation result with `source: 'toolbar'`; `shell.validate()` and framework Handle/Expose methods use `source: 'api'`. Vue receives `validation`, React receives `onValidation`, and Core uses `subscribeValidation()`. `valid` means there are no errors; warnings do not block publishing by default.
187
+ - The default Header does not duplicate Fit; use the footer control or `fitView()`.
180
188
  - `regions` can hide `header`, `left`, `right`, or `footer` without leaving an empty layout track. Prop changes update the existing Shell; do not rebuild the Canvas.
181
189
  - Put a host-owned properties panel beside the Nova root. Use `selection-change` / `onSelectionChange` as its source of truth because it covers nodes, edges, multi-selection, clearing, and keyboard selection. Do not substitute `element-click` / `onElementClick`.
182
190
  - Join host business configuration by stable BPMN element ID. Saving, publishing, authorization, upload, and server transactions remain host responsibilities.
183
191
  - `theme="auto"` explicitly follows the system theme. The compatibility default remains `light`.
184
192
  - Vue and React both export standalone `BpmnPalettePanel` for a fully custom layout. Pass the same external Studio Controller to Canvas, Palette, and Properties.
185
193
 
194
+ For a host-owned definition-time subtitle, pass `nodeSubtitleResolver` to Studio, Canvas, or Viewer. Return `undefined` for Nova's default subtitle, `null` to remove the row, or a string (including an empty string) as the override. After data inside a stable closure or Map changes, call `refreshPresentation()` on the component handle or Shell. This refresh must not be implemented by mutating a node, re-importing XML, or remounting the component. The resolver applies only to standard Design/Viewer task and container cards and standard SVG fallback; a complete custom renderer wins, and Instance runtime summaries are never overridden.
195
+
186
196
  ## 5. Keep model ownership deterministic
187
197
 
188
198
  - Treat `xml` and `model` as external replacement inputs. Use the emitted/exported XML as the draft output.
@@ -195,9 +205,9 @@ This step is complete when edit, undo, redo, save, reload, and intentional exter
195
205
 
196
206
  ## 6. Add host constraints before business use
197
207
 
198
- Production workflow applications usually support a subset of BPMN. Configure `allowedNodeTypes` and `allowedEdgeTypes` on the Studio Controller or framework `BpmnStudio`; these reject unsupported imported models and block node/edge creation outside the host contract. Configure matching Palette and Properties registries when the host needs custom labels or business fields.
208
+ Production workflow applications usually support a subset of BPMN. Configure `allowedNodeTypes` and `allowedEdgeTypes` on the Studio Controller or framework `BpmnStudio`; these reject unsupported imported models and block node/edge creation outside the host contract. The node allowlist filters Palette entries, but one allowed node type may still have multiple Palette presets. Configure matching Palette and Properties registries when the host needs custom labels or business fields.
199
209
 
200
- Use `allowedModes` to expose only host-authorized workbench modes. Pass real Runtime data for instance mode; absence of Runtime data means no approval trace rather than demo business data.
210
+ Use `allowedModes` to expose only host-authorized workbench modes. Runtime changes use `setAllowedModes()` rather than rebuilding the Studio; invalid, empty, or duplicate lists are errors. Pass real Runtime data for instance mode; absence of Runtime data means no approval trace rather than demo business data.
201
211
 
202
212
  Runtime snapshots store asset references only. The host supplies `runtimeAssetResolver`. BPMN Nova does not execute workflow engines, submit approvals, upload/store attachments, issue permissions, or export PNG/PDF.
203
213
 
@@ -212,10 +222,11 @@ Run the target application's existing non-destructive quality commands, includin
212
222
  3. Create, connect, edit, delete, Undo, and Redo work in design mode.
213
223
  4. Change output is persisted and reloads to the same process.
214
224
  5. Intentional external XML replacement loads once and resets history once.
215
- 6. Disallowed node types are unavailable and rejected by import/creation commands; disallowed modes are not rendered and `setMode()` leaves the current mode unchanged.
225
+ 6. Disallowed node types are unavailable and rejected by import/creation commands; disallowed modes are not rendered and `setMode()` returns `false` without changing state.
216
226
  7. Theme changes update the existing instance.
217
227
  8. Unmount/remount leaves no duplicate listeners, overlays, or framework instances.
218
228
  9. Browser Console has no errors.
229
+ 10. If a subtitle resolver is used, verify override, `undefined`, `null`, SVG parity, and that `refreshPresentation()` preserves XML, history, selection, scope, zoom, pan, theme, and mode. Verify Instance summaries are unchanged.
219
230
 
220
231
  The installation is complete only when the package is present, the production build succeeds, and the relevant browser checks pass. Report any unverified branch explicitly.
221
232
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-nova/react",
3
- "version": "0.3.2-preview",
3
+ "version": "0.3.3-preview",
4
4
  "description": "React components and hooks for BPMN Nova Designer, Viewer, Studio and Properties.",
5
5
  "keywords": [
6
6
  "bpmn",
@@ -42,7 +42,7 @@
42
42
  "react-dom": ">=18"
43
43
  },
44
44
  "dependencies": {
45
- "@bpmn-nova/studio": "0.3.2-preview"
45
+ "@bpmn-nova/studio": "0.3.3-preview"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=18"