@bpmnkit/editor 0.0.34 → 0.1.0
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/chrome.d.ts +24 -0
- package/dist/chrome.js +75 -0
- package/dist/css.d.ts +5 -4
- package/dist/css.js +231 -357
- package/dist/dock.js +58 -80
- package/dist/editor.js +12 -2
- package/dist/i18n.d.ts +35 -0
- package/dist/i18n.js +45 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/inject.d.ts +3 -0
- package/dist/inject.js +12 -0
- package/dist/modal.js +33 -53
- package/package.json +3 -3
package/dist/dock.js
CHANGED
|
@@ -1,131 +1,109 @@
|
|
|
1
|
+
import { injectChromeStyles } from "./chrome.js";
|
|
1
2
|
const DOCK_STYLE_ID = "bpmnkit-side-dock-styles-v1";
|
|
2
3
|
const STORAGE_KEY_WIDTH = "bpmnkit-side-dock-width";
|
|
3
4
|
const STORAGE_KEY_COLLAPSED = "bpmnkit-side-dock-collapsed";
|
|
4
5
|
const MIN_WIDTH = 280;
|
|
5
6
|
const MAX_WIDTH = 700;
|
|
6
|
-
const DEFAULT_WIDTH =
|
|
7
|
+
const DEFAULT_WIDTH = 340;
|
|
7
8
|
const DOCK_CSS = `
|
|
8
|
-
/* ── Side
|
|
9
|
-
|
|
9
|
+
/* ── Side dock ───────────────────────────────────────────────────────────
|
|
10
|
+
The properties panel, in the bpmnkit.com design system: flat, square,
|
|
11
|
+
hairline-bounded, mono uppercase labels. Grounds follow the HUD theme
|
|
12
|
+
variables declared in css.ts, so the two read as one piece of chrome.
|
|
13
|
+
──────────────────────────────────────────────────────────────────────── */
|
|
10
14
|
.bpmnkit-side-dock {
|
|
11
15
|
position: fixed; right: 0; top: 36px; bottom: 0;
|
|
12
16
|
z-index: 9999; display: flex; flex-direction: column;
|
|
13
|
-
background:
|
|
14
|
-
border-left: 1px solid rgba(255,255,255,0.
|
|
15
|
-
|
|
16
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
17
|
+
background: var(--bpmnkit-chrome-ground, #ffffff);
|
|
18
|
+
border-left: 1px solid var(--bpmnkit-chrome-line, rgba(255, 255, 255, 0.14));
|
|
19
|
+
font-family: var(--bpmnkit-ds-font-sans, system-ui, -apple-system, sans-serif);
|
|
17
20
|
transition: width 0.22s ease;
|
|
18
21
|
}
|
|
19
|
-
/*
|
|
22
|
+
/* Square handle — sticks out from the left edge; always visible + clickable */
|
|
20
23
|
.bpmnkit-side-dock__collapse-handle {
|
|
21
24
|
position: absolute; left: -20px; top: 50%; transform: translateY(-50%);
|
|
22
25
|
width: 20px; height: 52px;
|
|
23
|
-
background:
|
|
24
|
-
border: 1px solid rgba(255,255,255,0.
|
|
25
|
-
border-radius: 8px 0 0 8px;
|
|
26
|
+
background: var(--bpmnkit-chrome-ground, #ffffff);
|
|
27
|
+
border: 1px solid var(--bpmnkit-chrome-line, rgba(255, 255, 255, 0.14)); border-right: none;
|
|
26
28
|
display: flex; align-items: center; justify-content: center;
|
|
27
29
|
cursor: pointer; z-index: 1;
|
|
28
|
-
color:
|
|
29
|
-
|
|
30
|
+
color: var(--bpmnkit-chrome-ink-4, #9aa1aa);
|
|
31
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
32
|
+
font-size: 13px; line-height: 1;
|
|
33
|
+
font-variant-emoji: text;
|
|
30
34
|
user-select: none;
|
|
31
35
|
}
|
|
32
|
-
.bpmnkit-side-dock__collapse-handle:hover { color: #
|
|
36
|
+
.bpmnkit-side-dock__collapse-handle:hover { color: var(--bpmnkit-chrome-ink, #f4f5f7); background: var(--bpmnkit-chrome-hover, rgba(255,255,255,0.07)); }
|
|
33
37
|
.bpmnkit-side-dock__resize-handle {
|
|
34
38
|
position: absolute; left: 0; top: 0; bottom: 0;
|
|
35
39
|
width: 5px; cursor: ew-resize; z-index: 2;
|
|
36
40
|
}
|
|
37
|
-
.bpmnkit-side-dock__resize-handle:hover { background:
|
|
41
|
+
.bpmnkit-side-dock__resize-handle:hover { background: var(--bpmnkit-chrome-accent, #c9755c); }
|
|
42
|
+
|
|
43
|
+
/* ── Tabs — equal-width row, the underline sits on the row's own rule ── */
|
|
38
44
|
.bpmnkit-side-dock__tab-strip {
|
|
39
|
-
display: flex; align-items:
|
|
40
|
-
border-bottom: 1px solid rgba(255,255,255,0.
|
|
45
|
+
display: flex; align-items: stretch; height: 34px; flex-shrink: 0;
|
|
46
|
+
border-bottom: 1px solid var(--bpmnkit-chrome-line, rgba(255, 255, 255, 0.14));
|
|
47
|
+
overflow-x: auto; scrollbar-width: none;
|
|
41
48
|
}
|
|
49
|
+
.bpmnkit-side-dock__tab-strip::-webkit-scrollbar { display: none; }
|
|
50
|
+
/* Equal-width while the labels fit; the strip scrolls rather than clipping them. */
|
|
42
51
|
.bpmnkit-side-dock__tab {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
font-family:
|
|
52
|
+
flex: 1 0 auto;
|
|
53
|
+
padding: 0 10px; height: 100%; background: none; border: none;
|
|
54
|
+
border-bottom: 2px solid transparent; color: var(--bpmnkit-chrome-ink-4, #9aa1aa);
|
|
55
|
+
cursor: pointer; white-space: nowrap;
|
|
56
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
57
|
+
font-size: var(--bpmnkit-ds-t-mono-micro, 10.5px);
|
|
58
|
+
letter-spacing: 0.08em; text-transform: uppercase;
|
|
59
|
+
}
|
|
60
|
+
.bpmnkit-side-dock__tab:hover { color: var(--bpmnkit-chrome-ink-2, #c8ccd2); }
|
|
61
|
+
.bpmnkit-side-dock__tab.active {
|
|
62
|
+
color: var(--bpmnkit-chrome-ink, #f4f5f7);
|
|
63
|
+
border-bottom-color: var(--bpmnkit-chrome-accent, #c9755c);
|
|
64
|
+
margin-bottom: -1px;
|
|
48
65
|
}
|
|
49
|
-
.bpmnkit-side-dock__tab:
|
|
50
|
-
.bpmnkit-side-dock__tab.active { color: #4c8ef7; border-bottom-color: #4c8ef7; }
|
|
66
|
+
.bpmnkit-side-dock__tab:disabled { opacity: 0.3; cursor: default; }
|
|
51
67
|
.bpmnkit-side-dock__pane {
|
|
52
68
|
flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;
|
|
53
69
|
}
|
|
54
70
|
.bpmnkit-side-dock__pane--hidden { display: none; }
|
|
55
|
-
|
|
71
|
+
|
|
72
|
+
/* ── Empty state — info rows + hint, shown when nothing is selected ── */
|
|
56
73
|
.bpmnkit-side-dock__empty {
|
|
57
74
|
flex: 1; display: flex; flex-direction: column;
|
|
58
|
-
overflow-y: auto; padding:
|
|
59
|
-
gap: 0;
|
|
75
|
+
overflow-y: auto; padding: 0 20px;
|
|
60
76
|
}
|
|
61
77
|
.bpmnkit-side-dock__info-row {
|
|
62
78
|
display: flex; flex-direction: column;
|
|
63
|
-
padding:
|
|
64
|
-
border-bottom: 1px solid rgba(255,255,255,0.
|
|
65
|
-
gap:
|
|
79
|
+
padding: 14px 0;
|
|
80
|
+
border-bottom: 1px solid var(--bpmnkit-chrome-line-soft, rgba(255, 255, 255, 0.08));
|
|
81
|
+
gap: 7px;
|
|
66
82
|
}
|
|
67
83
|
.bpmnkit-side-dock__info-label {
|
|
68
|
-
font-
|
|
69
|
-
|
|
84
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
85
|
+
font-size: var(--bpmnkit-ds-t-mono-micro, 10.5px); letter-spacing: 0.12em;
|
|
86
|
+
text-transform: uppercase; color: var(--bpmnkit-chrome-ink-4, #9aa1aa);
|
|
70
87
|
}
|
|
71
88
|
.bpmnkit-side-dock__info-value {
|
|
72
|
-
font-
|
|
89
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
90
|
+
font-size: 12.5px; color: var(--bpmnkit-chrome-ink-2, #c8ccd2); word-break: break-word;
|
|
73
91
|
}
|
|
92
|
+
/* A sentence, not a label — --ink-4 does not clear 4.5:1 on a light ground. */
|
|
74
93
|
.bpmnkit-side-dock__empty-hint {
|
|
75
|
-
font-
|
|
76
|
-
|
|
94
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
95
|
+
font-size: var(--bpmnkit-ds-t-mono-label, 11.5px); letter-spacing: 0.04em;
|
|
96
|
+
color: var(--bpmnkit-chrome-ink-2, #c8ccd2);
|
|
97
|
+
padding: 24px 0;
|
|
77
98
|
}
|
|
78
|
-
/* Collapsed state — only the
|
|
99
|
+
/* Collapsed state — only the handle remains visible */
|
|
79
100
|
.bpmnkit-side-dock--collapsed .bpmnkit-side-dock__tab-strip,
|
|
80
101
|
.bpmnkit-side-dock--collapsed .bpmnkit-side-dock__pane { display: none; }
|
|
81
102
|
/* Push watermark left of the dock using a CSS variable updated by JS */
|
|
82
103
|
.bpmnkit-watermark { right: calc(var(--bpmnkit-dock-width, 0px) + 8px) !important; }
|
|
83
|
-
/* Light theme */
|
|
84
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock {
|
|
85
|
-
background: rgba(248,248,252,0.99); border-left-color: rgba(0,0,0,0.08);
|
|
86
|
-
box-shadow: -8px 0 40px rgba(0,0,0,0.12);
|
|
87
|
-
}
|
|
88
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__collapse-handle {
|
|
89
|
-
background: rgba(248,248,252,0.99); border-color: rgba(0,0,0,0.08); color: rgba(0,0,0,0.4);
|
|
90
|
-
}
|
|
91
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__collapse-handle:hover {
|
|
92
|
-
background: rgba(235,235,242,0.99); color: rgba(0,0,0,0.9);
|
|
93
|
-
}
|
|
94
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__tab-strip { border-bottom-color: rgba(0,0,0,0.07); }
|
|
95
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__tab { color: rgba(0,0,0,0.4); }
|
|
96
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__tab:hover { color: rgba(0,0,0,0.7); }
|
|
97
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__tab.active { color: #1a56db; border-bottom-color: #1a56db; }
|
|
98
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__resize-handle:hover { background: rgba(26,86,219,0.2); }
|
|
99
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__info-label { color: rgba(0,0,0,0.3); }
|
|
100
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__info-value { color: rgba(0,0,0,0.75); }
|
|
101
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__info-row { border-bottom-color: rgba(0,0,0,0.06); }
|
|
102
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-side-dock__empty-hint { color: rgba(0,0,0,0.25); }
|
|
103
|
-
/* Neon theme */
|
|
104
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock {
|
|
105
|
-
background: oklch(6% 0.04 280);
|
|
106
|
-
border-left: 1px solid oklch(65% 0.28 280 / 0.35);
|
|
107
|
-
box-shadow: -8px 0 40px oklch(0% 0 0 / 0.8), -1px 0 20px oklch(65% 0.28 280 / 0.12);
|
|
108
|
-
}
|
|
109
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__collapse-handle {
|
|
110
|
-
background: oklch(6% 0.04 280);
|
|
111
|
-
border-color: oklch(65% 0.28 280 / 0.35);
|
|
112
|
-
color: oklch(65% 0.28 280 / 0.6);
|
|
113
|
-
}
|
|
114
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__collapse-handle:hover {
|
|
115
|
-
background: oklch(12% 0.04 270 / 0.99);
|
|
116
|
-
color: oklch(73% 0.16 280);
|
|
117
|
-
}
|
|
118
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__tab-strip { border-bottom-color: oklch(65% 0.28 280 / 0.25); }
|
|
119
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__tab { color: oklch(50% 0.1 280); }
|
|
120
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__tab:hover { color: oklch(73% 0.16 280); }
|
|
121
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__tab.active { color: oklch(72% 0.18 185); border-bottom-color: oklch(72% 0.18 185); }
|
|
122
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__resize-handle:hover { background: oklch(65% 0.28 280 / 0.25); }
|
|
123
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__info-label { color: oklch(50% 0.06 280); }
|
|
124
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__info-value { color: oklch(73% 0.16 280); }
|
|
125
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__info-row { border-bottom-color: oklch(65% 0.28 280 / 0.1); }
|
|
126
|
-
[data-bpmnkit-hud-theme="neon"] .bpmnkit-side-dock__empty-hint { color: oklch(45% 0.08 280); }
|
|
127
104
|
`;
|
|
128
105
|
function injectDockStyles() {
|
|
106
|
+
injectChromeStyles();
|
|
129
107
|
if (document.getElementById(DOCK_STYLE_ID))
|
|
130
108
|
return;
|
|
131
109
|
const style = document.createElement("style");
|
package/dist/editor.js
CHANGED
|
@@ -295,8 +295,10 @@ export class BpmnEditor {
|
|
|
295
295
|
injectEditorStyles();
|
|
296
296
|
this._id = String(_instanceCounter++);
|
|
297
297
|
this._t = options.translate ?? defaultTranslate;
|
|
298
|
-
// Resolve initial theme — localStorage overrides the options.theme when persistTheme is on
|
|
299
|
-
|
|
298
|
+
// Resolve initial theme — localStorage overrides the options.theme when persistTheme is on.
|
|
299
|
+
// The shell's default is the design system's light `--canvas` ground; `neon` stays a
|
|
300
|
+
// white-label theme a host opts into.
|
|
301
|
+
let initialTheme = options.theme ?? "light";
|
|
300
302
|
if (options.persistTheme) {
|
|
301
303
|
try {
|
|
302
304
|
const stored = localStorage.getItem("bpmnkit-theme");
|
|
@@ -2384,6 +2386,14 @@ export class BpmnEditor {
|
|
|
2384
2386
|
scrollToElement(id) {
|
|
2385
2387
|
self.scrollToElement(id);
|
|
2386
2388
|
},
|
|
2389
|
+
// The editor works on one plane — `diagrams[0]` — and has no drill-in.
|
|
2390
|
+
// Saying so honestly is what lets a navigation plugin decline to drill
|
|
2391
|
+
// here, rather than appearing to and doing nothing.
|
|
2392
|
+
getPlanes() {
|
|
2393
|
+
const plane = self._defs?.diagrams[0]?.plane;
|
|
2394
|
+
return plane === undefined ? [] : [{ id: plane.bpmnElement, name: plane.bpmnElement }];
|
|
2395
|
+
},
|
|
2396
|
+
showPlane() { },
|
|
2387
2397
|
getAbsoluteBBox(id) {
|
|
2388
2398
|
return self._absoluteBBox(id);
|
|
2389
2399
|
},
|
package/dist/i18n.d.ts
CHANGED
|
@@ -11,4 +11,39 @@ export type Translate = (template: string, vars?: TranslateVars) => string;
|
|
|
11
11
|
export declare function interpolate(template: string, vars?: TranslateVars): string;
|
|
12
12
|
/** The default (identity) translator: no localization, just placeholder interpolation. */
|
|
13
13
|
export declare function defaultTranslate(template: string, vars?: TranslateVars): string;
|
|
14
|
+
/**
|
|
15
|
+
* A translator that also records what it was asked for.
|
|
16
|
+
*
|
|
17
|
+
* Localising a UI starts with knowing which strings it has, and the usual
|
|
18
|
+
* answer — grep the source for the translation call — produces a list nobody
|
|
19
|
+
* can trust: it includes strings behind code that no longer runs, and misses
|
|
20
|
+
* any built by concatenation. Harvesting from a *running* editor inverts that.
|
|
21
|
+
* Every key it observes is real by construction, and a key the harvest never
|
|
22
|
+
* observes is either dead or reachable only through a path the harvest does
|
|
23
|
+
* not exercise. Both are worth knowing, and neither is knowable from the
|
|
24
|
+
* source alone.
|
|
25
|
+
*
|
|
26
|
+
* @param base - The translator to delegate to. Defaults to identity, which is
|
|
27
|
+
* what a harvest wants; pass a real one to record a live session instead.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const recorder = createTranslationRecorder();
|
|
32
|
+
* const editor = new BpmnEditor({ container, translate: recorder.translate });
|
|
33
|
+
* initEditorHud(editor);
|
|
34
|
+
* recorder.keys(); // every string the editor asked for while starting up
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function createTranslationRecorder(base?: Translate): TranslationRecorder;
|
|
38
|
+
/** A {@link Translate} that remembers every template it was given. */
|
|
39
|
+
export interface TranslationRecorder {
|
|
40
|
+
/** Pass this to the editor as its `translate` option. */
|
|
41
|
+
translate: Translate;
|
|
42
|
+
/** Every template requested, in the order it was first asked for. */
|
|
43
|
+
keys(): string[];
|
|
44
|
+
/** The interpolation variables a template was given, sorted. */
|
|
45
|
+
placeholders(template: string): string[];
|
|
46
|
+
/** Forgets everything observed so far. */
|
|
47
|
+
reset(): void;
|
|
48
|
+
}
|
|
14
49
|
//# sourceMappingURL=i18n.d.ts.map
|
package/dist/i18n.js
CHANGED
|
@@ -8,4 +8,49 @@ export function interpolate(template, vars) {
|
|
|
8
8
|
export function defaultTranslate(template, vars) {
|
|
9
9
|
return interpolate(template, vars);
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* A translator that also records what it was asked for.
|
|
13
|
+
*
|
|
14
|
+
* Localising a UI starts with knowing which strings it has, and the usual
|
|
15
|
+
* answer — grep the source for the translation call — produces a list nobody
|
|
16
|
+
* can trust: it includes strings behind code that no longer runs, and misses
|
|
17
|
+
* any built by concatenation. Harvesting from a *running* editor inverts that.
|
|
18
|
+
* Every key it observes is real by construction, and a key the harvest never
|
|
19
|
+
* observes is either dead or reachable only through a path the harvest does
|
|
20
|
+
* not exercise. Both are worth knowing, and neither is knowable from the
|
|
21
|
+
* source alone.
|
|
22
|
+
*
|
|
23
|
+
* @param base - The translator to delegate to. Defaults to identity, which is
|
|
24
|
+
* what a harvest wants; pass a real one to record a live session instead.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const recorder = createTranslationRecorder();
|
|
29
|
+
* const editor = new BpmnEditor({ container, translate: recorder.translate });
|
|
30
|
+
* initEditorHud(editor);
|
|
31
|
+
* recorder.keys(); // every string the editor asked for while starting up
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export function createTranslationRecorder(base = defaultTranslate) {
|
|
35
|
+
// Insertion-ordered, so the harvest reads in the order the UI asks.
|
|
36
|
+
const seen = new Map();
|
|
37
|
+
return {
|
|
38
|
+
translate(template, vars) {
|
|
39
|
+
const names = seen.get(template) ?? new Set();
|
|
40
|
+
for (const name of Object.keys(vars ?? {}))
|
|
41
|
+
names.add(name);
|
|
42
|
+
seen.set(template, names);
|
|
43
|
+
return base(template, vars);
|
|
44
|
+
},
|
|
45
|
+
keys() {
|
|
46
|
+
return [...seen.keys()];
|
|
47
|
+
},
|
|
48
|
+
placeholders(template) {
|
|
49
|
+
return [...(seen.get(template) ?? [])].sort();
|
|
50
|
+
},
|
|
51
|
+
reset() {
|
|
52
|
+
seen.clear();
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
11
56
|
//# sourceMappingURL=i18n.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { BpmnEditor } from "./editor.js";
|
|
2
|
+
export { CHROME_CSS, CHROME_STYLE_ID, injectChromeStyles } from "./chrome.js";
|
|
3
|
+
export { injectStyle } from "./inject.js";
|
|
2
4
|
export { createEmptyDefinitions } from "./modeling.js";
|
|
3
5
|
export type { EditorEvents, EditorOptions, LabelPosition, Tool, CreateShapeType, HandleDir, PortDir, } from "./types.js";
|
|
4
6
|
export { ELEMENT_GROUPS, ELEMENT_TYPE_LABELS, EXTERNAL_LABEL_TYPES, CONTEXTUAL_ADD_TYPES, getElementGroup, getValidLabelPositions, } from "./element-groups.js";
|
|
5
7
|
export type { ElementGroup } from "./element-groups.js";
|
|
6
8
|
export { initEditorHud } from "./hud.js";
|
|
7
9
|
export type { HudOptions } from "./hud.js";
|
|
8
|
-
export { defaultTranslate, interpolate } from "./i18n.js";
|
|
9
|
-
export type { Translate, TranslateVars } from "./i18n.js";
|
|
10
|
+
export { createTranslationRecorder, defaultTranslate, interpolate } from "./i18n.js";
|
|
11
|
+
export type { Translate, TranslationRecorder, TranslateVars } from "./i18n.js";
|
|
10
12
|
export { createSideDock } from "./dock.js";
|
|
11
13
|
export type { SideDock } from "./dock.js";
|
|
12
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { BpmnEditor } from "./editor.js";
|
|
2
|
+
export { CHROME_CSS, CHROME_STYLE_ID, injectChromeStyles } from "./chrome.js";
|
|
3
|
+
export { injectStyle } from "./inject.js";
|
|
2
4
|
export { createEmptyDefinitions } from "./modeling.js";
|
|
3
5
|
export { ELEMENT_GROUPS, ELEMENT_TYPE_LABELS, EXTERNAL_LABEL_TYPES, CONTEXTUAL_ADD_TYPES, getElementGroup, getValidLabelPositions, } from "./element-groups.js";
|
|
4
6
|
export { initEditorHud } from "./hud.js";
|
|
5
|
-
export { defaultTranslate, interpolate } from "./i18n.js";
|
|
7
|
+
export { createTranslationRecorder, defaultTranslate, interpolate } from "./i18n.js";
|
|
6
8
|
export { createSideDock } from "./dock.js";
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/dist/inject.d.ts
ADDED
package/dist/inject.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Injects a CSS string into `<head>` exactly once, keyed by id. */
|
|
2
|
+
export function injectStyle(id, css) {
|
|
3
|
+
if (typeof document === "undefined")
|
|
4
|
+
return;
|
|
5
|
+
if (document.getElementById(id))
|
|
6
|
+
return;
|
|
7
|
+
const style = document.createElement("style");
|
|
8
|
+
style.id = id;
|
|
9
|
+
style.textContent = css;
|
|
10
|
+
document.head.appendChild(style);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=inject.js.map
|
package/dist/modal.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { injectChromeStyles } from "./chrome.js";
|
|
1
2
|
const MODAL_STYLE_ID = "bpmnkit-hud-modal-styles";
|
|
2
3
|
function injectModalStyles() {
|
|
4
|
+
injectChromeStyles();
|
|
3
5
|
if (document.getElementById(MODAL_STYLE_ID))
|
|
4
6
|
return;
|
|
5
7
|
const style = document.createElement("style");
|
|
@@ -7,76 +9,54 @@ function injectModalStyles() {
|
|
|
7
9
|
style.textContent = `
|
|
8
10
|
.bpmnkit-hud-modal-overlay {
|
|
9
11
|
position: fixed; inset: 0; z-index: 300;
|
|
10
|
-
background:
|
|
12
|
+
background: color-mix(in srgb, var(--bpmnkit-ds-dark, #14161a) 55%, transparent);
|
|
11
13
|
display: flex; align-items: center; justify-content: center;
|
|
12
14
|
}
|
|
13
15
|
.bpmnkit-hud-modal {
|
|
14
|
-
background:
|
|
15
|
-
border: 1px solid rgba(255,255,255,0.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
box-shadow: 0 16px 48px rgba(0,0,0,0.6);
|
|
22
|
-
display: flex; flex-direction: column; gap: 12px;
|
|
16
|
+
background: var(--bpmnkit-chrome-ground, #ffffff);
|
|
17
|
+
border: 1px solid var(--bpmnkit-chrome-line, rgba(255, 255, 255, 0.14));
|
|
18
|
+
padding: 24px 26px;
|
|
19
|
+
min-width: 320px; max-width: 90vw;
|
|
20
|
+
color: var(--bpmnkit-chrome-ink-2, #c8ccd2);
|
|
21
|
+
font-family: var(--bpmnkit-ds-font-sans, system-ui, -apple-system, sans-serif);
|
|
22
|
+
display: flex; flex-direction: column; gap: 14px;
|
|
23
23
|
}
|
|
24
24
|
.bpmnkit-hud-modal-title {
|
|
25
|
-
font-
|
|
26
|
-
|
|
25
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
26
|
+
font-size: var(--bpmnkit-ds-t-mono-micro, 10.5px); letter-spacing: 0.12em;
|
|
27
|
+
text-transform: uppercase; color: var(--bpmnkit-chrome-ink-4, #9aa1aa);
|
|
27
28
|
}
|
|
28
29
|
.bpmnkit-hud-modal-input {
|
|
29
|
-
width: 100%; padding:
|
|
30
|
-
background:
|
|
31
|
-
border: 1px solid rgba(255,255,255,0.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
font-size:
|
|
30
|
+
width: 100%; padding: 7px 9px;
|
|
31
|
+
background: transparent;
|
|
32
|
+
border: 1px solid var(--bpmnkit-chrome-line, rgba(255, 255, 255, 0.14));
|
|
33
|
+
color: var(--bpmnkit-chrome-ink, #f4f5f7);
|
|
34
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
35
|
+
font-size: 12.5px;
|
|
35
36
|
outline: none;
|
|
36
37
|
box-sizing: border-box;
|
|
37
38
|
}
|
|
38
|
-
.bpmnkit-hud-modal-input:focus { border-color:
|
|
39
|
-
.bpmnkit-hud-modal-actions { display: flex; gap:
|
|
39
|
+
.bpmnkit-hud-modal-input:focus { border-color: var(--bpmnkit-chrome-accent, #c9755c); }
|
|
40
|
+
.bpmnkit-hud-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
|
|
40
41
|
.bpmnkit-hud-modal-btn {
|
|
41
|
-
font-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
font-family: var(--bpmnkit-ds-font-mono, ui-monospace, monospace);
|
|
43
|
+
font-size: 12px; padding: 7px 16px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
border: 1px solid var(--bpmnkit-chrome-line, rgba(255, 255, 255, 0.14));
|
|
46
|
+
background: transparent;
|
|
47
|
+
color: var(--bpmnkit-chrome-ink-2, #c8ccd2);
|
|
46
48
|
}
|
|
47
|
-
.bpmnkit-hud-modal-btn:hover { background: rgba(255,255,255,0.
|
|
49
|
+
.bpmnkit-hud-modal-btn:hover { background: var(--bpmnkit-chrome-hover, rgba(255,255,255,0.07)); color: var(--bpmnkit-chrome-ink, #f4f5f7); }
|
|
48
50
|
.bpmnkit-hud-modal-btn--primary {
|
|
49
|
-
background:
|
|
50
|
-
border-color:
|
|
51
|
+
background: var(--bpmnkit-ds-accent, #a8503a);
|
|
52
|
+
border-color: var(--bpmnkit-ds-accent, #a8503a);
|
|
51
53
|
color: #fff;
|
|
52
54
|
}
|
|
53
|
-
.bpmnkit-hud-modal-btn--primary:hover {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
background: rgba(252,252,254,0.98);
|
|
57
|
-
border-color: rgba(0,0,0,0.1);
|
|
58
|
-
color: rgba(0,0,0,0.8);
|
|
59
|
-
box-shadow: 0 8px 32px rgba(0,0,0,0.15);
|
|
60
|
-
}
|
|
61
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-hud-modal-title { color: rgba(0,0,0,0.88); }
|
|
62
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-hud-modal-input {
|
|
63
|
-
background: rgba(0,0,0,0.04);
|
|
64
|
-
border-color: rgba(0,0,0,0.15);
|
|
65
|
-
color: rgba(0,0,0,0.9);
|
|
66
|
-
}
|
|
67
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-hud-modal-input:focus { border-color: rgba(0,80,200,0.4); }
|
|
68
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-hud-modal-btn {
|
|
69
|
-
border-color: rgba(0,0,0,0.12);
|
|
70
|
-
background: rgba(0,0,0,0.04);
|
|
71
|
-
color: rgba(0,0,0,0.7);
|
|
72
|
-
}
|
|
73
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-hud-modal-btn:hover { background: rgba(0,0,0,0.08); }
|
|
74
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-hud-modal-btn--primary {
|
|
75
|
-
background: rgba(0,80,200,0.85);
|
|
76
|
-
border-color: rgba(0,80,200,0.9);
|
|
55
|
+
.bpmnkit-hud-modal-btn--primary:hover {
|
|
56
|
+
background: var(--bpmnkit-ds-accent-hover, #8f412e);
|
|
57
|
+
border-color: var(--bpmnkit-ds-accent-hover, #8f412e);
|
|
77
58
|
color: #fff;
|
|
78
59
|
}
|
|
79
|
-
[data-bpmnkit-hud-theme="light"] .bpmnkit-hud-modal-btn--primary:hover { background: rgba(0,80,200,1); }
|
|
80
60
|
`;
|
|
81
61
|
document.head.appendChild(style);
|
|
82
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpmnkit/editor",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dist/**/*.d.ts"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@bpmnkit/canvas": "0.0
|
|
21
|
-
"@bpmnkit/core": "0.
|
|
20
|
+
"@bpmnkit/canvas": "0.1.0",
|
|
21
|
+
"@bpmnkit/core": "0.3.0"
|
|
22
22
|
},
|
|
23
23
|
"description": "Full-featured interactive BPMN editor with undo/redo, HUD, and side-dock UI",
|
|
24
24
|
"keywords": [
|