@bpmnkit/operate 0.0.14 → 0.0.15
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/css.js +7 -2
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/views/definition-detail.d.ts +1 -1
- package/dist/views/definition-detail.js +16 -17
- package/dist/views/instance-detail.js +2 -0
- package/package.json +2 -2
package/dist/css.js
CHANGED
|
@@ -668,8 +668,13 @@ const OPERATE_CSS = `
|
|
|
668
668
|
display: flex;
|
|
669
669
|
align-items: center;
|
|
670
670
|
gap: 10px;
|
|
671
|
-
|
|
672
|
-
flex-
|
|
671
|
+
height: 40px;
|
|
672
|
+
flex-shrink: 0;
|
|
673
|
+
padding: 0 12px;
|
|
674
|
+
border-bottom: 1px solid var(--bpmnkit-border);
|
|
675
|
+
background: var(--bpmnkit-surface);
|
|
676
|
+
flex-wrap: nowrap;
|
|
677
|
+
overflow: hidden;
|
|
673
678
|
}
|
|
674
679
|
.op-def-meta-name {
|
|
675
680
|
font-weight: 600;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export { createOperate } from "./operate.js";
|
|
2
|
+
export { createDefinitionDetailView } from "./views/definition-detail.js";
|
|
3
|
+
export { createInstanceDetailView } from "./views/instance-detail.js";
|
|
4
|
+
export { createDecisionDetailView } from "./views/decision-detail.js";
|
|
5
|
+
export { DefinitionsStore } from "./stores/definitions.js";
|
|
6
|
+
export { InstancesStore } from "./stores/instances.js";
|
|
7
|
+
export { DecisionsStore } from "./stores/decisions.js";
|
|
2
8
|
export type { DashboardData, IncidentResult, JobSearchResult, OperateApi, OperateOptions, ProcessDefinitionResult, ProcessInstanceResult, ProfileInfo, Theme, UserTaskResult, VariableResult, } from "./types.js";
|
|
3
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export { createOperate } from "./operate.js";
|
|
2
|
+
export { createDefinitionDetailView } from "./views/definition-detail.js";
|
|
3
|
+
export { createInstanceDetailView } from "./views/instance-detail.js";
|
|
4
|
+
export { createDecisionDetailView } from "./views/decision-detail.js";
|
|
5
|
+
export { DefinitionsStore } from "./stores/definitions.js";
|
|
6
|
+
export { InstancesStore } from "./stores/instances.js";
|
|
7
|
+
export { DecisionsStore } from "./stores/decisions.js";
|
|
2
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,7 +5,7 @@ interface Config {
|
|
|
5
5
|
mock: boolean;
|
|
6
6
|
theme: "light" | "dark" | "neon";
|
|
7
7
|
navigate?: (path: string) => void;
|
|
8
|
-
onOpenInEditor?: (xml: string, name: string) => void;
|
|
8
|
+
onOpenInEditor?: (xml: string, name: string, processDefinitionId: string | undefined) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare function createDefinitionDetailView(definitionKey: string, store: DefinitionsStore, cfg: Config, onBack: () => void): {
|
|
11
11
|
el: HTMLElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BpmnCanvas } from "@bpmnkit/canvas";
|
|
2
2
|
import { createConfigPanelPlugin } from "@bpmnkit/plugins/config-panel";
|
|
3
3
|
import { createConfigPanelBpmnPlugin } from "@bpmnkit/plugins/config-panel-bpmn";
|
|
4
|
+
import { injectOperateStyles } from "../css.js";
|
|
4
5
|
import { MOCK_BPMN_XML } from "../mock-data.js";
|
|
5
6
|
function parseVariables(raw) {
|
|
6
7
|
const trimmed = raw.trim();
|
|
@@ -18,30 +19,20 @@ function parseVariables(raw) {
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
export function createDefinitionDetailView(definitionKey, store, cfg, onBack) {
|
|
22
|
+
injectOperateStyles();
|
|
21
23
|
const el = document.createElement("div");
|
|
22
24
|
el.className = "op-view op-def-detail";
|
|
23
|
-
// Breadcrumb
|
|
24
|
-
const breadcrumb = document.createElement("div");
|
|
25
|
-
breadcrumb.className = "op-breadcrumb";
|
|
26
|
-
const backBtn = document.createElement("button");
|
|
27
|
-
backBtn.className = "op-back-btn";
|
|
28
|
-
backBtn.textContent = "← Processes";
|
|
29
|
-
backBtn.addEventListener("click", onBack);
|
|
30
|
-
breadcrumb.appendChild(backBtn);
|
|
31
25
|
let _openInEditorXml = null;
|
|
32
26
|
let _openInEditorName = "";
|
|
27
|
+
let _openInEditorProcessId = undefined;
|
|
33
28
|
const openInEditorBtn = document.createElement("button");
|
|
34
29
|
openInEditorBtn.className = "op-action-btn";
|
|
35
30
|
openInEditorBtn.textContent = "Open in Editor ↗";
|
|
36
|
-
openInEditorBtn.style.marginLeft = "auto";
|
|
37
31
|
openInEditorBtn.style.display = "none";
|
|
38
32
|
openInEditorBtn.addEventListener("click", () => {
|
|
39
33
|
if (_openInEditorXml)
|
|
40
|
-
cfg.onOpenInEditor?.(_openInEditorXml, _openInEditorName);
|
|
34
|
+
cfg.onOpenInEditor?.(_openInEditorXml, _openInEditorName, _openInEditorProcessId);
|
|
41
35
|
});
|
|
42
|
-
if (cfg.onOpenInEditor)
|
|
43
|
-
breadcrumb.appendChild(openInEditorBtn);
|
|
44
|
-
el.appendChild(breadcrumb);
|
|
45
36
|
// Metadata row
|
|
46
37
|
const meta = document.createElement("div");
|
|
47
38
|
meta.className = "op-def-meta";
|
|
@@ -149,10 +140,14 @@ export function createDefinitionDetailView(definitionKey, store, cfg, onBack) {
|
|
|
149
140
|
key.className = "op-instance-key";
|
|
150
141
|
key.textContent = def.processDefinitionKey ?? "";
|
|
151
142
|
meta.appendChild(key);
|
|
143
|
+
if (cfg.onOpenInEditor) {
|
|
144
|
+
openInEditorBtn.style.marginLeft = "auto";
|
|
145
|
+
meta.appendChild(openInEditorBtn);
|
|
146
|
+
}
|
|
152
147
|
const startBtn = document.createElement("button");
|
|
153
148
|
startBtn.className = "op-action-btn op-action-btn--primary";
|
|
154
149
|
startBtn.textContent = "▶ Start Instance";
|
|
155
|
-
startBtn.style.marginLeft = "auto";
|
|
150
|
+
startBtn.style.marginLeft = cfg.onOpenInEditor ? "" : "auto";
|
|
156
151
|
startBtn.addEventListener("click", () => showStartModal(def));
|
|
157
152
|
meta.appendChild(startBtn);
|
|
158
153
|
}
|
|
@@ -305,9 +300,10 @@ export function createDefinitionDetailView(definitionKey, store, cfg, onBack) {
|
|
|
305
300
|
el.appendChild(overlay);
|
|
306
301
|
setTimeout(() => bizInput.focus(), 0);
|
|
307
302
|
}
|
|
308
|
-
function loadCanvas(xml, name) {
|
|
303
|
+
function loadCanvas(xml, name, processDefinitionId) {
|
|
309
304
|
_openInEditorXml = xml;
|
|
310
305
|
_openInEditorName = name;
|
|
306
|
+
_openInEditorProcessId = processDefinitionId;
|
|
311
307
|
openInEditorBtn.style.display = "";
|
|
312
308
|
canvas?.destroy();
|
|
313
309
|
canvasWrap.innerHTML = "";
|
|
@@ -315,6 +311,7 @@ export function createDefinitionDetailView(definitionKey, store, cfg, onBack) {
|
|
|
315
311
|
container: canvasWrap,
|
|
316
312
|
xml,
|
|
317
313
|
theme: cfg.theme,
|
|
314
|
+
fit: "center",
|
|
318
315
|
plugins: [bridgePlugin, configPanel, configPanelBpmn],
|
|
319
316
|
});
|
|
320
317
|
}
|
|
@@ -322,12 +319,13 @@ export function createDefinitionDetailView(definitionKey, store, cfg, onBack) {
|
|
|
322
319
|
const def = getDef();
|
|
323
320
|
renderMeta(def);
|
|
324
321
|
const mockName = def?.name ?? def?.processDefinitionId ?? "Process";
|
|
325
|
-
loadCanvas(MOCK_BPMN_XML, mockName);
|
|
322
|
+
loadCanvas(MOCK_BPMN_XML, mockName, def?.processDefinitionId);
|
|
326
323
|
}
|
|
327
324
|
else {
|
|
328
325
|
const def = getDef();
|
|
329
326
|
renderMeta(def);
|
|
330
327
|
const defName = def?.name ?? def?.processDefinitionId ?? "Process";
|
|
328
|
+
const defProcessId = def?.processDefinitionId;
|
|
331
329
|
fetch(`${cfg.proxyUrl}/api/process-definitions/${definitionKey}/xml`, {
|
|
332
330
|
headers: {
|
|
333
331
|
accept: "text/xml",
|
|
@@ -335,7 +333,7 @@ export function createDefinitionDetailView(definitionKey, store, cfg, onBack) {
|
|
|
335
333
|
},
|
|
336
334
|
})
|
|
337
335
|
.then((r) => r.text())
|
|
338
|
-
.then((xml) => loadCanvas(xml, defName))
|
|
336
|
+
.then((xml) => loadCanvas(xml, defName, defProcessId))
|
|
339
337
|
.catch(() => {
|
|
340
338
|
canvasWrap.innerHTML = `<div style="padding:24px;color:var(--bpmnkit-fg-muted)">Failed to load diagram</div>`;
|
|
341
339
|
});
|
|
@@ -352,6 +350,7 @@ export function createDefinitionDetailView(definitionKey, store, cfg, onBack) {
|
|
|
352
350
|
destroy() {
|
|
353
351
|
canvas?.destroy();
|
|
354
352
|
defUnsub();
|
|
353
|
+
el.remove();
|
|
355
354
|
},
|
|
356
355
|
};
|
|
357
356
|
}
|
|
@@ -3,6 +3,7 @@ import { createConfigPanelPlugin } from "@bpmnkit/plugins/config-panel";
|
|
|
3
3
|
import { createConfigPanelBpmnPlugin } from "@bpmnkit/plugins/config-panel-bpmn";
|
|
4
4
|
import { createTokenHighlightPlugin } from "@bpmnkit/plugins/token-highlight";
|
|
5
5
|
import { badge } from "../components/badge.js";
|
|
6
|
+
import { injectOperateStyles } from "../css.js";
|
|
6
7
|
import { MOCK_ACTIVE_ELEMENTS, MOCK_BPMN_XML, MOCK_VARIABLES, MOCK_VISITED_ELEMENTS, } from "../mock-data.js";
|
|
7
8
|
import { IncidentsStore } from "../stores/incidents.js";
|
|
8
9
|
function relTime(iso) {
|
|
@@ -129,6 +130,7 @@ function highlightTextNodes(container, query) {
|
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
export function createInstanceDetailView(instanceKey, instancesStore, cfg, onBack) {
|
|
133
|
+
injectOperateStyles();
|
|
132
134
|
const el = document.createElement("div");
|
|
133
135
|
el.className = "op-view op-instance-detail";
|
|
134
136
|
// Breadcrumb
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpmnkit/operate",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Monitoring and operations frontend for Camunda 8 clusters — real-time SSE, zero dependencies",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@bpmnkit/api": "0.0.13",
|
|
22
22
|
"@bpmnkit/canvas": "0.0.15",
|
|
23
23
|
"@bpmnkit/core": "0.0.15",
|
|
24
|
-
"@bpmnkit/plugins": "0.0.
|
|
24
|
+
"@bpmnkit/plugins": "0.0.18",
|
|
25
25
|
"@bpmnkit/ui": "0.0.9"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|