@miragon/wardley-renderer 0.9.0 → 0.10.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 +11 -6
- package/dist/collaborative/CollaborativeWardley.d.ts +5 -1
- package/dist/collaborative/CollaborativeWardley.d.ts.map +1 -1
- package/dist/index.js +367 -356
- package/dist/index.js.map +1 -1
- package/dist/map-menu/menu.d.ts +2 -0
- package/dist/map-menu/menu.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -227,8 +227,8 @@ function Ge(e) {
|
|
|
227
227
|
if (t) try {
|
|
228
228
|
let e = t.getCTM();
|
|
229
229
|
if (!e) return;
|
|
230
|
-
let n = e.inverse(), r = Infinity, i = Infinity, a = -Infinity, o = -Infinity;
|
|
231
|
-
for (let e of
|
|
230
|
+
let n = e.inverse(), r = Infinity, i = Infinity, a = -Infinity, o = -Infinity, s = t.querySelectorAll(".djs-visual:not(.djs-drag-group .djs-visual)");
|
|
231
|
+
for (let e of s) {
|
|
232
232
|
let t = e.getBBox(), s = e.getCTM();
|
|
233
233
|
if (t.width === 0 && t.height === 0 || !s) continue;
|
|
234
234
|
let c = n.multiply(s);
|
|
@@ -827,7 +827,7 @@ var bt = [
|
|
|
827
827
|
config: t
|
|
828
828
|
};
|
|
829
829
|
}
|
|
830
|
-
}] },
|
|
830
|
+
}] }, Ct = "wardley.readOnly.changed", wt = "wardley-read-only", Tt = 5e3, Et = [
|
|
831
831
|
"elements.move",
|
|
832
832
|
"shape.move",
|
|
833
833
|
"shape.create",
|
|
@@ -842,7 +842,7 @@ var bt = [
|
|
|
842
842
|
"connection.reconnectEnd",
|
|
843
843
|
"connection.updateWaypoints",
|
|
844
844
|
"elements.delete"
|
|
845
|
-
],
|
|
845
|
+
], Dt = class extends ce {
|
|
846
846
|
canvas;
|
|
847
847
|
injector;
|
|
848
848
|
static $inject = [
|
|
@@ -855,13 +855,13 @@ var bt = [
|
|
|
855
855
|
super(e), this.canvas = t, this.injector = n;
|
|
856
856
|
}
|
|
857
857
|
init() {
|
|
858
|
-
this.addRule(
|
|
858
|
+
this.addRule(Et, Tt, () => !this.locked && void 0);
|
|
859
859
|
}
|
|
860
860
|
isReadOnly() {
|
|
861
861
|
return this.locked;
|
|
862
862
|
}
|
|
863
863
|
setReadOnly(e) {
|
|
864
|
-
this.locked !== e && (this.locked = e, this.outerContainer().classList.toggle(
|
|
864
|
+
this.locked !== e && (this.locked = e, this.outerContainer().classList.toggle(wt, e), e && this.endInteractions(), this.injector.get("eventBus").fire(Ct, { readOnly: e }));
|
|
865
865
|
}
|
|
866
866
|
endInteractions() {
|
|
867
867
|
this.injector.get("dragging", !1)?.cancel();
|
|
@@ -880,52 +880,52 @@ var bt = [
|
|
|
880
880
|
let e = this.canvas.getContainer();
|
|
881
881
|
return e.closest(".wardley-container") ?? e;
|
|
882
882
|
}
|
|
883
|
-
},
|
|
883
|
+
}, Ot = {
|
|
884
884
|
__init__: ["wardleyReadOnly"],
|
|
885
|
-
wardleyReadOnly: ["type",
|
|
885
|
+
wardleyReadOnly: ["type", Dt]
|
|
886
886
|
};
|
|
887
|
-
function
|
|
887
|
+
function F(e) {
|
|
888
888
|
return e.get("wardleyReadOnly", !1)?.isReadOnly() === !0;
|
|
889
889
|
}
|
|
890
890
|
//#endregion
|
|
891
891
|
//#region src/map-resize/MapResizeHandles.ts
|
|
892
|
-
var
|
|
892
|
+
var kt = "wardley.mapResize", At = "wardley-map-resize", jt = -.5, Mt = 10, Nt = 12, Pt = 8, Ft = 16, It = 10, Lt = 16, Rt = {
|
|
893
893
|
x: "ew-resize",
|
|
894
894
|
y: "ns-resize",
|
|
895
895
|
xy: "nwse-resize"
|
|
896
896
|
};
|
|
897
|
-
function
|
|
897
|
+
function zt(e, t) {
|
|
898
898
|
return Math.round(e / t) * t;
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function Bt(e, t, n) {
|
|
901
901
|
return e < t ? t : e > n ? n : e;
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function Vt(e) {
|
|
904
904
|
return e.setAttribute("fill", "none"), e.setAttribute("stroke", "none"), e.setAttribute("opacity", "0"), e;
|
|
905
905
|
}
|
|
906
|
-
function
|
|
906
|
+
function Ht(e, t, n, r, i = {
|
|
907
907
|
keepAspectRatio: !1,
|
|
908
908
|
disableSnapping: !1
|
|
909
909
|
}) {
|
|
910
|
-
let a = t === "y" ? e.width : e.width + n, o = t === "x" ? e.height : e.height + r, s = i.disableSnapping ? 1 :
|
|
910
|
+
let a = t === "y" ? e.width : e.width + n, o = t === "x" ? e.height : e.height + r, s = i.disableSnapping ? 1 : Mt;
|
|
911
911
|
if (i.keepAspectRatio) {
|
|
912
912
|
let n = e.width / e.height;
|
|
913
|
-
return t === "x" || t === "xy" && Math.abs(a - e.width) / e.width >= Math.abs(o - e.height) / e.height ? (a = zt(
|
|
913
|
+
return t === "x" || t === "xy" && Math.abs(a - e.width) / e.width >= Math.abs(o - e.height) / e.height ? (a = Bt(zt(a, s), f.width, u.width), o = a / n) : (o = Bt(zt(o, s), f.height, u.height), a = o * n), _(a, o);
|
|
914
914
|
}
|
|
915
915
|
if (!i.disableSnapping) {
|
|
916
|
-
let e = c.find((e) => Math.abs(a - e.width) <=
|
|
916
|
+
let e = c.find((e) => Math.abs(a - e.width) <= Nt && Math.abs(o - e.height) <= Nt);
|
|
917
917
|
if (e) return {
|
|
918
918
|
width: e.width,
|
|
919
919
|
height: e.height
|
|
920
920
|
};
|
|
921
921
|
}
|
|
922
|
-
return _(t === "y" ? a :
|
|
922
|
+
return _(t === "y" ? a : zt(a, s), t === "x" ? o : zt(o, s));
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function Ut(e) {
|
|
925
925
|
let t = c.find((t) => t.width === e.width && t.height === e.height);
|
|
926
926
|
return `${e.width} × ${e.height}${t ? ` · ${t.name}` : ""}`;
|
|
927
927
|
}
|
|
928
|
-
var
|
|
928
|
+
var Wt = class {
|
|
929
929
|
canvas;
|
|
930
930
|
grid;
|
|
931
931
|
dragging;
|
|
@@ -946,16 +946,16 @@ var Ut = class {
|
|
|
946
946
|
badge;
|
|
947
947
|
scale;
|
|
948
948
|
constructor(e, t, n, r, i, a, o) {
|
|
949
|
-
this.canvas = t, this.grid = n, this.dragging = r, this.projection = i, this.modeling = a, this.injector = o, this.layer = T("g", { class: "wardley-map-resize" }), C(t.getLayer(
|
|
949
|
+
this.canvas = t, this.grid = n, this.dragging = r, this.projection = i, this.modeling = a, this.injector = o, this.layer = T("g", { class: "wardley-map-resize" }), C(t.getLayer(At, jt), this.layer), this.handles = {
|
|
950
950
|
x: this.createHandle("x"),
|
|
951
951
|
y: this.createHandle("y"),
|
|
952
952
|
xy: this.createHandle("xy")
|
|
953
953
|
}, this.handles.xy.group.addEventListener("dblclick", (e) => {
|
|
954
|
-
e.stopPropagation(), e.preventDefault(), !
|
|
954
|
+
e.stopPropagation(), e.preventDefault(), !F(this.injector) && this.modeling.resizeMap(void 0);
|
|
955
955
|
}), e.on(["import.done", "wardley.config.changed"], () => this.render()), e.on("canvas.viewbox.changed", (e) => {
|
|
956
956
|
let t = e.viewbox?.scale;
|
|
957
957
|
t !== this.scale && (this.scale = t, this.render());
|
|
958
|
-
}), e.on(`${
|
|
958
|
+
}), e.on(`${kt}.start`, (e) => this.onStart(e)), e.on(`${kt}.move`, (e) => this.onMove(e)), e.on(`${kt}.end`, (e) => this.onEnd(e)), e.on(`${kt}.cleanup`, (e) => this.onCleanup(e)), e.on(bt, xt, () => this.cancelPreviewingDrag()), this.render();
|
|
959
959
|
}
|
|
960
960
|
cancelPreviewingDrag() {
|
|
961
961
|
let e = this.dragging.context();
|
|
@@ -964,13 +964,13 @@ var Ut = class {
|
|
|
964
964
|
t?.snapshot && !t.committed && this.dragging.cancel(!0);
|
|
965
965
|
}
|
|
966
966
|
start(e, t) {
|
|
967
|
-
if (
|
|
967
|
+
if (F(this.injector)) return;
|
|
968
968
|
let n = {
|
|
969
969
|
axis: t,
|
|
970
970
|
startSize: this.grid.getPlotSize()
|
|
971
971
|
};
|
|
972
|
-
this.dragging.init(e,
|
|
973
|
-
cursor:
|
|
972
|
+
this.dragging.init(e, kt, {
|
|
973
|
+
cursor: Rt[t],
|
|
974
974
|
keepSelection: !0,
|
|
975
975
|
data: { context: n }
|
|
976
976
|
});
|
|
@@ -979,7 +979,7 @@ var Ut = class {
|
|
|
979
979
|
let t = T("g", {
|
|
980
980
|
class: `wardley-map-resize-handle wardley-map-resize-${e}`,
|
|
981
981
|
"data-axis": e
|
|
982
|
-
}), n =
|
|
982
|
+
}), n = Vt(T(e === "xy" ? "rect" : "line", { class: "wardley-map-resize-visual" })), r = Vt(T("rect", { class: "wardley-map-resize-hit" }));
|
|
983
983
|
return C(t, n), C(t, r), C(this.layer, t), t.addEventListener("mousedown", (t) => {
|
|
984
984
|
t.button !== 0 || this.dragging.context() || (t.stopPropagation(), t.preventDefault(), this.start(t, e));
|
|
985
985
|
}), {
|
|
@@ -991,7 +991,7 @@ var Ut = class {
|
|
|
991
991
|
render() {
|
|
992
992
|
let e = this.projection.root() !== void 0;
|
|
993
993
|
if (w(this.layer, { display: e ? "inline" : "none" }), !e) return;
|
|
994
|
-
let { width: t, height: n } = this.grid.getPlotSize(), r = D.marginLeft, i = D.marginTop, a = r + t, o = i + n, s = 1 / this.currentScale(), c =
|
|
994
|
+
let { width: t, height: n } = this.grid.getPlotSize(), r = D.marginLeft, i = D.marginTop, a = r + t, o = i + n, s = 1 / this.currentScale(), c = Pt * s, l = c / 2, u = Ft * s, d = u / 2, f = It * s;
|
|
995
995
|
w(this.handles.x.hit, {
|
|
996
996
|
x: a - l,
|
|
997
997
|
y: i,
|
|
@@ -1039,7 +1039,7 @@ var Ut = class {
|
|
|
1039
1039
|
onMove(e) {
|
|
1040
1040
|
let t = e.context;
|
|
1041
1041
|
if (!t.snapshot || !t.model) return;
|
|
1042
|
-
let n =
|
|
1042
|
+
let n = Ht(t.startSize, t.axis, e.dx, e.dy, {
|
|
1043
1043
|
keepAspectRatio: e.originalEvent?.shiftKey === !0,
|
|
1044
1044
|
disableSnapping: e.originalEvent?.altKey === !0
|
|
1045
1045
|
});
|
|
@@ -1061,15 +1061,15 @@ var Ut = class {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
showBadge(e, t) {
|
|
1063
1063
|
let n = this.canvas.getContainer();
|
|
1064
|
-
if (this.badge || (this.badge = document.createElement("div"), this.badge.className = "wardley-map-resize-badge", this.badge.setAttribute("role", "status"), n.appendChild(this.badge)), this.badge.textContent =
|
|
1064
|
+
if (this.badge || (this.badge = document.createElement("div"), this.badge.className = "wardley-map-resize-badge", this.badge.setAttribute("role", "status"), n.appendChild(this.badge)), this.badge.textContent = Ut(e), this.badge.hidden = !1, t) {
|
|
1065
1065
|
let e = n.getBoundingClientRect();
|
|
1066
|
-
this.badge.style.left = `${t.clientX - e.left +
|
|
1066
|
+
this.badge.style.left = `${t.clientX - e.left + Lt}px`, this.badge.style.top = `${t.clientY - e.top + Lt}px`;
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
1069
1069
|
hideBadge() {
|
|
1070
1070
|
this.badge && (this.badge.hidden = !0);
|
|
1071
1071
|
}
|
|
1072
|
-
},
|
|
1072
|
+
}, Gt = class extends le {
|
|
1073
1073
|
injector;
|
|
1074
1074
|
static $inject = [
|
|
1075
1075
|
"config.autoScroll",
|
|
@@ -1083,17 +1083,17 @@ var Ut = class {
|
|
|
1083
1083
|
startScroll(e) {
|
|
1084
1084
|
this.injector.get("dragging", !1)?.context()?.prefix === "wardley.mapResize" ? this.stopScroll() : super.startScroll(e);
|
|
1085
1085
|
}
|
|
1086
|
-
},
|
|
1086
|
+
}, Kt = {
|
|
1087
1087
|
__depends__: [St],
|
|
1088
1088
|
wardleyMapProjection: ["type", vt]
|
|
1089
|
-
},
|
|
1090
|
-
__depends__: [S,
|
|
1089
|
+
}, qt = {
|
|
1090
|
+
__depends__: [S, Kt],
|
|
1091
1091
|
__init__: ["mapResizeHandles"],
|
|
1092
|
-
mapResizeHandles: ["type",
|
|
1092
|
+
mapResizeHandles: ["type", Wt]
|
|
1093
1093
|
};
|
|
1094
1094
|
//#endregion
|
|
1095
1095
|
//#region src/modeling/cmd/UpdateConfigHandler.ts
|
|
1096
|
-
function
|
|
1096
|
+
function Jt(e, t, n, r, i = {}) {
|
|
1097
1097
|
let a = gt(e);
|
|
1098
1098
|
if (!a?.businessObject) return {};
|
|
1099
1099
|
let o = {}, s = { ...a.businessObject.config };
|
|
@@ -1107,7 +1107,7 @@ function qt(e, t, n, r, i = {}) {
|
|
|
1107
1107
|
...i.transient ? { transient: !0 } : {}
|
|
1108
1108
|
}), o;
|
|
1109
1109
|
}
|
|
1110
|
-
var
|
|
1110
|
+
var Yt = class {
|
|
1111
1111
|
canvas;
|
|
1112
1112
|
grid;
|
|
1113
1113
|
eventBus;
|
|
@@ -1126,12 +1126,12 @@ var Jt = class {
|
|
|
1126
1126
|
return e.oldProperties && this.apply(e.oldProperties), [];
|
|
1127
1127
|
}
|
|
1128
1128
|
apply(e) {
|
|
1129
|
-
return
|
|
1129
|
+
return Jt(this.canvas, this.grid, this.eventBus, e);
|
|
1130
1130
|
}
|
|
1131
1131
|
};
|
|
1132
1132
|
//#endregion
|
|
1133
1133
|
//#region src/WardleyBaseViewer.ts
|
|
1134
|
-
function
|
|
1134
|
+
function Xt(e) {
|
|
1135
1135
|
let t = e.undoRedoKeys ?? e.keyboard?.undoRedo, n = e.freeArea ? e.freeArea.insets ? { insets: e.freeArea.insets } : { center: e.freeArea.center } : e.freeRectInsets ? { insets: e.freeRectInsets } : void 0;
|
|
1136
1136
|
return {
|
|
1137
1137
|
...t === void 0 ? {} : { wardleyKeyboard: { undoRedo: t } },
|
|
@@ -1139,16 +1139,16 @@ function Yt(e) {
|
|
|
1139
1139
|
...e.fitOnImport === !1 ? { wardleyImport: { fit: !1 } } : {}
|
|
1140
1140
|
};
|
|
1141
1141
|
}
|
|
1142
|
-
var
|
|
1143
|
-
function
|
|
1144
|
-
let t = re(e), n = [...t.elements, ...t.edges].find(({ id: e }) => e === "wardley-root" || e.startsWith(
|
|
1142
|
+
var Zt = "__implicitroot";
|
|
1143
|
+
function Qt(e) {
|
|
1144
|
+
let t = re(e), n = [...t.elements, ...t.edges].find(({ id: e }) => e === "wardley-root" || e.startsWith(Zt));
|
|
1145
1145
|
if (n) throw Error(`The id "${n.id}" is reserved for the canvas itself.`);
|
|
1146
1146
|
return t;
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function $t(e) {
|
|
1149
1149
|
return typeof e == "number" ? `${e}px` : e;
|
|
1150
1150
|
}
|
|
1151
|
-
var
|
|
1151
|
+
var en = class {
|
|
1152
1152
|
_diagram;
|
|
1153
1153
|
_container;
|
|
1154
1154
|
_options;
|
|
@@ -1159,7 +1159,7 @@ var $t = class {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
_createContainer(e) {
|
|
1161
1161
|
let t = e.container ?? document.createElement("div");
|
|
1162
|
-
return t.classList.add("wardley-container"), t.style.width =
|
|
1162
|
+
return t.classList.add("wardley-container"), t.style.width = $t(e.width ?? "100%"), t.style.height = $t(e.height ?? (e.container ? "100%" : "600px")), t;
|
|
1163
1163
|
}
|
|
1164
1164
|
_ensureDiagram() {
|
|
1165
1165
|
if (!this._diagram) {
|
|
@@ -1167,7 +1167,7 @@ var $t = class {
|
|
|
1167
1167
|
this._diagram = new e({
|
|
1168
1168
|
canvas: { container: this._container },
|
|
1169
1169
|
modules: t,
|
|
1170
|
-
...
|
|
1170
|
+
...Xt(this._options)
|
|
1171
1171
|
}), this._diagram.get("eventBus").on(bt, xt, () => this._putBackSizePreview());
|
|
1172
1172
|
}
|
|
1173
1173
|
return this._diagram;
|
|
@@ -1182,7 +1182,7 @@ var $t = class {
|
|
|
1182
1182
|
this.get("eventBus").off(e, t);
|
|
1183
1183
|
}
|
|
1184
1184
|
async importMap(e) {
|
|
1185
|
-
let t =
|
|
1185
|
+
let t = Qt(e), n = this._ensureDiagram(), r = n.get("eventBus"), i = n.get("wardleyImporter"), a = n.get("commandStack", !1), o = this._rootBusinessObject() ? this.exportMap() : void 0;
|
|
1186
1186
|
this._labelsBeforePreview = void 0, this._sizePreview = void 0, n.get("dragging", !1)?.cancel(!1), i.clear();
|
|
1187
1187
|
let s;
|
|
1188
1188
|
try {
|
|
@@ -1284,7 +1284,7 @@ var $t = class {
|
|
|
1284
1284
|
} else this._applyConfigDirectly({ evolutionLabels: n });
|
|
1285
1285
|
}
|
|
1286
1286
|
_applyConfigDirectly(e, t = {}) {
|
|
1287
|
-
|
|
1287
|
+
Jt(this.get("canvas"), this.get("evolutionGrid"), this.get("eventBus"), e, t);
|
|
1288
1288
|
}
|
|
1289
1289
|
_wardleyModeling() {
|
|
1290
1290
|
return this._ensureDiagram().get("wardleyModeling", !1);
|
|
@@ -1323,7 +1323,7 @@ var $t = class {
|
|
|
1323
1323
|
};
|
|
1324
1324
|
//#endregion
|
|
1325
1325
|
//#region src/layout/WardleyLayouter.ts
|
|
1326
|
-
function
|
|
1326
|
+
function I(e) {
|
|
1327
1327
|
return P(e) ? {
|
|
1328
1328
|
x: e.x + e.width / 2,
|
|
1329
1329
|
y: e.y
|
|
@@ -1332,32 +1332,32 @@ function L(e) {
|
|
|
1332
1332
|
y: e.y + e.height / 2
|
|
1333
1333
|
};
|
|
1334
1334
|
}
|
|
1335
|
-
var
|
|
1335
|
+
var tn = class extends ue {
|
|
1336
1336
|
layoutConnection(e, t = {}) {
|
|
1337
1337
|
let n = t.source ?? e.source, r = t.target ?? e.target;
|
|
1338
1338
|
return super.layoutConnection(e, {
|
|
1339
1339
|
...t,
|
|
1340
|
-
...n ? { connectionStart:
|
|
1341
|
-
...r ? { connectionEnd:
|
|
1340
|
+
...n ? { connectionStart: I(n) } : {},
|
|
1341
|
+
...r ? { connectionEnd: I(r) } : {}
|
|
1342
1342
|
});
|
|
1343
1343
|
}
|
|
1344
|
-
},
|
|
1344
|
+
}, nn = { layouter: ["type", tn] }, rn = /* @__PURE__ */ new Set([
|
|
1345
1345
|
"component",
|
|
1346
1346
|
"anchor",
|
|
1347
1347
|
"submap",
|
|
1348
1348
|
"pipeline",
|
|
1349
1349
|
"accelerator"
|
|
1350
1350
|
]);
|
|
1351
|
-
function
|
|
1352
|
-
return typeof e == "string" &&
|
|
1351
|
+
function an(e) {
|
|
1352
|
+
return typeof e == "string" && rn.has(e);
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function on(e, t) {
|
|
1355
1355
|
if (!t.has(e)) return e;
|
|
1356
1356
|
let n = / (\d+)$/.exec(e), r = n ? e.slice(0, n.index) : e, i = n ? Number(n[1]) + 1 : 2;
|
|
1357
1357
|
for (; t.has(`${r} ${i}`);) i++;
|
|
1358
1358
|
return `${r} ${i}`;
|
|
1359
1359
|
}
|
|
1360
|
-
var
|
|
1360
|
+
var sn = class {
|
|
1361
1361
|
elementFactory;
|
|
1362
1362
|
grid;
|
|
1363
1363
|
elementRegistry;
|
|
@@ -1370,25 +1370,25 @@ var on = class {
|
|
|
1370
1370
|
this.elementFactory = e, this.grid = t, this.elementRegistry = n;
|
|
1371
1371
|
}
|
|
1372
1372
|
uniqueLabel(e, t) {
|
|
1373
|
-
return
|
|
1373
|
+
return on(e, this.takenLinkableLabels(t, this.pairableTypeFor(t)));
|
|
1374
1374
|
}
|
|
1375
1375
|
uniqueLabels(e) {
|
|
1376
1376
|
let t = this.takenLinkableLabels();
|
|
1377
1377
|
return e.map(({ type: e, label: n }) => {
|
|
1378
|
-
if (!
|
|
1379
|
-
let r =
|
|
1378
|
+
if (!an(e)) return n;
|
|
1379
|
+
let r = on(n, t);
|
|
1380
1380
|
return t.add(r), r;
|
|
1381
1381
|
});
|
|
1382
1382
|
}
|
|
1383
1383
|
isLinkable(e) {
|
|
1384
|
-
return
|
|
1384
|
+
return an(e);
|
|
1385
1385
|
}
|
|
1386
1386
|
takenLinkableLabels(e, t) {
|
|
1387
1387
|
let n = /* @__PURE__ */ new Set();
|
|
1388
1388
|
for (let r of this.elementRegistry.getAll()) {
|
|
1389
1389
|
if (e && r.id === e) continue;
|
|
1390
1390
|
let { wardleyType: i, wardleyLabel: a } = r;
|
|
1391
|
-
|
|
1391
|
+
an(i) && typeof a == "string" && (i === t && this.isUnpaired(r) || n.add(a));
|
|
1392
1392
|
}
|
|
1393
1393
|
return n;
|
|
1394
1394
|
}
|
|
@@ -1540,7 +1540,7 @@ var on = class {
|
|
|
1540
1540
|
});
|
|
1541
1541
|
}
|
|
1542
1542
|
createNew(e, t, n = {}) {
|
|
1543
|
-
let r = e === "attitude" ? n.attitudeKind ?? "pioneers" :
|
|
1543
|
+
let r = e === "attitude" ? n.attitudeKind ?? "pioneers" : an(e) ? this.uniqueLabel(t) : t;
|
|
1544
1544
|
if (e === "pipeline") return this.elementFactory.createShape({
|
|
1545
1545
|
width: 200,
|
|
1546
1546
|
height: 30,
|
|
@@ -1619,7 +1619,7 @@ var on = class {
|
|
|
1619
1619
|
id: t.id,
|
|
1620
1620
|
source: n,
|
|
1621
1621
|
target: r,
|
|
1622
|
-
waypoints: [
|
|
1622
|
+
waypoints: [I(n), I(r)],
|
|
1623
1623
|
wardleyType: e,
|
|
1624
1624
|
bidirectional: i,
|
|
1625
1625
|
...a ? { flowValue: a } : {},
|
|
@@ -1627,24 +1627,24 @@ var on = class {
|
|
|
1627
1627
|
businessObject: t
|
|
1628
1628
|
});
|
|
1629
1629
|
}
|
|
1630
|
-
},
|
|
1631
|
-
function
|
|
1630
|
+
}, cn = { wardleyElementFactory: ["type", sn] }, ln = "wardley-axes", un = ["Invisible", "Visible"], dn = "wardley-axis", fn = "wardley-axis-text";
|
|
1631
|
+
function pn(e) {
|
|
1632
1632
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
1633
1633
|
}
|
|
1634
|
-
var
|
|
1634
|
+
var mn = class {
|
|
1635
1635
|
canvas;
|
|
1636
1636
|
static $inject = ["canvas"];
|
|
1637
1637
|
boundaries = a;
|
|
1638
1638
|
labels = n;
|
|
1639
1639
|
yAxisLabel = "Value Chain";
|
|
1640
|
-
yAxisEndLabels =
|
|
1640
|
+
yAxisEndLabels = un;
|
|
1641
1641
|
plotWidth = D.width;
|
|
1642
1642
|
plotHeight = D.height;
|
|
1643
1643
|
constructor(e) {
|
|
1644
1644
|
this.canvas = e;
|
|
1645
1645
|
}
|
|
1646
1646
|
configure(e) {
|
|
1647
|
-
this.boundaries = e.stageBoundaries ?? a, this.labels = e.evolutionLabels ?? n, this.yAxisLabel = e.yAxisLabel ?? "Value Chain", this.yAxisEndLabels = e.yAxisEndLabels ??
|
|
1647
|
+
this.boundaries = e.stageBoundaries ?? a, this.labels = e.evolutionLabels ?? n, this.yAxisLabel = e.yAxisLabel ?? "Value Chain", this.yAxisEndLabels = e.yAxisEndLabels ?? un, this.plotWidth = p(e.size?.width, "width"), this.plotHeight = p(e.size?.height, "height");
|
|
1648
1648
|
}
|
|
1649
1649
|
toCanvas(e) {
|
|
1650
1650
|
return {
|
|
@@ -1654,8 +1654,8 @@ var pn = class {
|
|
|
1654
1654
|
}
|
|
1655
1655
|
fromCanvas(e) {
|
|
1656
1656
|
return {
|
|
1657
|
-
evolution:
|
|
1658
|
-
visibility:
|
|
1657
|
+
evolution: pn((e.x - D.marginLeft) / this.plotWidth),
|
|
1658
|
+
visibility: pn(1 - (e.y - D.marginTop) / this.plotHeight)
|
|
1659
1659
|
};
|
|
1660
1660
|
}
|
|
1661
1661
|
stageOf(e) {
|
|
@@ -1679,10 +1679,10 @@ var pn = class {
|
|
|
1679
1679
|
};
|
|
1680
1680
|
}
|
|
1681
1681
|
render() {
|
|
1682
|
-
let e = this.canvas.getLayer(
|
|
1682
|
+
let e = this.canvas.getLayer(ln, -1);
|
|
1683
1683
|
oe(e);
|
|
1684
1684
|
let t = D.marginLeft, n = D.marginTop, r = t + this.plotWidth, i = n + this.plotHeight;
|
|
1685
|
-
C(e,
|
|
1685
|
+
C(e, hn(t, n, this.plotWidth, this.plotHeight, {
|
|
1686
1686
|
fill: k.plotBackground,
|
|
1687
1687
|
stroke: k.grid
|
|
1688
1688
|
}));
|
|
@@ -1693,51 +1693,51 @@ var pn = class {
|
|
|
1693
1693
|
];
|
|
1694
1694
|
for (let r = 0; r < 4; r++) {
|
|
1695
1695
|
let o = t + a[r] * this.plotWidth, s = t + a[r + 1] * this.plotWidth;
|
|
1696
|
-
r % 2 == 1 && C(e,
|
|
1696
|
+
r % 2 == 1 && C(e, hn(o, n, s - o, this.plotHeight, {
|
|
1697
1697
|
fill: k.band,
|
|
1698
1698
|
stroke: "none"
|
|
1699
|
-
})), r > 0 && C(e,
|
|
1699
|
+
})), r > 0 && C(e, gn(o, n, o, i, {
|
|
1700
1700
|
stroke: k.grid,
|
|
1701
1701
|
"stroke-dasharray": "3 5"
|
|
1702
1702
|
}));
|
|
1703
1703
|
let c = (o + s) / 2;
|
|
1704
|
-
C(e,
|
|
1704
|
+
C(e, _n(this.labels[r].toUpperCase(), c, i + 18, {
|
|
1705
1705
|
"text-anchor": "middle",
|
|
1706
1706
|
"font-size": A.stage,
|
|
1707
1707
|
"letter-spacing": "0.08em",
|
|
1708
1708
|
fill: k.axisText
|
|
1709
1709
|
}));
|
|
1710
1710
|
}
|
|
1711
|
-
C(e,
|
|
1711
|
+
C(e, gn(t, i, r + 10, i, {
|
|
1712
1712
|
stroke: k.axis,
|
|
1713
|
-
class:
|
|
1714
|
-
})), C(e,
|
|
1713
|
+
class: dn
|
|
1714
|
+
})), C(e, vn(r + 10, i, "right")), C(e, _n("Evolution", r + 6, i + 38, {
|
|
1715
1715
|
"text-anchor": "end",
|
|
1716
1716
|
"font-size": A.axis,
|
|
1717
1717
|
fill: k.axisText,
|
|
1718
1718
|
"font-style": "italic"
|
|
1719
|
-
})), C(e,
|
|
1719
|
+
})), C(e, gn(t, i, t, n - 10, {
|
|
1720
1720
|
stroke: k.axis,
|
|
1721
|
-
class:
|
|
1722
|
-
})), C(e,
|
|
1723
|
-
let o =
|
|
1721
|
+
class: dn
|
|
1722
|
+
})), C(e, vn(t, n - 10, "up"));
|
|
1723
|
+
let o = _n(this.yAxisLabel, 0, 0, {
|
|
1724
1724
|
"text-anchor": "middle",
|
|
1725
1725
|
"font-size": A.axis,
|
|
1726
1726
|
fill: k.axisText,
|
|
1727
1727
|
"font-style": "italic"
|
|
1728
1728
|
});
|
|
1729
|
-
w(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), C(e, o), C(e,
|
|
1729
|
+
w(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), C(e, o), C(e, _n(this.yAxisEndLabels[1], t - 10, n + 11, {
|
|
1730
1730
|
"text-anchor": "end",
|
|
1731
1731
|
"font-size": A.stage,
|
|
1732
1732
|
fill: k.axisText
|
|
1733
|
-
})), C(e,
|
|
1733
|
+
})), C(e, _n(this.yAxisEndLabels[0], t - 10, i - 2, {
|
|
1734
1734
|
"text-anchor": "end",
|
|
1735
1735
|
"font-size": A.stage,
|
|
1736
1736
|
fill: k.axisText
|
|
1737
1737
|
}));
|
|
1738
1738
|
}
|
|
1739
1739
|
};
|
|
1740
|
-
function
|
|
1740
|
+
function hn(e, t, n, r, i) {
|
|
1741
1741
|
return w(T("rect"), {
|
|
1742
1742
|
x: e,
|
|
1743
1743
|
y: t,
|
|
@@ -1747,7 +1747,7 @@ function mn(e, t, n, r, i) {
|
|
|
1747
1747
|
...i
|
|
1748
1748
|
});
|
|
1749
1749
|
}
|
|
1750
|
-
function
|
|
1750
|
+
function gn(e, t, n, r, i) {
|
|
1751
1751
|
return w(T("line"), {
|
|
1752
1752
|
x1: e,
|
|
1753
1753
|
y1: t,
|
|
@@ -1757,62 +1757,62 @@ function hn(e, t, n, r, i) {
|
|
|
1757
1757
|
...i
|
|
1758
1758
|
});
|
|
1759
1759
|
}
|
|
1760
|
-
function
|
|
1760
|
+
function _n(e, t, n, r) {
|
|
1761
1761
|
let i = w(T("text"), {
|
|
1762
1762
|
x: t,
|
|
1763
1763
|
y: n,
|
|
1764
1764
|
"font-family": A.family,
|
|
1765
|
-
class:
|
|
1765
|
+
class: fn,
|
|
1766
1766
|
...r
|
|
1767
1767
|
});
|
|
1768
1768
|
return i.textContent = e, i;
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function vn(e, t, n) {
|
|
1771
1771
|
let r = n === "right" ? `${e - 5},${t - 5} ${e + 2},${t} ${e - 5},${t + 5}` : `${e - 5},${t + 5} ${e},${t - 2} ${e + 5},${t + 5}`;
|
|
1772
1772
|
return w(T("polygon"), {
|
|
1773
1773
|
points: r,
|
|
1774
1774
|
fill: k.axis,
|
|
1775
|
-
class:
|
|
1775
|
+
class: dn
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
//#endregion
|
|
1779
1779
|
//#region src/evolve/constants.ts
|
|
1780
|
-
var
|
|
1780
|
+
var yn = .005;
|
|
1781
1781
|
//#endregion
|
|
1782
1782
|
//#region src/a11y/canvasFocus.ts
|
|
1783
|
-
function
|
|
1783
|
+
function bn(e) {
|
|
1784
1784
|
return e._svg ?? e.getContainer().querySelector(":scope > svg");
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1787
|
-
let t =
|
|
1786
|
+
function xn(e) {
|
|
1787
|
+
let t = bn(e);
|
|
1788
1788
|
t ? t.focus({
|
|
1789
1789
|
preventScroll: !0,
|
|
1790
1790
|
focusVisible: !1
|
|
1791
1791
|
}) : e.focus();
|
|
1792
1792
|
}
|
|
1793
|
-
var
|
|
1794
|
-
function
|
|
1795
|
-
|
|
1796
|
-
e.target instanceof HTMLElement && e.target.closest("input, textarea") || (
|
|
1793
|
+
var Sn = "pointer", Cn = !1;
|
|
1794
|
+
function wn() {
|
|
1795
|
+
Cn || typeof document > "u" || (Cn = !0, document.addEventListener("pointerdown", () => Sn = "pointer", !0), document.addEventListener("mousedown", () => Sn = "pointer", !0), document.addEventListener("keydown", (e) => {
|
|
1796
|
+
e.target instanceof HTMLElement && e.target.closest("input, textarea") || (Sn = "keyboard");
|
|
1797
1797
|
}, !0));
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1800
|
-
return
|
|
1799
|
+
function Tn() {
|
|
1800
|
+
return Sn === "pointer";
|
|
1801
1801
|
}
|
|
1802
1802
|
//#endregion
|
|
1803
1803
|
//#region src/a11y/describeCanvas.ts
|
|
1804
|
-
function
|
|
1805
|
-
let t =
|
|
1804
|
+
function En(e) {
|
|
1805
|
+
let t = bn(e);
|
|
1806
1806
|
t && (t.setAttribute("role", "application"), t.setAttribute("aria-roledescription", "Wardley map"), t.setAttribute("aria-label", "Map canvas"));
|
|
1807
1807
|
}
|
|
1808
|
-
|
|
1808
|
+
En.$inject = ["canvas"];
|
|
1809
1809
|
//#endregion
|
|
1810
1810
|
//#region src/a11y/index.ts
|
|
1811
|
-
var
|
|
1812
|
-
function
|
|
1811
|
+
var Dn = { __init__: [En] }, On = "wardley.evolve", kn = "wardley-evolve-handle";
|
|
1812
|
+
function An(e) {
|
|
1813
1813
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
1814
1814
|
}
|
|
1815
|
-
var
|
|
1815
|
+
var jn = class {
|
|
1816
1816
|
dragging;
|
|
1817
1817
|
injector;
|
|
1818
1818
|
static $inject = [
|
|
@@ -1828,9 +1828,9 @@ var An = class {
|
|
|
1828
1828
|
this.dragging = t, this.injector = o;
|
|
1829
1829
|
let s = (t, n) => {
|
|
1830
1830
|
n === void 0 ? delete t.movement : t.movement = n, e.fire("element.changed", { element: t });
|
|
1831
|
-
}, c = (e, t) => Math.max(
|
|
1831
|
+
}, c = (e, t) => Math.max(An(t), Math.min(1, e.evolution + yn)), l = (e, t) => {
|
|
1832
1832
|
let r = i.getContainer().getBoundingClientRect(), a = i.viewbox(), o = a.x + (e - r.left) * (a.width / r.width);
|
|
1833
|
-
return
|
|
1833
|
+
return An(n.fromCanvas({
|
|
1834
1834
|
x: o,
|
|
1835
1835
|
y: t
|
|
1836
1836
|
}).evolution);
|
|
@@ -1840,10 +1840,10 @@ var An = class {
|
|
|
1840
1840
|
};
|
|
1841
1841
|
i.getContainer().addEventListener("mousedown", (e) => {
|
|
1842
1842
|
let t = e.target;
|
|
1843
|
-
if (!t?.closest(`.${
|
|
1843
|
+
if (!t?.closest(`.${kn}`) || u() || F(o)) return;
|
|
1844
1844
|
let n = t.closest("[data-element-id]")?.getAttribute("data-element-id"), d = n ? a.get(n) : void 0;
|
|
1845
1845
|
if (!d || d.wardleyType !== "component") return;
|
|
1846
|
-
e.stopPropagation(), e.preventDefault(),
|
|
1846
|
+
e.stopPropagation(), e.preventDefault(), xn(i);
|
|
1847
1847
|
let f = d.movement, p = d.y + d.height / 2, m, h = (e) => {
|
|
1848
1848
|
m = c(d, l(e.clientX, p)), s(d, {
|
|
1849
1849
|
...f,
|
|
@@ -1853,7 +1853,7 @@ var An = class {
|
|
|
1853
1853
|
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g), s(d, f), a.get(d.id) === d && m !== void 0 && m > d.evolution + .005 && r.evolveComponent(d, m);
|
|
1854
1854
|
};
|
|
1855
1855
|
document.addEventListener("mousemove", h), document.addEventListener("mouseup", g);
|
|
1856
|
-
}, !0), e.on(`${
|
|
1856
|
+
}, !0), e.on(`${On}.move`, (e) => {
|
|
1857
1857
|
let { shape: t } = e.context, r = t.y + t.height / 2, i = c(t, n.fromCanvas({
|
|
1858
1858
|
x: e.x,
|
|
1859
1859
|
y: r
|
|
@@ -1862,63 +1862,63 @@ var An = class {
|
|
|
1862
1862
|
...e.context.originalMovement,
|
|
1863
1863
|
targetEvolution: i
|
|
1864
1864
|
});
|
|
1865
|
-
}), e.on(`${
|
|
1865
|
+
}), e.on(`${On}.end`, (e) => {
|
|
1866
1866
|
let t = e.context, { shape: n, target: i } = t;
|
|
1867
1867
|
s(n, t.originalMovement), i !== void 0 && i > n.evolution + .005 && r.evolveComponent(n, i), t.committed = !0;
|
|
1868
|
-
}), e.on(`${
|
|
1868
|
+
}), e.on(`${On}.cleanup`, (e) => {
|
|
1869
1869
|
let t = e.context;
|
|
1870
1870
|
t && !t.committed && s(t.shape, t.originalMovement);
|
|
1871
1871
|
});
|
|
1872
1872
|
}
|
|
1873
1873
|
start(e, t) {
|
|
1874
|
-
if (
|
|
1874
|
+
if (F(this.injector)) return;
|
|
1875
1875
|
let n = {
|
|
1876
1876
|
shape: t,
|
|
1877
1877
|
...t.movement ? { originalMovement: t.movement } : {}
|
|
1878
1878
|
};
|
|
1879
|
-
this.dragging.init(e,
|
|
1879
|
+
this.dragging.init(e, On, {
|
|
1880
1880
|
cursor: "ew-resize",
|
|
1881
1881
|
data: { context: n }
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
|
-
},
|
|
1884
|
+
}, Mn = {
|
|
1885
1885
|
__init__: ["wardleyEvolveDragging"],
|
|
1886
|
-
wardleyEvolveDragging: ["type",
|
|
1886
|
+
wardleyEvolveDragging: ["type", jn]
|
|
1887
1887
|
};
|
|
1888
1888
|
//#endregion
|
|
1889
1889
|
//#region src/pipeline/pipelineMembership.ts
|
|
1890
|
-
function
|
|
1890
|
+
function L(e) {
|
|
1891
1891
|
return {
|
|
1892
1892
|
x: e.x + e.width / 2,
|
|
1893
1893
|
y: e.y + e.height / 2
|
|
1894
1894
|
};
|
|
1895
1895
|
}
|
|
1896
|
-
function
|
|
1896
|
+
function Nn(e, t) {
|
|
1897
1897
|
return t.x >= e.x && t.x <= e.x + e.width && t.y >= e.y && t.y <= e.y + e.height;
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1899
|
+
function Pn(e) {
|
|
1900
1900
|
return e.filter((e) => P(e));
|
|
1901
1901
|
}
|
|
1902
|
-
function Pn(e, t) {
|
|
1903
|
-
return e.filter((e) => N(e) && e.pipelineId === t.id);
|
|
1904
|
-
}
|
|
1905
1902
|
function Fn(e, t) {
|
|
1906
|
-
return e.
|
|
1903
|
+
return e.filter((e) => N(e) && e.pipelineId === t.id);
|
|
1907
1904
|
}
|
|
1908
1905
|
function In(e, t) {
|
|
1909
|
-
|
|
1906
|
+
return e.find((e) => N(e) && e.wardleyLabel === t.wardleyLabel && e.pipelineId !== t.id);
|
|
1910
1907
|
}
|
|
1911
1908
|
function Ln(e, t) {
|
|
1912
|
-
|
|
1913
|
-
|
|
1909
|
+
if (N(t)) return Pn(e).find((e) => e.wardleyLabel === t.wardleyLabel && t.pipelineId !== e.id);
|
|
1910
|
+
}
|
|
1911
|
+
function Rn(e, t) {
|
|
1912
|
+
let n = In(e, t);
|
|
1913
|
+
return [...Fn(e, t), ...n ? [n] : []];
|
|
1914
1914
|
}
|
|
1915
|
-
function
|
|
1916
|
-
let i =
|
|
1915
|
+
function zn(e, t, n, r = /* @__PURE__ */ new Set()) {
|
|
1916
|
+
let i = Pn(e).filter((e) => !r.has(e) && e.wardleyLabel !== t.wardleyLabel && Nn(e, n));
|
|
1917
1917
|
return i.find((e) => e.id === t.pipelineId) ?? i[0];
|
|
1918
1918
|
}
|
|
1919
1919
|
//#endregion
|
|
1920
1920
|
//#region src/pipeline/PipelineGroupBehavior.ts
|
|
1921
|
-
var
|
|
1921
|
+
var Bn = 1400, Vn = 450, Hn = 400, Un = 1500, Wn = "wardley-pipeline-drag", Gn = 900, Kn = "wardley-drop-target", qn = class extends de {
|
|
1922
1922
|
elementRegistry;
|
|
1923
1923
|
canvas;
|
|
1924
1924
|
static $inject = [
|
|
@@ -1933,27 +1933,27 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
1933
1933
|
this.preExecute("element.updateProperties", (e) => {
|
|
1934
1934
|
let { context: t } = e, n = t.element, r = t.properties.wardleyLabel;
|
|
1935
1935
|
if (typeof r != "string" || r === n.wardleyLabel) return;
|
|
1936
|
-
let i = P(n) ?
|
|
1936
|
+
let i = P(n) ? In(this.elementRegistry, n) : Ln(this.elementRegistry, n);
|
|
1937
1937
|
i && (t.renamedCounterpart = i);
|
|
1938
1938
|
}), this.postExecute("element.updateProperties", (e) => {
|
|
1939
1939
|
let { context: t } = e, n = t.renamedCounterpart, i = t.properties.wardleyLabel;
|
|
1940
1940
|
n && typeof i == "string" && n.wardleyLabel !== i && r.get("wardleyModeling").updateProperties(n, { wardleyLabel: i });
|
|
1941
|
-
}), e.on("shape.move.start",
|
|
1941
|
+
}), e.on("shape.move.start", Bn, (e) => {
|
|
1942
1942
|
let { context: t } = e;
|
|
1943
1943
|
t.shapes = this.withFollowers(t.shapes ?? []);
|
|
1944
|
-
}), this.preExecuted("elements.move",
|
|
1944
|
+
}), this.preExecuted("elements.move", Un, (e) => {
|
|
1945
1945
|
let t = e.context.closure;
|
|
1946
1946
|
if (t) {
|
|
1947
|
-
for (let e of Object.values(t.allShapes)) if (P(e)) for (let n of
|
|
1947
|
+
for (let e of Object.values(t.allShapes)) if (P(e)) for (let n of Rn(this.elementRegistry, e)) t.allShapes[n.id] || t.add(n, !!t.topLevel[e.id]);
|
|
1948
1948
|
}
|
|
1949
|
-
}), i && e.on("shape.move.start",
|
|
1949
|
+
}), i && e.on("shape.move.start", Vn, (e) => {
|
|
1950
1950
|
let { context: t } = e, n = this.carriedVertically(t.shapes ?? []);
|
|
1951
1951
|
if (!n.length) return;
|
|
1952
1952
|
let r = T("g");
|
|
1953
|
-
w(r, { class: "djs-drag-group" }), C(this.canvas.getLayer(
|
|
1953
|
+
w(r, { class: "djs-drag-group" }), C(this.canvas.getLayer(Wn, Gn), r);
|
|
1954
1954
|
for (let e of n) i.addDragger(e, r);
|
|
1955
1955
|
t.pipelineVerticalPreview = r;
|
|
1956
|
-
}), e.on("shape.move.move",
|
|
1956
|
+
}), e.on("shape.move.move", Hn, (e) => {
|
|
1957
1957
|
let { context: t } = e;
|
|
1958
1958
|
t.pipelineVerticalPreview && fe(t.pipelineVerticalPreview, 0, e.dy), this.markDropTarget(t, this.dropTargetFor(t, e.dx, e.dy));
|
|
1959
1959
|
}), e.on("shape.move.cleanup", (e) => {
|
|
@@ -1963,47 +1963,47 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
1963
1963
|
}
|
|
1964
1964
|
withFollowers(e) {
|
|
1965
1965
|
let t = new Set(e);
|
|
1966
|
-
for (let n of e) if (P(n)) for (let e of
|
|
1966
|
+
for (let n of e) if (P(n)) for (let e of Rn(this.elementRegistry, n)) t.add(e);
|
|
1967
1967
|
return [...t];
|
|
1968
1968
|
}
|
|
1969
1969
|
carriedVertically(e) {
|
|
1970
1970
|
let t = new Set(e), n = [];
|
|
1971
1971
|
for (let r of e) {
|
|
1972
1972
|
if (!N(r)) continue;
|
|
1973
|
-
let e =
|
|
1974
|
-
e && !t.has(e) && n.push(e, ...
|
|
1973
|
+
let e = Ln(this.elementRegistry, r);
|
|
1974
|
+
e && !t.has(e) && n.push(e, ...Fn(this.elementRegistry, e).filter((e) => !t.has(e)));
|
|
1975
1975
|
}
|
|
1976
1976
|
return n;
|
|
1977
1977
|
}
|
|
1978
1978
|
dropTargetFor(e, t, n) {
|
|
1979
1979
|
let r = e.shape;
|
|
1980
|
-
if (!N(r) ||
|
|
1981
|
-
let i =
|
|
1982
|
-
return
|
|
1980
|
+
if (!N(r) || Ln(this.elementRegistry, r)) return;
|
|
1981
|
+
let i = L(r);
|
|
1982
|
+
return zn(this.elementRegistry, r, {
|
|
1983
1983
|
x: i.x + t,
|
|
1984
1984
|
y: i.y + n
|
|
1985
1985
|
}, new Set(e.shapes ?? []));
|
|
1986
1986
|
}
|
|
1987
1987
|
markDropTarget(e, t) {
|
|
1988
1988
|
let n = e.pipelineDropTarget;
|
|
1989
|
-
n !== t && (n && this.canvas.removeMarker(n,
|
|
1989
|
+
n !== t && (n && this.canvas.removeMarker(n, Kn), t && this.canvas.addMarker(t, Kn), t ? e.pipelineDropTarget = t : delete e.pipelineDropTarget);
|
|
1990
1990
|
}
|
|
1991
|
-
},
|
|
1991
|
+
}, Jn = {
|
|
1992
1992
|
__init__: ["pipelineGroupBehavior"],
|
|
1993
|
-
pipelineGroupBehavior: ["type",
|
|
1994
|
-
},
|
|
1993
|
+
pipelineGroupBehavior: ["type", qn]
|
|
1994
|
+
}, Yn = [
|
|
1995
1995
|
"shape.move",
|
|
1996
1996
|
"shape.create",
|
|
1997
1997
|
"shape.resize"
|
|
1998
|
-
],
|
|
1999
|
-
...
|
|
1998
|
+
], Xn = [
|
|
1999
|
+
...Yn,
|
|
2000
2000
|
"elements.move",
|
|
2001
2001
|
"elements.create"
|
|
2002
|
-
],
|
|
2002
|
+
], Zn = [
|
|
2003
2003
|
"shape.create",
|
|
2004
2004
|
"shape.delete",
|
|
2005
2005
|
"element.updateProperties"
|
|
2006
|
-
],
|
|
2006
|
+
], Qn = 2e3, $n = 1e3, er = 10, tr = 1e-6, nr = class extends de {
|
|
2007
2007
|
eventBus;
|
|
2008
2008
|
grid;
|
|
2009
2009
|
elementRegistry;
|
|
@@ -2023,9 +2023,9 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2023
2023
|
constructor(e, t, n, r, i, a) {
|
|
2024
2024
|
super(e), this.eventBus = e, this.grid = t, this.elementRegistry = n, this.canvas = r, this.modeling = i, this.wardleyModeling = a;
|
|
2025
2025
|
let o = (e) => {
|
|
2026
|
-
for (let t of
|
|
2026
|
+
for (let t of rr(e.context)) this.deriveFromGeometry(t);
|
|
2027
2027
|
};
|
|
2028
|
-
this.executed(
|
|
2028
|
+
this.executed(Yn, o), this.reverted(Yn, o), this.preExecute(Xn, Qn, (e) => {
|
|
2029
2029
|
this.topLevelContext ||= e.context;
|
|
2030
2030
|
}), e.on("commandStack.changed", () => {
|
|
2031
2031
|
this.topLevelContext = null;
|
|
@@ -2034,18 +2034,18 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2034
2034
|
if (!this.isTopLevel(t) || !j(t.shape) || !t.delta) return;
|
|
2035
2035
|
let n = [t.shape, ...this.followersOf(t.shape)];
|
|
2036
2036
|
this.rememberEvolutions(t, n), t.delta = this.clampDelta(t.delta, n);
|
|
2037
|
-
}), this.preExecuted("elements.move",
|
|
2037
|
+
}), this.preExecuted("elements.move", $n, (e) => {
|
|
2038
2038
|
let { context: t } = e;
|
|
2039
2039
|
if (!this.isTopLevel(t) || !t.delta) return;
|
|
2040
|
-
let n =
|
|
2040
|
+
let n = ir(t);
|
|
2041
2041
|
this.rememberEvolutions(t, n), t.delta = this.clampDelta(t.delta, n);
|
|
2042
2042
|
}), this.preExecute(["shape.create", "elements.create"], (e) => {
|
|
2043
2043
|
let { context: t } = e;
|
|
2044
|
-
t.parent?.parent && (t.parent = this.canvas.getRootElement()), this.isTopLevel(t) && this.rememberEvolutions(t,
|
|
2044
|
+
t.parent?.parent && (t.parent = this.canvas.getRootElement()), this.isTopLevel(t) && this.rememberEvolutions(t, rr(t));
|
|
2045
2045
|
}), this.preExecute("shape.resize", (e) => {
|
|
2046
2046
|
let { context: t } = e, n = t.shape;
|
|
2047
2047
|
j(n) && t.newBounds && (n.wardleyType === "pipeline" ? t.newBounds = this.horizontalPipelineBounds(n, t.newBounds) : n.wardleyType === "attitude" && (t.newBounds = this.boundsInsidePlot(t.newBounds)));
|
|
2048
|
-
}), this.postExecuted(
|
|
2048
|
+
}), this.postExecuted(Xn, (e) => {
|
|
2049
2049
|
if (e.context === this.topLevelContext) try {
|
|
2050
2050
|
this.applyCorrections(e.command, e.context);
|
|
2051
2051
|
} finally {
|
|
@@ -2059,13 +2059,13 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2059
2059
|
...e.context?.elements ?? []
|
|
2060
2060
|
].some((e) => N(e))) for (let e of this.elementRegistry.filter((e) => P(e))) this.eventBus.fire("element.changed", { element: e });
|
|
2061
2061
|
};
|
|
2062
|
-
this.executed(
|
|
2062
|
+
this.executed(Zn, s), this.reverted(Zn, s);
|
|
2063
2063
|
}
|
|
2064
2064
|
isTopLevel(e) {
|
|
2065
2065
|
return e === this.topLevelContext;
|
|
2066
2066
|
}
|
|
2067
2067
|
followersOf(e) {
|
|
2068
|
-
return P(e) ?
|
|
2068
|
+
return P(e) ? Rn(this.elementRegistry, e) : [];
|
|
2069
2069
|
}
|
|
2070
2070
|
rememberEvolutions(e, t) {
|
|
2071
2071
|
this.evolutionsBefore.set(e, new Map(t.map((e) => [e, e.evolution])));
|
|
@@ -2098,7 +2098,7 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2098
2098
|
return;
|
|
2099
2099
|
}
|
|
2100
2100
|
default: {
|
|
2101
|
-
let t = this.grid.fromCanvas(
|
|
2101
|
+
let t = this.grid.fromCanvas(L(e));
|
|
2102
2102
|
e.evolution = t.evolution;
|
|
2103
2103
|
let n = this.pipelineOfMember(e);
|
|
2104
2104
|
e.visibility = n ? this.pipelineVisibility(n) : t.visibility;
|
|
@@ -2112,9 +2112,9 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2112
2112
|
}), n = this.grid.fromCanvas({
|
|
2113
2113
|
x: e.x + e.width,
|
|
2114
2114
|
y: e.y
|
|
2115
|
-
}), [r, i] =
|
|
2116
|
-
e.evolutionStart = r, e.evolutionEnd = i, e.evolution =
|
|
2117
|
-
for (let t of
|
|
2115
|
+
}), [r, i] = cr(t.evolution, n.evolution);
|
|
2116
|
+
e.evolutionStart = r, e.evolutionEnd = i, e.evolution = sr((r + i) / 2), e.visibility = t.visibility;
|
|
2117
|
+
for (let t of Fn(this.elementRegistry, e)) t.visibility = e.visibility;
|
|
2118
2118
|
}
|
|
2119
2119
|
pipelineOfMember(e) {
|
|
2120
2120
|
if (!N(e) || !e.pipelineId) return;
|
|
@@ -2141,14 +2141,14 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2141
2141
|
return;
|
|
2142
2142
|
}
|
|
2143
2143
|
case "elements.move":
|
|
2144
|
-
this.completeMove(
|
|
2144
|
+
this.completeMove(ir(t), t.delta ?? {
|
|
2145
2145
|
x: 0,
|
|
2146
2146
|
y: 0
|
|
2147
2147
|
}, t);
|
|
2148
2148
|
return;
|
|
2149
2149
|
case "shape.create":
|
|
2150
2150
|
case "elements.create": {
|
|
2151
|
-
let e =
|
|
2151
|
+
let e = rr(t), n = this.clampDelta({
|
|
2152
2152
|
x: 0,
|
|
2153
2153
|
y: 0
|
|
2154
2154
|
}, e);
|
|
@@ -2165,12 +2165,12 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2165
2165
|
this.carryPipelinesOfMovedAnchors(e, t), this.reconcileMembership(e), this.shiftPassedEvolveTargets(n);
|
|
2166
2166
|
}
|
|
2167
2167
|
carryPipelinesOfMovedAnchors(e, t) {
|
|
2168
|
-
if (Math.abs(t.y) <
|
|
2168
|
+
if (Math.abs(t.y) < tr) return;
|
|
2169
2169
|
let n = new Set(e);
|
|
2170
2170
|
for (let r of e) {
|
|
2171
|
-
let e =
|
|
2171
|
+
let e = Ln(this.elementRegistry, r);
|
|
2172
2172
|
if (!e || n.has(e)) continue;
|
|
2173
|
-
let i = [e, ...
|
|
2173
|
+
let i = [e, ...Fn(this.elementRegistry, e).filter((e) => !n.has(e))], a = this.clampDelta({
|
|
2174
2174
|
x: 0,
|
|
2175
2175
|
y: t.y
|
|
2176
2176
|
}, i);
|
|
@@ -2179,8 +2179,8 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2179
2179
|
}
|
|
2180
2180
|
reconcileMembership(e) {
|
|
2181
2181
|
for (let t of e) {
|
|
2182
|
-
if (!N(t) ||
|
|
2183
|
-
let e =
|
|
2182
|
+
if (!N(t) || Ln(this.elementRegistry, t)) continue;
|
|
2183
|
+
let e = L(t), n = zn(this.elementRegistry, t, e);
|
|
2184
2184
|
n ? (this.moveBy(t, {
|
|
2185
2185
|
x: 0,
|
|
2186
2186
|
y: n.y + n.height / 2 - e.y
|
|
@@ -2191,15 +2191,15 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2191
2191
|
}
|
|
2192
2192
|
}
|
|
2193
2193
|
releaseMembersOutside(e) {
|
|
2194
|
-
for (let t of
|
|
2195
|
-
let n =
|
|
2194
|
+
for (let t of Fn(this.elementRegistry, e)) {
|
|
2195
|
+
let n = L(t);
|
|
2196
2196
|
(n.x < e.x || n.x > e.x + e.width) && this.release(t);
|
|
2197
2197
|
}
|
|
2198
2198
|
}
|
|
2199
2199
|
release(e) {
|
|
2200
2200
|
this.wardleyModeling.updateProperties(e, {
|
|
2201
2201
|
pipelineId: void 0,
|
|
2202
|
-
visibility: this.grid.fromCanvas(
|
|
2202
|
+
visibility: this.grid.fromCanvas(L(e)).visibility
|
|
2203
2203
|
});
|
|
2204
2204
|
}
|
|
2205
2205
|
shiftPassedEvolveTargets(e) {
|
|
@@ -2217,7 +2217,7 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
2219
2219
|
moveBy(e, t) {
|
|
2220
|
-
Math.abs(t.x) <
|
|
2220
|
+
Math.abs(t.x) < tr && Math.abs(t.y) < tr || this.modeling.moveShape(e, {
|
|
2221
2221
|
x: t.x,
|
|
2222
2222
|
y: t.y
|
|
2223
2223
|
});
|
|
@@ -2254,7 +2254,7 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2254
2254
|
case "drawing": {
|
|
2255
2255
|
let t = e.drawingPoints ?? [];
|
|
2256
2256
|
if (!t.length) return {
|
|
2257
|
-
...
|
|
2257
|
+
...L(e),
|
|
2258
2258
|
width: 0,
|
|
2259
2259
|
height: 0
|
|
2260
2260
|
};
|
|
@@ -2267,7 +2267,7 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2267
2267
|
};
|
|
2268
2268
|
}
|
|
2269
2269
|
default: return {
|
|
2270
|
-
...
|
|
2270
|
+
...L(e),
|
|
2271
2271
|
width: 0,
|
|
2272
2272
|
height: 0
|
|
2273
2273
|
};
|
|
@@ -2286,8 +2286,8 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2286
2286
|
r.min = Math.max(r.min, n.x - t.x), r.max = Math.min(r.max, n.x + n.width - (t.x + t.width)), i.min = Math.max(i.min, n.y - t.y), i.max = Math.min(i.max, n.y + n.height - (t.y + t.height));
|
|
2287
2287
|
}
|
|
2288
2288
|
return {
|
|
2289
|
-
x:
|
|
2290
|
-
y:
|
|
2289
|
+
x: ar(e.x, r),
|
|
2290
|
+
y: ar(e.y, i)
|
|
2291
2291
|
};
|
|
2292
2292
|
}
|
|
2293
2293
|
horizontalPipelineBounds(e, t) {
|
|
@@ -2309,11 +2309,11 @@ var zn = 1400, Bn = 450, Vn = 400, Hn = 1500, Un = "wardley-pipeline-drag", Wn =
|
|
|
2309
2309
|
};
|
|
2310
2310
|
}
|
|
2311
2311
|
spanInside(e, t, n) {
|
|
2312
|
-
let r = this.plotBounds(), i = n === "x" ? r.x : r.y, a = i + (n === "x" ? r.width : r.height), o = Math.max(e, i), s = Math.max(Math.min(e + t, a) - o,
|
|
2312
|
+
let r = this.plotBounds(), i = n === "x" ? r.x : r.y, a = i + (n === "x" ? r.width : r.height), o = Math.max(e, i), s = Math.max(Math.min(e + t, a) - o, er);
|
|
2313
2313
|
return [Math.min(o, a - s), s];
|
|
2314
2314
|
}
|
|
2315
2315
|
};
|
|
2316
|
-
function
|
|
2316
|
+
function rr(e) {
|
|
2317
2317
|
let t = [
|
|
2318
2318
|
...e.shape ? [e.shape] : [],
|
|
2319
2319
|
...e.shapes ?? [],
|
|
@@ -2321,37 +2321,37 @@ function nr(e) {
|
|
|
2321
2321
|
];
|
|
2322
2322
|
return [...new Set(t)].filter(j);
|
|
2323
2323
|
}
|
|
2324
|
-
function
|
|
2325
|
-
return e.closure ? Object.values(e.closure.allShapes).filter(j) :
|
|
2324
|
+
function ir(e) {
|
|
2325
|
+
return e.closure ? Object.values(e.closure.allShapes).filter(j) : rr(e);
|
|
2326
2326
|
}
|
|
2327
|
-
function
|
|
2327
|
+
function ar(e, t) {
|
|
2328
2328
|
return t.min > t.max ? e : Math.min(Math.max(e, t.min), t.max);
|
|
2329
2329
|
}
|
|
2330
|
-
var
|
|
2331
|
-
function
|
|
2330
|
+
var or = .001;
|
|
2331
|
+
function sr(e) {
|
|
2332
2332
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
2333
2333
|
}
|
|
2334
|
-
function
|
|
2335
|
-
let n =
|
|
2336
|
-
return [Math.max(0, Math.min(e, n -
|
|
2334
|
+
function cr(e, t) {
|
|
2335
|
+
let n = sr(Math.max(t, e + or));
|
|
2336
|
+
return [Math.max(0, Math.min(e, n - or)), n];
|
|
2337
2337
|
}
|
|
2338
2338
|
//#endregion
|
|
2339
2339
|
//#region src/modeling/cmd/UpdatePropertiesHandler.ts
|
|
2340
|
-
function
|
|
2340
|
+
function lr(e, t, n) {
|
|
2341
2341
|
n === void 0 ? delete e[t] : e[t] = n;
|
|
2342
2342
|
}
|
|
2343
|
-
var
|
|
2343
|
+
var ur = class {
|
|
2344
2344
|
execute(e) {
|
|
2345
2345
|
let { element: t, properties: n } = e, r = t, i = {};
|
|
2346
|
-
for (let e of Object.keys(n)) i[e] = r[e],
|
|
2346
|
+
for (let e of Object.keys(n)) i[e] = r[e], lr(r, e, n[e]);
|
|
2347
2347
|
return e.oldProperties = i, [t];
|
|
2348
2348
|
}
|
|
2349
2349
|
revert(e) {
|
|
2350
2350
|
let { element: t, oldProperties: n } = e, r = t;
|
|
2351
|
-
if (n) for (let e of Object.keys(n))
|
|
2351
|
+
if (n) for (let e of Object.keys(n)) lr(r, e, n[e]);
|
|
2352
2352
|
return [t];
|
|
2353
2353
|
}
|
|
2354
|
-
},
|
|
2354
|
+
}, dr = class {
|
|
2355
2355
|
projection;
|
|
2356
2356
|
static $inject = ["wardleyMapProjection"];
|
|
2357
2357
|
constructor(e) {
|
|
@@ -2359,20 +2359,20 @@ var lr = class {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
execute(e) {
|
|
2361
2361
|
let t = this.projection.root()?.businessObject;
|
|
2362
|
-
return t ? (e.oldSize = t.config.size, e.oldRawPassthrough = t.rawPassthrough, this.projection.apply(
|
|
2362
|
+
return t ? (e.oldSize = t.config.size, e.oldRawPassthrough = t.rawPassthrough, this.projection.apply(fr({
|
|
2363
2363
|
...t,
|
|
2364
2364
|
config: ht(t.config, e.size)
|
|
2365
2365
|
}, _t(t.rawPassthrough)))) : [];
|
|
2366
2366
|
}
|
|
2367
2367
|
revert(e) {
|
|
2368
2368
|
let t = this.projection.root()?.businessObject;
|
|
2369
|
-
return t ? this.projection.apply(
|
|
2369
|
+
return t ? this.projection.apply(fr({
|
|
2370
2370
|
...t,
|
|
2371
2371
|
config: ht(t.config, e.oldSize)
|
|
2372
2372
|
}, e.oldRawPassthrough)) : [];
|
|
2373
2373
|
}
|
|
2374
2374
|
};
|
|
2375
|
-
function
|
|
2375
|
+
function fr(e, t) {
|
|
2376
2376
|
let { rawPassthrough: n, ...r } = e;
|
|
2377
2377
|
return t ? {
|
|
2378
2378
|
...r,
|
|
@@ -2381,34 +2381,34 @@ function dr(e, t) {
|
|
|
2381
2381
|
}
|
|
2382
2382
|
//#endregion
|
|
2383
2383
|
//#region src/modeling/WardleyModeling.ts
|
|
2384
|
-
var
|
|
2385
|
-
function
|
|
2384
|
+
var pr = "element.updateProperties", mr = "wardley.map.resize", hr = "wardley.config.update";
|
|
2385
|
+
function gr(e) {
|
|
2386
2386
|
let t = {};
|
|
2387
2387
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
2388
2388
|
return t;
|
|
2389
2389
|
}
|
|
2390
|
-
var
|
|
2390
|
+
var _r = class {
|
|
2391
2391
|
commandStack;
|
|
2392
2392
|
canvas;
|
|
2393
2393
|
static $inject = ["commandStack", "canvas"];
|
|
2394
2394
|
constructor(e, t) {
|
|
2395
|
-
this.commandStack = e, this.canvas = t, e.registerHandler(
|
|
2395
|
+
this.commandStack = e, this.canvas = t, e.registerHandler(pr, ur), e.registerHandler(mr, dr), e.registerHandler(hr, Yt);
|
|
2396
2396
|
}
|
|
2397
2397
|
resizeMap(e) {
|
|
2398
2398
|
let t = this.currentConfig();
|
|
2399
|
-
t && !
|
|
2399
|
+
t && !vr(t.size, e) && this.commandStack.execute(mr, { size: e });
|
|
2400
2400
|
}
|
|
2401
2401
|
updateConfig(e) {
|
|
2402
2402
|
let t = this.currentConfig();
|
|
2403
2403
|
if (!t) return;
|
|
2404
2404
|
let n = t, r = Object.fromEntries(Object.entries(e).filter(([e, t]) => e !== "size" && JSON.stringify(n[e]) !== JSON.stringify(t)));
|
|
2405
|
-
Object.keys(r).length !== 0 && this.commandStack.execute(
|
|
2405
|
+
Object.keys(r).length !== 0 && this.commandStack.execute(hr, { properties: r });
|
|
2406
2406
|
}
|
|
2407
2407
|
currentConfig() {
|
|
2408
2408
|
return gt(this.canvas)?.businessObject?.config;
|
|
2409
2409
|
}
|
|
2410
2410
|
updateProperties(e, t) {
|
|
2411
|
-
this.commandStack.execute(
|
|
2411
|
+
this.commandStack.execute(pr, {
|
|
2412
2412
|
element: e,
|
|
2413
2413
|
properties: t
|
|
2414
2414
|
});
|
|
@@ -2426,11 +2426,11 @@ var gr = class {
|
|
|
2426
2426
|
} else this.updateProperties(e, { wardleyLabel: t });
|
|
2427
2427
|
}
|
|
2428
2428
|
evolveComponent(e, t, n = {}) {
|
|
2429
|
-
let r =
|
|
2430
|
-
r <= e.evolution || this.updateProperties(e, { movement:
|
|
2429
|
+
let r = yr(t);
|
|
2430
|
+
r <= e.evolution || this.updateProperties(e, { movement: gr({
|
|
2431
2431
|
...e.movement,
|
|
2432
2432
|
targetEvolution: r,
|
|
2433
|
-
...
|
|
2433
|
+
...gr({
|
|
2434
2434
|
newLabel: n.newLabel,
|
|
2435
2435
|
method: n.method
|
|
2436
2436
|
})
|
|
@@ -2455,15 +2455,15 @@ var gr = class {
|
|
|
2455
2455
|
this.updateProperties(e, { color: t });
|
|
2456
2456
|
}
|
|
2457
2457
|
};
|
|
2458
|
-
function
|
|
2458
|
+
function vr(e, t) {
|
|
2459
2459
|
return !e || !t ? e === t : e.width === t.width && e.height === t.height;
|
|
2460
2460
|
}
|
|
2461
|
-
function
|
|
2461
|
+
function yr(e) {
|
|
2462
2462
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
2463
2463
|
}
|
|
2464
2464
|
//#endregion
|
|
2465
2465
|
//#region src/modeling/WardleyCopyPaste.ts
|
|
2466
|
-
var
|
|
2466
|
+
var br = 24, xr = [
|
|
2467
2467
|
"wardleyType",
|
|
2468
2468
|
"evolution",
|
|
2469
2469
|
"visibility",
|
|
@@ -2480,13 +2480,13 @@ var yr = 24, br = [
|
|
|
2480
2480
|
"drawingPoints",
|
|
2481
2481
|
"closed",
|
|
2482
2482
|
"strokeStyle"
|
|
2483
|
-
],
|
|
2483
|
+
], Sr = [
|
|
2484
2484
|
"wardleyType",
|
|
2485
2485
|
"bidirectional",
|
|
2486
2486
|
"flowValue",
|
|
2487
2487
|
"linkLabel"
|
|
2488
2488
|
];
|
|
2489
|
-
function
|
|
2489
|
+
function Cr(e, t) {
|
|
2490
2490
|
let n = {};
|
|
2491
2491
|
for (let r of t) {
|
|
2492
2492
|
let t = e[r];
|
|
@@ -2494,7 +2494,7 @@ function Sr(e, t) {
|
|
|
2494
2494
|
}
|
|
2495
2495
|
return n;
|
|
2496
2496
|
}
|
|
2497
|
-
var
|
|
2497
|
+
var wr = class {
|
|
2498
2498
|
selection;
|
|
2499
2499
|
modeling;
|
|
2500
2500
|
elementFactory;
|
|
@@ -2526,14 +2526,14 @@ var Cr = class {
|
|
|
2526
2526
|
i !== void 0 && a !== void 0 && (r.add(e), n.push({
|
|
2527
2527
|
sourceIdx: i,
|
|
2528
2528
|
targetIdx: a,
|
|
2529
|
-
props:
|
|
2529
|
+
props: Cr(e, Sr)
|
|
2530
2530
|
}));
|
|
2531
2531
|
}
|
|
2532
2532
|
return this.clipboard = {
|
|
2533
2533
|
shapes: e.map((e) => ({
|
|
2534
2534
|
id: e.id,
|
|
2535
2535
|
...e.pipelineId ? { pipelineId: e.pipelineId } : {},
|
|
2536
|
-
props:
|
|
2536
|
+
props: Cr(e, xr),
|
|
2537
2537
|
x: e.x,
|
|
2538
2538
|
y: e.y,
|
|
2539
2539
|
width: e.width,
|
|
@@ -2570,7 +2570,7 @@ var Cr = class {
|
|
|
2570
2570
|
...structuredClone(e.props),
|
|
2571
2571
|
source: n[e.sourceIdx],
|
|
2572
2572
|
target: n[e.targetIdx],
|
|
2573
|
-
waypoints: [
|
|
2573
|
+
waypoints: [I(n[e.sourceIdx]), I(n[e.targetIdx])]
|
|
2574
2574
|
}))
|
|
2575
2575
|
};
|
|
2576
2576
|
}
|
|
@@ -2594,14 +2594,14 @@ var Cr = class {
|
|
|
2594
2594
|
}
|
|
2595
2595
|
insertWithOffset(e) {
|
|
2596
2596
|
this.pasteCount++;
|
|
2597
|
-
let t =
|
|
2597
|
+
let t = br * this.pasteCount, n = Tr(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
|
|
2598
2598
|
x: n.cx + t,
|
|
2599
2599
|
y: n.cy + t
|
|
2600
2600
|
}, this.canvas.getRootElement());
|
|
2601
2601
|
return this.selection.select(r), !0;
|
|
2602
2602
|
}
|
|
2603
2603
|
};
|
|
2604
|
-
function
|
|
2604
|
+
function Tr(e) {
|
|
2605
2605
|
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));
|
|
2606
2606
|
return {
|
|
2607
2607
|
cx: (t + r) / 2,
|
|
@@ -2610,26 +2610,26 @@ function wr(e) {
|
|
|
2610
2610
|
}
|
|
2611
2611
|
//#endregion
|
|
2612
2612
|
//#region src/modeling/index.ts
|
|
2613
|
-
var
|
|
2613
|
+
var Er = {
|
|
2614
2614
|
__depends__: [
|
|
2615
2615
|
me,
|
|
2616
2616
|
he,
|
|
2617
|
-
|
|
2617
|
+
Kt
|
|
2618
2618
|
],
|
|
2619
2619
|
__init__: ["wardleyModeling"],
|
|
2620
|
-
wardleyModeling: ["type",
|
|
2621
|
-
wardleyCopyPaste: ["type",
|
|
2622
|
-
},
|
|
2620
|
+
wardleyModeling: ["type", _r],
|
|
2621
|
+
wardleyCopyPaste: ["type", wr]
|
|
2622
|
+
}, Dr = { evolutionGrid: ["type", mn] }, Or = {
|
|
2623
2623
|
__init__: ["evolutionConstraintBehavior"],
|
|
2624
2624
|
__depends__: [
|
|
2625
|
-
|
|
2626
|
-
|
|
2625
|
+
Dr,
|
|
2626
|
+
nn,
|
|
2627
2627
|
pe,
|
|
2628
|
-
|
|
2628
|
+
Er
|
|
2629
2629
|
],
|
|
2630
|
-
evolutionConstraintBehavior: ["type",
|
|
2631
|
-
},
|
|
2632
|
-
function
|
|
2630
|
+
evolutionConstraintBehavior: ["type", nr]
|
|
2631
|
+
}, 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", Ar = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z", jr = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z", Mr = "M15.5 5H11l5 7-5 7h4.5l5-7zM8.5 5H4l5 7-5 7h4.5l5-7z", Nr = "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", Pr = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Fr = "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z", Ir = "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z", Lr = "M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z", Rr = "M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z", zr = "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z", Br = "M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z", Vr = "M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z";
|
|
2632
|
+
function Hr(e, t, n, r, i) {
|
|
2633
2633
|
let a = T("g"), o = r / 24;
|
|
2634
2634
|
return w(a, {
|
|
2635
2635
|
transform: `translate(${t - r / 2}, ${n - r / 2}) scale(${o})`,
|
|
@@ -2637,19 +2637,19 @@ function Vr(e, t, n, r, i) {
|
|
|
2637
2637
|
stroke: "none"
|
|
2638
2638
|
}), C(a, w(T("path"), { d: e })), a;
|
|
2639
2639
|
}
|
|
2640
|
-
var
|
|
2641
|
-
function
|
|
2640
|
+
var Ur = "M0.44 3.56L3.56 0.44 23.56 20.44 20.44 23.56z", Wr = 0, Gr = "M1.29 2.71L2.71 1.29 22.71 21.29 21.29 22.71z";
|
|
2641
|
+
function Kr(e) {
|
|
2642
2642
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
2643
2643
|
}
|
|
2644
|
-
function
|
|
2645
|
-
let n = `wardley-icon-strike-gap-${++
|
|
2646
|
-
return `<svg viewBox="0 0 24 24" width="${Number(t)}" height="${Number(t)}" fill="currentColor" aria-hidden="true"><mask id="${n}" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><rect width="24" height="24" fill="#fff"/><path d="${
|
|
2644
|
+
function qr(e, t = 18) {
|
|
2645
|
+
let n = `wardley-icon-strike-gap-${++Wr}`;
|
|
2646
|
+
return `<svg viewBox="0 0 24 24" width="${Number(t)}" height="${Number(t)}" fill="currentColor" aria-hidden="true"><mask id="${n}" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><rect width="24" height="24" fill="#fff"/><path d="${Ur}" fill="#000"/></mask><path d="${Kr(e)}" mask="url(#${n})"/><path d="${Gr}"/></svg>`;
|
|
2647
2647
|
}
|
|
2648
|
-
function
|
|
2649
|
-
return `<svg viewBox="0 0 24 24" width="${Number(t)}" height="${Number(t)}" fill="currentColor" aria-hidden="true"><path d="${
|
|
2648
|
+
function R(e, t = 18) {
|
|
2649
|
+
return `<svg viewBox="0 0 24 24" width="${Number(t)}" height="${Number(t)}" fill="currentColor" aria-hidden="true"><path d="${Kr(e)}"/></svg>`;
|
|
2650
2650
|
}
|
|
2651
|
-
var
|
|
2652
|
-
function
|
|
2651
|
+
var Jr = 7.5;
|
|
2652
|
+
function Yr(e, t) {
|
|
2653
2653
|
let n = e.movement;
|
|
2654
2654
|
if (!n) return;
|
|
2655
2655
|
let r = t.toCanvas({
|
|
@@ -2661,26 +2661,26 @@ function Jr(e, t) {
|
|
|
2661
2661
|
evolution: n.targetEvolution
|
|
2662
2662
|
}).x - r.x;
|
|
2663
2663
|
}
|
|
2664
|
-
function
|
|
2665
|
-
return (e ?? "").length *
|
|
2664
|
+
function Xr(e) {
|
|
2665
|
+
return (e ?? "").length * Jr;
|
|
2666
2666
|
}
|
|
2667
|
-
function
|
|
2667
|
+
function Zr() {
|
|
2668
2668
|
return {
|
|
2669
2669
|
x: 22,
|
|
2670
2670
|
y: -4
|
|
2671
2671
|
};
|
|
2672
2672
|
}
|
|
2673
|
-
function Zr(e, t) {
|
|
2674
|
-
return t > 0 && t < Yr(e.wardleyLabel) + 30 + 14;
|
|
2675
|
-
}
|
|
2676
2673
|
function Qr(e, t) {
|
|
2677
|
-
|
|
2674
|
+
return t > 0 && t < Xr(e.wardleyLabel) + 30 + 14;
|
|
2675
|
+
}
|
|
2676
|
+
function $r(e, t) {
|
|
2677
|
+
let n = Zr();
|
|
2678
2678
|
if (e.labelOffset) return {
|
|
2679
2679
|
x: n.x + e.labelOffset.dx,
|
|
2680
2680
|
y: n.y + e.labelOffset.dy,
|
|
2681
2681
|
anchor: "start"
|
|
2682
2682
|
};
|
|
2683
|
-
if (t !== void 0 &&
|
|
2683
|
+
if (t !== void 0 && Qr(e, t)) return {
|
|
2684
2684
|
x: -n.x,
|
|
2685
2685
|
y: n.y,
|
|
2686
2686
|
anchor: "end"
|
|
@@ -2692,14 +2692,14 @@ function Qr(e, t) {
|
|
|
2692
2692
|
anchor: "start"
|
|
2693
2693
|
};
|
|
2694
2694
|
}
|
|
2695
|
-
function
|
|
2695
|
+
function ei(e) {
|
|
2696
2696
|
return {
|
|
2697
2697
|
x: e + 15 + 7,
|
|
2698
2698
|
y: -4
|
|
2699
2699
|
};
|
|
2700
2700
|
}
|
|
2701
|
-
function
|
|
2702
|
-
let n =
|
|
2701
|
+
function ti(e, t) {
|
|
2702
|
+
let n = ei(t);
|
|
2703
2703
|
return e ? {
|
|
2704
2704
|
x: n.x + e.dx,
|
|
2705
2705
|
y: n.y + e.dy,
|
|
@@ -2714,21 +2714,21 @@ function ei(e, t) {
|
|
|
2714
2714
|
anchor: "start"
|
|
2715
2715
|
};
|
|
2716
2716
|
}
|
|
2717
|
-
function
|
|
2717
|
+
function ni() {
|
|
2718
2718
|
return {
|
|
2719
2719
|
x: 0,
|
|
2720
2720
|
y: -17
|
|
2721
2721
|
};
|
|
2722
2722
|
}
|
|
2723
|
-
function
|
|
2724
|
-
let t =
|
|
2723
|
+
function ri(e) {
|
|
2724
|
+
let t = ni();
|
|
2725
2725
|
return {
|
|
2726
2726
|
x: t.x + (e.labelOffset?.dx ?? 0),
|
|
2727
2727
|
y: t.y + (e.labelOffset?.dy ?? 0),
|
|
2728
2728
|
anchor: "middle"
|
|
2729
2729
|
};
|
|
2730
2730
|
}
|
|
2731
|
-
function
|
|
2731
|
+
function ii(e, t) {
|
|
2732
2732
|
let n = (e) => Math.max(-200, Math.min(200, Math.round(e))), r = {
|
|
2733
2733
|
dx: n(e) || 0,
|
|
2734
2734
|
dy: n(t) || 0
|
|
@@ -2737,7 +2737,7 @@ function ri(e, t) {
|
|
|
2737
2737
|
}
|
|
2738
2738
|
//#endregion
|
|
2739
2739
|
//#region src/draw/WardleyRenderer.ts
|
|
2740
|
-
var
|
|
2740
|
+
var ai = 1500, z = "wardley-name-label", oi = "wardley-movement", si = "wardley-label-handle", ci = "data-label-role", li = 6, ui = class extends ge {
|
|
2741
2741
|
grid;
|
|
2742
2742
|
elementRegistry;
|
|
2743
2743
|
static $inject = [
|
|
@@ -2746,7 +2746,7 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2746
2746
|
"elementRegistry"
|
|
2747
2747
|
];
|
|
2748
2748
|
constructor(e, t, n) {
|
|
2749
|
-
super(e,
|
|
2749
|
+
super(e, ai), this.grid = t, this.elementRegistry = n;
|
|
2750
2750
|
}
|
|
2751
2751
|
canRender(e) {
|
|
2752
2752
|
return j(e) || M(e);
|
|
@@ -2807,7 +2807,7 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2807
2807
|
return t ? `M${t.x},${t.y}` + n.map((e) => `L${e.x},${e.y}`).join("") : "";
|
|
2808
2808
|
}
|
|
2809
2809
|
drawComponent(e, t) {
|
|
2810
|
-
let n = t.width / 2, r = t.height / 2, i = t.decorators, a =
|
|
2810
|
+
let n = t.width / 2, r = t.height / 2, i = t.decorators, a = Yr(t, this.grid);
|
|
2811
2811
|
a !== void 0 && this.drawMovement(e, t, n, r, a), i?.inertia && di(e, n, r);
|
|
2812
2812
|
let o = t.color ?? k.stroke, s = B(n, r, 15, {
|
|
2813
2813
|
fill: k.componentFill,
|
|
@@ -2818,7 +2818,7 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2818
2818
|
fill: "none",
|
|
2819
2819
|
stroke: o,
|
|
2820
2820
|
"stroke-width": 1.5
|
|
2821
|
-
})), fi(e, n, r, o, i), pi(e, t, n, r,
|
|
2821
|
+
})), fi(e, n, r, o, i), pi(e, t, n, r, $r(t, a)), s;
|
|
2822
2822
|
}
|
|
2823
2823
|
drawMovement(e, t, n, r, i) {
|
|
2824
2824
|
let a = t.movement;
|
|
@@ -2847,7 +2847,7 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2847
2847
|
"stroke-width": 2,
|
|
2848
2848
|
class: "wardley-evolve-handle"
|
|
2849
2849
|
}));
|
|
2850
|
-
let l =
|
|
2850
|
+
let l = ti(a.labelOffset, i);
|
|
2851
2851
|
C(o, V(a.newLabel ?? t.wardleyLabel, n + l.x, r + l.y, {
|
|
2852
2852
|
"font-weight": "500",
|
|
2853
2853
|
fill: k.movement,
|
|
@@ -2861,13 +2861,13 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2861
2861
|
}));
|
|
2862
2862
|
}
|
|
2863
2863
|
drawAnchor(e, t) {
|
|
2864
|
-
let n = t.width / 2, r = t.height / 2, i =
|
|
2864
|
+
let n = t.width / 2, r = t.height / 2, i = Hr(kr, n, r, 26, t.color ?? k.ink);
|
|
2865
2865
|
C(e, i);
|
|
2866
|
-
let a =
|
|
2866
|
+
let a = ri(t);
|
|
2867
2867
|
return C(e, V(t.wardleyLabel, n + a.x, r + a.y, {
|
|
2868
2868
|
"text-anchor": a.anchor,
|
|
2869
2869
|
"font-weight": "700",
|
|
2870
|
-
class: `${
|
|
2870
|
+
class: `${z} ${si}`,
|
|
2871
2871
|
[ci]: "name",
|
|
2872
2872
|
...t.color ? { fill: t.color } : {}
|
|
2873
2873
|
})), i;
|
|
@@ -2894,14 +2894,14 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2894
2894
|
"stroke-width": 2
|
|
2895
2895
|
})), C(e, V(t.wardleyLabel, n / 2 + 8 + 6, -4, {
|
|
2896
2896
|
"font-weight": "500",
|
|
2897
|
-
class:
|
|
2897
|
+
class: z,
|
|
2898
2898
|
...r ? { fill: r } : {}
|
|
2899
2899
|
}))), i;
|
|
2900
2900
|
}
|
|
2901
2901
|
drawNote(e, t) {
|
|
2902
2902
|
let n = t.color, r = (t.wardleyLabel ?? "").split("\n"), i = t.width / 2, a = t.height / 2 - (r.length - 1) * 17 / 2 + 4, o = {
|
|
2903
2903
|
"text-anchor": "middle",
|
|
2904
|
-
class:
|
|
2904
|
+
class: z,
|
|
2905
2905
|
fill: n ?? k.noteText,
|
|
2906
2906
|
"font-style": "italic",
|
|
2907
2907
|
...n ? { "font-weight": "600" } : {}
|
|
@@ -2951,10 +2951,10 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2951
2951
|
})), i;
|
|
2952
2952
|
}
|
|
2953
2953
|
drawAccelerator(e, t) {
|
|
2954
|
-
let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a =
|
|
2954
|
+
let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a = Hr(i ? Lr : Rr, n, r, 24, t.color ?? (i ? k.accelerator : k.deaccelerator));
|
|
2955
2955
|
return C(e, a), t.wardleyLabel && C(e, V(t.wardleyLabel, n + 15, r + 5, {
|
|
2956
2956
|
"font-size": 12,
|
|
2957
|
-
class:
|
|
2957
|
+
class: z
|
|
2958
2958
|
})), a;
|
|
2959
2959
|
}
|
|
2960
2960
|
drawSubmap(e, t) {
|
|
@@ -2979,7 +2979,7 @@ var ii = 1500, ai = "wardley-name-label", oi = "wardley-movement", si = "wardley
|
|
|
2979
2979
|
"stroke-width": 1
|
|
2980
2980
|
})), C(e, V(t.wardleyLabel, n + 16 + 6, r - 6, {
|
|
2981
2981
|
"font-weight": "500",
|
|
2982
|
-
class:
|
|
2982
|
+
class: z,
|
|
2983
2983
|
...t.color ? { fill: t.color } : {}
|
|
2984
2984
|
})), a;
|
|
2985
2985
|
}
|
|
@@ -3010,7 +3010,7 @@ function pi(e, t, n, r, i) {
|
|
|
3010
3010
|
C(e, V(t.wardleyLabel, a, o, {
|
|
3011
3011
|
"font-weight": "500",
|
|
3012
3012
|
"text-anchor": i.anchor,
|
|
3013
|
-
class: `${
|
|
3013
|
+
class: `${z} ${si}`,
|
|
3014
3014
|
[ci]: "name",
|
|
3015
3015
|
...t.color ? { fill: t.color } : {}
|
|
3016
3016
|
}));
|
|
@@ -3075,7 +3075,7 @@ function _i(e) {
|
|
|
3075
3075
|
};
|
|
3076
3076
|
return [e, r[r.length - 1] ?? e];
|
|
3077
3077
|
}
|
|
3078
|
-
let i =
|
|
3078
|
+
let i = I(t), a = I(n), o = a.x - i.x, s = a.y - i.y, c = Math.hypot(o, s) || 1, l = o / c, u = s / c, d = gi(t), f = gi(n);
|
|
3079
3079
|
return c <= d + f + 2 ? [i, a] : [{
|
|
3080
3080
|
x: i.x + l * d,
|
|
3081
3081
|
y: i.y + u * d
|
|
@@ -3089,11 +3089,11 @@ function _i(e) {
|
|
|
3089
3089
|
var vi = {
|
|
3090
3090
|
__init__: ["wardleyRenderer"],
|
|
3091
3091
|
wardleyRenderer: ["type", ui]
|
|
3092
|
-
}, yi = class extends
|
|
3092
|
+
}, yi = class extends en {
|
|
3093
3093
|
_getModules() {
|
|
3094
3094
|
return [
|
|
3095
|
-
|
|
3096
|
-
|
|
3095
|
+
cn,
|
|
3096
|
+
Dr,
|
|
3097
3097
|
vi,
|
|
3098
3098
|
mt
|
|
3099
3099
|
];
|
|
@@ -3344,12 +3344,12 @@ var Bi = class extends ce {
|
|
|
3344
3344
|
component: H(Ki()),
|
|
3345
3345
|
market: H(Ki(`<circle cx="12" cy="10" r="1.4" fill="${k.stroke}"/><circle cx="10.2" cy="13.4" r="1.4" fill="${k.stroke}"/><circle cx="13.8" cy="13.4" r="1.4" fill="${k.stroke}"/>`)),
|
|
3346
3346
|
ecosystem: H(Ki(`<circle cx="12" cy="12" r="10" fill="none" stroke="${k.stroke}" stroke-width="1.25" stroke-dasharray="1.5 3" stroke-linecap="round"/>`)),
|
|
3347
|
-
anchor: H(`<path d="${
|
|
3347
|
+
anchor: H(`<path d="${kr}" fill="${k.ink}"/>`),
|
|
3348
3348
|
pipeline: H(`<rect x="9.5" y="2.5" width="5.5" height="5.5" fill="${k.componentFill}" stroke="${k.stroke}" stroke-width="1.5"/><rect x="2" y="10" width="20" height="9" rx="2" fill="none" stroke="${k.pipeline}" stroke-width="1.25" stroke-dasharray="3 2"/><circle cx="7" cy="14.5" r="2.2" fill="${k.componentFill}" stroke="${k.stroke}" stroke-width="1.2"/><circle cx="17" cy="14.5" r="2.2" fill="${k.componentFill}" stroke="${k.stroke}" stroke-width="1.2"/>`),
|
|
3349
3349
|
note: H(`<g fill="none" stroke="${k.noteText}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 4h14v11l-5 5H5z" fill="${k.componentFill}"/><path d="M14 20v-5h5"/><line x1="8" y1="8.5" x2="16" y2="8.5"/><line x1="8" y1="12" x2="13" y2="12"/></g>`),
|
|
3350
3350
|
annotation: H(`<circle cx="12" cy="12" r="8" fill="${k.annotationFill}" stroke="${k.stroke}" stroke-width="1.25"/>` + qi("1", `y="16" font-size="11" font-weight="700" fill="${k.stroke}"`)),
|
|
3351
|
-
accelerator: H(`<path d="${
|
|
3352
|
-
deaccelerator: H(`<path d="${
|
|
3351
|
+
accelerator: H(`<path d="${Lr}" fill="${k.accelerator}"/>`),
|
|
3352
|
+
deaccelerator: H(`<path d="${Rr}" fill="${k.deaccelerator}"/>`),
|
|
3353
3353
|
submap: H(`<rect x="4" y="4" width="16" height="16" rx="3" fill="${k.componentFill}" stroke="${k.stroke}" stroke-width="2"/><rect x="7.5" y="7.5" width="9" height="9" rx="1.5" fill="none" stroke="${k.stroke}" stroke-width="1"/>`)
|
|
3354
3354
|
}, Ji = {
|
|
3355
3355
|
pioneers: "P",
|
|
@@ -3729,7 +3729,7 @@ var Aa = class {
|
|
|
3729
3729
|
selection;
|
|
3730
3730
|
locked;
|
|
3731
3731
|
constructor(e, t, n, r, i) {
|
|
3732
|
-
this.eventBus = e, this.canvas = t, this.modeling = n, this.factory = r,
|
|
3732
|
+
this.eventBus = e, this.canvas = t, this.modeling = n, this.factory = r, wn(), this.contextPad = i.get("contextPad", !1) ?? null, this.selection = i.get("selection", !1) ?? null, this.locked = () => F(i), e.on("element.dblclick", (e) => {
|
|
3733
3733
|
j(e.element) ? this.activate(e.element) : M(e.element) && this.activateConnection(e.element);
|
|
3734
3734
|
}), e.on(["element.mousedown", "drag.init"], () => this.active?.commit("outside")), e.on("canvas.viewbox.changing", () => this.relayoutAfterViewChange()), e.on("canvas.viewbox.changed", () => this.active?.relayout()), e.on(["shape.changed", "connection.changed"], va, (e) => {
|
|
3735
3735
|
this.active && e.element?.id === this.active.elementId && this.active.relayout();
|
|
@@ -3740,7 +3740,7 @@ var Aa = class {
|
|
|
3740
3740
|
activate(e, t = {}) {
|
|
3741
3741
|
if (!j(e) || _a.has(e.wardleyType) || this.locked()) return;
|
|
3742
3742
|
this.active?.commit("outside");
|
|
3743
|
-
let n = this.canvas.getContainer(), r = e.wardleyType === "note", i =
|
|
3743
|
+
let n = this.canvas.getContainer(), r = e.wardleyType === "note", i = Tn(), a = this.factory.isLinkable(e.wardleyType), o = this.nameLabelElements(e), s = [...o.classedByFallback], c = this.labelGeometry(e, o.labelElements), l = (e) => Math.max(e * Sa, r ? 17 * this.canvas.zoom() : 0), u = l(c.fontSize), d = ja(r, t.value ?? e.wardleyLabel ?? "", c, u), f = r ? Na("wardley-label-hint", Ta) : void 0, p = () => {
|
|
3744
3744
|
let { left: e, top: t, width: n, height: i } = Ma(d.value, c, u, r);
|
|
3745
3745
|
Object.assign(d.style, {
|
|
3746
3746
|
left: `${e}px`,
|
|
@@ -3871,7 +3871,7 @@ var Aa = class {
|
|
|
3871
3871
|
};
|
|
3872
3872
|
}
|
|
3873
3873
|
returnToCanvas(e, t) {
|
|
3874
|
-
t ?
|
|
3874
|
+
t ? xn(this.canvas) : this.canvas.restoreFocus();
|
|
3875
3875
|
let n = this.selection?.get() ?? [];
|
|
3876
3876
|
n.length === 1 && n[0] === e && this.contextPad?.open(e);
|
|
3877
3877
|
}
|
|
@@ -4024,7 +4024,7 @@ var qa = class {
|
|
|
4024
4024
|
return n ? i[r] = n : delete i[r], this.modeling.updateProperties(e, { businessObject: i }), !0;
|
|
4025
4025
|
}
|
|
4026
4026
|
activate(e, t = {}) {
|
|
4027
|
-
if (!Ga(e) ||
|
|
4027
|
+
if (!Ga(e) || F(this.injector)) return;
|
|
4028
4028
|
this.active?.commit();
|
|
4029
4029
|
let n = this.canvas.getContainer(), r = document.createElement("input");
|
|
4030
4030
|
r.type = "text", r.inputMode = "url", r.spellcheck = !1, r.autocomplete = "off", r.className = "wardley-label-input wardley-link-input", r.placeholder = "https://… or ./other.wmap", r.setAttribute("aria-label", `Link of ${e.wardleyLabel || e.wardleyType}`), r.value = t.value ?? Ka(e) ?? "", r.style.position = "absolute";
|
|
@@ -4208,14 +4208,14 @@ var co = {
|
|
|
4208
4208
|
});
|
|
4209
4209
|
}
|
|
4210
4210
|
getContextPadEntries(e) {
|
|
4211
|
-
if (
|
|
4211
|
+
if (F(this.injector)) return {};
|
|
4212
4212
|
if (M(e)) return this.connectionEntries(e);
|
|
4213
4213
|
if (!j(e)) return {};
|
|
4214
4214
|
let t = e, n = {};
|
|
4215
4215
|
return this.addPrimaryEntries(t, n), this.addPropertyEntries(t, n), n.delete = {
|
|
4216
4216
|
group: ro,
|
|
4217
4217
|
title: "Delete",
|
|
4218
|
-
html: Y(
|
|
4218
|
+
html: Y(R(Pr), "Delete"),
|
|
4219
4219
|
action: { click: () => this.modeling.removeElements([t]) }
|
|
4220
4220
|
}, n;
|
|
4221
4221
|
}
|
|
@@ -4225,13 +4225,13 @@ var co = {
|
|
|
4225
4225
|
"edit-value": {
|
|
4226
4226
|
group: J,
|
|
4227
4227
|
title: t,
|
|
4228
|
-
html: Y(
|
|
4228
|
+
html: Y(R(Nr), t),
|
|
4229
4229
|
action: { click: () => this.labelEditing.activateConnection(e) }
|
|
4230
4230
|
},
|
|
4231
4231
|
delete: {
|
|
4232
4232
|
group: ro,
|
|
4233
4233
|
title: "Delete connection",
|
|
4234
|
-
html: Y(
|
|
4234
|
+
html: Y(R(Pr), "Delete connection"),
|
|
4235
4235
|
action: { click: () => this.modeling.removeElements([e]) }
|
|
4236
4236
|
}
|
|
4237
4237
|
};
|
|
@@ -4240,7 +4240,7 @@ var co = {
|
|
|
4240
4240
|
if (e.wardleyType !== "drawing" && e.wardleyType !== "attitude" && (t["edit-label"] = {
|
|
4241
4241
|
group: J,
|
|
4242
4242
|
title: "Edit label",
|
|
4243
|
-
html: Y(
|
|
4243
|
+
html: Y(R(Nr), "Edit label"),
|
|
4244
4244
|
action: { click: () => this.labelEditing.activate(e) }
|
|
4245
4245
|
}), e.wardleyType === "component" || e.wardleyType === "anchor" || e.wardleyType === "submap" || e.wardleyType === "pipeline") {
|
|
4246
4246
|
let n = (t) => {
|
|
@@ -4254,7 +4254,7 @@ var co = {
|
|
|
4254
4254
|
t.append = {
|
|
4255
4255
|
group: J,
|
|
4256
4256
|
title: "Append component (auto-connect)",
|
|
4257
|
-
html: Y(
|
|
4257
|
+
html: Y(R(Ar), "Append component", !0),
|
|
4258
4258
|
action: {
|
|
4259
4259
|
click: n,
|
|
4260
4260
|
dragstart: n
|
|
@@ -4266,7 +4266,7 @@ var co = {
|
|
|
4266
4266
|
t.connect = {
|
|
4267
4267
|
group: J,
|
|
4268
4268
|
title: "Connect to existing element (A)",
|
|
4269
|
-
html: Y(
|
|
4269
|
+
html: Y(R(jr), "Connect to existing element (A)", !0),
|
|
4270
4270
|
action: {
|
|
4271
4271
|
click: r,
|
|
4272
4272
|
dragstart: r
|
|
@@ -4277,7 +4277,7 @@ var co = {
|
|
|
4277
4277
|
if (e.movement) t["evolve-clear"] = {
|
|
4278
4278
|
group: J,
|
|
4279
4279
|
title: "Remove evolve",
|
|
4280
|
-
html: Y(
|
|
4280
|
+
html: Y(qr(Mr), "Remove evolve"),
|
|
4281
4281
|
action: { click: () => this.wardleyModeling.clearMovement(e) }
|
|
4282
4282
|
};
|
|
4283
4283
|
else if (e.evolution < .999) {
|
|
@@ -4285,7 +4285,7 @@ var co = {
|
|
|
4285
4285
|
t.evolve = {
|
|
4286
4286
|
group: J,
|
|
4287
4287
|
title: "Evolve: drag to set the target maturity",
|
|
4288
|
-
html: Y(
|
|
4288
|
+
html: Y(R(Mr), "Evolve: drag to set the target maturity", !0),
|
|
4289
4289
|
action: {
|
|
4290
4290
|
click: n,
|
|
4291
4291
|
dragstart: n
|
|
@@ -4298,7 +4298,7 @@ var co = {
|
|
|
4298
4298
|
if (e.wardleyType === "component" && (t.settings = {
|
|
4299
4299
|
group: no,
|
|
4300
4300
|
title: "Settings (type, sourcing, inertia)",
|
|
4301
|
-
html: Y(
|
|
4301
|
+
html: Y(R(Fr), "Settings (type, sourcing, inertia)"),
|
|
4302
4302
|
action: { click: (t) => {
|
|
4303
4303
|
let n = t;
|
|
4304
4304
|
this.popupMenu.open(e, Ya, {
|
|
@@ -4311,14 +4311,14 @@ var co = {
|
|
|
4311
4311
|
t["stroke-style"] = {
|
|
4312
4312
|
group: no,
|
|
4313
4313
|
title: r,
|
|
4314
|
-
html: Y(
|
|
4314
|
+
html: Y(R(zr), r),
|
|
4315
4315
|
action: { click: () => this.wardleyModeling.updateProperties(e, { strokeStyle: n }) }
|
|
4316
4316
|
};
|
|
4317
4317
|
}
|
|
4318
4318
|
t.color = {
|
|
4319
4319
|
group: no,
|
|
4320
4320
|
title: "Color",
|
|
4321
|
-
html: Y(
|
|
4321
|
+
html: Y(R(Ir), "Color"),
|
|
4322
4322
|
action: { click: (t) => {
|
|
4323
4323
|
let n = t;
|
|
4324
4324
|
this.colorPicker.open(e, n.clientX, n.clientY);
|
|
@@ -4330,7 +4330,7 @@ var co = {
|
|
|
4330
4330
|
t.link = {
|
|
4331
4331
|
group: no,
|
|
4332
4332
|
title: i,
|
|
4333
|
-
html: Y(
|
|
4333
|
+
html: Y(R(Vr), i),
|
|
4334
4334
|
action: { click: () => n.activate(e) }
|
|
4335
4335
|
};
|
|
4336
4336
|
}
|
|
@@ -4338,7 +4338,7 @@ var co = {
|
|
|
4338
4338
|
i && (t["open-link"] = {
|
|
4339
4339
|
group: no,
|
|
4340
4340
|
title: `Open link (${i})`,
|
|
4341
|
-
html: Y(
|
|
4341
|
+
html: Y(R(Br), `Open link (${i})`),
|
|
4342
4342
|
action: { click: () => window.open(i, "_blank", "noopener,noreferrer") }
|
|
4343
4343
|
});
|
|
4344
4344
|
}
|
|
@@ -4500,7 +4500,7 @@ var Co = class {
|
|
|
4500
4500
|
}, 0));
|
|
4501
4501
|
}, w = (e) => {
|
|
4502
4502
|
x !== void 0 && e.defaultPrevented && (clearTimeout(x), x = void 0);
|
|
4503
|
-
}, oe = () =>
|
|
4503
|
+
}, oe = () => F(d), T = (e, r) => {
|
|
4504
4504
|
if (!oe() || ["a", "c"].includes(r)) {
|
|
4505
4505
|
if (r === "z" || r === "y") {
|
|
4506
4506
|
if (!m) return;
|
|
@@ -4684,7 +4684,7 @@ var To = {
|
|
|
4684
4684
|
], () => this.close());
|
|
4685
4685
|
}
|
|
4686
4686
|
open(e, t, n) {
|
|
4687
|
-
if (this.close(),
|
|
4687
|
+
if (this.close(), F(this.injector)) return;
|
|
4688
4688
|
let r = this.canvas.getContainer(), i = r.getBoundingClientRect(), a = document.createElement("div");
|
|
4689
4689
|
a.className = "wardley-color-picker", a.setAttribute("role", "dialog"), a.setAttribute("aria-label", "Color");
|
|
4690
4690
|
let o = [{
|
|
@@ -4788,7 +4788,7 @@ var Po = class extends Ne {
|
|
|
4788
4788
|
return e.closest(".wardley-container") ?? e;
|
|
4789
4789
|
}
|
|
4790
4790
|
activate() {
|
|
4791
|
-
if (this.active ||
|
|
4791
|
+
if (this.active || F(this.injector)) return;
|
|
4792
4792
|
this.active = !0, this.points = [], this.cursor = null;
|
|
4793
4793
|
let e = this.canvas.getContainer();
|
|
4794
4794
|
this.outerContainer().classList.add("wardley-draw-mode"), e.addEventListener("mousedown", this.onMouseDown, !0), e.addEventListener("dblclick", this.onDblClick, !0), e.addEventListener("mousemove", this.onMouseMove, !0), document.addEventListener("keydown", this.onKeyDown, !0), this.eventBus.fire("tool-manager.update", { tool: "draw" });
|
|
@@ -4942,7 +4942,7 @@ var zo = class {
|
|
|
4942
4942
|
}), C(e, t), this.group = t;
|
|
4943
4943
|
}
|
|
4944
4944
|
startDrag(e, t) {
|
|
4945
|
-
if (e.button !== 0 || !this.shape ||
|
|
4945
|
+
if (e.button !== 0 || !this.shape || F(this.injector)) return;
|
|
4946
4946
|
e.preventDefault(), e.stopPropagation();
|
|
4947
4947
|
let n = this.shape, r = this.absolutePoints(), i = (e) => {
|
|
4948
4948
|
r[t] = this.toCanvasPoint(e), this.renderDragPreview(r, !!n.closed);
|
|
@@ -5060,12 +5060,12 @@ var Uo = {
|
|
|
5060
5060
|
t === "movement" ? e.movement?.labelOffset && this.commitMovementOffset(e, void 0) : e.labelOffset && this.commitNameOffset(e, void 0);
|
|
5061
5061
|
}
|
|
5062
5062
|
onMouseDown = (e) => {
|
|
5063
|
-
if (e.button !== 0 || this.outerContainer().classList.contains("wardley-draw-mode") ||
|
|
5063
|
+
if (e.button !== 0 || this.outerContainer().classList.contains("wardley-draw-mode") || F(this.injector)) return;
|
|
5064
5064
|
let t = this.labelTarget(e);
|
|
5065
5065
|
if (!t) return;
|
|
5066
5066
|
e.stopPropagation(), e.preventDefault();
|
|
5067
5067
|
let n = document.activeElement;
|
|
5068
|
-
n instanceof HTMLElement && this.outerContainer().contains(n) && n.blur(),
|
|
5068
|
+
n instanceof HTMLElement && this.outerContainer().contains(n) && n.blur(), xn(this.canvas);
|
|
5069
5069
|
let { shape: r, role: i, handle: a } = t, o = this.renderedOffset(r, i, a);
|
|
5070
5070
|
this.active = {
|
|
5071
5071
|
shape: r,
|
|
@@ -5112,7 +5112,7 @@ var Uo = {
|
|
|
5112
5112
|
e.key === "Escape" && this.active && (e.stopPropagation(), this.cancel());
|
|
5113
5113
|
};
|
|
5114
5114
|
onDoubleClick = (e) => {
|
|
5115
|
-
if (!e.altKey ||
|
|
5115
|
+
if (!e.altKey || F(this.injector)) return;
|
|
5116
5116
|
let t = this.labelTarget(e);
|
|
5117
5117
|
t && (e.stopPropagation(), e.preventDefault(), this.resetLabelOffset(t.shape, t.role));
|
|
5118
5118
|
};
|
|
@@ -5130,7 +5130,7 @@ var Uo = {
|
|
|
5130
5130
|
}), this.eventBus.fire("element.changed", { element: e.shape });
|
|
5131
5131
|
}
|
|
5132
5132
|
snapHome(e, t) {
|
|
5133
|
-
return Math.abs(e.dx - t.dx) <= Go && Math.abs(e.dy - t.dy) <= Go ? void 0 :
|
|
5133
|
+
return Math.abs(e.dx - t.dx) <= Go && Math.abs(e.dy - t.dy) <= Go ? void 0 : ii(e.dx, e.dy);
|
|
5134
5134
|
}
|
|
5135
5135
|
commitNameOffset(e, t) {
|
|
5136
5136
|
let n = { labelOffset: t }, r = e.businessObject;
|
|
@@ -5157,14 +5157,14 @@ var Uo = {
|
|
|
5157
5157
|
dx: 0,
|
|
5158
5158
|
dy: 0
|
|
5159
5159
|
};
|
|
5160
|
-
let r =
|
|
5160
|
+
let r = Yr(e, this.grid);
|
|
5161
5161
|
return t === "movement" ? r === void 0 ? {
|
|
5162
5162
|
dx: 0,
|
|
5163
5163
|
dy: 0
|
|
5164
|
-
} : Yo(
|
|
5164
|
+
} : Yo(ti(void 0, r), ei(r), n, e) : Yo($r({
|
|
5165
5165
|
...e,
|
|
5166
5166
|
labelOffset: void 0
|
|
5167
|
-
}, r),
|
|
5167
|
+
}, r), Zr(), n, e);
|
|
5168
5168
|
}
|
|
5169
5169
|
labelTarget(e) {
|
|
5170
5170
|
let t = e.target?.closest?.(`.${si}`);
|
|
@@ -5198,12 +5198,12 @@ function Xo(e, t) {
|
|
|
5198
5198
|
var Zo = {
|
|
5199
5199
|
__init__: ["wardleyLabelDragging"],
|
|
5200
5200
|
wardleyLabelDragging: ["type", Jo]
|
|
5201
|
-
}, Qo = { autoScroll: ["type",
|
|
5201
|
+
}, Qo = { autoScroll: ["type", Gt] }, $o = class extends Ni {
|
|
5202
5202
|
_getModules() {
|
|
5203
5203
|
return [
|
|
5204
5204
|
...super._getModules(),
|
|
5205
5205
|
pe,
|
|
5206
|
-
|
|
5206
|
+
nn,
|
|
5207
5207
|
Ee,
|
|
5208
5208
|
xe,
|
|
5209
5209
|
Se,
|
|
@@ -5215,27 +5215,27 @@ var Zo = {
|
|
|
5215
5215
|
De,
|
|
5216
5216
|
Oe,
|
|
5217
5217
|
ke,
|
|
5218
|
-
|
|
5218
|
+
Er,
|
|
5219
5219
|
Vi,
|
|
5220
|
-
|
|
5220
|
+
Or,
|
|
5221
5221
|
Hi,
|
|
5222
5222
|
ca,
|
|
5223
5223
|
co,
|
|
5224
5224
|
Pa,
|
|
5225
5225
|
To,
|
|
5226
|
-
|
|
5226
|
+
Mn,
|
|
5227
5227
|
to,
|
|
5228
5228
|
ko,
|
|
5229
5229
|
Mo,
|
|
5230
5230
|
Fi,
|
|
5231
5231
|
Fo,
|
|
5232
5232
|
Uo,
|
|
5233
|
-
|
|
5234
|
-
|
|
5233
|
+
Jn,
|
|
5234
|
+
qt,
|
|
5235
5235
|
Ja,
|
|
5236
|
-
|
|
5236
|
+
Dn,
|
|
5237
5237
|
Zo,
|
|
5238
|
-
|
|
5238
|
+
Ot
|
|
5239
5239
|
];
|
|
5240
5240
|
}
|
|
5241
5241
|
commitPendingEdits() {
|
|
@@ -5328,7 +5328,7 @@ function is(e, t, n = {}) {
|
|
|
5328
5328
|
value: u.value,
|
|
5329
5329
|
...u.selection ? { selection: u.selection } : {}
|
|
5330
5330
|
}), !0) : !1;
|
|
5331
|
-
})() ||
|
|
5331
|
+
})() || xn(e.get("canvas"));
|
|
5332
5332
|
}
|
|
5333
5333
|
//#endregion
|
|
5334
5334
|
//#region src/collaborative/CollaborativeWardley.ts
|
|
@@ -5390,38 +5390,38 @@ function ds(e, t) {
|
|
|
5390
5390
|
};
|
|
5391
5391
|
}
|
|
5392
5392
|
function fs(e, t) {
|
|
5393
|
-
let n = e.get("eventBus"), r = e.get("canvas"), i = e.get("elementRegistry"), a = e.get("selection"), o = ds(e, n),
|
|
5393
|
+
let n = e.get("eventBus"), r = e.get("canvas"), i = e.get("elementRegistry"), a = e.get("selection"), o = e.get("panConstraint"), s = ds(e, n), c = t ? e.get("wardleyLivePreview") : void 0, l = /* @__PURE__ */ new Set(), u = 0, d = !1, f = !1, p = "", m = {
|
|
5394
5394
|
notation: as,
|
|
5395
5395
|
apiVersion: Pe,
|
|
5396
5396
|
editable: t
|
|
5397
5397
|
};
|
|
5398
5398
|
t && n.on("commandStack.changed", () => {
|
|
5399
|
-
if (!(
|
|
5399
|
+
if (!(u > 0)) for (let e of [...l]) e();
|
|
5400
5400
|
});
|
|
5401
|
-
let
|
|
5402
|
-
let t =
|
|
5401
|
+
let h = (e) => e.filter(ss).map((e) => s.of(e.id)), g = (e) => {
|
|
5402
|
+
let t = s.of(e.id);
|
|
5403
5403
|
return e.wardleyLabel ? {
|
|
5404
5404
|
id: t,
|
|
5405
5405
|
name: e.wardleyLabel
|
|
5406
5406
|
} : { id: t };
|
|
5407
|
-
},
|
|
5408
|
-
if (
|
|
5409
|
-
let t = i.get(
|
|
5410
|
-
return ss(t) &&
|
|
5411
|
-
},
|
|
5412
|
-
list: () =>
|
|
5407
|
+
}, _ = (e) => {
|
|
5408
|
+
if (f) return;
|
|
5409
|
+
let t = i.get(s.canvasIdOf(e));
|
|
5410
|
+
return ss(t) && s.of(t.id) === e ? t : void 0;
|
|
5411
|
+
}, v = {
|
|
5412
|
+
list: () => f ? [] : i.getAll().filter(ss).map(g),
|
|
5413
5413
|
reveal(e) {
|
|
5414
|
-
if (
|
|
5415
|
-
let t = i.get(
|
|
5414
|
+
if (f) return !1;
|
|
5415
|
+
let t = i.get(s.canvasIdOf(e));
|
|
5416
5416
|
return ss(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
|
|
5417
5417
|
},
|
|
5418
|
-
selection: () =>
|
|
5418
|
+
selection: () => f ? [] : h(a.get()),
|
|
5419
5419
|
onSelection(e) {
|
|
5420
|
-
let t = (t) => e(
|
|
5420
|
+
let t = (t) => e(h(t.newSelection ?? []));
|
|
5421
5421
|
return n.on("selection.changed", t), () => n.off("selection.changed", t);
|
|
5422
5422
|
},
|
|
5423
5423
|
bounds(e) {
|
|
5424
|
-
let t =
|
|
5424
|
+
let t = _(e);
|
|
5425
5425
|
if (!t) return;
|
|
5426
5426
|
let { x: n, y: r, width: i, height: a } = t;
|
|
5427
5427
|
return {
|
|
@@ -5431,39 +5431,39 @@ function fs(e, t) {
|
|
|
5431
5431
|
height: a
|
|
5432
5432
|
};
|
|
5433
5433
|
}
|
|
5434
|
-
},
|
|
5435
|
-
let t =
|
|
5434
|
+
}, y = () => {
|
|
5435
|
+
let t = c?.committedMap();
|
|
5436
5436
|
return t ? b(t) : e.exportDSL();
|
|
5437
5437
|
};
|
|
5438
|
-
async function
|
|
5439
|
-
if (
|
|
5440
|
-
|
|
5441
|
-
let r = t &&
|
|
5438
|
+
async function ee(n) {
|
|
5439
|
+
if (f) throw Error("The modeler was destroyed.");
|
|
5440
|
+
u += 1;
|
|
5441
|
+
let r = t && d ? rs(e) : void 0;
|
|
5442
5442
|
try {
|
|
5443
5443
|
let { warnings: t } = await e.importDSL(n);
|
|
5444
|
-
return
|
|
5444
|
+
return d = !0, r && is(e, r), { warnings: t.map((e) => e.message) };
|
|
5445
5445
|
} catch (t) {
|
|
5446
5446
|
throw r && is(e, r, { importRejected: !0 }), t;
|
|
5447
5447
|
} finally {
|
|
5448
|
-
--
|
|
5448
|
+
--u;
|
|
5449
5449
|
}
|
|
5450
5450
|
}
|
|
5451
5451
|
return {
|
|
5452
|
-
meta:
|
|
5453
|
-
elements:
|
|
5452
|
+
meta: m,
|
|
5453
|
+
elements: v,
|
|
5454
5454
|
diagram: e,
|
|
5455
5455
|
attachTo(t) {
|
|
5456
5456
|
e.attachTo(t);
|
|
5457
5457
|
},
|
|
5458
|
-
importText:
|
|
5458
|
+
importText: ee,
|
|
5459
5459
|
exportText() {
|
|
5460
|
-
return
|
|
5460
|
+
return f ? p : y();
|
|
5461
5461
|
},
|
|
5462
5462
|
onContentChanged(e) {
|
|
5463
|
-
return t ? (
|
|
5463
|
+
return t ? (l.add(e), () => l.delete(e)) : () => void 0;
|
|
5464
5464
|
},
|
|
5465
5465
|
getViewState() {
|
|
5466
|
-
if (!
|
|
5466
|
+
if (!f) try {
|
|
5467
5467
|
let { x: e, y: t, width: n, height: i } = r.viewbox(), a = {
|
|
5468
5468
|
x: e,
|
|
5469
5469
|
y: t,
|
|
@@ -5476,21 +5476,31 @@ function fs(e, t) {
|
|
|
5476
5476
|
}
|
|
5477
5477
|
},
|
|
5478
5478
|
setViewState(e) {
|
|
5479
|
-
!
|
|
5479
|
+
!f && ps(e) && r.viewbox({
|
|
5480
5480
|
x: e.x,
|
|
5481
5481
|
y: e.y,
|
|
5482
5482
|
width: e.width,
|
|
5483
5483
|
height: e.height
|
|
5484
5484
|
});
|
|
5485
5485
|
},
|
|
5486
|
+
contentBounds() {
|
|
5487
|
+
if (f) return;
|
|
5488
|
+
let { x: e, y: t, width: n, height: r } = o.contentBounds();
|
|
5489
|
+
return {
|
|
5490
|
+
x: e,
|
|
5491
|
+
y: t,
|
|
5492
|
+
width: n,
|
|
5493
|
+
height: r
|
|
5494
|
+
};
|
|
5495
|
+
},
|
|
5486
5496
|
destroy() {
|
|
5487
|
-
if (!
|
|
5497
|
+
if (!f) {
|
|
5488
5498
|
try {
|
|
5489
|
-
|
|
5499
|
+
p = y();
|
|
5490
5500
|
} catch {
|
|
5491
|
-
|
|
5501
|
+
p = "";
|
|
5492
5502
|
}
|
|
5493
|
-
|
|
5503
|
+
f = !0, l.clear(), e.destroy();
|
|
5494
5504
|
}
|
|
5495
5505
|
}
|
|
5496
5506
|
};
|
|
@@ -5527,7 +5537,7 @@ function gs(e) {
|
|
|
5527
5537
|
return e.transparentPng && t.push(hs("export-png-transparent", X.transparentPng, e.transparentPng)), e.json && t.push(hs("export-json", X.json, e.json)), e.wmap && t.push(hs("export-wmap", X.wmap, e.wmap)), t;
|
|
5528
5538
|
}
|
|
5529
5539
|
function _s(e) {
|
|
5530
|
-
let { mapTitle: t } = e;
|
|
5540
|
+
let { mapTitle: t, shortcutsKey: n } = e;
|
|
5531
5541
|
return {
|
|
5532
5542
|
model: [
|
|
5533
5543
|
...t ? [{
|
|
@@ -5555,6 +5565,7 @@ function _s(e) {
|
|
|
5555
5565
|
id: "keyboard-shortcuts",
|
|
5556
5566
|
label: "Keyboard shortcuts…",
|
|
5557
5567
|
icon: "keyboard",
|
|
5568
|
+
...n ? { shortcut: n } : {},
|
|
5558
5569
|
onSelect: () => e.showKeyboardShortcuts()
|
|
5559
5570
|
}]
|
|
5560
5571
|
};
|
|
@@ -5895,12 +5906,12 @@ function js(e, t) {
|
|
|
5895
5906
|
}), a = (e) => {
|
|
5896
5907
|
e.readOnly && i.close();
|
|
5897
5908
|
};
|
|
5898
|
-
return t.on(
|
|
5909
|
+
return t.on(Ct, a), {
|
|
5899
5910
|
open: () => i.open(),
|
|
5900
5911
|
isOpen: () => i.isOpen(),
|
|
5901
5912
|
close: () => i.close(),
|
|
5902
5913
|
destroy() {
|
|
5903
|
-
t.off(
|
|
5914
|
+
t.off(Ct, a), i.destroy();
|
|
5904
5915
|
}
|
|
5905
5916
|
};
|
|
5906
5917
|
}
|
|
@@ -5956,12 +5967,12 @@ function Ps(e, t) {
|
|
|
5956
5967
|
let n = () => t.end("import"), r = (e) => {
|
|
5957
5968
|
e.readOnly && t.end("cancel");
|
|
5958
5969
|
};
|
|
5959
|
-
return e.on("import.done", n), e.on(
|
|
5970
|
+
return e.on("import.done", n), e.on(Ct, r), {
|
|
5960
5971
|
open: () => t.open(),
|
|
5961
5972
|
isOpen: () => t.isOpen(),
|
|
5962
5973
|
close: () => t.close(),
|
|
5963
5974
|
destroy() {
|
|
5964
|
-
e.off("import.done", n), e.off(
|
|
5975
|
+
e.off("import.done", n), e.off(Ct, r), t.destroy();
|
|
5965
5976
|
}
|
|
5966
5977
|
};
|
|
5967
5978
|
}
|
|
@@ -6091,11 +6102,11 @@ function Vs(e, t) {
|
|
|
6091
6102
|
}
|
|
6092
6103
|
//#endregion
|
|
6093
6104
|
//#region src/draw/deprecated-icons.ts
|
|
6094
|
-
var Hs = "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", Us = "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", Ws = "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", Gs = "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", Ks = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", qs = "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", Js = "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", Ys = "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", Xs = "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", Zs = "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", Qs = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", $s = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", ec = "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", tc =
|
|
6105
|
+
var Hs = "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", Us = "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", Ws = "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", Gs = "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", Ks = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", qs = "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", Js = "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", Ys = "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", Xs = "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", Zs = "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", Qs = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", $s = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", ec = "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", tc = kr, nc = Nr, rc = Pr;
|
|
6095
6106
|
function ic(e, t) {
|
|
6096
|
-
return
|
|
6107
|
+
return R(e, t);
|
|
6097
6108
|
}
|
|
6098
6109
|
//#endregion
|
|
6099
|
-
export { k as COLORS, X as EXPORT_LABELS,
|
|
6110
|
+
export { k as COLORS, X as EXPORT_LABELS, mn as EvolutionGrid, ji as FreeRect, $s as ICON_ADD, Zs as ICON_ASPECT_RATIO, Gs as ICON_CODE, Ws as ICON_DATA_OBJECT, rc as ICON_DELETE, Ks as ICON_DOWNLOAD, nc as ICON_EDIT, Js as ICON_FOLDER_OPEN, Ys as ICON_IMAGE, Qs as ICON_MENU, Xs as ICON_NEW, tc as ICON_PERSON, Us as ICON_REDO, qs as ICON_SHARE, Hs as ICON_UNDO, ec as ICON_VISIBILITY, s as MAP_SIZE_PRESETS, E as MIRAGON, vt as MapProjection, Wt as MapResizeHandles, $o as Modeler, Le as NOTE_COLORS, Ni as NavigatedViewer, D as PLOT, l as PLOT_MAX, d as PLOT_MIN, Ya as POPUP_PROVIDER_ID, ki as PanConstraint, Ai as PanConstraintModule, qn as PipelineGroupBehavior, Ct as READ_ONLY_CHANGED, mr as RESIZE_MAP, Ke as ROOT_ID, Gt as ResizeAwareAutoScroll, hr as UPDATE_CONFIG, yi as Viewer, as as WARDLEY_NOTATION, Oo as WardleyAppendBehavior, en as WardleyBaseViewer, jo as WardleyColorPicker, Lo as WardleyDrawTool, sn as WardleyElementFactory, eo as WardleyElementSettingsProvider, jn as WardleyEvolveDragging, rt as WardleyExporter, Qe as WardleyImporter, Jo as WardleyLabelDragging, Aa as WardleyLabelEditing, Pi as WardleyLassoBehavior, tn as WardleyLayouter, qa as WardleyLinkEditing, _r as WardleyModeling, Po as WardleyOrderingProvider, Dt as WardleyReadOnly, ui as WardleyRenderer, Bi as WardleyRules, it as WardleySourceOrder, dt as blobToBase64, Ga as canHaveLink, Dn as canvasAccessibilityModule, Vs as createAxisLabelsPopover, cs as createCollaborativeModeler, ls as createCollaborativeViewer, Ds as createMapDialog, Ls as createMapSizePopover, ks as createShortcutsDialog, js as createTitleDialog, Q as dialogButton, Or as evolutionConstraintModule, Dr as evolutionGridModule, Ue as exportBounds, Mi as freeRectModule, ic as iconMarkup, mt as ioModule, N as isComponent, P as isPipeline, M as isWardleyConnection, j as isWardleyShape, Pa as labelEditingModule, Ja as linkEditingModule, Ka as linkOf, _s as mapMenu, qt as mapResizeModule, Ss as mapShortcuts, g as normalizeMapSize, Jn as pipelineGroupModule, ee as presetIdForSize, Ot as readOnlyModule, is as restoreEditorState, Be as saveSVG, rs as setAsideEditorState, Hi as stageSnappingModule, lt as svgToPng, ko as wardleyAppendModule, Mo as wardleyColorPickerModule, co as wardleyContextPadModule, vi as wardleyDrawModule, Uo as wardleyDrawToolModule, Mn as wardleyEvolveModule, To as wardleyKeyboardModule, Zo as wardleyLabelDragModule, Fi as wardleyLassoModule, nn as wardleyLayoutModule, cn as wardleyModelModule, Er as wardleyModelingModule, Fo as wardleyOrderingModule, ca as wardleyPaletteModule, to as wardleyPopupModule, Vi as wardleyRulesModule };
|
|
6100
6111
|
|
|
6101
6112
|
//# sourceMappingURL=index.js.map
|