@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,118 @@
|
|
|
1
|
+
import type { CanvasPlugin } from "@bpmnkit/canvas";
|
|
2
|
+
import type { BpmnDefinitions } from "@bpmnkit/core";
|
|
3
|
+
/** Input field types supported by the config panel renderer. */
|
|
4
|
+
export type FieldType = "text" | "select" | "textarea" | "feel-expression" | "toggle" | "action";
|
|
5
|
+
export interface SelectOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
/** Describes a single configurable field. */
|
|
10
|
+
export interface FieldSchema {
|
|
11
|
+
/** Unique key used to read/write the value via the adapter. */
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
type: FieldType;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Options for `select` fields. */
|
|
17
|
+
options?: SelectOption[];
|
|
18
|
+
/** Short hint displayed below the field. */
|
|
19
|
+
hint?: string;
|
|
20
|
+
/** Tooltip text shown on hover over the field label. */
|
|
21
|
+
tooltip?: string;
|
|
22
|
+
/** Link to external documentation. */
|
|
23
|
+
docsUrl?: string;
|
|
24
|
+
/** Mask the input (password-style) for secret values. */
|
|
25
|
+
secret?: boolean;
|
|
26
|
+
/** If true, the field is mandatory — shown with an asterisk and a red border when empty. */
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/** If provided, the field is only shown when this returns true. */
|
|
29
|
+
condition?: (values: Record<string, FieldValue>) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* For `type: "action"` fields — called when the button is clicked.
|
|
32
|
+
* Receives the current field values and a `setValue` helper that updates a
|
|
33
|
+
* field in the panel and immediately writes it back to the diagram.
|
|
34
|
+
*/
|
|
35
|
+
onClick?: (values: Record<string, FieldValue>, setValue: (key: string, val: FieldValue) => void) => void;
|
|
36
|
+
/**
|
|
37
|
+
* For `type: "feel-expression"` fields — when true, the field is always a
|
|
38
|
+
* FEEL expression. The FEEL/string toggle is hidden and the `=` prefix is
|
|
39
|
+
* managed automatically (not shown in the input).
|
|
40
|
+
*/
|
|
41
|
+
feelFixed?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* For `type: "feel-expression"` fields — optional callback to open the
|
|
44
|
+
* expression in an external playground/editor.
|
|
45
|
+
*/
|
|
46
|
+
openInPlayground?: (values: Record<string, FieldValue>) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Custom validation function. Called after the built-in required/FEEL checks.
|
|
49
|
+
* Return `null` when the value is valid, or an error message string when invalid.
|
|
50
|
+
*/
|
|
51
|
+
validate?: (value: FieldValue) => string | null;
|
|
52
|
+
}
|
|
53
|
+
/** A named group of fields shown as a section in the full editor. */
|
|
54
|
+
export interface GroupSchema {
|
|
55
|
+
id: string;
|
|
56
|
+
label: string;
|
|
57
|
+
fields: FieldSchema[];
|
|
58
|
+
/** If provided, the group (and its tab) is only shown when this returns true. */
|
|
59
|
+
condition?: (values: Record<string, FieldValue>) => boolean;
|
|
60
|
+
}
|
|
61
|
+
/** Describes the full config panel for an element type. */
|
|
62
|
+
export interface PanelSchema {
|
|
63
|
+
/** Optional link to documentation for this element type. Shown as a ? button in the panel header. */
|
|
64
|
+
docsUrl?: string;
|
|
65
|
+
/** Optional connector/template name shown in the panel header (e.g. "REST Connector"). */
|
|
66
|
+
templateName?: string;
|
|
67
|
+
/** Fields shown in the compact (right-rail) panel. */
|
|
68
|
+
compact: FieldSchema[];
|
|
69
|
+
/** All field groups shown in the full overlay editor. */
|
|
70
|
+
groups: GroupSchema[];
|
|
71
|
+
}
|
|
72
|
+
export type FieldValue = string | boolean | undefined;
|
|
73
|
+
/** Bridges between the generic field schema and the BPMN data model. */
|
|
74
|
+
export interface PanelAdapter {
|
|
75
|
+
/** Read current values for the selected element. */
|
|
76
|
+
read(defs: BpmnDefinitions, id: string): Record<string, FieldValue>;
|
|
77
|
+
/** Apply updated values and return new definitions. */
|
|
78
|
+
write(defs: BpmnDefinitions, id: string, values: Record<string, FieldValue>): BpmnDefinitions;
|
|
79
|
+
/**
|
|
80
|
+
* Optional: dynamically resolve a different schema+adapter for this specific element instance.
|
|
81
|
+
* Called on each select and diagram-change event. When it returns non-null the renderer uses
|
|
82
|
+
* the returned registration instead of the one stored in the schema registry.
|
|
83
|
+
*
|
|
84
|
+
* Typical use: detect a `zeebe:modelerTemplate` attribute and switch to the matching template
|
|
85
|
+
* schema without requiring a separate registration for every possible template.
|
|
86
|
+
*/
|
|
87
|
+
resolve?(defs: BpmnDefinitions, id: string): {
|
|
88
|
+
schema: PanelSchema;
|
|
89
|
+
adapter: PanelAdapter;
|
|
90
|
+
} | null;
|
|
91
|
+
}
|
|
92
|
+
/** The config panel plugin — extends CanvasPlugin with a schema registration API. */
|
|
93
|
+
export interface ConfigPanelPlugin extends CanvasPlugin {
|
|
94
|
+
registerSchema(elementType: string, schema: PanelSchema, adapter: PanelAdapter): void;
|
|
95
|
+
}
|
|
96
|
+
export interface ConfigPanelOptions {
|
|
97
|
+
getDefinitions: () => BpmnDefinitions | null;
|
|
98
|
+
applyChange: (fn: (defs: BpmnDefinitions) => BpmnDefinitions) => void;
|
|
99
|
+
/** Render into this element instead of document.body. */
|
|
100
|
+
container?: HTMLElement;
|
|
101
|
+
/** Called when an element is selected and the panel appears. */
|
|
102
|
+
onPanelShow?: () => void;
|
|
103
|
+
/** Called when the panel is hidden (element deselected). */
|
|
104
|
+
onPanelHide?: () => void;
|
|
105
|
+
/**
|
|
106
|
+
* Called when the user clicks "Open in FEEL Playground ↗" on any
|
|
107
|
+
* `feel-expression` field that is currently in FEEL mode and does not have
|
|
108
|
+
* its own `field.openInPlayground` override.
|
|
109
|
+
* Receives the expression body (without the leading `=`).
|
|
110
|
+
*/
|
|
111
|
+
openInPlayground?: (expression: string) => void;
|
|
112
|
+
/**
|
|
113
|
+
* When true, all form fields are rendered in read-only / disabled state.
|
|
114
|
+
* Use this when the panel is shown purely for inspection (e.g. operate views).
|
|
115
|
+
*/
|
|
116
|
+
readonly?: boolean;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @bpmnkit/canvas-plugin-config-panel-bpmn — BPMN element schemas for the
|
|
3
|
+
* config panel plugin.
|
|
4
|
+
*
|
|
5
|
+
* Registers config panel schemas for all standard BPMN element types. For
|
|
6
|
+
* service tasks the panel is template-aware: when `zeebe:modelerTemplate` is
|
|
7
|
+
* set on an element the matching template's property form is shown instead of
|
|
8
|
+
* the generic connector selector.
|
|
9
|
+
*
|
|
10
|
+
* ## Usage
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { createConfigPanelPlugin } from "@bpmnkit/canvas-plugin-config-panel";
|
|
13
|
+
* import { createConfigPanelBpmnPlugin } from "@bpmnkit/canvas-plugin-config-panel-bpmn";
|
|
14
|
+
*
|
|
15
|
+
* let editorRef: BpmnEditor | null = null;
|
|
16
|
+
* const configPanel = createConfigPanelPlugin({
|
|
17
|
+
* getDefinitions: () => editorRef?.getDefinitions() ?? null,
|
|
18
|
+
* applyChange: (fn) => { editorRef?.applyChange(fn); },
|
|
19
|
+
* });
|
|
20
|
+
* const configPanelBpmn = createConfigPanelBpmnPlugin(configPanel);
|
|
21
|
+
* const editor = new BpmnEditor({ container, xml, plugins: [configPanel, configPanelBpmn] });
|
|
22
|
+
* editorRef = editor;
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @packageDocumentation
|
|
26
|
+
*/
|
|
27
|
+
import type { CanvasPlugin } from "@bpmnkit/canvas";
|
|
28
|
+
import { ELEMENT_TYPE_LABELS } from "@bpmnkit/editor";
|
|
29
|
+
import type { ConfigPanelPlugin } from "../config-panel/index.js";
|
|
30
|
+
import type { ElementTemplate } from "./template-types.js";
|
|
31
|
+
export { CAMUNDA_CONNECTOR_TEMPLATES } from "./templates/generated.js";
|
|
32
|
+
export { templateToServiceTaskOptions } from "./template-to-service-task.js";
|
|
33
|
+
export interface ConfigPanelBpmnOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Called when the user clicks "Open in FEEL Playground ↗" in a FEEL expression field.
|
|
36
|
+
* Typically implemented by calling `tabsPlugin.api.openTab({ type: "feel", ... })`.
|
|
37
|
+
*/
|
|
38
|
+
openFeelPlayground?: (expression: string) => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates the BPMN config panel extension plugin.
|
|
42
|
+
*
|
|
43
|
+
* Registers property schemas for all standard BPMN element types. Service tasks
|
|
44
|
+
* are template-aware: when `zeebe:modelerTemplate` is set the matching
|
|
45
|
+
* connector template form is rendered; otherwise a generic connector selector
|
|
46
|
+
* is shown. Custom templates can be registered via `registerTemplate`.
|
|
47
|
+
*
|
|
48
|
+
* @param configPanel - The base config panel plugin returned by
|
|
49
|
+
* `createConfigPanelPlugin`.
|
|
50
|
+
* @param options - Optional callbacks for FEEL playground navigation.
|
|
51
|
+
*/
|
|
52
|
+
export declare function createConfigPanelBpmnPlugin(configPanel: ConfigPanelPlugin, options?: ConfigPanelBpmnOptions): CanvasPlugin & {
|
|
53
|
+
/** Register an additional element template to make it available in the UI. */
|
|
54
|
+
registerTemplate(template: ElementTemplate): void;
|
|
55
|
+
};
|
|
56
|
+
export { ELEMENT_TYPE_LABELS };
|
|
57
|
+
export type { ElementTemplate };
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|