@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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @bpmnkit/canvas-plugin-config-panel — schema-driven element config panel for
|
|
3
|
+
* `@bpmnkit/editor`.
|
|
4
|
+
*
|
|
5
|
+
* Provides a compact right-rail panel and a full 65%-overlay editor for
|
|
6
|
+
* configuring BPMN element properties. Schemas and adapters are registered by
|
|
7
|
+
* companion plugins (e.g. `@bpmnkit/canvas-plugin-config-panel-bpmn`).
|
|
8
|
+
*
|
|
9
|
+
* ## Usage
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { createConfigPanelPlugin } from "@bpmnkit/canvas-plugin-config-panel";
|
|
12
|
+
*
|
|
13
|
+
* let editorRef: BpmnEditor | null = null;
|
|
14
|
+
* const configPanel = createConfigPanelPlugin({
|
|
15
|
+
* getDefinitions: () => editorRef?.getDefinitions() ?? null,
|
|
16
|
+
* applyChange: (fn) => { editorRef?.applyChange(fn); },
|
|
17
|
+
* });
|
|
18
|
+
* const editor = new BpmnEditor({ container, xml, plugins: [configPanel] });
|
|
19
|
+
* editorRef = editor;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
import type { ConfigPanelOptions, ConfigPanelPlugin } from "./types.js";
|
|
25
|
+
export type { ConfigPanelOptions, ConfigPanelPlugin, FieldSchema, FieldType, FieldValue, GroupSchema, PanelAdapter, PanelSchema, SelectOption, } from "./types.js";
|
|
26
|
+
export { CONFIG_PANEL_CSS, CONFIG_PANEL_STYLE_ID, injectConfigPanelStyles } from "./css.js";
|
|
27
|
+
/**
|
|
28
|
+
* Creates the config panel plugin.
|
|
29
|
+
*
|
|
30
|
+
* @param options.getDefinitions - Returns the current BpmnDefinitions (may be
|
|
31
|
+
* null before the editor is initialized). Called lazily when the panel opens.
|
|
32
|
+
* @param options.applyChange - Applies a pure transformation to the diagram.
|
|
33
|
+
* May reference the editor lazily via a captured reference.
|
|
34
|
+
*/
|
|
35
|
+
export declare function createConfigPanelPlugin(options: ConfigPanelOptions): ConfigPanelPlugin;
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @bpmnkit/canvas-plugin-config-panel — schema-driven element config panel for
|
|
3
|
+
* `@bpmnkit/editor`.
|
|
4
|
+
*
|
|
5
|
+
* Provides a compact right-rail panel and a full 65%-overlay editor for
|
|
6
|
+
* configuring BPMN element properties. Schemas and adapters are registered by
|
|
7
|
+
* companion plugins (e.g. `@bpmnkit/canvas-plugin-config-panel-bpmn`).
|
|
8
|
+
*
|
|
9
|
+
* ## Usage
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { createConfigPanelPlugin } from "@bpmnkit/canvas-plugin-config-panel";
|
|
12
|
+
*
|
|
13
|
+
* let editorRef: BpmnEditor | null = null;
|
|
14
|
+
* const configPanel = createConfigPanelPlugin({
|
|
15
|
+
* getDefinitions: () => editorRef?.getDefinitions() ?? null,
|
|
16
|
+
* applyChange: (fn) => { editorRef?.applyChange(fn); },
|
|
17
|
+
* });
|
|
18
|
+
* const editor = new BpmnEditor({ container, xml, plugins: [configPanel] });
|
|
19
|
+
* editorRef = editor;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
import { injectConfigPanelStyles } from "./css.js";
|
|
25
|
+
import { ConfigPanelRenderer } from "./renderer.js";
|
|
26
|
+
export { CONFIG_PANEL_CSS, CONFIG_PANEL_STYLE_ID, injectConfigPanelStyles } from "./css.js";
|
|
27
|
+
// ── Factory ───────────────────────────────────────────────────────────────────
|
|
28
|
+
/**
|
|
29
|
+
* Creates the config panel plugin.
|
|
30
|
+
*
|
|
31
|
+
* @param options.getDefinitions - Returns the current BpmnDefinitions (may be
|
|
32
|
+
* null before the editor is initialized). Called lazily when the panel opens.
|
|
33
|
+
* @param options.applyChange - Applies a pure transformation to the diagram.
|
|
34
|
+
* May reference the editor lazily via a captured reference.
|
|
35
|
+
*/
|
|
36
|
+
export function createConfigPanelPlugin(options) {
|
|
37
|
+
const { getDefinitions, applyChange } = options;
|
|
38
|
+
// Shared schema registry — populated before or after install via registerSchema
|
|
39
|
+
const _schemas = new Map();
|
|
40
|
+
let _renderer = null;
|
|
41
|
+
const _unsubs = [];
|
|
42
|
+
return {
|
|
43
|
+
name: "config-panel",
|
|
44
|
+
install(api) {
|
|
45
|
+
injectConfigPanelStyles();
|
|
46
|
+
_renderer = new ConfigPanelRenderer(_schemas, getDefinitions, applyChange, () => api.viewportEl, () => api.getShapes(), {
|
|
47
|
+
container: options.container,
|
|
48
|
+
onPanelShow: options.onPanelShow,
|
|
49
|
+
onPanelHide: options.onPanelHide,
|
|
50
|
+
openInPlayground: options.openInPlayground,
|
|
51
|
+
readonly: options.readonly,
|
|
52
|
+
});
|
|
53
|
+
const anyOn = api.on.bind(api);
|
|
54
|
+
_unsubs.push(anyOn("editor:select", (rawIds) => {
|
|
55
|
+
_renderer?.onSelect(rawIds, api.getShapes(), api.getEdges());
|
|
56
|
+
}));
|
|
57
|
+
_unsubs.push(anyOn("diagram:change", (rawDefs) => {
|
|
58
|
+
_renderer?.onDiagramChange(rawDefs);
|
|
59
|
+
}));
|
|
60
|
+
},
|
|
61
|
+
uninstall() {
|
|
62
|
+
for (const unsub of _unsubs)
|
|
63
|
+
unsub();
|
|
64
|
+
_unsubs.length = 0;
|
|
65
|
+
_renderer?.destroy();
|
|
66
|
+
_renderer = null;
|
|
67
|
+
},
|
|
68
|
+
registerSchema(elementType, schema, adapter) {
|
|
69
|
+
_schemas.set(elementType, { schema, adapter });
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { RenderedEdge, RenderedShape } from "@bpmnkit/canvas";
|
|
2
|
+
import type { BpmnDefinitions } from "@bpmnkit/core";
|
|
3
|
+
import type { PanelAdapter, PanelSchema } from "./types.js";
|
|
4
|
+
interface Registration {
|
|
5
|
+
schema: PanelSchema;
|
|
6
|
+
adapter: PanelAdapter;
|
|
7
|
+
}
|
|
8
|
+
export declare class ConfigPanelRenderer {
|
|
9
|
+
private readonly _schemas;
|
|
10
|
+
private readonly _getDefinitions;
|
|
11
|
+
private readonly _applyChange;
|
|
12
|
+
private readonly _getSvgViewport;
|
|
13
|
+
private readonly _getShapes;
|
|
14
|
+
private readonly _container;
|
|
15
|
+
private readonly _onPanelShow;
|
|
16
|
+
private readonly _onPanelHide;
|
|
17
|
+
private readonly _openInPlayground;
|
|
18
|
+
private readonly _readonly;
|
|
19
|
+
private _panelEl;
|
|
20
|
+
/** SVG group appended to the canvas viewport; holds all validation badges. */
|
|
21
|
+
private _badgeContainerEl;
|
|
22
|
+
private _collapsed;
|
|
23
|
+
/** User-set panel width; persisted to localStorage. */
|
|
24
|
+
private _panelWidth;
|
|
25
|
+
/** Sub-element refs for layout toggling; reset on panel teardown. */
|
|
26
|
+
private _tabsAreaEl;
|
|
27
|
+
private _tabsScrollEl;
|
|
28
|
+
private _tabsPrevBtn;
|
|
29
|
+
private _tabsNextBtn;
|
|
30
|
+
private _bodyEl;
|
|
31
|
+
private _searchResultsEl;
|
|
32
|
+
private _searchClearBtn;
|
|
33
|
+
private _searchQuery;
|
|
34
|
+
/** Guide bar sub-element refs; reset on panel teardown. */
|
|
35
|
+
private _guideBarEl;
|
|
36
|
+
private _guideTextEl;
|
|
37
|
+
private _guideBtnEl;
|
|
38
|
+
/** Key of the field the guide is currently pointing at. */
|
|
39
|
+
private _guideCurrentKey;
|
|
40
|
+
private _guideStarted;
|
|
41
|
+
private _selectedId;
|
|
42
|
+
private _selectedType;
|
|
43
|
+
private _elementName;
|
|
44
|
+
private _activeTabId;
|
|
45
|
+
private _values;
|
|
46
|
+
/** The effective registration after optional `resolve?` override. */
|
|
47
|
+
private _effectiveReg;
|
|
48
|
+
constructor(schemas: Map<string, Registration>, getDefinitions: () => BpmnDefinitions | null, applyChange: (fn: (d: BpmnDefinitions) => BpmnDefinitions) => void, getSvgViewport?: () => SVGGElement | null, getShapes?: () => RenderedShape[], opts?: {
|
|
49
|
+
container?: HTMLElement;
|
|
50
|
+
onPanelShow?: () => void;
|
|
51
|
+
onPanelHide?: () => void;
|
|
52
|
+
openInPlayground?: (expression: string) => void;
|
|
53
|
+
readonly?: boolean;
|
|
54
|
+
});
|
|
55
|
+
onSelect(ids: string[], shapes: RenderedShape[], edges?: RenderedEdge[]): void;
|
|
56
|
+
onDiagramChange(defs: BpmnDefinitions): void;
|
|
57
|
+
destroy(): void;
|
|
58
|
+
private _refreshValues;
|
|
59
|
+
private _applyField;
|
|
60
|
+
private _close;
|
|
61
|
+
private _hidePanel;
|
|
62
|
+
/** Update all input values in-place without re-rendering (preserves focus). */
|
|
63
|
+
private _refreshInputs;
|
|
64
|
+
/**
|
|
65
|
+
* Refresh both field-level and group-level conditional visibility.
|
|
66
|
+
* Called synchronously after any value change so the UI updates immediately.
|
|
67
|
+
*/
|
|
68
|
+
private _refreshConditionals;
|
|
69
|
+
/**
|
|
70
|
+
* Returns true when a field value is considered empty for validation purposes.
|
|
71
|
+
* For `feel-expression` fields, a value of just "=" (no expression body) is
|
|
72
|
+
* treated the same as empty.
|
|
73
|
+
*/
|
|
74
|
+
private _isEffectivelyEmpty;
|
|
75
|
+
/**
|
|
76
|
+
* Returns an error message string when the field has a validation error, or
|
|
77
|
+
* null when the value is valid. Checks (in order):
|
|
78
|
+
* 1. Required + empty → "Required"
|
|
79
|
+
* 2. feel-expression type with FEEL parse error → error from parser
|
|
80
|
+
* 3. Custom `field.validate` callback → its return value
|
|
81
|
+
*/
|
|
82
|
+
private _fieldError;
|
|
83
|
+
/** Returns true when a field has any validation error. */
|
|
84
|
+
private _fieldHasError;
|
|
85
|
+
/**
|
|
86
|
+
* Returns true when a group has at least one required, currently-visible field
|
|
87
|
+
* that is effectively empty.
|
|
88
|
+
*/
|
|
89
|
+
private _groupHasErrors;
|
|
90
|
+
/** Update invalid state for all fields, tab error dots, and guide bar. */
|
|
91
|
+
private _refreshValidation;
|
|
92
|
+
/** Show/hide tabs and groups based on their conditions. */
|
|
93
|
+
private _refreshGroupVisibility;
|
|
94
|
+
private _activateTab;
|
|
95
|
+
/** Show/hide tab scroll arrow buttons based on current scroll position and overflow. */
|
|
96
|
+
private _updateTabScrollBtns;
|
|
97
|
+
/**
|
|
98
|
+
* Hide the tabs area when there are 0 or 1 visible groups — a single tab
|
|
99
|
+
* provides no navigation value and adds visual noise.
|
|
100
|
+
*/
|
|
101
|
+
private _syncTabsAreaVisibility;
|
|
102
|
+
/**
|
|
103
|
+
* Renders (or removes) a small red "!" badge on each canvas shape that has
|
|
104
|
+
* at least one required config field with a missing or empty value.
|
|
105
|
+
* Badges live in a `<g>` appended to the SVG viewport group so they
|
|
106
|
+
* automatically follow pan and zoom.
|
|
107
|
+
*/
|
|
108
|
+
private _updateBadges;
|
|
109
|
+
/** Returns all visible fields that have any error (missing required or invalid FEEL). */
|
|
110
|
+
private _getMissingFields;
|
|
111
|
+
/** Switches to the group's tab, scrolls the field into view, and focuses its input. */
|
|
112
|
+
private _navigateToField;
|
|
113
|
+
/** Refreshes guide bar text and visibility; hides when no required fields are missing. */
|
|
114
|
+
private _refreshGuide;
|
|
115
|
+
private _setSearch;
|
|
116
|
+
private _buildSearchResults;
|
|
117
|
+
private _showPanel;
|
|
118
|
+
private _renderField;
|
|
119
|
+
private _renderFeelExpression;
|
|
120
|
+
private _renderTextInput;
|
|
121
|
+
private _renderTextarea;
|
|
122
|
+
private _renderSelect;
|
|
123
|
+
private _renderToggle;
|
|
124
|
+
private _renderActionButton;
|
|
125
|
+
}
|
|
126
|
+
export {};
|
|
127
|
+
//# sourceMappingURL=renderer.d.ts.map
|