@miragon/event-storming-renderer 0.4.1 → 0.5.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/README.md +26 -4
- package/dist/EventStormingBaseViewer.d.ts +23 -3
- package/dist/EventStormingBaseViewer.d.ts.map +1 -1
- package/dist/board-bounds/BoardBounds.d.ts +6 -5
- package/dist/board-bounds/BoardBounds.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeEventStorming.d.ts +8 -3
- package/dist/collaborative/CollaborativeEventStorming.d.ts.map +1 -1
- package/dist/draw/EventStormingRenderer.d.ts.map +1 -1
- package/dist/draw/extent.d.ts +47 -0
- package/dist/draw/extent.d.ts.map +1 -0
- package/dist/draw/index.d.ts +1 -0
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/index.js +755 -656
- package/dist/index.js.map +1 -1
- package/dist/palette/EventStormingPaletteProvider.d.ts +1 -1
- package/dist/palette/EventStormingPaletteProvider.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import e from "diagram-js/lib/Diagram";
|
|
2
2
|
import { ATTACHABLE_STICKY_KINDS as t, CURRENT_SCHEMA_VERSION as n, DEFAULT_BOARD_LEVEL as r, DEFAULT_BOARD_SIZE as i, HOST_STICKY_KINDS as a, LEVEL_STICKY_KINDS as o, assertDrawable as s, validateBoard as c } from "@miragon/event-storming-schema-model";
|
|
3
3
|
import { parseDSLWithDiagnostics as l, serializeDSL as u } from "@miragon/event-storming-dsl";
|
|
4
|
-
import d from "diagram-js/lib/
|
|
5
|
-
import f from "
|
|
6
|
-
import
|
|
4
|
+
import d from "diagram-js/lib/draw/BaseRenderer";
|
|
5
|
+
import { append as f, attr as p, create as m, remove as h } from "tiny-svg";
|
|
6
|
+
import g from "diagram-js/lib/features/change-support";
|
|
7
7
|
import _ from "diagram-js/lib/features/selection";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { html as
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import { MODELER_API_VERSION as
|
|
8
|
+
import v from "diagram-js/lib/navigation/zoomscroll";
|
|
9
|
+
import ee from "diagram-js/lib/navigation/movecanvas";
|
|
10
|
+
import te from "diagram-js/lib/features/keyboard";
|
|
11
|
+
import ne from "diagram-js/lib/features/modeling";
|
|
12
|
+
import re from "diagram-js/lib/features/move";
|
|
13
|
+
import ie from "diagram-js/lib/features/create";
|
|
14
|
+
import ae from "diagram-js/lib/features/connect";
|
|
15
|
+
import oe from "diagram-js/lib/features/context-pad";
|
|
16
|
+
import se from "diagram-js/lib/features/palette";
|
|
17
|
+
import ce from "diagram-js/lib/features/rules";
|
|
18
|
+
import le from "diagram-js/lib/features/outline";
|
|
19
|
+
import ue from "diagram-js/lib/features/popup-menu";
|
|
20
|
+
import de from "diagram-js/lib/features/attach-support";
|
|
21
|
+
import fe from "diagram-js/lib/command/CommandInterceptor";
|
|
22
|
+
import pe from "diagram-js/lib/features/mouse";
|
|
23
|
+
import me from "diagram-js/lib/features/lasso-tool";
|
|
24
|
+
import he from "diagram-js/lib/features/rules/RuleProvider";
|
|
25
|
+
import ge from "diagram-js/lib/features/palette/PaletteTooltipComponent";
|
|
26
|
+
import { html as _e } from "diagram-js/lib/ui";
|
|
27
|
+
import ve from "diagram-js/lib/features/connection-preview";
|
|
28
|
+
import ye from "diagram-js/lib/features/ordering/OrderingProvider";
|
|
29
|
+
import be from "diagram-js/lib/features/resize";
|
|
30
|
+
import { MODELER_API_VERSION as xe } from "@miragon/modeler-api";
|
|
31
31
|
//#region src/io/saveSvg.ts
|
|
32
|
-
var
|
|
32
|
+
var Se = [
|
|
33
33
|
"tabindex",
|
|
34
34
|
"role",
|
|
35
35
|
"aria-label",
|
|
36
36
|
"aria-labelledby"
|
|
37
37
|
];
|
|
38
|
-
function
|
|
38
|
+
function Ce(e, t) {
|
|
39
39
|
let n = e.getContainer().querySelector(":scope > svg");
|
|
40
40
|
if (!n) throw Error("No SVG found in the canvas container.");
|
|
41
41
|
let r = n.cloneNode(!0);
|
|
42
|
-
for (let e of
|
|
42
|
+
for (let e of Se) r.removeAttribute(e);
|
|
43
43
|
let a = t ?? {
|
|
44
44
|
x: 0,
|
|
45
45
|
y: 0,
|
|
@@ -51,17 +51,17 @@ function we(e, t) {
|
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/model/di-types.ts
|
|
54
|
-
var
|
|
55
|
-
function
|
|
54
|
+
var y = "event-storming-root";
|
|
55
|
+
function we(e) {
|
|
56
56
|
return typeof e == "object" && !!e;
|
|
57
57
|
}
|
|
58
|
-
function y(e) {
|
|
59
|
-
return Te(e) && typeof e.eventStormingType == "string" && !("waypoints" in e);
|
|
60
|
-
}
|
|
61
58
|
function b(e) {
|
|
62
|
-
return
|
|
59
|
+
return we(e) && typeof e.eventStormingType == "string" && !("waypoints" in e);
|
|
63
60
|
}
|
|
64
|
-
|
|
61
|
+
function x(e) {
|
|
62
|
+
return we(e) && typeof e.eventStormingType == "string" && "waypoints" in e;
|
|
63
|
+
}
|
|
64
|
+
var S = [
|
|
65
65
|
"event",
|
|
66
66
|
"command",
|
|
67
67
|
"actor",
|
|
@@ -71,33 +71,33 @@ var x = [
|
|
|
71
71
|
"external",
|
|
72
72
|
"hotspot"
|
|
73
73
|
];
|
|
74
|
-
function S(e) {
|
|
75
|
-
return x.includes(e);
|
|
76
|
-
}
|
|
77
74
|
function C(e) {
|
|
78
|
-
return
|
|
75
|
+
return S.includes(e);
|
|
79
76
|
}
|
|
80
77
|
function w(e) {
|
|
81
|
-
return
|
|
78
|
+
return b(e) && C(e.eventStormingType);
|
|
82
79
|
}
|
|
83
80
|
function T(e) {
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
function Ee(e) {
|
|
87
|
-
return y(e) && w(e.eventStormingType);
|
|
81
|
+
return t.includes(e);
|
|
88
82
|
}
|
|
89
83
|
function E(e) {
|
|
90
|
-
return
|
|
84
|
+
return a.includes(e);
|
|
85
|
+
}
|
|
86
|
+
function Te(e) {
|
|
87
|
+
return b(e) && T(e.eventStormingType);
|
|
91
88
|
}
|
|
92
89
|
function D(e) {
|
|
93
|
-
return
|
|
90
|
+
return b(e) && E(e.eventStormingType);
|
|
91
|
+
}
|
|
92
|
+
function O(e) {
|
|
93
|
+
return b(e) && e.eventStormingType === "drawing";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
95
|
+
function Ee(e) {
|
|
96
|
+
return b(e) && e.eventStormingType === "note";
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region src/theme/palette.ts
|
|
100
|
-
var
|
|
100
|
+
var k = {
|
|
101
101
|
blau: "#335DE5",
|
|
102
102
|
blauLink: "#2B50D4",
|
|
103
103
|
blauHell: "#6B8AFF",
|
|
@@ -112,7 +112,7 @@ var O = {
|
|
|
112
112
|
info: "#335DE5",
|
|
113
113
|
navy: "#080A20",
|
|
114
114
|
gradientBrand: "linear-gradient(120deg, #335DE5 30%, #00E676)"
|
|
115
|
-
},
|
|
115
|
+
}, De = [
|
|
116
116
|
{
|
|
117
117
|
marker: "***",
|
|
118
118
|
bold: !0,
|
|
@@ -129,28 +129,28 @@ var O = {
|
|
|
129
129
|
italic: !0
|
|
130
130
|
}
|
|
131
131
|
];
|
|
132
|
-
function
|
|
132
|
+
function A(e) {
|
|
133
133
|
return e.split("\n").map((e) => {
|
|
134
134
|
let t = e.startsWith("- ");
|
|
135
135
|
return {
|
|
136
136
|
bullet: t,
|
|
137
|
-
runs:
|
|
137
|
+
runs: Ae(t ? e.slice(2) : e)
|
|
138
138
|
};
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Oe(e) {
|
|
142
142
|
return e.map((e) => {
|
|
143
|
-
let t =
|
|
143
|
+
let t = Me(e.runs).map((e) => {
|
|
144
144
|
let t = e.bold && e.italic ? "***" : e.bold ? "**" : e.italic ? "*" : "";
|
|
145
145
|
return t + e.text + t;
|
|
146
146
|
}).join("");
|
|
147
147
|
return (e.bullet ? "- " : "") + t;
|
|
148
148
|
}).join("\n");
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
150
|
+
function ke(e) {
|
|
151
|
+
return A(e).map((e) => (e.bullet ? "• " : "") + e.runs.map((e) => e.text).join("")).join("\n");
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Ae(e) {
|
|
154
154
|
let t = [], n = "", r = () => {
|
|
155
155
|
n && t.push({
|
|
156
156
|
text: n,
|
|
@@ -159,17 +159,17 @@ function je(e) {
|
|
|
159
159
|
}), n = "";
|
|
160
160
|
}, i = 0;
|
|
161
161
|
for (; i < e.length;) {
|
|
162
|
-
let a = e[i] === "*" ?
|
|
162
|
+
let a = e[i] === "*" ? je(e, i) : void 0;
|
|
163
163
|
a ? (r(), t.push({
|
|
164
164
|
text: a.content,
|
|
165
165
|
bold: a.bold,
|
|
166
166
|
italic: a.italic
|
|
167
167
|
}), i = a.end) : (n += e[i], i++);
|
|
168
168
|
}
|
|
169
|
-
return r(),
|
|
169
|
+
return r(), Me(t);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
for (let { marker: n, bold: r, italic: i } of
|
|
171
|
+
function je(e, t) {
|
|
172
|
+
for (let { marker: n, bold: r, italic: i } of De) {
|
|
173
173
|
if (!e.startsWith(n, t)) continue;
|
|
174
174
|
let a = e.indexOf(n, t + n.length);
|
|
175
175
|
if (!(a <= t + n.length)) return {
|
|
@@ -180,7 +180,7 @@ function Me(e, t) {
|
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Me(e) {
|
|
184
184
|
let t = [];
|
|
185
185
|
for (let n of e) {
|
|
186
186
|
if (!n.text) continue;
|
|
@@ -195,7 +195,7 @@ function Ne(e) {
|
|
|
195
195
|
}
|
|
196
196
|
//#endregion
|
|
197
197
|
//#region src/draw/styles.ts
|
|
198
|
-
var
|
|
198
|
+
var j = {
|
|
199
199
|
event: {
|
|
200
200
|
label: "Domain Event",
|
|
201
201
|
width: 130,
|
|
@@ -252,128 +252,224 @@ var A = {
|
|
|
252
252
|
fill: "#E85D75",
|
|
253
253
|
stroke: "#C43B55"
|
|
254
254
|
}
|
|
255
|
-
},
|
|
255
|
+
}, M = {
|
|
256
256
|
label: "Note",
|
|
257
257
|
fill: "#ECECEC",
|
|
258
258
|
stroke: "#C4C4C4"
|
|
259
|
-
},
|
|
259
|
+
}, N = {
|
|
260
260
|
width: 60,
|
|
261
261
|
height: 40
|
|
262
|
-
},
|
|
263
|
-
width:
|
|
264
|
-
height:
|
|
262
|
+
}, P = 7.5, Ne = {
|
|
263
|
+
width: j.aggregate.width,
|
|
264
|
+
height: j.aggregate.height
|
|
265
265
|
};
|
|
266
|
-
function
|
|
267
|
-
let t =
|
|
266
|
+
function F(e) {
|
|
267
|
+
let t = ke(e), n = (t && t.length ? t : "note").split("\n"), r = Math.max(1, ...n.map((e) => e.length));
|
|
268
268
|
return {
|
|
269
269
|
lines: n,
|
|
270
|
-
width: Math.max(
|
|
271
|
-
height: Math.max(
|
|
270
|
+
width: Math.max(Ne.width, Math.round(r * P) + 16),
|
|
271
|
+
height: Math.max(Ne.height, n.length * 17 + 16)
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
let n =
|
|
274
|
+
function I(e, t) {
|
|
275
|
+
let n = F(e);
|
|
276
276
|
return t.width !== n.width || t.height !== n.height;
|
|
277
277
|
}
|
|
278
|
-
var
|
|
279
|
-
paper:
|
|
280
|
-
ink:
|
|
278
|
+
var L = {
|
|
279
|
+
paper: k.grau,
|
|
280
|
+
ink: k.schwarz,
|
|
281
281
|
inkSoft: "#5B5B5B",
|
|
282
|
-
surface:
|
|
283
|
-
stroke:
|
|
282
|
+
surface: k.weiss,
|
|
283
|
+
stroke: k.schwarz,
|
|
284
284
|
arrow: "#9E9E9E",
|
|
285
|
-
accent:
|
|
285
|
+
accent: k.blau,
|
|
286
286
|
accentSoft: "rgba(51,93,229,0.12)",
|
|
287
|
-
stickyText:
|
|
288
|
-
},
|
|
287
|
+
stickyText: k.schwarz
|
|
288
|
+
}, R = k.schwarz, z = {
|
|
289
289
|
family: "'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif",
|
|
290
290
|
label: 13
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
}, Pe = "geometricPrecision", B = `italic 11px ${z.family}`;
|
|
292
|
+
function V(e) {
|
|
293
|
+
return {
|
|
294
|
+
x: e.x + e.width / 2,
|
|
295
|
+
y: e.y + e.height / 2
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function Fe(e, t) {
|
|
299
|
+
let n = V(e), r = t.x - n.x, i = t.y - n.y;
|
|
300
|
+
if (r === 0 && i === 0) return n;
|
|
301
|
+
let a = e.width / 2 + 2, o = e.height / 2 + 2, s = Math.min(r === 0 ? Infinity : a / Math.abs(r), i === 0 ? Infinity : o / Math.abs(i));
|
|
302
|
+
return {
|
|
303
|
+
x: n.x + r * s,
|
|
304
|
+
y: n.y + i * s
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function Ie(e) {
|
|
308
|
+
let t = e.source, n = e.target, r = e.waypoints;
|
|
309
|
+
if (!t || !n) {
|
|
310
|
+
let e = r[0] ?? {
|
|
311
|
+
x: 0,
|
|
312
|
+
y: 0
|
|
313
|
+
};
|
|
314
|
+
return [e, r[r.length - 1] ?? e];
|
|
315
|
+
}
|
|
316
|
+
let i = V(t), a = V(n), o = Fe(t, a), s = Fe(n, i);
|
|
317
|
+
return (a.x - i.x) * (s.x - o.x) + (a.y - i.y) * (s.y - o.y) <= 0 ? [i, a] : [o, s];
|
|
318
|
+
}
|
|
319
|
+
function Le(e) {
|
|
320
|
+
let [t, n] = Ie(e);
|
|
321
|
+
return {
|
|
322
|
+
x: (t.x + n.x) / 2,
|
|
323
|
+
y: (t.y + n.y) / 2 - 5
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function Re(e) {
|
|
327
|
+
if (e.eventStormingType !== "hotspot") return {
|
|
328
|
+
x: e.x,
|
|
329
|
+
y: e.y,
|
|
330
|
+
width: e.width,
|
|
331
|
+
height: e.height
|
|
332
|
+
};
|
|
333
|
+
let t = Math.abs(-3 * Math.PI / 180), n = e.width * Math.cos(t) + e.height * Math.sin(t), r = e.width * Math.sin(t) + e.height * Math.cos(t), i = V(e);
|
|
334
|
+
return {
|
|
335
|
+
x: i.x - n / 2,
|
|
336
|
+
y: i.y - r / 2,
|
|
337
|
+
width: n,
|
|
338
|
+
height: r
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
function ze(e) {
|
|
342
|
+
if (!e.linkLabel) return;
|
|
343
|
+
let t = Le(e), { advance: n, left: r, right: i, ascent: a, descent: o } = We(e.linkLabel);
|
|
344
|
+
return {
|
|
345
|
+
x: t.x - n / 2 + r,
|
|
346
|
+
y: t.y - a,
|
|
347
|
+
width: i - r,
|
|
348
|
+
height: a + o
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
var Be;
|
|
352
|
+
function Ve() {
|
|
353
|
+
return Be ??= typeof document < "u" && typeof CanvasRenderingContext2D < "u" ? document.createElement("canvas").getContext("2d") : null, Be;
|
|
354
|
+
}
|
|
355
|
+
function He(e) {
|
|
356
|
+
if (e.length === 0 || typeof document > "u" || !("fonts" in document)) return;
|
|
357
|
+
let t = e.join(" ");
|
|
358
|
+
if (!document.fonts.check(B, t)) return document.fonts.load(B, t).then(() => void 0, () => void 0);
|
|
359
|
+
}
|
|
360
|
+
function Ue(e) {
|
|
361
|
+
return e.replace(/[ \t\n\r]+/g, " ").replace(/^ | $/g, "");
|
|
362
|
+
}
|
|
363
|
+
function We(e) {
|
|
364
|
+
let t = Ue(e), n = Ve();
|
|
365
|
+
if (!n) {
|
|
366
|
+
let e = t.length * 11 * (P / z.label);
|
|
367
|
+
return {
|
|
368
|
+
advance: e,
|
|
369
|
+
left: 0,
|
|
370
|
+
right: e,
|
|
371
|
+
ascent: 11,
|
|
372
|
+
descent: 11 / 4
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
n.font = B, n.textRendering = Pe;
|
|
376
|
+
let r = n.measureText(t);
|
|
377
|
+
return {
|
|
378
|
+
advance: r.width,
|
|
379
|
+
left: Math.min(0, -r.actualBoundingBoxLeft),
|
|
380
|
+
right: Math.max(r.width, r.actualBoundingBoxRight),
|
|
381
|
+
ascent: r.fontBoundingBoxAscent,
|
|
382
|
+
descent: r.fontBoundingBoxDescent
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
//#endregion
|
|
386
|
+
//#region src/draw/palette-icons.ts
|
|
387
|
+
var Ge = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="event-storming-palette-svg">${e}</svg>`, Ke = (e, t, n = 0) => Ge(`<rect x="4" y="5" width="16" height="14" fill="${e}" stroke="${t}" stroke-width="1.5"${n ? ` transform="rotate(${n} 12 12)"` : ""}/>`), qe = (e) => `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="event-storming-palette-svg">${e}</svg>`, H = {
|
|
388
|
+
draw: qe("<circle cx=\"19\" cy=\"5\" r=\"2\"/><circle cx=\"5\" cy=\"19\" r=\"2\"/><path d=\"M6.5 17.5 17.5 6.5\"/>"),
|
|
389
|
+
lasso: qe("<path d=\"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z\"/><path d=\"M5 3a2 2 0 0 0-2 2\"/><path d=\"M19 3a2 2 0 0 1 2 2\"/><path d=\"M5 21a2 2 0 0 1-2-2\"/><path d=\"M9 3h1\"/><path d=\"M9 21h2\"/><path d=\"M14 3h1\"/><path d=\"M3 9v1\"/><path d=\"M21 9v2\"/><path d=\"M3 14v1\"/>"),
|
|
390
|
+
note: Ke(M.fill, M.stroke)
|
|
295
391
|
};
|
|
296
|
-
for (let e of
|
|
297
|
-
let t =
|
|
298
|
-
|
|
392
|
+
for (let e of S) {
|
|
393
|
+
let t = j[e];
|
|
394
|
+
H[e] = Ke(t.fill, t.stroke, e === "hotspot" ? -6 : 0);
|
|
299
395
|
}
|
|
300
|
-
function
|
|
396
|
+
function Je(e, t) {
|
|
301
397
|
return `<svg width="14" height="14" viewBox="0 0 14 14" class="event-storming-palette-svg"><rect x="1" y="1" width="12" height="12" fill="${e}" stroke="${t}" stroke-width="1"/></svg>`;
|
|
302
398
|
}
|
|
303
399
|
//#endregion
|
|
304
400
|
//#region src/palette/EventStormingPaletteProvider.ts
|
|
305
|
-
function
|
|
401
|
+
function Ye(e) {
|
|
306
402
|
if (e.freeArea) return e.freeArea;
|
|
307
403
|
let t = e.freeRectInsets;
|
|
308
404
|
return t ? { insets: t } : void 0;
|
|
309
405
|
}
|
|
310
|
-
var
|
|
406
|
+
var Xe = 24, U = "stickies-1", Ze = "stickies-2", Qe = "stickies-3", $e = [
|
|
311
407
|
{
|
|
312
408
|
key: "event",
|
|
313
409
|
type: "event",
|
|
314
|
-
label:
|
|
410
|
+
label: j.event.label,
|
|
315
411
|
title: "Domain event",
|
|
316
412
|
shortcut: "E",
|
|
317
|
-
group:
|
|
413
|
+
group: U
|
|
318
414
|
},
|
|
319
415
|
{
|
|
320
416
|
key: "command",
|
|
321
417
|
type: "command",
|
|
322
|
-
label:
|
|
418
|
+
label: j.command.label,
|
|
323
419
|
title: "Command",
|
|
324
420
|
shortcut: "C",
|
|
325
|
-
group:
|
|
421
|
+
group: U
|
|
326
422
|
},
|
|
327
423
|
{
|
|
328
424
|
key: "actor",
|
|
329
425
|
type: "actor",
|
|
330
|
-
label:
|
|
426
|
+
label: j.actor.label,
|
|
331
427
|
title: "Actor",
|
|
332
|
-
group:
|
|
428
|
+
group: U
|
|
333
429
|
},
|
|
334
430
|
{
|
|
335
431
|
key: "aggregate",
|
|
336
432
|
type: "aggregate",
|
|
337
|
-
label:
|
|
433
|
+
label: j.aggregate.label,
|
|
338
434
|
title: "Aggregate",
|
|
339
|
-
group:
|
|
435
|
+
group: U
|
|
340
436
|
},
|
|
341
437
|
{
|
|
342
438
|
key: "policy",
|
|
343
439
|
type: "policy",
|
|
344
|
-
label:
|
|
440
|
+
label: j.policy.label,
|
|
345
441
|
title: "Policy",
|
|
346
|
-
group:
|
|
442
|
+
group: Ze
|
|
347
443
|
},
|
|
348
444
|
{
|
|
349
445
|
key: "readmodel",
|
|
350
446
|
type: "readmodel",
|
|
351
|
-
label:
|
|
447
|
+
label: j.readmodel.label,
|
|
352
448
|
title: "Read model",
|
|
353
|
-
group:
|
|
449
|
+
group: Ze
|
|
354
450
|
},
|
|
355
451
|
{
|
|
356
452
|
key: "external",
|
|
357
453
|
type: "external",
|
|
358
|
-
label:
|
|
454
|
+
label: j.external.label,
|
|
359
455
|
title: "External system",
|
|
360
|
-
group:
|
|
456
|
+
group: Ze
|
|
361
457
|
},
|
|
362
458
|
{
|
|
363
459
|
key: "hotspot",
|
|
364
460
|
type: "hotspot",
|
|
365
|
-
label:
|
|
461
|
+
label: j.hotspot.label,
|
|
366
462
|
title: "Hotspot",
|
|
367
|
-
group:
|
|
463
|
+
group: Qe
|
|
368
464
|
},
|
|
369
465
|
{
|
|
370
466
|
key: "note",
|
|
371
467
|
type: "note",
|
|
372
|
-
label:
|
|
468
|
+
label: M.label,
|
|
373
469
|
title: "Note",
|
|
374
|
-
group:
|
|
470
|
+
group: Qe
|
|
375
471
|
}
|
|
376
|
-
],
|
|
472
|
+
], et = class {
|
|
377
473
|
create;
|
|
378
474
|
factory;
|
|
379
475
|
lassoTool;
|
|
@@ -413,26 +509,26 @@ var Be = 24, B = "stickies-1", V = "stickies-2", Ve = "stickies-3", He = [
|
|
|
413
509
|
group: "tools",
|
|
414
510
|
title: "Lasso",
|
|
415
511
|
shortcut: "L",
|
|
416
|
-
html: `<div class="entry event-storming-palette-entry">${
|
|
512
|
+
html: `<div class="entry event-storming-palette-entry">${H.lasso}</div>`,
|
|
417
513
|
action: { click: (e) => this.lassoTool.activateSelection(e) }
|
|
418
514
|
}, e["draw-tool"] = {
|
|
419
515
|
group: "tools",
|
|
420
516
|
title: "Draw",
|
|
421
|
-
html: `<div class="entry event-storming-palette-entry">${
|
|
517
|
+
html: `<div class="entry event-storming-palette-entry">${H.draw}</div>`,
|
|
422
518
|
action: { click: () => this.drawTool.toggle() }
|
|
423
519
|
};
|
|
424
520
|
let t = o[this.eventStormingModeling.getLevel()];
|
|
425
|
-
for (let n of
|
|
521
|
+
for (let n of $e) {
|
|
426
522
|
if (n.type !== "note" && !t.includes(n.type)) continue;
|
|
427
523
|
let r = (e) => {
|
|
428
524
|
let t = this.factory.createNew(n.type, n.label);
|
|
429
|
-
|
|
525
|
+
tt(e) && this.placeInFreeRect(t) || this.create.start(e, t);
|
|
430
526
|
};
|
|
431
527
|
e[`create.${n.key}`] = {
|
|
432
528
|
group: n.group,
|
|
433
529
|
title: n.title,
|
|
434
530
|
...n.shortcut ? { shortcut: n.shortcut } : {},
|
|
435
|
-
html: `<div class="entry event-storming-palette-entry" draggable="true">${
|
|
531
|
+
html: `<div class="entry event-storming-palette-entry" draggable="true">${H[n.key]}</div>`,
|
|
436
532
|
action: {
|
|
437
533
|
dragstart: r,
|
|
438
534
|
click: r
|
|
@@ -444,13 +540,13 @@ var Be = 24, B = "stickies-1", V = "stickies-2", Ve = "stickies-3", He = [
|
|
|
444
540
|
placeInFreeRect(e) {
|
|
445
541
|
let { canvas: t, modeling: n, selection: r, elementRegistry: i } = this;
|
|
446
542
|
if (!t || !n || !r || !i) return !1;
|
|
447
|
-
let a = this.freeAreaCentre(t), o = (e) => i.filter(
|
|
448
|
-
for (; o(a);) a.x +=
|
|
543
|
+
let a = this.freeAreaCentre(t), o = (e) => i.filter(b).some((t) => Math.abs(t.x + t.width / 2 - e.x) < 1 && Math.abs(t.y + t.height / 2 - e.y) < 1);
|
|
544
|
+
for (; o(a);) a.x += Xe, a.y += Xe;
|
|
449
545
|
let s = n.createShape(e, a, t.getRootElement());
|
|
450
546
|
return r.select(s), t.focus(), this.labelEditing?.activate(s), !0;
|
|
451
547
|
}
|
|
452
548
|
freeAreaCentre(e) {
|
|
453
|
-
let t = this.config &&
|
|
549
|
+
let t = this.config && Ye(this.config), n = t?.center?.();
|
|
454
550
|
if (n) return {
|
|
455
551
|
x: n.x,
|
|
456
552
|
y: n.y
|
|
@@ -467,27 +563,31 @@ var Be = 24, B = "stickies-1", V = "stickies-2", Ve = "stickies-3", He = [
|
|
|
467
563
|
};
|
|
468
564
|
}
|
|
469
565
|
};
|
|
470
|
-
function
|
|
566
|
+
function tt(e) {
|
|
471
567
|
return e.type === "click" && e.detail === 0;
|
|
472
568
|
}
|
|
473
569
|
//#endregion
|
|
474
570
|
//#region src/EventStormingBaseViewer.ts
|
|
475
|
-
function
|
|
571
|
+
function nt(e) {
|
|
476
572
|
for (let { id: t } of [...e.elements, ...e.edges]) if (t === "event-storming-root" || t.startsWith("__implicitroot")) throw Error(`Element id "${t}" is reserved for the board itself.`);
|
|
477
573
|
}
|
|
478
|
-
function
|
|
574
|
+
function rt(e) {
|
|
575
|
+
return e.edges.flatMap((e) => e.label ? [e.label] : []);
|
|
576
|
+
}
|
|
577
|
+
function it(e) {
|
|
479
578
|
return typeof e == "number" ? `${e}px` : e;
|
|
480
579
|
}
|
|
481
|
-
var
|
|
580
|
+
var at = class {
|
|
482
581
|
_diagram;
|
|
483
582
|
_container;
|
|
484
583
|
_options;
|
|
584
|
+
_waitingImport;
|
|
485
585
|
constructor(e = {}) {
|
|
486
586
|
this._options = e, this._container = this._createContainer(e);
|
|
487
587
|
}
|
|
488
588
|
_createContainer(e) {
|
|
489
589
|
let t = e.container ?? document.createElement("div");
|
|
490
|
-
return t.classList.add("event-storming-container"), t.style.width =
|
|
590
|
+
return t.classList.add("event-storming-container"), t.style.width = it(e.width ?? "100%"), t.style.height = it(e.height ?? (e.container ? "100%" : "600px")), t;
|
|
491
591
|
}
|
|
492
592
|
_ensureDiagram() {
|
|
493
593
|
if (!this._diagram) {
|
|
@@ -496,7 +596,7 @@ var qe = class {
|
|
|
496
596
|
canvas: { container: this._container },
|
|
497
597
|
modules: t,
|
|
498
598
|
eventStormingKeyboard: { undoRedoKeys: this._options.undoRedoKeys ?? !0 },
|
|
499
|
-
eventStormingPalette: { freeArea:
|
|
599
|
+
eventStormingPalette: { freeArea: Ye(this._options) },
|
|
500
600
|
eventStormingImporter: { fitOnImport: this._options.fitOnImport ?? !0 }
|
|
501
601
|
});
|
|
502
602
|
}
|
|
@@ -513,11 +613,19 @@ var qe = class {
|
|
|
513
613
|
}
|
|
514
614
|
async importMap(e) {
|
|
515
615
|
let t = this._ensureDiagram(), n = t.get("eventBus"), r = t.get("eventStormingImporter");
|
|
516
|
-
|
|
517
|
-
let i =
|
|
518
|
-
i
|
|
519
|
-
let a =
|
|
520
|
-
|
|
616
|
+
nt(e), s(e);
|
|
617
|
+
let i = this._importTurn(e);
|
|
618
|
+
if (i && (await i, this._waitingImport === i && (this._waitingImport = void 0), this._diagram !== t)) throw Error("The viewer was destroyed during the import.");
|
|
619
|
+
let a = t.get("eventStormingLabelEditing", !1);
|
|
620
|
+
a?.suspend(), t.get("popupMenu", !1)?.close(), r.clear();
|
|
621
|
+
let o = r.import(e);
|
|
622
|
+
return t.get("commandStack", !1)?.clear(!1), n.fire("import.done", { warnings: o }), a?.resumeAfterImport(), { warnings: o };
|
|
623
|
+
}
|
|
624
|
+
_importTurn(e) {
|
|
625
|
+
let t = [this._waitingImport, He(rt(e))].filter((e) => e !== void 0);
|
|
626
|
+
if (t.length === 0) return;
|
|
627
|
+
let n = Promise.all(t);
|
|
628
|
+
return this._waitingImport = n, n;
|
|
521
629
|
}
|
|
522
630
|
async importDSL(e) {
|
|
523
631
|
let t = this._ensureDiagram().get("eventBus");
|
|
@@ -540,8 +648,13 @@ var qe = class {
|
|
|
540
648
|
exportDSL() {
|
|
541
649
|
return u(this.exportMap());
|
|
542
650
|
}
|
|
651
|
+
contentBounds() {
|
|
652
|
+
if (!this._diagram) return;
|
|
653
|
+
let e = this._diagram.get("boardBounds");
|
|
654
|
+
return e.isEmpty() ? void 0 : e.contentBounds(0);
|
|
655
|
+
}
|
|
543
656
|
async saveSVG() {
|
|
544
|
-
return
|
|
657
|
+
return Ce(this.get("canvas"), this.get("boardBounds").contentBounds());
|
|
545
658
|
}
|
|
546
659
|
attachTo(e) {
|
|
547
660
|
e.appendChild(this._container), this.get("canvas").resized();
|
|
@@ -558,15 +671,15 @@ var qe = class {
|
|
|
558
671
|
get container() {
|
|
559
672
|
return this._container;
|
|
560
673
|
}
|
|
561
|
-
},
|
|
562
|
-
function
|
|
674
|
+
}, ot = "0123456789abcdefghijklmnopqrstuvwxyz", st = 252;
|
|
675
|
+
function ct() {
|
|
563
676
|
let e = "";
|
|
564
|
-
for (; e.length < 8;) for (let t of globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8))) t >=
|
|
677
|
+
for (; e.length < 8;) for (let t of globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8))) t >= st || e.length === 8 || (e += ot[t % 36]);
|
|
565
678
|
return e;
|
|
566
679
|
}
|
|
567
680
|
//#endregion
|
|
568
681
|
//#region src/model/EventStormingElementFactory.ts
|
|
569
|
-
var
|
|
682
|
+
var lt = {
|
|
570
683
|
event: "event",
|
|
571
684
|
command: "cmd",
|
|
572
685
|
actor: "actor",
|
|
@@ -577,7 +690,7 @@ var Ze = {
|
|
|
577
690
|
hotspot: "hot",
|
|
578
691
|
note: "note",
|
|
579
692
|
drawing: "draw"
|
|
580
|
-
},
|
|
693
|
+
}, ut = class {
|
|
581
694
|
elementFactory;
|
|
582
695
|
elementRegistry;
|
|
583
696
|
static $inject = ["elementFactory", "elementRegistry"];
|
|
@@ -596,15 +709,15 @@ var Ze = {
|
|
|
596
709
|
return `${e} ${n}`;
|
|
597
710
|
}
|
|
598
711
|
allocateId(e, t) {
|
|
599
|
-
let n =
|
|
712
|
+
let n = lt[e];
|
|
600
713
|
for (;;) {
|
|
601
|
-
let e = `${n}_${
|
|
714
|
+
let e = `${n}_${ct()}`;
|
|
602
715
|
if (!this.elementRegistry.get(e) && !t?.has(e)) return e;
|
|
603
716
|
}
|
|
604
717
|
}
|
|
605
718
|
createSticky(e) {
|
|
606
|
-
if (!
|
|
607
|
-
let { width: t, height: n } =
|
|
719
|
+
if (!C(e.elementType)) throw Error(`not a sticky kind: ${e.elementType}`);
|
|
720
|
+
let { width: t, height: n } = j[e.elementType];
|
|
608
721
|
return this.elementFactory.createShape({
|
|
609
722
|
id: e.id,
|
|
610
723
|
x: e.position.x - t / 2,
|
|
@@ -618,7 +731,7 @@ var Ze = {
|
|
|
618
731
|
});
|
|
619
732
|
}
|
|
620
733
|
createNote(e) {
|
|
621
|
-
let { width: t, height: n } = e.size ??
|
|
734
|
+
let { width: t, height: n } = e.size ?? F(e.label), r = e.align?.horizontal, i = e.align?.vertical;
|
|
622
735
|
return this.elementFactory.createShape({
|
|
623
736
|
id: e.id,
|
|
624
737
|
x: e.position.x - t / 2,
|
|
@@ -663,7 +776,7 @@ var Ze = {
|
|
|
663
776
|
});
|
|
664
777
|
}
|
|
665
778
|
createNew(e, t) {
|
|
666
|
-
let n = this.uniqueLabel(t), { width: r, height: i } =
|
|
779
|
+
let n = this.uniqueLabel(t), { width: r, height: i } = C(e) ? j[e] : F(n);
|
|
667
780
|
return this.elementFactory.createShape({
|
|
668
781
|
id: this.allocateId(e),
|
|
669
782
|
width: r,
|
|
@@ -673,7 +786,7 @@ var Ze = {
|
|
|
673
786
|
});
|
|
674
787
|
}
|
|
675
788
|
createProvisional() {
|
|
676
|
-
let { width: e, height: t } =
|
|
789
|
+
let { width: e, height: t } = j.event;
|
|
677
790
|
return this.elementFactory.createShape({
|
|
678
791
|
id: this.allocateId("event"),
|
|
679
792
|
width: e,
|
|
@@ -688,14 +801,14 @@ var Ze = {
|
|
|
688
801
|
id: e.id,
|
|
689
802
|
source: t,
|
|
690
803
|
target: n,
|
|
691
|
-
waypoints: [
|
|
804
|
+
waypoints: [dt(t), dt(n)],
|
|
692
805
|
eventStormingType: "arrow",
|
|
693
806
|
...e.label ? { linkLabel: e.label } : {},
|
|
694
807
|
businessObject: e
|
|
695
808
|
});
|
|
696
809
|
}
|
|
697
810
|
};
|
|
698
|
-
function
|
|
811
|
+
function dt(e) {
|
|
699
812
|
return {
|
|
700
813
|
x: e.x + e.width / 2,
|
|
701
814
|
y: e.y + e.height / 2
|
|
@@ -703,149 +816,97 @@ function $e(e) {
|
|
|
703
816
|
}
|
|
704
817
|
//#endregion
|
|
705
818
|
//#region src/model/index.ts
|
|
706
|
-
var
|
|
707
|
-
|
|
708
|
-
//#region src/board-bounds/BoardBounds.ts
|
|
709
|
-
function tt(e) {
|
|
710
|
-
return e.id !== "event-storming-root" && !e.waypoints && typeof e.x == "number" && typeof e.y == "number" && typeof e.width == "number" && typeof e.height == "number";
|
|
711
|
-
}
|
|
712
|
-
var nt = class {
|
|
713
|
-
elementRegistry;
|
|
714
|
-
static $inject = ["elementRegistry"];
|
|
715
|
-
constructor(e) {
|
|
716
|
-
this.elementRegistry = e;
|
|
717
|
-
}
|
|
718
|
-
contentBounds(e = 120) {
|
|
719
|
-
let t = this.positionedShapes();
|
|
720
|
-
if (!t.length) return {
|
|
721
|
-
x: 0,
|
|
722
|
-
y: 0,
|
|
723
|
-
...i
|
|
724
|
-
};
|
|
725
|
-
let n = Math.min(...t.map((e) => e.x)), r = Math.min(...t.map((e) => e.y)), a = Math.max(...t.map((e) => e.x + e.width)), o = Math.max(...t.map((e) => e.y + e.height));
|
|
726
|
-
return {
|
|
727
|
-
x: n - e,
|
|
728
|
-
y: r - e,
|
|
729
|
-
width: a - n + 2 * e,
|
|
730
|
-
height: o - r + 2 * e
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
isEmpty() {
|
|
734
|
-
return this.positionedShapes().length === 0;
|
|
735
|
-
}
|
|
736
|
-
positionedShapes() {
|
|
737
|
-
return this.elementRegistry.getAll().filter(tt);
|
|
738
|
-
}
|
|
739
|
-
}, rt = { boardBounds: ["type", nt] }, it = "eventStorming.viewOptions.changed", at = class {
|
|
740
|
-
eventBus;
|
|
741
|
-
elementRegistry;
|
|
742
|
-
static $inject = ["eventBus", "elementRegistry"];
|
|
743
|
-
_typeCaptionsVisible = !0;
|
|
744
|
-
constructor(e, t) {
|
|
745
|
-
this.eventBus = e, this.elementRegistry = t;
|
|
746
|
-
}
|
|
747
|
-
typeCaptionsVisible() {
|
|
748
|
-
return this._typeCaptionsVisible;
|
|
749
|
-
}
|
|
750
|
-
setTypeCaptionsVisible(e) {
|
|
751
|
-
if (e === this._typeCaptionsVisible) return;
|
|
752
|
-
this._typeCaptionsVisible = e, this.eventBus.fire(it, { typeCaptionsVisible: e });
|
|
753
|
-
let t = this.elementRegistry.filter(C);
|
|
754
|
-
t.length && this.eventBus.fire("elements.changed", { elements: t });
|
|
755
|
-
}
|
|
756
|
-
}, H = {
|
|
757
|
-
__depends__: [d],
|
|
758
|
-
eventStormingViewOptions: ["type", at]
|
|
759
|
-
}, ot = 1500, st = -3, ct = "event-storming-kind-caption", lt = 9, ut = 300, dt = F.stickyText, ft = 7, pt = "#FBFBFB", mt = "#B9B9B9", ht = "6 4", gt = "event-storming-sticky-shadow";
|
|
760
|
-
function _t(e) {
|
|
819
|
+
var ft = { eventStormingElementFactory: ["type", ut] }, pt = 1500, mt = "event-storming-kind-caption", ht = 9, gt = 300, _t = L.stickyText, vt = 7, yt = "#FBFBFB", bt = "#B9B9B9", xt = "6 4", St = "event-storming-sticky-shadow";
|
|
820
|
+
function Ct(e) {
|
|
761
821
|
let t = e.closest("svg");
|
|
762
822
|
if (!t) return !1;
|
|
763
823
|
if (t.querySelector("#event-storming-sticky-shadow")) return !0;
|
|
764
|
-
let n = m(
|
|
824
|
+
let n = p(m("feDropShadow"), {
|
|
765
825
|
dx: 0,
|
|
766
826
|
dy: 5,
|
|
767
827
|
stdDeviation: 5,
|
|
768
828
|
"flood-color": "#000000",
|
|
769
829
|
"flood-opacity": .2
|
|
770
|
-
}), r = m(
|
|
771
|
-
id:
|
|
830
|
+
}), r = p(m("filter"), {
|
|
831
|
+
id: St,
|
|
772
832
|
x: "-40%",
|
|
773
833
|
y: "-40%",
|
|
774
834
|
width: "180%",
|
|
775
835
|
height: "180%"
|
|
776
836
|
});
|
|
777
|
-
|
|
778
|
-
let i =
|
|
779
|
-
return
|
|
837
|
+
f(r, n);
|
|
838
|
+
let i = m("defs");
|
|
839
|
+
return f(i, r), t.insertBefore(i, t.firstChild), !0;
|
|
780
840
|
}
|
|
781
|
-
var
|
|
841
|
+
var wt = class extends d {
|
|
782
842
|
viewOptions;
|
|
783
843
|
static $inject = ["eventBus", "eventStormingViewOptions"];
|
|
784
844
|
constructor(e, t) {
|
|
785
|
-
super(e,
|
|
845
|
+
super(e, pt), this.viewOptions = t;
|
|
786
846
|
}
|
|
787
847
|
canRender(e) {
|
|
788
|
-
return
|
|
848
|
+
return b(e) || x(e);
|
|
789
849
|
}
|
|
790
850
|
drawShape(e, t) {
|
|
791
851
|
let n = t;
|
|
792
852
|
return n.eventStormingType === "drawing" ? this.drawDrawing(e, n) : this.drawSticky(e, n);
|
|
793
853
|
}
|
|
794
854
|
drawDrawing(e, t) {
|
|
795
|
-
let n = t.drawingPoints ?? [], r = t.strokeStyle === "dashed" ? "8 5" : t.strokeStyle === "dotted" ? "2 4" : void 0, i = m(
|
|
855
|
+
let n = t.drawingPoints ?? [], r = t.strokeStyle === "dashed" ? "8 5" : t.strokeStyle === "dotted" ? "2 4" : void 0, i = p(m(t.closed ? "polygon" : "polyline"), {
|
|
796
856
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
797
857
|
fill: "none",
|
|
798
|
-
stroke: t.color ??
|
|
858
|
+
stroke: t.color ?? R,
|
|
799
859
|
"stroke-width": 2,
|
|
800
860
|
"stroke-linecap": "round",
|
|
801
861
|
"stroke-linejoin": "round",
|
|
802
862
|
...r ? { "stroke-dasharray": r } : {}
|
|
803
863
|
});
|
|
804
|
-
return
|
|
864
|
+
return f(e, i), i;
|
|
805
865
|
}
|
|
806
866
|
drawSticky(e, t) {
|
|
807
|
-
let n = t.eventStormingType, r =
|
|
867
|
+
let n = t.eventStormingType, r = C(n) ? j[n] : M, i = t.provisional === !0, a = e;
|
|
808
868
|
if (n === "hotspot") {
|
|
809
|
-
let n = m(
|
|
810
|
-
|
|
869
|
+
let n = p(m("g"), { transform: `rotate(-3 ${t.width / 2} ${t.height / 2})` });
|
|
870
|
+
f(e, n), a = n;
|
|
811
871
|
}
|
|
812
|
-
let o = m(
|
|
872
|
+
let o = p(m("rect"), {
|
|
813
873
|
x: 0,
|
|
814
874
|
y: 0,
|
|
815
875
|
width: Math.max(t.width, 1),
|
|
816
876
|
height: Math.max(t.height, 1),
|
|
817
877
|
rx: 0,
|
|
818
|
-
fill: i ?
|
|
819
|
-
stroke: i ?
|
|
878
|
+
fill: i ? yt : t.color ?? r.fill,
|
|
879
|
+
stroke: i ? bt : r.stroke,
|
|
820
880
|
"stroke-width": 1.5,
|
|
821
|
-
...i ? { "stroke-dasharray":
|
|
881
|
+
...i ? { "stroke-dasharray": xt } : {}
|
|
822
882
|
});
|
|
823
|
-
if (
|
|
824
|
-
if (n === "note" ?
|
|
825
|
-
let e =
|
|
883
|
+
if (Ct(e) && o.setAttribute("filter", `url(#${St})`), f(a, o), i) return o;
|
|
884
|
+
if (n === "note" ? kt(a, t) : Et(a, t), C(n) && this.viewOptions.typeCaptionsVisible()) {
|
|
885
|
+
let e = Pt(j[n].label, t.width / 2, t.height - vt, {
|
|
826
886
|
"text-anchor": "middle",
|
|
827
|
-
"font-size":
|
|
828
|
-
fill:
|
|
887
|
+
"font-size": ht,
|
|
888
|
+
fill: _t
|
|
829
889
|
});
|
|
830
|
-
e.setAttribute("class",
|
|
890
|
+
e.setAttribute("class", mt), e.setAttribute("font-weight", String(gt)), f(a, e);
|
|
831
891
|
}
|
|
832
892
|
return o;
|
|
833
893
|
}
|
|
834
894
|
drawConnection(e, t) {
|
|
835
|
-
let n = t, [r, i] =
|
|
895
|
+
let n = t, [r, i] = Ie(n), a = p(m("polyline"), {
|
|
836
896
|
points: `${r.x},${r.y} ${i.x},${i.y}`,
|
|
837
897
|
fill: "none",
|
|
838
|
-
stroke:
|
|
898
|
+
stroke: L.arrow,
|
|
839
899
|
"stroke-width": 1.5,
|
|
840
900
|
"stroke-linecap": "round"
|
|
841
901
|
});
|
|
842
|
-
if (
|
|
843
|
-
let t = (
|
|
844
|
-
|
|
902
|
+
if (f(e, a), f(e, Ft(r, i, L.arrow, 11, 5)), n.linkLabel) {
|
|
903
|
+
let t = Le(n);
|
|
904
|
+
f(e, Pt(n.linkLabel, t.x, t.y, {
|
|
845
905
|
"text-anchor": "middle",
|
|
846
906
|
"font-size": 11,
|
|
847
907
|
"font-style": "italic",
|
|
848
|
-
|
|
908
|
+
"text-rendering": Pe,
|
|
909
|
+
fill: L.inkSoft
|
|
849
910
|
}));
|
|
850
911
|
}
|
|
851
912
|
return a;
|
|
@@ -859,7 +920,7 @@ var vt = class extends f {
|
|
|
859
920
|
return t ? `M${t.x},${t.y}` + n.map((e) => `L${e.x},${e.y}`).join("") : "";
|
|
860
921
|
}
|
|
861
922
|
};
|
|
862
|
-
function
|
|
923
|
+
function Tt(e, t) {
|
|
863
924
|
let n = e.split(/\s+/).filter((e) => e.length);
|
|
864
925
|
if (!n.length) return [""];
|
|
865
926
|
let r = [], i = "";
|
|
@@ -876,25 +937,25 @@ function yt(e, t) {
|
|
|
876
937
|
}
|
|
877
938
|
return r.push(i), r;
|
|
878
939
|
}
|
|
879
|
-
function
|
|
880
|
-
let n = t.width - 16, r = Math.max(1, Math.floor(n /
|
|
940
|
+
function Et(e, t) {
|
|
941
|
+
let n = t.width - 16, r = Math.max(1, Math.floor(n / P)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = (t.eventStormingLabel ?? "").split("\n").flatMap((e) => Tt(e, r)).slice(0, i), o = t.width / 2, s = t.height / 2 - (a.length - 1) * 17 / 2 + 4;
|
|
881
942
|
a.forEach((t, n) => {
|
|
882
|
-
|
|
943
|
+
f(e, Pt(t, o, s + n * 17, {
|
|
883
944
|
"text-anchor": "middle",
|
|
884
|
-
fill:
|
|
945
|
+
fill: L.stickyText
|
|
885
946
|
}));
|
|
886
947
|
});
|
|
887
948
|
}
|
|
888
|
-
var
|
|
889
|
-
function
|
|
890
|
-
let n = t.width - 16, r = Math.max(1, Math.floor(n /
|
|
949
|
+
var Dt = 2, Ot = 12.5;
|
|
950
|
+
function kt(e, t) {
|
|
951
|
+
let n = t.width - 16, r = Math.max(1, Math.floor(n / P)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = A(t.eventStormingLabel ?? "").flatMap((e) => At(e, r)).slice(0, i), o = t.alignHorizontal ?? "left", s = t.alignVertical ?? "top", c = o === "left" ? "start" : o === "center" ? "middle" : "end", l = a.length * 17, u = s === "top" ? 8 : s === "middle" ? (t.height - l) / 2 : t.height - 8 - l;
|
|
891
952
|
a.forEach((n, r) => {
|
|
892
|
-
let i = o === "left" ? 8 + (n.indent ? 12 : 0) : o === "center" ? t.width / 2 : t.width - 8, a = m(
|
|
953
|
+
let i = o === "left" ? 8 + (n.indent ? 12 : 0) : o === "center" ? t.width / 2 : t.width - 8, a = p(m("text"), {
|
|
893
954
|
x: i,
|
|
894
|
-
y: u + r * 17 +
|
|
895
|
-
"font-family":
|
|
896
|
-
"font-size":
|
|
897
|
-
fill:
|
|
955
|
+
y: u + r * 17 + Ot,
|
|
956
|
+
"font-family": z.family,
|
|
957
|
+
"font-size": z.label,
|
|
958
|
+
fill: L.stickyText,
|
|
898
959
|
"text-anchor": c
|
|
899
960
|
}), s = n.marker ? [{
|
|
900
961
|
text: "• ",
|
|
@@ -902,25 +963,25 @@ function Ct(e, t) {
|
|
|
902
963
|
italic: !1
|
|
903
964
|
}, ...n.runs] : n.runs;
|
|
904
965
|
for (let e of s) {
|
|
905
|
-
let t =
|
|
906
|
-
t.textContent = e.text, e.bold && t.setAttribute("font-weight", "600"), e.italic && t.setAttribute("font-style", "italic"),
|
|
966
|
+
let t = m("tspan");
|
|
967
|
+
t.textContent = e.text, e.bold && t.setAttribute("font-weight", "600"), e.italic && t.setAttribute("font-style", "italic"), f(a, t);
|
|
907
968
|
}
|
|
908
|
-
|
|
969
|
+
f(e, a);
|
|
909
970
|
});
|
|
910
971
|
}
|
|
911
|
-
function
|
|
912
|
-
let n = Math.max(1, t - (e.bullet ?
|
|
913
|
-
return
|
|
972
|
+
function At(e, t) {
|
|
973
|
+
let n = Math.max(1, t - (e.bullet ? Dt : 0));
|
|
974
|
+
return jt(e.runs, n).map((t, n) => ({
|
|
914
975
|
runs: t,
|
|
915
976
|
marker: e.bullet && n === 0,
|
|
916
977
|
indent: e.bullet && n > 0
|
|
917
978
|
}));
|
|
918
979
|
}
|
|
919
|
-
function
|
|
980
|
+
function jt(e, t) {
|
|
920
981
|
let n = e.map((e) => e.text).join("");
|
|
921
|
-
return n.length <= t ? [e] :
|
|
982
|
+
return n.length <= t ? [e] : Mt(n, t).map(([t, n]) => Nt(e, t, n));
|
|
922
983
|
}
|
|
923
|
-
function
|
|
984
|
+
function Mt(e, t) {
|
|
924
985
|
let n = [...e.matchAll(/\S+/g)];
|
|
925
986
|
if (!n.length) return [[0, 0]];
|
|
926
987
|
let r = [], i = -1, a = -1, o = () => {
|
|
@@ -935,7 +996,7 @@ function Et(e, t) {
|
|
|
935
996
|
}
|
|
936
997
|
return o(), r;
|
|
937
998
|
}
|
|
938
|
-
function
|
|
999
|
+
function Nt(e, t, n) {
|
|
939
1000
|
let r = [], i = 0;
|
|
940
1001
|
for (let a of e) {
|
|
941
1002
|
let e = i;
|
|
@@ -949,58 +1010,93 @@ function Dt(e, t, n) {
|
|
|
949
1010
|
}
|
|
950
1011
|
return r;
|
|
951
1012
|
}
|
|
952
|
-
function
|
|
953
|
-
let i = m(
|
|
1013
|
+
function Pt(e, t, n, r = {}) {
|
|
1014
|
+
let i = p(m("text"), {
|
|
954
1015
|
x: t,
|
|
955
1016
|
y: n,
|
|
956
|
-
"font-family":
|
|
957
|
-
"font-size":
|
|
958
|
-
fill:
|
|
1017
|
+
"font-family": z.family,
|
|
1018
|
+
"font-size": z.label,
|
|
1019
|
+
fill: L.ink,
|
|
959
1020
|
...r
|
|
960
1021
|
});
|
|
961
1022
|
return i.textContent = e, i;
|
|
962
1023
|
}
|
|
963
|
-
function
|
|
1024
|
+
function Ft(e, t, n, r = 10, i = 5) {
|
|
964
1025
|
let a = Math.atan2(t.y - e.y, t.x - e.x), o = t.x - r * Math.cos(a), s = t.y - r * Math.sin(a), c = `${t.x},${t.y} ${o - i * Math.sin(a)},${s + i * Math.cos(a)} ${o + i * Math.sin(a)},${s - i * Math.cos(a)}`;
|
|
965
|
-
return m(
|
|
1026
|
+
return p(m("polygon"), {
|
|
966
1027
|
points: c,
|
|
967
1028
|
fill: n
|
|
968
1029
|
});
|
|
969
1030
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1031
|
+
//#endregion
|
|
1032
|
+
//#region src/view-options/EventStormingViewOptions.ts
|
|
1033
|
+
var It = "eventStorming.viewOptions.changed", Lt = class {
|
|
1034
|
+
eventBus;
|
|
1035
|
+
elementRegistry;
|
|
1036
|
+
static $inject = ["eventBus", "elementRegistry"];
|
|
1037
|
+
_typeCaptionsVisible = !0;
|
|
1038
|
+
constructor(e, t) {
|
|
1039
|
+
this.eventBus = e, this.elementRegistry = t;
|
|
1040
|
+
}
|
|
1041
|
+
typeCaptionsVisible() {
|
|
1042
|
+
return this._typeCaptionsVisible;
|
|
1043
|
+
}
|
|
1044
|
+
setTypeCaptionsVisible(e) {
|
|
1045
|
+
if (e === this._typeCaptionsVisible) return;
|
|
1046
|
+
this._typeCaptionsVisible = e, this.eventBus.fire(It, { typeCaptionsVisible: e });
|
|
1047
|
+
let t = this.elementRegistry.filter(w);
|
|
1048
|
+
t.length && this.eventBus.fire("elements.changed", { elements: t });
|
|
1049
|
+
}
|
|
1050
|
+
}, Rt = {
|
|
1051
|
+
__depends__: [g],
|
|
1052
|
+
eventStormingViewOptions: ["type", Lt]
|
|
1053
|
+
}, zt = {
|
|
1054
|
+
__depends__: [Rt],
|
|
1055
|
+
__init__: ["eventStormingRenderer"],
|
|
1056
|
+
eventStormingRenderer: ["type", wt]
|
|
1057
|
+
};
|
|
1058
|
+
//#endregion
|
|
1059
|
+
//#region src/board-bounds/BoardBounds.ts
|
|
1060
|
+
function Bt(e) {
|
|
1061
|
+
return e.id !== "event-storming-root" && !e.waypoints && typeof e.x == "number" && typeof e.y == "number" && typeof e.width == "number" && typeof e.height == "number";
|
|
984
1062
|
}
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1063
|
+
var Vt = class {
|
|
1064
|
+
elementRegistry;
|
|
1065
|
+
static $inject = ["elementRegistry"];
|
|
1066
|
+
constructor(e) {
|
|
1067
|
+
this.elementRegistry = e;
|
|
1068
|
+
}
|
|
1069
|
+
contentBounds(e = 120) {
|
|
1070
|
+
let t = this.drawnBoxes();
|
|
1071
|
+
if (!t.length) return {
|
|
989
1072
|
x: 0,
|
|
990
|
-
y: 0
|
|
1073
|
+
y: 0,
|
|
1074
|
+
...i
|
|
1075
|
+
};
|
|
1076
|
+
let n = Math.min(...t.map((e) => e.x)), r = Math.min(...t.map((e) => e.y)), a = Math.max(...t.map((e) => e.x + e.width)), o = Math.max(...t.map((e) => e.y + e.height));
|
|
1077
|
+
return {
|
|
1078
|
+
x: n - e,
|
|
1079
|
+
y: r - e,
|
|
1080
|
+
width: a - n + 2 * e,
|
|
1081
|
+
height: o - r + 2 * e
|
|
991
1082
|
};
|
|
992
|
-
return [e, r[r.length - 1] ?? e];
|
|
993
1083
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
}
|
|
1084
|
+
isEmpty() {
|
|
1085
|
+
return this.positionedShapes().length === 0;
|
|
1086
|
+
}
|
|
1087
|
+
drawnBoxes() {
|
|
1088
|
+
let e = this.positionedShapes().map(Re);
|
|
1089
|
+
for (let t of this.elementRegistry.getAll()) {
|
|
1090
|
+
if (!x(t)) continue;
|
|
1091
|
+
let n = ze(t);
|
|
1092
|
+
n && e.push(n);
|
|
1093
|
+
}
|
|
1094
|
+
return e;
|
|
1095
|
+
}
|
|
1096
|
+
positionedShapes() {
|
|
1097
|
+
return this.elementRegistry.getAll().filter(Bt);
|
|
1098
|
+
}
|
|
1099
|
+
}, Ht = { boardBounds: ["type", Vt] }, Ut = { drawing: 0 }, Wt = .001, Gt = class {
|
|
1004
1100
|
canvas;
|
|
1005
1101
|
elementFactory;
|
|
1006
1102
|
factory;
|
|
@@ -1028,7 +1124,7 @@ var jt = {
|
|
|
1028
1124
|
...e.rawPassthrough ? { rawPassthrough: e.rawPassthrough } : {}
|
|
1029
1125
|
}, r = this.boardRoot();
|
|
1030
1126
|
r.businessObject = n;
|
|
1031
|
-
let i = /* @__PURE__ */ new Map(), a = [...e.elements].sort((e, t) => (
|
|
1127
|
+
let i = /* @__PURE__ */ new Map(), a = [...e.elements].sort((e, t) => (Ut[e.elementType] ?? 9) - (Ut[t.elementType] ?? 9)), o = a.filter((e) => e.elementType === "drawing"), s = a.filter((e) => e.elementType !== "drawing");
|
|
1032
1128
|
for (let e of o) {
|
|
1033
1129
|
let t = this.createShape(e);
|
|
1034
1130
|
this.canvas.addShape(t, r), i.set(e.id, t);
|
|
@@ -1041,7 +1137,7 @@ var jt = {
|
|
|
1041
1137
|
let n = "attachedTo" in e ? e.attachedTo : void 0;
|
|
1042
1138
|
if (!n) continue;
|
|
1043
1139
|
let r = i.get(n);
|
|
1044
|
-
!r || !
|
|
1140
|
+
!r || !D(r) ? t.push({
|
|
1045
1141
|
message: `“${e.id}” is pinned to “${n}”, which isn't on the board or can't hold a pin. It stays unpinned.`,
|
|
1046
1142
|
elementId: e.id
|
|
1047
1143
|
}) : i.get(e.id).host = r;
|
|
@@ -1061,8 +1157,8 @@ var jt = {
|
|
|
1061
1157
|
return this.config?.fitOnImport !== !1 && this.fitToContent(), this.eventBus.fire("import.render.done", { warnings: t }), t;
|
|
1062
1158
|
}
|
|
1063
1159
|
boardRoot() {
|
|
1064
|
-
let e = this.elementRegistry.get(
|
|
1065
|
-
e || (e = this.elementFactory.createRoot({ id:
|
|
1160
|
+
let e = this.elementRegistry.get(y);
|
|
1161
|
+
e || (e = this.elementFactory.createRoot({ id: y }), this.canvas.setRootElement(e));
|
|
1066
1162
|
for (let t of this.canvas.getRootElements()) t !== e && this.canvas.removeRootElement(t);
|
|
1067
1163
|
return e;
|
|
1068
1164
|
}
|
|
@@ -1072,7 +1168,7 @@ var jt = {
|
|
|
1072
1168
|
this.canvas.viewbox(e);
|
|
1073
1169
|
return;
|
|
1074
1170
|
}
|
|
1075
|
-
let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1),
|
|
1171
|
+
let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1), Wt);
|
|
1076
1172
|
this.canvas.viewbox({
|
|
1077
1173
|
x: e.x + e.width / 2 - t / 2 / r,
|
|
1078
1174
|
y: e.y + e.height / 2 - n / 2 / r,
|
|
@@ -1097,23 +1193,23 @@ var jt = {
|
|
|
1097
1193
|
} catch {}
|
|
1098
1194
|
}
|
|
1099
1195
|
}
|
|
1100
|
-
},
|
|
1196
|
+
}, Kt = class {
|
|
1101
1197
|
elementRegistry;
|
|
1102
1198
|
static $inject = ["elementRegistry"];
|
|
1103
1199
|
constructor(e) {
|
|
1104
1200
|
this.elementRegistry = e;
|
|
1105
1201
|
}
|
|
1106
1202
|
export() {
|
|
1107
|
-
let e = this.elementRegistry.get(
|
|
1203
|
+
let e = this.elementRegistry.get(y)?.businessObject, t = e?.config ?? { title: "Untitled Board" }, r = [], i = [];
|
|
1108
1204
|
for (let e of this.elementRegistry.getAll()) if (e.id !== "event-storming-root") {
|
|
1109
|
-
if (
|
|
1205
|
+
if (x(e)) i.push({
|
|
1110
1206
|
id: e.id,
|
|
1111
1207
|
edgeType: "arrow",
|
|
1112
1208
|
from: e.source?.id ?? "",
|
|
1113
1209
|
to: e.target?.id ?? "",
|
|
1114
1210
|
...e.linkLabel ? { label: e.linkLabel } : {}
|
|
1115
1211
|
});
|
|
1116
|
-
else if (
|
|
1212
|
+
else if (b(e)) {
|
|
1117
1213
|
let t = this.buildElement(e);
|
|
1118
1214
|
t && r.push(t);
|
|
1119
1215
|
}
|
|
@@ -1144,10 +1240,10 @@ var jt = {
|
|
|
1144
1240
|
...e.color ? { color: e.color } : {}
|
|
1145
1241
|
};
|
|
1146
1242
|
}
|
|
1147
|
-
let t = e.eventStormingType === "note" &&
|
|
1243
|
+
let t = e.eventStormingType === "note" && I(e.eventStormingLabel, e) ? {
|
|
1148
1244
|
width: e.width,
|
|
1149
1245
|
height: e.height
|
|
1150
|
-
} : void 0, n = e.eventStormingType === "note" ?
|
|
1246
|
+
} : void 0, n = e.eventStormingType === "note" ? qt(e) : void 0;
|
|
1151
1247
|
return {
|
|
1152
1248
|
id: e.id,
|
|
1153
1249
|
elementType: e.eventStormingType,
|
|
@@ -1163,7 +1259,7 @@ var jt = {
|
|
|
1163
1259
|
};
|
|
1164
1260
|
}
|
|
1165
1261
|
};
|
|
1166
|
-
function
|
|
1262
|
+
function qt(e) {
|
|
1167
1263
|
let t = e.alignHorizontal && e.alignHorizontal !== "left" ? e.alignHorizontal : void 0, n = e.alignVertical && e.alignVertical !== "top" ? e.alignVertical : void 0;
|
|
1168
1264
|
if (t || n) return {
|
|
1169
1265
|
...t ? { horizontal: t } : {},
|
|
@@ -1172,62 +1268,62 @@ function It(e) {
|
|
|
1172
1268
|
}
|
|
1173
1269
|
//#endregion
|
|
1174
1270
|
//#region src/io/warnings.ts
|
|
1175
|
-
function
|
|
1271
|
+
function Jt(e) {
|
|
1176
1272
|
return e.source === void 0 ? e.message : `${e.message} (“${e.source}”)`;
|
|
1177
1273
|
}
|
|
1178
1274
|
//#endregion
|
|
1179
1275
|
//#region src/io/index.ts
|
|
1180
|
-
var
|
|
1181
|
-
eventStormingImporter: ["type",
|
|
1182
|
-
eventStormingExporter: ["type",
|
|
1183
|
-
},
|
|
1276
|
+
var Yt = {
|
|
1277
|
+
eventStormingImporter: ["type", Gt],
|
|
1278
|
+
eventStormingExporter: ["type", Kt]
|
|
1279
|
+
}, Xt = class extends at {
|
|
1184
1280
|
_getModules() {
|
|
1185
1281
|
return [
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1282
|
+
ft,
|
|
1283
|
+
Ht,
|
|
1284
|
+
Rt,
|
|
1285
|
+
zt,
|
|
1286
|
+
Yt
|
|
1191
1287
|
];
|
|
1192
1288
|
}
|
|
1193
|
-
},
|
|
1289
|
+
}, Zt = class extends Xt {
|
|
1194
1290
|
_getModules() {
|
|
1195
1291
|
return [
|
|
1196
1292
|
...super._getModules(),
|
|
1197
1293
|
_,
|
|
1294
|
+
v,
|
|
1198
1295
|
ee,
|
|
1199
|
-
te
|
|
1200
|
-
ne
|
|
1296
|
+
te
|
|
1201
1297
|
];
|
|
1202
1298
|
}
|
|
1203
|
-
},
|
|
1299
|
+
}, Qt = class extends fe {
|
|
1204
1300
|
static $inject = ["eventBus", "modeling"];
|
|
1205
1301
|
constructor(e, t) {
|
|
1206
1302
|
super(e), this.preExecute("element.updateProperties", (e) => {
|
|
1207
1303
|
let { element: n, properties: r } = e.context, i = r.eventStormingType;
|
|
1208
1304
|
if (typeof i != "string") return;
|
|
1209
1305
|
let a = n;
|
|
1210
|
-
if (a.host && !
|
|
1306
|
+
if (a.host && !T(i) && t.updateAttachment(a, void 0), a.attachers?.length && !E(i)) for (let e of [...a.attachers]) t.updateAttachment(e, void 0);
|
|
1211
1307
|
});
|
|
1212
1308
|
}
|
|
1213
|
-
},
|
|
1214
|
-
__depends__: [
|
|
1309
|
+
}, $t = {
|
|
1310
|
+
__depends__: [de],
|
|
1215
1311
|
__init__: ["eventStormingAttachBehavior"],
|
|
1216
|
-
eventStormingAttachBehavior: ["type",
|
|
1312
|
+
eventStormingAttachBehavior: ["type", Qt]
|
|
1217
1313
|
};
|
|
1218
1314
|
//#endregion
|
|
1219
1315
|
//#region src/modeling/cmd/UpdatePropertiesHandler.ts
|
|
1220
|
-
function
|
|
1316
|
+
function en(e, t, n) {
|
|
1221
1317
|
n === void 0 ? delete e[t] : e[t] = n;
|
|
1222
1318
|
}
|
|
1223
|
-
var
|
|
1319
|
+
var tn = [
|
|
1224
1320
|
"x",
|
|
1225
1321
|
"y",
|
|
1226
1322
|
"width",
|
|
1227
1323
|
"height"
|
|
1228
1324
|
];
|
|
1229
|
-
function
|
|
1230
|
-
if (!t.some((e) =>
|
|
1325
|
+
function nn(e, t) {
|
|
1326
|
+
if (!t.some((e) => tn.includes(e))) return [e];
|
|
1231
1327
|
let n = e;
|
|
1232
1328
|
return [
|
|
1233
1329
|
e,
|
|
@@ -1235,18 +1331,18 @@ function Gt(e, t) {
|
|
|
1235
1331
|
...n.outgoing ?? []
|
|
1236
1332
|
];
|
|
1237
1333
|
}
|
|
1238
|
-
var
|
|
1334
|
+
var rn = class {
|
|
1239
1335
|
execute(e) {
|
|
1240
1336
|
let { element: t, properties: n } = e, r = t, i = {};
|
|
1241
|
-
for (let e of Object.keys(n)) i[e] = r[e],
|
|
1242
|
-
return e.oldProperties = i,
|
|
1337
|
+
for (let e of Object.keys(n)) i[e] = r[e], en(r, e, n[e]);
|
|
1338
|
+
return e.oldProperties = i, nn(t, Object.keys(n));
|
|
1243
1339
|
}
|
|
1244
1340
|
revert(e) {
|
|
1245
1341
|
let { element: t, oldProperties: n } = e, r = t;
|
|
1246
|
-
if (n) for (let e of Object.keys(n))
|
|
1247
|
-
return
|
|
1342
|
+
if (n) for (let e of Object.keys(n)) en(r, e, n[e]);
|
|
1343
|
+
return nn(t, Object.keys(n ?? {}));
|
|
1248
1344
|
}
|
|
1249
|
-
},
|
|
1345
|
+
}, an = "element.updateProperties", on = class {
|
|
1250
1346
|
commandStack;
|
|
1251
1347
|
canvas;
|
|
1252
1348
|
elementRegistry;
|
|
@@ -1256,17 +1352,17 @@ var Kt = class {
|
|
|
1256
1352
|
"elementRegistry"
|
|
1257
1353
|
];
|
|
1258
1354
|
constructor(e, t, n) {
|
|
1259
|
-
this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(
|
|
1355
|
+
this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(an, rn);
|
|
1260
1356
|
}
|
|
1261
1357
|
updateProperties(e, t) {
|
|
1262
|
-
this.commandStack.execute(
|
|
1358
|
+
this.commandStack.execute(an, {
|
|
1263
1359
|
element: e,
|
|
1264
1360
|
properties: t
|
|
1265
1361
|
});
|
|
1266
1362
|
}
|
|
1267
1363
|
updateLabel(e, t) {
|
|
1268
|
-
if (e.eventStormingType === "note" && !
|
|
1269
|
-
let { width: n, height: r } =
|
|
1364
|
+
if (e.eventStormingType === "note" && !I(e.eventStormingLabel, e)) {
|
|
1365
|
+
let { width: n, height: r } = F(t), i = e.x + e.width / 2, a = e.y + e.height / 2;
|
|
1270
1366
|
this.updateProperties(e, {
|
|
1271
1367
|
eventStormingLabel: t,
|
|
1272
1368
|
width: n,
|
|
@@ -1277,9 +1373,9 @@ var Kt = class {
|
|
|
1277
1373
|
} else this.updateProperties(e, { eventStormingLabel: t });
|
|
1278
1374
|
}
|
|
1279
1375
|
setStickyKind(e, t) {
|
|
1280
|
-
if (!
|
|
1376
|
+
if (!C(e.eventStormingType) || !C(t)) throw Error("setStickyKind: only sticky kinds can be retyped");
|
|
1281
1377
|
if (e.eventStormingType === t && !e.provisional) return;
|
|
1282
|
-
let { width: n, height: r } =
|
|
1378
|
+
let { width: n, height: r } = j[t], i = e.x + e.width / 2, a = e.y + e.height / 2;
|
|
1283
1379
|
this.updateProperties(e, {
|
|
1284
1380
|
eventStormingType: t,
|
|
1285
1381
|
...e.provisional ? { provisional: void 0 } : {},
|
|
@@ -1301,7 +1397,7 @@ var Kt = class {
|
|
|
1301
1397
|
setLevel(e) {
|
|
1302
1398
|
if (this.getLevel() === e) return;
|
|
1303
1399
|
let t = this.root(), n = t.businessObject ?? { config: { title: "Untitled Board" } };
|
|
1304
|
-
this.commandStack.execute(
|
|
1400
|
+
this.commandStack.execute(an, {
|
|
1305
1401
|
element: t,
|
|
1306
1402
|
properties: { businessObject: {
|
|
1307
1403
|
...n,
|
|
@@ -1315,7 +1411,7 @@ var Kt = class {
|
|
|
1315
1411
|
root() {
|
|
1316
1412
|
return this.elementRegistry.get("event-storming-root") ?? this.canvas.getRootElement();
|
|
1317
1413
|
}
|
|
1318
|
-
},
|
|
1414
|
+
}, sn = 24, cn = [
|
|
1319
1415
|
"eventStormingType",
|
|
1320
1416
|
"color",
|
|
1321
1417
|
"drawingPoints",
|
|
@@ -1323,8 +1419,8 @@ var Kt = class {
|
|
|
1323
1419
|
"strokeStyle",
|
|
1324
1420
|
"alignHorizontal",
|
|
1325
1421
|
"alignVertical"
|
|
1326
|
-
],
|
|
1327
|
-
function
|
|
1422
|
+
], ln = ["eventStormingType", "linkLabel"];
|
|
1423
|
+
function un(e, t) {
|
|
1328
1424
|
let n = {};
|
|
1329
1425
|
for (let r of t) {
|
|
1330
1426
|
let t = e[r];
|
|
@@ -1332,7 +1428,7 @@ function Qt(e, t) {
|
|
|
1332
1428
|
}
|
|
1333
1429
|
return n;
|
|
1334
1430
|
}
|
|
1335
|
-
var
|
|
1431
|
+
var dn = class {
|
|
1336
1432
|
selection;
|
|
1337
1433
|
modeling;
|
|
1338
1434
|
elementFactory;
|
|
@@ -1355,23 +1451,23 @@ var $t = class {
|
|
|
1355
1451
|
this.selection = e, this.modeling = t, this.elementFactory = n, this.esFactory = r, this.canvas = i, this.create = a, this.mouse = o;
|
|
1356
1452
|
}
|
|
1357
1453
|
copy() {
|
|
1358
|
-
let e = this.selection.get().filter((e) =>
|
|
1454
|
+
let e = this.selection.get().filter((e) => b(e));
|
|
1359
1455
|
if (!e.length) return !1;
|
|
1360
1456
|
let t = new Map(e.map((e, t) => [e, t])), n = [], r = /* @__PURE__ */ new Set();
|
|
1361
1457
|
for (let i of e) for (let e of [...i.incoming ?? [], ...i.outgoing ?? []]) {
|
|
1362
|
-
if (!
|
|
1458
|
+
if (!x(e) || r.has(e)) continue;
|
|
1363
1459
|
let i = t.get(e.source), a = t.get(e.target);
|
|
1364
1460
|
i !== void 0 && a !== void 0 && (r.add(e), n.push({
|
|
1365
1461
|
sourceIdx: i,
|
|
1366
1462
|
targetIdx: a,
|
|
1367
|
-
props:
|
|
1463
|
+
props: un(e, ln)
|
|
1368
1464
|
}));
|
|
1369
1465
|
}
|
|
1370
1466
|
return this.clipboard = {
|
|
1371
1467
|
shapes: e.map((e) => {
|
|
1372
1468
|
let n = e.host ? t.get(e.host) : void 0;
|
|
1373
1469
|
return {
|
|
1374
|
-
props:
|
|
1470
|
+
props: un(e, cn),
|
|
1375
1471
|
x: e.x,
|
|
1376
1472
|
y: e.y,
|
|
1377
1473
|
width: e.width,
|
|
@@ -1412,26 +1508,26 @@ var $t = class {
|
|
|
1412
1508
|
...structuredClone(e.props),
|
|
1413
1509
|
source: n[e.sourceIdx],
|
|
1414
1510
|
target: n[e.targetIdx],
|
|
1415
|
-
waypoints: [
|
|
1511
|
+
waypoints: [fn(n[e.sourceIdx]), fn(n[e.targetIdx])]
|
|
1416
1512
|
}))
|
|
1417
1513
|
};
|
|
1418
1514
|
}
|
|
1419
1515
|
insertWithOffset(e) {
|
|
1420
1516
|
this.pasteCount++;
|
|
1421
|
-
let t =
|
|
1517
|
+
let t = sn * this.pasteCount, n = pn(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
|
|
1422
1518
|
x: n.cx + t,
|
|
1423
1519
|
y: n.cy + t
|
|
1424
1520
|
}, this.canvas.getRootElement());
|
|
1425
1521
|
return this.selection.select(r), !0;
|
|
1426
1522
|
}
|
|
1427
1523
|
};
|
|
1428
|
-
function
|
|
1524
|
+
function fn(e) {
|
|
1429
1525
|
return {
|
|
1430
1526
|
x: e.x + e.width / 2,
|
|
1431
1527
|
y: e.y + e.height / 2
|
|
1432
1528
|
};
|
|
1433
1529
|
}
|
|
1434
|
-
function
|
|
1530
|
+
function pn(e) {
|
|
1435
1531
|
let t = Math.min(...e.map((e) => e.x)), n = Math.min(...e.map((e) => e.y)), r = Math.max(...e.map((e) => e.x + e.width)), i = Math.max(...e.map((e) => e.y + e.height));
|
|
1436
1532
|
return {
|
|
1437
1533
|
cx: (t + r) / 2,
|
|
@@ -1440,13 +1536,13 @@ function tn(e) {
|
|
|
1440
1536
|
}
|
|
1441
1537
|
//#endregion
|
|
1442
1538
|
//#region src/modeling/index.ts
|
|
1443
|
-
var
|
|
1444
|
-
__depends__: [
|
|
1539
|
+
var mn = {
|
|
1540
|
+
__depends__: [pe, ie],
|
|
1445
1541
|
__init__: ["eventStormingModeling"],
|
|
1446
|
-
eventStormingModeling: ["type",
|
|
1447
|
-
eventStormingCopyPaste: ["type",
|
|
1448
|
-
},
|
|
1449
|
-
__depends__: [
|
|
1542
|
+
eventStormingModeling: ["type", on],
|
|
1543
|
+
eventStormingCopyPaste: ["type", dn]
|
|
1544
|
+
}, hn = {
|
|
1545
|
+
__depends__: [me],
|
|
1450
1546
|
__init__: ["eventStormingLassoBehavior"],
|
|
1451
1547
|
eventStormingLassoBehavior: ["type", class {
|
|
1452
1548
|
static $inject = [
|
|
@@ -1471,43 +1567,43 @@ var nn = {
|
|
|
1471
1567
|
};
|
|
1472
1568
|
//#endregion
|
|
1473
1569
|
//#region src/rules/EventStormingRules.ts
|
|
1474
|
-
function
|
|
1570
|
+
function gn(e, t) {
|
|
1475
1571
|
return (e.outgoing ?? []).some((e) => e.target === t);
|
|
1476
1572
|
}
|
|
1477
|
-
function
|
|
1478
|
-
return e.length !== 1 || !
|
|
1573
|
+
function _n(e, t) {
|
|
1574
|
+
return e.length !== 1 || !Te(e[0]) || !D(t) ? !1 : "attach";
|
|
1479
1575
|
}
|
|
1480
|
-
var
|
|
1576
|
+
var vn = class extends he {
|
|
1481
1577
|
static $inject = ["eventBus"];
|
|
1482
1578
|
constructor(e) {
|
|
1483
1579
|
super(e);
|
|
1484
1580
|
}
|
|
1485
1581
|
init() {
|
|
1486
|
-
this.addRule("connection.start", (e) =>
|
|
1582
|
+
this.addRule("connection.start", (e) => w(e.source)), this.addRule("connection.create", (e) => {
|
|
1487
1583
|
let { source: t, target: n } = e;
|
|
1488
|
-
return !
|
|
1489
|
-
}), this.addRule(["shape.move", "elements.move"], (e) =>
|
|
1490
|
-
if (!
|
|
1584
|
+
return !w(t) || !w(n) || t === n || gn(t, n) ? !1 : { eventStormingType: "arrow" };
|
|
1585
|
+
}), this.addRule(["shape.move", "elements.move"], (e) => _n(e.shapes ?? (e.shape ? [e.shape] : []), e.target) || !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => {
|
|
1586
|
+
if (!Ee(e.shape)) return !1;
|
|
1491
1587
|
let { newBounds: t } = e;
|
|
1492
|
-
return !t || t.width >=
|
|
1588
|
+
return !t || t.width >= N.width && t.height >= N.height;
|
|
1493
1589
|
});
|
|
1494
1590
|
}
|
|
1495
|
-
},
|
|
1591
|
+
}, yn = {
|
|
1496
1592
|
__init__: ["eventStormingRules"],
|
|
1497
|
-
eventStormingRules: ["type",
|
|
1498
|
-
},
|
|
1593
|
+
eventStormingRules: ["type", vn]
|
|
1594
|
+
}, bn = 8, xn = {
|
|
1499
1595
|
__init__: ["elementSnapping"],
|
|
1500
1596
|
elementSnapping: ["type", class {
|
|
1501
1597
|
static $inject = ["eventBus", "elementRegistry"];
|
|
1502
1598
|
constructor(e, t) {
|
|
1503
|
-
let n = (e) => t.getAll().filter((t) =>
|
|
1599
|
+
let n = (e) => t.getAll().filter((t) => b(t) && t.eventStormingType !== "drawing" && !e.has(t.id)).map((e) => ({
|
|
1504
1600
|
x: e.x + e.width / 2,
|
|
1505
1601
|
y: e.y + e.height / 2
|
|
1506
1602
|
})), r = (e, t) => {
|
|
1507
1603
|
let n, r = 9;
|
|
1508
1604
|
for (let i of t) {
|
|
1509
1605
|
let t = Math.abs(i - e);
|
|
1510
|
-
t <=
|
|
1606
|
+
t <= bn && t < r && (n = i, r = t);
|
|
1511
1607
|
}
|
|
1512
1608
|
return n;
|
|
1513
1609
|
};
|
|
@@ -1539,7 +1635,7 @@ var sn = class extends ge {
|
|
|
1539
1635
|
});
|
|
1540
1636
|
}
|
|
1541
1637
|
}]
|
|
1542
|
-
},
|
|
1638
|
+
}, Sn = ".djs-palette-entries .entry", Cn = "bottom", wn = class {
|
|
1543
1639
|
palette;
|
|
1544
1640
|
hoverTooltip;
|
|
1545
1641
|
static $inject = [
|
|
@@ -1554,9 +1650,9 @@ var sn = class extends ge {
|
|
|
1554
1650
|
attachTo(e) {
|
|
1555
1651
|
this.refreshEntries(), this.hoverTooltip.add({
|
|
1556
1652
|
container: e,
|
|
1557
|
-
selector:
|
|
1653
|
+
selector: Sn,
|
|
1558
1654
|
getContent: (e) => this.contentFor(e),
|
|
1559
|
-
getPosition: (e) =>
|
|
1655
|
+
getPosition: (e) => Tn(e)
|
|
1560
1656
|
});
|
|
1561
1657
|
}
|
|
1562
1658
|
refreshEntries() {
|
|
@@ -1564,58 +1660,58 @@ var sn = class extends ge {
|
|
|
1564
1660
|
}
|
|
1565
1661
|
contentFor(e) {
|
|
1566
1662
|
let t = this.entries[e.getAttribute("data-action") ?? ""];
|
|
1567
|
-
return t?.title ?
|
|
1663
|
+
return t?.title ? _e`<${ge} title=${t.title} shortcut=${t.shortcut} />` : null;
|
|
1568
1664
|
}
|
|
1569
1665
|
};
|
|
1570
|
-
function
|
|
1666
|
+
function Tn(e) {
|
|
1571
1667
|
let t = e.getBoundingClientRect();
|
|
1572
1668
|
return {
|
|
1573
1669
|
x: t.left + t.width / 2,
|
|
1574
1670
|
y: t.bottom + 8,
|
|
1575
|
-
placement:
|
|
1671
|
+
placement: Cn
|
|
1576
1672
|
};
|
|
1577
1673
|
}
|
|
1578
1674
|
//#endregion
|
|
1579
1675
|
//#region src/palette/index.ts
|
|
1580
|
-
var
|
|
1676
|
+
var En = {
|
|
1581
1677
|
__init__: ["eventStormingPaletteProvider", "paletteTooltip"],
|
|
1582
|
-
eventStormingPaletteProvider: ["type",
|
|
1583
|
-
paletteTooltip: ["type",
|
|
1584
|
-
},
|
|
1678
|
+
eventStormingPaletteProvider: ["type", et],
|
|
1679
|
+
paletteTooltip: ["type", wn]
|
|
1680
|
+
}, W = "event-storming-element-settings", Dn = {
|
|
1585
1681
|
id: "kind",
|
|
1586
1682
|
name: "Change type"
|
|
1587
1683
|
};
|
|
1588
|
-
function
|
|
1684
|
+
function On(e, t) {
|
|
1589
1685
|
return e ? `✓ ${t}` : t;
|
|
1590
1686
|
}
|
|
1591
|
-
var
|
|
1687
|
+
var kn = class {
|
|
1592
1688
|
modeling;
|
|
1593
1689
|
static $inject = ["popupMenu", "eventStormingModeling"];
|
|
1594
1690
|
constructor(e, t) {
|
|
1595
|
-
this.modeling = t, e.registerProvider(
|
|
1691
|
+
this.modeling = t, e.registerProvider(W, this);
|
|
1596
1692
|
}
|
|
1597
1693
|
getPopupMenuEntries(e) {
|
|
1598
1694
|
let t = Array.isArray(e) ? e[0] : e;
|
|
1599
|
-
return
|
|
1695
|
+
return w(t) ? this.kindEntries(t) : {};
|
|
1600
1696
|
}
|
|
1601
1697
|
kindEntries(e) {
|
|
1602
1698
|
let t = {}, n = e.provisional === !0, r = o[this.modeling.getLevel()];
|
|
1603
|
-
for (let i of
|
|
1699
|
+
for (let i of S) {
|
|
1604
1700
|
if (!r.includes(i) && (n || i !== e.eventStormingType)) continue;
|
|
1605
|
-
let a =
|
|
1701
|
+
let a = j[i];
|
|
1606
1702
|
t[`kind-${i}`] = {
|
|
1607
|
-
label: n ? a.label :
|
|
1608
|
-
imageHtml:
|
|
1609
|
-
group:
|
|
1703
|
+
label: n ? a.label : On(e.eventStormingType === i, a.label),
|
|
1704
|
+
imageHtml: Je(a.fill, a.stroke),
|
|
1705
|
+
group: Dn,
|
|
1610
1706
|
action: () => this.modeling.setStickyKind(e, i)
|
|
1611
1707
|
};
|
|
1612
1708
|
}
|
|
1613
1709
|
return t;
|
|
1614
1710
|
}
|
|
1615
|
-
},
|
|
1711
|
+
}, An = {
|
|
1616
1712
|
__init__: ["eventStormingElementSettings"],
|
|
1617
|
-
eventStormingElementSettings: ["type",
|
|
1618
|
-
},
|
|
1713
|
+
eventStormingElementSettings: ["type", kn]
|
|
1714
|
+
}, G = "eventStorming.readOnly.changed", jn = 5e3, Mn = [
|
|
1619
1715
|
"elements.move",
|
|
1620
1716
|
"shape.move",
|
|
1621
1717
|
"shape.resize",
|
|
@@ -1628,7 +1724,7 @@ var vn = class {
|
|
|
1628
1724
|
"connection.reconnect",
|
|
1629
1725
|
"connection.updateWaypoints",
|
|
1630
1726
|
"elements.delete"
|
|
1631
|
-
],
|
|
1727
|
+
], Nn = class extends he {
|
|
1632
1728
|
bus;
|
|
1633
1729
|
static $inject = ["eventBus"];
|
|
1634
1730
|
readOnly = !1;
|
|
@@ -1636,19 +1732,19 @@ var vn = class {
|
|
|
1636
1732
|
super(e), this.bus = e;
|
|
1637
1733
|
}
|
|
1638
1734
|
init() {
|
|
1639
|
-
this.addRule(
|
|
1735
|
+
this.addRule(Mn, jn, () => !this.readOnly && void 0);
|
|
1640
1736
|
}
|
|
1641
1737
|
isReadOnly() {
|
|
1642
1738
|
return this.readOnly;
|
|
1643
1739
|
}
|
|
1644
1740
|
setReadOnly(e) {
|
|
1645
|
-
this.readOnly !== e && (this.readOnly = e, this.bus.fire(
|
|
1741
|
+
this.readOnly !== e && (this.readOnly = e, this.bus.fire(G, { readOnly: e }));
|
|
1646
1742
|
}
|
|
1647
|
-
},
|
|
1648
|
-
__depends__: [
|
|
1743
|
+
}, Pn = {
|
|
1744
|
+
__depends__: [ce],
|
|
1649
1745
|
__init__: ["eventStormingReadOnly"],
|
|
1650
|
-
eventStormingReadOnly: ["type",
|
|
1651
|
-
},
|
|
1746
|
+
eventStormingReadOnly: ["type", Nn]
|
|
1747
|
+
}, Fn = {
|
|
1652
1748
|
plus: "<path d=\"M5 12h14\"/><path d=\"M12 5v14\"/>",
|
|
1653
1749
|
"arrow-right": "<path d=\"M5 12h14\"/><path d=\"m12 5 7 7-7 7\"/>",
|
|
1654
1750
|
pencil: "<path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\"/><path d=\"m15 5 4 4\"/>",
|
|
@@ -1667,18 +1763,18 @@ var vn = class {
|
|
|
1667
1763
|
"align-vertical-justify-end": "<rect width=\"14\" height=\"6\" x=\"5\" y=\"12\" rx=\"2\"/><rect width=\"10\" height=\"6\" x=\"7\" y=\"2\" rx=\"2\"/><path d=\"M2 22h20\"/>",
|
|
1668
1764
|
x: "<path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/>"
|
|
1669
1765
|
};
|
|
1670
|
-
function
|
|
1671
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${
|
|
1766
|
+
function K(e) {
|
|
1767
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${Fn[e]}</svg>`;
|
|
1672
1768
|
}
|
|
1673
1769
|
//#endregion
|
|
1674
1770
|
//#region src/context-pad/EventStormingContextPadProvider.ts
|
|
1675
|
-
var
|
|
1676
|
-
function
|
|
1677
|
-
return `<div class="entry event-storming-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${
|
|
1771
|
+
var In = "Append sticky (auto-connect, choose the type after placing)";
|
|
1772
|
+
function q(e, t, n = !1) {
|
|
1773
|
+
return `<div class="entry event-storming-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${K(e)}</div>`;
|
|
1678
1774
|
}
|
|
1679
1775
|
//#endregion
|
|
1680
1776
|
//#region src/context-pad/index.ts
|
|
1681
|
-
var
|
|
1777
|
+
var Ln = {
|
|
1682
1778
|
__init__: ["eventStormingContextPadProvider"],
|
|
1683
1779
|
eventStormingContextPadProvider: ["type", class {
|
|
1684
1780
|
modeling;
|
|
@@ -1704,40 +1800,40 @@ var En = {
|
|
|
1704
1800
|
"eventStormingReadOnly"
|
|
1705
1801
|
];
|
|
1706
1802
|
constructor(e, t, n, r, i, a, o, s, c, l, u) {
|
|
1707
|
-
this.modeling = t, this.connect = n, this.create = r, this.popupMenu = i, this.eventStormingModeling = a, this.labelEditing = o, this.factory = s, this.colorPicker = c, this.readOnly = u, e.registerProvider(this), l?.on(
|
|
1803
|
+
this.modeling = t, this.connect = n, this.create = r, this.popupMenu = i, this.eventStormingModeling = a, this.labelEditing = o, this.factory = s, this.colorPicker = c, this.readOnly = u, e.registerProvider(this), l?.on(G, (t) => {
|
|
1708
1804
|
t.readOnly && e.close();
|
|
1709
1805
|
});
|
|
1710
1806
|
}
|
|
1711
1807
|
getContextPadEntries(e) {
|
|
1712
1808
|
if (this.readOnly?.isReadOnly()) return {};
|
|
1713
|
-
if (
|
|
1809
|
+
if (x(e)) {
|
|
1714
1810
|
let t = e;
|
|
1715
1811
|
return {
|
|
1716
1812
|
"edit-label": {
|
|
1717
1813
|
group: "edit",
|
|
1718
1814
|
title: "Edit arrow label",
|
|
1719
|
-
html:
|
|
1815
|
+
html: q("pencil", "Edit arrow label"),
|
|
1720
1816
|
action: { click: () => this.labelEditing.activateConnection(t) }
|
|
1721
1817
|
},
|
|
1722
1818
|
delete: {
|
|
1723
1819
|
group: "delete",
|
|
1724
1820
|
title: "Delete connection",
|
|
1725
|
-
html:
|
|
1821
|
+
html: q("trash", "Delete connection"),
|
|
1726
1822
|
action: { click: () => this.modeling.removeElements([e]) }
|
|
1727
1823
|
}
|
|
1728
1824
|
};
|
|
1729
1825
|
}
|
|
1730
|
-
if (!
|
|
1826
|
+
if (!b(e)) return {};
|
|
1731
1827
|
let t = e, n = {}, r = t.eventStormingType;
|
|
1732
|
-
if (
|
|
1828
|
+
if (C(r)) {
|
|
1733
1829
|
let e = (e) => {
|
|
1734
1830
|
let n = this.factory.createProvisional();
|
|
1735
1831
|
this.create.start(e, n, { source: t });
|
|
1736
1832
|
};
|
|
1737
1833
|
n.append = {
|
|
1738
1834
|
group: "append",
|
|
1739
|
-
title:
|
|
1740
|
-
html:
|
|
1835
|
+
title: In,
|
|
1836
|
+
html: q("plus", In, !0),
|
|
1741
1837
|
action: {
|
|
1742
1838
|
click: e,
|
|
1743
1839
|
dragstart: e
|
|
@@ -1749,7 +1845,7 @@ var En = {
|
|
|
1749
1845
|
n.connect = {
|
|
1750
1846
|
group: "edit",
|
|
1751
1847
|
title: "Connect to existing sticky",
|
|
1752
|
-
html:
|
|
1848
|
+
html: q("arrow-right", "Connect to existing sticky", !0),
|
|
1753
1849
|
action: {
|
|
1754
1850
|
click: r,
|
|
1755
1851
|
dragstart: r
|
|
@@ -1757,10 +1853,10 @@ var En = {
|
|
|
1757
1853
|
}, n["change-kind"] = {
|
|
1758
1854
|
group: "edit",
|
|
1759
1855
|
title: "Change type",
|
|
1760
|
-
html:
|
|
1856
|
+
html: q("replace", "Change type"),
|
|
1761
1857
|
action: { click: (e) => {
|
|
1762
1858
|
let n = e;
|
|
1763
|
-
this.popupMenu.open(t,
|
|
1859
|
+
this.popupMenu.open(t, W, {
|
|
1764
1860
|
x: n.clientX,
|
|
1765
1861
|
y: n.clientY
|
|
1766
1862
|
});
|
|
@@ -1772,14 +1868,14 @@ var En = {
|
|
|
1772
1868
|
n["stroke-style"] = {
|
|
1773
1869
|
group: "edit",
|
|
1774
1870
|
title: r,
|
|
1775
|
-
html:
|
|
1871
|
+
html: q("line-style", r),
|
|
1776
1872
|
action: { click: () => this.eventStormingModeling.setStrokeStyle(t, e) }
|
|
1777
1873
|
};
|
|
1778
1874
|
}
|
|
1779
1875
|
return r === "drawing" && (n.color = {
|
|
1780
1876
|
group: "edit",
|
|
1781
1877
|
title: "Color",
|
|
1782
|
-
html:
|
|
1878
|
+
html: q("palette", "Color"),
|
|
1783
1879
|
action: { click: (e) => {
|
|
1784
1880
|
let n = e;
|
|
1785
1881
|
this.colorPicker.open(t, n.clientX, n.clientY);
|
|
@@ -1787,46 +1883,46 @@ var En = {
|
|
|
1787
1883
|
}), r !== "drawing" && (n["edit-label"] = {
|
|
1788
1884
|
group: "edit",
|
|
1789
1885
|
title: "Edit label",
|
|
1790
|
-
html:
|
|
1886
|
+
html: q("pencil", "Edit label"),
|
|
1791
1887
|
action: { click: () => this.labelEditing.activate(t) }
|
|
1792
1888
|
}), n.delete = {
|
|
1793
1889
|
group: "delete",
|
|
1794
1890
|
title: "Delete",
|
|
1795
|
-
html:
|
|
1891
|
+
html: q("trash", "Delete"),
|
|
1796
1892
|
action: { click: () => this.modeling.removeElements([t]) }
|
|
1797
1893
|
}, n;
|
|
1798
1894
|
}
|
|
1799
1895
|
}]
|
|
1800
|
-
},
|
|
1896
|
+
}, Rn = "bullet", zn = [
|
|
1801
1897
|
"left",
|
|
1802
1898
|
"center",
|
|
1803
1899
|
"right"
|
|
1804
|
-
],
|
|
1900
|
+
], Bn = [
|
|
1805
1901
|
"top",
|
|
1806
1902
|
"middle",
|
|
1807
1903
|
"bottom"
|
|
1808
1904
|
];
|
|
1809
|
-
function
|
|
1905
|
+
function Vn(e, t) {
|
|
1810
1906
|
return e[(e.indexOf(t) + 1) % e.length];
|
|
1811
1907
|
}
|
|
1812
|
-
function
|
|
1908
|
+
function Hn(e, t) {
|
|
1813
1909
|
let n = e.ownerDocument;
|
|
1814
1910
|
e.textContent = "";
|
|
1815
|
-
for (let r of
|
|
1911
|
+
for (let r of A(t)) {
|
|
1816
1912
|
let t = n.createElement("div");
|
|
1817
|
-
r.bullet && (t.className =
|
|
1913
|
+
r.bullet && (t.className = Rn);
|
|
1818
1914
|
for (let e of r.runs) {
|
|
1819
1915
|
let r = n.createTextNode(e.text);
|
|
1820
|
-
e.italic && (r =
|
|
1916
|
+
e.italic && (r = Un(n, "i", r)), e.bold && (r = Un(n, "b", r)), t.appendChild(r);
|
|
1821
1917
|
}
|
|
1822
1918
|
r.runs.length === 0 && t.appendChild(n.createElement("br")), e.appendChild(t);
|
|
1823
1919
|
}
|
|
1824
1920
|
}
|
|
1825
|
-
function
|
|
1921
|
+
function Un(e, t, n) {
|
|
1826
1922
|
let r = e.createElement(t);
|
|
1827
1923
|
return r.appendChild(n), r;
|
|
1828
1924
|
}
|
|
1829
|
-
function
|
|
1925
|
+
function Wn(e) {
|
|
1830
1926
|
let t = [], n = null, r = (e) => (n = {
|
|
1831
1927
|
bullet: e,
|
|
1832
1928
|
runs: []
|
|
@@ -1847,11 +1943,11 @@ function Nn(e) {
|
|
|
1847
1943
|
s.nextSibling && r(!1);
|
|
1848
1944
|
return;
|
|
1849
1945
|
}
|
|
1850
|
-
if (
|
|
1946
|
+
if (Gn(s.tagName)) {
|
|
1851
1947
|
a(s);
|
|
1852
1948
|
return;
|
|
1853
1949
|
}
|
|
1854
|
-
let c =
|
|
1950
|
+
let c = Kn(s, t, o);
|
|
1855
1951
|
for (let e of s.childNodes) i(e, c.bold, c.italic);
|
|
1856
1952
|
}, a = (e) => {
|
|
1857
1953
|
r(e.classList.contains("bullet") || e.tagName === "LI");
|
|
@@ -1859,12 +1955,12 @@ function Nn(e) {
|
|
|
1859
1955
|
n = null;
|
|
1860
1956
|
};
|
|
1861
1957
|
for (let t of e.childNodes) i(t, !1, !1);
|
|
1862
|
-
return
|
|
1958
|
+
return Oe(t);
|
|
1863
1959
|
}
|
|
1864
|
-
function
|
|
1960
|
+
function Gn(e) {
|
|
1865
1961
|
return e === "DIV" || e === "P" || e === "LI";
|
|
1866
1962
|
}
|
|
1867
|
-
function
|
|
1963
|
+
function Kn(e, t, n) {
|
|
1868
1964
|
let r = e.tagName;
|
|
1869
1965
|
(r === "B" || r === "STRONG") && (t = !0), (r === "I" || r === "EM") && (n = !0);
|
|
1870
1966
|
let i = e.style.fontWeight;
|
|
@@ -1875,13 +1971,13 @@ function Fn(e, t, n) {
|
|
|
1875
1971
|
italic: n
|
|
1876
1972
|
};
|
|
1877
1973
|
}
|
|
1878
|
-
function
|
|
1974
|
+
function qn(e) {
|
|
1879
1975
|
let t = e.ownerDocument, n = t.getSelection();
|
|
1880
1976
|
if (!n) return;
|
|
1881
1977
|
let r = t.createRange();
|
|
1882
1978
|
r.selectNodeContents(e), n.removeAllRanges(), n.addRange(r);
|
|
1883
1979
|
}
|
|
1884
|
-
function
|
|
1980
|
+
function Jn(e, t) {
|
|
1885
1981
|
let n = e.ownerDocument;
|
|
1886
1982
|
if (typeof n.execCommand == "function" && n.execCommand("insertText", !1, t)) return;
|
|
1887
1983
|
let r = n.getSelection();
|
|
@@ -1892,24 +1988,24 @@ function Ln(e, t) {
|
|
|
1892
1988
|
let a = n.createTextNode(t);
|
|
1893
1989
|
i.insertNode(a), i.setStartAfter(a), i.collapse(!0), r.removeAllRanges(), r.addRange(i);
|
|
1894
1990
|
}
|
|
1895
|
-
function
|
|
1991
|
+
function Yn(e) {
|
|
1896
1992
|
let t = e.ownerDocument.getSelection();
|
|
1897
1993
|
if (!t || t.rangeCount === 0) return [];
|
|
1898
1994
|
let n = t.getRangeAt(0);
|
|
1899
1995
|
return e.contains(n.commonAncestorContainer) ? Array.from(e.children).filter((e) => n.intersectsNode(e)) : [];
|
|
1900
1996
|
}
|
|
1901
|
-
function
|
|
1902
|
-
|
|
1903
|
-
let t =
|
|
1997
|
+
function Xn(e) {
|
|
1998
|
+
Zn(e);
|
|
1999
|
+
let t = Yn(e);
|
|
1904
2000
|
if (t.length === 0) return;
|
|
1905
|
-
let n = t.every((e) => e.classList.contains(
|
|
1906
|
-
for (let e of t) e.classList.toggle(
|
|
2001
|
+
let n = t.every((e) => e.classList.contains(Rn));
|
|
2002
|
+
for (let e of t) e.classList.toggle(Rn, !n);
|
|
1907
2003
|
}
|
|
1908
|
-
function
|
|
2004
|
+
function Zn(e) {
|
|
1909
2005
|
let t = e.ownerDocument, n = null;
|
|
1910
|
-
for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE &&
|
|
2006
|
+
for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && Gn(r.tagName) ? n = null : (n || (n = t.createElement("div"), e.insertBefore(n, r)), n.appendChild(r));
|
|
1911
2007
|
}
|
|
1912
|
-
var
|
|
2008
|
+
var Qn = {
|
|
1913
2009
|
horizontal: {
|
|
1914
2010
|
left: "text-align-start",
|
|
1915
2011
|
center: "text-align-center",
|
|
@@ -1921,30 +2017,30 @@ var Vn = {
|
|
|
1921
2017
|
bottom: "align-vertical-justify-end"
|
|
1922
2018
|
}
|
|
1923
2019
|
};
|
|
1924
|
-
function
|
|
2020
|
+
function $n(e, t) {
|
|
1925
2021
|
let n = e.createElement("div");
|
|
1926
2022
|
n.className = "event-storming-note-toolbar";
|
|
1927
2023
|
let r = (r, i, a) => {
|
|
1928
2024
|
let o = e.createElement("button");
|
|
1929
2025
|
o.type = "button", o.setAttribute("data-action", r), o.title = i, o.innerHTML = a, o.addEventListener("mousedown", (e) => e.preventDefault()), o.addEventListener("click", () => t(r)), n.appendChild(o);
|
|
1930
2026
|
};
|
|
1931
|
-
r("note-bold", "Bold (Cmd/Ctrl+B)",
|
|
2027
|
+
r("note-bold", "Bold (Cmd/Ctrl+B)", K("bold")), r("note-italic", "Italic (Cmd/Ctrl+I)", K("italic")), r("note-bullet", "Bullet list", K("list"));
|
|
1932
2028
|
let i = e.createElement("span");
|
|
1933
2029
|
return i.className = "event-storming-note-toolbar-separator", n.appendChild(i), r("note-align-horizontal", "Horizontal alignment (click to cycle)", ""), r("note-align-vertical", "Vertical alignment (click to cycle)", ""), n;
|
|
1934
2030
|
}
|
|
1935
|
-
function
|
|
1936
|
-
let r =
|
|
1937
|
-
e.innerHTML = r ?
|
|
2031
|
+
function er(e, t, n) {
|
|
2032
|
+
let r = Qn[t][n];
|
|
2033
|
+
e.innerHTML = r ? K(r) : "", e.title = t === "horizontal" ? `Horizontal alignment: ${n} (click to cycle)` : `Vertical alignment: ${n} (click to cycle)`;
|
|
1938
2034
|
}
|
|
1939
|
-
function
|
|
2035
|
+
function tr(e, t) {
|
|
1940
2036
|
e.style.textAlign = t.horizontal, e.style.justifyContent = t.vertical === "top" ? "flex-start" : t.vertical === "middle" ? "center" : "flex-end";
|
|
1941
2037
|
}
|
|
1942
2038
|
//#endregion
|
|
1943
2039
|
//#region src/label-editing/EventStormingLabelEditing.ts
|
|
1944
|
-
function
|
|
2040
|
+
function nr(e) {
|
|
1945
2041
|
return e.replace(/(?<!:)\/\//g, "∕∕").replace(/\/\*/g, "∕*").replace(/->/g, "→").replace(/;/g, ",").replace(/\[/g, "(").replace(/\]/g, ")").trim();
|
|
1946
2042
|
}
|
|
1947
|
-
var
|
|
2043
|
+
var rr = class {
|
|
1948
2044
|
canvas;
|
|
1949
2045
|
modeling;
|
|
1950
2046
|
elementRegistry;
|
|
@@ -1960,12 +2056,12 @@ var Kn = class {
|
|
|
1960
2056
|
suspended = null;
|
|
1961
2057
|
resumeTimer;
|
|
1962
2058
|
constructor(e, t, n, r, i) {
|
|
1963
|
-
this.canvas = t, this.modeling = n, this.elementRegistry = r, this.readOnly = i, e.on(
|
|
2059
|
+
this.canvas = t, this.modeling = n, this.elementRegistry = r, this.readOnly = i, e.on(G, (e) => {
|
|
1964
2060
|
e.readOnly && this.cancel();
|
|
1965
2061
|
}), e.on("diagram.destroy", () => {
|
|
1966
2062
|
clearTimeout(this.resumeTimer), this.suspended = null, this.cancel();
|
|
1967
2063
|
}), e.on("element.dblclick", (e) => {
|
|
1968
|
-
|
|
2064
|
+
b(e.element) ? this.activate(e.element) : x(e.element) && this.activateConnection(e.element);
|
|
1969
2065
|
}), e.on(["element.mousedown", "drag.init"], () => this.active?.commit()), e.on("canvas.viewbox.changed", () => this.active?.place());
|
|
1970
2066
|
}
|
|
1971
2067
|
suspend() {
|
|
@@ -1980,14 +2076,14 @@ var Kn = class {
|
|
|
1980
2076
|
resume(e) {
|
|
1981
2077
|
let t = this.elementRegistry?.get(e.elementId);
|
|
1982
2078
|
if (e.connection) {
|
|
1983
|
-
if (!
|
|
2079
|
+
if (!x(t)) return;
|
|
1984
2080
|
this.activateConnection(t);
|
|
1985
2081
|
} else {
|
|
1986
|
-
if (!
|
|
2082
|
+
if (!b(t)) return;
|
|
1987
2083
|
this.activate(t);
|
|
1988
2084
|
}
|
|
1989
2085
|
let n = this.active?.field;
|
|
1990
|
-
n && (n instanceof HTMLTextAreaElement || n instanceof HTMLInputElement ? (n.value = e.value, n instanceof HTMLTextAreaElement && (n.rows = Math.max(2, e.value.split("\n").length)), n.setSelectionRange(e.selectionStart ?? e.value.length, e.selectionEnd ?? e.value.length)) : (
|
|
2086
|
+
n && (n instanceof HTMLTextAreaElement || n instanceof HTMLInputElement ? (n.value = e.value, n instanceof HTMLTextAreaElement && (n.rows = Math.max(2, e.value.split("\n").length)), n.setSelectionRange(e.selectionStart ?? e.value.length, e.selectionEnd ?? e.value.length)) : (Hn(n, e.value), e.align && this.restoreNoteAlign?.(e.align), ar(n)));
|
|
1991
2087
|
}
|
|
1992
2088
|
restoreNoteAlign;
|
|
1993
2089
|
activate(e) {
|
|
@@ -2007,7 +2103,7 @@ var Kn = class {
|
|
|
2007
2103
|
i || (i = !0, n.removeEventListener("keydown", s), n.removeEventListener("blur", c), n.remove(), this.active = null, this.canvas.restoreFocus?.());
|
|
2008
2104
|
}, o = () => {
|
|
2009
2105
|
if (i) return;
|
|
2010
|
-
let t =
|
|
2106
|
+
let t = nr(n.value), r = t && t !== e.eventStormingLabel;
|
|
2011
2107
|
a(), r && this.modeling.updateLabel(e, t);
|
|
2012
2108
|
}, s = (e) => {
|
|
2013
2109
|
if (e.key === "Escape") e.preventDefault(), a();
|
|
@@ -2034,43 +2130,43 @@ var Kn = class {
|
|
|
2034
2130
|
}
|
|
2035
2131
|
activateNote(e) {
|
|
2036
2132
|
let t = this.canvas.getContainer(), n = document.createElement("div");
|
|
2037
|
-
n.className = "event-storming-label-input event-storming-note-editor", n.contentEditable = "true", n.style.position = "absolute", n.style.transform = "translate(-50%, -50%)",
|
|
2133
|
+
n.className = "event-storming-label-input event-storming-note-editor", n.contentEditable = "true", n.style.position = "absolute", n.style.transform = "translate(-50%, -50%)", Hn(n, e.eventStormingLabel ?? "");
|
|
2038
2134
|
let r = {
|
|
2039
2135
|
horizontal: e.alignHorizontal ?? "left",
|
|
2040
2136
|
vertical: e.alignVertical ?? "top"
|
|
2041
2137
|
};
|
|
2042
|
-
|
|
2043
|
-
let i =
|
|
2138
|
+
tr(n, r);
|
|
2139
|
+
let i = $n(document, (e) => d(e));
|
|
2044
2140
|
i.style.transform = "translate(-50%, -100%)";
|
|
2045
2141
|
let a = () => {
|
|
2046
2142
|
let t = this.canvas.zoom(), r = this.canvas.viewbox(), a = (e.x + e.width / 2 - r.x) * t;
|
|
2047
2143
|
n.style.left = `${a}px`, n.style.top = `${(e.y + e.height / 2 - r.y) * t}px`, n.style.minWidth = `${e.width * t}px`, n.style.minHeight = `${e.height * t}px`, i.style.left = `${a}px`, i.style.top = `${(e.y - r.y) * t - 8}px`;
|
|
2048
2144
|
};
|
|
2049
|
-
a(), t.appendChild(n), t.appendChild(i), n.focus(),
|
|
2145
|
+
a(), t.appendChild(n), t.appendChild(i), n.focus(), qn(n);
|
|
2050
2146
|
let o = (e) => i.querySelector(`[data-action="${e}"]`), s = (e, t) => {
|
|
2051
2147
|
let n = o(e);
|
|
2052
2148
|
n?.classList.toggle("active", t), n?.setAttribute("aria-pressed", String(t));
|
|
2053
2149
|
}, c = () => {
|
|
2054
|
-
s("note-bold",
|
|
2055
|
-
let e =
|
|
2150
|
+
s("note-bold", or("bold")), s("note-italic", or("italic"));
|
|
2151
|
+
let e = Yn(n);
|
|
2056
2152
|
s("note-bullet", e.length > 0 && e.every((e) => e.classList.contains("bullet")));
|
|
2057
2153
|
let t = o("note-align-horizontal");
|
|
2058
|
-
t &&
|
|
2154
|
+
t && er(t, "horizontal", r.horizontal);
|
|
2059
2155
|
let i = o("note-align-vertical");
|
|
2060
|
-
i &&
|
|
2156
|
+
i && er(i, "vertical", r.vertical);
|
|
2061
2157
|
}, l = (e) => {
|
|
2062
2158
|
typeof document.execCommand == "function" && document.execCommand(e, !1), c();
|
|
2063
2159
|
}, u = (e) => {
|
|
2064
|
-
e === "horizontal" ? r.horizontal =
|
|
2160
|
+
e === "horizontal" ? r.horizontal = Vn(zn, r.horizontal) : r.vertical = Vn(Bn, r.vertical), tr(n, r), c();
|
|
2065
2161
|
}, d = (e) => {
|
|
2066
|
-
e === "note-bold" ? l("bold") : e === "note-italic" ? l("italic") : e === "note-bullet" ? (
|
|
2162
|
+
e === "note-bold" ? l("bold") : e === "note-italic" ? l("italic") : e === "note-bullet" ? (Xn(n), c()) : u(e === "note-align-horizontal" ? "horizontal" : "vertical");
|
|
2067
2163
|
}, f = () => c();
|
|
2068
2164
|
document.addEventListener("selectionchange", f);
|
|
2069
2165
|
let p = !1, m = () => {
|
|
2070
|
-
p || (p = !0, document.removeEventListener("selectionchange", f), n.removeEventListener("keydown", g), n.removeEventListener("blur", _), n.removeEventListener("paste",
|
|
2166
|
+
p || (p = !0, document.removeEventListener("selectionchange", f), n.removeEventListener("keydown", g), n.removeEventListener("blur", _), n.removeEventListener("paste", v), n.remove(), i.remove(), this.active = null, this.restoreNoteAlign = void 0, this.canvas.restoreFocus?.());
|
|
2071
2167
|
}, h = () => {
|
|
2072
2168
|
if (p) return;
|
|
2073
|
-
let t =
|
|
2169
|
+
let t = ir(e, nr(Wn(n)), r);
|
|
2074
2170
|
m(), t && this.modeling.updateProperties(e, t);
|
|
2075
2171
|
}, g = (e) => {
|
|
2076
2172
|
if (e.key === "Escape") {
|
|
@@ -2086,18 +2182,18 @@ var Kn = class {
|
|
|
2086
2182
|
(e.metaKey || e.ctrlKey) && (t === "b" || t === "i") && (e.preventDefault(), l(t === "b" ? "bold" : "italic"));
|
|
2087
2183
|
}, _ = (e) => {
|
|
2088
2184
|
e.relatedTarget instanceof Node && i.contains(e.relatedTarget) || h();
|
|
2089
|
-
},
|
|
2185
|
+
}, v = (e) => {
|
|
2090
2186
|
e.preventDefault();
|
|
2091
2187
|
let t = e.clipboardData?.getData("text/plain") ?? "";
|
|
2092
|
-
t &&
|
|
2188
|
+
t && Jn(n, t);
|
|
2093
2189
|
};
|
|
2094
|
-
n.addEventListener("keydown", g), n.addEventListener("blur", _), n.addEventListener("paste",
|
|
2095
|
-
r.horizontal = e.horizontal, r.vertical = e.vertical,
|
|
2190
|
+
n.addEventListener("keydown", g), n.addEventListener("blur", _), n.addEventListener("paste", v), c(), this.restoreNoteAlign = (e) => {
|
|
2191
|
+
r.horizontal = e.horizontal, r.vertical = e.vertical, tr(n, r), c();
|
|
2096
2192
|
};
|
|
2097
|
-
let
|
|
2193
|
+
let ee = () => ({
|
|
2098
2194
|
elementId: e.id,
|
|
2099
2195
|
connection: !1,
|
|
2100
|
-
value:
|
|
2196
|
+
value: Wn(n),
|
|
2101
2197
|
align: { ...r }
|
|
2102
2198
|
});
|
|
2103
2199
|
this.active = {
|
|
@@ -2105,7 +2201,7 @@ var Kn = class {
|
|
|
2105
2201
|
place: a,
|
|
2106
2202
|
commit: h,
|
|
2107
2203
|
cleanup: m,
|
|
2108
|
-
snapshot:
|
|
2204
|
+
snapshot: ee
|
|
2109
2205
|
};
|
|
2110
2206
|
}
|
|
2111
2207
|
activateConnection(e) {
|
|
@@ -2123,7 +2219,7 @@ var Kn = class {
|
|
|
2123
2219
|
o || (o = !0, i.removeEventListener("keydown", l), i.removeEventListener("blur", u), i.remove(), this.active = null, this.canvas.restoreFocus?.());
|
|
2124
2220
|
}, c = () => {
|
|
2125
2221
|
if (o) return;
|
|
2126
|
-
let t =
|
|
2222
|
+
let t = nr(i.value), n = e.linkLabel ?? "";
|
|
2127
2223
|
s(), t !== n && this.modeling.updateProperties(e, { linkLabel: t || void 0 });
|
|
2128
2224
|
}, l = (e) => {
|
|
2129
2225
|
e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Enter" && (e.preventDefault(), c());
|
|
@@ -2156,23 +2252,23 @@ var Kn = class {
|
|
|
2156
2252
|
};
|
|
2157
2253
|
}
|
|
2158
2254
|
};
|
|
2159
|
-
function
|
|
2255
|
+
function ir(e, t, n) {
|
|
2160
2256
|
let r = !!t && t !== e.eventStormingLabel, i = n.horizontal !== (e.alignHorizontal ?? "left") || n.vertical !== (e.alignVertical ?? "top");
|
|
2161
2257
|
if (!r && !i) return null;
|
|
2162
2258
|
let a = {};
|
|
2163
|
-
if (r && (a.eventStormingLabel = t, !
|
|
2164
|
-
let { width: n, height: r } =
|
|
2259
|
+
if (r && (a.eventStormingLabel = t, !I(e.eventStormingLabel, e))) {
|
|
2260
|
+
let { width: n, height: r } = F(t);
|
|
2165
2261
|
a.width = n, a.height = r, a.x = e.x + e.width / 2 - n / 2, a.y = e.y + e.height / 2 - r / 2;
|
|
2166
2262
|
}
|
|
2167
2263
|
return i && (a.alignHorizontal = n.horizontal === "left" ? void 0 : n.horizontal, a.alignVertical = n.vertical === "top" ? void 0 : n.vertical), a;
|
|
2168
2264
|
}
|
|
2169
|
-
function
|
|
2265
|
+
function ar(e) {
|
|
2170
2266
|
let t = document.createRange();
|
|
2171
2267
|
t.selectNodeContents(e), t.collapse(!1);
|
|
2172
2268
|
let n = window.getSelection();
|
|
2173
2269
|
n?.removeAllRanges(), n?.addRange(t);
|
|
2174
2270
|
}
|
|
2175
|
-
function
|
|
2271
|
+
function or(e) {
|
|
2176
2272
|
if (typeof document.queryCommandState != "function") return !1;
|
|
2177
2273
|
try {
|
|
2178
2274
|
return document.queryCommandState(e);
|
|
@@ -2182,10 +2278,10 @@ function Yn(e) {
|
|
|
2182
2278
|
}
|
|
2183
2279
|
//#endregion
|
|
2184
2280
|
//#region src/label-editing/index.ts
|
|
2185
|
-
var
|
|
2281
|
+
var sr = {
|
|
2186
2282
|
__init__: ["eventStormingLabelEditing"],
|
|
2187
|
-
eventStormingLabelEditing: ["type",
|
|
2188
|
-
},
|
|
2283
|
+
eventStormingLabelEditing: ["type", rr]
|
|
2284
|
+
}, cr = 2, lr = 10, ur = {
|
|
2189
2285
|
arrowleft: {
|
|
2190
2286
|
x: -1,
|
|
2191
2287
|
y: 0
|
|
@@ -2202,7 +2298,7 @@ var Xn = {
|
|
|
2202
2298
|
x: 0,
|
|
2203
2299
|
y: 1
|
|
2204
2300
|
}
|
|
2205
|
-
},
|
|
2301
|
+
}, dr = class {
|
|
2206
2302
|
static $inject = [
|
|
2207
2303
|
"config.eventStormingKeyboard",
|
|
2208
2304
|
"canvas",
|
|
@@ -2220,12 +2316,12 @@ var Xn = {
|
|
|
2220
2316
|
];
|
|
2221
2317
|
constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2222
2318
|
let p = t.getContainer(), m = e?.undoRedoKeys ?? !0, h = (e) => {
|
|
2223
|
-
e.defaultPrevented ||
|
|
2319
|
+
e.defaultPrevented || fr(e.target, p) && (pr(e.target) || g(e) || f?.isReadOnly() || _(e));
|
|
2224
2320
|
}, g = (e) => {
|
|
2225
2321
|
let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
|
|
2226
2322
|
if (t && n === "a" && !e.shiftKey && !e.altKey) {
|
|
2227
2323
|
e.preventDefault();
|
|
2228
|
-
let t = (d?.getAll() ?? []).filter((e) =>
|
|
2324
|
+
let t = (d?.getAll() ?? []).filter((e) => b(e) || x(e));
|
|
2229
2325
|
r.select(t);
|
|
2230
2326
|
} else if (t && n === "c") a.copy() && e.preventDefault();
|
|
2231
2327
|
else if (!t && !e.altKey && n === "l") {
|
|
@@ -2248,14 +2344,14 @@ var Xn = {
|
|
|
2248
2344
|
let t = c.getLastMoveEvent();
|
|
2249
2345
|
if (t) {
|
|
2250
2346
|
e.preventDefault();
|
|
2251
|
-
let n = l === "e" ? o.createNew("event",
|
|
2347
|
+
let n = l === "e" ? o.createNew("event", j.event.label) : o.createNew("command", j.command.label);
|
|
2252
2348
|
s.start(t, n);
|
|
2253
2349
|
}
|
|
2254
|
-
} else if (l in
|
|
2350
|
+
} else if (l in ur && !t) {
|
|
2255
2351
|
let t = r.get();
|
|
2256
2352
|
if (t.length) {
|
|
2257
2353
|
e.preventDefault();
|
|
2258
|
-
let n = e.shiftKey ?
|
|
2354
|
+
let n = e.shiftKey ? lr : cr, r = ur[l];
|
|
2259
2355
|
i.moveElements(t, {
|
|
2260
2356
|
x: r.x * n,
|
|
2261
2357
|
y: r.y * n
|
|
@@ -2266,20 +2362,20 @@ var Xn = {
|
|
|
2266
2362
|
document.addEventListener("keydown", h), u.on("diagram.destroy", () => document.removeEventListener("keydown", h));
|
|
2267
2363
|
}
|
|
2268
2364
|
};
|
|
2269
|
-
function
|
|
2365
|
+
function fr(e, t) {
|
|
2270
2366
|
return e instanceof Node ? t.contains(e) || e === document.body || e === document.documentElement : !1;
|
|
2271
2367
|
}
|
|
2272
|
-
function
|
|
2368
|
+
function pr(e) {
|
|
2273
2369
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2274
2370
|
let t = e.tagName;
|
|
2275
2371
|
return t === "INPUT" || t === "TEXTAREA" || e.isContentEditable;
|
|
2276
2372
|
}
|
|
2277
2373
|
//#endregion
|
|
2278
2374
|
//#region src/keyboard/index.ts
|
|
2279
|
-
var
|
|
2375
|
+
var mr = {
|
|
2280
2376
|
__init__: ["eventStormingKeyboard"],
|
|
2281
|
-
eventStormingKeyboard: ["type",
|
|
2282
|
-
},
|
|
2377
|
+
eventStormingKeyboard: ["type", dr]
|
|
2378
|
+
}, hr = 500, gr = 6, _r = class {
|
|
2283
2379
|
static $inject = ["injector", "eventBus"];
|
|
2284
2380
|
constructor(e, t) {
|
|
2285
2381
|
let n = e.get("connectionPreview", !1), r = e.get("eventStormingLabelEditing", !1), i = e.get("popupMenu", !1), a = e.get("modeling", !1), o = e.get("canvas", !1), s = !1;
|
|
@@ -2310,16 +2406,16 @@ var rr = {
|
|
|
2310
2406
|
let c = (e) => {
|
|
2311
2407
|
if (s || !e.parent || !i || !a || !o) return;
|
|
2312
2408
|
let n = o.getAbsoluteBBox(e), c = o.getContainer().getBoundingClientRect();
|
|
2313
|
-
i.open(e,
|
|
2409
|
+
i.open(e, W, {
|
|
2314
2410
|
x: c.left + n.x,
|
|
2315
|
-
y: c.top + n.y + n.height +
|
|
2411
|
+
y: c.top + n.y + n.height + gr
|
|
2316
2412
|
}), i.isOpen() ? t.once("popupMenu.close", () => {
|
|
2317
2413
|
setTimeout(() => {
|
|
2318
2414
|
s || (e.provisional ? e.parent && a.removeElements([e]) : r?.activate(e));
|
|
2319
2415
|
}, 0);
|
|
2320
2416
|
}) : a.removeElements([e]);
|
|
2321
2417
|
};
|
|
2322
|
-
t.on("create.end",
|
|
2418
|
+
t.on("create.end", hr, (e) => {
|
|
2323
2419
|
let { context: t } = e;
|
|
2324
2420
|
if (!t.source || !t.canExecute || !t.shape) return;
|
|
2325
2421
|
let n = t.shape;
|
|
@@ -2336,14 +2432,14 @@ var rr = {
|
|
|
2336
2432
|
} else r && setTimeout(() => r.activate(n), 0);
|
|
2337
2433
|
});
|
|
2338
2434
|
}
|
|
2339
|
-
},
|
|
2340
|
-
__depends__: [
|
|
2435
|
+
}, vr = {
|
|
2436
|
+
__depends__: [ve],
|
|
2341
2437
|
__init__: ["eventStormingAppendBehavior"],
|
|
2342
|
-
eventStormingAppendBehavior: ["type",
|
|
2343
|
-
},
|
|
2344
|
-
value:
|
|
2345
|
-
title:
|
|
2346
|
-
})),
|
|
2438
|
+
eventStormingAppendBehavior: ["type", _r]
|
|
2439
|
+
}, yr = S.map((e) => ({
|
|
2440
|
+
value: j[e].fill,
|
|
2441
|
+
title: j[e].label
|
|
2442
|
+
})), br = class {
|
|
2347
2443
|
canvas;
|
|
2348
2444
|
modeling;
|
|
2349
2445
|
static $inject = [
|
|
@@ -2373,7 +2469,7 @@ var rr = {
|
|
|
2373
2469
|
value: void 0,
|
|
2374
2470
|
title: "No color",
|
|
2375
2471
|
cls: "event-storming-cp-none"
|
|
2376
|
-
}, ...
|
|
2472
|
+
}, ...yr.map((e) => ({
|
|
2377
2473
|
value: e.value,
|
|
2378
2474
|
title: e.title,
|
|
2379
2475
|
cls: ""
|
|
@@ -2393,12 +2489,12 @@ var rr = {
|
|
|
2393
2489
|
close() {
|
|
2394
2490
|
this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0));
|
|
2395
2491
|
}
|
|
2396
|
-
},
|
|
2492
|
+
}, xr = {
|
|
2397
2493
|
__init__: ["eventStormingColorPicker"],
|
|
2398
|
-
eventStormingColorPicker: ["type",
|
|
2399
|
-
},
|
|
2494
|
+
eventStormingColorPicker: ["type", br]
|
|
2495
|
+
}, Sr = {
|
|
2400
2496
|
__init__: ["eventStormingOrderingProvider"],
|
|
2401
|
-
eventStormingOrderingProvider: ["type", class extends
|
|
2497
|
+
eventStormingOrderingProvider: ["type", class extends ye {
|
|
2402
2498
|
static $inject = ["eventBus"];
|
|
2403
2499
|
constructor(e) {
|
|
2404
2500
|
super(e);
|
|
@@ -2406,15 +2502,15 @@ var rr = {
|
|
|
2406
2502
|
getOrdering(e, t) {
|
|
2407
2503
|
for (; t.parent;) t = t.parent;
|
|
2408
2504
|
let n = t.children ?? [];
|
|
2409
|
-
if (
|
|
2410
|
-
let r = n.filter((t) => t !== e && (
|
|
2505
|
+
if (x(e)) {
|
|
2506
|
+
let r = n.filter((t) => t !== e && (O(t) || x(t))).length;
|
|
2411
2507
|
return {
|
|
2412
2508
|
parent: t,
|
|
2413
2509
|
index: r
|
|
2414
2510
|
};
|
|
2415
2511
|
}
|
|
2416
|
-
if (
|
|
2417
|
-
let r = n.filter((t) => t !== e &&
|
|
2512
|
+
if (O(e)) {
|
|
2513
|
+
let r = n.filter((t) => t !== e && O(t)).length;
|
|
2418
2514
|
return {
|
|
2419
2515
|
parent: t,
|
|
2420
2516
|
index: r
|
|
@@ -2423,7 +2519,7 @@ var rr = {
|
|
|
2423
2519
|
return { parent: t };
|
|
2424
2520
|
}
|
|
2425
2521
|
}]
|
|
2426
|
-
},
|
|
2522
|
+
}, Cr = 12, wr = class {
|
|
2427
2523
|
canvas;
|
|
2428
2524
|
eventBus;
|
|
2429
2525
|
modeling;
|
|
@@ -2441,7 +2537,7 @@ var rr = {
|
|
|
2441
2537
|
cursor = null;
|
|
2442
2538
|
layer = null;
|
|
2443
2539
|
constructor(e, t, n, r, i) {
|
|
2444
|
-
this.canvas = e, this.eventBus = t, this.modeling = n, this.selection = r, this.factory = i, t.on("diagram.destroy", () => this.cancel()), t.on(
|
|
2540
|
+
this.canvas = e, this.eventBus = t, this.modeling = n, this.selection = r, this.factory = i, t.on("diagram.destroy", () => this.cancel()), t.on(G, (e) => {
|
|
2445
2541
|
e.readOnly && this.cancel();
|
|
2446
2542
|
});
|
|
2447
2543
|
}
|
|
@@ -2502,12 +2598,12 @@ var rr = {
|
|
|
2502
2598
|
if (e.button !== 0 || this.isChromeTarget(e)) return;
|
|
2503
2599
|
e.preventDefault(), e.stopPropagation();
|
|
2504
2600
|
let t = this.toCanvasPoint(e), n = this.points[0];
|
|
2505
|
-
if (n && this.points.length >= 3 &&
|
|
2601
|
+
if (n && this.points.length >= 3 && Tr(t, n) <= Cr) {
|
|
2506
2602
|
this.finishClosed();
|
|
2507
2603
|
return;
|
|
2508
2604
|
}
|
|
2509
2605
|
let r = this.points[this.points.length - 1];
|
|
2510
|
-
r &&
|
|
2606
|
+
r && Tr(t, r) <= Cr ? this.points.length >= 2 && this.finish() : (this.points.push(t), this.renderPreview());
|
|
2511
2607
|
};
|
|
2512
2608
|
onDblClick = (e) => {
|
|
2513
2609
|
this.isChromeTarget(e) || (e.preventDefault(), e.stopPropagation(), this.finish());
|
|
@@ -2520,47 +2616,47 @@ var rr = {
|
|
|
2520
2616
|
};
|
|
2521
2617
|
renderPreview() {
|
|
2522
2618
|
if (this.clearPreview(), !this.points.length) return;
|
|
2523
|
-
let e = this.canvas.getLayer("event-storming-draw-preview", 1e3), t =
|
|
2524
|
-
|
|
2619
|
+
let e = this.canvas.getLayer("event-storming-draw-preview", 1e3), t = m("g"), n = this.cursor ? [...this.points, this.cursor] : this.points;
|
|
2620
|
+
f(t, p(m("polyline"), {
|
|
2525
2621
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
2526
2622
|
fill: "none",
|
|
2527
|
-
stroke:
|
|
2623
|
+
stroke: R,
|
|
2528
2624
|
"stroke-width": 2,
|
|
2529
2625
|
"stroke-linecap": "round",
|
|
2530
2626
|
"stroke-linejoin": "round",
|
|
2531
2627
|
"stroke-dasharray": "5 4"
|
|
2532
2628
|
}));
|
|
2533
2629
|
let r = this.points[0];
|
|
2534
|
-
if (
|
|
2630
|
+
if (f(t, p(m("circle"), {
|
|
2535
2631
|
cx: r.x,
|
|
2536
2632
|
cy: r.y,
|
|
2537
2633
|
r: this.points.length >= 3 ? 5 : 3,
|
|
2538
|
-
fill:
|
|
2539
|
-
stroke:
|
|
2634
|
+
fill: L.paper,
|
|
2635
|
+
stroke: R,
|
|
2540
2636
|
"stroke-width": 1.5
|
|
2541
2637
|
})), this.points.length >= 2) {
|
|
2542
2638
|
let e = this.points[this.points.length - 1];
|
|
2543
|
-
|
|
2639
|
+
f(t, p(m("circle"), {
|
|
2544
2640
|
cx: e.x,
|
|
2545
2641
|
cy: e.y,
|
|
2546
2642
|
r: 5,
|
|
2547
|
-
fill:
|
|
2548
|
-
stroke:
|
|
2643
|
+
fill: L.paper,
|
|
2644
|
+
stroke: R,
|
|
2549
2645
|
"stroke-width": 1.5
|
|
2550
2646
|
}));
|
|
2551
2647
|
}
|
|
2552
|
-
|
|
2648
|
+
f(e, t), this.layer = t;
|
|
2553
2649
|
}
|
|
2554
2650
|
clearPreview() {
|
|
2555
|
-
this.layer &&= (
|
|
2651
|
+
this.layer &&= (h(this.layer), null);
|
|
2556
2652
|
}
|
|
2557
2653
|
};
|
|
2558
|
-
function
|
|
2654
|
+
function Tr(e, t) {
|
|
2559
2655
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
2560
2656
|
}
|
|
2561
2657
|
//#endregion
|
|
2562
2658
|
//#region src/draw-tool/EventStormingDrawingHandles.ts
|
|
2563
|
-
var
|
|
2659
|
+
var Er = class {
|
|
2564
2660
|
eventBus;
|
|
2565
2661
|
canvas;
|
|
2566
2662
|
modeling;
|
|
@@ -2575,9 +2671,9 @@ var hr = class {
|
|
|
2575
2671
|
group = null;
|
|
2576
2672
|
dragPreview = null;
|
|
2577
2673
|
constructor(e, t, n, r) {
|
|
2578
|
-
this.eventBus = e, this.canvas = t, this.modeling = n, this.readOnly = r, e.on(
|
|
2674
|
+
this.eventBus = e, this.canvas = t, this.modeling = n, this.readOnly = r, e.on(G, () => this.render()), e.on("selection.changed", (e) => {
|
|
2579
2675
|
let t = e.newSelection ?? [], n = t.length === 1 ? t[0] : null;
|
|
2580
|
-
this.attach(
|
|
2676
|
+
this.attach(O(n) ? n : null);
|
|
2581
2677
|
}), e.on("element.changed", (e) => {
|
|
2582
2678
|
this.shape && e.element === this.shape && this.render();
|
|
2583
2679
|
}), e.on(["diagram.clear", "diagram.destroy"], () => this.attach(null));
|
|
@@ -2594,19 +2690,19 @@ var hr = class {
|
|
|
2594
2690
|
}
|
|
2595
2691
|
render() {
|
|
2596
2692
|
if (this.clear(), !this.shape || this.readOnly?.isReadOnly()) return;
|
|
2597
|
-
let e = this.canvas.getLayer("event-storming-drawing-handles", 1100), t =
|
|
2693
|
+
let e = this.canvas.getLayer("event-storming-drawing-handles", 1100), t = m("g");
|
|
2598
2694
|
this.absolutePoints().forEach((e, n) => {
|
|
2599
|
-
let r = m(
|
|
2695
|
+
let r = p(m("circle"), {
|
|
2600
2696
|
cx: e.x,
|
|
2601
2697
|
cy: e.y,
|
|
2602
2698
|
r: 5,
|
|
2603
|
-
fill:
|
|
2604
|
-
stroke:
|
|
2699
|
+
fill: L.paper,
|
|
2700
|
+
stroke: L.ink,
|
|
2605
2701
|
"stroke-width": 1.5,
|
|
2606
2702
|
class: "event-storming-drawing-handle"
|
|
2607
2703
|
});
|
|
2608
|
-
r.addEventListener("mousedown", (e) => this.startDrag(e, n)),
|
|
2609
|
-
}),
|
|
2704
|
+
r.addEventListener("mousedown", (e) => this.startDrag(e, n)), f(t, r);
|
|
2705
|
+
}), f(e, t), this.group = t;
|
|
2610
2706
|
}
|
|
2611
2707
|
startDrag(e, t) {
|
|
2612
2708
|
if (e.button !== 0 || !this.shape) return;
|
|
@@ -2633,21 +2729,21 @@ var hr = class {
|
|
|
2633
2729
|
}
|
|
2634
2730
|
renderDragPreview(e, t) {
|
|
2635
2731
|
this.clearDragPreview();
|
|
2636
|
-
let n = this.canvas.getLayer("event-storming-drawing-handles", 1100), r = m(
|
|
2732
|
+
let n = this.canvas.getLayer("event-storming-drawing-handles", 1100), r = p(m(t ? "polygon" : "polyline"), {
|
|
2637
2733
|
points: e.map((e) => `${e.x},${e.y}`).join(" "),
|
|
2638
2734
|
fill: "none",
|
|
2639
|
-
stroke:
|
|
2735
|
+
stroke: L.ink,
|
|
2640
2736
|
"stroke-width": 1.5,
|
|
2641
2737
|
"stroke-dasharray": "5 4",
|
|
2642
2738
|
"pointer-events": "none"
|
|
2643
2739
|
});
|
|
2644
|
-
|
|
2740
|
+
f(n, r), this.dragPreview = r;
|
|
2645
2741
|
}
|
|
2646
2742
|
clearDragPreview() {
|
|
2647
|
-
this.dragPreview &&= (
|
|
2743
|
+
this.dragPreview &&= (h(this.dragPreview), null);
|
|
2648
2744
|
}
|
|
2649
2745
|
clear() {
|
|
2650
|
-
this.clearDragPreview(), this.group &&= (
|
|
2746
|
+
this.clearDragPreview(), this.group &&= (h(this.group), null);
|
|
2651
2747
|
}
|
|
2652
2748
|
toCanvasPoint(e) {
|
|
2653
2749
|
let t = this.canvas.getContainer().getBoundingClientRect(), n = this.canvas.viewbox(), r = this.canvas.zoom();
|
|
@@ -2656,79 +2752,79 @@ var hr = class {
|
|
|
2656
2752
|
y: (e.clientY - t.top) / r + n.y
|
|
2657
2753
|
};
|
|
2658
2754
|
}
|
|
2659
|
-
},
|
|
2755
|
+
}, Dr = class {
|
|
2660
2756
|
static $inject = ["eventBus", "interactionEvents"];
|
|
2661
2757
|
constructor(e, t) {
|
|
2662
2758
|
e.on("interactionEvents.createHit", (e) => {
|
|
2663
|
-
if (
|
|
2759
|
+
if (O(e.element) && e.gfx) return Or(e.element, e.gfx), !1;
|
|
2664
2760
|
}), e.on("interactionEvents.updateHit", (e) => {
|
|
2665
|
-
if (
|
|
2761
|
+
if (O(e.element) && e.gfx) return t.removeHits(e.gfx), Or(e.element, e.gfx), !1;
|
|
2666
2762
|
});
|
|
2667
2763
|
}
|
|
2668
2764
|
};
|
|
2669
|
-
function
|
|
2670
|
-
let n = e.drawingPoints ?? [], r =
|
|
2671
|
-
|
|
2765
|
+
function Or(e, t) {
|
|
2766
|
+
let n = e.drawingPoints ?? [], r = m(e.closed ? "polygon" : "polyline");
|
|
2767
|
+
p(r, {
|
|
2672
2768
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
2673
2769
|
class: "djs-hit djs-hit-stroke",
|
|
2674
2770
|
fill: "none",
|
|
2675
2771
|
stroke: "white",
|
|
2676
2772
|
"stroke-width": 15,
|
|
2677
2773
|
"stroke-opacity": 0
|
|
2678
|
-
}),
|
|
2774
|
+
}), f(t, r);
|
|
2679
2775
|
}
|
|
2680
2776
|
//#endregion
|
|
2681
2777
|
//#region src/draw-tool/index.ts
|
|
2682
|
-
var
|
|
2778
|
+
var kr = {
|
|
2683
2779
|
__init__: [
|
|
2684
2780
|
"eventStormingDrawTool",
|
|
2685
2781
|
"eventStormingDrawingHandles",
|
|
2686
2782
|
"eventStormingDrawingHitProvider"
|
|
2687
2783
|
],
|
|
2688
|
-
eventStormingDrawTool: ["type",
|
|
2689
|
-
eventStormingDrawingHandles: ["type",
|
|
2690
|
-
eventStormingDrawingHitProvider: ["type",
|
|
2691
|
-
},
|
|
2784
|
+
eventStormingDrawTool: ["type", wr],
|
|
2785
|
+
eventStormingDrawingHandles: ["type", Er],
|
|
2786
|
+
eventStormingDrawingHitProvider: ["type", Dr]
|
|
2787
|
+
}, Ar = class {
|
|
2692
2788
|
static $inject = ["eventBus"];
|
|
2693
2789
|
constructor(e) {
|
|
2694
2790
|
e.on("resize.start", 1500, (e) => {
|
|
2695
2791
|
let t = e.context;
|
|
2696
|
-
|
|
2792
|
+
Ee(t.shape) && (t.minDimensions = N);
|
|
2697
2793
|
});
|
|
2698
2794
|
}
|
|
2699
|
-
},
|
|
2700
|
-
__depends__: [
|
|
2795
|
+
}, jr = {
|
|
2796
|
+
__depends__: [be],
|
|
2701
2797
|
__init__: ["eventStormingResizeBehavior"],
|
|
2702
|
-
eventStormingResizeBehavior: ["type",
|
|
2703
|
-
},
|
|
2798
|
+
eventStormingResizeBehavior: ["type", Ar]
|
|
2799
|
+
}, Mr = class extends Zt {
|
|
2704
2800
|
_getModules() {
|
|
2705
2801
|
return [
|
|
2706
2802
|
...super._getModules(),
|
|
2803
|
+
ne,
|
|
2804
|
+
ce,
|
|
2707
2805
|
re,
|
|
2708
|
-
le,
|
|
2709
2806
|
ie,
|
|
2710
2807
|
ae,
|
|
2711
2808
|
oe,
|
|
2712
2809
|
se,
|
|
2713
|
-
|
|
2810
|
+
le,
|
|
2714
2811
|
ue,
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
Ht,
|
|
2719
|
-
cn,
|
|
2720
|
-
un,
|
|
2721
|
-
hn,
|
|
2722
|
-
En,
|
|
2723
|
-
Xn,
|
|
2724
|
-
rr,
|
|
2812
|
+
Pn,
|
|
2813
|
+
mn,
|
|
2814
|
+
$t,
|
|
2725
2815
|
yn,
|
|
2816
|
+
xn,
|
|
2817
|
+
En,
|
|
2818
|
+
Ln,
|
|
2726
2819
|
sr,
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
dr,
|
|
2820
|
+
mr,
|
|
2821
|
+
An,
|
|
2730
2822
|
vr,
|
|
2731
|
-
|
|
2823
|
+
xr,
|
|
2824
|
+
hn,
|
|
2825
|
+
Sr,
|
|
2826
|
+
kr,
|
|
2827
|
+
jr
|
|
2732
2828
|
];
|
|
2733
2829
|
}
|
|
2734
2830
|
undo() {
|
|
@@ -2743,18 +2839,18 @@ var vr = {
|
|
|
2743
2839
|
canRedo() {
|
|
2744
2840
|
return this.get("commandStack").canRedo();
|
|
2745
2841
|
}
|
|
2746
|
-
},
|
|
2747
|
-
function
|
|
2748
|
-
return
|
|
2749
|
-
...
|
|
2842
|
+
}, Nr = "event-storming";
|
|
2843
|
+
function Pr(e = {}) {
|
|
2844
|
+
return Lr(new Mr({
|
|
2845
|
+
...Ir(e),
|
|
2750
2846
|
undoRedoKeys: e.undoRedoKeys ?? !0,
|
|
2751
|
-
freeArea:
|
|
2847
|
+
freeArea: Ye(e)
|
|
2752
2848
|
}), !0);
|
|
2753
2849
|
}
|
|
2754
|
-
function
|
|
2755
|
-
return
|
|
2850
|
+
function Fr(e = {}) {
|
|
2851
|
+
return Lr(new Zt(Ir(e)), !1);
|
|
2756
2852
|
}
|
|
2757
|
-
function
|
|
2853
|
+
function Ir(e) {
|
|
2758
2854
|
return {
|
|
2759
2855
|
width: "100%",
|
|
2760
2856
|
height: "100%",
|
|
@@ -2762,10 +2858,10 @@ function Tr(e) {
|
|
|
2762
2858
|
fitOnImport: e.fitOnImport ?? !0
|
|
2763
2859
|
};
|
|
2764
2860
|
}
|
|
2765
|
-
function
|
|
2861
|
+
function Lr(e, t) {
|
|
2766
2862
|
let n = e.get("eventBus"), r = e.get("canvas"), i = e.get("elementRegistry"), a = e.get("selection"), o = /* @__PURE__ */ new Set(), s = 0, c = !1, l = "", u = {
|
|
2767
|
-
notation:
|
|
2768
|
-
apiVersion:
|
|
2863
|
+
notation: Nr,
|
|
2864
|
+
apiVersion: xe,
|
|
2769
2865
|
editable: t
|
|
2770
2866
|
};
|
|
2771
2867
|
return t && n.on("commandStack.changed", () => {
|
|
@@ -2773,21 +2869,21 @@ function Er(e, t) {
|
|
|
2773
2869
|
}), {
|
|
2774
2870
|
meta: u,
|
|
2775
2871
|
elements: {
|
|
2776
|
-
list: () => c ? [] : i.getAll().filter(
|
|
2872
|
+
list: () => c ? [] : i.getAll().filter(J).map((e) => Br(e)),
|
|
2777
2873
|
reveal(e) {
|
|
2778
2874
|
if (c) return !1;
|
|
2779
2875
|
let t = i.get(e);
|
|
2780
|
-
return
|
|
2876
|
+
return J(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
|
|
2781
2877
|
},
|
|
2782
|
-
selection: () => c ? [] :
|
|
2878
|
+
selection: () => c ? [] : Rr(a.get()),
|
|
2783
2879
|
onSelection(e) {
|
|
2784
|
-
let t = (t) => e(
|
|
2880
|
+
let t = (t) => e(Rr(t.newSelection ?? []));
|
|
2785
2881
|
return n.on("selection.changed", t), () => n.off("selection.changed", t);
|
|
2786
2882
|
},
|
|
2787
2883
|
bounds(e) {
|
|
2788
2884
|
if (c) return;
|
|
2789
2885
|
let t = i.get(e);
|
|
2790
|
-
return
|
|
2886
|
+
return J(t) ? zr(t) : void 0;
|
|
2791
2887
|
}
|
|
2792
2888
|
},
|
|
2793
2889
|
diagram: e,
|
|
@@ -2799,7 +2895,7 @@ function Er(e, t) {
|
|
|
2799
2895
|
s += 1;
|
|
2800
2896
|
try {
|
|
2801
2897
|
let { warnings: n } = await e.importDSL(t);
|
|
2802
|
-
return { warnings: n.map(
|
|
2898
|
+
return { warnings: n.map(Jt) };
|
|
2803
2899
|
} finally {
|
|
2804
2900
|
--s;
|
|
2805
2901
|
}
|
|
@@ -2818,19 +2914,22 @@ function Er(e, t) {
|
|
|
2818
2914
|
width: n,
|
|
2819
2915
|
height: i
|
|
2820
2916
|
};
|
|
2821
|
-
return
|
|
2917
|
+
return Vr(a) ? a : void 0;
|
|
2822
2918
|
} catch {
|
|
2823
2919
|
return;
|
|
2824
2920
|
}
|
|
2825
2921
|
},
|
|
2826
2922
|
setViewState(e) {
|
|
2827
|
-
!c &&
|
|
2923
|
+
!c && Vr(e) && r.viewbox({
|
|
2828
2924
|
x: e.x,
|
|
2829
2925
|
y: e.y,
|
|
2830
2926
|
width: e.width,
|
|
2831
2927
|
height: e.height
|
|
2832
2928
|
});
|
|
2833
2929
|
},
|
|
2930
|
+
contentBounds() {
|
|
2931
|
+
return e.contentBounds();
|
|
2932
|
+
},
|
|
2834
2933
|
destroy() {
|
|
2835
2934
|
if (!c) {
|
|
2836
2935
|
try {
|
|
@@ -2843,13 +2942,13 @@ function Er(e, t) {
|
|
|
2843
2942
|
}
|
|
2844
2943
|
};
|
|
2845
2944
|
}
|
|
2846
|
-
function
|
|
2847
|
-
return
|
|
2945
|
+
function J(e) {
|
|
2946
|
+
return w(e);
|
|
2848
2947
|
}
|
|
2849
|
-
function
|
|
2850
|
-
return e.filter(
|
|
2948
|
+
function Rr(e) {
|
|
2949
|
+
return e.filter(J).map((e) => e.id);
|
|
2851
2950
|
}
|
|
2852
|
-
function
|
|
2951
|
+
function zr(e) {
|
|
2853
2952
|
return {
|
|
2854
2953
|
x: e.x,
|
|
2855
2954
|
y: e.y,
|
|
@@ -2857,24 +2956,24 @@ function Or(e) {
|
|
|
2857
2956
|
height: e.height
|
|
2858
2957
|
};
|
|
2859
2958
|
}
|
|
2860
|
-
function
|
|
2959
|
+
function Br(e) {
|
|
2861
2960
|
let t = e.eventStormingLabel;
|
|
2862
2961
|
return t ? {
|
|
2863
2962
|
id: e.id,
|
|
2864
2963
|
name: t
|
|
2865
2964
|
} : { id: e.id };
|
|
2866
2965
|
}
|
|
2867
|
-
function
|
|
2966
|
+
function Vr(e) {
|
|
2868
2967
|
if (typeof e != "object" || !e) return !1;
|
|
2869
2968
|
let { x: t, y: n, width: r, height: i } = e;
|
|
2870
|
-
return
|
|
2969
|
+
return Y(t) && Y(n) && Y(r) && Y(i) && r > 0 && i > 0;
|
|
2871
2970
|
}
|
|
2872
|
-
function
|
|
2971
|
+
function Y(e) {
|
|
2873
2972
|
return typeof e == "number" && Number.isFinite(e);
|
|
2874
2973
|
}
|
|
2875
2974
|
//#endregion
|
|
2876
2975
|
//#region src/board-menu/menu.ts
|
|
2877
|
-
var
|
|
2976
|
+
var Hr = "Export as .storm", Ur = [
|
|
2878
2977
|
{
|
|
2879
2978
|
value: "big-picture",
|
|
2880
2979
|
label: "Big picture"
|
|
@@ -2888,10 +2987,10 @@ var jr = "Export as .storm", Mr = [
|
|
|
2888
2987
|
label: "Software design"
|
|
2889
2988
|
}
|
|
2890
2989
|
];
|
|
2891
|
-
function
|
|
2892
|
-
return
|
|
2990
|
+
function Wr(e) {
|
|
2991
|
+
return Ur.some((t) => t.value === e);
|
|
2893
2992
|
}
|
|
2894
|
-
function
|
|
2993
|
+
function X(e, t, n, r) {
|
|
2895
2994
|
return {
|
|
2896
2995
|
kind: "action",
|
|
2897
2996
|
id: e,
|
|
@@ -2901,20 +3000,20 @@ function Z(e, t, n, r) {
|
|
|
2901
3000
|
onSelect: () => n.onSelect()
|
|
2902
3001
|
};
|
|
2903
3002
|
}
|
|
2904
|
-
function
|
|
2905
|
-
let t = [
|
|
2906
|
-
return e.transparentPng && t.push(
|
|
3003
|
+
function Gr(e) {
|
|
3004
|
+
let t = [X("export-png", "Export as PNG", e.png, "file-image"), X("export-svg", "Export as SVG", e.svg, "file-code-corner")];
|
|
3005
|
+
return e.transparentPng && t.push(X("export-png-transparent", "Export as PNG (4×, transparent)", e.transparentPng)), e.json && t.push(X("export-json", "Export as JSON", e.json)), e.storm && t.push(X("export-storm", Hr, e.storm)), t;
|
|
2907
3006
|
}
|
|
2908
|
-
function
|
|
3007
|
+
function Kr(e) {
|
|
2909
3008
|
return {
|
|
2910
3009
|
model: [{
|
|
2911
3010
|
kind: "radio",
|
|
2912
3011
|
id: "level",
|
|
2913
3012
|
label: "Level",
|
|
2914
|
-
options:
|
|
3013
|
+
options: Ur,
|
|
2915
3014
|
value: () => e.levels.getLevel(),
|
|
2916
3015
|
onSelect: (t) => {
|
|
2917
|
-
|
|
3016
|
+
Wr(t) && e.levels.setLevel(t);
|
|
2918
3017
|
}
|
|
2919
3018
|
}, {
|
|
2920
3019
|
kind: "checkbox",
|
|
@@ -2926,7 +3025,7 @@ function Fr(e) {
|
|
|
2926
3025
|
e.typeCaptions.setTypeCaptionsVisible(t), e.onTypeCaptionsToggled?.(t);
|
|
2927
3026
|
}
|
|
2928
3027
|
}],
|
|
2929
|
-
export:
|
|
3028
|
+
export: Gr(e.exports),
|
|
2930
3029
|
help: [{
|
|
2931
3030
|
kind: "dialog",
|
|
2932
3031
|
id: "keyboard-shortcuts",
|
|
@@ -2938,23 +3037,23 @@ function Fr(e) {
|
|
|
2938
3037
|
}
|
|
2939
3038
|
//#endregion
|
|
2940
3039
|
//#region src/board-menu/shortcuts.ts
|
|
2941
|
-
var
|
|
3040
|
+
var qr = [
|
|
2942
3041
|
"←",
|
|
2943
3042
|
"↑",
|
|
2944
3043
|
"→",
|
|
2945
3044
|
"↓"
|
|
2946
3045
|
];
|
|
2947
|
-
function
|
|
3046
|
+
function Jr(e, t, n) {
|
|
2948
3047
|
return t === "mac" ? `⌘${e}` : `${n.ctrl}+${e}`;
|
|
2949
3048
|
}
|
|
2950
|
-
function
|
|
3049
|
+
function Yr(e) {
|
|
2951
3050
|
try {
|
|
2952
3051
|
return new Intl.NumberFormat(e, { style: "percent" }).format(1);
|
|
2953
3052
|
} catch {
|
|
2954
3053
|
return new Intl.NumberFormat("en", { style: "percent" }).format(1);
|
|
2955
3054
|
}
|
|
2956
3055
|
}
|
|
2957
|
-
function
|
|
3056
|
+
function Xr(e, t) {
|
|
2958
3057
|
if (e === "mac") return {
|
|
2959
3058
|
zoomIn: "⌘+",
|
|
2960
3059
|
zoomOut: "⌘−",
|
|
@@ -2969,7 +3068,7 @@ function zr(e, t) {
|
|
|
2969
3068
|
fit: `${r}+1`
|
|
2970
3069
|
};
|
|
2971
3070
|
}
|
|
2972
|
-
function
|
|
3071
|
+
function Zr(e, t) {
|
|
2973
3072
|
if (e === "mac") return {
|
|
2974
3073
|
undo: ["⌘Z"],
|
|
2975
3074
|
redo: ["⌘⇧Z"],
|
|
@@ -2978,7 +3077,7 @@ function Br(e, t) {
|
|
|
2978
3077
|
paste: ["⌘V"],
|
|
2979
3078
|
duplicate: ["⌘D"],
|
|
2980
3079
|
remove: ["⌫"],
|
|
2981
|
-
coarseMove:
|
|
3080
|
+
coarseMove: qr.map((e) => `⇧${e}`),
|
|
2982
3081
|
lassoDrag: ["⇧ Drag"]
|
|
2983
3082
|
};
|
|
2984
3083
|
let { ctrl: n, shift: r } = t;
|
|
@@ -2990,27 +3089,27 @@ function Br(e, t) {
|
|
|
2990
3089
|
paste: [`${n}+V`],
|
|
2991
3090
|
duplicate: [`${n}+D`],
|
|
2992
3091
|
remove: ["Del", "Backspace"],
|
|
2993
|
-
coarseMove:
|
|
3092
|
+
coarseMove: qr.map((e) => `${r}+${e}`),
|
|
2994
3093
|
lassoDrag: [`${r}+Drag`]
|
|
2995
3094
|
};
|
|
2996
3095
|
}
|
|
2997
|
-
function
|
|
3096
|
+
function Qr(e) {
|
|
2998
3097
|
let { platform: t, messages: n } = e;
|
|
2999
3098
|
return {
|
|
3000
3099
|
title: "File",
|
|
3001
3100
|
rows: [{
|
|
3002
3101
|
action: n.openFile ?? "Open…",
|
|
3003
|
-
keys: [
|
|
3102
|
+
keys: [Jr("O", t, n.keyNames)]
|
|
3004
3103
|
}, {
|
|
3005
|
-
action:
|
|
3006
|
-
keys: [
|
|
3104
|
+
action: Hr,
|
|
3105
|
+
keys: [Jr("S", t, n.keyNames)]
|
|
3007
3106
|
}]
|
|
3008
3107
|
};
|
|
3009
3108
|
}
|
|
3010
|
-
function
|
|
3011
|
-
let { platform: n, messages: r } = e, i =
|
|
3109
|
+
function $r(e, t = {}) {
|
|
3110
|
+
let { platform: n, messages: r } = e, i = Xr(n, r.keyNames), a = Zr(n, r.keyNames);
|
|
3012
3111
|
return [
|
|
3013
|
-
...t.fileKeys ? [
|
|
3112
|
+
...t.fileKeys ? [Qr(e)] : [],
|
|
3014
3113
|
{
|
|
3015
3114
|
title: "View",
|
|
3016
3115
|
rows: [
|
|
@@ -3023,7 +3122,7 @@ function Hr(e, t = {}) {
|
|
|
3023
3122
|
keys: [i.zoomOut]
|
|
3024
3123
|
},
|
|
3025
3124
|
{
|
|
3026
|
-
action: r.zoomToActual(
|
|
3125
|
+
action: r.zoomToActual(Yr(e.lang)),
|
|
3027
3126
|
keys: [i.zoomToActual]
|
|
3028
3127
|
},
|
|
3029
3128
|
{
|
|
@@ -3065,7 +3164,7 @@ function Hr(e, t = {}) {
|
|
|
3065
3164
|
},
|
|
3066
3165
|
{
|
|
3067
3166
|
action: "Move selection",
|
|
3068
|
-
keys:
|
|
3167
|
+
keys: qr
|
|
3069
3168
|
},
|
|
3070
3169
|
{
|
|
3071
3170
|
action: "Move selection in large steps",
|
|
@@ -3106,39 +3205,39 @@ function Hr(e, t = {}) {
|
|
|
3106
3205
|
}
|
|
3107
3206
|
//#endregion
|
|
3108
3207
|
//#region src/board-menu/ShortcutsDialog.ts
|
|
3109
|
-
var
|
|
3208
|
+
var Z = "event-storming-shortcuts", Q = "event-storming-shortcuts-title";
|
|
3110
3209
|
function $(e, t, n) {
|
|
3111
3210
|
let r = document.createElement(e);
|
|
3112
3211
|
return r.className = t, n !== void 0 && (r.textContent = n), r;
|
|
3113
3212
|
}
|
|
3114
|
-
function
|
|
3115
|
-
let n = $("section", `${
|
|
3213
|
+
function ei(e, t) {
|
|
3214
|
+
let n = $("section", `${Z}-group`), r = `${Q}-group-${t}`, i = $("h4", `${Z}-group-title`, e.title);
|
|
3116
3215
|
i.id = r;
|
|
3117
|
-
let a = $("table", `${
|
|
3216
|
+
let a = $("table", `${Z}-table`);
|
|
3118
3217
|
a.setAttribute("aria-labelledby", r);
|
|
3119
3218
|
let o = a.createTBody();
|
|
3120
3219
|
for (let t of e.rows) {
|
|
3121
|
-
let e = o.insertRow(), n = $("th", `${
|
|
3220
|
+
let e = o.insertRow(), n = $("th", `${Z}-action`, t.action);
|
|
3122
3221
|
n.scope = "row";
|
|
3123
|
-
let r = $("td", `${
|
|
3124
|
-
for (let e of t.keys) r.append($("kbd", `${
|
|
3222
|
+
let r = $("td", `${Z}-keys`);
|
|
3223
|
+
for (let e of t.keys) r.append($("kbd", `${Z}-key`, e));
|
|
3125
3224
|
e.append(n, r);
|
|
3126
3225
|
}
|
|
3127
3226
|
return n.append(i, a), n;
|
|
3128
3227
|
}
|
|
3129
|
-
function
|
|
3130
|
-
let r = $("div", `${
|
|
3131
|
-
a.id =
|
|
3132
|
-
let o = $("button", `${
|
|
3133
|
-
o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML =
|
|
3134
|
-
let s = $("div", `${
|
|
3135
|
-
return s.append(
|
|
3228
|
+
function ti(e, t, n) {
|
|
3229
|
+
let r = $("div", `${Z}-panel`), i = $("header", `${Z}-header`), a = $("h3", `${Z}-title`, "Keyboard shortcuts");
|
|
3230
|
+
a.id = Q;
|
|
3231
|
+
let o = $("button", `${Z}-close`);
|
|
3232
|
+
o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML = K("x"), o.addEventListener("click", n), i.append(a, o);
|
|
3233
|
+
let s = $("div", `${Z}-body`);
|
|
3234
|
+
return s.append(...$r(e, t).map(ei)), r.append(i, s), r;
|
|
3136
3235
|
}
|
|
3137
|
-
function
|
|
3236
|
+
function ni(e, t = {}) {
|
|
3138
3237
|
let n;
|
|
3139
3238
|
function r() {
|
|
3140
|
-
let n = $("dialog",
|
|
3141
|
-
return n.setAttribute("aria-labelledby",
|
|
3239
|
+
let n = $("dialog", Z);
|
|
3240
|
+
return n.setAttribute("aria-labelledby", Q), n.append(ti(e, t, () => n.close())), n.addEventListener("click", (e) => {
|
|
3142
3241
|
e.target === n && n.close();
|
|
3143
3242
|
}), n.addEventListener("close", () => {
|
|
3144
3243
|
e.menu.trigger.hidden || e.menu.trigger.focus({ preventScroll: !0 });
|
|
@@ -3159,11 +3258,11 @@ function Kr(e, t = {}) {
|
|
|
3159
3258
|
}
|
|
3160
3259
|
//#endregion
|
|
3161
3260
|
//#region src/draw/icons.ts
|
|
3162
|
-
var
|
|
3163
|
-
function
|
|
3261
|
+
var ri = "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z", ii = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z", ai = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", oi = "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z", si = "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z", ci = "M4 7v2c0 .55-.45 1-1 1H2v2h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h1v-2H7c-.55 0-1-.45-1-1v-2c0-.84-.35-1.61-.92-2.18L4.85 12l.23-.82C5.65 10.61 6 9.84 6 9V7c0-.55.45-1 1-1h1V4H7C5.35 4 4 5.35 4 7zm16 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-1v2h1c.55 0 1 .45 1 1v2c0 .84.35 1.61.92 2.18l.23.82-.23.82c-.57.57-.92 1.34-.92 2.18v2c0 .55-.45 1-1 1h-1v2h1c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-2h-1z", li = "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z", ui = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", di = "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z", fi = "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z", pi = "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z", mi = "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z", hi = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", gi = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", _i = "M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z", vi = "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";
|
|
3262
|
+
function yi(e, t = 18) {
|
|
3164
3263
|
return `<svg viewBox="0 0 24 24" width="${t}" height="${t}" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
|
|
3165
3264
|
}
|
|
3166
3265
|
//#endregion
|
|
3167
|
-
export {
|
|
3266
|
+
export { Ur as BOARD_LEVELS, Vt as BoardBounds, L as COLORS, Nr as EVENT_STORMING_NOTATION, _r as EventStormingAppendBehavior, Qt as EventStormingAttachBehavior, at as EventStormingBaseViewer, br as EventStormingColorPicker, ut as EventStormingElementFactory, kn as EventStormingElementSettingsProvider, Kt as EventStormingExporter, Gt as EventStormingImporter, rr as EventStormingLabelEditing, on as EventStormingModeling, Nn as EventStormingReadOnly, wt as EventStormingRenderer, Ar as EventStormingResizeBehavior, vn as EventStormingRules, Lt as EventStormingViewOptions, gi as ICON_ADD, li as ICON_CODE, ci as ICON_DATA_OBJECT, ai as ICON_DELETE, ui as ICON_DOWNLOAD, ii as ICON_EDIT, vi as ICON_EYE, _i as ICON_FIT, fi as ICON_FOLDER_OPEN, pi as ICON_IMAGE, hi as ICON_MENU, mi as ICON_NEW, ri as ICON_PERSON, si as ICON_REDO, di as ICON_SHARE, oi as ICON_UNDO, k as MIRAGON, Mr as Modeler, M as NOTE_STYLE, Zt as NavigatedViewer, W as POPUP_PROVIDER_ID, G as READ_ONLY_CHANGED_EVENT, y as ROOT_ID, S as STICKY_KINDS, j as STICKY_STYLES, Hr as STORM_EXPORT_LABEL, It as VIEW_OPTIONS_CHANGED_EVENT, Xt as Viewer, Ht as boardBoundsModule, Kr as boardMenu, $r as boardShortcuts, Jr as commandKeyLabel, Pr as createCollaborativeModeler, Fr as createCollaborativeViewer, ni as createShortcutsDialog, xn as elementSnappingModule, vr as eventStormingAppendModule, $t as eventStormingAttachModule, xr as eventStormingColorPickerModule, Ln as eventStormingContextPadModule, zt as eventStormingDrawModule, mr as eventStormingKeyboardModule, ft as eventStormingModelModule, mn as eventStormingModelingModule, En as eventStormingPaletteModule, An as eventStormingPopupModule, Pn as eventStormingReadOnlyModule, jr as eventStormingResizeModule, yn as eventStormingRulesModule, Rt as eventStormingViewOptionsModule, yi as iconMarkup, Jt as importWarningText, Yt as ioModule, T as isAttachableKind, Te as isAttachableSticky, x as isEventStormingConnection, b as isEventStormingShape, E as isHostKind, D as isHostSticky, w as isSticky, C as isStickyKind, sr as labelEditingModule, A as parseNoteMarkdown, ke as plainNoteText, Ce as saveSVG, Oe as serializeNoteMarkdown };
|
|
3168
3267
|
|
|
3169
3268
|
//# sourceMappingURL=index.js.map
|