@miragon/event-storming-renderer 0.3.0 → 0.4.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 +30 -11
- package/dist/EventStormingBaseViewer.d.ts +16 -4
- package/dist/EventStormingBaseViewer.d.ts.map +1 -1
- package/dist/collaborative/CollaborativeEventStorming.d.ts +15 -7
- package/dist/collaborative/CollaborativeEventStorming.d.ts.map +1 -1
- package/dist/collaborative/index.d.ts +1 -1
- package/dist/collaborative/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +856 -803
- package/dist/index.js.map +1 -1
- package/dist/io/EventStormingImporter.d.ts +6 -1
- package/dist/io/EventStormingImporter.d.ts.map +1 -1
- package/dist/label-editing/EventStormingLabelEditing.d.ts +3 -3
- package/dist/label-editing/EventStormingLabelEditing.d.ts.map +1 -1
- package/dist/model/EventStormingElementFactory.d.ts +5 -3
- package/dist/model/EventStormingElementFactory.d.ts.map +1 -1
- package/dist/model/random-id.d.ts +5 -0
- package/dist/model/random-id.d.ts.map +1 -0
- package/dist/palette/EventStormingPaletteProvider.d.ts +11 -0
- package/dist/palette/EventStormingPaletteProvider.d.ts.map +1 -1
- package/dist/palette/index.d.ts +1 -1
- package/dist/palette/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9,37 +9,37 @@ import _ from "diagram-js/lib/navigation/zoomscroll";
|
|
|
9
9
|
import v from "diagram-js/lib/navigation/movecanvas";
|
|
10
10
|
import ee from "diagram-js/lib/features/keyboard";
|
|
11
11
|
import te from "diagram-js/lib/features/modeling";
|
|
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
|
|
12
|
+
import ne from "diagram-js/lib/features/move";
|
|
13
|
+
import re from "diagram-js/lib/features/create";
|
|
14
|
+
import ie from "diagram-js/lib/features/connect";
|
|
15
|
+
import ae from "diagram-js/lib/features/context-pad";
|
|
16
|
+
import oe from "diagram-js/lib/features/palette";
|
|
17
|
+
import se from "diagram-js/lib/features/rules";
|
|
18
|
+
import ce from "diagram-js/lib/features/outline";
|
|
19
|
+
import le from "diagram-js/lib/features/popup-menu";
|
|
20
|
+
import ue from "diagram-js/lib/features/attach-support";
|
|
21
|
+
import de from "diagram-js/lib/command/CommandInterceptor";
|
|
22
|
+
import fe from "diagram-js/lib/features/mouse";
|
|
23
|
+
import pe from "diagram-js/lib/features/lasso-tool";
|
|
24
|
+
import me from "diagram-js/lib/features/rules/RuleProvider";
|
|
25
|
+
import he from "diagram-js/lib/features/palette/PaletteTooltipComponent";
|
|
26
|
+
import { html as ge } from "diagram-js/lib/ui";
|
|
27
|
+
import _e from "diagram-js/lib/features/connection-preview";
|
|
28
|
+
import ve from "diagram-js/lib/features/ordering/OrderingProvider";
|
|
29
|
+
import ye from "diagram-js/lib/features/resize";
|
|
30
|
+
import { MODELER_API_VERSION as be } from "@miragon/modeler-api";
|
|
31
31
|
//#region src/io/saveSvg.ts
|
|
32
|
-
var
|
|
32
|
+
var xe = [
|
|
33
33
|
"tabindex",
|
|
34
34
|
"role",
|
|
35
35
|
"aria-label",
|
|
36
36
|
"aria-labelledby"
|
|
37
37
|
];
|
|
38
|
-
function
|
|
38
|
+
function Se(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 xe) r.removeAttribute(e);
|
|
43
43
|
let i = t ?? {
|
|
44
44
|
x: 0,
|
|
45
45
|
y: 0,
|
|
@@ -51,17 +51,17 @@ function be(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 Ce(e) {
|
|
56
56
|
return typeof e == "object" && !!e;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function b(e) {
|
|
59
|
+
return Ce(e) && typeof e.eventStormingType == "string" && !("waypoints" in e);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
61
|
+
function x(e) {
|
|
62
|
+
return Ce(e) && typeof e.eventStormingType == "string" && "waypoints" in e;
|
|
63
63
|
}
|
|
64
|
-
var
|
|
64
|
+
var S = [
|
|
65
65
|
"event",
|
|
66
66
|
"command",
|
|
67
67
|
"actor",
|
|
@@ -71,118 +71,33 @@ var w = [
|
|
|
71
71
|
"external",
|
|
72
72
|
"hotspot"
|
|
73
73
|
];
|
|
74
|
-
function
|
|
75
|
-
return
|
|
74
|
+
function C(e) {
|
|
75
|
+
return S.includes(e);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function w(e) {
|
|
78
|
+
return b(e) && C(e.eventStormingType);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function we(e) {
|
|
81
81
|
return r.includes(e);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Te(e) {
|
|
84
84
|
return s.includes(e);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function Ee(e) {
|
|
87
|
+
return b(e) && we(e.eventStormingType);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function De(e) {
|
|
90
|
+
return b(e) && Te(e.eventStormingType);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function T(e) {
|
|
93
|
+
return b(e) && e.eventStormingType === "drawing";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
95
|
+
function Oe(e) {
|
|
96
|
+
return b(e) && e.eventStormingType === "note";
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
|
-
//#region src/
|
|
100
|
-
|
|
101
|
-
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.`);
|
|
102
|
-
}
|
|
103
|
-
function Ee(e) {
|
|
104
|
-
return typeof e == "number" ? `${e}px` : e;
|
|
105
|
-
}
|
|
106
|
-
var De = class {
|
|
107
|
-
_diagram;
|
|
108
|
-
_container;
|
|
109
|
-
_options;
|
|
110
|
-
constructor(e = {}) {
|
|
111
|
-
this._options = e, this._container = this._createContainer(e);
|
|
112
|
-
}
|
|
113
|
-
_createContainer(e) {
|
|
114
|
-
let t = e.container ?? document.createElement("div");
|
|
115
|
-
return t.classList.add("event-storming-container"), t.style.width = Ee(e.width ?? "100%"), t.style.height = Ee(e.height ?? (e.container ? "100%" : "600px")), t;
|
|
116
|
-
}
|
|
117
|
-
_ensureDiagram() {
|
|
118
|
-
if (!this._diagram) {
|
|
119
|
-
let t = [...this._getModules(), ...this._options.additionalModules ?? []];
|
|
120
|
-
this._diagram = new e({
|
|
121
|
-
canvas: { container: this._container },
|
|
122
|
-
modules: t,
|
|
123
|
-
eventStormingKeyboard: { undoRedoKeys: this._options.undoRedoKeys ?? !0 },
|
|
124
|
-
eventStormingPalette: { freeRectInsets: this._options.freeRectInsets }
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
return this._diagram;
|
|
128
|
-
}
|
|
129
|
-
get(e) {
|
|
130
|
-
return this._ensureDiagram().get(e);
|
|
131
|
-
}
|
|
132
|
-
on(e, t, n = 1e3) {
|
|
133
|
-
this.get("eventBus").on(e, n, t);
|
|
134
|
-
}
|
|
135
|
-
off(e, t) {
|
|
136
|
-
this.get("eventBus").off(e, t);
|
|
137
|
-
}
|
|
138
|
-
async importMap(e) {
|
|
139
|
-
let t = this._ensureDiagram(), n = t.get("eventBus"), r = t.get("eventStormingImporter");
|
|
140
|
-
Te(e);
|
|
141
|
-
let i = t.get("eventStormingLabelEditing", !1);
|
|
142
|
-
i?.suspend(), t.get("popupMenu", !1)?.close(), r.clear();
|
|
143
|
-
let a = r.import(e);
|
|
144
|
-
return t.get("commandStack", !1)?.clear(!1), n.fire("import.done", { warnings: a }), i?.resumeAfterImport(), { warnings: a };
|
|
145
|
-
}
|
|
146
|
-
async importDSL(e) {
|
|
147
|
-
let n = this._ensureDiagram().get("eventBus");
|
|
148
|
-
n.fire("import.parse.start", { text: e });
|
|
149
|
-
let { board: r, diagnostics: i } = t(e);
|
|
150
|
-
n.fire("import.parse.done", {
|
|
151
|
-
board: r,
|
|
152
|
-
diagnostics: i
|
|
153
|
-
});
|
|
154
|
-
let { warnings: a } = await this.importMap(r);
|
|
155
|
-
return { warnings: [...i.map((e) => ({
|
|
156
|
-
message: `Line ${e.line}: ${e.message}`,
|
|
157
|
-
line: e.line,
|
|
158
|
-
source: e.text
|
|
159
|
-
})), ...a] };
|
|
160
|
-
}
|
|
161
|
-
exportMap() {
|
|
162
|
-
return this.get("eventStormingExporter").export();
|
|
163
|
-
}
|
|
164
|
-
exportDSL() {
|
|
165
|
-
return n(this.exportMap());
|
|
166
|
-
}
|
|
167
|
-
async saveSVG() {
|
|
168
|
-
return be(this.get("canvas"), this.get("boardBounds").contentBounds());
|
|
169
|
-
}
|
|
170
|
-
attachTo(e) {
|
|
171
|
-
e.appendChild(this._container), this.get("canvas").resized();
|
|
172
|
-
}
|
|
173
|
-
detach() {
|
|
174
|
-
this._container.remove();
|
|
175
|
-
}
|
|
176
|
-
clear() {
|
|
177
|
-
this._ensureDiagram().clear();
|
|
178
|
-
}
|
|
179
|
-
destroy() {
|
|
180
|
-
this._diagram &&= (this._diagram.destroy(), void 0), this._container.remove();
|
|
181
|
-
}
|
|
182
|
-
get container() {
|
|
183
|
-
return this._container;
|
|
184
|
-
}
|
|
185
|
-
}, A = {
|
|
99
|
+
//#region src/theme/palette.ts
|
|
100
|
+
var E = {
|
|
186
101
|
blau: "#335DE5",
|
|
187
102
|
blauLink: "#2B50D4",
|
|
188
103
|
blauHell: "#6B8AFF",
|
|
@@ -197,7 +112,7 @@ var De = class {
|
|
|
197
112
|
info: "#335DE5",
|
|
198
113
|
navy: "#080A20",
|
|
199
114
|
gradientBrand: "linear-gradient(120deg, #335DE5 30%, #00E676)"
|
|
200
|
-
},
|
|
115
|
+
}, ke = [
|
|
201
116
|
{
|
|
202
117
|
marker: "***",
|
|
203
118
|
bold: !0,
|
|
@@ -214,28 +129,28 @@ var De = class {
|
|
|
214
129
|
italic: !0
|
|
215
130
|
}
|
|
216
131
|
];
|
|
217
|
-
function
|
|
132
|
+
function D(e) {
|
|
218
133
|
return e.split("\n").map((e) => {
|
|
219
134
|
let t = e.startsWith("- ");
|
|
220
135
|
return {
|
|
221
136
|
bullet: t,
|
|
222
|
-
runs:
|
|
137
|
+
runs: Me(t ? e.slice(2) : e)
|
|
223
138
|
};
|
|
224
139
|
});
|
|
225
140
|
}
|
|
226
|
-
function
|
|
141
|
+
function Ae(e) {
|
|
227
142
|
return e.map((e) => {
|
|
228
|
-
let t =
|
|
143
|
+
let t = Pe(e.runs).map((e) => {
|
|
229
144
|
let t = e.bold && e.italic ? "***" : e.bold ? "**" : e.italic ? "*" : "";
|
|
230
145
|
return t + e.text + t;
|
|
231
146
|
}).join("");
|
|
232
147
|
return (e.bullet ? "- " : "") + t;
|
|
233
148
|
}).join("\n");
|
|
234
149
|
}
|
|
235
|
-
function Ae(e) {
|
|
236
|
-
return j(e).map((e) => (e.bullet ? "• " : "") + e.runs.map((e) => e.text).join("")).join("\n");
|
|
237
|
-
}
|
|
238
150
|
function je(e) {
|
|
151
|
+
return D(e).map((e) => (e.bullet ? "• " : "") + e.runs.map((e) => e.text).join("")).join("\n");
|
|
152
|
+
}
|
|
153
|
+
function Me(e) {
|
|
239
154
|
let t = [], n = "", r = () => {
|
|
240
155
|
n && t.push({
|
|
241
156
|
text: n,
|
|
@@ -244,17 +159,17 @@ function je(e) {
|
|
|
244
159
|
}), n = "";
|
|
245
160
|
}, i = 0;
|
|
246
161
|
for (; i < e.length;) {
|
|
247
|
-
let a = e[i] === "*" ?
|
|
162
|
+
let a = e[i] === "*" ? Ne(e, i) : void 0;
|
|
248
163
|
a ? (r(), t.push({
|
|
249
164
|
text: a.content,
|
|
250
165
|
bold: a.bold,
|
|
251
166
|
italic: a.italic
|
|
252
167
|
}), i = a.end) : (n += e[i], i++);
|
|
253
168
|
}
|
|
254
|
-
return r(),
|
|
169
|
+
return r(), Pe(t);
|
|
255
170
|
}
|
|
256
|
-
function
|
|
257
|
-
for (let { marker: n, bold: r, italic: i } of
|
|
171
|
+
function Ne(e, t) {
|
|
172
|
+
for (let { marker: n, bold: r, italic: i } of ke) {
|
|
258
173
|
if (!e.startsWith(n, t)) continue;
|
|
259
174
|
let a = e.indexOf(n, t + n.length);
|
|
260
175
|
if (!(a <= t + n.length)) return {
|
|
@@ -265,7 +180,7 @@ function Me(e, t) {
|
|
|
265
180
|
};
|
|
266
181
|
}
|
|
267
182
|
}
|
|
268
|
-
function
|
|
183
|
+
function Pe(e) {
|
|
269
184
|
let t = [];
|
|
270
185
|
for (let n of e) {
|
|
271
186
|
if (!n.text) continue;
|
|
@@ -280,7 +195,7 @@ function Ne(e) {
|
|
|
280
195
|
}
|
|
281
196
|
//#endregion
|
|
282
197
|
//#region src/draw/styles.ts
|
|
283
|
-
var
|
|
198
|
+
var O = {
|
|
284
199
|
event: {
|
|
285
200
|
label: "Domain Event",
|
|
286
201
|
width: 130,
|
|
@@ -337,43 +252,321 @@ var M = {
|
|
|
337
252
|
fill: "#E85D75",
|
|
338
253
|
stroke: "#C43B55"
|
|
339
254
|
}
|
|
340
|
-
},
|
|
255
|
+
}, k = {
|
|
341
256
|
label: "Note",
|
|
342
257
|
fill: "#ECECEC",
|
|
343
258
|
stroke: "#C4C4C4"
|
|
344
|
-
},
|
|
259
|
+
}, A = {
|
|
345
260
|
width: 60,
|
|
346
261
|
height: 40
|
|
347
|
-
},
|
|
348
|
-
width:
|
|
349
|
-
height:
|
|
262
|
+
}, j = 7.5, Fe = {
|
|
263
|
+
width: O.aggregate.width,
|
|
264
|
+
height: O.aggregate.height
|
|
350
265
|
};
|
|
351
|
-
function
|
|
352
|
-
let t =
|
|
266
|
+
function M(e) {
|
|
267
|
+
let t = je(e), n = (t && t.length ? t : "note").split("\n"), r = Math.max(1, ...n.map((e) => e.length));
|
|
353
268
|
return {
|
|
354
269
|
lines: n,
|
|
355
|
-
width: Math.max(Fe.width, Math.round(r *
|
|
270
|
+
width: Math.max(Fe.width, Math.round(r * j) + 16),
|
|
356
271
|
height: Math.max(Fe.height, n.length * 17 + 16)
|
|
357
272
|
};
|
|
358
273
|
}
|
|
359
|
-
function
|
|
360
|
-
let n =
|
|
274
|
+
function N(e, t) {
|
|
275
|
+
let n = M(e);
|
|
361
276
|
return t.width !== n.width || t.height !== n.height;
|
|
362
277
|
}
|
|
363
|
-
var
|
|
364
|
-
paper:
|
|
365
|
-
ink:
|
|
278
|
+
var P = {
|
|
279
|
+
paper: E.grau,
|
|
280
|
+
ink: E.schwarz,
|
|
366
281
|
inkSoft: "#5B5B5B",
|
|
367
|
-
surface:
|
|
368
|
-
stroke:
|
|
282
|
+
surface: E.weiss,
|
|
283
|
+
stroke: E.schwarz,
|
|
369
284
|
arrow: "#9E9E9E",
|
|
370
|
-
accent:
|
|
285
|
+
accent: E.blau,
|
|
371
286
|
accentSoft: "rgba(51,93,229,0.12)",
|
|
372
|
-
stickyText:
|
|
373
|
-
},
|
|
287
|
+
stickyText: E.schwarz
|
|
288
|
+
}, F = E.schwarz, I = {
|
|
374
289
|
family: "'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif",
|
|
375
290
|
label: 13
|
|
376
|
-
}, Ie = {
|
|
291
|
+
}, Ie = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="event-storming-palette-svg">${e}</svg>`, Le = (e, t, n = 0) => Ie(`<rect x="4" y="5" width="16" height="14" fill="${e}" stroke="${t}" stroke-width="1.5"${n ? ` transform="rotate(${n} 12 12)"` : ""}/>`), Re = (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>`, L = {
|
|
292
|
+
draw: Re("<circle cx=\"19\" cy=\"5\" r=\"2\"/><circle cx=\"5\" cy=\"19\" r=\"2\"/><path d=\"M6.5 17.5 17.5 6.5\"/>"),
|
|
293
|
+
lasso: Re("<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\"/>"),
|
|
294
|
+
note: Le(k.fill, k.stroke)
|
|
295
|
+
};
|
|
296
|
+
for (let e of S) {
|
|
297
|
+
let t = O[e];
|
|
298
|
+
L[e] = Le(t.fill, t.stroke, e === "hotspot" ? -6 : 0);
|
|
299
|
+
}
|
|
300
|
+
function ze(e, t) {
|
|
301
|
+
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
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region src/palette/EventStormingPaletteProvider.ts
|
|
305
|
+
function R(e) {
|
|
306
|
+
if (e.freeArea) return e.freeArea;
|
|
307
|
+
let t = e.freeRectInsets;
|
|
308
|
+
return t ? { insets: t } : void 0;
|
|
309
|
+
}
|
|
310
|
+
var Be = 24, z = "stickies-1", B = "stickies-2", Ve = "stickies-3", He = [
|
|
311
|
+
{
|
|
312
|
+
key: "event",
|
|
313
|
+
type: "event",
|
|
314
|
+
label: O.event.label,
|
|
315
|
+
title: "Domain event",
|
|
316
|
+
shortcut: "E",
|
|
317
|
+
group: z
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
key: "command",
|
|
321
|
+
type: "command",
|
|
322
|
+
label: O.command.label,
|
|
323
|
+
title: "Command",
|
|
324
|
+
shortcut: "C",
|
|
325
|
+
group: z
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
key: "actor",
|
|
329
|
+
type: "actor",
|
|
330
|
+
label: O.actor.label,
|
|
331
|
+
title: "Actor",
|
|
332
|
+
group: z
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
key: "aggregate",
|
|
336
|
+
type: "aggregate",
|
|
337
|
+
label: O.aggregate.label,
|
|
338
|
+
title: "Aggregate",
|
|
339
|
+
group: z
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
key: "policy",
|
|
343
|
+
type: "policy",
|
|
344
|
+
label: O.policy.label,
|
|
345
|
+
title: "Policy",
|
|
346
|
+
group: B
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
key: "readmodel",
|
|
350
|
+
type: "readmodel",
|
|
351
|
+
label: O.readmodel.label,
|
|
352
|
+
title: "Read model",
|
|
353
|
+
group: B
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
key: "external",
|
|
357
|
+
type: "external",
|
|
358
|
+
label: O.external.label,
|
|
359
|
+
title: "External system",
|
|
360
|
+
group: B
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
key: "hotspot",
|
|
364
|
+
type: "hotspot",
|
|
365
|
+
label: O.hotspot.label,
|
|
366
|
+
title: "Hotspot",
|
|
367
|
+
group: Ve
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
key: "note",
|
|
371
|
+
type: "note",
|
|
372
|
+
label: k.label,
|
|
373
|
+
title: "Note",
|
|
374
|
+
group: Ve
|
|
375
|
+
}
|
|
376
|
+
], Ue = class {
|
|
377
|
+
create;
|
|
378
|
+
factory;
|
|
379
|
+
lassoTool;
|
|
380
|
+
drawTool;
|
|
381
|
+
eventStormingModeling;
|
|
382
|
+
canvas;
|
|
383
|
+
modeling;
|
|
384
|
+
selection;
|
|
385
|
+
elementRegistry;
|
|
386
|
+
labelEditing;
|
|
387
|
+
config;
|
|
388
|
+
static $inject = [
|
|
389
|
+
"palette",
|
|
390
|
+
"create",
|
|
391
|
+
"eventStormingElementFactory",
|
|
392
|
+
"lassoTool",
|
|
393
|
+
"eventStormingDrawTool",
|
|
394
|
+
"eventStormingModeling",
|
|
395
|
+
"eventBus",
|
|
396
|
+
"canvas",
|
|
397
|
+
"modeling",
|
|
398
|
+
"selection",
|
|
399
|
+
"elementRegistry",
|
|
400
|
+
"eventStormingLabelEditing",
|
|
401
|
+
"config.eventStormingPalette"
|
|
402
|
+
];
|
|
403
|
+
constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
404
|
+
this.create = t, this.factory = n, this.lassoTool = r, this.drawTool = i, this.eventStormingModeling = a, this.canvas = s, this.modeling = c, this.selection = l, this.elementRegistry = u, this.labelEditing = d, this.config = f, e.registerProvider(this);
|
|
405
|
+
let p = () => e._rebuild();
|
|
406
|
+
o.on("import.done", p), o.on(["commandStack.element.updateProperties.postExecuted", "commandStack.element.updateProperties.reverted"], (e) => {
|
|
407
|
+
e.context.element.id === "event-storming-root" && p();
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
getPaletteEntries() {
|
|
411
|
+
let e = {};
|
|
412
|
+
e["lasso-tool"] = {
|
|
413
|
+
group: "tools",
|
|
414
|
+
title: "Lasso",
|
|
415
|
+
shortcut: "L",
|
|
416
|
+
html: `<div class="entry event-storming-palette-entry">${L.lasso}</div>`,
|
|
417
|
+
action: { click: (e) => this.lassoTool.activateSelection(e) }
|
|
418
|
+
}, e["draw-tool"] = {
|
|
419
|
+
group: "tools",
|
|
420
|
+
title: "Draw",
|
|
421
|
+
html: `<div class="entry event-storming-palette-entry">${L.draw}</div>`,
|
|
422
|
+
action: { click: () => this.drawTool.toggle() }
|
|
423
|
+
};
|
|
424
|
+
let t = c[this.eventStormingModeling.getLevel()];
|
|
425
|
+
for (let n of He) {
|
|
426
|
+
if (n.type !== "note" && !t.includes(n.type)) continue;
|
|
427
|
+
let r = (e) => {
|
|
428
|
+
let t = this.factory.createNew(n.type, n.label);
|
|
429
|
+
We(e) && this.placeInFreeRect(t) || this.create.start(e, t);
|
|
430
|
+
};
|
|
431
|
+
e[`create.${n.key}`] = {
|
|
432
|
+
group: n.group,
|
|
433
|
+
title: n.title,
|
|
434
|
+
...n.shortcut ? { shortcut: n.shortcut } : {},
|
|
435
|
+
html: `<div class="entry event-storming-palette-entry" draggable="true">${L[n.key]}</div>`,
|
|
436
|
+
action: {
|
|
437
|
+
dragstart: r,
|
|
438
|
+
click: r
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
return e;
|
|
443
|
+
}
|
|
444
|
+
placeInFreeRect(e) {
|
|
445
|
+
let { canvas: t, modeling: n, selection: r, elementRegistry: i } = this;
|
|
446
|
+
if (!t || !n || !r || !i) return !1;
|
|
447
|
+
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);
|
|
448
|
+
for (; o(a);) a.x += Be, a.y += Be;
|
|
449
|
+
let s = n.createShape(e, a, t.getRootElement());
|
|
450
|
+
return r.select(s), t.focus(), this.labelEditing?.activate(s), !0;
|
|
451
|
+
}
|
|
452
|
+
freeAreaCentre(e) {
|
|
453
|
+
let t = this.config && R(this.config), n = t?.center?.();
|
|
454
|
+
if (n) return {
|
|
455
|
+
x: n.x,
|
|
456
|
+
y: n.y
|
|
457
|
+
};
|
|
458
|
+
let r = e.viewbox(), i = t?.insets?.() ?? {
|
|
459
|
+
top: 0,
|
|
460
|
+
right: 0,
|
|
461
|
+
bottom: 0,
|
|
462
|
+
left: 0
|
|
463
|
+
}, a = Math.max(0, r.outer.width - i.left - i.right), o = Math.max(0, r.outer.height - i.top - i.bottom);
|
|
464
|
+
return {
|
|
465
|
+
x: r.x + (i.left + a / 2) / r.scale,
|
|
466
|
+
y: r.y + (i.top + o / 2) / r.scale
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
function We(e) {
|
|
471
|
+
return e.type === "click" && e.detail === 0;
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region src/EventStormingBaseViewer.ts
|
|
475
|
+
function Ge(e) {
|
|
476
|
+
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
|
+
}
|
|
478
|
+
function Ke(e) {
|
|
479
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
480
|
+
}
|
|
481
|
+
var qe = class {
|
|
482
|
+
_diagram;
|
|
483
|
+
_container;
|
|
484
|
+
_options;
|
|
485
|
+
constructor(e = {}) {
|
|
486
|
+
this._options = e, this._container = this._createContainer(e);
|
|
487
|
+
}
|
|
488
|
+
_createContainer(e) {
|
|
489
|
+
let t = e.container ?? document.createElement("div");
|
|
490
|
+
return t.classList.add("event-storming-container"), t.style.width = Ke(e.width ?? "100%"), t.style.height = Ke(e.height ?? (e.container ? "100%" : "600px")), t;
|
|
491
|
+
}
|
|
492
|
+
_ensureDiagram() {
|
|
493
|
+
if (!this._diagram) {
|
|
494
|
+
let t = [...this._getModules(), ...this._options.additionalModules ?? []];
|
|
495
|
+
this._diagram = new e({
|
|
496
|
+
canvas: { container: this._container },
|
|
497
|
+
modules: t,
|
|
498
|
+
eventStormingKeyboard: { undoRedoKeys: this._options.undoRedoKeys ?? !0 },
|
|
499
|
+
eventStormingPalette: { freeArea: R(this._options) },
|
|
500
|
+
eventStormingImporter: { fitOnImport: this._options.fitOnImport ?? !0 }
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
return this._diagram;
|
|
504
|
+
}
|
|
505
|
+
get(e) {
|
|
506
|
+
return this._ensureDiagram().get(e);
|
|
507
|
+
}
|
|
508
|
+
on(e, t, n = 1e3) {
|
|
509
|
+
this.get("eventBus").on(e, n, t);
|
|
510
|
+
}
|
|
511
|
+
off(e, t) {
|
|
512
|
+
this.get("eventBus").off(e, t);
|
|
513
|
+
}
|
|
514
|
+
async importMap(e) {
|
|
515
|
+
let t = this._ensureDiagram(), n = t.get("eventBus"), r = t.get("eventStormingImporter");
|
|
516
|
+
Ge(e);
|
|
517
|
+
let i = t.get("eventStormingLabelEditing", !1);
|
|
518
|
+
i?.suspend(), t.get("popupMenu", !1)?.close(), r.clear();
|
|
519
|
+
let a = r.import(e);
|
|
520
|
+
return t.get("commandStack", !1)?.clear(!1), n.fire("import.done", { warnings: a }), i?.resumeAfterImport(), { warnings: a };
|
|
521
|
+
}
|
|
522
|
+
async importDSL(e) {
|
|
523
|
+
let n = this._ensureDiagram().get("eventBus");
|
|
524
|
+
n.fire("import.parse.start", { text: e });
|
|
525
|
+
let { board: r, diagnostics: i } = t(e);
|
|
526
|
+
n.fire("import.parse.done", {
|
|
527
|
+
board: r,
|
|
528
|
+
diagnostics: i
|
|
529
|
+
});
|
|
530
|
+
let { warnings: a } = await this.importMap(r);
|
|
531
|
+
return { warnings: [...i.map((e) => ({
|
|
532
|
+
message: `Line ${e.line}: ${e.message}`,
|
|
533
|
+
line: e.line,
|
|
534
|
+
source: e.text
|
|
535
|
+
})), ...a] };
|
|
536
|
+
}
|
|
537
|
+
exportMap() {
|
|
538
|
+
return this.get("eventStormingExporter").export();
|
|
539
|
+
}
|
|
540
|
+
exportDSL() {
|
|
541
|
+
return n(this.exportMap());
|
|
542
|
+
}
|
|
543
|
+
async saveSVG() {
|
|
544
|
+
return Se(this.get("canvas"), this.get("boardBounds").contentBounds());
|
|
545
|
+
}
|
|
546
|
+
attachTo(e) {
|
|
547
|
+
e.appendChild(this._container), this.get("canvas").resized();
|
|
548
|
+
}
|
|
549
|
+
detach() {
|
|
550
|
+
this._container.remove();
|
|
551
|
+
}
|
|
552
|
+
clear() {
|
|
553
|
+
this._ensureDiagram().clear();
|
|
554
|
+
}
|
|
555
|
+
destroy() {
|
|
556
|
+
this._diagram &&= (this._diagram.destroy(), void 0), this._container.remove();
|
|
557
|
+
}
|
|
558
|
+
get container() {
|
|
559
|
+
return this._container;
|
|
560
|
+
}
|
|
561
|
+
}, Je = "0123456789abcdefghijklmnopqrstuvwxyz", Ye = 252;
|
|
562
|
+
function Xe() {
|
|
563
|
+
let e = "";
|
|
564
|
+
for (; e.length < 8;) for (let t of globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8))) t >= Ye || e.length === 8 || (e += Je[t % 36]);
|
|
565
|
+
return e;
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/model/EventStormingElementFactory.ts
|
|
569
|
+
var Ze = {
|
|
377
570
|
event: "event",
|
|
378
571
|
command: "cmd",
|
|
379
572
|
actor: "actor",
|
|
@@ -384,7 +577,7 @@ var L = {
|
|
|
384
577
|
hotspot: "hot",
|
|
385
578
|
note: "note",
|
|
386
579
|
drawing: "draw"
|
|
387
|
-
},
|
|
580
|
+
}, Qe = class {
|
|
388
581
|
elementFactory;
|
|
389
582
|
elementRegistry;
|
|
390
583
|
static $inject = ["elementFactory", "elementRegistry"];
|
|
@@ -403,15 +596,15 @@ var L = {
|
|
|
403
596
|
return `${e} ${n}`;
|
|
404
597
|
}
|
|
405
598
|
allocateId(e, t) {
|
|
406
|
-
let n =
|
|
407
|
-
for (
|
|
408
|
-
let
|
|
409
|
-
if (!this.elementRegistry.get(
|
|
599
|
+
let n = Ze[e];
|
|
600
|
+
for (;;) {
|
|
601
|
+
let e = `${n}_${Xe()}`;
|
|
602
|
+
if (!this.elementRegistry.get(e) && !t?.has(e)) return e;
|
|
410
603
|
}
|
|
411
604
|
}
|
|
412
605
|
createSticky(e) {
|
|
413
|
-
if (!
|
|
414
|
-
let { width: t, height: n } =
|
|
606
|
+
if (!C(e.elementType)) throw Error(`not a sticky kind: ${e.elementType}`);
|
|
607
|
+
let { width: t, height: n } = O[e.elementType];
|
|
415
608
|
return this.elementFactory.createShape({
|
|
416
609
|
id: e.id,
|
|
417
610
|
x: e.position.x - t / 2,
|
|
@@ -425,7 +618,7 @@ var L = {
|
|
|
425
618
|
});
|
|
426
619
|
}
|
|
427
620
|
createNote(e) {
|
|
428
|
-
let { width: t, height: n } = e.size ??
|
|
621
|
+
let { width: t, height: n } = e.size ?? M(e.label), r = e.align?.horizontal, i = e.align?.vertical;
|
|
429
622
|
return this.elementFactory.createShape({
|
|
430
623
|
id: e.id,
|
|
431
624
|
x: e.position.x - t / 2,
|
|
@@ -470,7 +663,7 @@ var L = {
|
|
|
470
663
|
});
|
|
471
664
|
}
|
|
472
665
|
createNew(e, t) {
|
|
473
|
-
let n = this.uniqueLabel(t), { width: r, height: i } =
|
|
666
|
+
let n = this.uniqueLabel(t), { width: r, height: i } = C(e) ? O[e] : M(n);
|
|
474
667
|
return this.elementFactory.createShape({
|
|
475
668
|
id: this.allocateId(e),
|
|
476
669
|
width: r,
|
|
@@ -480,7 +673,7 @@ var L = {
|
|
|
480
673
|
});
|
|
481
674
|
}
|
|
482
675
|
createProvisional() {
|
|
483
|
-
let { width: e, height: t } =
|
|
676
|
+
let { width: e, height: t } = O.event;
|
|
484
677
|
return this.elementFactory.createShape({
|
|
485
678
|
id: this.allocateId("event"),
|
|
486
679
|
width: e,
|
|
@@ -495,14 +688,14 @@ var L = {
|
|
|
495
688
|
id: e.id,
|
|
496
689
|
source: t,
|
|
497
690
|
target: n,
|
|
498
|
-
waypoints: [
|
|
691
|
+
waypoints: [$e(t), $e(n)],
|
|
499
692
|
eventStormingType: "arrow",
|
|
500
693
|
...e.label ? { linkLabel: e.label } : {},
|
|
501
694
|
businessObject: e
|
|
502
695
|
});
|
|
503
696
|
}
|
|
504
697
|
};
|
|
505
|
-
function
|
|
698
|
+
function $e(e) {
|
|
506
699
|
return {
|
|
507
700
|
x: e.x + e.width / 2,
|
|
508
701
|
y: e.y + e.height / 2
|
|
@@ -510,13 +703,13 @@ function Re(e) {
|
|
|
510
703
|
}
|
|
511
704
|
//#endregion
|
|
512
705
|
//#region src/model/index.ts
|
|
513
|
-
var
|
|
706
|
+
var et = { eventStormingElementFactory: ["type", Qe] };
|
|
514
707
|
//#endregion
|
|
515
708
|
//#region src/board-bounds/BoardBounds.ts
|
|
516
|
-
function
|
|
709
|
+
function tt(e) {
|
|
517
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";
|
|
518
711
|
}
|
|
519
|
-
var
|
|
712
|
+
var nt = class {
|
|
520
713
|
elementRegistry;
|
|
521
714
|
static $inject = ["elementRegistry"];
|
|
522
715
|
constructor(e) {
|
|
@@ -541,9 +734,9 @@ var Ve = class {
|
|
|
541
734
|
return this.positionedShapes().length === 0;
|
|
542
735
|
}
|
|
543
736
|
positionedShapes() {
|
|
544
|
-
return this.elementRegistry.getAll().filter(
|
|
737
|
+
return this.elementRegistry.getAll().filter(tt);
|
|
545
738
|
}
|
|
546
|
-
},
|
|
739
|
+
}, rt = { boardBounds: ["type", nt] }, it = "eventStorming.viewOptions.changed", at = class {
|
|
547
740
|
eventBus;
|
|
548
741
|
elementRegistry;
|
|
549
742
|
static $inject = ["eventBus", "elementRegistry"];
|
|
@@ -556,15 +749,15 @@ var Ve = class {
|
|
|
556
749
|
}
|
|
557
750
|
setTypeCaptionsVisible(e) {
|
|
558
751
|
if (e === this._typeCaptionsVisible) return;
|
|
559
|
-
this._typeCaptionsVisible = e, this.eventBus.fire(
|
|
560
|
-
let t = this.elementRegistry.filter(
|
|
752
|
+
this._typeCaptionsVisible = e, this.eventBus.fire(it, { typeCaptionsVisible: e });
|
|
753
|
+
let t = this.elementRegistry.filter(w);
|
|
561
754
|
t.length && this.eventBus.fire("elements.changed", { elements: t });
|
|
562
755
|
}
|
|
563
|
-
},
|
|
756
|
+
}, V = {
|
|
564
757
|
__depends__: [u],
|
|
565
|
-
eventStormingViewOptions: ["type",
|
|
566
|
-
},
|
|
567
|
-
function
|
|
758
|
+
eventStormingViewOptions: ["type", at]
|
|
759
|
+
}, ot = 1500, st = -3, ct = "event-storming-kind-caption", lt = 9, ut = 300, dt = P.stickyText, ft = 7, pt = "#FBFBFB", mt = "#B9B9B9", ht = "6 4", gt = "event-storming-sticky-shadow";
|
|
760
|
+
function _t(e) {
|
|
568
761
|
let t = e.closest("svg");
|
|
569
762
|
if (!t) return !1;
|
|
570
763
|
if (t.querySelector("#event-storming-sticky-shadow")) return !0;
|
|
@@ -575,7 +768,7 @@ function rt(e) {
|
|
|
575
768
|
"flood-color": "#000000",
|
|
576
769
|
"flood-opacity": .2
|
|
577
770
|
}), r = p(m("filter"), {
|
|
578
|
-
id:
|
|
771
|
+
id: gt,
|
|
579
772
|
x: "-40%",
|
|
580
773
|
y: "-40%",
|
|
581
774
|
width: "180%",
|
|
@@ -585,14 +778,14 @@ function rt(e) {
|
|
|
585
778
|
let i = m("defs");
|
|
586
779
|
return f(i, r), t.insertBefore(i, t.firstChild), !0;
|
|
587
780
|
}
|
|
588
|
-
var
|
|
781
|
+
var vt = class extends d {
|
|
589
782
|
viewOptions;
|
|
590
783
|
static $inject = ["eventBus", "eventStormingViewOptions"];
|
|
591
784
|
constructor(e, t) {
|
|
592
|
-
super(e,
|
|
785
|
+
super(e, ot), this.viewOptions = t;
|
|
593
786
|
}
|
|
594
787
|
canRender(e) {
|
|
595
|
-
return
|
|
788
|
+
return b(e) || x(e);
|
|
596
789
|
}
|
|
597
790
|
drawShape(e, t) {
|
|
598
791
|
let n = t;
|
|
@@ -602,7 +795,7 @@ var it = class extends d {
|
|
|
602
795
|
let n = t.drawingPoints ?? [], r = t.strokeStyle === "dashed" ? "8 5" : t.strokeStyle === "dotted" ? "2 4" : void 0, i = p(m(t.closed ? "polygon" : "polyline"), {
|
|
603
796
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
604
797
|
fill: "none",
|
|
605
|
-
stroke: t.color ??
|
|
798
|
+
stroke: t.color ?? F,
|
|
606
799
|
"stroke-width": 2,
|
|
607
800
|
"stroke-linecap": "round",
|
|
608
801
|
"stroke-linejoin": "round",
|
|
@@ -611,9 +804,9 @@ var it = class extends d {
|
|
|
611
804
|
return f(e, i), i;
|
|
612
805
|
}
|
|
613
806
|
drawSticky(e, t) {
|
|
614
|
-
let n = t.eventStormingType, r =
|
|
807
|
+
let n = t.eventStormingType, r = C(n) ? O[n] : k, i = t.provisional === !0, a = e;
|
|
615
808
|
if (n === "hotspot") {
|
|
616
|
-
let n = p(m("g"), { transform: `rotate(${
|
|
809
|
+
let n = p(m("g"), { transform: `rotate(${st} ${t.width / 2} ${t.height / 2})` });
|
|
617
810
|
f(e, n), a = n;
|
|
618
811
|
}
|
|
619
812
|
let o = p(m("rect"), {
|
|
@@ -622,37 +815,37 @@ var it = class extends d {
|
|
|
622
815
|
width: Math.max(t.width, 1),
|
|
623
816
|
height: Math.max(t.height, 1),
|
|
624
817
|
rx: 0,
|
|
625
|
-
fill: i ?
|
|
626
|
-
stroke: i ?
|
|
818
|
+
fill: i ? pt : t.color ?? r.fill,
|
|
819
|
+
stroke: i ? mt : r.stroke,
|
|
627
820
|
"stroke-width": 1.5,
|
|
628
|
-
...i ? { "stroke-dasharray":
|
|
821
|
+
...i ? { "stroke-dasharray": ht } : {}
|
|
629
822
|
});
|
|
630
|
-
if (
|
|
631
|
-
if (n === "note" ?
|
|
632
|
-
let e =
|
|
823
|
+
if (_t(e) && o.setAttribute("filter", `url(#${gt})`), f(a, o), i) return o;
|
|
824
|
+
if (n === "note" ? Ct(a, t) : bt(a, t), C(n) && this.viewOptions.typeCaptionsVisible()) {
|
|
825
|
+
let e = H(O[n].label, t.width / 2, t.height - ft, {
|
|
633
826
|
"text-anchor": "middle",
|
|
634
|
-
"font-size":
|
|
635
|
-
fill:
|
|
827
|
+
"font-size": lt,
|
|
828
|
+
fill: dt
|
|
636
829
|
});
|
|
637
|
-
e.setAttribute("class",
|
|
830
|
+
e.setAttribute("class", ct), e.setAttribute("font-weight", String(ut)), f(a, e);
|
|
638
831
|
}
|
|
639
832
|
return o;
|
|
640
833
|
}
|
|
641
834
|
drawConnection(e, t) {
|
|
642
|
-
let n = t, [r, i] =
|
|
835
|
+
let n = t, [r, i] = At(n), a = p(m("polyline"), {
|
|
643
836
|
points: `${r.x},${r.y} ${i.x},${i.y}`,
|
|
644
837
|
fill: "none",
|
|
645
|
-
stroke:
|
|
838
|
+
stroke: P.arrow,
|
|
646
839
|
"stroke-width": 1.5,
|
|
647
840
|
"stroke-linecap": "round"
|
|
648
841
|
});
|
|
649
|
-
if (f(e, a), f(e,
|
|
842
|
+
if (f(e, a), f(e, Ot(r, i, P.arrow, 11, 5)), n.linkLabel) {
|
|
650
843
|
let t = (r.x + i.x) / 2, a = (r.y + i.y) / 2;
|
|
651
|
-
f(e,
|
|
844
|
+
f(e, H(n.linkLabel, t, a - 5, {
|
|
652
845
|
"text-anchor": "middle",
|
|
653
846
|
"font-size": 11,
|
|
654
847
|
"font-style": "italic",
|
|
655
|
-
fill:
|
|
848
|
+
fill: P.inkSoft
|
|
656
849
|
}));
|
|
657
850
|
}
|
|
658
851
|
return a;
|
|
@@ -666,7 +859,7 @@ var it = class extends d {
|
|
|
666
859
|
return t ? `M${t.x},${t.y}` + n.map((e) => `L${e.x},${e.y}`).join("") : "";
|
|
667
860
|
}
|
|
668
861
|
};
|
|
669
|
-
function
|
|
862
|
+
function yt(e, t) {
|
|
670
863
|
let n = e.split(/\s+/).filter((e) => e.length);
|
|
671
864
|
if (!n.length) return [""];
|
|
672
865
|
let r = [], i = "";
|
|
@@ -683,25 +876,25 @@ function at(e, t) {
|
|
|
683
876
|
}
|
|
684
877
|
return r.push(i), r;
|
|
685
878
|
}
|
|
686
|
-
function
|
|
687
|
-
let n = t.width - 16, r = Math.max(1, Math.floor(n /
|
|
879
|
+
function bt(e, t) {
|
|
880
|
+
let n = t.width - 16, r = Math.max(1, Math.floor(n / j)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = (t.eventStormingLabel ?? "").split("\n").flatMap((e) => yt(e, r)).slice(0, i), o = t.width / 2, s = t.height / 2 - (a.length - 1) * 17 / 2 + 4;
|
|
688
881
|
a.forEach((t, n) => {
|
|
689
|
-
f(e,
|
|
882
|
+
f(e, H(t, o, s + n * 17, {
|
|
690
883
|
"text-anchor": "middle",
|
|
691
|
-
fill:
|
|
884
|
+
fill: P.stickyText
|
|
692
885
|
}));
|
|
693
886
|
});
|
|
694
887
|
}
|
|
695
|
-
var
|
|
696
|
-
function
|
|
697
|
-
let n = t.width - 16, r = Math.max(1, Math.floor(n /
|
|
888
|
+
var xt = 2, St = 12.5;
|
|
889
|
+
function Ct(e, t) {
|
|
890
|
+
let n = t.width - 16, r = Math.max(1, Math.floor(n / j)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = D(t.eventStormingLabel ?? "").flatMap((e) => wt(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;
|
|
698
891
|
a.forEach((n, r) => {
|
|
699
892
|
let i = o === "left" ? 8 + (n.indent ? 12 : 0) : o === "center" ? t.width / 2 : t.width - 8, a = p(m("text"), {
|
|
700
893
|
x: i,
|
|
701
|
-
y: u + r * 17 +
|
|
702
|
-
"font-family":
|
|
703
|
-
"font-size":
|
|
704
|
-
fill:
|
|
894
|
+
y: u + r * 17 + St,
|
|
895
|
+
"font-family": I.family,
|
|
896
|
+
"font-size": I.label,
|
|
897
|
+
fill: P.stickyText,
|
|
705
898
|
"text-anchor": c
|
|
706
899
|
}), s = n.marker ? [{
|
|
707
900
|
text: "• ",
|
|
@@ -715,19 +908,19 @@ function lt(e, t) {
|
|
|
715
908
|
f(e, a);
|
|
716
909
|
});
|
|
717
910
|
}
|
|
718
|
-
function
|
|
719
|
-
let n = Math.max(1, t - (e.bullet ?
|
|
720
|
-
return
|
|
911
|
+
function wt(e, t) {
|
|
912
|
+
let n = Math.max(1, t - (e.bullet ? xt : 0));
|
|
913
|
+
return Tt(e.runs, n).map((t, n) => ({
|
|
721
914
|
runs: t,
|
|
722
915
|
marker: e.bullet && n === 0,
|
|
723
916
|
indent: e.bullet && n > 0
|
|
724
917
|
}));
|
|
725
918
|
}
|
|
726
|
-
function
|
|
919
|
+
function Tt(e, t) {
|
|
727
920
|
let n = e.map((e) => e.text).join("");
|
|
728
|
-
return n.length <= t ? [e] :
|
|
921
|
+
return n.length <= t ? [e] : Et(n, t).map(([t, n]) => Dt(e, t, n));
|
|
729
922
|
}
|
|
730
|
-
function
|
|
923
|
+
function Et(e, t) {
|
|
731
924
|
let n = [...e.matchAll(/\S+/g)];
|
|
732
925
|
if (!n.length) return [[0, 0]];
|
|
733
926
|
let r = [], i = -1, a = -1, o = () => {
|
|
@@ -742,7 +935,7 @@ function ft(e, t) {
|
|
|
742
935
|
}
|
|
743
936
|
return o(), r;
|
|
744
937
|
}
|
|
745
|
-
function
|
|
938
|
+
function Dt(e, t, n) {
|
|
746
939
|
let r = [], i = 0;
|
|
747
940
|
for (let a of e) {
|
|
748
941
|
let e = i;
|
|
@@ -756,32 +949,32 @@ function pt(e, t, n) {
|
|
|
756
949
|
}
|
|
757
950
|
return r;
|
|
758
951
|
}
|
|
759
|
-
function
|
|
952
|
+
function H(e, t, n, r = {}) {
|
|
760
953
|
let i = p(m("text"), {
|
|
761
954
|
x: t,
|
|
762
955
|
y: n,
|
|
763
|
-
"font-family":
|
|
764
|
-
"font-size":
|
|
765
|
-
fill:
|
|
956
|
+
"font-family": I.family,
|
|
957
|
+
"font-size": I.label,
|
|
958
|
+
fill: P.ink,
|
|
766
959
|
...r
|
|
767
960
|
});
|
|
768
961
|
return i.textContent = e, i;
|
|
769
962
|
}
|
|
770
|
-
function
|
|
963
|
+
function Ot(e, t, n, r = 10, i = 5) {
|
|
771
964
|
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)}`;
|
|
772
965
|
return p(m("polygon"), {
|
|
773
966
|
points: c,
|
|
774
967
|
fill: n
|
|
775
968
|
});
|
|
776
969
|
}
|
|
777
|
-
function
|
|
970
|
+
function U(e) {
|
|
778
971
|
return {
|
|
779
972
|
x: e.x + e.width / 2,
|
|
780
973
|
y: e.y + e.height / 2
|
|
781
974
|
};
|
|
782
975
|
}
|
|
783
|
-
function
|
|
784
|
-
let n =
|
|
976
|
+
function kt(e, t) {
|
|
977
|
+
let n = U(e), r = t.x - n.x, i = t.y - n.y;
|
|
785
978
|
if (r === 0 && i === 0) return n;
|
|
786
979
|
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));
|
|
787
980
|
return {
|
|
@@ -789,7 +982,7 @@ function _t(e, t) {
|
|
|
789
982
|
y: n.y + i * s
|
|
790
983
|
};
|
|
791
984
|
}
|
|
792
|
-
function
|
|
985
|
+
function At(e) {
|
|
793
986
|
let t = e.source, n = e.target, r = e.waypoints;
|
|
794
987
|
if (!t || !n) {
|
|
795
988
|
let e = r[0] ?? {
|
|
@@ -798,32 +991,34 @@ function vt(e) {
|
|
|
798
991
|
};
|
|
799
992
|
return [e, r[r.length - 1] ?? e];
|
|
800
993
|
}
|
|
801
|
-
let i =
|
|
994
|
+
let i = U(t), a = U(n), o = kt(t, a), s = kt(n, i);
|
|
802
995
|
return (a.x - i.x) * (s.x - o.x) + (a.y - i.y) * (s.y - o.y) <= 0 ? [i, a] : [o, s];
|
|
803
996
|
}
|
|
804
997
|
//#endregion
|
|
805
998
|
//#region src/draw/index.ts
|
|
806
|
-
var
|
|
807
|
-
__depends__: [
|
|
999
|
+
var jt = {
|
|
1000
|
+
__depends__: [V],
|
|
808
1001
|
__init__: ["eventStormingRenderer"],
|
|
809
|
-
eventStormingRenderer: ["type",
|
|
810
|
-
},
|
|
1002
|
+
eventStormingRenderer: ["type", vt]
|
|
1003
|
+
}, Mt = { drawing: 0 }, Nt = .001, Pt = class {
|
|
811
1004
|
canvas;
|
|
812
1005
|
elementFactory;
|
|
813
1006
|
factory;
|
|
814
1007
|
boardBounds;
|
|
815
1008
|
eventBus;
|
|
816
1009
|
elementRegistry;
|
|
1010
|
+
config;
|
|
817
1011
|
static $inject = [
|
|
818
1012
|
"canvas",
|
|
819
1013
|
"elementFactory",
|
|
820
1014
|
"eventStormingElementFactory",
|
|
821
1015
|
"boardBounds",
|
|
822
1016
|
"eventBus",
|
|
823
|
-
"elementRegistry"
|
|
1017
|
+
"elementRegistry",
|
|
1018
|
+
"config.eventStormingImporter"
|
|
824
1019
|
];
|
|
825
|
-
constructor(e, t, n, r, i, a) {
|
|
826
|
-
this.canvas = e, this.elementFactory = t, this.factory = n, this.boardBounds = r, this.eventBus = i, this.elementRegistry = a;
|
|
1020
|
+
constructor(e, t, n, r, i, a, o) {
|
|
1021
|
+
this.canvas = e, this.elementFactory = t, this.factory = n, this.boardBounds = r, this.eventBus = i, this.elementRegistry = a, this.config = o;
|
|
827
1022
|
}
|
|
828
1023
|
import(e) {
|
|
829
1024
|
let t = [];
|
|
@@ -833,7 +1028,7 @@ var yt = {
|
|
|
833
1028
|
...e.rawPassthrough ? { rawPassthrough: e.rawPassthrough } : {}
|
|
834
1029
|
}, r = this.boardRoot();
|
|
835
1030
|
r.businessObject = n;
|
|
836
|
-
let i = /* @__PURE__ */ new Map(), a = [...e.elements].sort((e, t) => (
|
|
1031
|
+
let i = /* @__PURE__ */ new Map(), a = [...e.elements].sort((e, t) => (Mt[e.elementType] ?? 9) - (Mt[t.elementType] ?? 9)), o = a.filter((e) => e.elementType === "drawing"), s = a.filter((e) => e.elementType !== "drawing");
|
|
837
1032
|
for (let e of o) {
|
|
838
1033
|
let t = this.createShape(e);
|
|
839
1034
|
this.canvas.addShape(t, r), i.set(e.id, t);
|
|
@@ -846,7 +1041,7 @@ var yt = {
|
|
|
846
1041
|
let n = "attachedTo" in e ? e.attachedTo : void 0;
|
|
847
1042
|
if (!n) continue;
|
|
848
1043
|
let r = i.get(n);
|
|
849
|
-
!r || !
|
|
1044
|
+
!r || !De(r) ? t.push({
|
|
850
1045
|
message: `“${e.id}” is pinned to “${n}”, which isn't on the board or can't hold a pin. It stays unpinned.`,
|
|
851
1046
|
elementId: e.id
|
|
852
1047
|
}) : i.get(e.id).host = r;
|
|
@@ -863,11 +1058,11 @@ var yt = {
|
|
|
863
1058
|
let s = this.factory.createArrow(n, e, a);
|
|
864
1059
|
this.canvas.addConnection(s, r, o.length);
|
|
865
1060
|
}
|
|
866
|
-
return this.fitToContent(), this.eventBus.fire("import.render.done", { warnings: t }), t;
|
|
1061
|
+
return this.config?.fitOnImport !== !1 && this.fitToContent(), this.eventBus.fire("import.render.done", { warnings: t }), t;
|
|
867
1062
|
}
|
|
868
1063
|
boardRoot() {
|
|
869
|
-
let e = this.elementRegistry.get(
|
|
870
|
-
e || (e = this.elementFactory.createRoot({ id:
|
|
1064
|
+
let e = this.elementRegistry.get(y);
|
|
1065
|
+
e || (e = this.elementFactory.createRoot({ id: y }), this.canvas.setRootElement(e));
|
|
871
1066
|
for (let t of this.canvas.getRootElements()) t !== e && this.canvas.removeRootElement(t);
|
|
872
1067
|
return e;
|
|
873
1068
|
}
|
|
@@ -877,7 +1072,7 @@ var yt = {
|
|
|
877
1072
|
this.canvas.viewbox(e);
|
|
878
1073
|
return;
|
|
879
1074
|
}
|
|
880
|
-
let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1),
|
|
1075
|
+
let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1), Nt);
|
|
881
1076
|
this.canvas.viewbox({
|
|
882
1077
|
x: e.x + e.width / 2 - t / 2 / r,
|
|
883
1078
|
y: e.y + e.height / 2 - n / 2 / r,
|
|
@@ -902,23 +1097,23 @@ var yt = {
|
|
|
902
1097
|
} catch {}
|
|
903
1098
|
}
|
|
904
1099
|
}
|
|
905
|
-
},
|
|
1100
|
+
}, Ft = class {
|
|
906
1101
|
elementRegistry;
|
|
907
1102
|
static $inject = ["elementRegistry"];
|
|
908
1103
|
constructor(e) {
|
|
909
1104
|
this.elementRegistry = e;
|
|
910
1105
|
}
|
|
911
1106
|
export() {
|
|
912
|
-
let e = this.elementRegistry.get(
|
|
1107
|
+
let e = this.elementRegistry.get(y)?.businessObject, t = e?.config ?? { title: "Untitled Board" }, n = [], r = [];
|
|
913
1108
|
for (let e of this.elementRegistry.getAll()) if (e.id !== "event-storming-root") {
|
|
914
|
-
if (
|
|
1109
|
+
if (x(e)) r.push({
|
|
915
1110
|
id: e.id,
|
|
916
1111
|
edgeType: "arrow",
|
|
917
1112
|
from: e.source?.id ?? "",
|
|
918
1113
|
to: e.target?.id ?? "",
|
|
919
1114
|
...e.linkLabel ? { label: e.linkLabel } : {}
|
|
920
1115
|
});
|
|
921
|
-
else if (
|
|
1116
|
+
else if (b(e)) {
|
|
922
1117
|
let t = this.buildElement(e);
|
|
923
1118
|
t && n.push(t);
|
|
924
1119
|
}
|
|
@@ -949,10 +1144,10 @@ var yt = {
|
|
|
949
1144
|
...e.color ? { color: e.color } : {}
|
|
950
1145
|
};
|
|
951
1146
|
}
|
|
952
|
-
let t = e.eventStormingType === "note" &&
|
|
1147
|
+
let t = e.eventStormingType === "note" && N(e.eventStormingLabel, e) ? {
|
|
953
1148
|
width: e.width,
|
|
954
1149
|
height: e.height
|
|
955
|
-
} : void 0, n = e.eventStormingType === "note" ?
|
|
1150
|
+
} : void 0, n = e.eventStormingType === "note" ? It(e) : void 0;
|
|
956
1151
|
return {
|
|
957
1152
|
id: e.id,
|
|
958
1153
|
elementType: e.eventStormingType,
|
|
@@ -968,7 +1163,7 @@ var yt = {
|
|
|
968
1163
|
};
|
|
969
1164
|
}
|
|
970
1165
|
};
|
|
971
|
-
function
|
|
1166
|
+
function It(e) {
|
|
972
1167
|
let t = e.alignHorizontal && e.alignHorizontal !== "left" ? e.alignHorizontal : void 0, n = e.alignVertical && e.alignVertical !== "top" ? e.alignVertical : void 0;
|
|
973
1168
|
if (t || n) return {
|
|
974
1169
|
...t ? { horizontal: t } : {},
|
|
@@ -977,25 +1172,25 @@ function wt(e) {
|
|
|
977
1172
|
}
|
|
978
1173
|
//#endregion
|
|
979
1174
|
//#region src/io/warnings.ts
|
|
980
|
-
function
|
|
1175
|
+
function Lt(e) {
|
|
981
1176
|
return e.source === void 0 ? e.message : `${e.message} (“${e.source}”)`;
|
|
982
1177
|
}
|
|
983
1178
|
//#endregion
|
|
984
1179
|
//#region src/io/index.ts
|
|
985
|
-
var
|
|
986
|
-
eventStormingImporter: ["type",
|
|
987
|
-
eventStormingExporter: ["type",
|
|
988
|
-
},
|
|
1180
|
+
var Rt = {
|
|
1181
|
+
eventStormingImporter: ["type", Pt],
|
|
1182
|
+
eventStormingExporter: ["type", Ft]
|
|
1183
|
+
}, zt = class extends qe {
|
|
989
1184
|
_getModules() {
|
|
990
1185
|
return [
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1186
|
+
et,
|
|
1187
|
+
rt,
|
|
1188
|
+
V,
|
|
1189
|
+
jt,
|
|
1190
|
+
Rt
|
|
996
1191
|
];
|
|
997
1192
|
}
|
|
998
|
-
},
|
|
1193
|
+
}, W = class extends zt {
|
|
999
1194
|
_getModules() {
|
|
1000
1195
|
return [
|
|
1001
1196
|
...super._getModules(),
|
|
@@ -1005,34 +1200,34 @@ var Et = {
|
|
|
1005
1200
|
ee
|
|
1006
1201
|
];
|
|
1007
1202
|
}
|
|
1008
|
-
},
|
|
1203
|
+
}, Bt = class extends de {
|
|
1009
1204
|
static $inject = ["eventBus", "modeling"];
|
|
1010
1205
|
constructor(e, t) {
|
|
1011
1206
|
super(e), this.preExecute("element.updateProperties", (e) => {
|
|
1012
1207
|
let { element: n, properties: r } = e.context, i = r.eventStormingType;
|
|
1013
1208
|
if (typeof i != "string") return;
|
|
1014
1209
|
let a = n;
|
|
1015
|
-
if (a.host && !
|
|
1210
|
+
if (a.host && !we(i) && t.updateAttachment(a, void 0), a.attachers?.length && !Te(i)) for (let e of [...a.attachers]) t.updateAttachment(e, void 0);
|
|
1016
1211
|
});
|
|
1017
1212
|
}
|
|
1018
|
-
},
|
|
1019
|
-
__depends__: [
|
|
1213
|
+
}, Vt = {
|
|
1214
|
+
__depends__: [ue],
|
|
1020
1215
|
__init__: ["eventStormingAttachBehavior"],
|
|
1021
|
-
eventStormingAttachBehavior: ["type",
|
|
1216
|
+
eventStormingAttachBehavior: ["type", Bt]
|
|
1022
1217
|
};
|
|
1023
1218
|
//#endregion
|
|
1024
1219
|
//#region src/modeling/cmd/UpdatePropertiesHandler.ts
|
|
1025
|
-
function
|
|
1220
|
+
function Ht(e, t, n) {
|
|
1026
1221
|
n === void 0 ? delete e[t] : e[t] = n;
|
|
1027
1222
|
}
|
|
1028
|
-
var
|
|
1223
|
+
var Ut = [
|
|
1029
1224
|
"x",
|
|
1030
1225
|
"y",
|
|
1031
1226
|
"width",
|
|
1032
1227
|
"height"
|
|
1033
1228
|
];
|
|
1034
|
-
function
|
|
1035
|
-
if (!t.some((e) =>
|
|
1229
|
+
function Wt(e, t) {
|
|
1230
|
+
if (!t.some((e) => Ut.includes(e))) return [e];
|
|
1036
1231
|
let n = e;
|
|
1037
1232
|
return [
|
|
1038
1233
|
e,
|
|
@@ -1040,18 +1235,18 @@ function Mt(e, t) {
|
|
|
1040
1235
|
...n.outgoing ?? []
|
|
1041
1236
|
];
|
|
1042
1237
|
}
|
|
1043
|
-
var
|
|
1238
|
+
var Gt = class {
|
|
1044
1239
|
execute(e) {
|
|
1045
1240
|
let { element: t, properties: n } = e, r = t, i = {};
|
|
1046
|
-
for (let e of Object.keys(n)) i[e] = r[e],
|
|
1047
|
-
return e.oldProperties = i,
|
|
1241
|
+
for (let e of Object.keys(n)) i[e] = r[e], Ht(r, e, n[e]);
|
|
1242
|
+
return e.oldProperties = i, Wt(t, Object.keys(n));
|
|
1048
1243
|
}
|
|
1049
1244
|
revert(e) {
|
|
1050
1245
|
let { element: t, oldProperties: n } = e, r = t;
|
|
1051
|
-
if (n) for (let e of Object.keys(n))
|
|
1052
|
-
return
|
|
1246
|
+
if (n) for (let e of Object.keys(n)) Ht(r, e, n[e]);
|
|
1247
|
+
return Wt(t, Object.keys(n ?? {}));
|
|
1053
1248
|
}
|
|
1054
|
-
},
|
|
1249
|
+
}, Kt = "element.updateProperties", qt = class {
|
|
1055
1250
|
commandStack;
|
|
1056
1251
|
canvas;
|
|
1057
1252
|
elementRegistry;
|
|
@@ -1061,17 +1256,17 @@ var Nt = class {
|
|
|
1061
1256
|
"elementRegistry"
|
|
1062
1257
|
];
|
|
1063
1258
|
constructor(e, t, n) {
|
|
1064
|
-
this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(
|
|
1259
|
+
this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(Kt, Gt);
|
|
1065
1260
|
}
|
|
1066
1261
|
updateProperties(e, t) {
|
|
1067
|
-
this.commandStack.execute(
|
|
1262
|
+
this.commandStack.execute(Kt, {
|
|
1068
1263
|
element: e,
|
|
1069
1264
|
properties: t
|
|
1070
1265
|
});
|
|
1071
1266
|
}
|
|
1072
1267
|
updateLabel(e, t) {
|
|
1073
|
-
if (e.eventStormingType === "note" && !
|
|
1074
|
-
let { width: n, height: r } =
|
|
1268
|
+
if (e.eventStormingType === "note" && !N(e.eventStormingLabel, e)) {
|
|
1269
|
+
let { width: n, height: r } = M(t), i = e.x + e.width / 2, a = e.y + e.height / 2;
|
|
1075
1270
|
this.updateProperties(e, {
|
|
1076
1271
|
eventStormingLabel: t,
|
|
1077
1272
|
width: n,
|
|
@@ -1082,9 +1277,9 @@ var Nt = class {
|
|
|
1082
1277
|
} else this.updateProperties(e, { eventStormingLabel: t });
|
|
1083
1278
|
}
|
|
1084
1279
|
setStickyKind(e, t) {
|
|
1085
|
-
if (!
|
|
1280
|
+
if (!C(e.eventStormingType) || !C(t)) throw Error("setStickyKind: only sticky kinds can be retyped");
|
|
1086
1281
|
if (e.eventStormingType === t && !e.provisional) return;
|
|
1087
|
-
let { width: n, height: r } =
|
|
1282
|
+
let { width: n, height: r } = O[t], i = e.x + e.width / 2, a = e.y + e.height / 2;
|
|
1088
1283
|
this.updateProperties(e, {
|
|
1089
1284
|
eventStormingType: t,
|
|
1090
1285
|
...e.provisional ? { provisional: void 0 } : {},
|
|
@@ -1106,7 +1301,7 @@ var Nt = class {
|
|
|
1106
1301
|
setLevel(e) {
|
|
1107
1302
|
if (this.getLevel() === e) return;
|
|
1108
1303
|
let t = this.root(), n = t.businessObject ?? { config: { title: "Untitled Board" } };
|
|
1109
|
-
this.commandStack.execute(
|
|
1304
|
+
this.commandStack.execute(Kt, {
|
|
1110
1305
|
element: t,
|
|
1111
1306
|
properties: { businessObject: {
|
|
1112
1307
|
...n,
|
|
@@ -1120,7 +1315,7 @@ var Nt = class {
|
|
|
1120
1315
|
root() {
|
|
1121
1316
|
return this.elementRegistry.get("event-storming-root") ?? this.canvas.getRootElement();
|
|
1122
1317
|
}
|
|
1123
|
-
},
|
|
1318
|
+
}, Jt = 24, Yt = [
|
|
1124
1319
|
"eventStormingType",
|
|
1125
1320
|
"color",
|
|
1126
1321
|
"drawingPoints",
|
|
@@ -1128,8 +1323,8 @@ var Nt = class {
|
|
|
1128
1323
|
"strokeStyle",
|
|
1129
1324
|
"alignHorizontal",
|
|
1130
1325
|
"alignVertical"
|
|
1131
|
-
],
|
|
1132
|
-
function
|
|
1326
|
+
], Xt = ["eventStormingType", "linkLabel"];
|
|
1327
|
+
function Zt(e, t) {
|
|
1133
1328
|
let n = {};
|
|
1134
1329
|
for (let r of t) {
|
|
1135
1330
|
let t = e[r];
|
|
@@ -1137,7 +1332,7 @@ function Rt(e, t) {
|
|
|
1137
1332
|
}
|
|
1138
1333
|
return n;
|
|
1139
1334
|
}
|
|
1140
|
-
var
|
|
1335
|
+
var Qt = class {
|
|
1141
1336
|
selection;
|
|
1142
1337
|
modeling;
|
|
1143
1338
|
elementFactory;
|
|
@@ -1160,23 +1355,23 @@ var zt = class {
|
|
|
1160
1355
|
this.selection = e, this.modeling = t, this.elementFactory = n, this.esFactory = r, this.canvas = i, this.create = a, this.mouse = o;
|
|
1161
1356
|
}
|
|
1162
1357
|
copy() {
|
|
1163
|
-
let e = this.selection.get().filter((e) =>
|
|
1358
|
+
let e = this.selection.get().filter((e) => b(e));
|
|
1164
1359
|
if (!e.length) return !1;
|
|
1165
1360
|
let t = new Map(e.map((e, t) => [e, t])), n = [], r = /* @__PURE__ */ new Set();
|
|
1166
1361
|
for (let i of e) for (let e of [...i.incoming ?? [], ...i.outgoing ?? []]) {
|
|
1167
|
-
if (!
|
|
1362
|
+
if (!x(e) || r.has(e)) continue;
|
|
1168
1363
|
let i = t.get(e.source), a = t.get(e.target);
|
|
1169
1364
|
i !== void 0 && a !== void 0 && (r.add(e), n.push({
|
|
1170
1365
|
sourceIdx: i,
|
|
1171
1366
|
targetIdx: a,
|
|
1172
|
-
props:
|
|
1367
|
+
props: Zt(e, Xt)
|
|
1173
1368
|
}));
|
|
1174
1369
|
}
|
|
1175
1370
|
return this.clipboard = {
|
|
1176
1371
|
shapes: e.map((e) => {
|
|
1177
1372
|
let n = e.host ? t.get(e.host) : void 0;
|
|
1178
1373
|
return {
|
|
1179
|
-
props:
|
|
1374
|
+
props: Zt(e, Yt),
|
|
1180
1375
|
x: e.x,
|
|
1181
1376
|
y: e.y,
|
|
1182
1377
|
width: e.width,
|
|
@@ -1217,26 +1412,26 @@ var zt = class {
|
|
|
1217
1412
|
...structuredClone(e.props),
|
|
1218
1413
|
source: n[e.sourceIdx],
|
|
1219
1414
|
target: n[e.targetIdx],
|
|
1220
|
-
waypoints: [
|
|
1415
|
+
waypoints: [$t(n[e.sourceIdx]), $t(n[e.targetIdx])]
|
|
1221
1416
|
}))
|
|
1222
1417
|
};
|
|
1223
1418
|
}
|
|
1224
1419
|
insertWithOffset(e) {
|
|
1225
1420
|
this.pasteCount++;
|
|
1226
|
-
let t =
|
|
1421
|
+
let t = Jt * this.pasteCount, n = en(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
|
|
1227
1422
|
x: n.cx + t,
|
|
1228
1423
|
y: n.cy + t
|
|
1229
1424
|
}, this.canvas.getRootElement());
|
|
1230
1425
|
return this.selection.select(r), !0;
|
|
1231
1426
|
}
|
|
1232
1427
|
};
|
|
1233
|
-
function
|
|
1428
|
+
function $t(e) {
|
|
1234
1429
|
return {
|
|
1235
1430
|
x: e.x + e.width / 2,
|
|
1236
1431
|
y: e.y + e.height / 2
|
|
1237
1432
|
};
|
|
1238
1433
|
}
|
|
1239
|
-
function
|
|
1434
|
+
function en(e) {
|
|
1240
1435
|
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));
|
|
1241
1436
|
return {
|
|
1242
1437
|
cx: (t + r) / 2,
|
|
@@ -1245,13 +1440,13 @@ function Vt(e) {
|
|
|
1245
1440
|
}
|
|
1246
1441
|
//#endregion
|
|
1247
1442
|
//#region src/modeling/index.ts
|
|
1248
|
-
var
|
|
1249
|
-
__depends__: [
|
|
1443
|
+
var tn = {
|
|
1444
|
+
__depends__: [fe, re],
|
|
1250
1445
|
__init__: ["eventStormingModeling"],
|
|
1251
|
-
eventStormingModeling: ["type",
|
|
1252
|
-
eventStormingCopyPaste: ["type",
|
|
1253
|
-
},
|
|
1254
|
-
__depends__: [
|
|
1446
|
+
eventStormingModeling: ["type", qt],
|
|
1447
|
+
eventStormingCopyPaste: ["type", Qt]
|
|
1448
|
+
}, nn = {
|
|
1449
|
+
__depends__: [pe],
|
|
1255
1450
|
__init__: ["eventStormingLassoBehavior"],
|
|
1256
1451
|
eventStormingLassoBehavior: ["type", class {
|
|
1257
1452
|
static $inject = [
|
|
@@ -1276,43 +1471,43 @@ var Ht = {
|
|
|
1276
1471
|
};
|
|
1277
1472
|
//#endregion
|
|
1278
1473
|
//#region src/rules/EventStormingRules.ts
|
|
1279
|
-
function
|
|
1474
|
+
function rn(e, t) {
|
|
1280
1475
|
return (e.outgoing ?? []).some((e) => e.target === t);
|
|
1281
1476
|
}
|
|
1282
|
-
function
|
|
1283
|
-
return e.length !== 1 || !
|
|
1477
|
+
function an(e, t) {
|
|
1478
|
+
return e.length !== 1 || !Ee(e[0]) || !De(t) ? !1 : "attach";
|
|
1284
1479
|
}
|
|
1285
|
-
var
|
|
1480
|
+
var on = class extends me {
|
|
1286
1481
|
static $inject = ["eventBus"];
|
|
1287
1482
|
constructor(e) {
|
|
1288
1483
|
super(e);
|
|
1289
1484
|
}
|
|
1290
1485
|
init() {
|
|
1291
|
-
this.addRule("connection.start", (e) =>
|
|
1486
|
+
this.addRule("connection.start", (e) => w(e.source)), this.addRule("connection.create", (e) => {
|
|
1292
1487
|
let { source: t, target: n } = e;
|
|
1293
|
-
return !
|
|
1294
|
-
}), this.addRule(["shape.move", "elements.move"], (e) =>
|
|
1295
|
-
if (!
|
|
1488
|
+
return !w(t) || !w(n) || t === n || rn(t, n) ? !1 : { eventStormingType: "arrow" };
|
|
1489
|
+
}), this.addRule(["shape.move", "elements.move"], (e) => an(e.shapes ?? (e.shape ? [e.shape] : []), e.target) || !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => {
|
|
1490
|
+
if (!Oe(e.shape)) return !1;
|
|
1296
1491
|
let { newBounds: t } = e;
|
|
1297
|
-
return !t || t.width >=
|
|
1492
|
+
return !t || t.width >= A.width && t.height >= A.height;
|
|
1298
1493
|
});
|
|
1299
1494
|
}
|
|
1300
|
-
},
|
|
1495
|
+
}, sn = {
|
|
1301
1496
|
__init__: ["eventStormingRules"],
|
|
1302
|
-
eventStormingRules: ["type",
|
|
1303
|
-
},
|
|
1497
|
+
eventStormingRules: ["type", on]
|
|
1498
|
+
}, cn = 8, ln = {
|
|
1304
1499
|
__init__: ["elementSnapping"],
|
|
1305
1500
|
elementSnapping: ["type", class {
|
|
1306
1501
|
static $inject = ["eventBus", "elementRegistry"];
|
|
1307
1502
|
constructor(e, t) {
|
|
1308
|
-
let n = (e) => t.getAll().filter((t) =>
|
|
1503
|
+
let n = (e) => t.getAll().filter((t) => b(t) && t.eventStormingType !== "drawing" && !e.has(t.id)).map((e) => ({
|
|
1309
1504
|
x: e.x + e.width / 2,
|
|
1310
1505
|
y: e.y + e.height / 2
|
|
1311
1506
|
})), r = (e, t) => {
|
|
1312
1507
|
let n, r = 9;
|
|
1313
1508
|
for (let i of t) {
|
|
1314
1509
|
let t = Math.abs(i - e);
|
|
1315
|
-
t <=
|
|
1510
|
+
t <= cn && t < r && (n = i, r = t);
|
|
1316
1511
|
}
|
|
1317
1512
|
return n;
|
|
1318
1513
|
};
|
|
@@ -1344,177 +1539,7 @@ var Kt = class extends fe {
|
|
|
1344
1539
|
});
|
|
1345
1540
|
}
|
|
1346
1541
|
}]
|
|
1347
|
-
},
|
|
1348
|
-
draw: Qt("<circle cx=\"19\" cy=\"5\" r=\"2\"/><circle cx=\"5\" cy=\"19\" r=\"2\"/><path d=\"M6.5 17.5 17.5 6.5\"/>"),
|
|
1349
|
-
lasso: Qt("<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\"/>"),
|
|
1350
|
-
note: Zt(N.fill, N.stroke)
|
|
1351
|
-
};
|
|
1352
|
-
for (let e of w) {
|
|
1353
|
-
let t = M[e];
|
|
1354
|
-
H[e] = Zt(t.fill, t.stroke, e === "hotspot" ? -6 : 0);
|
|
1355
|
-
}
|
|
1356
|
-
function $t(e, t) {
|
|
1357
|
-
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>`;
|
|
1358
|
-
}
|
|
1359
|
-
//#endregion
|
|
1360
|
-
//#region src/palette/EventStormingPaletteProvider.ts
|
|
1361
|
-
var en = 24, U = "stickies-1", W = "stickies-2", tn = "stickies-3", nn = [
|
|
1362
|
-
{
|
|
1363
|
-
key: "event",
|
|
1364
|
-
type: "event",
|
|
1365
|
-
label: M.event.label,
|
|
1366
|
-
title: "Domain event",
|
|
1367
|
-
shortcut: "E",
|
|
1368
|
-
group: U
|
|
1369
|
-
},
|
|
1370
|
-
{
|
|
1371
|
-
key: "command",
|
|
1372
|
-
type: "command",
|
|
1373
|
-
label: M.command.label,
|
|
1374
|
-
title: "Command",
|
|
1375
|
-
shortcut: "C",
|
|
1376
|
-
group: U
|
|
1377
|
-
},
|
|
1378
|
-
{
|
|
1379
|
-
key: "actor",
|
|
1380
|
-
type: "actor",
|
|
1381
|
-
label: M.actor.label,
|
|
1382
|
-
title: "Actor",
|
|
1383
|
-
group: U
|
|
1384
|
-
},
|
|
1385
|
-
{
|
|
1386
|
-
key: "aggregate",
|
|
1387
|
-
type: "aggregate",
|
|
1388
|
-
label: M.aggregate.label,
|
|
1389
|
-
title: "Aggregate",
|
|
1390
|
-
group: U
|
|
1391
|
-
},
|
|
1392
|
-
{
|
|
1393
|
-
key: "policy",
|
|
1394
|
-
type: "policy",
|
|
1395
|
-
label: M.policy.label,
|
|
1396
|
-
title: "Policy",
|
|
1397
|
-
group: W
|
|
1398
|
-
},
|
|
1399
|
-
{
|
|
1400
|
-
key: "readmodel",
|
|
1401
|
-
type: "readmodel",
|
|
1402
|
-
label: M.readmodel.label,
|
|
1403
|
-
title: "Read model",
|
|
1404
|
-
group: W
|
|
1405
|
-
},
|
|
1406
|
-
{
|
|
1407
|
-
key: "external",
|
|
1408
|
-
type: "external",
|
|
1409
|
-
label: M.external.label,
|
|
1410
|
-
title: "External system",
|
|
1411
|
-
group: W
|
|
1412
|
-
},
|
|
1413
|
-
{
|
|
1414
|
-
key: "hotspot",
|
|
1415
|
-
type: "hotspot",
|
|
1416
|
-
label: M.hotspot.label,
|
|
1417
|
-
title: "Hotspot",
|
|
1418
|
-
group: tn
|
|
1419
|
-
},
|
|
1420
|
-
{
|
|
1421
|
-
key: "note",
|
|
1422
|
-
type: "note",
|
|
1423
|
-
label: N.label,
|
|
1424
|
-
title: "Note",
|
|
1425
|
-
group: tn
|
|
1426
|
-
}
|
|
1427
|
-
], rn = class {
|
|
1428
|
-
create;
|
|
1429
|
-
factory;
|
|
1430
|
-
lassoTool;
|
|
1431
|
-
drawTool;
|
|
1432
|
-
eventStormingModeling;
|
|
1433
|
-
canvas;
|
|
1434
|
-
modeling;
|
|
1435
|
-
selection;
|
|
1436
|
-
elementRegistry;
|
|
1437
|
-
labelEditing;
|
|
1438
|
-
config;
|
|
1439
|
-
static $inject = [
|
|
1440
|
-
"palette",
|
|
1441
|
-
"create",
|
|
1442
|
-
"eventStormingElementFactory",
|
|
1443
|
-
"lassoTool",
|
|
1444
|
-
"eventStormingDrawTool",
|
|
1445
|
-
"eventStormingModeling",
|
|
1446
|
-
"eventBus",
|
|
1447
|
-
"canvas",
|
|
1448
|
-
"modeling",
|
|
1449
|
-
"selection",
|
|
1450
|
-
"elementRegistry",
|
|
1451
|
-
"eventStormingLabelEditing",
|
|
1452
|
-
"config.eventStormingPalette"
|
|
1453
|
-
];
|
|
1454
|
-
constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
1455
|
-
this.create = t, this.factory = n, this.lassoTool = r, this.drawTool = i, this.eventStormingModeling = a, this.canvas = s, this.modeling = c, this.selection = l, this.elementRegistry = u, this.labelEditing = d, this.config = f, e.registerProvider(this);
|
|
1456
|
-
let p = () => e._rebuild();
|
|
1457
|
-
o.on("import.done", p), o.on(["commandStack.element.updateProperties.postExecuted", "commandStack.element.updateProperties.reverted"], (e) => {
|
|
1458
|
-
e.context.element.id === "event-storming-root" && p();
|
|
1459
|
-
});
|
|
1460
|
-
}
|
|
1461
|
-
getPaletteEntries() {
|
|
1462
|
-
let e = {};
|
|
1463
|
-
e["lasso-tool"] = {
|
|
1464
|
-
group: "tools",
|
|
1465
|
-
title: "Lasso",
|
|
1466
|
-
shortcut: "L",
|
|
1467
|
-
html: `<div class="entry event-storming-palette-entry">${H.lasso}</div>`,
|
|
1468
|
-
action: { click: (e) => this.lassoTool.activateSelection(e) }
|
|
1469
|
-
}, e["draw-tool"] = {
|
|
1470
|
-
group: "tools",
|
|
1471
|
-
title: "Draw",
|
|
1472
|
-
html: `<div class="entry event-storming-palette-entry">${H.draw}</div>`,
|
|
1473
|
-
action: { click: () => this.drawTool.toggle() }
|
|
1474
|
-
};
|
|
1475
|
-
let t = c[this.eventStormingModeling.getLevel()];
|
|
1476
|
-
for (let n of nn) {
|
|
1477
|
-
if (n.type !== "note" && !t.includes(n.type)) continue;
|
|
1478
|
-
let r = (e) => {
|
|
1479
|
-
let t = this.factory.createNew(n.type, n.label);
|
|
1480
|
-
an(e) && this.placeInFreeRect(t) || this.create.start(e, t);
|
|
1481
|
-
};
|
|
1482
|
-
e[`create.${n.key}`] = {
|
|
1483
|
-
group: n.group,
|
|
1484
|
-
title: n.title,
|
|
1485
|
-
...n.shortcut ? { shortcut: n.shortcut } : {},
|
|
1486
|
-
html: `<div class="entry event-storming-palette-entry" draggable="true">${H[n.key]}</div>`,
|
|
1487
|
-
action: {
|
|
1488
|
-
dragstart: r,
|
|
1489
|
-
click: r
|
|
1490
|
-
}
|
|
1491
|
-
};
|
|
1492
|
-
}
|
|
1493
|
-
return e;
|
|
1494
|
-
}
|
|
1495
|
-
placeInFreeRect(e) {
|
|
1496
|
-
let { canvas: t, modeling: n, selection: r, elementRegistry: i } = this;
|
|
1497
|
-
if (!t || !n || !r || !i) return !1;
|
|
1498
|
-
let a = t.viewbox(), o = this.config?.freeRectInsets?.() ?? {
|
|
1499
|
-
top: 0,
|
|
1500
|
-
right: 0,
|
|
1501
|
-
bottom: 0,
|
|
1502
|
-
left: 0
|
|
1503
|
-
}, s = Math.max(0, a.outer.width - o.left - o.right), c = Math.max(0, a.outer.height - o.top - o.bottom), l = {
|
|
1504
|
-
x: a.x + (o.left + s / 2) / a.scale,
|
|
1505
|
-
y: a.y + (o.top + c / 2) / a.scale
|
|
1506
|
-
}, u = (e) => i.filter(S).some((t) => Math.abs(t.x + t.width / 2 - e.x) < 1 && Math.abs(t.y + t.height / 2 - e.y) < 1);
|
|
1507
|
-
for (; u(l);) l.x += en, l.y += en;
|
|
1508
|
-
let d = n.createShape(e, l, t.getRootElement());
|
|
1509
|
-
return r.select(d), t.focus(), this.labelEditing?.activate(d), !0;
|
|
1510
|
-
}
|
|
1511
|
-
};
|
|
1512
|
-
function an(e) {
|
|
1513
|
-
return e.type === "click" && e.detail === 0;
|
|
1514
|
-
}
|
|
1515
|
-
//#endregion
|
|
1516
|
-
//#region src/palette/EventStormingPaletteTooltip.ts
|
|
1517
|
-
var on = ".djs-palette-entries .entry", sn = "bottom", cn = class {
|
|
1542
|
+
}, un = ".djs-palette-entries .entry", dn = "bottom", fn = class {
|
|
1518
1543
|
palette;
|
|
1519
1544
|
hoverTooltip;
|
|
1520
1545
|
static $inject = [
|
|
@@ -1529,9 +1554,9 @@ var on = ".djs-palette-entries .entry", sn = "bottom", cn = class {
|
|
|
1529
1554
|
attachTo(e) {
|
|
1530
1555
|
this.refreshEntries(), this.hoverTooltip.add({
|
|
1531
1556
|
container: e,
|
|
1532
|
-
selector:
|
|
1557
|
+
selector: un,
|
|
1533
1558
|
getContent: (e) => this.contentFor(e),
|
|
1534
|
-
getPosition: (e) =>
|
|
1559
|
+
getPosition: (e) => pn(e)
|
|
1535
1560
|
});
|
|
1536
1561
|
}
|
|
1537
1562
|
refreshEntries() {
|
|
@@ -1539,31 +1564,31 @@ var on = ".djs-palette-entries .entry", sn = "bottom", cn = class {
|
|
|
1539
1564
|
}
|
|
1540
1565
|
contentFor(e) {
|
|
1541
1566
|
let t = this.entries[e.getAttribute("data-action") ?? ""];
|
|
1542
|
-
return t?.title ?
|
|
1567
|
+
return t?.title ? ge`<${he} title=${t.title} shortcut=${t.shortcut} />` : null;
|
|
1543
1568
|
}
|
|
1544
1569
|
};
|
|
1545
|
-
function
|
|
1570
|
+
function pn(e) {
|
|
1546
1571
|
let t = e.getBoundingClientRect();
|
|
1547
1572
|
return {
|
|
1548
1573
|
x: t.left + t.width / 2,
|
|
1549
1574
|
y: t.bottom + 8,
|
|
1550
|
-
placement:
|
|
1575
|
+
placement: dn
|
|
1551
1576
|
};
|
|
1552
1577
|
}
|
|
1553
1578
|
//#endregion
|
|
1554
1579
|
//#region src/palette/index.ts
|
|
1555
|
-
var
|
|
1580
|
+
var mn = {
|
|
1556
1581
|
__init__: ["eventStormingPaletteProvider", "paletteTooltip"],
|
|
1557
|
-
eventStormingPaletteProvider: ["type",
|
|
1558
|
-
paletteTooltip: ["type",
|
|
1559
|
-
}, G = "event-storming-element-settings",
|
|
1582
|
+
eventStormingPaletteProvider: ["type", Ue],
|
|
1583
|
+
paletteTooltip: ["type", fn]
|
|
1584
|
+
}, G = "event-storming-element-settings", hn = {
|
|
1560
1585
|
id: "kind",
|
|
1561
1586
|
name: "Change type"
|
|
1562
1587
|
};
|
|
1563
|
-
function
|
|
1588
|
+
function gn(e, t) {
|
|
1564
1589
|
return e ? `✓ ${t}` : t;
|
|
1565
1590
|
}
|
|
1566
|
-
var
|
|
1591
|
+
var _n = class {
|
|
1567
1592
|
modeling;
|
|
1568
1593
|
static $inject = ["popupMenu", "eventStormingModeling"];
|
|
1569
1594
|
constructor(e, t) {
|
|
@@ -1571,26 +1596,26 @@ var pn = class {
|
|
|
1571
1596
|
}
|
|
1572
1597
|
getPopupMenuEntries(e) {
|
|
1573
1598
|
let t = Array.isArray(e) ? e[0] : e;
|
|
1574
|
-
return
|
|
1599
|
+
return w(t) ? this.kindEntries(t) : {};
|
|
1575
1600
|
}
|
|
1576
1601
|
kindEntries(e) {
|
|
1577
1602
|
let t = {}, n = e.provisional === !0, r = c[this.modeling.getLevel()];
|
|
1578
|
-
for (let i of
|
|
1603
|
+
for (let i of S) {
|
|
1579
1604
|
if (!r.includes(i) && (n || i !== e.eventStormingType)) continue;
|
|
1580
|
-
let a =
|
|
1605
|
+
let a = O[i];
|
|
1581
1606
|
t[`kind-${i}`] = {
|
|
1582
|
-
label: n ? a.label :
|
|
1583
|
-
imageHtml:
|
|
1584
|
-
group:
|
|
1607
|
+
label: n ? a.label : gn(e.eventStormingType === i, a.label),
|
|
1608
|
+
imageHtml: ze(a.fill, a.stroke),
|
|
1609
|
+
group: hn,
|
|
1585
1610
|
action: () => this.modeling.setStickyKind(e, i)
|
|
1586
1611
|
};
|
|
1587
1612
|
}
|
|
1588
1613
|
return t;
|
|
1589
1614
|
}
|
|
1590
|
-
},
|
|
1615
|
+
}, vn = {
|
|
1591
1616
|
__init__: ["eventStormingElementSettings"],
|
|
1592
|
-
eventStormingElementSettings: ["type",
|
|
1593
|
-
}, K = "eventStorming.readOnly.changed",
|
|
1617
|
+
eventStormingElementSettings: ["type", _n]
|
|
1618
|
+
}, K = "eventStorming.readOnly.changed", yn = 5e3, bn = [
|
|
1594
1619
|
"elements.move",
|
|
1595
1620
|
"shape.move",
|
|
1596
1621
|
"shape.resize",
|
|
@@ -1603,7 +1628,7 @@ var pn = class {
|
|
|
1603
1628
|
"connection.reconnect",
|
|
1604
1629
|
"connection.updateWaypoints",
|
|
1605
1630
|
"elements.delete"
|
|
1606
|
-
],
|
|
1631
|
+
], xn = class extends me {
|
|
1607
1632
|
bus;
|
|
1608
1633
|
static $inject = ["eventBus"];
|
|
1609
1634
|
readOnly = !1;
|
|
@@ -1611,7 +1636,7 @@ var pn = class {
|
|
|
1611
1636
|
super(e), this.bus = e;
|
|
1612
1637
|
}
|
|
1613
1638
|
init() {
|
|
1614
|
-
this.addRule(
|
|
1639
|
+
this.addRule(bn, yn, () => !this.readOnly && void 0);
|
|
1615
1640
|
}
|
|
1616
1641
|
isReadOnly() {
|
|
1617
1642
|
return this.readOnly;
|
|
@@ -1619,11 +1644,11 @@ var pn = class {
|
|
|
1619
1644
|
setReadOnly(e) {
|
|
1620
1645
|
this.readOnly !== e && (this.readOnly = e, this.bus.fire(K, { readOnly: e }));
|
|
1621
1646
|
}
|
|
1622
|
-
},
|
|
1623
|
-
__depends__: [
|
|
1647
|
+
}, Sn = {
|
|
1648
|
+
__depends__: [se],
|
|
1624
1649
|
__init__: ["eventStormingReadOnly"],
|
|
1625
|
-
eventStormingReadOnly: ["type",
|
|
1626
|
-
},
|
|
1650
|
+
eventStormingReadOnly: ["type", xn]
|
|
1651
|
+
}, Cn = {
|
|
1627
1652
|
plus: "<path d=\"M5 12h14\"/><path d=\"M12 5v14\"/>",
|
|
1628
1653
|
"arrow-right": "<path d=\"M5 12h14\"/><path d=\"m12 5 7 7-7 7\"/>",
|
|
1629
1654
|
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\"/>",
|
|
@@ -1643,17 +1668,17 @@ var pn = class {
|
|
|
1643
1668
|
x: "<path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/>"
|
|
1644
1669
|
};
|
|
1645
1670
|
function q(e) {
|
|
1646
|
-
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">${
|
|
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">${Cn[e]}</svg>`;
|
|
1647
1672
|
}
|
|
1648
1673
|
//#endregion
|
|
1649
1674
|
//#region src/context-pad/EventStormingContextPadProvider.ts
|
|
1650
|
-
var
|
|
1675
|
+
var wn = "Append sticky (auto-connect, choose the type after placing)";
|
|
1651
1676
|
function J(e, t, n = !1) {
|
|
1652
1677
|
return `<div class="entry event-storming-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${q(e)}</div>`;
|
|
1653
1678
|
}
|
|
1654
1679
|
//#endregion
|
|
1655
1680
|
//#region src/context-pad/index.ts
|
|
1656
|
-
var
|
|
1681
|
+
var Tn = {
|
|
1657
1682
|
__init__: ["eventStormingContextPadProvider"],
|
|
1658
1683
|
eventStormingContextPadProvider: ["type", class {
|
|
1659
1684
|
modeling;
|
|
@@ -1685,7 +1710,7 @@ var xn = {
|
|
|
1685
1710
|
}
|
|
1686
1711
|
getContextPadEntries(e) {
|
|
1687
1712
|
if (this.readOnly?.isReadOnly()) return {};
|
|
1688
|
-
if (
|
|
1713
|
+
if (x(e)) {
|
|
1689
1714
|
let t = e;
|
|
1690
1715
|
return {
|
|
1691
1716
|
"edit-label": {
|
|
@@ -1702,17 +1727,17 @@ var xn = {
|
|
|
1702
1727
|
}
|
|
1703
1728
|
};
|
|
1704
1729
|
}
|
|
1705
|
-
if (!
|
|
1730
|
+
if (!b(e)) return {};
|
|
1706
1731
|
let t = e, n = {}, r = t.eventStormingType;
|
|
1707
|
-
if (
|
|
1732
|
+
if (C(r)) {
|
|
1708
1733
|
let e = (e) => {
|
|
1709
1734
|
let n = this.factory.createProvisional();
|
|
1710
1735
|
this.create.start(e, n, { source: t });
|
|
1711
1736
|
};
|
|
1712
1737
|
n.append = {
|
|
1713
1738
|
group: "append",
|
|
1714
|
-
title:
|
|
1715
|
-
html: J("plus",
|
|
1739
|
+
title: wn,
|
|
1740
|
+
html: J("plus", wn, !0),
|
|
1716
1741
|
action: {
|
|
1717
1742
|
click: e,
|
|
1718
1743
|
dragstart: e
|
|
@@ -1772,36 +1797,36 @@ var xn = {
|
|
|
1772
1797
|
}, n;
|
|
1773
1798
|
}
|
|
1774
1799
|
}]
|
|
1775
|
-
},
|
|
1800
|
+
}, En = "bullet", Dn = [
|
|
1776
1801
|
"left",
|
|
1777
1802
|
"center",
|
|
1778
1803
|
"right"
|
|
1779
|
-
],
|
|
1804
|
+
], On = [
|
|
1780
1805
|
"top",
|
|
1781
1806
|
"middle",
|
|
1782
1807
|
"bottom"
|
|
1783
1808
|
];
|
|
1784
|
-
function
|
|
1809
|
+
function kn(e, t) {
|
|
1785
1810
|
return e[(e.indexOf(t) + 1) % e.length];
|
|
1786
1811
|
}
|
|
1787
|
-
function
|
|
1812
|
+
function An(e, t) {
|
|
1788
1813
|
let n = e.ownerDocument;
|
|
1789
1814
|
e.textContent = "";
|
|
1790
|
-
for (let r of
|
|
1815
|
+
for (let r of D(t)) {
|
|
1791
1816
|
let t = n.createElement("div");
|
|
1792
|
-
r.bullet && (t.className =
|
|
1817
|
+
r.bullet && (t.className = En);
|
|
1793
1818
|
for (let e of r.runs) {
|
|
1794
1819
|
let r = n.createTextNode(e.text);
|
|
1795
|
-
e.italic && (r =
|
|
1820
|
+
e.italic && (r = jn(n, "i", r)), e.bold && (r = jn(n, "b", r)), t.appendChild(r);
|
|
1796
1821
|
}
|
|
1797
1822
|
r.runs.length === 0 && t.appendChild(n.createElement("br")), e.appendChild(t);
|
|
1798
1823
|
}
|
|
1799
1824
|
}
|
|
1800
|
-
function
|
|
1825
|
+
function jn(e, t, n) {
|
|
1801
1826
|
let r = e.createElement(t);
|
|
1802
1827
|
return r.appendChild(n), r;
|
|
1803
1828
|
}
|
|
1804
|
-
function
|
|
1829
|
+
function Mn(e) {
|
|
1805
1830
|
let t = [], n = null, r = (e) => (n = {
|
|
1806
1831
|
bullet: e,
|
|
1807
1832
|
runs: []
|
|
@@ -1822,11 +1847,11 @@ function On(e) {
|
|
|
1822
1847
|
s.nextSibling && r(!1);
|
|
1823
1848
|
return;
|
|
1824
1849
|
}
|
|
1825
|
-
if (
|
|
1850
|
+
if (Nn(s.tagName)) {
|
|
1826
1851
|
a(s);
|
|
1827
1852
|
return;
|
|
1828
1853
|
}
|
|
1829
|
-
let c =
|
|
1854
|
+
let c = Pn(s, t, o);
|
|
1830
1855
|
for (let e of s.childNodes) i(e, c.bold, c.italic);
|
|
1831
1856
|
}, a = (e) => {
|
|
1832
1857
|
r(e.classList.contains("bullet") || e.tagName === "LI");
|
|
@@ -1834,12 +1859,12 @@ function On(e) {
|
|
|
1834
1859
|
n = null;
|
|
1835
1860
|
};
|
|
1836
1861
|
for (let t of e.childNodes) i(t, !1, !1);
|
|
1837
|
-
return
|
|
1862
|
+
return Ae(t);
|
|
1838
1863
|
}
|
|
1839
|
-
function
|
|
1864
|
+
function Nn(e) {
|
|
1840
1865
|
return e === "DIV" || e === "P" || e === "LI";
|
|
1841
1866
|
}
|
|
1842
|
-
function
|
|
1867
|
+
function Pn(e, t, n) {
|
|
1843
1868
|
let r = e.tagName;
|
|
1844
1869
|
(r === "B" || r === "STRONG") && (t = !0), (r === "I" || r === "EM") && (n = !0);
|
|
1845
1870
|
let i = e.style.fontWeight;
|
|
@@ -1850,13 +1875,13 @@ function An(e, t, n) {
|
|
|
1850
1875
|
italic: n
|
|
1851
1876
|
};
|
|
1852
1877
|
}
|
|
1853
|
-
function
|
|
1878
|
+
function Fn(e) {
|
|
1854
1879
|
let t = e.ownerDocument, n = t.getSelection();
|
|
1855
1880
|
if (!n) return;
|
|
1856
1881
|
let r = t.createRange();
|
|
1857
1882
|
r.selectNodeContents(e), n.removeAllRanges(), n.addRange(r);
|
|
1858
1883
|
}
|
|
1859
|
-
function
|
|
1884
|
+
function In(e, t) {
|
|
1860
1885
|
let n = e.ownerDocument;
|
|
1861
1886
|
if (typeof n.execCommand == "function" && n.execCommand("insertText", !1, t)) return;
|
|
1862
1887
|
let r = n.getSelection();
|
|
@@ -1867,24 +1892,24 @@ function Mn(e, t) {
|
|
|
1867
1892
|
let a = n.createTextNode(t);
|
|
1868
1893
|
i.insertNode(a), i.setStartAfter(a), i.collapse(!0), r.removeAllRanges(), r.addRange(i);
|
|
1869
1894
|
}
|
|
1870
|
-
function
|
|
1895
|
+
function Ln(e) {
|
|
1871
1896
|
let t = e.ownerDocument.getSelection();
|
|
1872
1897
|
if (!t || t.rangeCount === 0) return [];
|
|
1873
1898
|
let n = t.getRangeAt(0);
|
|
1874
1899
|
return e.contains(n.commonAncestorContainer) ? Array.from(e.children).filter((e) => n.intersectsNode(e)) : [];
|
|
1875
1900
|
}
|
|
1876
|
-
function
|
|
1877
|
-
|
|
1878
|
-
let t =
|
|
1901
|
+
function Rn(e) {
|
|
1902
|
+
zn(e);
|
|
1903
|
+
let t = Ln(e);
|
|
1879
1904
|
if (t.length === 0) return;
|
|
1880
|
-
let n = t.every((e) => e.classList.contains(
|
|
1881
|
-
for (let e of t) e.classList.toggle(
|
|
1905
|
+
let n = t.every((e) => e.classList.contains(En));
|
|
1906
|
+
for (let e of t) e.classList.toggle(En, !n);
|
|
1882
1907
|
}
|
|
1883
|
-
function
|
|
1908
|
+
function zn(e) {
|
|
1884
1909
|
let t = e.ownerDocument, n = null;
|
|
1885
|
-
for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE &&
|
|
1910
|
+
for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && Nn(r.tagName) ? n = null : (n || (n = t.createElement("div"), e.insertBefore(n, r)), n.appendChild(r));
|
|
1886
1911
|
}
|
|
1887
|
-
var
|
|
1912
|
+
var Bn = {
|
|
1888
1913
|
horizontal: {
|
|
1889
1914
|
left: "text-align-start",
|
|
1890
1915
|
center: "text-align-center",
|
|
@@ -1896,7 +1921,7 @@ var In = {
|
|
|
1896
1921
|
bottom: "align-vertical-justify-end"
|
|
1897
1922
|
}
|
|
1898
1923
|
};
|
|
1899
|
-
function
|
|
1924
|
+
function Vn(e, t) {
|
|
1900
1925
|
let n = e.createElement("div");
|
|
1901
1926
|
n.className = "event-storming-note-toolbar";
|
|
1902
1927
|
let r = (r, i, a) => {
|
|
@@ -1907,19 +1932,19 @@ function Ln(e, t) {
|
|
|
1907
1932
|
let i = e.createElement("span");
|
|
1908
1933
|
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;
|
|
1909
1934
|
}
|
|
1910
|
-
function
|
|
1911
|
-
let r =
|
|
1935
|
+
function Hn(e, t, n) {
|
|
1936
|
+
let r = Bn[t][n];
|
|
1912
1937
|
e.innerHTML = r ? q(r) : "", e.title = t === "horizontal" ? `Horizontal alignment: ${n} (click to cycle)` : `Vertical alignment: ${n} (click to cycle)`;
|
|
1913
1938
|
}
|
|
1914
|
-
function
|
|
1939
|
+
function Un(e, t) {
|
|
1915
1940
|
e.style.textAlign = t.horizontal, e.style.justifyContent = t.vertical === "top" ? "flex-start" : t.vertical === "middle" ? "center" : "flex-end";
|
|
1916
1941
|
}
|
|
1917
1942
|
//#endregion
|
|
1918
1943
|
//#region src/label-editing/EventStormingLabelEditing.ts
|
|
1919
|
-
function
|
|
1944
|
+
function Wn(e) {
|
|
1920
1945
|
return e.replace(/(?<!:)\/\//g, "∕∕").replace(/\/\*/g, "∕*").replace(/->/g, "→").replace(/;/g, ",").replace(/\[/g, "(").replace(/\]/g, ")").trim();
|
|
1921
1946
|
}
|
|
1922
|
-
var
|
|
1947
|
+
var Gn = class {
|
|
1923
1948
|
canvas;
|
|
1924
1949
|
modeling;
|
|
1925
1950
|
elementRegistry;
|
|
@@ -1940,12 +1965,8 @@ var Vn = class {
|
|
|
1940
1965
|
}), e.on("diagram.destroy", () => {
|
|
1941
1966
|
clearTimeout(this.resumeTimer), this.suspended = null, this.cancel();
|
|
1942
1967
|
}), e.on("element.dblclick", (e) => {
|
|
1943
|
-
|
|
1944
|
-
}), e.on([
|
|
1945
|
-
"element.mousedown",
|
|
1946
|
-
"drag.init",
|
|
1947
|
-
"canvas.viewbox.changing"
|
|
1948
|
-
], () => this.active?.commit());
|
|
1968
|
+
b(e.element) ? this.activate(e.element) : x(e.element) && this.activateConnection(e.element);
|
|
1969
|
+
}), e.on(["element.mousedown", "drag.init"], () => this.active?.commit()), e.on("canvas.viewbox.changed", () => this.active?.place());
|
|
1949
1970
|
}
|
|
1950
1971
|
suspend() {
|
|
1951
1972
|
clearTimeout(this.resumeTimer), this.active && (this.suspended = this.active.snapshot(), this.active.cleanup());
|
|
@@ -1959,14 +1980,14 @@ var Vn = class {
|
|
|
1959
1980
|
resume(e) {
|
|
1960
1981
|
let t = this.elementRegistry?.get(e.elementId);
|
|
1961
1982
|
if (e.connection) {
|
|
1962
|
-
if (!
|
|
1983
|
+
if (!x(t)) return;
|
|
1963
1984
|
this.activateConnection(t);
|
|
1964
1985
|
} else {
|
|
1965
|
-
if (!
|
|
1986
|
+
if (!b(t)) return;
|
|
1966
1987
|
this.activate(t);
|
|
1967
1988
|
}
|
|
1968
1989
|
let n = this.active?.field;
|
|
1969
|
-
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)) : (
|
|
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)) : (An(n, e.value), e.align && this.restoreNoteAlign?.(e.align), qn(n)));
|
|
1970
1991
|
}
|
|
1971
1992
|
restoreNoteAlign;
|
|
1972
1993
|
activate(e) {
|
|
@@ -1975,134 +1996,152 @@ var Vn = class {
|
|
|
1975
1996
|
this.activateNote(e);
|
|
1976
1997
|
return;
|
|
1977
1998
|
}
|
|
1978
|
-
let t = this.canvas.getContainer(), n =
|
|
1979
|
-
|
|
1980
|
-
let
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1999
|
+
let t = this.canvas.getContainer(), n = document.createElement("textarea");
|
|
2000
|
+
n.className = "event-storming-label-input event-storming-label-textarea", n.value = e.eventStormingLabel ?? "", n.rows = Math.max(2, n.value.split("\n").length), n.wrap = "off", n.style.position = "absolute", n.style.transform = "translate(-50%, -50%)";
|
|
2001
|
+
let r = () => {
|
|
2002
|
+
let t = this.canvas.zoom(), r = this.canvas.viewbox();
|
|
2003
|
+
n.style.left = `${(e.x + e.width / 2 - r.x) * t}px`, n.style.top = `${(e.y + e.height / 2 - r.y) * t}px`, n.style.width = `${e.width * t}px`;
|
|
2004
|
+
};
|
|
2005
|
+
r(), t.appendChild(n), n.focus(), n.select();
|
|
2006
|
+
let i = !1, a = () => {
|
|
2007
|
+
i || (i = !0, n.removeEventListener("keydown", s), n.removeEventListener("blur", c), n.remove(), this.active = null, this.canvas.restoreFocus?.());
|
|
2008
|
+
}, o = () => {
|
|
2009
|
+
if (i) return;
|
|
2010
|
+
let t = Wn(n.value), r = t && t !== e.eventStormingLabel;
|
|
2011
|
+
a(), r && this.modeling.updateLabel(e, t);
|
|
2012
|
+
}, s = (e) => {
|
|
2013
|
+
if (e.key === "Escape") e.preventDefault(), a();
|
|
1988
2014
|
else if (e.key === "Enter") {
|
|
1989
2015
|
if (!(e.metaKey || e.ctrlKey)) return;
|
|
1990
|
-
e.preventDefault(),
|
|
2016
|
+
e.preventDefault(), o();
|
|
1991
2017
|
}
|
|
1992
|
-
},
|
|
1993
|
-
|
|
1994
|
-
let
|
|
2018
|
+
}, c = () => o();
|
|
2019
|
+
n.addEventListener("keydown", s), n.addEventListener("blur", c);
|
|
2020
|
+
let l = () => ({
|
|
1995
2021
|
elementId: e.id,
|
|
1996
2022
|
connection: !1,
|
|
1997
|
-
value:
|
|
1998
|
-
selectionStart:
|
|
1999
|
-
selectionEnd:
|
|
2023
|
+
value: n.value,
|
|
2024
|
+
selectionStart: n.selectionStart ?? void 0,
|
|
2025
|
+
selectionEnd: n.selectionEnd ?? void 0
|
|
2000
2026
|
});
|
|
2001
2027
|
this.active = {
|
|
2002
|
-
field:
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2028
|
+
field: n,
|
|
2029
|
+
place: r,
|
|
2030
|
+
commit: o,
|
|
2031
|
+
cleanup: a,
|
|
2032
|
+
snapshot: l
|
|
2006
2033
|
};
|
|
2007
2034
|
}
|
|
2008
2035
|
activateNote(e) {
|
|
2009
|
-
let t = this.canvas.getContainer(), n =
|
|
2010
|
-
|
|
2011
|
-
let
|
|
2036
|
+
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%)", An(n, e.eventStormingLabel ?? "");
|
|
2038
|
+
let r = {
|
|
2012
2039
|
horizontal: e.alignHorizontal ?? "left",
|
|
2013
2040
|
vertical: e.alignVertical ?? "top"
|
|
2014
2041
|
};
|
|
2015
|
-
|
|
2016
|
-
let
|
|
2017
|
-
|
|
2018
|
-
let
|
|
2019
|
-
let
|
|
2042
|
+
Un(n, r);
|
|
2043
|
+
let i = Vn(document, (e) => d(e));
|
|
2044
|
+
i.style.transform = "translate(-50%, -100%)";
|
|
2045
|
+
let a = () => {
|
|
2046
|
+
let t = this.canvas.zoom(), r = this.canvas.viewbox(), a = (e.x + e.width / 2 - r.x) * t;
|
|
2047
|
+
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
|
+
};
|
|
2049
|
+
a(), t.appendChild(n), t.appendChild(i), n.focus(), Fn(n);
|
|
2050
|
+
let o = (e) => i.querySelector(`[data-action="${e}"]`), s = (e, t) => {
|
|
2051
|
+
let n = o(e);
|
|
2020
2052
|
n?.classList.toggle("active", t), n?.setAttribute("aria-pressed", String(t));
|
|
2021
|
-
},
|
|
2022
|
-
|
|
2023
|
-
let e =
|
|
2024
|
-
|
|
2025
|
-
let t =
|
|
2026
|
-
t &&
|
|
2027
|
-
let
|
|
2028
|
-
|
|
2029
|
-
},
|
|
2030
|
-
typeof document.execCommand == "function" && document.execCommand(e, !1),
|
|
2031
|
-
},
|
|
2032
|
-
e === "horizontal" ?
|
|
2033
|
-
},
|
|
2034
|
-
e === "note-bold" ?
|
|
2035
|
-
},
|
|
2036
|
-
document.addEventListener("selectionchange",
|
|
2037
|
-
let
|
|
2038
|
-
|
|
2039
|
-
},
|
|
2040
|
-
if (
|
|
2041
|
-
let t =
|
|
2042
|
-
|
|
2043
|
-
},
|
|
2053
|
+
}, c = () => {
|
|
2054
|
+
s("note-bold", Jn("bold")), s("note-italic", Jn("italic"));
|
|
2055
|
+
let e = Ln(n);
|
|
2056
|
+
s("note-bullet", e.length > 0 && e.every((e) => e.classList.contains("bullet")));
|
|
2057
|
+
let t = o("note-align-horizontal");
|
|
2058
|
+
t && Hn(t, "horizontal", r.horizontal);
|
|
2059
|
+
let i = o("note-align-vertical");
|
|
2060
|
+
i && Hn(i, "vertical", r.vertical);
|
|
2061
|
+
}, l = (e) => {
|
|
2062
|
+
typeof document.execCommand == "function" && document.execCommand(e, !1), c();
|
|
2063
|
+
}, u = (e) => {
|
|
2064
|
+
e === "horizontal" ? r.horizontal = kn(Dn, r.horizontal) : r.vertical = kn(On, r.vertical), Un(n, r), c();
|
|
2065
|
+
}, d = (e) => {
|
|
2066
|
+
e === "note-bold" ? l("bold") : e === "note-italic" ? l("italic") : e === "note-bullet" ? (Rn(n), c()) : u(e === "note-align-horizontal" ? "horizontal" : "vertical");
|
|
2067
|
+
}, f = () => c();
|
|
2068
|
+
document.addEventListener("selectionchange", f);
|
|
2069
|
+
let p = !1, m = () => {
|
|
2070
|
+
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
|
+
}, h = () => {
|
|
2072
|
+
if (p) return;
|
|
2073
|
+
let t = Kn(e, Wn(Mn(n)), r);
|
|
2074
|
+
m(), t && this.modeling.updateProperties(e, t);
|
|
2075
|
+
}, g = (e) => {
|
|
2044
2076
|
if (e.key === "Escape") {
|
|
2045
|
-
e.preventDefault(),
|
|
2077
|
+
e.preventDefault(), m();
|
|
2046
2078
|
return;
|
|
2047
2079
|
}
|
|
2048
2080
|
if (e.key === "Enter") {
|
|
2049
2081
|
if (!(e.metaKey || e.ctrlKey)) return;
|
|
2050
|
-
e.preventDefault(),
|
|
2082
|
+
e.preventDefault(), h();
|
|
2051
2083
|
return;
|
|
2052
2084
|
}
|
|
2053
2085
|
let t = e.key.toLowerCase();
|
|
2054
|
-
(e.metaKey || e.ctrlKey) && (t === "b" || t === "i") && (e.preventDefault(),
|
|
2055
|
-
},
|
|
2056
|
-
e.relatedTarget instanceof Node &&
|
|
2057
|
-
},
|
|
2086
|
+
(e.metaKey || e.ctrlKey) && (t === "b" || t === "i") && (e.preventDefault(), l(t === "b" ? "bold" : "italic"));
|
|
2087
|
+
}, _ = (e) => {
|
|
2088
|
+
e.relatedTarget instanceof Node && i.contains(e.relatedTarget) || h();
|
|
2089
|
+
}, v = (e) => {
|
|
2058
2090
|
e.preventDefault();
|
|
2059
2091
|
let t = e.clipboardData?.getData("text/plain") ?? "";
|
|
2060
|
-
t &&
|
|
2092
|
+
t && In(n, t);
|
|
2061
2093
|
};
|
|
2062
|
-
|
|
2063
|
-
|
|
2094
|
+
n.addEventListener("keydown", g), n.addEventListener("blur", _), n.addEventListener("paste", v), c(), this.restoreNoteAlign = (e) => {
|
|
2095
|
+
r.horizontal = e.horizontal, r.vertical = e.vertical, Un(n, r), c();
|
|
2064
2096
|
};
|
|
2065
|
-
let
|
|
2097
|
+
let ee = () => ({
|
|
2066
2098
|
elementId: e.id,
|
|
2067
2099
|
connection: !1,
|
|
2068
|
-
value:
|
|
2069
|
-
align: { ...
|
|
2100
|
+
value: Mn(n),
|
|
2101
|
+
align: { ...r }
|
|
2070
2102
|
});
|
|
2071
2103
|
this.active = {
|
|
2072
|
-
field:
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2104
|
+
field: n,
|
|
2105
|
+
place: a,
|
|
2106
|
+
commit: h,
|
|
2107
|
+
cleanup: m,
|
|
2108
|
+
snapshot: ee
|
|
2076
2109
|
};
|
|
2077
2110
|
}
|
|
2078
2111
|
activateConnection(e) {
|
|
2079
2112
|
if (this.active?.commit(), this.readOnly?.isReadOnly()) return;
|
|
2080
|
-
let t = this.canvas.getContainer(), n =
|
|
2081
|
-
if (!
|
|
2082
|
-
let
|
|
2083
|
-
|
|
2084
|
-
let
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2113
|
+
let t = this.canvas.getContainer(), n = e.waypoints[0], r = e.waypoints[e.waypoints.length - 1];
|
|
2114
|
+
if (!n || !r) return;
|
|
2115
|
+
let i = document.createElement("input");
|
|
2116
|
+
i.type = "text", i.className = "event-storming-label-input", i.placeholder = "arrow label", i.value = e.linkLabel ?? "", i.style.position = "absolute";
|
|
2117
|
+
let a = () => {
|
|
2118
|
+
let e = this.canvas.zoom(), t = this.canvas.viewbox();
|
|
2119
|
+
i.style.left = `${((n.x + r.x) / 2 - 60 - t.x) * e}px`, i.style.top = `${((n.y + r.y) / 2 - 26 - t.y) * e}px`;
|
|
2120
|
+
};
|
|
2121
|
+
a(), t.appendChild(i), i.focus(), i.select();
|
|
2122
|
+
let o = !1, s = () => {
|
|
2123
|
+
o || (o = !0, i.removeEventListener("keydown", l), i.removeEventListener("blur", u), i.remove(), this.active = null, this.canvas.restoreFocus?.());
|
|
2124
|
+
}, c = () => {
|
|
2125
|
+
if (o) return;
|
|
2126
|
+
let t = Wn(i.value), n = e.linkLabel ?? "";
|
|
2127
|
+
s(), t !== n && this.modeling.updateProperties(e, { linkLabel: t || void 0 });
|
|
2128
|
+
}, l = (e) => {
|
|
2129
|
+
e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Enter" && (e.preventDefault(), c());
|
|
2130
|
+
}, u = () => c();
|
|
2131
|
+
i.addEventListener("keydown", l), i.addEventListener("blur", u);
|
|
2132
|
+
let d = () => ({
|
|
2095
2133
|
elementId: e.id,
|
|
2096
2134
|
connection: !0,
|
|
2097
|
-
value:
|
|
2098
|
-
selectionStart:
|
|
2099
|
-
selectionEnd:
|
|
2135
|
+
value: i.value,
|
|
2136
|
+
selectionStart: i.selectionStart ?? void 0,
|
|
2137
|
+
selectionEnd: i.selectionEnd ?? void 0
|
|
2100
2138
|
});
|
|
2101
2139
|
this.active = {
|
|
2102
|
-
field:
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2140
|
+
field: i,
|
|
2141
|
+
place: a,
|
|
2142
|
+
commit: c,
|
|
2143
|
+
cleanup: s,
|
|
2144
|
+
snapshot: d
|
|
2106
2145
|
};
|
|
2107
2146
|
}
|
|
2108
2147
|
cancel() {
|
|
@@ -2117,23 +2156,23 @@ var Vn = class {
|
|
|
2117
2156
|
};
|
|
2118
2157
|
}
|
|
2119
2158
|
};
|
|
2120
|
-
function
|
|
2159
|
+
function Kn(e, t, n) {
|
|
2121
2160
|
let r = !!t && t !== e.eventStormingLabel, i = n.horizontal !== (e.alignHorizontal ?? "left") || n.vertical !== (e.alignVertical ?? "top");
|
|
2122
2161
|
if (!r && !i) return null;
|
|
2123
2162
|
let a = {};
|
|
2124
|
-
if (r && (a.eventStormingLabel = t, !
|
|
2125
|
-
let { width: n, height: r } =
|
|
2163
|
+
if (r && (a.eventStormingLabel = t, !N(e.eventStormingLabel, e))) {
|
|
2164
|
+
let { width: n, height: r } = M(t);
|
|
2126
2165
|
a.width = n, a.height = r, a.x = e.x + e.width / 2 - n / 2, a.y = e.y + e.height / 2 - r / 2;
|
|
2127
2166
|
}
|
|
2128
2167
|
return i && (a.alignHorizontal = n.horizontal === "left" ? void 0 : n.horizontal, a.alignVertical = n.vertical === "top" ? void 0 : n.vertical), a;
|
|
2129
2168
|
}
|
|
2130
|
-
function
|
|
2169
|
+
function qn(e) {
|
|
2131
2170
|
let t = document.createRange();
|
|
2132
2171
|
t.selectNodeContents(e), t.collapse(!1);
|
|
2133
2172
|
let n = window.getSelection();
|
|
2134
2173
|
n?.removeAllRanges(), n?.addRange(t);
|
|
2135
2174
|
}
|
|
2136
|
-
function
|
|
2175
|
+
function Jn(e) {
|
|
2137
2176
|
if (typeof document.queryCommandState != "function") return !1;
|
|
2138
2177
|
try {
|
|
2139
2178
|
return document.queryCommandState(e);
|
|
@@ -2143,10 +2182,10 @@ function Wn(e) {
|
|
|
2143
2182
|
}
|
|
2144
2183
|
//#endregion
|
|
2145
2184
|
//#region src/label-editing/index.ts
|
|
2146
|
-
var
|
|
2185
|
+
var Yn = {
|
|
2147
2186
|
__init__: ["eventStormingLabelEditing"],
|
|
2148
|
-
eventStormingLabelEditing: ["type",
|
|
2149
|
-
},
|
|
2187
|
+
eventStormingLabelEditing: ["type", Gn]
|
|
2188
|
+
}, Xn = 2, Zn = 10, Qn = {
|
|
2150
2189
|
arrowleft: {
|
|
2151
2190
|
x: -1,
|
|
2152
2191
|
y: 0
|
|
@@ -2163,7 +2202,7 @@ var Gn = {
|
|
|
2163
2202
|
x: 0,
|
|
2164
2203
|
y: 1
|
|
2165
2204
|
}
|
|
2166
|
-
},
|
|
2205
|
+
}, $n = class {
|
|
2167
2206
|
static $inject = [
|
|
2168
2207
|
"config.eventStormingKeyboard",
|
|
2169
2208
|
"canvas",
|
|
@@ -2181,12 +2220,12 @@ var Gn = {
|
|
|
2181
2220
|
];
|
|
2182
2221
|
constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2183
2222
|
let p = t.getContainer(), m = e?.undoRedoKeys ?? !0, h = (e) => {
|
|
2184
|
-
e.defaultPrevented ||
|
|
2223
|
+
e.defaultPrevented || er(e.target, p) && (tr(e.target) || g(e) || f?.isReadOnly() || _(e));
|
|
2185
2224
|
}, g = (e) => {
|
|
2186
2225
|
let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
|
|
2187
2226
|
if (t && n === "a" && !e.shiftKey && !e.altKey) {
|
|
2188
2227
|
e.preventDefault();
|
|
2189
|
-
let t = (d?.getAll() ?? []).filter((e) =>
|
|
2228
|
+
let t = (d?.getAll() ?? []).filter((e) => b(e) || x(e));
|
|
2190
2229
|
r.select(t);
|
|
2191
2230
|
} else if (t && n === "c") a.copy() && e.preventDefault();
|
|
2192
2231
|
else if (!t && !e.altKey && n === "l") {
|
|
@@ -2209,14 +2248,14 @@ var Gn = {
|
|
|
2209
2248
|
let t = c.getLastMoveEvent();
|
|
2210
2249
|
if (t) {
|
|
2211
2250
|
e.preventDefault();
|
|
2212
|
-
let n = l === "e" ? o.createNew("event",
|
|
2251
|
+
let n = l === "e" ? o.createNew("event", O.event.label) : o.createNew("command", O.command.label);
|
|
2213
2252
|
s.start(t, n);
|
|
2214
2253
|
}
|
|
2215
|
-
} else if (l in
|
|
2254
|
+
} else if (l in Qn && !t) {
|
|
2216
2255
|
let t = r.get();
|
|
2217
2256
|
if (t.length) {
|
|
2218
2257
|
e.preventDefault();
|
|
2219
|
-
let n = e.shiftKey ?
|
|
2258
|
+
let n = e.shiftKey ? Zn : Xn, r = Qn[l];
|
|
2220
2259
|
i.moveElements(t, {
|
|
2221
2260
|
x: r.x * n,
|
|
2222
2261
|
y: r.y * n
|
|
@@ -2227,20 +2266,20 @@ var Gn = {
|
|
|
2227
2266
|
document.addEventListener("keydown", h), u.on("diagram.destroy", () => document.removeEventListener("keydown", h));
|
|
2228
2267
|
}
|
|
2229
2268
|
};
|
|
2230
|
-
function
|
|
2269
|
+
function er(e, t) {
|
|
2231
2270
|
return e instanceof Node ? t.contains(e) || e === document.body || e === document.documentElement : !1;
|
|
2232
2271
|
}
|
|
2233
|
-
function
|
|
2272
|
+
function tr(e) {
|
|
2234
2273
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2235
2274
|
let t = e.tagName;
|
|
2236
2275
|
return t === "INPUT" || t === "TEXTAREA" || e.isContentEditable;
|
|
2237
2276
|
}
|
|
2238
2277
|
//#endregion
|
|
2239
2278
|
//#region src/keyboard/index.ts
|
|
2240
|
-
var
|
|
2279
|
+
var nr = {
|
|
2241
2280
|
__init__: ["eventStormingKeyboard"],
|
|
2242
|
-
eventStormingKeyboard: ["type",
|
|
2243
|
-
},
|
|
2281
|
+
eventStormingKeyboard: ["type", $n]
|
|
2282
|
+
}, rr = 500, ir = 6, ar = class {
|
|
2244
2283
|
static $inject = ["injector", "eventBus"];
|
|
2245
2284
|
constructor(e, t) {
|
|
2246
2285
|
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;
|
|
@@ -2273,14 +2312,14 @@ var Qn = {
|
|
|
2273
2312
|
let n = o.getAbsoluteBBox(e), c = o.getContainer().getBoundingClientRect();
|
|
2274
2313
|
i.open(e, G, {
|
|
2275
2314
|
x: c.left + n.x,
|
|
2276
|
-
y: c.top + n.y + n.height +
|
|
2315
|
+
y: c.top + n.y + n.height + ir
|
|
2277
2316
|
}), i.isOpen() ? t.once("popupMenu.close", () => {
|
|
2278
2317
|
setTimeout(() => {
|
|
2279
2318
|
s || (e.provisional ? e.parent && a.removeElements([e]) : r?.activate(e));
|
|
2280
2319
|
}, 0);
|
|
2281
2320
|
}) : a.removeElements([e]);
|
|
2282
2321
|
};
|
|
2283
|
-
t.on("create.end",
|
|
2322
|
+
t.on("create.end", rr, (e) => {
|
|
2284
2323
|
let { context: t } = e;
|
|
2285
2324
|
if (!t.source || !t.canExecute || !t.shape) return;
|
|
2286
2325
|
let n = t.shape;
|
|
@@ -2297,14 +2336,14 @@ var Qn = {
|
|
|
2297
2336
|
} else r && setTimeout(() => r.activate(n), 0);
|
|
2298
2337
|
});
|
|
2299
2338
|
}
|
|
2300
|
-
},
|
|
2301
|
-
__depends__: [
|
|
2339
|
+
}, or = {
|
|
2340
|
+
__depends__: [_e],
|
|
2302
2341
|
__init__: ["eventStormingAppendBehavior"],
|
|
2303
|
-
eventStormingAppendBehavior: ["type",
|
|
2304
|
-
},
|
|
2305
|
-
value:
|
|
2306
|
-
title:
|
|
2307
|
-
})),
|
|
2342
|
+
eventStormingAppendBehavior: ["type", ar]
|
|
2343
|
+
}, sr = S.map((e) => ({
|
|
2344
|
+
value: O[e].fill,
|
|
2345
|
+
title: O[e].label
|
|
2346
|
+
})), cr = class {
|
|
2308
2347
|
canvas;
|
|
2309
2348
|
modeling;
|
|
2310
2349
|
static $inject = [
|
|
@@ -2334,7 +2373,7 @@ var Qn = {
|
|
|
2334
2373
|
value: void 0,
|
|
2335
2374
|
title: "No color",
|
|
2336
2375
|
cls: "event-storming-cp-none"
|
|
2337
|
-
}, ...
|
|
2376
|
+
}, ...sr.map((e) => ({
|
|
2338
2377
|
value: e.value,
|
|
2339
2378
|
title: e.title,
|
|
2340
2379
|
cls: ""
|
|
@@ -2354,12 +2393,12 @@ var Qn = {
|
|
|
2354
2393
|
close() {
|
|
2355
2394
|
this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0));
|
|
2356
2395
|
}
|
|
2357
|
-
},
|
|
2396
|
+
}, lr = {
|
|
2358
2397
|
__init__: ["eventStormingColorPicker"],
|
|
2359
|
-
eventStormingColorPicker: ["type",
|
|
2360
|
-
},
|
|
2398
|
+
eventStormingColorPicker: ["type", cr]
|
|
2399
|
+
}, ur = {
|
|
2361
2400
|
__init__: ["eventStormingOrderingProvider"],
|
|
2362
|
-
eventStormingOrderingProvider: ["type", class extends
|
|
2401
|
+
eventStormingOrderingProvider: ["type", class extends ve {
|
|
2363
2402
|
static $inject = ["eventBus"];
|
|
2364
2403
|
constructor(e) {
|
|
2365
2404
|
super(e);
|
|
@@ -2367,15 +2406,15 @@ var Qn = {
|
|
|
2367
2406
|
getOrdering(e, t) {
|
|
2368
2407
|
for (; t.parent;) t = t.parent;
|
|
2369
2408
|
let n = t.children ?? [];
|
|
2370
|
-
if (
|
|
2371
|
-
let r = n.filter((t) => t !== e && (
|
|
2409
|
+
if (x(e)) {
|
|
2410
|
+
let r = n.filter((t) => t !== e && (T(t) || x(t))).length;
|
|
2372
2411
|
return {
|
|
2373
2412
|
parent: t,
|
|
2374
2413
|
index: r
|
|
2375
2414
|
};
|
|
2376
2415
|
}
|
|
2377
|
-
if (
|
|
2378
|
-
let r = n.filter((t) => t !== e &&
|
|
2416
|
+
if (T(e)) {
|
|
2417
|
+
let r = n.filter((t) => t !== e && T(t)).length;
|
|
2379
2418
|
return {
|
|
2380
2419
|
parent: t,
|
|
2381
2420
|
index: r
|
|
@@ -2384,7 +2423,7 @@ var Qn = {
|
|
|
2384
2423
|
return { parent: t };
|
|
2385
2424
|
}
|
|
2386
2425
|
}]
|
|
2387
|
-
},
|
|
2426
|
+
}, dr = 12, fr = class {
|
|
2388
2427
|
canvas;
|
|
2389
2428
|
eventBus;
|
|
2390
2429
|
modeling;
|
|
@@ -2463,12 +2502,12 @@ var Qn = {
|
|
|
2463
2502
|
if (e.button !== 0 || this.isChromeTarget(e)) return;
|
|
2464
2503
|
e.preventDefault(), e.stopPropagation();
|
|
2465
2504
|
let t = this.toCanvasPoint(e), n = this.points[0];
|
|
2466
|
-
if (n && this.points.length >= 3 &&
|
|
2505
|
+
if (n && this.points.length >= 3 && pr(t, n) <= dr) {
|
|
2467
2506
|
this.finishClosed();
|
|
2468
2507
|
return;
|
|
2469
2508
|
}
|
|
2470
2509
|
let r = this.points[this.points.length - 1];
|
|
2471
|
-
r &&
|
|
2510
|
+
r && pr(t, r) <= dr ? this.points.length >= 2 && this.finish() : (this.points.push(t), this.renderPreview());
|
|
2472
2511
|
};
|
|
2473
2512
|
onDblClick = (e) => {
|
|
2474
2513
|
this.isChromeTarget(e) || (e.preventDefault(), e.stopPropagation(), this.finish());
|
|
@@ -2485,7 +2524,7 @@ var Qn = {
|
|
|
2485
2524
|
f(t, p(m("polyline"), {
|
|
2486
2525
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
2487
2526
|
fill: "none",
|
|
2488
|
-
stroke:
|
|
2527
|
+
stroke: F,
|
|
2489
2528
|
"stroke-width": 2,
|
|
2490
2529
|
"stroke-linecap": "round",
|
|
2491
2530
|
"stroke-linejoin": "round",
|
|
@@ -2496,8 +2535,8 @@ var Qn = {
|
|
|
2496
2535
|
cx: r.x,
|
|
2497
2536
|
cy: r.y,
|
|
2498
2537
|
r: this.points.length >= 3 ? 5 : 3,
|
|
2499
|
-
fill:
|
|
2500
|
-
stroke:
|
|
2538
|
+
fill: P.paper,
|
|
2539
|
+
stroke: F,
|
|
2501
2540
|
"stroke-width": 1.5
|
|
2502
2541
|
})), this.points.length >= 2) {
|
|
2503
2542
|
let e = this.points[this.points.length - 1];
|
|
@@ -2505,8 +2544,8 @@ var Qn = {
|
|
|
2505
2544
|
cx: e.x,
|
|
2506
2545
|
cy: e.y,
|
|
2507
2546
|
r: 5,
|
|
2508
|
-
fill:
|
|
2509
|
-
stroke:
|
|
2547
|
+
fill: P.paper,
|
|
2548
|
+
stroke: F,
|
|
2510
2549
|
"stroke-width": 1.5
|
|
2511
2550
|
}));
|
|
2512
2551
|
}
|
|
@@ -2516,12 +2555,12 @@ var Qn = {
|
|
|
2516
2555
|
this.layer &&= (h(this.layer), null);
|
|
2517
2556
|
}
|
|
2518
2557
|
};
|
|
2519
|
-
function
|
|
2558
|
+
function pr(e, t) {
|
|
2520
2559
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
2521
2560
|
}
|
|
2522
2561
|
//#endregion
|
|
2523
2562
|
//#region src/draw-tool/EventStormingDrawingHandles.ts
|
|
2524
|
-
var
|
|
2563
|
+
var mr = class {
|
|
2525
2564
|
eventBus;
|
|
2526
2565
|
canvas;
|
|
2527
2566
|
modeling;
|
|
@@ -2538,7 +2577,7 @@ var ur = class {
|
|
|
2538
2577
|
constructor(e, t, n, r) {
|
|
2539
2578
|
this.eventBus = e, this.canvas = t, this.modeling = n, this.readOnly = r, e.on(K, () => this.render()), e.on("selection.changed", (e) => {
|
|
2540
2579
|
let t = e.newSelection ?? [], n = t.length === 1 ? t[0] : null;
|
|
2541
|
-
this.attach(
|
|
2580
|
+
this.attach(T(n) ? n : null);
|
|
2542
2581
|
}), e.on("element.changed", (e) => {
|
|
2543
2582
|
this.shape && e.element === this.shape && this.render();
|
|
2544
2583
|
}), e.on(["diagram.clear", "diagram.destroy"], () => this.attach(null));
|
|
@@ -2561,8 +2600,8 @@ var ur = class {
|
|
|
2561
2600
|
cx: e.x,
|
|
2562
2601
|
cy: e.y,
|
|
2563
2602
|
r: 5,
|
|
2564
|
-
fill:
|
|
2565
|
-
stroke:
|
|
2603
|
+
fill: P.paper,
|
|
2604
|
+
stroke: P.ink,
|
|
2566
2605
|
"stroke-width": 1.5,
|
|
2567
2606
|
class: "event-storming-drawing-handle"
|
|
2568
2607
|
});
|
|
@@ -2597,7 +2636,7 @@ var ur = class {
|
|
|
2597
2636
|
let n = this.canvas.getLayer("event-storming-drawing-handles", 1100), r = p(m(t ? "polygon" : "polyline"), {
|
|
2598
2637
|
points: e.map((e) => `${e.x},${e.y}`).join(" "),
|
|
2599
2638
|
fill: "none",
|
|
2600
|
-
stroke:
|
|
2639
|
+
stroke: P.ink,
|
|
2601
2640
|
"stroke-width": 1.5,
|
|
2602
2641
|
"stroke-dasharray": "5 4",
|
|
2603
2642
|
"pointer-events": "none"
|
|
@@ -2617,17 +2656,17 @@ var ur = class {
|
|
|
2617
2656
|
y: (e.clientY - t.top) / r + n.y
|
|
2618
2657
|
};
|
|
2619
2658
|
}
|
|
2620
|
-
},
|
|
2659
|
+
}, hr = class {
|
|
2621
2660
|
static $inject = ["eventBus", "interactionEvents"];
|
|
2622
2661
|
constructor(e, t) {
|
|
2623
2662
|
e.on("interactionEvents.createHit", (e) => {
|
|
2624
|
-
if (
|
|
2663
|
+
if (T(e.element) && e.gfx) return gr(e.element, e.gfx), !1;
|
|
2625
2664
|
}), e.on("interactionEvents.updateHit", (e) => {
|
|
2626
|
-
if (
|
|
2665
|
+
if (T(e.element) && e.gfx) return t.removeHits(e.gfx), gr(e.element, e.gfx), !1;
|
|
2627
2666
|
});
|
|
2628
2667
|
}
|
|
2629
2668
|
};
|
|
2630
|
-
function
|
|
2669
|
+
function gr(e, t) {
|
|
2631
2670
|
let n = e.drawingPoints ?? [], r = m(e.closed ? "polygon" : "polyline");
|
|
2632
2671
|
p(r, {
|
|
2633
2672
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
@@ -2640,56 +2679,56 @@ function fr(e, t) {
|
|
|
2640
2679
|
}
|
|
2641
2680
|
//#endregion
|
|
2642
2681
|
//#region src/draw-tool/index.ts
|
|
2643
|
-
var
|
|
2682
|
+
var _r = {
|
|
2644
2683
|
__init__: [
|
|
2645
2684
|
"eventStormingDrawTool",
|
|
2646
2685
|
"eventStormingDrawingHandles",
|
|
2647
2686
|
"eventStormingDrawingHitProvider"
|
|
2648
2687
|
],
|
|
2649
|
-
eventStormingDrawTool: ["type",
|
|
2650
|
-
eventStormingDrawingHandles: ["type",
|
|
2651
|
-
eventStormingDrawingHitProvider: ["type",
|
|
2652
|
-
},
|
|
2688
|
+
eventStormingDrawTool: ["type", fr],
|
|
2689
|
+
eventStormingDrawingHandles: ["type", mr],
|
|
2690
|
+
eventStormingDrawingHitProvider: ["type", hr]
|
|
2691
|
+
}, vr = class {
|
|
2653
2692
|
static $inject = ["eventBus"];
|
|
2654
2693
|
constructor(e) {
|
|
2655
2694
|
e.on("resize.start", 1500, (e) => {
|
|
2656
2695
|
let t = e.context;
|
|
2657
|
-
|
|
2696
|
+
Oe(t.shape) && (t.minDimensions = A);
|
|
2658
2697
|
});
|
|
2659
2698
|
}
|
|
2660
|
-
},
|
|
2661
|
-
__depends__: [
|
|
2699
|
+
}, yr = {
|
|
2700
|
+
__depends__: [ye],
|
|
2662
2701
|
__init__: ["eventStormingResizeBehavior"],
|
|
2663
|
-
eventStormingResizeBehavior: ["type",
|
|
2664
|
-
},
|
|
2702
|
+
eventStormingResizeBehavior: ["type", vr]
|
|
2703
|
+
}, br = class extends W {
|
|
2665
2704
|
_getModules() {
|
|
2666
2705
|
return [
|
|
2667
2706
|
...super._getModules(),
|
|
2668
2707
|
te,
|
|
2669
|
-
|
|
2670
|
-
y,
|
|
2671
|
-
b,
|
|
2708
|
+
se,
|
|
2672
2709
|
ne,
|
|
2673
2710
|
re,
|
|
2674
2711
|
ie,
|
|
2712
|
+
ae,
|
|
2675
2713
|
oe,
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
xn,
|
|
2684
|
-
Gn,
|
|
2685
|
-
Qn,
|
|
2714
|
+
ce,
|
|
2715
|
+
le,
|
|
2716
|
+
Sn,
|
|
2717
|
+
tn,
|
|
2718
|
+
Vt,
|
|
2719
|
+
sn,
|
|
2720
|
+
ln,
|
|
2686
2721
|
mn,
|
|
2722
|
+
Tn,
|
|
2723
|
+
Yn,
|
|
2687
2724
|
nr,
|
|
2688
|
-
|
|
2689
|
-
Ut,
|
|
2725
|
+
vn,
|
|
2690
2726
|
or,
|
|
2691
|
-
|
|
2692
|
-
|
|
2727
|
+
lr,
|
|
2728
|
+
nn,
|
|
2729
|
+
ur,
|
|
2730
|
+
_r,
|
|
2731
|
+
yr
|
|
2693
2732
|
];
|
|
2694
2733
|
}
|
|
2695
2734
|
undo() {
|
|
@@ -2704,28 +2743,29 @@ var pr = {
|
|
|
2704
2743
|
canRedo() {
|
|
2705
2744
|
return this.get("commandStack").canRedo();
|
|
2706
2745
|
}
|
|
2707
|
-
},
|
|
2708
|
-
function
|
|
2709
|
-
return
|
|
2710
|
-
...
|
|
2746
|
+
}, xr = "event-storming";
|
|
2747
|
+
function Sr(e = {}) {
|
|
2748
|
+
return Tr(new br({
|
|
2749
|
+
...wr(e),
|
|
2711
2750
|
undoRedoKeys: e.undoRedoKeys ?? !0,
|
|
2712
|
-
|
|
2751
|
+
freeArea: R(e)
|
|
2713
2752
|
}), !0);
|
|
2714
2753
|
}
|
|
2715
|
-
function
|
|
2716
|
-
return
|
|
2754
|
+
function Cr(e = {}) {
|
|
2755
|
+
return Tr(new W(wr(e)), !1);
|
|
2717
2756
|
}
|
|
2718
|
-
function
|
|
2757
|
+
function wr(e) {
|
|
2719
2758
|
return {
|
|
2720
2759
|
width: "100%",
|
|
2721
2760
|
height: "100%",
|
|
2722
|
-
additionalModules: e.additionalModules ?? []
|
|
2761
|
+
additionalModules: e.additionalModules ?? [],
|
|
2762
|
+
fitOnImport: e.fitOnImport ?? !0
|
|
2723
2763
|
};
|
|
2724
2764
|
}
|
|
2725
|
-
function
|
|
2765
|
+
function Tr(e, t) {
|
|
2726
2766
|
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 = {
|
|
2727
|
-
notation:
|
|
2728
|
-
apiVersion:
|
|
2767
|
+
notation: xr,
|
|
2768
|
+
apiVersion: be,
|
|
2729
2769
|
editable: t
|
|
2730
2770
|
};
|
|
2731
2771
|
return t && n.on("commandStack.changed", () => {
|
|
@@ -2733,16 +2773,21 @@ function xr(e, t) {
|
|
|
2733
2773
|
}), {
|
|
2734
2774
|
meta: u,
|
|
2735
2775
|
elements: {
|
|
2736
|
-
list: () => c ? [] : i.getAll().filter(
|
|
2776
|
+
list: () => c ? [] : i.getAll().filter(Y).map((e) => Or(e)),
|
|
2737
2777
|
reveal(e) {
|
|
2738
2778
|
if (c) return !1;
|
|
2739
2779
|
let t = i.get(e);
|
|
2740
|
-
return
|
|
2780
|
+
return Y(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
|
|
2741
2781
|
},
|
|
2742
|
-
selection: () => c ? [] :
|
|
2782
|
+
selection: () => c ? [] : Er(a.get()),
|
|
2743
2783
|
onSelection(e) {
|
|
2744
|
-
let t = (t) => e(
|
|
2784
|
+
let t = (t) => e(Er(t.newSelection ?? []));
|
|
2745
2785
|
return n.on("selection.changed", t), () => n.off("selection.changed", t);
|
|
2786
|
+
},
|
|
2787
|
+
bounds(e) {
|
|
2788
|
+
if (c) return;
|
|
2789
|
+
let t = i.get(e);
|
|
2790
|
+
return Y(t) ? Dr(t) : void 0;
|
|
2746
2791
|
}
|
|
2747
2792
|
},
|
|
2748
2793
|
diagram: e,
|
|
@@ -2754,7 +2799,7 @@ function xr(e, t) {
|
|
|
2754
2799
|
s += 1;
|
|
2755
2800
|
try {
|
|
2756
2801
|
let { warnings: n } = await e.importDSL(t);
|
|
2757
|
-
return { warnings: n.map(
|
|
2802
|
+
return { warnings: n.map(Lt) };
|
|
2758
2803
|
} finally {
|
|
2759
2804
|
--s;
|
|
2760
2805
|
}
|
|
@@ -2773,13 +2818,13 @@ function xr(e, t) {
|
|
|
2773
2818
|
width: n,
|
|
2774
2819
|
height: i
|
|
2775
2820
|
};
|
|
2776
|
-
return
|
|
2821
|
+
return kr(a) ? a : void 0;
|
|
2777
2822
|
} catch {
|
|
2778
2823
|
return;
|
|
2779
2824
|
}
|
|
2780
2825
|
},
|
|
2781
2826
|
setViewState(e) {
|
|
2782
|
-
!c &&
|
|
2827
|
+
!c && kr(e) && r.viewbox({
|
|
2783
2828
|
x: e.x,
|
|
2784
2829
|
y: e.y,
|
|
2785
2830
|
width: e.width,
|
|
@@ -2798,30 +2843,38 @@ function xr(e, t) {
|
|
|
2798
2843
|
}
|
|
2799
2844
|
};
|
|
2800
2845
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return
|
|
2846
|
+
function Y(e) {
|
|
2847
|
+
return w(e);
|
|
2803
2848
|
}
|
|
2804
|
-
function
|
|
2805
|
-
return e.filter(
|
|
2849
|
+
function Er(e) {
|
|
2850
|
+
return e.filter(Y).map((e) => e.id);
|
|
2806
2851
|
}
|
|
2807
|
-
function
|
|
2852
|
+
function Dr(e) {
|
|
2853
|
+
return {
|
|
2854
|
+
x: e.x,
|
|
2855
|
+
y: e.y,
|
|
2856
|
+
width: e.width,
|
|
2857
|
+
height: e.height
|
|
2858
|
+
};
|
|
2859
|
+
}
|
|
2860
|
+
function Or(e) {
|
|
2808
2861
|
let t = e.eventStormingLabel;
|
|
2809
2862
|
return t ? {
|
|
2810
2863
|
id: e.id,
|
|
2811
2864
|
name: t
|
|
2812
2865
|
} : { id: e.id };
|
|
2813
2866
|
}
|
|
2814
|
-
function
|
|
2867
|
+
function kr(e) {
|
|
2815
2868
|
if (typeof e != "object" || !e) return !1;
|
|
2816
2869
|
let { x: t, y: n, width: r, height: i } = e;
|
|
2817
|
-
return
|
|
2870
|
+
return X(t) && X(n) && X(r) && X(i) && r > 0 && i > 0;
|
|
2818
2871
|
}
|
|
2819
|
-
function
|
|
2872
|
+
function X(e) {
|
|
2820
2873
|
return typeof e == "number" && Number.isFinite(e);
|
|
2821
2874
|
}
|
|
2822
2875
|
//#endregion
|
|
2823
2876
|
//#region src/board-menu/menu.ts
|
|
2824
|
-
var
|
|
2877
|
+
var Ar = "Export as .storm", jr = [
|
|
2825
2878
|
{
|
|
2826
2879
|
value: "big-picture",
|
|
2827
2880
|
label: "Big picture"
|
|
@@ -2835,10 +2888,10 @@ var Er = "Export as .storm", Dr = [
|
|
|
2835
2888
|
label: "Software design"
|
|
2836
2889
|
}
|
|
2837
2890
|
];
|
|
2838
|
-
function
|
|
2839
|
-
return
|
|
2891
|
+
function Mr(e) {
|
|
2892
|
+
return jr.some((t) => t.value === e);
|
|
2840
2893
|
}
|
|
2841
|
-
function
|
|
2894
|
+
function Z(e, t, n, r) {
|
|
2842
2895
|
return {
|
|
2843
2896
|
kind: "action",
|
|
2844
2897
|
id: e,
|
|
@@ -2848,20 +2901,20 @@ function X(e, t, n, r) {
|
|
|
2848
2901
|
onSelect: () => n.onSelect()
|
|
2849
2902
|
};
|
|
2850
2903
|
}
|
|
2851
|
-
function
|
|
2852
|
-
let t = [
|
|
2853
|
-
return e.transparentPng && t.push(
|
|
2904
|
+
function Nr(e) {
|
|
2905
|
+
let t = [Z("export-png", "Export as PNG", e.png, "file-image"), Z("export-svg", "Export as SVG", e.svg, "file-code-corner")];
|
|
2906
|
+
return e.transparentPng && t.push(Z("export-png-transparent", "Export as PNG (4×, transparent)", e.transparentPng)), e.json && t.push(Z("export-json", "Export as JSON", e.json)), e.storm && t.push(Z("export-storm", Ar, e.storm)), t;
|
|
2854
2907
|
}
|
|
2855
|
-
function
|
|
2908
|
+
function Pr(e) {
|
|
2856
2909
|
return {
|
|
2857
2910
|
model: [{
|
|
2858
2911
|
kind: "radio",
|
|
2859
2912
|
id: "level",
|
|
2860
2913
|
label: "Level",
|
|
2861
|
-
options:
|
|
2914
|
+
options: jr,
|
|
2862
2915
|
value: () => e.levels.getLevel(),
|
|
2863
2916
|
onSelect: (t) => {
|
|
2864
|
-
|
|
2917
|
+
Mr(t) && e.levels.setLevel(t);
|
|
2865
2918
|
}
|
|
2866
2919
|
}, {
|
|
2867
2920
|
kind: "checkbox",
|
|
@@ -2873,7 +2926,7 @@ function Ar(e) {
|
|
|
2873
2926
|
e.typeCaptions.setTypeCaptionsVisible(t), e.onTypeCaptionsToggled?.(t);
|
|
2874
2927
|
}
|
|
2875
2928
|
}],
|
|
2876
|
-
export:
|
|
2929
|
+
export: Nr(e.exports),
|
|
2877
2930
|
help: [{
|
|
2878
2931
|
kind: "dialog",
|
|
2879
2932
|
id: "keyboard-shortcuts",
|
|
@@ -2885,23 +2938,23 @@ function Ar(e) {
|
|
|
2885
2938
|
}
|
|
2886
2939
|
//#endregion
|
|
2887
2940
|
//#region src/board-menu/shortcuts.ts
|
|
2888
|
-
var
|
|
2941
|
+
var Fr = [
|
|
2889
2942
|
"←",
|
|
2890
2943
|
"↑",
|
|
2891
2944
|
"→",
|
|
2892
2945
|
"↓"
|
|
2893
2946
|
];
|
|
2894
|
-
function
|
|
2947
|
+
function Ir(e, t, n) {
|
|
2895
2948
|
return t === "mac" ? `⌘${e}` : `${n.ctrl}+${e}`;
|
|
2896
2949
|
}
|
|
2897
|
-
function
|
|
2950
|
+
function Lr(e) {
|
|
2898
2951
|
try {
|
|
2899
2952
|
return new Intl.NumberFormat(e, { style: "percent" }).format(1);
|
|
2900
2953
|
} catch {
|
|
2901
2954
|
return new Intl.NumberFormat("en", { style: "percent" }).format(1);
|
|
2902
2955
|
}
|
|
2903
2956
|
}
|
|
2904
|
-
function
|
|
2957
|
+
function Rr(e, t) {
|
|
2905
2958
|
if (e === "mac") return {
|
|
2906
2959
|
zoomIn: "⌘+",
|
|
2907
2960
|
zoomOut: "⌘−",
|
|
@@ -2916,7 +2969,7 @@ function Nr(e, t) {
|
|
|
2916
2969
|
fit: `${r}+1`
|
|
2917
2970
|
};
|
|
2918
2971
|
}
|
|
2919
|
-
function
|
|
2972
|
+
function zr(e, t) {
|
|
2920
2973
|
if (e === "mac") return {
|
|
2921
2974
|
undo: ["⌘Z"],
|
|
2922
2975
|
redo: ["⌘⇧Z"],
|
|
@@ -2925,7 +2978,7 @@ function Pr(e, t) {
|
|
|
2925
2978
|
paste: ["⌘V"],
|
|
2926
2979
|
duplicate: ["⌘D"],
|
|
2927
2980
|
remove: ["⌫"],
|
|
2928
|
-
coarseMove:
|
|
2981
|
+
coarseMove: Fr.map((e) => `⇧${e}`),
|
|
2929
2982
|
lassoDrag: ["⇧ Drag"]
|
|
2930
2983
|
};
|
|
2931
2984
|
let { ctrl: n, shift: r } = t;
|
|
@@ -2937,27 +2990,27 @@ function Pr(e, t) {
|
|
|
2937
2990
|
paste: [`${n}+V`],
|
|
2938
2991
|
duplicate: [`${n}+D`],
|
|
2939
2992
|
remove: ["Del", "Backspace"],
|
|
2940
|
-
coarseMove:
|
|
2993
|
+
coarseMove: Fr.map((e) => `${r}+${e}`),
|
|
2941
2994
|
lassoDrag: [`${r}+Drag`]
|
|
2942
2995
|
};
|
|
2943
2996
|
}
|
|
2944
|
-
function
|
|
2997
|
+
function Br(e) {
|
|
2945
2998
|
let { platform: t, messages: n } = e;
|
|
2946
2999
|
return {
|
|
2947
3000
|
title: "File",
|
|
2948
3001
|
rows: [{
|
|
2949
3002
|
action: n.openFile ?? "Open…",
|
|
2950
|
-
keys: [
|
|
3003
|
+
keys: [Ir("O", t, n.keyNames)]
|
|
2951
3004
|
}, {
|
|
2952
|
-
action:
|
|
2953
|
-
keys: [
|
|
3005
|
+
action: Ar,
|
|
3006
|
+
keys: [Ir("S", t, n.keyNames)]
|
|
2954
3007
|
}]
|
|
2955
3008
|
};
|
|
2956
3009
|
}
|
|
2957
|
-
function
|
|
2958
|
-
let { platform: n, messages: r } = e, i =
|
|
3010
|
+
function Vr(e, t = {}) {
|
|
3011
|
+
let { platform: n, messages: r } = e, i = Rr(n, r.keyNames), a = zr(n, r.keyNames);
|
|
2959
3012
|
return [
|
|
2960
|
-
...t.fileKeys ? [
|
|
3013
|
+
...t.fileKeys ? [Br(e)] : [],
|
|
2961
3014
|
{
|
|
2962
3015
|
title: "View",
|
|
2963
3016
|
rows: [
|
|
@@ -2970,7 +3023,7 @@ function Ir(e, t = {}) {
|
|
|
2970
3023
|
keys: [i.zoomOut]
|
|
2971
3024
|
},
|
|
2972
3025
|
{
|
|
2973
|
-
action: r.zoomToActual(
|
|
3026
|
+
action: r.zoomToActual(Lr(e.lang)),
|
|
2974
3027
|
keys: [i.zoomToActual]
|
|
2975
3028
|
},
|
|
2976
3029
|
{
|
|
@@ -3012,7 +3065,7 @@ function Ir(e, t = {}) {
|
|
|
3012
3065
|
},
|
|
3013
3066
|
{
|
|
3014
3067
|
action: "Move selection",
|
|
3015
|
-
keys:
|
|
3068
|
+
keys: Fr
|
|
3016
3069
|
},
|
|
3017
3070
|
{
|
|
3018
3071
|
action: "Move selection in large steps",
|
|
@@ -3053,13 +3106,13 @@ function Ir(e, t = {}) {
|
|
|
3053
3106
|
}
|
|
3054
3107
|
//#endregion
|
|
3055
3108
|
//#region src/board-menu/ShortcutsDialog.ts
|
|
3056
|
-
var Q = "event-storming-shortcuts",
|
|
3109
|
+
var Q = "event-storming-shortcuts", Hr = "event-storming-shortcuts-title";
|
|
3057
3110
|
function $(e, t, n) {
|
|
3058
3111
|
let r = document.createElement(e);
|
|
3059
3112
|
return r.className = t, n !== void 0 && (r.textContent = n), r;
|
|
3060
3113
|
}
|
|
3061
|
-
function
|
|
3062
|
-
let n = $("section", `${Q}-group`), r = `${
|
|
3114
|
+
function Ur(e, t) {
|
|
3115
|
+
let n = $("section", `${Q}-group`), r = `${Hr}-group-${t}`, i = $("h4", `${Q}-group-title`, e.title);
|
|
3063
3116
|
i.id = r;
|
|
3064
3117
|
let a = $("table", `${Q}-table`);
|
|
3065
3118
|
a.setAttribute("aria-labelledby", r);
|
|
@@ -3073,19 +3126,19 @@ function Rr(e, t) {
|
|
|
3073
3126
|
}
|
|
3074
3127
|
return n.append(i, a), n;
|
|
3075
3128
|
}
|
|
3076
|
-
function
|
|
3129
|
+
function Wr(e, t, n) {
|
|
3077
3130
|
let r = $("div", `${Q}-panel`), i = $("header", `${Q}-header`), a = $("h3", `${Q}-title`, "Keyboard shortcuts");
|
|
3078
|
-
a.id =
|
|
3131
|
+
a.id = Hr;
|
|
3079
3132
|
let o = $("button", `${Q}-close`);
|
|
3080
3133
|
o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML = q("x"), o.addEventListener("click", n), i.append(a, o);
|
|
3081
3134
|
let s = $("div", `${Q}-body`);
|
|
3082
|
-
return s.append(...
|
|
3135
|
+
return s.append(...Vr(e, t).map(Ur)), r.append(i, s), r;
|
|
3083
3136
|
}
|
|
3084
|
-
function
|
|
3137
|
+
function Gr(e, t = {}) {
|
|
3085
3138
|
let n;
|
|
3086
3139
|
function r() {
|
|
3087
3140
|
let n = $("dialog", Q);
|
|
3088
|
-
return n.setAttribute("aria-labelledby",
|
|
3141
|
+
return n.setAttribute("aria-labelledby", Hr), n.append(Wr(e, t, () => n.close())), n.addEventListener("click", (e) => {
|
|
3089
3142
|
e.target === n && n.close();
|
|
3090
3143
|
}), n.addEventListener("close", () => {
|
|
3091
3144
|
e.menu.trigger.hidden || e.menu.trigger.focus({ preventScroll: !0 });
|
|
@@ -3106,11 +3159,11 @@ function Br(e, t = {}) {
|
|
|
3106
3159
|
}
|
|
3107
3160
|
//#endregion
|
|
3108
3161
|
//#region src/draw/icons.ts
|
|
3109
|
-
var
|
|
3110
|
-
function
|
|
3162
|
+
var Kr = "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", qr = "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", Jr = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Yr = "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", Xr = "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", Zr = "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", Qr = "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", $r = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", ei = "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", ti = "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", ni = "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", ri = "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", ii = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", ai = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", oi = "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", si = "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";
|
|
3163
|
+
function ci(e, t = 18) {
|
|
3111
3164
|
return `<svg viewBox="0 0 24 24" width="${t}" height="${t}" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
|
|
3112
3165
|
}
|
|
3113
3166
|
//#endregion
|
|
3114
|
-
export {
|
|
3167
|
+
export { jr as BOARD_LEVELS, nt as BoardBounds, P as COLORS, xr as EVENT_STORMING_NOTATION, ar as EventStormingAppendBehavior, Bt as EventStormingAttachBehavior, qe as EventStormingBaseViewer, cr as EventStormingColorPicker, Qe as EventStormingElementFactory, _n as EventStormingElementSettingsProvider, Ft as EventStormingExporter, Pt as EventStormingImporter, Gn as EventStormingLabelEditing, qt as EventStormingModeling, xn as EventStormingReadOnly, vt as EventStormingRenderer, vr as EventStormingResizeBehavior, on as EventStormingRules, at as EventStormingViewOptions, ai as ICON_ADD, Qr as ICON_CODE, Zr as ICON_DATA_OBJECT, Jr as ICON_DELETE, $r as ICON_DOWNLOAD, qr as ICON_EDIT, si as ICON_EYE, oi as ICON_FIT, ti as ICON_FOLDER_OPEN, ni as ICON_IMAGE, ii as ICON_MENU, ri as ICON_NEW, Kr as ICON_PERSON, Xr as ICON_REDO, ei as ICON_SHARE, Yr as ICON_UNDO, E as MIRAGON, br as Modeler, k as NOTE_STYLE, W as NavigatedViewer, G as POPUP_PROVIDER_ID, K as READ_ONLY_CHANGED_EVENT, y as ROOT_ID, S as STICKY_KINDS, O as STICKY_STYLES, Ar as STORM_EXPORT_LABEL, it as VIEW_OPTIONS_CHANGED_EVENT, zt as Viewer, rt as boardBoundsModule, Pr as boardMenu, Vr as boardShortcuts, Ir as commandKeyLabel, Sr as createCollaborativeModeler, Cr as createCollaborativeViewer, Gr as createShortcutsDialog, ln as elementSnappingModule, or as eventStormingAppendModule, Vt as eventStormingAttachModule, lr as eventStormingColorPickerModule, Tn as eventStormingContextPadModule, jt as eventStormingDrawModule, nr as eventStormingKeyboardModule, et as eventStormingModelModule, tn as eventStormingModelingModule, mn as eventStormingPaletteModule, vn as eventStormingPopupModule, Sn as eventStormingReadOnlyModule, yr as eventStormingResizeModule, sn as eventStormingRulesModule, V as eventStormingViewOptionsModule, ci as iconMarkup, Lt as importWarningText, Rt as ioModule, we as isAttachableKind, Ee as isAttachableSticky, x as isEventStormingConnection, b as isEventStormingShape, Te as isHostKind, De as isHostSticky, w as isSticky, C as isStickyKind, Yn as labelEditingModule, D as parseNoteMarkdown, je as plainNoteText, Se as saveSVG, Ae as serializeNoteMarkdown };
|
|
3115
3168
|
|
|
3116
3169
|
//# sourceMappingURL=index.js.map
|