@bpmnkit/editor 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/dist/css.js ADDED
@@ -0,0 +1,722 @@
1
+ /** ID used to prevent duplicate style injection. */
2
+ export const EDITOR_STYLE_ID = "bpmnkit-editor-styles-v1";
3
+ /** ID used to prevent duplicate HUD style injection. */
4
+ export const HUD_STYLE_ID = "bpmnkit-editor-hud-styles-v1";
5
+ /** CSS for editor-specific overlays injected once into `<head>`. */
6
+ export const EDITOR_CSS = `
7
+ /* Selection outline */
8
+ .bpmnkit-sel-indicator {
9
+ fill: none;
10
+ stroke: var(--bpmnkit-accent, #1a56db);
11
+ stroke-width: 1.5;
12
+ pointer-events: none;
13
+ }
14
+
15
+ /* Resize handle */
16
+ .bpmnkit-resize-handle {
17
+ fill: #fff;
18
+ stroke: var(--bpmnkit-accent, #1a56db);
19
+ stroke-width: 1.5;
20
+ cursor: nwse-resize;
21
+ }
22
+ .bpmnkit-resize-handle[data-bpmnkit-handle="n"],
23
+ .bpmnkit-resize-handle[data-bpmnkit-handle="s"] {
24
+ cursor: ns-resize;
25
+ }
26
+ .bpmnkit-resize-handle[data-bpmnkit-handle="e"],
27
+ .bpmnkit-resize-handle[data-bpmnkit-handle="w"] {
28
+ cursor: ew-resize;
29
+ }
30
+ .bpmnkit-resize-handle[data-bpmnkit-handle="ne"],
31
+ .bpmnkit-resize-handle[data-bpmnkit-handle="sw"] {
32
+ cursor: nesw-resize;
33
+ }
34
+ .bpmnkit-resize-handle[data-bpmnkit-handle="nw"],
35
+ .bpmnkit-resize-handle[data-bpmnkit-handle="se"] {
36
+ cursor: nwse-resize;
37
+ }
38
+
39
+ /* Connection port */
40
+ .bpmnkit-conn-port {
41
+ fill: var(--bpmnkit-accent, #1a56db);
42
+ stroke: none;
43
+ cursor: crosshair;
44
+ opacity: 0.7;
45
+ }
46
+ .bpmnkit-conn-port:hover {
47
+ opacity: 1;
48
+ }
49
+
50
+ /* Rubber-band selection */
51
+ .bpmnkit-rubber-band {
52
+ fill: rgba(0, 102, 204, 0.05);
53
+ stroke: var(--bpmnkit-accent, #1a56db);
54
+ stroke-dasharray: 4 2;
55
+ pointer-events: none;
56
+ }
57
+
58
+ /* Ghost element (create / connect preview) */
59
+ .bpmnkit-ghost {
60
+ opacity: 0.45;
61
+ pointer-events: none;
62
+ }
63
+
64
+ /* Ghost connection line */
65
+ .bpmnkit-ghost-conn {
66
+ stroke: var(--bpmnkit-accent, #1a56db);
67
+ stroke-width: 1.5;
68
+ stroke-dasharray: 6 3;
69
+ fill: none;
70
+ pointer-events: none;
71
+ }
72
+
73
+ /* Resize preview rect */
74
+ .bpmnkit-resize-preview {
75
+ fill: rgba(0, 102, 204, 0.05);
76
+ stroke: var(--bpmnkit-accent, #1a56db);
77
+ stroke-dasharray: 4 2;
78
+ pointer-events: none;
79
+ }
80
+
81
+ /* Alignment guide lines (snap helpers) */
82
+ .bpmnkit-align-guide {
83
+ stroke: var(--bpmnkit-accent-bright, #6b9df7);
84
+ stroke-width: 1;
85
+ stroke-dasharray: 4 2;
86
+ pointer-events: none;
87
+ }
88
+
89
+ /* Edge transparent hit area (wide stroke for easier clicking) */
90
+ .bpmnkit-edge-hitarea {
91
+ fill: none;
92
+ stroke: transparent;
93
+ stroke-width: 12;
94
+ cursor: pointer;
95
+ }
96
+
97
+ /* Edge hover dot (waypoint insertion indicator) */
98
+ .bpmnkit-edge-hover-dot {
99
+ fill: var(--bpmnkit-accent, #1a56db);
100
+ stroke: #fff;
101
+ stroke-width: 1.5;
102
+ pointer-events: none;
103
+ opacity: 0.85;
104
+ }
105
+ [data-theme="dark"] .bpmnkit-edge-hover-dot { fill: var(--bpmnkit-accent, #6b9df7); }
106
+
107
+ /* Edge waypoint angle balls (visible on edge hover) */
108
+ .bpmnkit-edge-waypoint-ball {
109
+ fill: var(--bpmnkit-accent, #1a56db);
110
+ stroke: #fff;
111
+ stroke-width: 1.5;
112
+ cursor: move;
113
+ }
114
+ .bpmnkit-edge-waypoint-ball:hover { fill: var(--bpmnkit-accent, #1a56db); }
115
+ [data-theme="dark"] .bpmnkit-edge-waypoint-ball { fill: var(--bpmnkit-accent, #6b9df7); }
116
+
117
+ /* Edge endpoint drag handles */
118
+ .bpmnkit-edge-endpoint {
119
+ fill: var(--bpmnkit-accent, #1a56db);
120
+ stroke: #fff;
121
+ stroke-width: 1.5;
122
+ cursor: grab;
123
+ }
124
+ .bpmnkit-edge-endpoint:hover {
125
+ fill: var(--bpmnkit-accent, #1a56db);
126
+ }
127
+
128
+ /* Ghost polyline when dragging an edge endpoint */
129
+ .bpmnkit-endpoint-ghost {
130
+ fill: none;
131
+ stroke: var(--bpmnkit-accent, #1a56db);
132
+ stroke-width: 1.5;
133
+ stroke-dasharray: 5 3;
134
+ pointer-events: none;
135
+ }
136
+
137
+ /* Edge split target highlight (shown while dragging a shape over an edge) */
138
+ .bpmnkit-edge-split-highlight .bpmnkit-edge-path {
139
+ stroke: var(--bpmnkit-success, #22c55e);
140
+ stroke-width: 2.5;
141
+ }
142
+
143
+ /* Distance/spacing guide arrows */
144
+ .bpmnkit-dist-guide {
145
+ stroke: var(--bpmnkit-warn, #f97316);
146
+ stroke-width: 1;
147
+ fill: none;
148
+ pointer-events: none;
149
+ }
150
+
151
+ /* Space tool split indicator line */
152
+ .bpmnkit-space-line {
153
+ stroke: var(--bpmnkit-warn, #f59e0b);
154
+ stroke-width: 1.5;
155
+ stroke-dasharray: 6 3;
156
+ pointer-events: none;
157
+ }
158
+
159
+ /* Label editor */
160
+ .bpmnkit-label-editor {
161
+ position: absolute;
162
+ min-width: 40px;
163
+ min-height: 16px;
164
+ padding: 1px 3px;
165
+ background: #fff;
166
+ border: 1px solid var(--bpmnkit-accent, #1a56db);
167
+ border-radius: 2px;
168
+ font-family: system-ui, -apple-system, sans-serif;
169
+ font-size: 11px;
170
+ text-align: center;
171
+ outline: none;
172
+ z-index: 10;
173
+ white-space: pre-wrap;
174
+ word-break: break-word;
175
+ }
176
+
177
+ /* Boundary event attach highlight */
178
+ .bpmnkit-boundary-host {
179
+ fill: none;
180
+ stroke: var(--bpmnkit-accent, #1a56db);
181
+ stroke-width: 2;
182
+ stroke-dasharray: 6 3;
183
+ pointer-events: none;
184
+ opacity: 0.7;
185
+ }
186
+
187
+ /* Duplicate-ID warning banner */
188
+ .bpmnkit-editor-warning-banner {
189
+ position: absolute;
190
+ top: 8px;
191
+ left: 50%;
192
+ transform: translateX(-50%);
193
+ z-index: 100;
194
+ max-width: calc(100% - 32px);
195
+ padding: 6px 12px;
196
+ border-radius: 6px;
197
+ background: #fef3c7;
198
+ border: 1px solid #f59e0b;
199
+ color: #92400e;
200
+ font-size: 12px;
201
+ line-height: 1.4;
202
+ pointer-events: none;
203
+ white-space: nowrap;
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ }
207
+ .bpmnkit-canvas-host[data-theme="dark"] .bpmnkit-editor-warning-banner {
208
+ background: #451a03;
209
+ border-color: #d97706;
210
+ color: #fde68a;
211
+ }
212
+ `;
213
+ /** Injects the editor stylesheet into `<head>` if not already present. */
214
+ export function injectEditorStyles() {
215
+ if (typeof document === "undefined")
216
+ return;
217
+ if (document.getElementById(EDITOR_STYLE_ID))
218
+ return;
219
+ const style = document.createElement("style");
220
+ style.id = EDITOR_STYLE_ID;
221
+ style.textContent = EDITOR_CSS;
222
+ document.head.appendChild(style);
223
+ }
224
+ /** CSS for the editor HUD — panels, buttons, dropdowns, group picker.
225
+ * Dark theme is the default. Light theme is activated by setting
226
+ * `data-bpmnkit-hud-theme="light"` on `document.body`. */
227
+ export const HUD_CSS = `
228
+ /* ── HUD base ────────────────────────────────────────────────────── */
229
+ .hud { position: absolute; z-index: 100; }
230
+
231
+ /* ── Dark theme (default) ────────────────────────────────────────── */
232
+ .panel {
233
+ display: flex; align-items: center; gap: 2px; padding: 4px;
234
+ background: var(--bpmnkit-panel-bg, rgba(13, 13, 22, 0.92));
235
+ backdrop-filter: blur(10px);
236
+ border: 1px solid var(--bpmnkit-panel-border, rgba(255, 255, 255, 0.08));
237
+ border-radius: 10px;
238
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
239
+ }
240
+
241
+ /* ── HUD positions ───────────────────────────────────────────────── */
242
+ #hud-top-center { top: 0; left: 50%; transform: translateX(-50%); height: 36px; }
243
+ #hud-bottom-left { bottom: 10px; left: 10px; }
244
+ #hud-bottom-center { bottom: 10px; left: 50%; transform: translateX(-50%); }
245
+ #ctx-toolbar { display: none; transform: translateX(-50%); }
246
+ #cfg-toolbar { display: none; transform: translate(-50%, -100%); }
247
+
248
+ /* ── Top center: strip floating card, merge into tab bar ─────────── */
249
+ #hud-top-center.panel {
250
+ background: transparent;
251
+ backdrop-filter: none;
252
+ border: none;
253
+ border-radius: 0;
254
+ box-shadow: none;
255
+ padding: 0 2px;
256
+ /* Pass clicks through the transparent background to the tab bar center slot. */
257
+ pointer-events: none;
258
+ }
259
+ #hud-top-center.panel > * {
260
+ pointer-events: auto;
261
+ }
262
+
263
+ /* ── Icon buttons ────────────────────────────────────────────────── */
264
+ .hud-btn {
265
+ display: flex; align-items: center; justify-content: center;
266
+ width: 32px; height: 32px;
267
+ background: transparent;
268
+ border: 1px solid transparent;
269
+ border-radius: 6px;
270
+ color: var(--bpmnkit-fg-muted, rgba(255,255,255,0.6));
271
+ cursor: pointer;
272
+ transition: background 0.1s, color 0.1s, border-color 0.1s;
273
+ padding: 0; flex-shrink: 0;
274
+ }
275
+ .hud-btn:hover { background: rgba(255,255,255,0.08); color: var(--bpmnkit-fg, #cdd6f4); }
276
+ .hud-btn.active { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.2); }
277
+ .hud-btn:disabled { opacity: 0.28; cursor: default; }
278
+ .hud-btn:disabled:hover { background: transparent; color: rgba(255,255,255,0.6); }
279
+ .hud-btn svg { width: 16px; height: 16px; pointer-events: none; }
280
+
281
+ /* ── Group button: small chevron at bottom-right corner ──────────── */
282
+ .hud-btn[data-group] { position: relative; }
283
+ .hud-btn[data-group]::after {
284
+ content: '';
285
+ position: absolute; bottom: 3px; right: 3px;
286
+ width: 0; height: 0;
287
+ border-left: 3px solid transparent;
288
+ border-top: 3px solid currentColor;
289
+ opacity: 0.55;
290
+ }
291
+
292
+ /* ── Tool groups container ───────────────────────────────────────── */
293
+ #tool-groups { display: flex; align-items: center; gap: 2px; }
294
+
295
+ /* ── Separator ───────────────────────────────────────────────────── */
296
+ .hud-sep { width: 1px; height: 20px; background: var(--bpmnkit-panel-border, rgba(255, 255, 255, 0.08)); margin: 0 2px; flex-shrink: 0; }
297
+
298
+ /* ── Zoom widget ─────────────────────────────────────────────────── */
299
+ #btn-zoom-current {
300
+ padding: 0 10px; height: 32px;
301
+ background: transparent; border: 1px solid transparent; border-radius: 7px;
302
+ color: rgba(255,255,255,0.6); cursor: pointer;
303
+ font-size: 12px; font-weight: 600;
304
+ transition: background 0.1s, color 0.1s;
305
+ white-space: nowrap;
306
+ }
307
+ #btn-zoom-current:hover { background: rgba(255,255,255,0.08); color: #fff; }
308
+
309
+ #zoom-expanded { display: none; align-items: center; gap: 2px; }
310
+ #zoom-expanded.open { display: flex; }
311
+
312
+ #btn-zoom-pct {
313
+ padding: 0 8px; height: 30px;
314
+ background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
315
+ color: rgba(255,255,255,0.75); cursor: pointer;
316
+ font-size: 12px; font-weight: 600;
317
+ transition: background 0.1s, color 0.1s;
318
+ white-space: nowrap; min-width: 60px; text-align: center;
319
+ }
320
+ #btn-zoom-pct:hover { background: rgba(255,255,255,0.12); color: #fff; }
321
+
322
+ /* ── Dropdown menus ──────────────────────────────────────────────── */
323
+ .dropdown {
324
+ position: absolute; display: none; flex-direction: column;
325
+ gap: 1px; padding: 4px;
326
+ background: var(--bpmnkit-panel-bg, rgba(13, 13, 22, 0.92));
327
+ backdrop-filter: blur(12px);
328
+ border: 1px solid var(--bpmnkit-panel-border, rgba(255, 255, 255, 0.08));
329
+ border-radius: 9px;
330
+ box-shadow: 0 6px 24px rgba(0,0,0,0.5);
331
+ z-index: 200; min-width: 150px;
332
+ }
333
+ .dropdown.open { display: flex; }
334
+
335
+ .drop-item {
336
+ display: flex; align-items: center; gap: 8px;
337
+ padding: 7px 10px;
338
+ border: none; background: transparent;
339
+ color: rgba(255,255,255,0.75); cursor: pointer;
340
+ border-radius: 6px; font-size: 12px; text-align: left; width: 100%;
341
+ transition: background 0.1s;
342
+ }
343
+ .drop-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
344
+ .drop-item .di-check { width: 14px; height: 14px; flex-shrink: 0; color: var(--bpmnkit-accent, #6b9df7); }
345
+ .drop-item .di-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
346
+ .drop-item svg { width: 14px; height: 14px; }
347
+ .drop-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 3px 0; }
348
+ .drop-label {
349
+ padding: 4px 10px 2px;
350
+ font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
351
+ color: rgba(255,255,255,0.3); text-transform: uppercase;
352
+ }
353
+
354
+ /* ── Group element picker ────────────────────────────────────────── */
355
+ .group-picker {
356
+ position: absolute;
357
+ display: flex; flex-direction: row;
358
+ gap: 2px; padding: 4px;
359
+ background: var(--bpmnkit-panel-bg, rgba(13, 13, 22, 0.92));
360
+ backdrop-filter: blur(12px);
361
+ border: 1px solid var(--bpmnkit-panel-border, rgba(255, 255, 255, 0.08));
362
+ border-radius: 9px;
363
+ box-shadow: 0 6px 24px rgba(0,0,0,0.5);
364
+ z-index: 300;
365
+ }
366
+ .group-picker-label {
367
+ padding: 2px 6px 4px;
368
+ font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
369
+ color: rgba(255,255,255,0.3); text-transform: uppercase;
370
+ white-space: nowrap; align-self: center;
371
+ border-right: 1px solid rgba(255,255,255,0.08);
372
+ margin-right: 2px;
373
+ }
374
+
375
+ /* ── Light theme overrides ───────────────────────────────────────── */
376
+ [data-bpmnkit-hud-theme="light"] .panel {
377
+ background: var(--bpmnkit-panel-bg, rgba(255,255,255,0.92));
378
+ border-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));
379
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
380
+ }
381
+ [data-bpmnkit-hud-theme="light"] #hud-top-center.panel {
382
+ background: transparent;
383
+ backdrop-filter: none;
384
+ border: none;
385
+ box-shadow: none;
386
+ }
387
+ [data-bpmnkit-hud-theme="light"] .hud-btn { color: var(--bpmnkit-fg-muted, #6666a0); }
388
+ [data-bpmnkit-hud-theme="light"] .hud-btn:hover { background: rgba(0,0,0,0.06); color: var(--bpmnkit-fg, #1a1a2e); }
389
+ [data-bpmnkit-hud-theme="light"] .hud-btn.active { background: rgba(0,0,0,0.08); color: var(--bpmnkit-fg, #1a1a2e); border-color: rgba(0,0,0,0.15); }
390
+ [data-bpmnkit-hud-theme="light"] .hud-btn:disabled:hover { background: transparent; color: var(--bpmnkit-fg-muted, #6666a0); }
391
+ [data-bpmnkit-hud-theme="light"] .hud-sep { background: var(--bpmnkit-panel-border, rgba(0,0,0,0.08)); }
392
+ [data-bpmnkit-hud-theme="light"] #btn-zoom-current { color: var(--bpmnkit-fg-muted, #6666a0); }
393
+ [data-bpmnkit-hud-theme="light"] #btn-zoom-current:hover { background: rgba(0,0,0,0.06); color: var(--bpmnkit-fg, #1a1a2e); }
394
+ [data-bpmnkit-hud-theme="light"] #btn-zoom-pct {
395
+ background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: var(--bpmnkit-fg-muted, #6666a0);
396
+ }
397
+ [data-bpmnkit-hud-theme="light"] #btn-zoom-pct:hover { background: rgba(0,0,0,0.08); color: var(--bpmnkit-fg, #1a1a2e); }
398
+ [data-bpmnkit-hud-theme="light"] .dropdown {
399
+ background: var(--bpmnkit-panel-bg, rgba(255,255,255,0.92));
400
+ border-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));
401
+ box-shadow: 0 6px 24px rgba(0,0,0,0.15);
402
+ }
403
+ [data-bpmnkit-hud-theme="light"] .drop-item { color: var(--bpmnkit-fg-muted, #6666a0); }
404
+ [data-bpmnkit-hud-theme="light"] .drop-item:hover { background: rgba(0,0,0,0.05); color: var(--bpmnkit-fg, #1a1a2e); }
405
+ [data-bpmnkit-hud-theme="light"] .drop-sep { background: var(--bpmnkit-border, #d0d0e8); }
406
+ [data-bpmnkit-hud-theme="light"] .drop-label { color: rgba(0,0,0,0.35); }
407
+ [data-bpmnkit-hud-theme="light"] .group-picker {
408
+ background: var(--bpmnkit-panel-bg, rgba(255,255,255,0.92));
409
+ border-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));
410
+ box-shadow: 0 6px 24px rgba(0,0,0,0.15);
411
+ }
412
+ [data-bpmnkit-hud-theme="light"] .group-picker-label {
413
+ color: rgba(0,0,0,0.35);
414
+ border-right-color: rgba(0,0,0,0.08);
415
+ }
416
+
417
+ /* ── Reference link button (wider text variant of hud-btn) ──────── */
418
+ .ref-link-btn {
419
+ height: 32px; padding: 0 8px;
420
+ background: transparent;
421
+ border: 1px solid transparent;
422
+ border-radius: 6px;
423
+ color: rgba(255, 255, 255, 0.6);
424
+ cursor: pointer;
425
+ font-size: 12px;
426
+ max-width: 160px;
427
+ overflow: hidden;
428
+ text-overflow: ellipsis;
429
+ white-space: nowrap;
430
+ flex-shrink: 0;
431
+ transition: background 0.1s, color 0.1s;
432
+ align-self: center;
433
+ }
434
+ .ref-link-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
435
+ [data-bpmnkit-hud-theme="light"] .ref-link-btn { color: var(--bpmnkit-fg-muted, #6666a0); }
436
+ [data-bpmnkit-hud-theme="light"] .ref-link-btn:hover { background: rgba(0,0,0,0.06); color: var(--bpmnkit-fg, #1a1a2e); }
437
+
438
+ /* ── Color swatches ──────────────────────────────────────────────── */
439
+ .bpmnkit-color-swatches { display: flex; gap: 4px; padding: 2px 4px; align-items: center; }
440
+ .bpmnkit-color-swatch {
441
+ width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
442
+ border: 2px solid transparent; flex-shrink: 0;
443
+ transition: transform 0.1s;
444
+ padding: 0;
445
+ }
446
+ .bpmnkit-color-swatch:hover { transform: scale(1.2); }
447
+ .bpmnkit-color-swatch.active { border-color: rgba(255,255,255,0.8); }
448
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-color-swatch.active { border-color: rgba(0,0,0,0.5); }
449
+ .bpmnkit-color-swatch--default {
450
+ background: transparent; border-color: rgba(255,255,255,0.25);
451
+ position: relative; overflow: hidden;
452
+ }
453
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-color-swatch--default { border-color: rgba(0,0,0,0.2); }
454
+ .bpmnkit-color-swatch--default::after {
455
+ content: ''; position: absolute;
456
+ top: 1px; left: 50%; transform: translateX(-50%) rotate(-45deg);
457
+ width: 1.5px; height: calc(100% - 2px);
458
+ background: rgba(200,50,50,0.65); border-radius: 1px;
459
+ }
460
+
461
+ /* ── Contextual Ask-AI button (tinted blue) ──────────────────────── */
462
+ .ctx-ask-ai-btn { color: var(--bpmnkit-accent-bright, #89b4fa); opacity: 0.8; }
463
+ .ctx-ask-ai-btn:hover { background: rgba(76, 142, 247, 0.15); color: #a8c8ff; opacity: 1; }
464
+ [data-bpmnkit-hud-theme="light"] .ctx-ask-ai-btn { color: var(--bpmnkit-accent, #1a56db); opacity: 0.7; }
465
+ [data-bpmnkit-hud-theme="light"] .ctx-ask-ai-btn:hover { background: var(--bpmnkit-accent-subtle, rgba(26,86,219,0.12)); color: var(--bpmnkit-accent, #1a56db); opacity: 1; }
466
+
467
+ /* ── New-diagram onboarding overlay ──────────────────────────────── */
468
+ #bpmnkit-empty-state {
469
+ position: absolute; z-index: 50;
470
+ top: 36px; left: 0; bottom: 0; right: 0;
471
+ display: flex; align-items: center; justify-content: center;
472
+ background: var(--bpmnkit-bg, #0d0d16);
473
+ }
474
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-empty-state { background: var(--bpmnkit-bg, #f4f4f8); }
475
+
476
+ .bpmnkit-onboard-inner {
477
+ display: flex; flex-direction: column; align-items: center;
478
+ gap: 28px; padding: 24px; max-width: 580px; width: 100%;
479
+ }
480
+ .bpmnkit-onboard-header { text-align: center; }
481
+ .bpmnkit-onboard-title {
482
+ color: rgba(255,255,255,0.82); font-size: 16px; font-weight: 600; margin: 0 0 7px;
483
+ }
484
+ .bpmnkit-onboard-sub {
485
+ color: rgba(255,255,255,0.36); font-size: 13px; margin: 0;
486
+ }
487
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-title { color: rgba(0,0,0,0.72); }
488
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-sub { color: rgba(0,0,0,0.38); }
489
+
490
+ .bpmnkit-onboard-actions { display: flex; gap: 10px; width: 100%; }
491
+
492
+ .bpmnkit-onboard-btn {
493
+ flex: 1; display: flex; flex-direction: column; align-items: flex-start;
494
+ gap: 10px; padding: 16px 14px;
495
+ background: rgba(255,255,255,0.04);
496
+ border: 1px solid rgba(255,255,255,0.07);
497
+ border-radius: 10px; cursor: pointer; text-align: left;
498
+ color: inherit; transition: background 0.15s, border-color 0.15s;
499
+ }
500
+ .bpmnkit-onboard-btn:hover {
501
+ background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14);
502
+ }
503
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-btn {
504
+ background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08);
505
+ }
506
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-btn:hover {
507
+ background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.14);
508
+ }
509
+
510
+ .bpmnkit-onboard-btn-icon {
511
+ display: flex; align-items: center; justify-content: center;
512
+ width: 32px; height: 32px; border-radius: 8px;
513
+ background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.65); flex-shrink: 0;
514
+ }
515
+ .bpmnkit-onboard-btn-icon svg { width: 16px; height: 16px; pointer-events: none; }
516
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-btn-icon {
517
+ background: rgba(0,0,0,0.07); color: rgba(0,0,0,0.55);
518
+ }
519
+
520
+ .bpmnkit-onboard-btn--ai .bpmnkit-onboard-btn-icon {
521
+ background: rgba(76,142,247,0.18); color: #8ab8ff;
522
+ }
523
+ .bpmnkit-onboard-btn--ai:hover { border-color: rgba(76,142,247,0.3); }
524
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-btn--ai .bpmnkit-onboard-btn-icon {
525
+ background: rgba(26,86,219,0.1); color: #1a56db;
526
+ }
527
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-btn--ai:hover { border-color: rgba(26,86,219,0.28); }
528
+
529
+ .bpmnkit-onboard-btn-label { display: flex; flex-direction: column; gap: 3px; }
530
+ .bpmnkit-onboard-btn-title {
531
+ font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8); margin: 0;
532
+ }
533
+ .bpmnkit-onboard-btn-desc {
534
+ font-size: 11px; color: rgba(255,255,255,0.32); margin: 0; line-height: 1.4;
535
+ }
536
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-btn-title { color: rgba(0,0,0,0.72); }
537
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-btn-desc { color: rgba(0,0,0,0.36); }
538
+
539
+ .bpmnkit-onboard-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
540
+ .bpmnkit-onboard-links a {
541
+ color: rgba(255,255,255,0.22); font-size: 11px; text-decoration: none; transition: color 0.1s;
542
+ }
543
+ .bpmnkit-onboard-links a:hover { color: rgba(255,255,255,0.55); }
544
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-links a { color: rgba(0,0,0,0.25); }
545
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-onboard-links a:hover { color: rgba(0,0,0,0.6); }
546
+
547
+ @media (max-width: 520px) {
548
+ .bpmnkit-onboard-actions { flex-direction: column; }
549
+ .bpmnkit-onboard-btn { flex-direction: row; align-items: center; gap: 12px; }
550
+ .bpmnkit-onboard-btn-label { flex-direction: column; }
551
+ }
552
+
553
+ /* ── Top-center overflow guard ───────────────────────────────────── */
554
+ #hud-top-center {
555
+ max-width: calc(100% - 24px);
556
+ overflow-x: auto; overflow-y: visible;
557
+ scrollbar-width: none;
558
+ }
559
+ #hud-top-center::-webkit-scrollbar { display: none; }
560
+
561
+ /* ── Push HUD toolbar down when simulation banner is visible ─────── */
562
+ .bpmnkit-sim-active #hud-top-center { top: 36px; }
563
+
564
+ /* ── Simulation active banner ────────────────────────────────────── */
565
+ #bpmnkit-sim-banner {
566
+ position: absolute;
567
+ top: 0; left: 0; right: 0;
568
+ z-index: 150;
569
+ display: flex; align-items: center; justify-content: center; gap: 12px;
570
+ padding: 7px 16px;
571
+ background: rgba(217, 119, 6, 0.18);
572
+ border-bottom: 1px solid rgba(217, 119, 6, 0.35);
573
+ backdrop-filter: blur(6px);
574
+ font-size: 12px; font-weight: 500;
575
+ color: rgba(255, 193, 87, 0.95);
576
+ pointer-events: auto;
577
+ }
578
+ #bpmnkit-sim-banner.hidden { display: none; }
579
+ #bpmnkit-sim-banner-exit {
580
+ padding: 3px 10px; border-radius: 5px;
581
+ background: rgba(217, 119, 6, 0.22);
582
+ border: 1px solid rgba(217, 119, 6, 0.4);
583
+ color: inherit; cursor: pointer; font-size: 11px; font-weight: 600;
584
+ transition: background 0.1s;
585
+ }
586
+ #bpmnkit-sim-banner-exit:hover { background: rgba(217, 119, 6, 0.35); }
587
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-sim-banner {
588
+ background: rgba(254, 243, 199, 0.95);
589
+ border-bottom-color: rgba(217, 119, 6, 0.25);
590
+ color: #92400e;
591
+ }
592
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-sim-banner-exit {
593
+ background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.3);
594
+ }
595
+
596
+ /* ── Context menu ────────────────────────────────────────────────── */
597
+ #bpmnkit-ctx-menu { min-width: 160px; }
598
+
599
+ /* ── Element search bar ──────────────────────────────────────────── */
600
+ #bpmnkit-search-bar {
601
+ position: absolute;
602
+ top: 44px; left: 50%; transform: translateX(-50%);
603
+ z-index: 120;
604
+ display: flex; align-items: center; gap: 6px;
605
+ padding: 5px 10px;
606
+ background: rgba(22, 22, 30, 0.92);
607
+ backdrop-filter: blur(10px);
608
+ border: 1px solid rgba(255,255,255,0.15);
609
+ border-radius: 8px;
610
+ box-shadow: 0 4px 16px rgba(0,0,0,0.4);
611
+ }
612
+ #bpmnkit-search-bar.hidden { display: none; }
613
+ #bpmnkit-search-input {
614
+ width: 220px; padding: 3px 6px;
615
+ background: transparent; border: none;
616
+ color: #fff; font-size: 13px; outline: none;
617
+ }
618
+ #bpmnkit-search-input::placeholder { color: rgba(255,255,255,0.35); }
619
+ #bpmnkit-search-count {
620
+ font-size: 11px; color: rgba(255,255,255,0.45); white-space: nowrap; min-width: 40px;
621
+ }
622
+ #bpmnkit-search-close {
623
+ background: transparent; border: none; color: rgba(255,255,255,0.4);
624
+ cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px;
625
+ }
626
+ #bpmnkit-search-close:hover { color: #fff; }
627
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-search-bar {
628
+ background: rgba(252, 252, 254, 0.96);
629
+ border-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));
630
+ box-shadow: 0 4px 16px rgba(0,0,0,0.12);
631
+ }
632
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-search-input { color: rgba(0,0,0,0.9); }
633
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-search-input::placeholder { color: rgba(0,0,0,0.3); }
634
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-search-count { color: rgba(0,0,0,0.4); }
635
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-search-close { color: rgba(0,0,0,0.35); }
636
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-search-close:hover { color: rgba(0,0,0,0.8); }
637
+
638
+ /* ── Keyboard shortcuts modal ────────────────────────────────────── */
639
+ #bpmnkit-shortcuts-modal {
640
+ position: absolute; inset: 0; z-index: 200;
641
+ display: flex; align-items: center; justify-content: center;
642
+ background: rgba(0,0,0,0.55);
643
+ backdrop-filter: blur(4px);
644
+ }
645
+ #bpmnkit-shortcuts-modal.hidden { display: none; }
646
+ #bpmnkit-shortcuts-inner {
647
+ background: var(--bpmnkit-surface-2, #1e1e2e);
648
+ border: 1px solid var(--bpmnkit-panel-border, rgba(255,255,255,0.08));
649
+ border-radius: 12px;
650
+ box-shadow: 0 8px 32px rgba(0,0,0,0.5);
651
+ padding: 20px 24px;
652
+ min-width: 320px; max-width: 480px;
653
+ color: rgba(255,255,255,0.85);
654
+ }
655
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-shortcuts-inner {
656
+ background: var(--bpmnkit-surface, #fff);
657
+ border-color: var(--bpmnkit-panel-border, rgba(0,0,0,0.08));
658
+ box-shadow: 0 8px 32px rgba(0,0,0,0.15);
659
+ color: rgba(0,0,0,0.8);
660
+ }
661
+ #bpmnkit-shortcuts-inner h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; }
662
+ .bpmnkit-sc-row {
663
+ display: flex; justify-content: space-between; align-items: center;
664
+ padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 12px;
665
+ }
666
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-sc-row { border-bottom-color: rgba(0,0,0,0.06); }
667
+ .bpmnkit-sc-row:last-child { border-bottom: none; }
668
+ .bpmnkit-sc-key {
669
+ font-family: var(--font-mono, monospace);
670
+ background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
671
+ border-radius: 4px; padding: 1px 6px; font-size: 11px;
672
+ }
673
+ [data-bpmnkit-hud-theme="light"] .bpmnkit-sc-key {
674
+ background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.7);
675
+ }
676
+ #bpmnkit-shortcuts-close {
677
+ display: block; margin: 14px auto 0; padding: 6px 20px;
678
+ background: var(--bpmnkit-surface-2, rgba(255,255,255,0.08)); border: 1px solid var(--bpmnkit-panel-border, rgba(255,255,255,0.08));
679
+ border-radius: 6px; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 12px;
680
+ transition: background 0.1s;
681
+ }
682
+ #bpmnkit-shortcuts-close:hover { background: rgba(255,255,255,0.14); color: #fff; }
683
+ [data-bpmnkit-hud-theme="light"] #bpmnkit-shortcuts-close {
684
+ background: var(--bpmnkit-surface-2, rgba(0,0,0,0.05)); border-color: var(--bpmnkit-border, #d0d0e8); color: rgba(0,0,0,0.6);
685
+ }
686
+
687
+ /* ── Mobile: collapsible center toolbars ─────────────────────────── */
688
+ #btn-bc-toggle, #btn-tc-toggle { display: none; }
689
+
690
+ @media (max-width: 600px) {
691
+ #btn-bc-toggle, #btn-tc-toggle { display: flex; }
692
+
693
+ /* Collapsed: hide all children except the toggle button */
694
+ #hud-bottom-center:not(.expanded) > *:not(#btn-bc-toggle) { display: none; }
695
+ #hud-top-center:not(.expanded) > *:not(#btn-tc-toggle) { display: none; }
696
+
697
+ /* Expanded: highlight the toggle button as a close affordance */
698
+ #hud-bottom-center.expanded #btn-bc-toggle,
699
+ #hud-top-center.expanded #btn-tc-toggle {
700
+ background: rgba(255,255,255,0.08); color: #fff;
701
+ }
702
+ [data-bpmnkit-hud-theme="light"] #hud-bottom-center.expanded #btn-bc-toggle,
703
+ [data-bpmnkit-hud-theme="light"] #hud-top-center.expanded #btn-tc-toggle {
704
+ background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.9);
705
+ }
706
+ }
707
+
708
+ /* Hide bottom toolbar on welcome screen */
709
+ .bpmnkit-welcome-active #hud-bottom-center { display: none !important; }
710
+ `;
711
+ /** Injects the HUD stylesheet into `<head>` if not already present. */
712
+ export function injectHudStyles() {
713
+ if (typeof document === "undefined")
714
+ return;
715
+ if (document.getElementById(HUD_STYLE_ID))
716
+ return;
717
+ const style = document.createElement("style");
718
+ style.id = HUD_STYLE_ID;
719
+ style.textContent = HUD_CSS;
720
+ document.head.appendChild(style);
721
+ }
722
+ //# sourceMappingURL=css.js.map