@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 FEEL_PLAYGROUND_STYLE_ID = "feel-playground-styles";
2
+ export declare const FEEL_PLAYGROUND_CSS = "\n/* \u2500\u2500 Light-theme defaults \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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.feel-playground {\n --fp-bg: #fafafa;\n --fp-header-bg: #f0f0f0;\n --fp-border: #e0e0e0;\n --fp-text: #333333;\n --fp-muted: #666666;\n --fp-input-bg: #ffffff;\n --fp-result-bg: #f5f5f5;\n --fp-error-bg: #fff2f2;\n --fp-error-text: #cc0000;\n --fp-active-btn-bg: #0062ff;\n --fp-active-btn-fg: #ffffff;\n --fp-inactive-btn-bg: #e8e8e8;\n --fp-inactive-btn-border: #d0d0d0;\n --fp-inactive-btn-fg: #444444;\n --fp-select-bg: #ffffff;\n}\n\n/* \u2500\u2500 Dark-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 */\n[data-theme=\"dark\"] .feel-playground {\n --fp-bg: #1e1e1e;\n --fp-header-bg: #252526;\n --fp-border: #3c3c3c;\n --fp-text: #d4d4d4;\n --fp-muted: #888888;\n --fp-input-bg: #1e1e1e;\n --fp-result-bg: #252526;\n --fp-error-bg: #3c1e1e;\n --fp-error-text: #f44747;\n --fp-active-btn-bg: #0e639c;\n --fp-active-btn-fg: #ffffff;\n --fp-inactive-btn-bg: #3c3c3c;\n --fp-inactive-btn-border: #555555;\n --fp-inactive-btn-fg: #cccccc;\n --fp-select-bg: #3c3c3c;\n}\n\n.feel-playground {\n width: 100%;\n height: 100%;\n background: var(--fp-bg);\n color: var(--fp-text);\n font-family: monospace;\n font-size: 13px;\n display: flex;\n flex-direction: column;\n align-items: center;\n overflow-y: auto;\n}\n\n/* Overlay wrapper \u2014 used only by createFeelPlaygroundPlugin() */\n.feel-playground-overlay {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 480px;\n max-height: 70%;\n z-index: 100;\n border-top-left-radius: 6px;\n border: 1px solid var(--fp-border, #e0e0e0);\n border-right: none;\n border-bottom: none;\n overflow: hidden;\n box-shadow: -4px -4px 20px rgba(0, 0, 0, 0.15);\n}\n\n[data-theme=\"dark\"] .feel-playground-overlay {\n border-color: #3c3c3c;\n box-shadow: -4px -4px 20px rgba(0, 0, 0, 0.4);\n}\n\n.feel-playground__header {\n display: flex;\n align-items: center;\n padding: 6px 16px;\n background: var(--fp-header-bg);\n border-bottom: 1px solid var(--fp-border);\n gap: 8px;\n user-select: none;\n width: 100%;\n max-width: 800px;\n box-sizing: border-box;\n flex-shrink: 0;\n}\n\n.feel-playground__title {\n font-weight: bold;\n color: var(--fp-text);\n font-size: 12px;\n flex: 1;\n font-family: system-ui, sans-serif;\n}\n\n.feel-playground__close {\n cursor: pointer;\n color: var(--fp-muted);\n background: none;\n border: none;\n font-size: 16px;\n padding: 0 4px;\n line-height: 1;\n}\n\n.feel-playground__close:hover { color: var(--fp-text); }\n\n.feel-playground__mode {\n display: flex;\n gap: 4px;\n}\n\n.feel-playground__mode button {\n background: var(--fp-inactive-btn-bg);\n border: 1px solid var(--fp-inactive-btn-border);\n color: var(--fp-inactive-btn-fg);\n border-radius: 3px;\n padding: 2px 8px;\n font-size: 11px;\n cursor: pointer;\n}\n\n.feel-playground__mode button.active {\n background: var(--fp-active-btn-bg);\n color: var(--fp-active-btn-fg);\n border-color: var(--fp-active-btn-bg);\n}\n\n.feel-playground__body {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 12px 16px;\n flex: 1;\n width: 100%;\n max-width: 800px;\n box-sizing: border-box;\n}\n\n.feel-playground__label {\n font-size: 11px;\n color: var(--fp-muted);\n margin-bottom: 2px;\n font-family: system-ui, sans-serif;\n}\n\n.feel-playground__input-wrap {\n position: relative;\n border: 1px solid var(--fp-border);\n border-radius: 3px;\n background: var(--fp-input-bg);\n}\n\n.feel-playground__input-wrap:focus-within {\n border-color: var(--fp-active-btn-bg);\n}\n\n.feel-playground__highlight {\n position: absolute;\n top: 0; left: 0;\n padding: 5px 8px;\n pointer-events: none;\n white-space: pre-wrap;\n word-break: break-word;\n color: transparent;\n z-index: 1;\n font: inherit;\n line-height: 1.5;\n}\n\n.feel-playground__textarea {\n position: relative;\n width: 100%;\n box-sizing: border-box;\n background: transparent;\n border: none;\n color: var(--fp-text);\n padding: 5px 8px;\n font: inherit;\n line-height: 1.5;\n resize: vertical;\n min-height: 60px;\n outline: none;\n z-index: 2;\n caret-color: var(--fp-text);\n}\n\n.feel-playground__context {\n width: 100%;\n box-sizing: border-box;\n background: var(--fp-input-bg);\n border: 1px solid var(--fp-border);\n border-radius: 3px;\n color: var(--fp-text);\n padding: 5px 8px;\n font: inherit;\n resize: vertical;\n min-height: 50px;\n outline: none;\n}\n\n.feel-playground__context:focus {\n border-color: var(--fp-active-btn-bg);\n}\n\n.feel-playground__result {\n padding: 6px 8px;\n background: var(--fp-result-bg);\n border: 1px solid var(--fp-border);\n border-radius: 3px;\n min-height: 28px;\n white-space: pre-wrap;\n word-break: break-word;\n font-family: system-ui, sans-serif;\n}\n\n.feel-playground__result.null-val { color: var(--fp-muted); font-style: italic; }\n\n/* result type colors \u2014 light theme */\n.feel-playground__result.bool-true { color: #15803d; }\n.feel-playground__result.bool-false { color: #b45309; }\n.feel-playground__result.number { color: #0369a1; }\n.feel-playground__result.string { color: #9f1239; }\n\n/* result type colors \u2014 dark theme */\n[data-theme=\"dark\"] .feel-playground__result.bool-true { color: #4ec9b0; }\n[data-theme=\"dark\"] .feel-playground__result.bool-false { color: #ce9178; }\n[data-theme=\"dark\"] .feel-playground__result.number { color: #b5cea8; }\n[data-theme=\"dark\"] .feel-playground__result.string { color: #ce9178; }\n\n.feel-playground__errors {\n font-size: 11px;\n color: var(--fp-error-text);\n padding: 4px 6px;\n background: var(--fp-error-bg);\n border-radius: 3px;\n font-family: system-ui, sans-serif;\n}\n\n.feel-playground__examples {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.feel-playground__examples select {\n flex: 1;\n background: var(--fp-select-bg);\n border: 1px solid var(--fp-border);\n color: var(--fp-text);\n padding: 3px 6px;\n border-radius: 3px;\n font-size: 12px;\n font-family: system-ui, sans-serif;\n}\n\n/* \u2500\u2500 FEEL syntax highlighting \u2014 light theme \u2500\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.feel-keyword { color: #0000cc; }\n.feel-operator { color: #555555; }\n.feel-literal-number { color: #09885a; }\n.feel-literal-string { color: #a31515; }\n.feel-literal-temporal{ color: #0070c1; }\n.feel-literal-bool { color: #0000cc; }\n.feel-literal-null { color: #0000cc; }\n.feel-builtin { color: #795e26; }\n.feel-variable { color: #001080; }\n.feel-comment { color: #008000; font-style: italic; }\n.feel-punctuation { color: #555555; }\n\n/* \u2500\u2500 FEEL syntax highlighting \u2014 dark theme \u2500\u2500\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-theme=\"dark\"] .feel-keyword { color: #569cd6; }\n[data-theme=\"dark\"] .feel-operator { color: #d4d4d4; }\n[data-theme=\"dark\"] .feel-literal-number { color: #b5cea8; }\n[data-theme=\"dark\"] .feel-literal-string { color: #ce9178; }\n[data-theme=\"dark\"] .feel-literal-temporal { color: #4ec9b0; }\n[data-theme=\"dark\"] .feel-literal-bool { color: #569cd6; }\n[data-theme=\"dark\"] .feel-literal-null { color: #569cd6; }\n[data-theme=\"dark\"] .feel-builtin { color: #dcdcaa; }\n[data-theme=\"dark\"] .feel-variable { color: #9cdcfe; }\n[data-theme=\"dark\"] .feel-comment { color: #6a9955; font-style: italic; }\n[data-theme=\"dark\"] .feel-punctuation { color: #d4d4d4; }\n";
3
+ export declare function injectPlaygroundStyles(): void;
4
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1,292 @@
1
+ export const FEEL_PLAYGROUND_STYLE_ID = "feel-playground-styles";
2
+ export const FEEL_PLAYGROUND_CSS = `
3
+ /* ── Light-theme defaults ─────────────────────────────────────────── */
4
+ .feel-playground {
5
+ --fp-bg: #fafafa;
6
+ --fp-header-bg: #f0f0f0;
7
+ --fp-border: #e0e0e0;
8
+ --fp-text: #333333;
9
+ --fp-muted: #666666;
10
+ --fp-input-bg: #ffffff;
11
+ --fp-result-bg: #f5f5f5;
12
+ --fp-error-bg: #fff2f2;
13
+ --fp-error-text: #cc0000;
14
+ --fp-active-btn-bg: #0062ff;
15
+ --fp-active-btn-fg: #ffffff;
16
+ --fp-inactive-btn-bg: #e8e8e8;
17
+ --fp-inactive-btn-border: #d0d0d0;
18
+ --fp-inactive-btn-fg: #444444;
19
+ --fp-select-bg: #ffffff;
20
+ }
21
+
22
+ /* ── Dark-theme overrides ─────────────────────────────────────────── */
23
+ [data-theme="dark"] .feel-playground {
24
+ --fp-bg: #1e1e1e;
25
+ --fp-header-bg: #252526;
26
+ --fp-border: #3c3c3c;
27
+ --fp-text: #d4d4d4;
28
+ --fp-muted: #888888;
29
+ --fp-input-bg: #1e1e1e;
30
+ --fp-result-bg: #252526;
31
+ --fp-error-bg: #3c1e1e;
32
+ --fp-error-text: #f44747;
33
+ --fp-active-btn-bg: #0e639c;
34
+ --fp-active-btn-fg: #ffffff;
35
+ --fp-inactive-btn-bg: #3c3c3c;
36
+ --fp-inactive-btn-border: #555555;
37
+ --fp-inactive-btn-fg: #cccccc;
38
+ --fp-select-bg: #3c3c3c;
39
+ }
40
+
41
+ .feel-playground {
42
+ width: 100%;
43
+ height: 100%;
44
+ background: var(--fp-bg);
45
+ color: var(--fp-text);
46
+ font-family: monospace;
47
+ font-size: 13px;
48
+ display: flex;
49
+ flex-direction: column;
50
+ align-items: center;
51
+ overflow-y: auto;
52
+ }
53
+
54
+ /* Overlay wrapper — used only by createFeelPlaygroundPlugin() */
55
+ .feel-playground-overlay {
56
+ position: absolute;
57
+ bottom: 0;
58
+ right: 0;
59
+ width: 480px;
60
+ max-height: 70%;
61
+ z-index: 100;
62
+ border-top-left-radius: 6px;
63
+ border: 1px solid var(--fp-border, #e0e0e0);
64
+ border-right: none;
65
+ border-bottom: none;
66
+ overflow: hidden;
67
+ box-shadow: -4px -4px 20px rgba(0, 0, 0, 0.15);
68
+ }
69
+
70
+ [data-theme="dark"] .feel-playground-overlay {
71
+ border-color: #3c3c3c;
72
+ box-shadow: -4px -4px 20px rgba(0, 0, 0, 0.4);
73
+ }
74
+
75
+ .feel-playground__header {
76
+ display: flex;
77
+ align-items: center;
78
+ padding: 6px 16px;
79
+ background: var(--fp-header-bg);
80
+ border-bottom: 1px solid var(--fp-border);
81
+ gap: 8px;
82
+ user-select: none;
83
+ width: 100%;
84
+ max-width: 800px;
85
+ box-sizing: border-box;
86
+ flex-shrink: 0;
87
+ }
88
+
89
+ .feel-playground__title {
90
+ font-weight: bold;
91
+ color: var(--fp-text);
92
+ font-size: 12px;
93
+ flex: 1;
94
+ font-family: system-ui, sans-serif;
95
+ }
96
+
97
+ .feel-playground__close {
98
+ cursor: pointer;
99
+ color: var(--fp-muted);
100
+ background: none;
101
+ border: none;
102
+ font-size: 16px;
103
+ padding: 0 4px;
104
+ line-height: 1;
105
+ }
106
+
107
+ .feel-playground__close:hover { color: var(--fp-text); }
108
+
109
+ .feel-playground__mode {
110
+ display: flex;
111
+ gap: 4px;
112
+ }
113
+
114
+ .feel-playground__mode button {
115
+ background: var(--fp-inactive-btn-bg);
116
+ border: 1px solid var(--fp-inactive-btn-border);
117
+ color: var(--fp-inactive-btn-fg);
118
+ border-radius: 3px;
119
+ padding: 2px 8px;
120
+ font-size: 11px;
121
+ cursor: pointer;
122
+ }
123
+
124
+ .feel-playground__mode button.active {
125
+ background: var(--fp-active-btn-bg);
126
+ color: var(--fp-active-btn-fg);
127
+ border-color: var(--fp-active-btn-bg);
128
+ }
129
+
130
+ .feel-playground__body {
131
+ display: flex;
132
+ flex-direction: column;
133
+ gap: 6px;
134
+ padding: 12px 16px;
135
+ flex: 1;
136
+ width: 100%;
137
+ max-width: 800px;
138
+ box-sizing: border-box;
139
+ }
140
+
141
+ .feel-playground__label {
142
+ font-size: 11px;
143
+ color: var(--fp-muted);
144
+ margin-bottom: 2px;
145
+ font-family: system-ui, sans-serif;
146
+ }
147
+
148
+ .feel-playground__input-wrap {
149
+ position: relative;
150
+ border: 1px solid var(--fp-border);
151
+ border-radius: 3px;
152
+ background: var(--fp-input-bg);
153
+ }
154
+
155
+ .feel-playground__input-wrap:focus-within {
156
+ border-color: var(--fp-active-btn-bg);
157
+ }
158
+
159
+ .feel-playground__highlight {
160
+ position: absolute;
161
+ top: 0; left: 0;
162
+ padding: 5px 8px;
163
+ pointer-events: none;
164
+ white-space: pre-wrap;
165
+ word-break: break-word;
166
+ color: transparent;
167
+ z-index: 1;
168
+ font: inherit;
169
+ line-height: 1.5;
170
+ }
171
+
172
+ .feel-playground__textarea {
173
+ position: relative;
174
+ width: 100%;
175
+ box-sizing: border-box;
176
+ background: transparent;
177
+ border: none;
178
+ color: var(--fp-text);
179
+ padding: 5px 8px;
180
+ font: inherit;
181
+ line-height: 1.5;
182
+ resize: vertical;
183
+ min-height: 60px;
184
+ outline: none;
185
+ z-index: 2;
186
+ caret-color: var(--fp-text);
187
+ }
188
+
189
+ .feel-playground__context {
190
+ width: 100%;
191
+ box-sizing: border-box;
192
+ background: var(--fp-input-bg);
193
+ border: 1px solid var(--fp-border);
194
+ border-radius: 3px;
195
+ color: var(--fp-text);
196
+ padding: 5px 8px;
197
+ font: inherit;
198
+ resize: vertical;
199
+ min-height: 50px;
200
+ outline: none;
201
+ }
202
+
203
+ .feel-playground__context:focus {
204
+ border-color: var(--fp-active-btn-bg);
205
+ }
206
+
207
+ .feel-playground__result {
208
+ padding: 6px 8px;
209
+ background: var(--fp-result-bg);
210
+ border: 1px solid var(--fp-border);
211
+ border-radius: 3px;
212
+ min-height: 28px;
213
+ white-space: pre-wrap;
214
+ word-break: break-word;
215
+ font-family: system-ui, sans-serif;
216
+ }
217
+
218
+ .feel-playground__result.null-val { color: var(--fp-muted); font-style: italic; }
219
+
220
+ /* result type colors — light theme */
221
+ .feel-playground__result.bool-true { color: #15803d; }
222
+ .feel-playground__result.bool-false { color: #b45309; }
223
+ .feel-playground__result.number { color: #0369a1; }
224
+ .feel-playground__result.string { color: #9f1239; }
225
+
226
+ /* result type colors — dark theme */
227
+ [data-theme="dark"] .feel-playground__result.bool-true { color: #4ec9b0; }
228
+ [data-theme="dark"] .feel-playground__result.bool-false { color: #ce9178; }
229
+ [data-theme="dark"] .feel-playground__result.number { color: #b5cea8; }
230
+ [data-theme="dark"] .feel-playground__result.string { color: #ce9178; }
231
+
232
+ .feel-playground__errors {
233
+ font-size: 11px;
234
+ color: var(--fp-error-text);
235
+ padding: 4px 6px;
236
+ background: var(--fp-error-bg);
237
+ border-radius: 3px;
238
+ font-family: system-ui, sans-serif;
239
+ }
240
+
241
+ .feel-playground__examples {
242
+ display: flex;
243
+ align-items: center;
244
+ gap: 6px;
245
+ }
246
+
247
+ .feel-playground__examples select {
248
+ flex: 1;
249
+ background: var(--fp-select-bg);
250
+ border: 1px solid var(--fp-border);
251
+ color: var(--fp-text);
252
+ padding: 3px 6px;
253
+ border-radius: 3px;
254
+ font-size: 12px;
255
+ font-family: system-ui, sans-serif;
256
+ }
257
+
258
+ /* ── FEEL syntax highlighting — light theme ───────────────────────── */
259
+ .feel-keyword { color: #0000cc; }
260
+ .feel-operator { color: #555555; }
261
+ .feel-literal-number { color: #09885a; }
262
+ .feel-literal-string { color: #a31515; }
263
+ .feel-literal-temporal{ color: #0070c1; }
264
+ .feel-literal-bool { color: #0000cc; }
265
+ .feel-literal-null { color: #0000cc; }
266
+ .feel-builtin { color: #795e26; }
267
+ .feel-variable { color: #001080; }
268
+ .feel-comment { color: #008000; font-style: italic; }
269
+ .feel-punctuation { color: #555555; }
270
+
271
+ /* ── FEEL syntax highlighting — dark theme ────────────────────────── */
272
+ [data-theme="dark"] .feel-keyword { color: #569cd6; }
273
+ [data-theme="dark"] .feel-operator { color: #d4d4d4; }
274
+ [data-theme="dark"] .feel-literal-number { color: #b5cea8; }
275
+ [data-theme="dark"] .feel-literal-string { color: #ce9178; }
276
+ [data-theme="dark"] .feel-literal-temporal { color: #4ec9b0; }
277
+ [data-theme="dark"] .feel-literal-bool { color: #569cd6; }
278
+ [data-theme="dark"] .feel-literal-null { color: #569cd6; }
279
+ [data-theme="dark"] .feel-builtin { color: #dcdcaa; }
280
+ [data-theme="dark"] .feel-variable { color: #9cdcfe; }
281
+ [data-theme="dark"] .feel-comment { color: #6a9955; font-style: italic; }
282
+ [data-theme="dark"] .feel-punctuation { color: #d4d4d4; }
283
+ `;
284
+ export function injectPlaygroundStyles() {
285
+ if (document.getElementById(FEEL_PLAYGROUND_STYLE_ID))
286
+ return;
287
+ const style = document.createElement("style");
288
+ style.id = FEEL_PLAYGROUND_STYLE_ID;
289
+ style.textContent = FEEL_PLAYGROUND_CSS;
290
+ document.head.appendChild(style);
291
+ }
292
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1,4 @@
1
+ export { buildFeelPlaygroundPanel, createFeelPlaygroundPlugin } from "./playground-plugin.js";
2
+ export type { FeelPlaygroundPlugin } from "./playground-plugin.js";
3
+ export { FEEL_PLAYGROUND_CSS, FEEL_PLAYGROUND_STYLE_ID, injectPlaygroundStyles } from "./css.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { buildFeelPlaygroundPanel, createFeelPlaygroundPlugin } from "./playground-plugin.js";
2
+ export { FEEL_PLAYGROUND_CSS, FEEL_PLAYGROUND_STYLE_ID, injectPlaygroundStyles } from "./css.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,14 @@
1
+ import type { CanvasPlugin } from "@bpmnkit/canvas";
2
+ export interface FeelPlaygroundPlugin extends CanvasPlugin {
3
+ /** Show the FEEL Playground panel. */
4
+ show(): void;
5
+ }
6
+ /**
7
+ * Builds the FEEL Playground panel DOM.
8
+ * When `onClose` is provided a close button is rendered that calls it.
9
+ * Omit `onClose` when embedding in a full-screen tab.
10
+ * Pass `initialExpression` to pre-fill the expression textarea.
11
+ */
12
+ export declare function buildFeelPlaygroundPanel(onClose?: () => void, initialExpression?: string): HTMLDivElement;
13
+ export declare function createFeelPlaygroundPlugin(): FeelPlaygroundPlugin;
14
+ //# sourceMappingURL=playground-plugin.d.ts.map
@@ -0,0 +1,292 @@
1
+ import { evaluate, evaluateUnaryTests, highlightToHtml, parseExpression, parseUnaryTests, } from "@bpmnkit/feel";
2
+ import { injectPlaygroundStyles } from "./css.js";
3
+ const EXAMPLES = [
4
+ { label: "Arithmetic", expr: "1 + 2 * 3", context: "{}", mode: "expression" },
5
+ { label: "String ops", expr: 'string length("Hello FEEL")', context: "{}", mode: "expression" },
6
+ { label: "List ops", expr: "sum([1, 2, 3, 4, 5])", context: "{}", mode: "expression" },
7
+ {
8
+ label: "Context access",
9
+ expr: "order.amount * 1.1",
10
+ context: '{"order": {"amount": 100}}',
11
+ mode: "expression",
12
+ },
13
+ {
14
+ label: "If-then-else",
15
+ expr: 'if age >= 18 then "adult" else "minor"',
16
+ context: '{"age": 20}',
17
+ mode: "expression",
18
+ },
19
+ {
20
+ label: "For expression",
21
+ expr: "for x in [1, 2, 3] return x * x",
22
+ context: "{}",
23
+ mode: "expression",
24
+ },
25
+ { label: "Temporal", expr: 'date("2021-01-15").month', context: "{}", mode: "expression" },
26
+ { label: "Unary tests — range", expr: "[18..65]", context: '{"?": 30}', mode: "unary-tests" },
27
+ {
28
+ label: "Unary tests — list",
29
+ expr: '"visa", "master"',
30
+ context: '{"?": "visa"}',
31
+ mode: "unary-tests",
32
+ },
33
+ {
34
+ label: "Contains filter",
35
+ expr: "items[item > 2]",
36
+ context: '{"items": [1, 2, 3, 4]}',
37
+ mode: "expression",
38
+ },
39
+ ];
40
+ function renderValue(v) {
41
+ if (v === null)
42
+ return { html: "null", cssClass: "null-val" };
43
+ if (typeof v === "boolean")
44
+ return { html: String(v), cssClass: v ? "bool-true" : "bool-false" };
45
+ if (typeof v === "number")
46
+ return { html: String(v), cssClass: "number" };
47
+ if (typeof v === "string")
48
+ return { html: `"${v}"`, cssClass: "string" };
49
+ if (Array.isArray(v))
50
+ return { html: JSON.stringify(v, null, 2), cssClass: "" };
51
+ return { html: JSON.stringify(v, null, 2), cssClass: "" };
52
+ }
53
+ /**
54
+ * Builds the FEEL Playground panel DOM.
55
+ * When `onClose` is provided a close button is rendered that calls it.
56
+ * Omit `onClose` when embedding in a full-screen tab.
57
+ * Pass `initialExpression` to pre-fill the expression textarea.
58
+ */
59
+ export function buildFeelPlaygroundPanel(onClose, initialExpression) {
60
+ let mode = "expression";
61
+ let exprEl = null;
62
+ let contextEl = null;
63
+ let resultEl = null;
64
+ let errorsEl = null;
65
+ let highlightEl = null;
66
+ function evaluate_() {
67
+ if (!exprEl || !contextEl || !resultEl || !errorsEl)
68
+ return;
69
+ const src = exprEl.value;
70
+ let vars = {};
71
+ try {
72
+ const parsed = JSON.parse(contextEl.value || "{}");
73
+ vars = parsed;
74
+ }
75
+ catch {
76
+ errorsEl.textContent = "Invalid JSON context";
77
+ return;
78
+ }
79
+ if (mode === "expression") {
80
+ const { ast, errors } = parseExpression(src);
81
+ if (errors.length > 0) {
82
+ errorsEl.textContent = errors.map((e) => e.message).join("; ");
83
+ resultEl.className = "feel-playground__result";
84
+ resultEl.textContent = "";
85
+ return;
86
+ }
87
+ errorsEl.textContent = "";
88
+ if (!ast)
89
+ return;
90
+ const val = evaluate(ast, { vars });
91
+ const { html, cssClass } = renderValue(val);
92
+ resultEl.className = `feel-playground__result ${cssClass}`;
93
+ resultEl.innerHTML = html;
94
+ }
95
+ else {
96
+ const input = vars["?"] ?? null;
97
+ const { ast, errors } = parseUnaryTests(src);
98
+ if (errors.length > 0) {
99
+ errorsEl.textContent = errors.map((e) => e.message).join("; ");
100
+ return;
101
+ }
102
+ errorsEl.textContent = "";
103
+ if (!ast)
104
+ return;
105
+ const result = evaluateUnaryTests(ast, input, { vars, input });
106
+ const { html, cssClass } = renderValue(result);
107
+ resultEl.className = `feel-playground__result ${cssClass}`;
108
+ resultEl.innerHTML = html;
109
+ }
110
+ }
111
+ function updateHighlight() {
112
+ if (!exprEl || !highlightEl)
113
+ return;
114
+ const html = highlightToHtml(exprEl.value);
115
+ highlightEl.innerHTML = html;
116
+ highlightEl.scrollTop = exprEl.scrollTop;
117
+ highlightEl.scrollLeft = exprEl.scrollLeft;
118
+ }
119
+ const div = document.createElement("div");
120
+ div.className = "feel-playground";
121
+ // Header
122
+ const header = document.createElement("div");
123
+ header.className = "feel-playground__header";
124
+ const title = document.createElement("span");
125
+ title.className = "feel-playground__title";
126
+ title.textContent = "FEEL Playground";
127
+ const modeDiv = document.createElement("div");
128
+ modeDiv.className = "feel-playground__mode";
129
+ const exprBtn = document.createElement("button");
130
+ exprBtn.textContent = "Expression";
131
+ exprBtn.className = "active"; // mode starts as "expression"
132
+ exprBtn.addEventListener("click", () => {
133
+ mode = "expression";
134
+ exprBtn.className = "active";
135
+ utBtn.className = "";
136
+ evaluate_();
137
+ });
138
+ const utBtn = document.createElement("button");
139
+ utBtn.textContent = "Unary Tests";
140
+ utBtn.className = ""; // mode starts as "expression", so utBtn starts inactive
141
+ utBtn.addEventListener("click", () => {
142
+ mode = "unary-tests";
143
+ utBtn.className = "active";
144
+ exprBtn.className = "";
145
+ evaluate_();
146
+ });
147
+ modeDiv.appendChild(exprBtn);
148
+ modeDiv.appendChild(utBtn);
149
+ header.appendChild(title);
150
+ header.appendChild(modeDiv);
151
+ if (onClose) {
152
+ const closeBtn = document.createElement("button");
153
+ closeBtn.className = "feel-playground__close";
154
+ closeBtn.textContent = "×";
155
+ closeBtn.addEventListener("click", onClose);
156
+ header.appendChild(closeBtn);
157
+ }
158
+ // Body
159
+ const body = document.createElement("div");
160
+ body.className = "feel-playground__body";
161
+ // Examples
162
+ const examplesRow = document.createElement("div");
163
+ examplesRow.className = "feel-playground__examples";
164
+ const exLabel = document.createElement("span");
165
+ exLabel.className = "feel-playground__label";
166
+ exLabel.textContent = "Examples:";
167
+ const select = document.createElement("select");
168
+ const defaultOpt = document.createElement("option");
169
+ defaultOpt.value = "";
170
+ defaultOpt.textContent = "— pick an example —";
171
+ select.appendChild(defaultOpt);
172
+ for (let i = 0; i < EXAMPLES.length; i++) {
173
+ const ex = EXAMPLES[i];
174
+ if (!ex)
175
+ continue;
176
+ const opt = document.createElement("option");
177
+ opt.value = String(i);
178
+ opt.textContent = ex.label;
179
+ select.appendChild(opt);
180
+ }
181
+ select.addEventListener("change", () => {
182
+ const idx = Number(select.value);
183
+ const ex = EXAMPLES[idx];
184
+ if (!ex || !exprEl || !contextEl)
185
+ return;
186
+ mode = ex.mode;
187
+ exprBtn.className = mode === "expression" ? "active" : "";
188
+ utBtn.className = mode === "unary-tests" ? "active" : "";
189
+ exprEl.value = ex.expr;
190
+ contextEl.value = ex.context;
191
+ updateHighlight();
192
+ evaluate_();
193
+ select.value = "";
194
+ });
195
+ examplesRow.appendChild(exLabel);
196
+ examplesRow.appendChild(select);
197
+ // Expression input
198
+ const exprLabel = document.createElement("div");
199
+ exprLabel.className = "feel-playground__label";
200
+ exprLabel.textContent = "Expression";
201
+ const inputWrap = document.createElement("div");
202
+ inputWrap.className = "feel-playground__input-wrap";
203
+ highlightEl = document.createElement("div");
204
+ highlightEl.className = "feel-playground__highlight";
205
+ exprEl = document.createElement("textarea");
206
+ exprEl.className = "feel-playground__textarea";
207
+ exprEl.rows = 3;
208
+ exprEl.spellcheck = false;
209
+ exprEl.placeholder = "Enter FEEL expression...";
210
+ exprEl.addEventListener("input", () => {
211
+ updateHighlight();
212
+ evaluate_();
213
+ });
214
+ exprEl.addEventListener("scroll", () => {
215
+ if (!highlightEl || !exprEl)
216
+ return;
217
+ highlightEl.scrollTop = exprEl.scrollTop;
218
+ });
219
+ if (initialExpression)
220
+ exprEl.value = initialExpression;
221
+ inputWrap.appendChild(highlightEl);
222
+ inputWrap.appendChild(exprEl);
223
+ // Context input
224
+ const ctxLabel = document.createElement("div");
225
+ ctxLabel.className = "feel-playground__label";
226
+ ctxLabel.textContent = "Context (JSON)";
227
+ contextEl = document.createElement("textarea");
228
+ contextEl.className = "feel-playground__context";
229
+ contextEl.rows = 3;
230
+ contextEl.value = "{}";
231
+ contextEl.spellcheck = false;
232
+ contextEl.placeholder = '{"x": 10}';
233
+ contextEl.addEventListener("input", evaluate_);
234
+ // Errors
235
+ errorsEl = document.createElement("div");
236
+ errorsEl.className = "feel-playground__errors";
237
+ errorsEl.style.display = "none";
238
+ const errObserver = new MutationObserver(() => {
239
+ if (!errorsEl)
240
+ return;
241
+ errorsEl.style.display = errorsEl.textContent?.trim() ? "" : "none";
242
+ });
243
+ errObserver.observe(errorsEl, { childList: true, characterData: true, subtree: true });
244
+ // Result
245
+ const resultLabel = document.createElement("div");
246
+ resultLabel.className = "feel-playground__label";
247
+ resultLabel.textContent = "Result";
248
+ resultEl = document.createElement("div");
249
+ resultEl.className = "feel-playground__result";
250
+ body.appendChild(examplesRow);
251
+ body.appendChild(exprLabel);
252
+ body.appendChild(inputWrap);
253
+ body.appendChild(ctxLabel);
254
+ body.appendChild(contextEl);
255
+ body.appendChild(errorsEl);
256
+ body.appendChild(resultLabel);
257
+ body.appendChild(resultEl);
258
+ div.appendChild(header);
259
+ div.appendChild(body);
260
+ if (initialExpression) {
261
+ updateHighlight();
262
+ evaluate_();
263
+ }
264
+ return div;
265
+ }
266
+ export function createFeelPlaygroundPlugin() {
267
+ let overlay = null;
268
+ return {
269
+ name: "feel-playground",
270
+ install(api) {
271
+ injectPlaygroundStyles();
272
+ overlay = document.createElement("div");
273
+ overlay.className = "feel-playground-overlay";
274
+ overlay.style.display = "none";
275
+ overlay.appendChild(buildFeelPlaygroundPanel(() => {
276
+ if (overlay)
277
+ overlay.style.display = "none";
278
+ }));
279
+ api.container.style.position = "relative";
280
+ api.container.appendChild(overlay);
281
+ },
282
+ uninstall() {
283
+ overlay?.remove();
284
+ overlay = null;
285
+ },
286
+ show() {
287
+ if (overlay)
288
+ overlay.style.display = "";
289
+ },
290
+ };
291
+ }
292
+ //# sourceMappingURL=playground-plugin.js.map
@@ -0,0 +1,3 @@
1
+ export declare const FORM_EDITOR_CSS: string;
2
+ export declare function injectFormEditorStyles(): void;
3
+ //# sourceMappingURL=css.d.ts.map