@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.
Files changed (140) hide show
  1. package/README.md +153 -0
  2. package/dist/ai-bridge/css.d.ts +2 -0
  3. package/dist/ai-bridge/css.js +366 -0
  4. package/dist/ai-bridge/index.d.ts +44 -0
  5. package/dist/ai-bridge/index.js +132 -0
  6. package/dist/ai-bridge/panel.d.ts +27 -0
  7. package/dist/ai-bridge/panel.js +715 -0
  8. package/dist/ascii-view/css.d.ts +4 -0
  9. package/dist/ascii-view/css.js +83 -0
  10. package/dist/ascii-view/index.d.ts +25 -0
  11. package/dist/ascii-view/index.js +92 -0
  12. package/dist/command-palette/css.d.ts +4 -0
  13. package/dist/command-palette/css.js +157 -0
  14. package/dist/command-palette/index.d.ts +53 -0
  15. package/dist/command-palette/index.js +378 -0
  16. package/dist/command-palette-editor/index.d.ts +35 -0
  17. package/dist/command-palette-editor/index.js +60 -0
  18. package/dist/config-panel/css.d.ts +4 -0
  19. package/dist/config-panel/css.js +719 -0
  20. package/dist/config-panel/index.d.ts +36 -0
  21. package/dist/config-panel/index.js +73 -0
  22. package/dist/config-panel/renderer.d.ts +127 -0
  23. package/dist/config-panel/renderer.js +1162 -0
  24. package/dist/config-panel/types.d.ts +118 -0
  25. package/dist/config-panel/types.js +2 -0
  26. package/dist/config-panel-bpmn/index.d.ts +58 -0
  27. package/dist/config-panel-bpmn/index.js +1320 -0
  28. package/dist/config-panel-bpmn/template-engine.d.ts +17 -0
  29. package/dist/config-panel-bpmn/template-engine.js +307 -0
  30. package/dist/config-panel-bpmn/template-to-service-task.d.ts +30 -0
  31. package/dist/config-panel-bpmn/template-to-service-task.js +92 -0
  32. package/dist/config-panel-bpmn/template-types.d.ts +126 -0
  33. package/dist/config-panel-bpmn/template-types.js +6 -0
  34. package/dist/config-panel-bpmn/templates/generated.d.ts +3 -0
  35. package/dist/config-panel-bpmn/templates/generated.js +57865 -0
  36. package/dist/config-panel-bpmn/util.d.ts +46 -0
  37. package/dist/config-panel-bpmn/util.js +195 -0
  38. package/dist/dmn-editor/css.d.ts +3 -0
  39. package/dist/dmn-editor/css.js +667 -0
  40. package/dist/dmn-editor/dmn-editor.d.ts +34 -0
  41. package/dist/dmn-editor/dmn-editor.js +646 -0
  42. package/dist/dmn-editor/drd-canvas.d.ts +85 -0
  43. package/dist/dmn-editor/drd-canvas.js +1087 -0
  44. package/dist/dmn-editor/index.d.ts +3 -0
  45. package/dist/dmn-editor/index.js +2 -0
  46. package/dist/dmn-viewer/css.d.ts +3 -0
  47. package/dist/dmn-viewer/css.js +151 -0
  48. package/dist/dmn-viewer/dmn-viewer.d.ts +30 -0
  49. package/dist/dmn-viewer/dmn-viewer.js +160 -0
  50. package/dist/dmn-viewer/feel.d.ts +3 -0
  51. package/dist/dmn-viewer/feel.js +2 -0
  52. package/dist/dmn-viewer/index.d.ts +14 -0
  53. package/dist/dmn-viewer/index.js +12 -0
  54. package/dist/element-docs/content.d.ts +20 -0
  55. package/dist/element-docs/content.js +1032 -0
  56. package/dist/element-docs/index.d.ts +7 -0
  57. package/dist/element-docs/index.js +643 -0
  58. package/dist/feel-playground/css.d.ts +4 -0
  59. package/dist/feel-playground/css.js +292 -0
  60. package/dist/feel-playground/index.d.ts +4 -0
  61. package/dist/feel-playground/index.js +3 -0
  62. package/dist/feel-playground/playground-plugin.d.ts +14 -0
  63. package/dist/feel-playground/playground-plugin.js +292 -0
  64. package/dist/form-editor/css.d.ts +3 -0
  65. package/dist/form-editor/css.js +703 -0
  66. package/dist/form-editor/form-editor.d.ts +48 -0
  67. package/dist/form-editor/form-editor.js +1039 -0
  68. package/dist/form-editor/index.d.ts +3 -0
  69. package/dist/form-editor/index.js +2 -0
  70. package/dist/form-viewer/css.d.ts +3 -0
  71. package/dist/form-viewer/css.js +303 -0
  72. package/dist/form-viewer/form-viewer.d.ts +29 -0
  73. package/dist/form-viewer/form-viewer.js +376 -0
  74. package/dist/form-viewer/index.d.ts +12 -0
  75. package/dist/form-viewer/index.js +11 -0
  76. package/dist/history/checkpoint.d.ts +10 -0
  77. package/dist/history/checkpoint.js +92 -0
  78. package/dist/history/css.d.ts +2 -0
  79. package/dist/history/css.js +130 -0
  80. package/dist/history/history-panel.d.ts +12 -0
  81. package/dist/history/history-panel.js +142 -0
  82. package/dist/history/index.d.ts +5 -0
  83. package/dist/history/index.js +3 -0
  84. package/dist/main-menu/css.d.ts +4 -0
  85. package/dist/main-menu/css.js +272 -0
  86. package/dist/main-menu/index.d.ts +59 -0
  87. package/dist/main-menu/index.js +285 -0
  88. package/dist/minimap/css.d.ts +10 -0
  89. package/dist/minimap/css.js +54 -0
  90. package/dist/minimap/index.d.ts +38 -0
  91. package/dist/minimap/index.js +69 -0
  92. package/dist/minimap/minimap.d.ts +35 -0
  93. package/dist/minimap/minimap.js +166 -0
  94. package/dist/optimize/index.d.ts +21 -0
  95. package/dist/optimize/index.js +304 -0
  96. package/dist/process-runner/css.d.ts +2 -0
  97. package/dist/process-runner/css.js +467 -0
  98. package/dist/process-runner/index.d.ts +56 -0
  99. package/dist/process-runner/index.js +549 -0
  100. package/dist/storage/auto-save.d.ts +11 -0
  101. package/dist/storage/auto-save.js +44 -0
  102. package/dist/storage/css.d.ts +2 -0
  103. package/dist/storage/css.js +2 -0
  104. package/dist/storage/db.d.ts +99 -0
  105. package/dist/storage/db.js +116 -0
  106. package/dist/storage/dialog.d.ts +15 -0
  107. package/dist/storage/dialog.js +201 -0
  108. package/dist/storage/export.d.ts +3 -0
  109. package/dist/storage/export.js +137 -0
  110. package/dist/storage/index.d.ts +44 -0
  111. package/dist/storage/index.js +201 -0
  112. package/dist/storage/sidebar.d.ts +2 -0
  113. package/dist/storage/sidebar.js +2 -0
  114. package/dist/storage/storage-api.d.ts +76 -0
  115. package/dist/storage/storage-api.js +342 -0
  116. package/dist/storage/types.d.ts +44 -0
  117. package/dist/storage/types.js +2 -0
  118. package/dist/storage-tabs-bridge/index.d.ts +96 -0
  119. package/dist/storage-tabs-bridge/index.js +502 -0
  120. package/dist/tabs/css.d.ts +3 -0
  121. package/dist/tabs/css.js +642 -0
  122. package/dist/tabs/file-resolver.d.ts +71 -0
  123. package/dist/tabs/file-resolver.js +46 -0
  124. package/dist/tabs/index.d.ts +15 -0
  125. package/dist/tabs/index.js +13 -0
  126. package/dist/tabs/tabs-plugin.d.ts +250 -0
  127. package/dist/tabs/tabs-plugin.js +1119 -0
  128. package/dist/token-highlight/css.d.ts +2 -0
  129. package/dist/token-highlight/css.js +81 -0
  130. package/dist/token-highlight/index.d.ts +44 -0
  131. package/dist/token-highlight/index.js +164 -0
  132. package/dist/watermark/css.d.ts +10 -0
  133. package/dist/watermark/css.js +54 -0
  134. package/dist/watermark/index.d.ts +48 -0
  135. package/dist/watermark/index.js +64 -0
  136. package/dist/zoom-controls/css.d.ts +4 -0
  137. package/dist/zoom-controls/css.js +48 -0
  138. package/dist/zoom-controls/index.d.ts +36 -0
  139. package/dist/zoom-controls/index.js +111 -0
  140. package/package.json +121 -0
@@ -0,0 +1,4 @@
1
+ export declare const ASCII_VIEW_STYLE_ID = "bpmnkit-ascii-view-styles-v1";
2
+ export declare const ASCII_VIEW_CSS = "\n.bpmnkit-ascii-overlay {\n position: fixed; inset: 0; z-index: 200;\n background: rgba(0,0,0,0.6);\n display: flex; align-items: center; justify-content: center;\n}\n.bpmnkit-ascii-panel {\n background: var(--bpmnkit-panel-bg, rgba(13,13,22,0.92));\n border: 1px solid var(--bpmnkit-panel-border, rgba(255,255,255,0.08));\n border-radius: 10px;\n width: 80vw; max-width: 900px; max-height: 80vh;\n display: flex; flex-direction: column;\n font-family: system-ui, sans-serif;\n box-shadow: 0 16px 48px rgba(0,0,0,0.7);\n overflow: hidden;\n}\n.bpmnkit-ascii-header {\n padding: 14px 18px;\n border-bottom: 1px solid rgba(255,255,255,0.08);\n display: flex; align-items: center; justify-content: space-between;\n flex-shrink: 0;\n}\n.bpmnkit-ascii-title {\n font-size: 14px; font-weight: 600;\n color: rgba(255,255,255,0.9);\n margin: 0;\n}\n.bpmnkit-ascii-actions { display: flex; gap: 8px; align-items: center; }\n.bpmnkit-ascii-btn {\n font-size: 12px; padding: 4px 12px; border-radius: 5px;\n cursor: pointer; font-weight: 500;\n border: 1px solid rgba(255,255,255,0.12);\n background: rgba(255,255,255,0.06);\n color: rgba(255,255,255,0.8);\n}\n.bpmnkit-ascii-btn:hover { background: rgba(255,255,255,0.1); }\n.bpmnkit-ascii-btn-copied {\n background: rgba(40,180,80,0.25) !important;\n border-color: rgba(40,180,80,0.5) !important;\n color: #8f8 !important;\n}\n.bpmnkit-ascii-body {\n flex: 1; overflow: auto; padding: 16px 18px;\n background: rgba(0,0,0,0.2);\n}\n.bpmnkit-ascii-pre {\n margin: 0;\n font-family: \"Fira Code\", \"Cascadia Code\", Consolas, Monaco, monospace;\n font-size: 13px; line-height: 1.45;\n color: #b0c4de;\n white-space: pre;\n}\n/* Light theme */\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-ascii-panel {\n background: rgba(252,252,254,0.98);\n border-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));\n box-shadow: 0 8px 32px rgba(0,0,0,0.15);\n}\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-ascii-header {\n border-bottom-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));\n}\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-ascii-title { color: rgba(0,0,0,0.88); }\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-ascii-btn {\n border-color: rgba(0,0,0,0.12);\n background: rgba(0,0,0,0.04);\n color: rgba(0,0,0,0.7);\n}\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-ascii-btn:hover { background: rgba(0,0,0,0.08); }\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-ascii-body { background: rgba(0,0,0,0.03); }\n[data-bpmnkit-hud-theme=\"light\"] .bpmnkit-ascii-pre { color: #1a3050; }\n";
3
+ export declare function injectAsciiViewStyles(): void;
4
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1,83 @@
1
+ export const ASCII_VIEW_STYLE_ID = "bpmnkit-ascii-view-styles-v1";
2
+ export const ASCII_VIEW_CSS = `
3
+ .bpmnkit-ascii-overlay {
4
+ position: fixed; inset: 0; z-index: 200;
5
+ background: rgba(0,0,0,0.6);
6
+ display: flex; align-items: center; justify-content: center;
7
+ }
8
+ .bpmnkit-ascii-panel {
9
+ background: var(--bpmnkit-panel-bg, rgba(13,13,22,0.92));
10
+ border: 1px solid var(--bpmnkit-panel-border, rgba(255,255,255,0.08));
11
+ border-radius: 10px;
12
+ width: 80vw; max-width: 900px; max-height: 80vh;
13
+ display: flex; flex-direction: column;
14
+ font-family: system-ui, sans-serif;
15
+ box-shadow: 0 16px 48px rgba(0,0,0,0.7);
16
+ overflow: hidden;
17
+ }
18
+ .bpmnkit-ascii-header {
19
+ padding: 14px 18px;
20
+ border-bottom: 1px solid rgba(255,255,255,0.08);
21
+ display: flex; align-items: center; justify-content: space-between;
22
+ flex-shrink: 0;
23
+ }
24
+ .bpmnkit-ascii-title {
25
+ font-size: 14px; font-weight: 600;
26
+ color: rgba(255,255,255,0.9);
27
+ margin: 0;
28
+ }
29
+ .bpmnkit-ascii-actions { display: flex; gap: 8px; align-items: center; }
30
+ .bpmnkit-ascii-btn {
31
+ font-size: 12px; padding: 4px 12px; border-radius: 5px;
32
+ cursor: pointer; font-weight: 500;
33
+ border: 1px solid rgba(255,255,255,0.12);
34
+ background: rgba(255,255,255,0.06);
35
+ color: rgba(255,255,255,0.8);
36
+ }
37
+ .bpmnkit-ascii-btn:hover { background: rgba(255,255,255,0.1); }
38
+ .bpmnkit-ascii-btn-copied {
39
+ background: rgba(40,180,80,0.25) !important;
40
+ border-color: rgba(40,180,80,0.5) !important;
41
+ color: #8f8 !important;
42
+ }
43
+ .bpmnkit-ascii-body {
44
+ flex: 1; overflow: auto; padding: 16px 18px;
45
+ background: rgba(0,0,0,0.2);
46
+ }
47
+ .bpmnkit-ascii-pre {
48
+ margin: 0;
49
+ font-family: "Fira Code", "Cascadia Code", Consolas, Monaco, monospace;
50
+ font-size: 13px; line-height: 1.45;
51
+ color: #b0c4de;
52
+ white-space: pre;
53
+ }
54
+ /* Light theme */
55
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-ascii-panel {
56
+ background: rgba(252,252,254,0.98);
57
+ border-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));
58
+ box-shadow: 0 8px 32px rgba(0,0,0,0.15);
59
+ }
60
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-ascii-header {
61
+ border-bottom-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));
62
+ }
63
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-ascii-title { color: rgba(0,0,0,0.88); }
64
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-ascii-btn {
65
+ border-color: rgba(0,0,0,0.12);
66
+ background: rgba(0,0,0,0.04);
67
+ color: rgba(0,0,0,0.7);
68
+ }
69
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-ascii-btn:hover { background: rgba(0,0,0,0.08); }
70
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-ascii-body { background: rgba(0,0,0,0.03); }
71
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-ascii-pre { color: #1a3050; }
72
+ `;
73
+ export function injectAsciiViewStyles() {
74
+ if (typeof document === "undefined")
75
+ return;
76
+ if (document.getElementById(ASCII_VIEW_STYLE_ID))
77
+ return;
78
+ const style = document.createElement("style");
79
+ style.id = ASCII_VIEW_STYLE_ID;
80
+ style.textContent = ASCII_VIEW_CSS;
81
+ document.head.appendChild(style);
82
+ }
83
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1,25 @@
1
+ import type { CanvasPlugin } from "@bpmnkit/canvas";
2
+ export { ASCII_VIEW_CSS, ASCII_VIEW_STYLE_ID, injectAsciiViewStyles } from "./css.js";
3
+ export interface AsciiViewPluginOptions {
4
+ /** Returns the current BPMN XML string, or null if no diagram is loaded. */
5
+ getXml: () => string | null;
6
+ }
7
+ /**
8
+ * Creates an ASCII view plugin that provides a button for viewing the current
9
+ * BPMN diagram rendered as a Unicode box-drawing ASCII diagram.
10
+ *
11
+ * The returned `button` should be passed to `initEditorHud` as `asciiButton`.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const asciiViewPlugin = createAsciiViewPlugin({
16
+ * getXml: () => editorRef?.getXml() ?? null,
17
+ * });
18
+ * // ...
19
+ * initEditorHud(editor, { asciiButton: asciiViewPlugin.button });
20
+ * ```
21
+ */
22
+ export declare function createAsciiViewPlugin(options: AsciiViewPluginOptions): CanvasPlugin & {
23
+ button: HTMLButtonElement;
24
+ };
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,92 @@
1
+ import { renderBpmnAscii } from "@bpmnkit/ascii";
2
+ import { injectAsciiViewStyles } from "./css.js";
3
+ export { ASCII_VIEW_CSS, ASCII_VIEW_STYLE_ID, injectAsciiViewStyles } from "./css.js";
4
+ const ASCII_ICON = `<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="3" width="14" height="10" rx="1.5"/><path d="M4 7l1.5 2L4 11"/><path d="M8.5 11h3.5"/></svg>`;
5
+ function showAsciiDialog(xml) {
6
+ const ascii = renderBpmnAscii(xml, { title: false });
7
+ const overlay = document.createElement("div");
8
+ overlay.className = "bpmnkit-ascii-overlay";
9
+ overlay.addEventListener("click", (e) => {
10
+ if (e.target === overlay)
11
+ overlay.remove();
12
+ });
13
+ const panel = document.createElement("div");
14
+ panel.className = "bpmnkit-ascii-panel";
15
+ const header = document.createElement("div");
16
+ header.className = "bpmnkit-ascii-header";
17
+ const title = document.createElement("div");
18
+ title.className = "bpmnkit-ascii-title";
19
+ title.textContent = "ASCII Diagram";
20
+ const actions = document.createElement("div");
21
+ actions.className = "bpmnkit-ascii-actions";
22
+ const copyBtn = document.createElement("button");
23
+ copyBtn.className = "bpmnkit-ascii-btn";
24
+ copyBtn.textContent = "Copy";
25
+ copyBtn.addEventListener("click", () => {
26
+ void navigator.clipboard.writeText(ascii).then(() => {
27
+ copyBtn.textContent = "Copied!";
28
+ copyBtn.classList.add("bpmnkit-ascii-btn-copied");
29
+ setTimeout(() => {
30
+ copyBtn.textContent = "Copy";
31
+ copyBtn.classList.remove("bpmnkit-ascii-btn-copied");
32
+ }, 1500);
33
+ });
34
+ });
35
+ const closeBtn = document.createElement("button");
36
+ closeBtn.className = "bpmnkit-ascii-btn";
37
+ closeBtn.textContent = "Close";
38
+ closeBtn.addEventListener("click", () => overlay.remove());
39
+ actions.append(copyBtn, closeBtn);
40
+ header.append(title, actions);
41
+ const body = document.createElement("div");
42
+ body.className = "bpmnkit-ascii-body";
43
+ const pre = document.createElement("pre");
44
+ pre.className = "bpmnkit-ascii-pre";
45
+ pre.textContent = ascii;
46
+ body.append(pre);
47
+ panel.append(header, body);
48
+ overlay.append(panel);
49
+ document.body.append(overlay);
50
+ // Close on Escape
51
+ const onKey = (e) => {
52
+ if (e.key === "Escape") {
53
+ overlay.remove();
54
+ document.removeEventListener("keydown", onKey);
55
+ }
56
+ };
57
+ document.addEventListener("keydown", onKey);
58
+ overlay.addEventListener("remove", () => document.removeEventListener("keydown", onKey));
59
+ }
60
+ /**
61
+ * Creates an ASCII view plugin that provides a button for viewing the current
62
+ * BPMN diagram rendered as a Unicode box-drawing ASCII diagram.
63
+ *
64
+ * The returned `button` should be passed to `initEditorHud` as `asciiButton`.
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const asciiViewPlugin = createAsciiViewPlugin({
69
+ * getXml: () => editorRef?.getXml() ?? null,
70
+ * });
71
+ * // ...
72
+ * initEditorHud(editor, { asciiButton: asciiViewPlugin.button });
73
+ * ```
74
+ */
75
+ export function createAsciiViewPlugin(options) {
76
+ injectAsciiViewStyles();
77
+ const button = document.createElement("button");
78
+ button.title = "View as ASCII";
79
+ button.innerHTML = ASCII_ICON;
80
+ button.addEventListener("click", () => {
81
+ const xml = options.getXml();
82
+ if (!xml)
83
+ return;
84
+ showAsciiDialog(xml);
85
+ });
86
+ return {
87
+ name: "ascii-view",
88
+ install() { },
89
+ button,
90
+ };
91
+ }
92
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ export declare const COMMAND_PALETTE_STYLE_ID = "bpmnkit-command-palette-styles-v1";
2
+ export declare const COMMAND_PALETTE_CSS = "\n/* \u2500\u2500 Overlay backdrop \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-palette-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.45);\n backdrop-filter: blur(3px);\n z-index: 9999;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n padding-top: 15vh;\n font-family: system-ui, -apple-system, sans-serif;\n}\n\n/* \u2500\u2500 Panel \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\u2500\u2500\u2500\u2500\u2500 */\n.bpmnkit-palette-panel {\n width: min(560px, calc(100vw - 32px));\n background: var(--bpmnkit-panel-bg, rgba(13,13,22,0.92));\n border: 1px solid var(--bpmnkit-panel-border, rgba(255,255,255,0.08));\n border-radius: 12px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n}\n\n/* \u2500\u2500 Search row \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-palette-search {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 0 16px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n flex-shrink: 0;\n}\n.bpmnkit-palette-search-icon {\n display: flex;\n align-items: center;\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n color: rgba(255, 255, 255, 0.35);\n pointer-events: none;\n}\n.bpmnkit-palette-search-icon svg { width: 16px; height: 16px; }\n.bpmnkit-palette-input {\n flex: 1;\n height: 48px;\n background: transparent;\n border: none;\n outline: none;\n color: rgba(255, 255, 255, 0.9);\n font-size: 14px;\n caret-color: var(--bpmnkit-accent, #6b9df7);\n}\n.bpmnkit-palette-input::placeholder { color: rgba(255, 255, 255, 0.3); }\n\n/* \u2500\u2500 Keyboard hint \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-palette-kbd {\n display: flex;\n align-items: center;\n gap: 3px;\n flex-shrink: 0;\n}\n.bpmnkit-palette-kbd kbd {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 2px 5px;\n background: rgba(255, 255, 255, 0.07);\n border: 1px solid rgba(255, 255, 255, 0.12);\n border-radius: 4px;\n font-family: system-ui, sans-serif;\n font-size: 11px;\n color: rgba(255, 255, 255, 0.4);\n line-height: 1;\n}\n\n/* \u2500\u2500 Commands list \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-palette-list {\n max-height: 360px;\n overflow-y: auto;\n padding: 4px;\n}\n.bpmnkit-palette-empty {\n padding: 20px 16px;\n text-align: center;\n color: rgba(255, 255, 255, 0.3);\n font-size: 13px;\n}\n.bpmnkit-palette-item {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 9px 12px;\n border-radius: 7px;\n cursor: pointer;\n color: rgba(255, 255, 255, 0.75);\n font-size: 13px;\n user-select: none;\n}\n.bpmnkit-palette-item:hover,\n.bpmnkit-palette-item.bpmnkit-palette-focused {\n background: rgba(255, 255, 255, 0.08);\n color: rgba(255, 255, 255, 0.95);\n}\n.bpmnkit-palette-item-title { flex: 1; }\n.bpmnkit-palette-item-desc {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.35);\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 */\n.bpmnkit-palette--light .bpmnkit-palette-panel {\n background: rgba(250, 250, 252, 0.98);\n border-color: var(--bpmnkit-panel-border, rgba(0, 0, 0, 0.08));\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);\n}\n.bpmnkit-palette--light .bpmnkit-palette-search {\n border-bottom-color: var(--bpmnkit-panel-border, rgba(0, 0, 0, 0.08));\n}\n.bpmnkit-palette--light .bpmnkit-palette-search-icon { color: rgba(0, 0, 0, 0.35); }\n.bpmnkit-palette--light .bpmnkit-palette-input { color: rgba(0, 0, 0, 0.9); caret-color: var(--bpmnkit-accent, #1a56db); }\n.bpmnkit-palette--light .bpmnkit-palette-input::placeholder { color: rgba(0, 0, 0, 0.3); }\n.bpmnkit-palette--light .bpmnkit-palette-kbd kbd {\n background: rgba(0, 0, 0, 0.05);\n border-color: rgba(0, 0, 0, 0.12);\n color: rgba(0, 0, 0, 0.4);\n}\n.bpmnkit-palette--light .bpmnkit-palette-empty { color: rgba(0, 0, 0, 0.3); }\n.bpmnkit-palette--light .bpmnkit-palette-item { color: rgba(0, 0, 0, 0.75); }\n.bpmnkit-palette--light .bpmnkit-palette-item:hover,\n.bpmnkit-palette--light .bpmnkit-palette-item.bpmnkit-palette-focused {\n background: rgba(0, 0, 0, 0.06);\n color: rgba(0, 0, 0, 0.95);\n}\n.bpmnkit-palette--light .bpmnkit-palette-item-desc { color: rgba(0, 0, 0, 0.4); }\n\n/* \u2500\u2500 Zen mode: hide internal canvas controls \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-zen-mode .bpmnkit-zoom-controls,\n.bpmnkit-zen-mode .bpmnkit-main-menu-panel {\n display: none !important;\n}\n";
3
+ export declare function injectCommandPaletteStyles(): void;
4
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1,157 @@
1
+ export const COMMAND_PALETTE_STYLE_ID = "bpmnkit-command-palette-styles-v1";
2
+ export const COMMAND_PALETTE_CSS = `
3
+ /* ── Overlay backdrop ─────────────────────────────────────────────────────── */
4
+ .bpmnkit-palette-overlay {
5
+ position: fixed;
6
+ inset: 0;
7
+ background: rgba(0, 0, 0, 0.45);
8
+ backdrop-filter: blur(3px);
9
+ z-index: 9999;
10
+ display: flex;
11
+ align-items: flex-start;
12
+ justify-content: center;
13
+ padding-top: 15vh;
14
+ font-family: system-ui, -apple-system, sans-serif;
15
+ }
16
+
17
+ /* ── Panel ────────────────────────────────────────────────────────────────── */
18
+ .bpmnkit-palette-panel {
19
+ width: min(560px, calc(100vw - 32px));
20
+ background: var(--bpmnkit-panel-bg, rgba(13,13,22,0.92));
21
+ border: 1px solid var(--bpmnkit-panel-border, rgba(255,255,255,0.08));
22
+ border-radius: 12px;
23
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
24
+ overflow: hidden;
25
+ display: flex;
26
+ flex-direction: column;
27
+ }
28
+
29
+ /* ── Search row ───────────────────────────────────────────────────────────── */
30
+ .bpmnkit-palette-search {
31
+ display: flex;
32
+ align-items: center;
33
+ gap: 10px;
34
+ padding: 0 16px;
35
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
36
+ flex-shrink: 0;
37
+ }
38
+ .bpmnkit-palette-search-icon {
39
+ display: flex;
40
+ align-items: center;
41
+ width: 16px;
42
+ height: 16px;
43
+ flex-shrink: 0;
44
+ color: rgba(255, 255, 255, 0.35);
45
+ pointer-events: none;
46
+ }
47
+ .bpmnkit-palette-search-icon svg { width: 16px; height: 16px; }
48
+ .bpmnkit-palette-input {
49
+ flex: 1;
50
+ height: 48px;
51
+ background: transparent;
52
+ border: none;
53
+ outline: none;
54
+ color: rgba(255, 255, 255, 0.9);
55
+ font-size: 14px;
56
+ caret-color: var(--bpmnkit-accent, #6b9df7);
57
+ }
58
+ .bpmnkit-palette-input::placeholder { color: rgba(255, 255, 255, 0.3); }
59
+
60
+ /* ── Keyboard hint ────────────────────────────────────────────────────────── */
61
+ .bpmnkit-palette-kbd {
62
+ display: flex;
63
+ align-items: center;
64
+ gap: 3px;
65
+ flex-shrink: 0;
66
+ }
67
+ .bpmnkit-palette-kbd kbd {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ padding: 2px 5px;
72
+ background: rgba(255, 255, 255, 0.07);
73
+ border: 1px solid rgba(255, 255, 255, 0.12);
74
+ border-radius: 4px;
75
+ font-family: system-ui, sans-serif;
76
+ font-size: 11px;
77
+ color: rgba(255, 255, 255, 0.4);
78
+ line-height: 1;
79
+ }
80
+
81
+ /* ── Commands list ────────────────────────────────────────────────────────── */
82
+ .bpmnkit-palette-list {
83
+ max-height: 360px;
84
+ overflow-y: auto;
85
+ padding: 4px;
86
+ }
87
+ .bpmnkit-palette-empty {
88
+ padding: 20px 16px;
89
+ text-align: center;
90
+ color: rgba(255, 255, 255, 0.3);
91
+ font-size: 13px;
92
+ }
93
+ .bpmnkit-palette-item {
94
+ display: flex;
95
+ align-items: center;
96
+ gap: 10px;
97
+ padding: 9px 12px;
98
+ border-radius: 7px;
99
+ cursor: pointer;
100
+ color: rgba(255, 255, 255, 0.75);
101
+ font-size: 13px;
102
+ user-select: none;
103
+ }
104
+ .bpmnkit-palette-item:hover,
105
+ .bpmnkit-palette-item.bpmnkit-palette-focused {
106
+ background: rgba(255, 255, 255, 0.08);
107
+ color: rgba(255, 255, 255, 0.95);
108
+ }
109
+ .bpmnkit-palette-item-title { flex: 1; }
110
+ .bpmnkit-palette-item-desc {
111
+ font-size: 11px;
112
+ color: rgba(255, 255, 255, 0.35);
113
+ }
114
+
115
+ /* ── Light theme overrides ────────────────────────────────────────────────── */
116
+ .bpmnkit-palette--light .bpmnkit-palette-panel {
117
+ background: rgba(250, 250, 252, 0.98);
118
+ border-color: var(--bpmnkit-panel-border, rgba(0, 0, 0, 0.08));
119
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
120
+ }
121
+ .bpmnkit-palette--light .bpmnkit-palette-search {
122
+ border-bottom-color: var(--bpmnkit-panel-border, rgba(0, 0, 0, 0.08));
123
+ }
124
+ .bpmnkit-palette--light .bpmnkit-palette-search-icon { color: rgba(0, 0, 0, 0.35); }
125
+ .bpmnkit-palette--light .bpmnkit-palette-input { color: rgba(0, 0, 0, 0.9); caret-color: var(--bpmnkit-accent, #1a56db); }
126
+ .bpmnkit-palette--light .bpmnkit-palette-input::placeholder { color: rgba(0, 0, 0, 0.3); }
127
+ .bpmnkit-palette--light .bpmnkit-palette-kbd kbd {
128
+ background: rgba(0, 0, 0, 0.05);
129
+ border-color: rgba(0, 0, 0, 0.12);
130
+ color: rgba(0, 0, 0, 0.4);
131
+ }
132
+ .bpmnkit-palette--light .bpmnkit-palette-empty { color: rgba(0, 0, 0, 0.3); }
133
+ .bpmnkit-palette--light .bpmnkit-palette-item { color: rgba(0, 0, 0, 0.75); }
134
+ .bpmnkit-palette--light .bpmnkit-palette-item:hover,
135
+ .bpmnkit-palette--light .bpmnkit-palette-item.bpmnkit-palette-focused {
136
+ background: rgba(0, 0, 0, 0.06);
137
+ color: rgba(0, 0, 0, 0.95);
138
+ }
139
+ .bpmnkit-palette--light .bpmnkit-palette-item-desc { color: rgba(0, 0, 0, 0.4); }
140
+
141
+ /* ── Zen mode: hide internal canvas controls ──────────────────────────────── */
142
+ .bpmnkit-zen-mode .bpmnkit-zoom-controls,
143
+ .bpmnkit-zen-mode .bpmnkit-main-menu-panel {
144
+ display: none !important;
145
+ }
146
+ `;
147
+ export function injectCommandPaletteStyles() {
148
+ if (typeof document === "undefined")
149
+ return;
150
+ if (document.getElementById(COMMAND_PALETTE_STYLE_ID))
151
+ return;
152
+ const style = document.createElement("style");
153
+ style.id = COMMAND_PALETTE_STYLE_ID;
154
+ style.textContent = COMMAND_PALETTE_CSS;
155
+ document.head.appendChild(style);
156
+ }
157
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @bpmnkit/canvas-plugin-command-palette — Ctrl+K / ⌘K command palette for
3
+ * `@bpmnkit/canvas` and `@bpmnkit/editor`.
4
+ *
5
+ * ## Usage
6
+ * ```typescript
7
+ * import { createCommandPalettePlugin } from "@bpmnkit/canvas-plugin-command-palette";
8
+ *
9
+ * const palette = createCommandPalettePlugin({
10
+ * onZenModeChange: (active) => {
11
+ * document.querySelectorAll(".hud").forEach(
12
+ * (el) => { (el as HTMLElement).style.display = active ? "none" : ""; }
13
+ * );
14
+ * },
15
+ * });
16
+ *
17
+ * const editor = new BpmnEditor({ container, xml, plugins: [palette] });
18
+ * ```
19
+ *
20
+ * @packageDocumentation
21
+ */
22
+ import type { CanvasPlugin } from "@bpmnkit/canvas";
23
+ export { COMMAND_PALETTE_CSS, COMMAND_PALETTE_STYLE_ID, injectCommandPaletteStyles, } from "./css.js";
24
+ export interface Command {
25
+ id: string;
26
+ title: string;
27
+ /** Short hint shown on the right side of the item. */
28
+ description?: string;
29
+ action: () => void;
30
+ }
31
+ export interface CommandPaletteOptions {
32
+ /**
33
+ * Called when zen mode is toggled.
34
+ * Use this to hide/show external toolbars that live outside the canvas
35
+ * container (e.g. HUD elements in the landing page).
36
+ */
37
+ onZenModeChange?: (active: boolean) => void;
38
+ /** Filename for exported BPMN XML downloads. Defaults to `"diagram.bpmn"`. */
39
+ exportFilename?: string;
40
+ }
41
+ /**
42
+ * The command palette plugin extends `CanvasPlugin` with an `addCommands`
43
+ * method so other plugins (e.g. the editor extension) can register commands.
44
+ */
45
+ export interface CommandPalettePlugin extends CanvasPlugin {
46
+ /**
47
+ * Registers additional commands in the palette.
48
+ * Returns a function that, when called, deregisters those commands.
49
+ */
50
+ addCommands(cmds: Command[]): () => void;
51
+ }
52
+ export declare function createCommandPalettePlugin(options?: CommandPaletteOptions): CommandPalettePlugin;
53
+ //# sourceMappingURL=index.d.ts.map