@bpmnkit/plugins 0.0.8
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 +153 -0
- package/dist/ai-bridge/css.d.ts +2 -0
- package/dist/ai-bridge/css.js +366 -0
- package/dist/ai-bridge/index.d.ts +44 -0
- package/dist/ai-bridge/index.js +132 -0
- package/dist/ai-bridge/panel.d.ts +27 -0
- package/dist/ai-bridge/panel.js +715 -0
- package/dist/ascii-view/css.d.ts +4 -0
- package/dist/ascii-view/css.js +83 -0
- package/dist/ascii-view/index.d.ts +25 -0
- package/dist/ascii-view/index.js +92 -0
- package/dist/command-palette/css.d.ts +4 -0
- package/dist/command-palette/css.js +157 -0
- package/dist/command-palette/index.d.ts +53 -0
- package/dist/command-palette/index.js +378 -0
- package/dist/command-palette-editor/index.d.ts +35 -0
- package/dist/command-palette-editor/index.js +60 -0
- package/dist/config-panel/css.d.ts +4 -0
- package/dist/config-panel/css.js +719 -0
- package/dist/config-panel/index.d.ts +36 -0
- package/dist/config-panel/index.js +73 -0
- package/dist/config-panel/renderer.d.ts +127 -0
- package/dist/config-panel/renderer.js +1162 -0
- package/dist/config-panel/types.d.ts +118 -0
- package/dist/config-panel/types.js +2 -0
- package/dist/config-panel-bpmn/index.d.ts +58 -0
- package/dist/config-panel-bpmn/index.js +1320 -0
- package/dist/config-panel-bpmn/template-engine.d.ts +17 -0
- package/dist/config-panel-bpmn/template-engine.js +307 -0
- package/dist/config-panel-bpmn/template-to-service-task.d.ts +30 -0
- package/dist/config-panel-bpmn/template-to-service-task.js +92 -0
- package/dist/config-panel-bpmn/template-types.d.ts +126 -0
- package/dist/config-panel-bpmn/template-types.js +6 -0
- package/dist/config-panel-bpmn/templates/generated.d.ts +3 -0
- package/dist/config-panel-bpmn/templates/generated.js +57865 -0
- package/dist/config-panel-bpmn/util.d.ts +46 -0
- package/dist/config-panel-bpmn/util.js +195 -0
- package/dist/dmn-editor/css.d.ts +3 -0
- package/dist/dmn-editor/css.js +667 -0
- package/dist/dmn-editor/dmn-editor.d.ts +34 -0
- package/dist/dmn-editor/dmn-editor.js +646 -0
- package/dist/dmn-editor/drd-canvas.d.ts +85 -0
- package/dist/dmn-editor/drd-canvas.js +1087 -0
- package/dist/dmn-editor/index.d.ts +3 -0
- package/dist/dmn-editor/index.js +2 -0
- package/dist/dmn-viewer/css.d.ts +3 -0
- package/dist/dmn-viewer/css.js +151 -0
- package/dist/dmn-viewer/dmn-viewer.d.ts +30 -0
- package/dist/dmn-viewer/dmn-viewer.js +160 -0
- package/dist/dmn-viewer/feel.d.ts +3 -0
- package/dist/dmn-viewer/feel.js +2 -0
- package/dist/dmn-viewer/index.d.ts +14 -0
- package/dist/dmn-viewer/index.js +12 -0
- package/dist/element-docs/content.d.ts +20 -0
- package/dist/element-docs/content.js +1032 -0
- package/dist/element-docs/index.d.ts +7 -0
- package/dist/element-docs/index.js +643 -0
- package/dist/feel-playground/css.d.ts +4 -0
- package/dist/feel-playground/css.js +292 -0
- package/dist/feel-playground/index.d.ts +4 -0
- package/dist/feel-playground/index.js +3 -0
- package/dist/feel-playground/playground-plugin.d.ts +14 -0
- package/dist/feel-playground/playground-plugin.js +292 -0
- package/dist/form-editor/css.d.ts +3 -0
- package/dist/form-editor/css.js +703 -0
- package/dist/form-editor/form-editor.d.ts +48 -0
- package/dist/form-editor/form-editor.js +1039 -0
- package/dist/form-editor/index.d.ts +3 -0
- package/dist/form-editor/index.js +2 -0
- package/dist/form-viewer/css.d.ts +3 -0
- package/dist/form-viewer/css.js +303 -0
- package/dist/form-viewer/form-viewer.d.ts +29 -0
- package/dist/form-viewer/form-viewer.js +376 -0
- package/dist/form-viewer/index.d.ts +12 -0
- package/dist/form-viewer/index.js +11 -0
- package/dist/history/checkpoint.d.ts +10 -0
- package/dist/history/checkpoint.js +92 -0
- package/dist/history/css.d.ts +2 -0
- package/dist/history/css.js +130 -0
- package/dist/history/history-panel.d.ts +12 -0
- package/dist/history/history-panel.js +142 -0
- package/dist/history/index.d.ts +5 -0
- package/dist/history/index.js +3 -0
- package/dist/main-menu/css.d.ts +4 -0
- package/dist/main-menu/css.js +272 -0
- package/dist/main-menu/index.d.ts +59 -0
- package/dist/main-menu/index.js +285 -0
- package/dist/minimap/css.d.ts +10 -0
- package/dist/minimap/css.js +54 -0
- package/dist/minimap/index.d.ts +38 -0
- package/dist/minimap/index.js +69 -0
- package/dist/minimap/minimap.d.ts +35 -0
- package/dist/minimap/minimap.js +166 -0
- package/dist/optimize/index.d.ts +21 -0
- package/dist/optimize/index.js +304 -0
- package/dist/process-runner/css.d.ts +2 -0
- package/dist/process-runner/css.js +467 -0
- package/dist/process-runner/index.d.ts +56 -0
- package/dist/process-runner/index.js +549 -0
- package/dist/storage/auto-save.d.ts +11 -0
- package/dist/storage/auto-save.js +44 -0
- package/dist/storage/css.d.ts +2 -0
- package/dist/storage/css.js +2 -0
- package/dist/storage/db.d.ts +99 -0
- package/dist/storage/db.js +116 -0
- package/dist/storage/dialog.d.ts +15 -0
- package/dist/storage/dialog.js +201 -0
- package/dist/storage/export.d.ts +3 -0
- package/dist/storage/export.js +137 -0
- package/dist/storage/index.d.ts +44 -0
- package/dist/storage/index.js +201 -0
- package/dist/storage/sidebar.d.ts +2 -0
- package/dist/storage/sidebar.js +2 -0
- package/dist/storage/storage-api.d.ts +76 -0
- package/dist/storage/storage-api.js +342 -0
- package/dist/storage/types.d.ts +44 -0
- package/dist/storage/types.js +2 -0
- package/dist/storage-tabs-bridge/index.d.ts +96 -0
- package/dist/storage-tabs-bridge/index.js +502 -0
- package/dist/tabs/css.d.ts +3 -0
- package/dist/tabs/css.js +642 -0
- package/dist/tabs/file-resolver.d.ts +71 -0
- package/dist/tabs/file-resolver.js +46 -0
- package/dist/tabs/index.d.ts +15 -0
- package/dist/tabs/index.js +13 -0
- package/dist/tabs/tabs-plugin.d.ts +250 -0
- package/dist/tabs/tabs-plugin.js +1119 -0
- package/dist/token-highlight/css.d.ts +2 -0
- package/dist/token-highlight/css.js +81 -0
- package/dist/token-highlight/index.d.ts +44 -0
- package/dist/token-highlight/index.js +164 -0
- package/dist/watermark/css.d.ts +10 -0
- package/dist/watermark/css.js +54 -0
- package/dist/watermark/index.d.ts +48 -0
- package/dist/watermark/index.js +64 -0
- package/dist/zoom-controls/css.d.ts +4 -0
- package/dist/zoom-controls/css.js +48 -0
- package/dist/zoom-controls/index.d.ts +36 -0
- package/dist/zoom-controls/index.js +111 -0
- package/package.json +121 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { BpmnDefinitions, BpmnFlowElement, BpmnSequenceFlow, XmlElement } from "@bpmnkit/core";
|
|
2
|
+
import type { ZeebeExtensions } from "@bpmnkit/core";
|
|
3
|
+
/** Strip namespace prefix: "zeebe:taskDefinition" → "taskDefinition" */
|
|
4
|
+
export declare function xmlLocalName(qname: string): string;
|
|
5
|
+
export declare function findFlowElement(defs: BpmnDefinitions, id: string): BpmnFlowElement | undefined;
|
|
6
|
+
export declare function updateFlowElement(defs: BpmnDefinitions, id: string, fn: (el: BpmnFlowElement) => BpmnFlowElement): BpmnDefinitions;
|
|
7
|
+
export declare function parseZeebeExtensions(extensionElements: XmlElement[]): ZeebeExtensions;
|
|
8
|
+
/** Read the example output JSON string from parsed zeebe extensions. */
|
|
9
|
+
export declare function getExampleOutputJson(ext: ZeebeExtensions): string;
|
|
10
|
+
/**
|
|
11
|
+
* Return new properties list with the example output JSON set (or removed if empty).
|
|
12
|
+
* Other existing zeebe:property entries are preserved.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildPropertiesWithExampleOutput(ext: ZeebeExtensions, json: string): ZeebeExtensions["properties"];
|
|
15
|
+
/** Get the value of a zeebe:ioMapping input by target name. */
|
|
16
|
+
export declare function getIoInput(ext: ZeebeExtensions, target: string): string | undefined;
|
|
17
|
+
/** Get the value of a zeebe:taskHeader by key. */
|
|
18
|
+
export declare function getTaskHeader(ext: ZeebeExtensions, key: string): string | undefined;
|
|
19
|
+
export declare function findSequenceFlow(defs: BpmnDefinitions, id: string): BpmnSequenceFlow | undefined;
|
|
20
|
+
export declare function updateSequenceFlow(defs: BpmnDefinitions, id: string, fn: (sf: BpmnSequenceFlow) => BpmnSequenceFlow): BpmnDefinitions;
|
|
21
|
+
export interface CalledElementInfo {
|
|
22
|
+
processId: string;
|
|
23
|
+
propagateAllChildVariables: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function parseCalledElement(extensionElements: XmlElement[]): CalledElementInfo;
|
|
26
|
+
export interface ZeebeScriptInfo {
|
|
27
|
+
expression: string;
|
|
28
|
+
resultVariable: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function parseZeebeScript(extensionElements: XmlElement[]): ZeebeScriptInfo;
|
|
31
|
+
/** Get an attribute from the zeebe:adHoc extension element. */
|
|
32
|
+
export declare function getAdHocAttr(extensionElements: XmlElement[], property: "outputCollection" | "outputElement" | "activeElementsCollection"): string | undefined;
|
|
33
|
+
export declare function parseZeebeMessage(extensionElements: XmlElement[]): {
|
|
34
|
+
name: string;
|
|
35
|
+
correlationKey: string;
|
|
36
|
+
};
|
|
37
|
+
export declare function parseZeebeSignal(extensionElements: XmlElement[]): {
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
40
|
+
export declare function parseZeebeError(extensionElements: XmlElement[]): {
|
|
41
|
+
errorCode: string;
|
|
42
|
+
};
|
|
43
|
+
export declare function parseZeebeEscalation(extensionElements: XmlElement[]): {
|
|
44
|
+
escalationCode: string;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// ── XML helpers ───────────────────────────────────────────────────────────────
|
|
2
|
+
/** Strip namespace prefix: "zeebe:taskDefinition" → "taskDefinition" */
|
|
3
|
+
export function xmlLocalName(qname) {
|
|
4
|
+
const idx = qname.indexOf(":");
|
|
5
|
+
return idx >= 0 ? qname.slice(idx + 1) : qname;
|
|
6
|
+
}
|
|
7
|
+
// ── Element lookup / update ───────────────────────────────────────────────────
|
|
8
|
+
export function findFlowElement(defs, id) {
|
|
9
|
+
for (const process of defs.processes) {
|
|
10
|
+
const el = process.flowElements.find((e) => e.id === id);
|
|
11
|
+
if (el)
|
|
12
|
+
return el;
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
export function updateFlowElement(defs, id, fn) {
|
|
17
|
+
const processIdx = defs.processes.findIndex((p) => p.flowElements.some((e) => e.id === id));
|
|
18
|
+
if (processIdx < 0)
|
|
19
|
+
return defs;
|
|
20
|
+
const process = defs.processes[processIdx];
|
|
21
|
+
if (!process)
|
|
22
|
+
return defs;
|
|
23
|
+
const elIdx = process.flowElements.findIndex((e) => e.id === id);
|
|
24
|
+
if (elIdx < 0)
|
|
25
|
+
return defs;
|
|
26
|
+
const el = process.flowElements[elIdx];
|
|
27
|
+
if (!el)
|
|
28
|
+
return defs;
|
|
29
|
+
const newEl = fn(el);
|
|
30
|
+
const newElements = process.flowElements.map((e, i) => (i === elIdx ? newEl : e));
|
|
31
|
+
const newProcess = { ...process, flowElements: newElements };
|
|
32
|
+
return {
|
|
33
|
+
...defs,
|
|
34
|
+
processes: defs.processes.map((p, i) => (i === processIdx ? newProcess : p)),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// ── Zeebe extension parsing ───────────────────────────────────────────────────
|
|
38
|
+
export function parseZeebeExtensions(extensionElements) {
|
|
39
|
+
const ext = {};
|
|
40
|
+
for (const el of extensionElements) {
|
|
41
|
+
const ln = xmlLocalName(el.name);
|
|
42
|
+
if (ln === "taskDefinition") {
|
|
43
|
+
ext.taskDefinition = {
|
|
44
|
+
type: el.attributes.type ?? "",
|
|
45
|
+
retries: el.attributes.retries,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
else if (ln === "ioMapping") {
|
|
49
|
+
const inputs = [];
|
|
50
|
+
const outputs = [];
|
|
51
|
+
for (const child of el.children) {
|
|
52
|
+
const cln = xmlLocalName(child.name);
|
|
53
|
+
if (cln === "input") {
|
|
54
|
+
inputs.push({
|
|
55
|
+
source: child.attributes.source ?? "",
|
|
56
|
+
target: child.attributes.target ?? "",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
else if (cln === "output") {
|
|
60
|
+
outputs.push({
|
|
61
|
+
source: child.attributes.source ?? "",
|
|
62
|
+
target: child.attributes.target ?? "",
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
ext.ioMapping = { inputs, outputs };
|
|
67
|
+
}
|
|
68
|
+
else if (ln === "taskHeaders") {
|
|
69
|
+
const headers = [];
|
|
70
|
+
for (const child of el.children) {
|
|
71
|
+
if (xmlLocalName(child.name) === "header") {
|
|
72
|
+
headers.push({
|
|
73
|
+
key: child.attributes.key ?? "",
|
|
74
|
+
value: child.attributes.value ?? "",
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
ext.taskHeaders = { headers };
|
|
79
|
+
}
|
|
80
|
+
else if (ln === "formDefinition") {
|
|
81
|
+
const formId = el.attributes.formId ?? "";
|
|
82
|
+
ext.formDefinition = { formId };
|
|
83
|
+
}
|
|
84
|
+
else if (ln === "calledDecision") {
|
|
85
|
+
const decisionId = el.attributes.decisionId ?? "";
|
|
86
|
+
const resultVariable = el.attributes.resultVariable ?? "result";
|
|
87
|
+
ext.calledDecision = { decisionId, resultVariable };
|
|
88
|
+
}
|
|
89
|
+
else if (ln === "properties") {
|
|
90
|
+
const properties = [];
|
|
91
|
+
for (const child of el.children) {
|
|
92
|
+
if (xmlLocalName(child.name) === "property") {
|
|
93
|
+
properties.push({
|
|
94
|
+
name: child.attributes.name ?? "",
|
|
95
|
+
value: child.attributes.value ?? "",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
ext.properties = { properties };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return ext;
|
|
103
|
+
}
|
|
104
|
+
const EXAMPLE_OUTPUT_JSON_KEY = "camundaModeler:exampleOutputJson";
|
|
105
|
+
/** Read the example output JSON string from parsed zeebe extensions. */
|
|
106
|
+
export function getExampleOutputJson(ext) {
|
|
107
|
+
return ext.properties?.properties.find((p) => p.name === EXAMPLE_OUTPUT_JSON_KEY)?.value ?? "";
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Return new properties list with the example output JSON set (or removed if empty).
|
|
111
|
+
* Other existing zeebe:property entries are preserved.
|
|
112
|
+
*/
|
|
113
|
+
export function buildPropertiesWithExampleOutput(ext, json) {
|
|
114
|
+
const others = ext.properties?.properties.filter((p) => p.name !== EXAMPLE_OUTPUT_JSON_KEY) ?? [];
|
|
115
|
+
const entries = json ? [...others, { name: EXAMPLE_OUTPUT_JSON_KEY, value: json }] : others;
|
|
116
|
+
return entries.length > 0 ? { properties: entries } : undefined;
|
|
117
|
+
}
|
|
118
|
+
/** Get the value of a zeebe:ioMapping input by target name. */
|
|
119
|
+
export function getIoInput(ext, target) {
|
|
120
|
+
return ext.ioMapping?.inputs.find((i) => i.target === target)?.source;
|
|
121
|
+
}
|
|
122
|
+
/** Get the value of a zeebe:taskHeader by key. */
|
|
123
|
+
export function getTaskHeader(ext, key) {
|
|
124
|
+
return ext.taskHeaders?.headers.find((h) => h.key === key)?.value;
|
|
125
|
+
}
|
|
126
|
+
// ── Sequence flow lookup / update ─────────────────────────────────────────────
|
|
127
|
+
export function findSequenceFlow(defs, id) {
|
|
128
|
+
for (const process of defs.processes) {
|
|
129
|
+
const sf = process.sequenceFlows.find((f) => f.id === id);
|
|
130
|
+
if (sf)
|
|
131
|
+
return sf;
|
|
132
|
+
}
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
export function updateSequenceFlow(defs, id, fn) {
|
|
136
|
+
const processIdx = defs.processes.findIndex((p) => p.sequenceFlows.some((f) => f.id === id));
|
|
137
|
+
if (processIdx < 0)
|
|
138
|
+
return defs;
|
|
139
|
+
const process = defs.processes[processIdx];
|
|
140
|
+
if (!process)
|
|
141
|
+
return defs;
|
|
142
|
+
const sfIdx = process.sequenceFlows.findIndex((f) => f.id === id);
|
|
143
|
+
if (sfIdx < 0)
|
|
144
|
+
return defs;
|
|
145
|
+
const sf = process.sequenceFlows[sfIdx];
|
|
146
|
+
if (!sf)
|
|
147
|
+
return defs;
|
|
148
|
+
const newSf = fn(sf);
|
|
149
|
+
const newFlows = process.sequenceFlows.map((f, i) => (i === sfIdx ? newSf : f));
|
|
150
|
+
const newProcess = { ...process, sequenceFlows: newFlows };
|
|
151
|
+
return {
|
|
152
|
+
...defs,
|
|
153
|
+
processes: defs.processes.map((p, i) => (i === processIdx ? newProcess : p)),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export function parseCalledElement(extensionElements) {
|
|
157
|
+
const el = extensionElements.find((x) => xmlLocalName(x.name) === "calledElement");
|
|
158
|
+
return {
|
|
159
|
+
processId: el?.attributes.processId ?? "",
|
|
160
|
+
propagateAllChildVariables: el?.attributes.propagateAllChildVariables === "true",
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
export function parseZeebeScript(extensionElements) {
|
|
164
|
+
const el = extensionElements.find((x) => xmlLocalName(x.name) === "script");
|
|
165
|
+
return {
|
|
166
|
+
expression: el?.attributes.expression ?? "",
|
|
167
|
+
resultVariable: el?.attributes.resultVariable ?? "",
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
/** Get an attribute from the zeebe:adHoc extension element. */
|
|
171
|
+
export function getAdHocAttr(extensionElements, property) {
|
|
172
|
+
const el = extensionElements.find((x) => xmlLocalName(x.name) === "adHoc");
|
|
173
|
+
return el?.attributes[property];
|
|
174
|
+
}
|
|
175
|
+
// ── Zeebe event extension helpers ─────────────────────────────────────────────
|
|
176
|
+
export function parseZeebeMessage(extensionElements) {
|
|
177
|
+
const el = extensionElements.find((x) => xmlLocalName(x.name) === "message");
|
|
178
|
+
return {
|
|
179
|
+
name: el?.attributes.name ?? "",
|
|
180
|
+
correlationKey: el?.attributes.correlationKey ?? "",
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
export function parseZeebeSignal(extensionElements) {
|
|
184
|
+
const el = extensionElements.find((x) => xmlLocalName(x.name) === "signal");
|
|
185
|
+
return { name: el?.attributes.name ?? "" };
|
|
186
|
+
}
|
|
187
|
+
export function parseZeebeError(extensionElements) {
|
|
188
|
+
const el = extensionElements.find((x) => xmlLocalName(x.name) === "error");
|
|
189
|
+
return { errorCode: el?.attributes.errorCode ?? "" };
|
|
190
|
+
}
|
|
191
|
+
export function parseZeebeEscalation(extensionElements) {
|
|
192
|
+
const el = extensionElements.find((x) => xmlLocalName(x.name) === "escalation");
|
|
193
|
+
return { escalationCode: el?.attributes.escalationCode ?? "" };
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=util.js.map
|