@miragon/team-topologies-renderer 0.3.1 → 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 +1 -1
- package/dist/index.js +835 -846
- package/dist/index.js.map +1 -1
- package/dist/team-topologies.css +2 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,852 +1,841 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
class
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
1
|
+
import e from "diagram-js/lib/Diagram";
|
|
2
|
+
import { ALL_INTERACTION_SPECS as t, ALL_TEAM_SPECS as n, DOCUMENT_VERSION as r, FLOW_SPEC as i, INTERACTION_MODE_SPECS as a, TEAM_TYPE_SPECS as o, dashArray as s, newId as c } from "@miragon/team-topologies-schema-model";
|
|
3
|
+
import l from "diagram-js/lib/draw/BaseRenderer";
|
|
4
|
+
import { append as u, attr as d, create as f } from "tiny-svg";
|
|
5
|
+
import p from "diagram-js/lib/features/selection";
|
|
6
|
+
import m from "diagram-js/lib/navigation/zoomscroll";
|
|
7
|
+
import h from "diagram-js/lib/navigation/movecanvas";
|
|
8
|
+
import g from "diagram-js/lib/features/modeling";
|
|
9
|
+
import ee from "diagram-js/lib/features/move";
|
|
10
|
+
import te from "diagram-js/lib/features/outline";
|
|
11
|
+
import ne from "diagram-js/lib/features/resize";
|
|
12
|
+
import re from "diagram-js/lib/features/rules";
|
|
13
|
+
import ie from "diagram-js/lib/features/rules/RuleProvider";
|
|
14
|
+
import ae from "diagram-js/lib/command/CommandInterceptor";
|
|
15
|
+
import oe from "diagram-js/lib/features/palette";
|
|
16
|
+
import se from "diagram-js/lib/features/create";
|
|
17
|
+
import ce from "diagram-js/lib/features/context-pad";
|
|
18
|
+
//#region src/model/di-types.ts
|
|
19
|
+
function _(e) {
|
|
20
|
+
return typeof e == "object" && e ? e.ttKind : void 0;
|
|
21
|
+
}
|
|
22
|
+
function v(e) {
|
|
23
|
+
return typeof _(e) == "string";
|
|
24
|
+
}
|
|
25
|
+
function y(e) {
|
|
26
|
+
return _(e) === "team";
|
|
27
|
+
}
|
|
28
|
+
function b(e) {
|
|
29
|
+
return _(e) === "interaction";
|
|
30
|
+
}
|
|
31
|
+
function x(e) {
|
|
32
|
+
return _(e) === "flow";
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/io/saveSvg.ts
|
|
36
|
+
var S = 40;
|
|
37
|
+
function C(e, t) {
|
|
38
|
+
let n = e.getContainer().querySelector("svg");
|
|
39
|
+
if (!n) throw Error("No SVG found in the canvas container.");
|
|
40
|
+
let r = Infinity, i = Infinity, a = -Infinity, o = -Infinity;
|
|
41
|
+
for (let e of t.getAll()) {
|
|
42
|
+
if (!v(e)) continue;
|
|
43
|
+
let t = e;
|
|
44
|
+
r = Math.min(r, t.x), i = Math.min(i, t.y), a = Math.max(a, t.x + t.width), o = Math.max(o, t.y + t.height);
|
|
45
|
+
}
|
|
46
|
+
Number.isFinite(r) || (r = 0, i = 0, a = 100, o = 100);
|
|
47
|
+
let s = r - S, c = i - S, l = a - r + S * 2, u = o - i + S * 2, d = n.cloneNode(!0);
|
|
48
|
+
d.setAttribute("xmlns", "http://www.w3.org/2000/svg"), d.setAttribute("viewBox", `${s} ${c} ${l} ${u}`), d.setAttribute("width", String(Math.round(l))), d.setAttribute("height", String(Math.round(u)));
|
|
49
|
+
let f = d.querySelector(".viewport");
|
|
50
|
+
return f && f.removeAttribute("transform"), { svg: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + new XMLSerializer().serializeToString(d) };
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/io/types.ts
|
|
54
|
+
var w = "tt-root";
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/TtBaseViewer.ts
|
|
57
|
+
function T(e) {
|
|
58
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
59
|
+
}
|
|
60
|
+
var E = class {
|
|
61
|
+
_diagram;
|
|
62
|
+
_container;
|
|
63
|
+
_options;
|
|
64
|
+
constructor(e = {}) {
|
|
65
|
+
this._options = e, this._container = this._createContainer(e);
|
|
66
|
+
}
|
|
67
|
+
_createContainer(e) {
|
|
68
|
+
let t = e.container ?? document.createElement("div");
|
|
69
|
+
return t.classList.add("tt-djs-container"), t.style.width = T(e.width ?? "100%"), t.style.height = T(e.height ?? (e.container ? "100%" : "600px")), t;
|
|
70
|
+
}
|
|
71
|
+
_ensureDiagram() {
|
|
72
|
+
if (!this._diagram) {
|
|
73
|
+
let t = [...this._getModules(), ...this._options.additionalModules ?? []];
|
|
74
|
+
this._diagram = new e({
|
|
75
|
+
canvas: { container: this._container },
|
|
76
|
+
modules: t
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return this._diagram;
|
|
80
|
+
}
|
|
81
|
+
get(e) {
|
|
82
|
+
return this._ensureDiagram().get(e);
|
|
83
|
+
}
|
|
84
|
+
on(e, t, n = 1e3) {
|
|
85
|
+
this.get("eventBus").on(e, n, t);
|
|
86
|
+
}
|
|
87
|
+
off(e, t) {
|
|
88
|
+
this.get("eventBus").off(e, t);
|
|
89
|
+
}
|
|
90
|
+
importDocument(e) {
|
|
91
|
+
let t = this._ensureDiagram(), n = t.get("eventBus"), r = t.get("ttImporter");
|
|
92
|
+
r.clear();
|
|
93
|
+
let i = r.import(e);
|
|
94
|
+
return this._fit(), n.fire("import.done", { warnings: i }), { warnings: i };
|
|
95
|
+
}
|
|
96
|
+
exportDocument() {
|
|
97
|
+
return this.get("ttExporter").export();
|
|
98
|
+
}
|
|
99
|
+
setMeta(e) {
|
|
100
|
+
let t = this.get("canvas"), n;
|
|
101
|
+
try {
|
|
102
|
+
n = t.getRootElement();
|
|
103
|
+
} catch {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (!n || n.id !== "tt-root") return;
|
|
107
|
+
let r = n.businessObject ?? { title: "Untitled team topology" };
|
|
108
|
+
n.businessObject = {
|
|
109
|
+
...r,
|
|
110
|
+
...e
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
getMeta() {
|
|
114
|
+
try {
|
|
115
|
+
return this.get("canvas").getRootElement().businessObject;
|
|
116
|
+
} catch {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
saveSVG() {
|
|
121
|
+
return C(this.get("canvas"), this.get("elementRegistry"));
|
|
122
|
+
}
|
|
123
|
+
_fit(e = 84, t = 56) {
|
|
124
|
+
let n = this.get("canvas"), r = this.get("elementRegistry"), i = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
|
|
125
|
+
for (let e of r.getAll()) {
|
|
126
|
+
let t = e;
|
|
127
|
+
typeof t.x != "number" || typeof t.y != "number" || typeof t.width != "number" || typeof t.height != "number" || (i = Math.min(i, t.x), a = Math.min(a, t.y), o = Math.max(o, t.x + t.width), s = Math.max(s, t.y + t.height));
|
|
128
|
+
}
|
|
129
|
+
if (!Number.isFinite(i)) return;
|
|
130
|
+
let c = this._container.getBoundingClientRect(), l = c.width, u = c.height, d = Math.max(o - i, 1), f = Math.max(s - a, 1);
|
|
131
|
+
if (!l || !u) {
|
|
132
|
+
n.zoom("fit-viewport");
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
let p = Math.min((l - 2 * t) / d, (u - e - t) / f, 1.25);
|
|
136
|
+
n.viewbox({
|
|
137
|
+
x: i + d / 2 - l / 2 / p,
|
|
138
|
+
y: a - e / p,
|
|
139
|
+
width: l / p,
|
|
140
|
+
height: u / p
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
attachTo(e) {
|
|
144
|
+
e.appendChild(this._container), this.get("canvas").resized();
|
|
145
|
+
}
|
|
146
|
+
detach() {
|
|
147
|
+
this._container.remove();
|
|
148
|
+
}
|
|
149
|
+
clear() {
|
|
150
|
+
this._ensureDiagram().clear();
|
|
151
|
+
}
|
|
152
|
+
destroy() {
|
|
153
|
+
this._diagram &&= (this._diagram.destroy(), void 0), this._container.remove();
|
|
154
|
+
}
|
|
155
|
+
get container() {
|
|
156
|
+
return this._container;
|
|
157
|
+
}
|
|
158
|
+
}, D = class {
|
|
159
|
+
elementFactory;
|
|
160
|
+
static $inject = ["elementFactory"];
|
|
161
|
+
constructor(e) {
|
|
162
|
+
this.elementFactory = e;
|
|
163
|
+
}
|
|
164
|
+
createTeam(e) {
|
|
165
|
+
return this.elementFactory.createShape({
|
|
166
|
+
id: e.id,
|
|
167
|
+
x: e.position.x,
|
|
168
|
+
y: e.position.y,
|
|
169
|
+
width: e.size.width,
|
|
170
|
+
height: e.size.height,
|
|
171
|
+
ttKind: "team",
|
|
172
|
+
teamType: e.type,
|
|
173
|
+
ttLabel: e.label,
|
|
174
|
+
...e.description ? { description: e.description } : {},
|
|
175
|
+
...e.fill ? { fill: e.fill } : {},
|
|
176
|
+
...e.stroke ? { stroke: e.stroke } : {}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
createInteraction(e) {
|
|
180
|
+
return this.elementFactory.createShape({
|
|
181
|
+
id: e.id,
|
|
182
|
+
x: e.position.x,
|
|
183
|
+
y: e.position.y,
|
|
184
|
+
width: e.size.width,
|
|
185
|
+
height: e.size.height,
|
|
186
|
+
ttKind: "interaction",
|
|
187
|
+
mode: e.mode,
|
|
188
|
+
...e.label ? { ttLabel: e.label } : {},
|
|
189
|
+
...e.fill ? { fill: e.fill } : {},
|
|
190
|
+
...e.stroke ? { stroke: e.stroke } : {}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
createFlow(e) {
|
|
194
|
+
return this.elementFactory.createShape({
|
|
195
|
+
id: e.id,
|
|
196
|
+
x: e.position.x,
|
|
197
|
+
y: e.position.y,
|
|
198
|
+
width: e.size.width,
|
|
199
|
+
height: e.size.height,
|
|
200
|
+
ttKind: "flow",
|
|
201
|
+
...e.label ? { ttLabel: e.label } : {}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
createNewTeam(e, t) {
|
|
205
|
+
let n = o[e];
|
|
206
|
+
return this.elementFactory.createShape({
|
|
207
|
+
id: c("team"),
|
|
208
|
+
width: n.defaultSize.width,
|
|
209
|
+
height: n.defaultSize.height,
|
|
210
|
+
ttKind: "team",
|
|
211
|
+
teamType: e,
|
|
212
|
+
ttLabel: t ?? n.label
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
createNewInteraction(e) {
|
|
216
|
+
let t = a[e];
|
|
217
|
+
return this.elementFactory.createShape({
|
|
218
|
+
id: c("int"),
|
|
219
|
+
width: t.defaultSize.width,
|
|
220
|
+
height: t.defaultSize.height,
|
|
221
|
+
ttKind: "interaction",
|
|
222
|
+
mode: e
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
createNewFlow() {
|
|
226
|
+
return this.elementFactory.createShape({
|
|
227
|
+
id: c("flow"),
|
|
228
|
+
width: i.defaultSize.width,
|
|
229
|
+
height: i.defaultSize.height,
|
|
230
|
+
ttKind: "flow",
|
|
231
|
+
ttLabel: i.label
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}, O = { ttElementFactory: ["type", D] }, le = 1500, ue = "#1f2430", de = "#525a6b", k = {
|
|
235
|
+
family: "'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif",
|
|
236
|
+
label: 13.5,
|
|
237
|
+
small: 11
|
|
238
|
+
}, A = class extends l {
|
|
239
|
+
static $inject = ["eventBus"];
|
|
240
|
+
constructor(e) {
|
|
241
|
+
super(e, le);
|
|
242
|
+
}
|
|
243
|
+
canRender(e) {
|
|
244
|
+
return v(e);
|
|
245
|
+
}
|
|
246
|
+
drawShape(e, t) {
|
|
247
|
+
if (y(t)) return this.drawTeam(e, t);
|
|
248
|
+
if (b(t)) return this.drawInteraction(e, t);
|
|
249
|
+
if (x(t)) return this.drawFlow(e, t);
|
|
250
|
+
let n = d(f("rect"), {
|
|
251
|
+
width: t.width,
|
|
252
|
+
height: t.height,
|
|
253
|
+
fill: "#eee"
|
|
254
|
+
});
|
|
255
|
+
return u(e, n), n;
|
|
256
|
+
}
|
|
257
|
+
getShapePath(e) {
|
|
258
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
259
|
+
return `M${t},${n}l${r},0l0,${i}l${-r},0z`;
|
|
260
|
+
}
|
|
261
|
+
drawTeam(e, t) {
|
|
262
|
+
let n = o[t.teamType] ?? o["stream-aligned"], r = Math.max(t.width, 1), i = Math.max(t.height, 1), a = n.strokeWidth, c = s(n.strokeStyle, a), l = this.teamOutline(n.shape, r, i, a, {
|
|
263
|
+
fill: t.fill ?? n.fill,
|
|
264
|
+
stroke: t.stroke ?? n.stroke,
|
|
265
|
+
"stroke-width": a,
|
|
266
|
+
...c ? { "stroke-dasharray": c } : {},
|
|
267
|
+
"stroke-linejoin": "round"
|
|
268
|
+
});
|
|
269
|
+
return u(e, l), this.appendLabel(e, t.ttLabel ?? "", r, i, { "font-weight": "640" }), l;
|
|
270
|
+
}
|
|
271
|
+
teamOutline(e, t, n, r, i) {
|
|
272
|
+
let a = r / 2, o = t - r, s = n - r;
|
|
273
|
+
if (e === "octagon") {
|
|
274
|
+
let e = Math.min(o, s) * .29;
|
|
275
|
+
return d(f("polygon"), {
|
|
276
|
+
points: fe(a, o, s, e),
|
|
277
|
+
...i
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
let c = e === "rect" ? 4 : Math.min(20, s / 2, o / 2);
|
|
281
|
+
return d(f("rect"), {
|
|
282
|
+
x: a,
|
|
283
|
+
y: a,
|
|
284
|
+
width: o,
|
|
285
|
+
height: s,
|
|
286
|
+
rx: c,
|
|
287
|
+
ry: c,
|
|
288
|
+
...i
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
drawInteraction(e, t) {
|
|
292
|
+
let n = a[t.mode] ?? a.collaboration, r = Math.max(t.width, 1), i = Math.max(t.height, 1), o = {
|
|
293
|
+
fill: t.fill ?? n.fill,
|
|
294
|
+
"fill-opacity": n.opacity,
|
|
295
|
+
stroke: t.stroke ?? n.stroke,
|
|
296
|
+
"stroke-width": 2,
|
|
297
|
+
"stroke-dasharray": s(n.strokeStyle, 2) || "6 4",
|
|
298
|
+
"stroke-linejoin": "round"
|
|
299
|
+
}, c;
|
|
300
|
+
if (n.shape === "circle") c = d(f("ellipse"), {
|
|
301
|
+
cx: r / 2,
|
|
302
|
+
cy: i / 2,
|
|
303
|
+
rx: (r - 2) / 2,
|
|
304
|
+
ry: (i - 2) / 2,
|
|
305
|
+
...o
|
|
306
|
+
});
|
|
307
|
+
else if (n.shape === "triangle") {
|
|
308
|
+
let e = `${r / 2},1 ${r - 1},${i - 1} 1,${i - 1}`;
|
|
309
|
+
c = d(f("polygon"), {
|
|
310
|
+
points: e,
|
|
311
|
+
...o
|
|
312
|
+
});
|
|
313
|
+
} else {
|
|
314
|
+
let e = Math.min(r * .26, i * .85), t = `${1 + e},1 ${r - 1},1 ${r - 1 - e},${i - 1} 1,${i - 1}`;
|
|
315
|
+
c = d(f("polygon"), {
|
|
316
|
+
points: t,
|
|
317
|
+
...o
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
return u(e, c), t.ttLabel && this.appendLabel(e, t.ttLabel, r, i, {
|
|
321
|
+
"font-size": k.small,
|
|
322
|
+
"font-weight": "600"
|
|
323
|
+
}), c;
|
|
324
|
+
}
|
|
325
|
+
drawFlow(e, t) {
|
|
326
|
+
let n = Math.max(t.width, 1), r = Math.max(t.height, 1), a = i.strokeWidth, o = a / 2, c = Math.min(n * .16, r * 1.1), l = r * .5, p = (r - l) / 2, m = p + l, h = [
|
|
327
|
+
[o, p],
|
|
328
|
+
[n - c, p],
|
|
329
|
+
[n - c, o],
|
|
330
|
+
[n - o, r / 2],
|
|
331
|
+
[n - c, r - o],
|
|
332
|
+
[n - c, m],
|
|
333
|
+
[o, m]
|
|
334
|
+
].map((e) => e.join(",")).join(" "), g = d(f("polygon"), {
|
|
335
|
+
points: h,
|
|
336
|
+
fill: "none",
|
|
337
|
+
stroke: i.stroke,
|
|
338
|
+
"stroke-width": a,
|
|
339
|
+
"stroke-dasharray": s(i.strokeStyle, a) || "6 4",
|
|
340
|
+
"stroke-linejoin": "round"
|
|
341
|
+
});
|
|
342
|
+
return u(e, g), t.ttLabel && this.appendLabel(e, t.ttLabel, n - c, r, {
|
|
343
|
+
"font-size": k.small,
|
|
344
|
+
"font-weight": "650",
|
|
345
|
+
"letter-spacing": "0.06em",
|
|
346
|
+
fill: de
|
|
347
|
+
}), g;
|
|
348
|
+
}
|
|
349
|
+
appendLabel(e, t, n, r, i) {
|
|
350
|
+
let a = typeof i["font-size"] == "number" ? i["font-size"] : k.label, o = pe(t, n - 20, a), s = a * 1.2, c = r / 2 - (o.length - 1) * s / 2;
|
|
351
|
+
o.forEach((t, r) => {
|
|
352
|
+
let o = d(f("text"), {
|
|
353
|
+
x: n / 2,
|
|
354
|
+
y: c + r * s,
|
|
355
|
+
"font-family": k.family,
|
|
356
|
+
"font-size": a,
|
|
357
|
+
fill: ue,
|
|
358
|
+
"text-anchor": "middle",
|
|
359
|
+
"dominant-baseline": "central",
|
|
360
|
+
...i
|
|
361
|
+
});
|
|
362
|
+
o.textContent = t, u(e, o);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
254
365
|
};
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
const pt = {
|
|
396
|
-
__init__: ["ttRenderer"],
|
|
397
|
-
ttRenderer: ["type", ut]
|
|
366
|
+
function fe(e, t, n, r) {
|
|
367
|
+
return [
|
|
368
|
+
[e + r, e],
|
|
369
|
+
[e + t - r, e],
|
|
370
|
+
[e + t, e + r],
|
|
371
|
+
[e + t, e + n - r],
|
|
372
|
+
[e + t - r, e + n],
|
|
373
|
+
[e + r, e + n],
|
|
374
|
+
[e, e + n - r],
|
|
375
|
+
[e, e + r]
|
|
376
|
+
].map((e) => e.join(",")).join(" ");
|
|
377
|
+
}
|
|
378
|
+
function pe(e, t, n) {
|
|
379
|
+
let r = Math.max(4, Math.floor(t / (n * .58))), i = e.split(/\s+/).filter(Boolean);
|
|
380
|
+
if (i.length === 0) return [];
|
|
381
|
+
let a = [], o = "";
|
|
382
|
+
for (let e of i) {
|
|
383
|
+
let t = o ? `${o} ${e}` : e;
|
|
384
|
+
t.length > r && o ? (a.push(o), o = e) : o = t;
|
|
385
|
+
}
|
|
386
|
+
return o && a.push(o), a;
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/draw/index.ts
|
|
390
|
+
var j = {
|
|
391
|
+
__init__: ["ttRenderer"],
|
|
392
|
+
ttRenderer: ["type", A]
|
|
393
|
+
}, M = class {
|
|
394
|
+
canvas;
|
|
395
|
+
elementFactory;
|
|
396
|
+
factory;
|
|
397
|
+
eventBus;
|
|
398
|
+
elementRegistry;
|
|
399
|
+
static $inject = [
|
|
400
|
+
"canvas",
|
|
401
|
+
"elementFactory",
|
|
402
|
+
"ttElementFactory",
|
|
403
|
+
"eventBus",
|
|
404
|
+
"elementRegistry"
|
|
405
|
+
];
|
|
406
|
+
constructor(e, t, n, r, i) {
|
|
407
|
+
this.canvas = e, this.elementFactory = t, this.factory = n, this.eventBus = r, this.elementRegistry = i;
|
|
408
|
+
}
|
|
409
|
+
import(e) {
|
|
410
|
+
let t = [];
|
|
411
|
+
this.eventBus.fire("import.render.start", { document: e });
|
|
412
|
+
let n;
|
|
413
|
+
try {
|
|
414
|
+
n = this.canvas.getRootElement();
|
|
415
|
+
} catch {
|
|
416
|
+
n = void 0;
|
|
417
|
+
}
|
|
418
|
+
let r;
|
|
419
|
+
n && n.id === "tt-root" ? r = n : (r = this.elementFactory.createRoot({ id: w }), this.canvas.setRootElement(r)), r.businessObject = { title: e.title };
|
|
420
|
+
for (let t of e.flows) this.canvas.addShape(this.factory.createFlow(t), r);
|
|
421
|
+
for (let t of e.nodes) this.canvas.addShape(this.factory.createTeam(t), r);
|
|
422
|
+
for (let t of e.interactions) this.canvas.addShape(this.factory.createInteraction(t), r);
|
|
423
|
+
return this.eventBus.fire("import.render.done", { warnings: t }), t;
|
|
424
|
+
}
|
|
425
|
+
clear() {
|
|
426
|
+
for (let e of [...this.elementRegistry.getAll()]) if (e.id !== "tt-root") try {
|
|
427
|
+
this.canvas.removeShape(e.id);
|
|
428
|
+
} catch {}
|
|
429
|
+
}
|
|
430
|
+
}, N = class {
|
|
431
|
+
elementRegistry;
|
|
432
|
+
canvas;
|
|
433
|
+
static $inject = ["elementRegistry", "canvas"];
|
|
434
|
+
constructor(e, t) {
|
|
435
|
+
this.elementRegistry = e, this.canvas = t;
|
|
436
|
+
}
|
|
437
|
+
export() {
|
|
438
|
+
let e;
|
|
439
|
+
try {
|
|
440
|
+
e = this.canvas.getRootElement().businessObject;
|
|
441
|
+
} catch {
|
|
442
|
+
e = void 0;
|
|
443
|
+
}
|
|
444
|
+
let t = [], n = [], i = [];
|
|
445
|
+
for (let e of this.elementRegistry.getAll()) {
|
|
446
|
+
if (e.id === "tt-root") continue;
|
|
447
|
+
let r = e, a = {
|
|
448
|
+
x: r.x,
|
|
449
|
+
y: r.y
|
|
450
|
+
}, o = {
|
|
451
|
+
width: r.width,
|
|
452
|
+
height: r.height
|
|
453
|
+
};
|
|
454
|
+
y(e) ? t.push({
|
|
455
|
+
id: e.id,
|
|
456
|
+
type: e.teamType,
|
|
457
|
+
label: e.ttLabel ?? "",
|
|
458
|
+
position: a,
|
|
459
|
+
size: o,
|
|
460
|
+
...e.description ? { description: e.description } : {},
|
|
461
|
+
...e.fill ? { fill: e.fill } : {},
|
|
462
|
+
...e.stroke ? { stroke: e.stroke } : {}
|
|
463
|
+
}) : b(e) ? n.push({
|
|
464
|
+
id: e.id,
|
|
465
|
+
mode: e.mode,
|
|
466
|
+
position: a,
|
|
467
|
+
size: o,
|
|
468
|
+
...e.ttLabel ? { label: e.ttLabel } : {},
|
|
469
|
+
...e.fill ? { fill: e.fill } : {},
|
|
470
|
+
...e.stroke ? { stroke: e.stroke } : {}
|
|
471
|
+
}) : x(e) && i.push({
|
|
472
|
+
id: e.id,
|
|
473
|
+
position: a,
|
|
474
|
+
size: o,
|
|
475
|
+
...e.ttLabel ? { label: e.ttLabel } : {}
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
return {
|
|
479
|
+
version: r,
|
|
480
|
+
title: e?.title ?? "Untitled team topology",
|
|
481
|
+
nodes: t,
|
|
482
|
+
interactions: n,
|
|
483
|
+
flows: i
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
}, P = {
|
|
487
|
+
ttImporter: ["type", M],
|
|
488
|
+
ttExporter: ["type", N]
|
|
489
|
+
}, F = class extends E {
|
|
490
|
+
_getModules() {
|
|
491
|
+
return [
|
|
492
|
+
O,
|
|
493
|
+
j,
|
|
494
|
+
P
|
|
495
|
+
];
|
|
496
|
+
}
|
|
497
|
+
}, I = class extends F {
|
|
498
|
+
_getModules() {
|
|
499
|
+
return [
|
|
500
|
+
...super._getModules(),
|
|
501
|
+
p,
|
|
502
|
+
m,
|
|
503
|
+
h
|
|
504
|
+
];
|
|
505
|
+
}
|
|
398
506
|
};
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
...n.ttLabel ? { label: n.ttLabel } : {}
|
|
471
|
-
});
|
|
472
|
-
}
|
|
473
|
-
return {
|
|
474
|
-
version: K,
|
|
475
|
-
title: t?.title ?? "Untitled team topology",
|
|
476
|
-
nodes: i,
|
|
477
|
-
interactions: e,
|
|
478
|
-
flows: o
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
const vt = {
|
|
483
|
-
ttImporter: ["type", gt],
|
|
484
|
-
ttExporter: ["type", yt]
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region src/modeling/cmd/UpdatePropertiesHandler.ts
|
|
509
|
+
function L(e, t, n) {
|
|
510
|
+
n === void 0 ? delete e[t] : e[t] = n;
|
|
511
|
+
}
|
|
512
|
+
var me = class {
|
|
513
|
+
execute(e) {
|
|
514
|
+
let { element: t, properties: n } = e, r = t, i = {};
|
|
515
|
+
for (let e of Object.keys(n)) i[e] = r[e], L(r, e, n[e]);
|
|
516
|
+
return e.oldProperties = i, [t];
|
|
517
|
+
}
|
|
518
|
+
revert(e) {
|
|
519
|
+
let { element: t, oldProperties: n } = e, r = t;
|
|
520
|
+
if (n) for (let e of Object.keys(n)) L(r, e, n[e]);
|
|
521
|
+
return [t];
|
|
522
|
+
}
|
|
523
|
+
}, R = "element.updateProperties", he = class {
|
|
524
|
+
commandStack;
|
|
525
|
+
static $inject = ["commandStack"];
|
|
526
|
+
constructor(e) {
|
|
527
|
+
this.commandStack = e, e.registerHandler(R, me);
|
|
528
|
+
}
|
|
529
|
+
updateProperties(e, t) {
|
|
530
|
+
this.commandStack.execute(R, {
|
|
531
|
+
element: e,
|
|
532
|
+
properties: t
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
updateLabel(e, t) {
|
|
536
|
+
this.updateProperties(e, { ttLabel: t || void 0 });
|
|
537
|
+
}
|
|
538
|
+
setTeamType(e, t) {
|
|
539
|
+
this.updateProperties(e, { teamType: t });
|
|
540
|
+
}
|
|
541
|
+
setInteractionMode(e, t) {
|
|
542
|
+
this.updateProperties(e, { mode: t });
|
|
543
|
+
}
|
|
544
|
+
setColors(e, t, n) {
|
|
545
|
+
this.updateProperties(e, {
|
|
546
|
+
fill: t,
|
|
547
|
+
stroke: n
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
setDescription(e, t) {
|
|
551
|
+
this.updateProperties(e, { description: t });
|
|
552
|
+
}
|
|
553
|
+
}, z = {
|
|
554
|
+
__init__: ["ttModeling"],
|
|
555
|
+
ttModeling: ["type", he]
|
|
556
|
+
}, B = class extends ie {
|
|
557
|
+
static $inject = ["eventBus"];
|
|
558
|
+
constructor(e) {
|
|
559
|
+
super(e);
|
|
560
|
+
}
|
|
561
|
+
init() {
|
|
562
|
+
this.addRule(["shape.move", "elements.move"], (e) => e.target && e.target.parent ? null : !0), this.addRule("shape.create", () => !0), this.addRule("shape.resize", () => !0);
|
|
563
|
+
}
|
|
564
|
+
}, V = {
|
|
565
|
+
__depends__: [re],
|
|
566
|
+
__init__: ["ttRules"],
|
|
567
|
+
ttRules: ["type", B]
|
|
568
|
+
}, H = class extends ae {
|
|
569
|
+
static $inject = ["eventBus", "canvas"];
|
|
570
|
+
constructor(e, t) {
|
|
571
|
+
super(e), this.preExecute(["shape.create", "elements.create"], (e) => {
|
|
572
|
+
e.parent = t.getRootElement();
|
|
573
|
+
}, !0);
|
|
574
|
+
}
|
|
575
|
+
}, U = {
|
|
576
|
+
__init__: ["ttFlatModelBehavior"],
|
|
577
|
+
ttFlatModelBehavior: ["type", H]
|
|
485
578
|
};
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/draw/palette-icons.ts
|
|
581
|
+
function W(e) {
|
|
582
|
+
return `<svg class="tt-palette-svg" width="24" height="24" viewBox="0 0 26 26" aria-hidden="true">${e}</svg>`;
|
|
583
|
+
}
|
|
584
|
+
function G(e) {
|
|
585
|
+
let t = o[e], n = s(t.strokeStyle, 1.5), r = `fill="${t.fill}" stroke="${t.stroke}" stroke-width="1.5"` + (n ? ` stroke-dasharray="${n}"` : "");
|
|
586
|
+
switch (t.shape) {
|
|
587
|
+
case "octagon": return W(`<polygon points="8,3 18,3 23,8 23,18 18,23 8,23 3,18 3,8" ${r}/>`);
|
|
588
|
+
case "rounded-rect-vertical": return W(`<rect x="8" y="3" width="10" height="20" rx="4" ${r}/>`);
|
|
589
|
+
case "rect": return W(`<rect x="3" y="7" width="20" height="12" rx="1.5" ${r}/>`);
|
|
590
|
+
default: return W(`<rect x="3" y="8" width="20" height="10" rx="5" ${r}/>`);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function K() {
|
|
594
|
+
return W("<g fill=\"none\" stroke=\"#6b6459\" stroke-width=\"1.5\" stroke-linejoin=\"round\" stroke-dasharray=\"3 2\"><polygon points=\"3,9 16,9 16,5 23,13 16,21 16,17 3,17\"/></g>");
|
|
595
|
+
}
|
|
596
|
+
function q(e) {
|
|
597
|
+
let t = a[e], n = s(t.strokeStyle, 1.5), r = `fill="${t.fill}" fill-opacity="${t.opacity}" stroke="${t.stroke}" stroke-width="1.5"` + (n ? ` stroke-dasharray="${n}"` : "");
|
|
598
|
+
switch (t.shape) {
|
|
599
|
+
case "circle": return W(`<circle cx="13" cy="13" r="9" ${r}/>`);
|
|
600
|
+
case "triangle": return W(`<polygon points="5,6 22,13 5,20" ${r}/>`);
|
|
601
|
+
default: return W(`<polygon points="9,6 23,6 17,20 3,20" ${r}/>`);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region src/palette/TtPaletteProvider.ts
|
|
606
|
+
var ge = "tt-1-teams", _e = "tt-2-modes", ve = "tt-3-flow";
|
|
607
|
+
function J(e, t) {
|
|
608
|
+
return `<div class="entry tt-palette-entry" draggable="true" title="${t}">${e}</div>`;
|
|
609
|
+
}
|
|
610
|
+
var Y = class {
|
|
611
|
+
create;
|
|
612
|
+
factory;
|
|
613
|
+
static $inject = [
|
|
614
|
+
"palette",
|
|
615
|
+
"create",
|
|
616
|
+
"ttElementFactory"
|
|
617
|
+
];
|
|
618
|
+
constructor(e, t, n) {
|
|
619
|
+
this.create = t, this.factory = n, e.registerProvider(this);
|
|
620
|
+
}
|
|
621
|
+
getPaletteEntries() {
|
|
622
|
+
let e = {};
|
|
623
|
+
for (let t of n) {
|
|
624
|
+
let n = (e) => this.create.start(e, this.factory.createNewTeam(t.type, t.label));
|
|
625
|
+
e[`team.${t.type}`] = {
|
|
626
|
+
group: ge,
|
|
627
|
+
title: `${t.label} team — ${t.description}`,
|
|
628
|
+
html: J(G(t.type), `${t.label} team — ${t.description}`),
|
|
629
|
+
action: {
|
|
630
|
+
dragstart: n,
|
|
631
|
+
click: n
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
for (let n of t) {
|
|
636
|
+
let t = (e) => this.create.start(e, this.factory.createNewInteraction(n.mode));
|
|
637
|
+
e[`mode.${n.mode}`] = {
|
|
638
|
+
group: _e,
|
|
639
|
+
title: `${n.label} — ${n.description} (place over the teams it relates to)`,
|
|
640
|
+
html: J(q(n.mode), `${n.label} — ${n.description}`),
|
|
641
|
+
action: {
|
|
642
|
+
dragstart: t,
|
|
643
|
+
click: t
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
let r = (e) => this.create.start(e, this.factory.createNewFlow());
|
|
648
|
+
return e.flow = {
|
|
649
|
+
group: ve,
|
|
650
|
+
title: `${i.label} — the implied left-to-right flow`,
|
|
651
|
+
html: J(K(), i.label),
|
|
652
|
+
action: {
|
|
653
|
+
dragstart: r,
|
|
654
|
+
click: r
|
|
655
|
+
}
|
|
656
|
+
}, e;
|
|
657
|
+
}
|
|
658
|
+
}, X = {
|
|
659
|
+
__depends__: [oe, se],
|
|
660
|
+
__init__: ["ttPaletteProvider"],
|
|
661
|
+
ttPaletteProvider: ["type", Y]
|
|
662
|
+
}, ye = "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.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z", be = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z";
|
|
663
|
+
function xe(e, t = 18) {
|
|
664
|
+
return `<svg width="${t}" height="${t}" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
|
|
665
|
+
}
|
|
666
|
+
//#endregion
|
|
667
|
+
//#region src/context-pad/TtContextPadProvider.ts
|
|
668
|
+
function Z(e, t) {
|
|
669
|
+
return `<div class="entry tt-cp-entry" title="${t}">${xe(e)}</div>`;
|
|
670
|
+
}
|
|
671
|
+
var Q = class {
|
|
672
|
+
modeling;
|
|
673
|
+
labelEditing;
|
|
674
|
+
static $inject = [
|
|
675
|
+
"contextPad",
|
|
676
|
+
"modeling",
|
|
677
|
+
"ttLabelEditing"
|
|
678
|
+
];
|
|
679
|
+
constructor(e, t, n) {
|
|
680
|
+
this.modeling = t, this.labelEditing = n, e.registerProvider(this);
|
|
681
|
+
}
|
|
682
|
+
getContextPadEntries(e) {
|
|
683
|
+
return v(e) ? {
|
|
684
|
+
"edit-label": {
|
|
685
|
+
group: "edit",
|
|
686
|
+
title: "Rename",
|
|
687
|
+
html: Z(ye, "Rename"),
|
|
688
|
+
action: { click: () => this.labelEditing.activate(e) }
|
|
689
|
+
},
|
|
690
|
+
delete: {
|
|
691
|
+
group: "edit",
|
|
692
|
+
title: "Delete",
|
|
693
|
+
html: Z(be, "Delete"),
|
|
694
|
+
action: { click: () => this.modeling.removeElements([e]) }
|
|
695
|
+
}
|
|
696
|
+
} : {};
|
|
697
|
+
}
|
|
698
|
+
}, Se = {
|
|
699
|
+
__depends__: [ce],
|
|
700
|
+
__init__: ["ttContextPadProvider"],
|
|
701
|
+
ttContextPadProvider: ["type", Q]
|
|
702
|
+
}, Ce = class {
|
|
703
|
+
canvas;
|
|
704
|
+
modeling;
|
|
705
|
+
static $inject = [
|
|
706
|
+
"eventBus",
|
|
707
|
+
"canvas",
|
|
708
|
+
"ttModeling"
|
|
709
|
+
];
|
|
710
|
+
active = null;
|
|
711
|
+
constructor(e, t, n) {
|
|
712
|
+
this.canvas = t, this.modeling = n, e.on("element.dblclick", (e) => {
|
|
713
|
+
v(e.element) && this.activate(e.element);
|
|
714
|
+
}), e.on([
|
|
715
|
+
"element.mousedown",
|
|
716
|
+
"drag.init",
|
|
717
|
+
"canvas.viewbox.changing"
|
|
718
|
+
], () => this.active?.commit());
|
|
719
|
+
}
|
|
720
|
+
activate(e) {
|
|
721
|
+
this.active?.commit();
|
|
722
|
+
let t = this.canvas.getContainer(), n = this.canvas.zoom(), r = this.canvas.viewbox(), i = e.x + e.width / 2, a = e.y + e.height / 2, o = (i - r.x) * n - 170 / 2, s = (a - r.y) * n - 14, c = document.createElement("input");
|
|
723
|
+
c.type = "text", c.className = "tt-label-input", c.value = e.ttLabel ?? "", c.style.position = "absolute", c.style.left = `${o}px`, c.style.top = `${s}px`, c.style.width = "170px", t.appendChild(c), c.focus(), c.select();
|
|
724
|
+
let l = !1, u = () => {
|
|
725
|
+
l || (l = !0, c.removeEventListener("keydown", f), c.removeEventListener("blur", p), c.remove(), this.active = null);
|
|
726
|
+
}, d = () => {
|
|
727
|
+
if (l) return;
|
|
728
|
+
let t = c.value.trim(), n = t !== (e.ttLabel ?? "");
|
|
729
|
+
u(), n && this.modeling.updateLabel(e, t);
|
|
730
|
+
}, f = (e) => {
|
|
731
|
+
e.key === "Enter" ? (e.preventDefault(), d()) : e.key === "Escape" && (e.preventDefault(), u());
|
|
732
|
+
}, p = () => d();
|
|
733
|
+
c.addEventListener("keydown", f), c.addEventListener("blur", p), this.active = {
|
|
734
|
+
commit: d,
|
|
735
|
+
cleanup: u
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
cancel() {
|
|
739
|
+
this.active?.cleanup();
|
|
740
|
+
}
|
|
741
|
+
}, we = {
|
|
742
|
+
__init__: ["ttLabelEditing"],
|
|
743
|
+
ttLabelEditing: ["type", Ce]
|
|
543
744
|
};
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region src/keyboard/TtKeyboard.ts
|
|
747
|
+
function Te(e) {
|
|
748
|
+
let t = e;
|
|
749
|
+
return t ? t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable : !1;
|
|
750
|
+
}
|
|
751
|
+
var Ee = class {
|
|
752
|
+
static $inject = [
|
|
753
|
+
"canvas",
|
|
754
|
+
"commandStack",
|
|
755
|
+
"selection",
|
|
756
|
+
"modeling"
|
|
757
|
+
];
|
|
758
|
+
constructor(e, t, n, r) {
|
|
759
|
+
(e.getContainer().ownerDocument ?? document).addEventListener("keydown", (e) => {
|
|
760
|
+
if (Te(e.target)) return;
|
|
761
|
+
let i = e.ctrlKey || e.metaKey, a = e.key.toLowerCase();
|
|
762
|
+
if (i && a === "z" && !e.shiftKey) e.preventDefault(), t.canUndo() && t.undo();
|
|
763
|
+
else if (i && a === "z" && e.shiftKey || i && a === "y") e.preventDefault(), t.canRedo() && t.redo();
|
|
764
|
+
else if (a === "delete" || a === "backspace") {
|
|
765
|
+
let t = n.get();
|
|
766
|
+
t.length && (e.preventDefault(), r.removeElements([...t]));
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
}, De = {
|
|
771
|
+
__init__: ["ttKeyboard"],
|
|
772
|
+
ttKeyboard: ["type", Ee]
|
|
560
773
|
};
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
);
|
|
625
|
-
t[`team.${e.type}`] = {
|
|
626
|
-
group: Pt,
|
|
627
|
-
title: `${e.label} team — ${e.description}`,
|
|
628
|
-
html: P(St(e.type), `${e.label} team — ${e.description}`),
|
|
629
|
-
action: { dragstart: o, click: o }
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
for (const e of V) {
|
|
633
|
-
const o = (n) => this.create.start(
|
|
634
|
-
n,
|
|
635
|
-
this.factory.createNewInteraction(e.mode)
|
|
636
|
-
);
|
|
637
|
-
t[`mode.${e.mode}`] = {
|
|
638
|
-
group: It,
|
|
639
|
-
title: `${e.label} — ${e.description} (place over the teams it relates to)`,
|
|
640
|
-
html: P(Lt(e.mode), `${e.label} — ${e.description}`),
|
|
641
|
-
action: { dragstart: o, click: o }
|
|
642
|
-
};
|
|
643
|
-
}
|
|
644
|
-
const i = (e) => this.create.start(e, this.factory.createNewFlow());
|
|
645
|
-
return t.flow = {
|
|
646
|
-
group: Ct,
|
|
647
|
-
title: `${w.label} — the implied left-to-right flow`,
|
|
648
|
-
html: P(Rt(), w.label),
|
|
649
|
-
action: { dragstart: i, click: i }
|
|
650
|
-
}, t;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
const zt = {
|
|
654
|
-
__depends__: [it, nt],
|
|
655
|
-
__init__: ["ttPaletteProvider"],
|
|
656
|
-
ttPaletteProvider: ["type", Ot]
|
|
657
|
-
}, Ft = "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.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z", Nt = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z";
|
|
658
|
-
function jt(r, t = 18) {
|
|
659
|
-
return `<svg width="${t}" height="${t}" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="${r}"/></svg>`;
|
|
660
|
-
}
|
|
661
|
-
function j(r, t) {
|
|
662
|
-
return `<div class="entry tt-cp-entry" title="${t}">${jt(r)}</div>`;
|
|
663
|
-
}
|
|
664
|
-
class Dt {
|
|
665
|
-
constructor(t, i, e) {
|
|
666
|
-
this.modeling = i, this.labelEditing = e, t.registerProvider(this);
|
|
667
|
-
}
|
|
668
|
-
static $inject = ["contextPad", "modeling", "ttLabelEditing"];
|
|
669
|
-
getContextPadEntries(t) {
|
|
670
|
-
return $(t) ? {
|
|
671
|
-
"edit-label": {
|
|
672
|
-
group: "edit",
|
|
673
|
-
title: "Rename",
|
|
674
|
-
html: j(Ft, "Rename"),
|
|
675
|
-
action: { click: () => this.labelEditing.activate(t) }
|
|
676
|
-
},
|
|
677
|
-
delete: {
|
|
678
|
-
group: "edit",
|
|
679
|
-
title: "Delete",
|
|
680
|
-
html: j(Nt, "Delete"),
|
|
681
|
-
action: { click: () => this.modeling.removeElements([t]) }
|
|
682
|
-
}
|
|
683
|
-
} : {};
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
const At = {
|
|
687
|
-
__depends__: [ot],
|
|
688
|
-
__init__: ["ttContextPadProvider"],
|
|
689
|
-
ttContextPadProvider: ["type", Dt]
|
|
690
|
-
};
|
|
691
|
-
class Bt {
|
|
692
|
-
constructor(t, i, e) {
|
|
693
|
-
this.canvas = i, this.modeling = e, t.on("element.dblclick", (o) => {
|
|
694
|
-
$(o.element) && this.activate(o.element);
|
|
695
|
-
}), t.on(
|
|
696
|
-
["element.mousedown", "drag.init", "canvas.viewbox.changing"],
|
|
697
|
-
() => this.active?.commit()
|
|
698
|
-
);
|
|
699
|
-
}
|
|
700
|
-
static $inject = ["eventBus", "canvas", "ttModeling"];
|
|
701
|
-
active = null;
|
|
702
|
-
activate(t) {
|
|
703
|
-
this.active?.commit();
|
|
704
|
-
const i = this.canvas.getContainer(), e = this.canvas.zoom(), o = this.canvas.viewbox(), n = t.x + t.width / 2, s = t.y + t.height / 2, a = 170, c = (n - o.x) * e - a / 2, h = (s - o.y) * e - 14, l = document.createElement("input");
|
|
705
|
-
l.type = "text", l.className = "tt-label-input", l.value = t.ttLabel ?? "", l.style.position = "absolute", l.style.left = `${c}px`, l.style.top = `${h}px`, l.style.width = `${a}px`, i.appendChild(l), l.focus(), l.select();
|
|
706
|
-
let m = !1;
|
|
707
|
-
const u = () => {
|
|
708
|
-
m || (m = !0, l.removeEventListener("keydown", p), l.removeEventListener("blur", b), l.remove(), this.active = null);
|
|
709
|
-
}, f = () => {
|
|
710
|
-
if (m) return;
|
|
711
|
-
const d = l.value.trim(), A = d !== (t.ttLabel ?? "");
|
|
712
|
-
u(), A && this.modeling.updateLabel(t, d);
|
|
713
|
-
}, p = (d) => {
|
|
714
|
-
d.key === "Enter" ? (d.preventDefault(), f()) : d.key === "Escape" && (d.preventDefault(), u());
|
|
715
|
-
}, b = () => f();
|
|
716
|
-
l.addEventListener("keydown", p), l.addEventListener("blur", b), this.active = { commit: f, cleanup: u };
|
|
717
|
-
}
|
|
718
|
-
cancel() {
|
|
719
|
-
this.active?.cleanup();
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
const Kt = {
|
|
723
|
-
__init__: ["ttLabelEditing"],
|
|
724
|
-
ttLabelEditing: ["type", Bt]
|
|
725
|
-
};
|
|
726
|
-
function Ut(r) {
|
|
727
|
-
const t = r;
|
|
728
|
-
return t ? t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" || t.isContentEditable : !1;
|
|
729
|
-
}
|
|
730
|
-
class Vt {
|
|
731
|
-
static $inject = ["canvas", "commandStack", "selection", "modeling"];
|
|
732
|
-
constructor(t, i, e, o) {
|
|
733
|
-
(t.getContainer().ownerDocument ?? document).addEventListener("keydown", (s) => {
|
|
734
|
-
if (Ut(s.target)) return;
|
|
735
|
-
const a = s.ctrlKey || s.metaKey, c = s.key.toLowerCase();
|
|
736
|
-
if (a && c === "z" && !s.shiftKey)
|
|
737
|
-
s.preventDefault(), i.canUndo() && i.undo();
|
|
738
|
-
else if (a && c === "z" && s.shiftKey || a && c === "y")
|
|
739
|
-
s.preventDefault(), i.canRedo() && i.redo();
|
|
740
|
-
else if (c === "delete" || c === "backspace") {
|
|
741
|
-
const h = e.get();
|
|
742
|
-
h.length && (s.preventDefault(), o.removeElements([...h]));
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
const Gt = {
|
|
748
|
-
__init__: ["ttKeyboard"],
|
|
749
|
-
ttKeyboard: ["type", Vt]
|
|
750
|
-
};
|
|
751
|
-
function D(r) {
|
|
752
|
-
return O(r) ? 0 : I(r) ? r.teamType === "enabling" ? 3 : r.teamType === "complicated-subsystem" ? 2 : 1 : C(r) ? 4 : 1;
|
|
753
|
-
}
|
|
754
|
-
class Ht {
|
|
755
|
-
constructor(t, i, e) {
|
|
756
|
-
this.canvas = i, this.elementRegistry = e, t.on("import.render.start", () => {
|
|
757
|
-
this.importing = !0;
|
|
758
|
-
}), t.on("import.render.done", () => {
|
|
759
|
-
this.importing = !1, this.reorder();
|
|
760
|
-
}), t.on("commandStack.changed", () => {
|
|
761
|
-
this.importing || this.reorder();
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
static $inject = ["eventBus", "canvas", "elementRegistry"];
|
|
765
|
-
importing = !1;
|
|
766
|
-
/** Re-append each element's graphics group in ascending tier order (back → front). */
|
|
767
|
-
reorder() {
|
|
768
|
-
const t = this.elementRegistry.getAll().filter($).sort(
|
|
769
|
-
(i, e) => D(i) - D(e)
|
|
770
|
-
);
|
|
771
|
-
for (const i of t) {
|
|
772
|
-
const o = this.canvas.getGraphics(i)?.parentNode, n = o?.parentNode;
|
|
773
|
-
o && n && n.appendChild(o);
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
const Yt = {
|
|
778
|
-
__init__: ["ttZOrder"],
|
|
779
|
-
ttZOrder: ["type", Ht]
|
|
780
|
-
};
|
|
781
|
-
class he extends bt {
|
|
782
|
-
_getModules() {
|
|
783
|
-
return [
|
|
784
|
-
...super._getModules(),
|
|
785
|
-
// diagram-js stock
|
|
786
|
-
W,
|
|
787
|
-
Z,
|
|
788
|
-
q,
|
|
789
|
-
J,
|
|
790
|
-
// Team Topologies editor
|
|
791
|
-
Mt,
|
|
792
|
-
kt,
|
|
793
|
-
Tt,
|
|
794
|
-
zt,
|
|
795
|
-
At,
|
|
796
|
-
Kt,
|
|
797
|
-
Gt,
|
|
798
|
-
Yt
|
|
799
|
-
];
|
|
800
|
-
}
|
|
801
|
-
undo() {
|
|
802
|
-
this.get("commandStack").undo();
|
|
803
|
-
}
|
|
804
|
-
redo() {
|
|
805
|
-
this.get("commandStack").redo();
|
|
806
|
-
}
|
|
807
|
-
canUndo() {
|
|
808
|
-
return this.get("commandStack").canUndo();
|
|
809
|
-
}
|
|
810
|
-
canRedo() {
|
|
811
|
-
return this.get("commandStack").canRedo();
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
export {
|
|
815
|
-
he as Modeler,
|
|
816
|
-
bt as NavigatedViewer,
|
|
817
|
-
M as ROOT_ID,
|
|
818
|
-
ut as TeamTopologiesRenderer,
|
|
819
|
-
st as TtBaseViewer,
|
|
820
|
-
Dt as TtContextPadProvider,
|
|
821
|
-
at as TtElementFactory,
|
|
822
|
-
yt as TtExporter,
|
|
823
|
-
Et as TtFlatModelBehavior,
|
|
824
|
-
gt as TtImporter,
|
|
825
|
-
Vt as TtKeyboard,
|
|
826
|
-
Bt as TtLabelEditing,
|
|
827
|
-
xt as TtModeling,
|
|
828
|
-
Ot as TtPaletteProvider,
|
|
829
|
-
$t as TtRules,
|
|
830
|
-
Ht as TtZOrder,
|
|
831
|
-
wt as Viewer,
|
|
832
|
-
Rt as flowIconSvg,
|
|
833
|
-
Lt as interactionIconSvg,
|
|
834
|
-
vt as ioModule,
|
|
835
|
-
$ as isTtElement,
|
|
836
|
-
O as isTtFlow,
|
|
837
|
-
C as isTtInteraction,
|
|
838
|
-
I as isTtTeam,
|
|
839
|
-
rt as saveSVG,
|
|
840
|
-
St as teamIconSvg,
|
|
841
|
-
Tt as ttBehaviorsModule,
|
|
842
|
-
At as ttContextPadModule,
|
|
843
|
-
pt as ttDrawModule,
|
|
844
|
-
Gt as ttKeyboardModule,
|
|
845
|
-
Kt as ttLabelEditingModule,
|
|
846
|
-
ct as ttModelModule,
|
|
847
|
-
Mt as ttModelingModule,
|
|
848
|
-
zt as ttPaletteModule,
|
|
849
|
-
kt as ttRulesModule,
|
|
850
|
-
Yt as ttZOrderModule
|
|
774
|
+
//#endregion
|
|
775
|
+
//#region src/zorder/TtZOrder.ts
|
|
776
|
+
function Oe(e) {
|
|
777
|
+
return x(e) ? 0 : y(e) ? e.teamType === "enabling" ? 3 : e.teamType === "complicated-subsystem" ? 2 : 1 : b(e) ? 4 : 1;
|
|
778
|
+
}
|
|
779
|
+
var ke = class {
|
|
780
|
+
canvas;
|
|
781
|
+
elementRegistry;
|
|
782
|
+
static $inject = [
|
|
783
|
+
"eventBus",
|
|
784
|
+
"canvas",
|
|
785
|
+
"elementRegistry"
|
|
786
|
+
];
|
|
787
|
+
importing = !1;
|
|
788
|
+
constructor(e, t, n) {
|
|
789
|
+
this.canvas = t, this.elementRegistry = n, e.on("import.render.start", () => {
|
|
790
|
+
this.importing = !0;
|
|
791
|
+
}), e.on("import.render.done", () => {
|
|
792
|
+
this.importing = !1, this.reorder();
|
|
793
|
+
}), e.on("commandStack.changed", () => {
|
|
794
|
+
this.importing || this.reorder();
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
reorder() {
|
|
798
|
+
let e = this.elementRegistry.getAll().filter(v).sort((e, t) => Oe(e) - Oe(t));
|
|
799
|
+
for (let t of e) {
|
|
800
|
+
let e = this.canvas.getGraphics(t)?.parentNode, n = e?.parentNode;
|
|
801
|
+
e && n && n.appendChild(e);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}, $ = {
|
|
805
|
+
__init__: ["ttZOrder"],
|
|
806
|
+
ttZOrder: ["type", ke]
|
|
807
|
+
}, Ae = class extends I {
|
|
808
|
+
_getModules() {
|
|
809
|
+
return [
|
|
810
|
+
...super._getModules(),
|
|
811
|
+
g,
|
|
812
|
+
ee,
|
|
813
|
+
te,
|
|
814
|
+
ne,
|
|
815
|
+
z,
|
|
816
|
+
V,
|
|
817
|
+
U,
|
|
818
|
+
X,
|
|
819
|
+
Se,
|
|
820
|
+
we,
|
|
821
|
+
De,
|
|
822
|
+
$
|
|
823
|
+
];
|
|
824
|
+
}
|
|
825
|
+
undo() {
|
|
826
|
+
this.get("commandStack").undo();
|
|
827
|
+
}
|
|
828
|
+
redo() {
|
|
829
|
+
this.get("commandStack").redo();
|
|
830
|
+
}
|
|
831
|
+
canUndo() {
|
|
832
|
+
return this.get("commandStack").canUndo();
|
|
833
|
+
}
|
|
834
|
+
canRedo() {
|
|
835
|
+
return this.get("commandStack").canRedo();
|
|
836
|
+
}
|
|
851
837
|
};
|
|
852
|
-
//#
|
|
838
|
+
//#endregion
|
|
839
|
+
export { Ae as Modeler, I as NavigatedViewer, w as ROOT_ID, A as TeamTopologiesRenderer, E as TtBaseViewer, Q as TtContextPadProvider, D as TtElementFactory, N as TtExporter, H as TtFlatModelBehavior, M as TtImporter, Ee as TtKeyboard, Ce as TtLabelEditing, he as TtModeling, Y as TtPaletteProvider, B as TtRules, ke as TtZOrder, F as Viewer, K as flowIconSvg, q as interactionIconSvg, P as ioModule, v as isTtElement, x as isTtFlow, b as isTtInteraction, y as isTtTeam, C as saveSVG, G as teamIconSvg, U as ttBehaviorsModule, Se as ttContextPadModule, j as ttDrawModule, De as ttKeyboardModule, we as ttLabelEditingModule, O as ttModelModule, z as ttModelingModule, X as ttPaletteModule, V as ttRulesModule, $ as ttZOrderModule };
|
|
840
|
+
|
|
841
|
+
//# sourceMappingURL=index.js.map
|