@bpmnkit/plugins 0.0.16 → 0.0.17
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 +2 -0
- package/dist/ai-bridge/panel.js +29 -3
- package/dist/live-mode/css.d.ts +4 -0
- package/dist/live-mode/css.js +170 -0
- package/dist/live-mode/index.d.ts +42 -0
- package/dist/live-mode/index.js +479 -0
- package/dist/pattern-advisor/css.d.ts +4 -0
- package/dist/pattern-advisor/css.js +198 -0
- package/dist/pattern-advisor/index.d.ts +20 -0
- package/dist/pattern-advisor/index.js +233 -0
- package/dist/process-runner/css.js +128 -0
- package/dist/process-runner/index.d.ts +52 -0
- package/dist/process-runner/index.js +508 -19
- package/dist/storage/storage-api.d.ts +6 -0
- package/dist/storage/storage-api.js +12 -0
- package/dist/story-view/css.d.ts +4 -0
- package/dist/story-view/css.js +259 -0
- package/dist/story-view/index.d.ts +33 -0
- package/dist/story-view/index.js +294 -0
- package/dist/variable-flow/css.d.ts +2 -0
- package/dist/variable-flow/css.js +98 -0
- package/dist/variable-flow/index.d.ts +12 -0
- package/dist/variable-flow/index.js +226 -0
- package/package.json +21 -5
package/README.md
CHANGED
|
@@ -154,6 +154,8 @@ const ai = createAiBridgePlugin({
|
|
|
154
154
|
| [`@bpmnkit/cli-sdk`](https://www.npmjs.com/package/@bpmnkit/cli-sdk) | Plugin authoring SDK for the casen CLI |
|
|
155
155
|
| [`@bpmnkit/create-casen-plugin`](https://www.npmjs.com/package/@bpmnkit/create-casen-plugin) | Scaffold a new casen CLI plugin in seconds |
|
|
156
156
|
| [`@bpmnkit/casen-report`](https://www.npmjs.com/package/@bpmnkit/casen-report) | HTML reports from Camunda 8 incident and SLA data |
|
|
157
|
+
| [`@bpmnkit/casen-worker-http`](https://www.npmjs.com/package/@bpmnkit/casen-worker-http) | Example HTTP worker plugin — completes jobs with live JSONPlaceholder API data |
|
|
158
|
+
| [`@bpmnkit/casen-worker-ai`](https://www.npmjs.com/package/@bpmnkit/casen-worker-ai) | AI task worker — classify, summarize, extract, and decide using Claude |
|
|
157
159
|
|
|
158
160
|
## License
|
|
159
161
|
|
package/dist/ai-bridge/panel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BpmnCanvas } from "@bpmnkit/canvas";
|
|
2
|
-
import { Bpmn, Dmn, Form, compactify } from "@bpmnkit/core";
|
|
2
|
+
import { Bpmn, Dmn, Form, compactify, optimize } from "@bpmnkit/core";
|
|
3
3
|
import { saveCheckpoint } from "../history/index.js";
|
|
4
4
|
import { injectAiBridgeStyles } from "./css.js";
|
|
5
5
|
const DEFAULT_SERVER = "http://localhost:3033";
|
|
@@ -181,6 +181,32 @@ const EXAMPLE_PROMPTS = [
|
|
|
181
181
|
"Explain what this process does in plain language",
|
|
182
182
|
"Optimize and simplify this diagram — remove redundant elements",
|
|
183
183
|
];
|
|
184
|
+
// ── Variable flow context builder ─────────────────────────────────────────────
|
|
185
|
+
function buildVariableFlowContext(defs) {
|
|
186
|
+
const report = optimize(defs, { categories: ["data-flow"] });
|
|
187
|
+
const byElement = {};
|
|
188
|
+
const undefinedVars = [];
|
|
189
|
+
const deadOutputs = [];
|
|
190
|
+
for (const f of report.findings) {
|
|
191
|
+
const elId = f.elementIds[0];
|
|
192
|
+
if (f.id.startsWith("data-flow/role:") && elId !== undefined) {
|
|
193
|
+
byElement[elId] = {
|
|
194
|
+
...(f.produces?.length ? { produces: f.produces } : {}),
|
|
195
|
+
...(f.consumes?.length ? { consumes: f.consumes } : {}),
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
else if (f.id.startsWith("data-flow/undefined-variable:") && f.consumes?.[0] !== undefined) {
|
|
199
|
+
undefinedVars.push(f.consumes[0]);
|
|
200
|
+
}
|
|
201
|
+
else if (f.id.startsWith("data-flow/dead-output:") && f.produces?.[0] !== undefined) {
|
|
202
|
+
deadOutputs.push(f.produces[0]);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return { byElement, undefinedVars, deadOutputs };
|
|
206
|
+
}
|
|
207
|
+
function buildContext(defs) {
|
|
208
|
+
return { ...compactify(defs), variableFlow: buildVariableFlowContext(defs) };
|
|
209
|
+
}
|
|
184
210
|
export function createAiPanel(options) {
|
|
185
211
|
injectAiBridgeStyles();
|
|
186
212
|
const panel = document.createElement("div");
|
|
@@ -654,7 +680,7 @@ export function createAiPanel(options) {
|
|
|
654
680
|
const aiMsgEl = addMessage("ai", "");
|
|
655
681
|
aiMsgEl.classList.add("ai-msg-cursor");
|
|
656
682
|
const defs = options.getDefinitions();
|
|
657
|
-
const diagramContext = defs ?
|
|
683
|
+
const diagramContext = defs ? buildContext(defs) : null;
|
|
658
684
|
const { fullText, resultXml } = await runStream(history, diagramContext, undefined, signal, aiMsgEl);
|
|
659
685
|
finalizeAiMessage(aiMsgEl, fullText, resultXml);
|
|
660
686
|
history.push({ role: "ai", content: fullText });
|
|
@@ -681,7 +707,7 @@ export function createAiPanel(options) {
|
|
|
681
707
|
addMessage("user", label, contextNodes.length > 0 ? contextNodes : undefined);
|
|
682
708
|
const aiMsgEl = addMessage("ai", "");
|
|
683
709
|
aiMsgEl.classList.add("ai-msg-cursor");
|
|
684
|
-
const context =
|
|
710
|
+
const context = buildContext(defs);
|
|
685
711
|
const { fullText, resultXml } = await runStream(history, context, action, signal, aiMsgEl);
|
|
686
712
|
finalizeAiMessage(aiMsgEl, fullText, resultXml);
|
|
687
713
|
history.push({ role: "ai", content: fullText });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const STYLE_ID = "bpmnkit-live-mode-v1";
|
|
2
|
+
export declare const CSS = "\n/* \u2500\u2500 Toggle button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpmnkit-live-toggle {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 12px;\n border-radius: 6px;\n border: 1px solid var(--bpmnkit-border, #d0d0e8);\n background: var(--bpmnkit-surface-2, #eeeef8);\n color: var(--bpmnkit-fg, #1a1a2e);\n font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;\n}\n.bpmnkit-live-toggle:hover {\n border-color: var(--bpmnkit-accent, #1a56db);\n color: var(--bpmnkit-accent, #1a56db);\n}\n.bpmnkit-live-toggle--on {\n border-color: var(--bpmnkit-success, #16a34a);\n color: var(--bpmnkit-success, #16a34a);\n box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);\n}\n.bpmnkit-live-toggle--blocked {\n border-color: var(--bpmnkit-danger, #dc2626);\n color: var(--bpmnkit-danger, #dc2626);\n background: rgba(220, 38, 38, 0.07);\n}\n\n/* \u2500\u2500 Status pill \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpmnkit-live-status {\n display: inline-block;\n font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n padding: 2px 7px;\n border-radius: 20px;\n background: var(--bpmnkit-surface-2, #eeeef8);\n color: var(--bpmnkit-fg-muted, #6666a0);\n border: 1px solid var(--bpmnkit-border, #d0d0e8);\n}\n.bpmnkit-live-status--off {\n background: var(--bpmnkit-surface-2, #eeeef8);\n color: var(--bpmnkit-fg-muted, #6666a0);\n}\n.bpmnkit-live-status--connecting {\n background: rgba(217, 119, 6, 0.12);\n color: var(--bpmnkit-warn, #d97706);\n border-color: var(--bpmnkit-warn, #d97706);\n}\n.bpmnkit-live-status--live {\n background: rgba(22, 163, 74, 0.12);\n color: var(--bpmnkit-success, #16a34a);\n border-color: var(--bpmnkit-success, #16a34a);\n}\n.bpmnkit-live-status--error {\n background: rgba(220, 38, 38, 0.12);\n color: var(--bpmnkit-danger, #dc2626);\n border-color: var(--bpmnkit-danger, #dc2626);\n}\n.bpmnkit-live-status--blocked {\n background: rgba(220, 38, 38, 0.07);\n color: var(--bpmnkit-danger, #dc2626);\n border-color: var(--bpmnkit-danger, #dc2626);\n}\n\n/* \u2500\u2500 Conflict banner \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpmnkit-live-conflict {\n font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);\n background: rgba(220, 38, 38, 0.07);\n border: 1px solid var(--bpmnkit-danger, #dc2626);\n border-radius: 8px;\n padding: 10px 14px;\n margin: 8px 0;\n font-size: 12px;\n color: var(--bpmnkit-fg, #1a1a2e);\n}\n.bpmnkit-live-conflict-title {\n font-weight: 700;\n color: var(--bpmnkit-danger, #dc2626);\n margin-bottom: 6px;\n}\n.bpmnkit-live-conflict-list {\n list-style: disc;\n padding-left: 18px;\n margin-bottom: 8px;\n}\n.bpmnkit-live-conflict-item {\n font-size: 11px;\n color: var(--bpmnkit-fg-muted, #6666a0);\n font-family: ui-monospace, \"Cascadia Code\", \"JetBrains Mono\", monospace;\n margin-bottom: 2px;\n}\n.bpmnkit-live-btn {\n font-size: 11px;\n padding: 3px 10px;\n border-radius: 5px;\n border: 1px solid var(--bpmnkit-border, #d0d0e8);\n background: var(--bpmnkit-surface, #ffffff);\n color: var(--bpmnkit-fg, #1a1a2e);\n cursor: pointer;\n font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);\n font-weight: 600;\n}\n.bpmnkit-live-btn:hover {\n background: var(--bpmnkit-accent-subtle, rgba(26,86,219,0.12));\n border-color: var(--bpmnkit-accent, #1a56db);\n color: var(--bpmnkit-accent, #1a56db);\n}\n\n/* \u2500\u2500 Variable inspector tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpmnkit-live-vars-tooltip {\n position: fixed;\n z-index: 9999;\n background: var(--bpmnkit-panel-bg, rgba(255,255,255,0.96));\n border: 1px solid var(--bpmnkit-panel-border, rgba(0,0,0,0.1));\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0,0,0,0.14);\n padding: 8px 12px;\n font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);\n font-size: 12px;\n min-width: 160px;\n max-width: 300px;\n pointer-events: none;\n}\n.bpmnkit-live-vars-row {\n display: flex;\n gap: 8px;\n align-items: baseline;\n padding: 2px 0;\n border-bottom: 1px solid var(--bpmnkit-border, #d0d0e8);\n}\n.bpmnkit-live-vars-row:last-child {\n border-bottom: none;\n}\n.bpmnkit-live-vars-name {\n font-weight: 600;\n color: var(--bpmnkit-fg, #1a1a2e);\n flex-shrink: 0;\n}\n.bpmnkit-live-vars-value {\n color: var(--bpmnkit-fg-muted, #6666a0);\n font-family: ui-monospace, \"Cascadia Code\", \"JetBrains Mono\", monospace;\n font-size: 11px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* \u2500\u2500 Light theme overrides \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-live-vars-tooltip {\n background: rgba(255,255,255,0.96);\n border-color: rgba(0,0,0,0.1);\n}\n";
|
|
3
|
+
export declare function injectLiveModeStyles(): void;
|
|
4
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export const STYLE_ID = "bpmnkit-live-mode-v1";
|
|
2
|
+
export const CSS = `
|
|
3
|
+
/* ── Toggle button ─────────────────────────────────────────────────────────── */
|
|
4
|
+
.bpmnkit-live-toggle {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 6px;
|
|
8
|
+
padding: 4px 12px;
|
|
9
|
+
border-radius: 6px;
|
|
10
|
+
border: 1px solid var(--bpmnkit-border, #d0d0e8);
|
|
11
|
+
background: var(--bpmnkit-surface-2, #eeeef8);
|
|
12
|
+
color: var(--bpmnkit-fg, #1a1a2e);
|
|
13
|
+
font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
|
|
18
|
+
}
|
|
19
|
+
.bpmnkit-live-toggle:hover {
|
|
20
|
+
border-color: var(--bpmnkit-accent, #1a56db);
|
|
21
|
+
color: var(--bpmnkit-accent, #1a56db);
|
|
22
|
+
}
|
|
23
|
+
.bpmnkit-live-toggle--on {
|
|
24
|
+
border-color: var(--bpmnkit-success, #16a34a);
|
|
25
|
+
color: var(--bpmnkit-success, #16a34a);
|
|
26
|
+
box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
|
|
27
|
+
}
|
|
28
|
+
.bpmnkit-live-toggle--blocked {
|
|
29
|
+
border-color: var(--bpmnkit-danger, #dc2626);
|
|
30
|
+
color: var(--bpmnkit-danger, #dc2626);
|
|
31
|
+
background: rgba(220, 38, 38, 0.07);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* ── Status pill ───────────────────────────────────────────────────────────── */
|
|
35
|
+
.bpmnkit-live-status {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);
|
|
38
|
+
font-size: 10px;
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
letter-spacing: 0.05em;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
padding: 2px 7px;
|
|
43
|
+
border-radius: 20px;
|
|
44
|
+
background: var(--bpmnkit-surface-2, #eeeef8);
|
|
45
|
+
color: var(--bpmnkit-fg-muted, #6666a0);
|
|
46
|
+
border: 1px solid var(--bpmnkit-border, #d0d0e8);
|
|
47
|
+
}
|
|
48
|
+
.bpmnkit-live-status--off {
|
|
49
|
+
background: var(--bpmnkit-surface-2, #eeeef8);
|
|
50
|
+
color: var(--bpmnkit-fg-muted, #6666a0);
|
|
51
|
+
}
|
|
52
|
+
.bpmnkit-live-status--connecting {
|
|
53
|
+
background: rgba(217, 119, 6, 0.12);
|
|
54
|
+
color: var(--bpmnkit-warn, #d97706);
|
|
55
|
+
border-color: var(--bpmnkit-warn, #d97706);
|
|
56
|
+
}
|
|
57
|
+
.bpmnkit-live-status--live {
|
|
58
|
+
background: rgba(22, 163, 74, 0.12);
|
|
59
|
+
color: var(--bpmnkit-success, #16a34a);
|
|
60
|
+
border-color: var(--bpmnkit-success, #16a34a);
|
|
61
|
+
}
|
|
62
|
+
.bpmnkit-live-status--error {
|
|
63
|
+
background: rgba(220, 38, 38, 0.12);
|
|
64
|
+
color: var(--bpmnkit-danger, #dc2626);
|
|
65
|
+
border-color: var(--bpmnkit-danger, #dc2626);
|
|
66
|
+
}
|
|
67
|
+
.bpmnkit-live-status--blocked {
|
|
68
|
+
background: rgba(220, 38, 38, 0.07);
|
|
69
|
+
color: var(--bpmnkit-danger, #dc2626);
|
|
70
|
+
border-color: var(--bpmnkit-danger, #dc2626);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ── Conflict banner ───────────────────────────────────────────────────────── */
|
|
74
|
+
.bpmnkit-live-conflict {
|
|
75
|
+
font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);
|
|
76
|
+
background: rgba(220, 38, 38, 0.07);
|
|
77
|
+
border: 1px solid var(--bpmnkit-danger, #dc2626);
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
padding: 10px 14px;
|
|
80
|
+
margin: 8px 0;
|
|
81
|
+
font-size: 12px;
|
|
82
|
+
color: var(--bpmnkit-fg, #1a1a2e);
|
|
83
|
+
}
|
|
84
|
+
.bpmnkit-live-conflict-title {
|
|
85
|
+
font-weight: 700;
|
|
86
|
+
color: var(--bpmnkit-danger, #dc2626);
|
|
87
|
+
margin-bottom: 6px;
|
|
88
|
+
}
|
|
89
|
+
.bpmnkit-live-conflict-list {
|
|
90
|
+
list-style: disc;
|
|
91
|
+
padding-left: 18px;
|
|
92
|
+
margin-bottom: 8px;
|
|
93
|
+
}
|
|
94
|
+
.bpmnkit-live-conflict-item {
|
|
95
|
+
font-size: 11px;
|
|
96
|
+
color: var(--bpmnkit-fg-muted, #6666a0);
|
|
97
|
+
font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
|
|
98
|
+
margin-bottom: 2px;
|
|
99
|
+
}
|
|
100
|
+
.bpmnkit-live-btn {
|
|
101
|
+
font-size: 11px;
|
|
102
|
+
padding: 3px 10px;
|
|
103
|
+
border-radius: 5px;
|
|
104
|
+
border: 1px solid var(--bpmnkit-border, #d0d0e8);
|
|
105
|
+
background: var(--bpmnkit-surface, #ffffff);
|
|
106
|
+
color: var(--bpmnkit-fg, #1a1a2e);
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
}
|
|
111
|
+
.bpmnkit-live-btn:hover {
|
|
112
|
+
background: var(--bpmnkit-accent-subtle, rgba(26,86,219,0.12));
|
|
113
|
+
border-color: var(--bpmnkit-accent, #1a56db);
|
|
114
|
+
color: var(--bpmnkit-accent, #1a56db);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* ── Variable inspector tooltip ────────────────────────────────────────────── */
|
|
118
|
+
.bpmnkit-live-vars-tooltip {
|
|
119
|
+
position: fixed;
|
|
120
|
+
z-index: 9999;
|
|
121
|
+
background: var(--bpmnkit-panel-bg, rgba(255,255,255,0.96));
|
|
122
|
+
border: 1px solid var(--bpmnkit-panel-border, rgba(0,0,0,0.1));
|
|
123
|
+
border-radius: 8px;
|
|
124
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.14);
|
|
125
|
+
padding: 8px 12px;
|
|
126
|
+
font-family: var(--bpmnkit-font, system-ui, -apple-system, sans-serif);
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
min-width: 160px;
|
|
129
|
+
max-width: 300px;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
}
|
|
132
|
+
.bpmnkit-live-vars-row {
|
|
133
|
+
display: flex;
|
|
134
|
+
gap: 8px;
|
|
135
|
+
align-items: baseline;
|
|
136
|
+
padding: 2px 0;
|
|
137
|
+
border-bottom: 1px solid var(--bpmnkit-border, #d0d0e8);
|
|
138
|
+
}
|
|
139
|
+
.bpmnkit-live-vars-row:last-child {
|
|
140
|
+
border-bottom: none;
|
|
141
|
+
}
|
|
142
|
+
.bpmnkit-live-vars-name {
|
|
143
|
+
font-weight: 600;
|
|
144
|
+
color: var(--bpmnkit-fg, #1a1a2e);
|
|
145
|
+
flex-shrink: 0;
|
|
146
|
+
}
|
|
147
|
+
.bpmnkit-live-vars-value {
|
|
148
|
+
color: var(--bpmnkit-fg-muted, #6666a0);
|
|
149
|
+
font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
|
|
150
|
+
font-size: 11px;
|
|
151
|
+
overflow: hidden;
|
|
152
|
+
text-overflow: ellipsis;
|
|
153
|
+
white-space: nowrap;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* ── Light theme overrides ─────────────────────────────────────────────────── */
|
|
157
|
+
[data-bpmnkit-hud-theme="light"] .bpmnkit-live-vars-tooltip {
|
|
158
|
+
background: rgba(255,255,255,0.96);
|
|
159
|
+
border-color: rgba(0,0,0,0.1);
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
export function injectLiveModeStyles() {
|
|
163
|
+
if (document.getElementById(STYLE_ID) !== null)
|
|
164
|
+
return;
|
|
165
|
+
const style = document.createElement("style");
|
|
166
|
+
style.id = STYLE_ID;
|
|
167
|
+
style.textContent = CSS;
|
|
168
|
+
document.head.appendChild(style);
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=css.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { CanvasPlugin } from "@bpmnkit/canvas";
|
|
2
|
+
export type LiveModeStatus = "off" | "connecting" | "live" | "error" | "blocked-production" | "tests-failing";
|
|
3
|
+
export interface LiveModeOptions {
|
|
4
|
+
/** Proxy server URL. Default "http://localhost:3033". */
|
|
5
|
+
proxyUrl?: string;
|
|
6
|
+
/** Returns active profile. If isProduction=true, blocks live mode. */
|
|
7
|
+
getProfile?: () => {
|
|
8
|
+
name: string;
|
|
9
|
+
isProduction?: boolean;
|
|
10
|
+
} | null;
|
|
11
|
+
/** Returns current BPMN XML string. */
|
|
12
|
+
getXml: () => string | null;
|
|
13
|
+
/** Returns a filename for deployment. */
|
|
14
|
+
getFileName?: () => string;
|
|
15
|
+
/** Token-highlight plugin API to drive canvas overlays. */
|
|
16
|
+
tokenHighlight?: {
|
|
17
|
+
api: {
|
|
18
|
+
setActive(elementIds: string[]): void;
|
|
19
|
+
addVisited(elementIds: string[]): void;
|
|
20
|
+
clear(): void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** If true, require runTests() to pass green before each deploy. */
|
|
24
|
+
requireTestsGreen?: boolean;
|
|
25
|
+
/** Called before each deploy. Return true = tests pass. */
|
|
26
|
+
runTests?: () => Promise<boolean>;
|
|
27
|
+
/** Called when live mode status changes. */
|
|
28
|
+
onStatusChange?: (status: LiveModeStatus) => void;
|
|
29
|
+
/** Poll interval for active element instances in ms. Default 3000. */
|
|
30
|
+
pollIntervalMs?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface LiveModePlugin extends CanvasPlugin {
|
|
33
|
+
readonly name: "live-mode";
|
|
34
|
+
/** Toggle button to place in the editor toolbar. */
|
|
35
|
+
readonly toggle: HTMLButtonElement;
|
|
36
|
+
/** Status pill element. */
|
|
37
|
+
readonly status: HTMLSpanElement;
|
|
38
|
+
/** Disable live mode programmatically. */
|
|
39
|
+
disable(): void;
|
|
40
|
+
}
|
|
41
|
+
export declare function createLiveModePlugin(options: LiveModeOptions): LiveModePlugin;
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|