@miragon/wardley-renderer 0.4.0 → 0.6.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 +4 -3
- package/dist/draw/WardleyRenderer.d.ts +2 -0
- package/dist/draw/WardleyRenderer.d.ts.map +1 -1
- package/dist/draw/styles.d.ts +50 -44
- package/dist/draw/styles.d.ts.map +1 -1
- package/dist/draw-tool/WardleyDrawTool.d.ts +4 -2
- package/dist/draw-tool/WardleyDrawTool.d.ts.map +1 -1
- package/dist/evolve/WardleyEvolveDragging.d.ts +4 -2
- package/dist/evolve/WardleyEvolveDragging.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +464 -438
- package/dist/index.js.map +1 -1
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/palette.d.ts +55 -0
- package/dist/theme/palette.d.ts.map +1 -0
- package/dist/wardley.css +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -23,8 +23,26 @@ import _e from "diagram-js/lib/features/lasso-tool";
|
|
|
23
23
|
import ve from "diagram-js/lib/features/rules/RuleProvider";
|
|
24
24
|
import ye from "diagram-js/lib/features/connection-preview";
|
|
25
25
|
import be from "diagram-js/lib/features/ordering/OrderingProvider";
|
|
26
|
-
//#region src/
|
|
26
|
+
//#region src/theme/palette.ts
|
|
27
27
|
var m = {
|
|
28
|
+
blau: "#335DE5",
|
|
29
|
+
blauLink: "#2B50D4",
|
|
30
|
+
blauHell: "#6B8AFF",
|
|
31
|
+
gruen: "#00E676",
|
|
32
|
+
grau: "#F9F7F7",
|
|
33
|
+
schwarz: "#1D1D1D",
|
|
34
|
+
weiss: "#FFFFFF",
|
|
35
|
+
success: "#0B7A55",
|
|
36
|
+
warning: "#92610A",
|
|
37
|
+
danger: "#C92A2A",
|
|
38
|
+
info: "#2B50D4",
|
|
39
|
+
navy: "#080A20",
|
|
40
|
+
gradientBrand: "linear-gradient(120deg, #335DE5 30%, #00E676)"
|
|
41
|
+
};
|
|
42
|
+
m.grau, m.schwarz, m.weiss, m.blau, m.gruen, m.danger, m.navy;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/draw/styles.ts
|
|
45
|
+
var h = {
|
|
28
46
|
width: a.width,
|
|
29
47
|
height: a.height,
|
|
30
48
|
marginLeft: 66,
|
|
@@ -35,7 +53,7 @@ var m = {
|
|
|
35
53
|
width: 480,
|
|
36
54
|
height: 320
|
|
37
55
|
}, Se = 8, Ce = 6, we = 7.5;
|
|
38
|
-
function
|
|
56
|
+
function g(e) {
|
|
39
57
|
let t = (e && e.length ? e : "note").split("\n"), n = Math.max(1, ...t.map((e) => e.length));
|
|
40
58
|
return {
|
|
41
59
|
lines: t,
|
|
@@ -43,85 +61,85 @@ function h(e) {
|
|
|
43
61
|
height: Math.max(34, t.length * 17 + Ce * 2)
|
|
44
62
|
};
|
|
45
63
|
}
|
|
46
|
-
var
|
|
47
|
-
paper:
|
|
48
|
-
ink:
|
|
49
|
-
inkSoft: "#
|
|
50
|
-
axis: "
|
|
51
|
-
axisText: "#
|
|
52
|
-
grid: "
|
|
53
|
-
band: "rgba(
|
|
54
|
-
stroke:
|
|
55
|
-
componentFill:
|
|
56
|
-
anchorFill:
|
|
57
|
-
dependency: "#
|
|
58
|
-
accent:
|
|
59
|
-
accentSoft: "rgba(
|
|
60
|
-
flow:
|
|
61
|
-
movement:
|
|
62
|
-
inertia:
|
|
63
|
-
noteText: "#
|
|
64
|
-
pipeline:
|
|
65
|
-
annotationFill: "#
|
|
66
|
-
plotBackground:
|
|
67
|
-
accelerator: "#
|
|
68
|
-
deaccelerator:
|
|
64
|
+
var _ = {
|
|
65
|
+
paper: m.grau,
|
|
66
|
+
ink: m.schwarz,
|
|
67
|
+
inkSoft: "#5B5B5B",
|
|
68
|
+
axis: "rgba(51,93,229,0.22)",
|
|
69
|
+
axisText: "#6E7797",
|
|
70
|
+
grid: "rgba(51,93,229,0.12)",
|
|
71
|
+
band: "rgba(51,93,229,0.04)",
|
|
72
|
+
stroke: m.schwarz,
|
|
73
|
+
componentFill: m.weiss,
|
|
74
|
+
anchorFill: m.schwarz,
|
|
75
|
+
dependency: "#9E9E9E",
|
|
76
|
+
accent: m.blau,
|
|
77
|
+
accentSoft: "rgba(51,93,229,0.12)",
|
|
78
|
+
flow: m.blau,
|
|
79
|
+
movement: m.danger,
|
|
80
|
+
inertia: m.schwarz,
|
|
81
|
+
noteText: "#5B5B5B",
|
|
82
|
+
pipeline: m.schwarz,
|
|
83
|
+
annotationFill: "#FBF3E0",
|
|
84
|
+
plotBackground: m.weiss,
|
|
85
|
+
accelerator: "#00C853",
|
|
86
|
+
deaccelerator: m.danger
|
|
69
87
|
}, Te = [
|
|
70
88
|
{
|
|
71
89
|
id: "green",
|
|
72
90
|
name: "Green · good",
|
|
73
|
-
value: "#
|
|
91
|
+
value: "#0B7A55"
|
|
74
92
|
},
|
|
75
93
|
{
|
|
76
94
|
id: "amber",
|
|
77
95
|
name: "Amber · watch",
|
|
78
|
-
value: "#
|
|
96
|
+
value: "#92610A"
|
|
79
97
|
},
|
|
80
98
|
{
|
|
81
99
|
id: "red",
|
|
82
100
|
name: "Red · problem",
|
|
83
|
-
value: "#
|
|
101
|
+
value: "#C92A2A"
|
|
84
102
|
},
|
|
85
103
|
{
|
|
86
104
|
id: "blue",
|
|
87
105
|
name: "Blue · info",
|
|
88
|
-
value: "#
|
|
106
|
+
value: "#2B50D4"
|
|
89
107
|
},
|
|
90
108
|
{
|
|
91
109
|
id: "teal",
|
|
92
110
|
name: "Teal",
|
|
93
|
-
value: "#
|
|
111
|
+
value: "#0E8181"
|
|
94
112
|
},
|
|
95
113
|
{
|
|
96
114
|
id: "purple",
|
|
97
115
|
name: "Purple · idea",
|
|
98
|
-
value: "#
|
|
116
|
+
value: "#6A3DB8"
|
|
99
117
|
},
|
|
100
118
|
{
|
|
101
119
|
id: "pink",
|
|
102
120
|
name: "Pink",
|
|
103
|
-
value: "#
|
|
121
|
+
value: "#C2185B"
|
|
104
122
|
},
|
|
105
123
|
{
|
|
106
124
|
id: "slate",
|
|
107
125
|
name: "Slate · neutral",
|
|
108
|
-
value: "#
|
|
126
|
+
value: "#4A4A4A"
|
|
109
127
|
}
|
|
110
|
-
],
|
|
128
|
+
], v = {
|
|
111
129
|
pioneers: {
|
|
112
|
-
fill: "rgba(
|
|
113
|
-
stroke: "#
|
|
130
|
+
fill: "rgba(51,93,229,0.07)",
|
|
131
|
+
stroke: "#335DE5"
|
|
114
132
|
},
|
|
115
133
|
settlers: {
|
|
116
|
-
fill: "rgba(
|
|
117
|
-
stroke: "#
|
|
134
|
+
fill: "rgba(146,97,10,0.10)",
|
|
135
|
+
stroke: "#92610A"
|
|
118
136
|
},
|
|
119
137
|
townplanners: {
|
|
120
|
-
fill: "rgba(
|
|
121
|
-
stroke: "#
|
|
138
|
+
fill: "rgba(0,200,83,0.08)",
|
|
139
|
+
stroke: "#00C853"
|
|
122
140
|
}
|
|
123
|
-
},
|
|
124
|
-
family: "'
|
|
141
|
+
}, y = {
|
|
142
|
+
family: "'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif",
|
|
125
143
|
label: 13,
|
|
126
144
|
axis: 12,
|
|
127
145
|
stage: 12
|
|
@@ -134,8 +152,8 @@ function Ee(e, t) {
|
|
|
134
152
|
let r = n.cloneNode(!0), i = t ?? {
|
|
135
153
|
x: 0,
|
|
136
154
|
y: 0,
|
|
137
|
-
width:
|
|
138
|
-
height:
|
|
155
|
+
width: h.marginLeft + h.width + h.marginRight,
|
|
156
|
+
height: h.marginTop + h.height + h.marginBottom
|
|
139
157
|
};
|
|
140
158
|
r.setAttribute("xmlns", "http://www.w3.org/2000/svg"), r.setAttribute("viewBox", `${i.x} ${i.y} ${i.width} ${i.height}`), r.setAttribute("width", String(i.width)), r.setAttribute("height", String(i.height));
|
|
141
159
|
let a = r.querySelector(".viewport");
|
|
@@ -307,7 +325,7 @@ var ke = class {
|
|
|
307
325
|
return this.node("anchor", e.id, e.label, e.position.visibility, e.position.evolution, e, { ...e.labelOffset ? { labelOffset: e.labelOffset } : {} });
|
|
308
326
|
}
|
|
309
327
|
createNote(e) {
|
|
310
|
-
let { width: t, height: n } =
|
|
328
|
+
let { width: t, height: n } = g(e.label), r = this.grid.toCanvas(e.position);
|
|
311
329
|
return this.elementFactory.createShape({
|
|
312
330
|
id: e.id,
|
|
313
331
|
x: r.x - t / 2,
|
|
@@ -432,7 +450,7 @@ var ke = class {
|
|
|
432
450
|
isFrame: !0
|
|
433
451
|
});
|
|
434
452
|
if (e === "note") {
|
|
435
|
-
let { width: e, height: t } =
|
|
453
|
+
let { width: e, height: t } = g(r);
|
|
436
454
|
return this.elementFactory.createShape({
|
|
437
455
|
width: e,
|
|
438
456
|
height: t,
|
|
@@ -508,55 +526,55 @@ function je(e) {
|
|
|
508
526
|
}
|
|
509
527
|
//#endregion
|
|
510
528
|
//#region src/model/di-types.ts
|
|
511
|
-
function
|
|
529
|
+
function b(e) {
|
|
512
530
|
return typeof e == "object" && !!e;
|
|
513
531
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
532
|
+
function x(e) {
|
|
533
|
+
return b(e) && typeof e.wardleyType == "string" && "evolution" in e;
|
|
516
534
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
535
|
+
function S(e) {
|
|
536
|
+
return b(e) && typeof e.wardleyType == "string" && "waypoints" in e;
|
|
519
537
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
538
|
+
function Me(e) {
|
|
539
|
+
return x(e) && e.wardleyType === "component";
|
|
522
540
|
}
|
|
523
|
-
function
|
|
524
|
-
return
|
|
541
|
+
function C(e) {
|
|
542
|
+
return x(e) && e.wardleyType === "pipeline";
|
|
525
543
|
}
|
|
526
|
-
function
|
|
527
|
-
return
|
|
544
|
+
function Ne(e) {
|
|
545
|
+
return x(e) && e.wardleyType === "attitude";
|
|
528
546
|
}
|
|
529
547
|
//#endregion
|
|
530
548
|
//#region src/model/index.ts
|
|
531
|
-
var
|
|
532
|
-
function
|
|
549
|
+
var Pe = { wardleyElementFactory: ["type", Ae] }, Fe = "wardley-axes";
|
|
550
|
+
function Ie(e) {
|
|
533
551
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
534
552
|
}
|
|
535
|
-
var
|
|
553
|
+
var Le = class {
|
|
536
554
|
canvas;
|
|
537
555
|
static $inject = ["canvas"];
|
|
538
556
|
boundaries = o;
|
|
539
557
|
labels = i;
|
|
540
558
|
yAxisLabel = "Value Chain";
|
|
541
559
|
yAxisEndLabels = ["invisible", "visible"];
|
|
542
|
-
plotWidth =
|
|
543
|
-
plotHeight =
|
|
560
|
+
plotWidth = h.width;
|
|
561
|
+
plotHeight = h.height;
|
|
544
562
|
constructor(e) {
|
|
545
563
|
this.canvas = e;
|
|
546
564
|
}
|
|
547
565
|
configure(e) {
|
|
548
|
-
this.boundaries = e.stageBoundaries ?? o, this.labels = e.evolutionLabels ?? i, this.yAxisLabel = e.yAxisLabel ?? "Value Chain", this.yAxisEndLabels = e.yAxisEndLabels ?? ["invisible", "visible"], this.plotWidth = Math.max(e.size?.width ??
|
|
566
|
+
this.boundaries = e.stageBoundaries ?? o, this.labels = e.evolutionLabels ?? i, this.yAxisLabel = e.yAxisLabel ?? "Value Chain", this.yAxisEndLabels = e.yAxisEndLabels ?? ["invisible", "visible"], this.plotWidth = Math.max(e.size?.width ?? h.width, xe.width), this.plotHeight = Math.max(e.size?.height ?? h.height, xe.height);
|
|
549
567
|
}
|
|
550
568
|
toCanvas(e) {
|
|
551
569
|
return {
|
|
552
|
-
x:
|
|
553
|
-
y:
|
|
570
|
+
x: h.marginLeft + e.evolution * this.plotWidth,
|
|
571
|
+
y: h.marginTop + (1 - e.visibility) * this.plotHeight
|
|
554
572
|
};
|
|
555
573
|
}
|
|
556
574
|
fromCanvas(e) {
|
|
557
575
|
return {
|
|
558
|
-
evolution:
|
|
559
|
-
visibility:
|
|
576
|
+
evolution: Ie((e.x - h.marginLeft) / this.plotWidth),
|
|
577
|
+
visibility: Ie(1 - (e.y - h.marginTop) / this.plotHeight)
|
|
560
578
|
};
|
|
561
579
|
}
|
|
562
580
|
stageOf(e) {
|
|
@@ -575,17 +593,17 @@ var Re = class {
|
|
|
575
593
|
return {
|
|
576
594
|
x: 0,
|
|
577
595
|
y: 0,
|
|
578
|
-
width:
|
|
579
|
-
height:
|
|
596
|
+
width: h.marginLeft + this.plotWidth + h.marginRight,
|
|
597
|
+
height: h.marginTop + this.plotHeight + h.marginBottom
|
|
580
598
|
};
|
|
581
599
|
}
|
|
582
600
|
render() {
|
|
583
|
-
let e = this.canvas.getLayer(
|
|
601
|
+
let e = this.canvas.getLayer(Fe, -1);
|
|
584
602
|
d(e);
|
|
585
|
-
let t =
|
|
586
|
-
l(e,
|
|
587
|
-
fill:
|
|
588
|
-
stroke:
|
|
603
|
+
let t = h.marginLeft, n = h.marginTop, r = t + this.plotWidth, i = n + this.plotHeight;
|
|
604
|
+
l(e, Re(t, n, this.plotWidth, this.plotHeight, {
|
|
605
|
+
fill: _.plotBackground,
|
|
606
|
+
stroke: _.grid
|
|
589
607
|
}));
|
|
590
608
|
let a = [
|
|
591
609
|
0,
|
|
@@ -594,45 +612,45 @@ var Re = class {
|
|
|
594
612
|
];
|
|
595
613
|
for (let r = 0; r < 4; r++) {
|
|
596
614
|
let o = t + a[r] * this.plotWidth, s = t + a[r + 1] * this.plotWidth;
|
|
597
|
-
r % 2 == 1 && l(e,
|
|
598
|
-
fill:
|
|
615
|
+
r % 2 == 1 && l(e, Re(o, n, s - o, this.plotHeight, {
|
|
616
|
+
fill: _.band,
|
|
599
617
|
stroke: "none"
|
|
600
|
-
})), r > 0 && l(e,
|
|
601
|
-
stroke:
|
|
618
|
+
})), r > 0 && l(e, w(o, n, o, i, {
|
|
619
|
+
stroke: _.grid,
|
|
602
620
|
"stroke-dasharray": "3 5"
|
|
603
621
|
}));
|
|
604
622
|
let c = (o + s) / 2;
|
|
605
|
-
l(e,
|
|
623
|
+
l(e, T(this.labels[r].toUpperCase(), c, i + 18, {
|
|
606
624
|
"text-anchor": "middle",
|
|
607
|
-
"font-size":
|
|
625
|
+
"font-size": y.stage,
|
|
608
626
|
"letter-spacing": "0.08em",
|
|
609
|
-
fill:
|
|
627
|
+
fill: _.axisText
|
|
610
628
|
}));
|
|
611
629
|
}
|
|
612
|
-
l(e,
|
|
630
|
+
l(e, w(t, i, r + 10, i, { stroke: _.axis })), l(e, ze(r + 10, i, "right")), l(e, T("Evolution", r + 6, i + 38, {
|
|
613
631
|
"text-anchor": "end",
|
|
614
|
-
"font-size":
|
|
615
|
-
fill:
|
|
632
|
+
"font-size": y.axis,
|
|
633
|
+
fill: _.axisText,
|
|
616
634
|
"font-style": "italic"
|
|
617
|
-
})), l(e,
|
|
618
|
-
let o =
|
|
635
|
+
})), l(e, w(t, i, t, n - 10, { stroke: _.axis })), l(e, ze(t, n - 10, "up"));
|
|
636
|
+
let o = T(this.yAxisLabel, 0, 0, {
|
|
619
637
|
"text-anchor": "middle",
|
|
620
|
-
"font-size":
|
|
621
|
-
fill:
|
|
638
|
+
"font-size": y.axis,
|
|
639
|
+
fill: _.axisText,
|
|
622
640
|
"font-style": "italic"
|
|
623
641
|
});
|
|
624
|
-
u(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), l(e, o), l(e,
|
|
642
|
+
u(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), l(e, o), l(e, T(this.yAxisEndLabels[1], t - 10, n + 11, {
|
|
625
643
|
"text-anchor": "end",
|
|
626
|
-
"font-size":
|
|
627
|
-
fill:
|
|
628
|
-
})), l(e,
|
|
644
|
+
"font-size": y.stage,
|
|
645
|
+
fill: _.axisText
|
|
646
|
+
})), l(e, T(this.yAxisEndLabels[0], t - 10, i - 2, {
|
|
629
647
|
"text-anchor": "end",
|
|
630
|
-
"font-size":
|
|
631
|
-
fill:
|
|
648
|
+
"font-size": y.stage,
|
|
649
|
+
fill: _.axisText
|
|
632
650
|
}));
|
|
633
651
|
}
|
|
634
652
|
};
|
|
635
|
-
function
|
|
653
|
+
function Re(e, t, n, r, i) {
|
|
636
654
|
return u(f("rect"), {
|
|
637
655
|
x: e,
|
|
638
656
|
y: t,
|
|
@@ -642,7 +660,7 @@ function ze(e, t, n, r, i) {
|
|
|
642
660
|
...i
|
|
643
661
|
});
|
|
644
662
|
}
|
|
645
|
-
function
|
|
663
|
+
function w(e, t, n, r, i) {
|
|
646
664
|
return u(f("line"), {
|
|
647
665
|
x1: e,
|
|
648
666
|
y1: t,
|
|
@@ -652,25 +670,25 @@ function S(e, t, n, r, i) {
|
|
|
652
670
|
...i
|
|
653
671
|
});
|
|
654
672
|
}
|
|
655
|
-
function
|
|
673
|
+
function T(e, t, n, r) {
|
|
656
674
|
let i = u(f("text"), {
|
|
657
675
|
x: t,
|
|
658
676
|
y: n,
|
|
659
|
-
"font-family":
|
|
677
|
+
"font-family": y.family,
|
|
660
678
|
...r
|
|
661
679
|
});
|
|
662
680
|
return i.textContent = e, i;
|
|
663
681
|
}
|
|
664
|
-
function
|
|
682
|
+
function ze(e, t, n) {
|
|
665
683
|
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}`;
|
|
666
684
|
return u(f("polygon"), {
|
|
667
685
|
points: r,
|
|
668
|
-
fill:
|
|
686
|
+
fill: _.axis
|
|
669
687
|
});
|
|
670
688
|
}
|
|
671
689
|
//#endregion
|
|
672
690
|
//#region src/evolution-grid/EvolutionConstraintBehavior.ts
|
|
673
|
-
var
|
|
691
|
+
var Be = [
|
|
674
692
|
"shape.move",
|
|
675
693
|
"shape.create",
|
|
676
694
|
"shape.resize",
|
|
@@ -688,13 +706,13 @@ var w = [
|
|
|
688
706
|
constructor(e, t, n) {
|
|
689
707
|
super(e), this.eventBus = e, this.grid = t, this.elementRegistry = n;
|
|
690
708
|
let r = (e) => this.syncAll(e.context);
|
|
691
|
-
this.postExecuted(
|
|
709
|
+
this.postExecuted(Be, r), this.reverted(Be, r);
|
|
692
710
|
let i = (e) => {
|
|
693
711
|
if ([
|
|
694
712
|
e.context?.shape,
|
|
695
713
|
e.context?.element,
|
|
696
714
|
...e.context?.elements ?? []
|
|
697
|
-
].some((e) =>
|
|
715
|
+
].some((e) => x(e) && e.wardleyType === "component")) for (let e of this.elementRegistry.filter((e) => C(e))) this.eventBus.fire("element.changed", { element: e });
|
|
698
716
|
};
|
|
699
717
|
this.postExecuted([
|
|
700
718
|
"shape.create",
|
|
@@ -713,7 +731,7 @@ var w = [
|
|
|
713
731
|
...e.shapes ?? [],
|
|
714
732
|
...e.elements ?? []
|
|
715
733
|
];
|
|
716
|
-
for (let e of t)
|
|
734
|
+
for (let e of t) x(e) && this.syncFromGeometry(e);
|
|
717
735
|
}
|
|
718
736
|
syncFromGeometry(e) {
|
|
719
737
|
let t = e.y + e.height / 2;
|
|
@@ -761,14 +779,14 @@ var w = [
|
|
|
761
779
|
(Math.abs(t - e.x) > .5 || Math.abs(n - e.y) > .5 || r !== void 0 && Math.abs(r - e.width) > .5 || i !== void 0 && Math.abs(i - e.height) > .5) && (e.x = t, e.y = n, r !== void 0 && (e.width = r), i !== void 0 && (e.height = i), this.fireChanged(e));
|
|
762
780
|
}
|
|
763
781
|
updateMembership(e) {
|
|
764
|
-
let t = e.x + e.width / 2, n = e.y + e.height / 2, r = this.elementRegistry.filter((e) =>
|
|
782
|
+
let t = e.x + e.width / 2, n = e.y + e.height / 2, r = this.elementRegistry.filter((e) => C(e)).find((r) => r.wardleyLabel !== e.wardleyLabel && t >= r.x && t <= r.x + r.width && n >= r.y && n <= r.y + r.height);
|
|
765
783
|
r ? (e.pipelineId = r.id, this.glueToPipeline(e, r)) : e.pipelineId && delete e.pipelineId;
|
|
766
784
|
}
|
|
767
785
|
glueToPipeline(e, t) {
|
|
768
786
|
e.y = t.y + t.height / 2 - e.height / 2, e.visibility = t.visibility, this.fireChanged(e);
|
|
769
787
|
}
|
|
770
788
|
reconcileMembership(e) {
|
|
771
|
-
let t = this.elementRegistry.filter((e) =>
|
|
789
|
+
let t = this.elementRegistry.filter((e) => x(e) && e.wardleyType === "component");
|
|
772
790
|
for (let n of t) {
|
|
773
791
|
if (n.wardleyLabel === e.wardleyLabel) continue;
|
|
774
792
|
let t = n.x + n.width / 2, r = n.y + n.height / 2, i = t >= e.x && t <= e.x + e.width && r >= e.y && r <= e.y + e.height;
|
|
@@ -797,12 +815,12 @@ function We(e, t) {
|
|
|
797
815
|
}
|
|
798
816
|
//#endregion
|
|
799
817
|
//#region src/evolution-grid/index.ts
|
|
800
|
-
var
|
|
818
|
+
var E = { evolutionGrid: ["type", Le] }, Ge = {
|
|
801
819
|
__init__: ["evolutionConstraintBehavior"],
|
|
802
|
-
__depends__: [
|
|
820
|
+
__depends__: [E],
|
|
803
821
|
evolutionConstraintBehavior: ["type", Ve]
|
|
804
|
-
},
|
|
805
|
-
function
|
|
822
|
+
}, D = "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", Ke = "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", qe = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z", Je = "M15.5 5H11l5 7-5 7h4.5l5-7zM8.5 5H4l5 7-5 7h4.5l5-7z", O = "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", k = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Ye = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", Xe = "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", Ze = "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", Qe = "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", $e = "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", et = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", tt = "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", nt = "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", rt = "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", it = "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", at = "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", ot = "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", A = "M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z", j = "M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z", st = "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z", ct = "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", lt = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", ut = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", dt = "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";
|
|
823
|
+
function M(e, t, n, r, i) {
|
|
806
824
|
let a = f("g"), o = r / 24;
|
|
807
825
|
return u(a, {
|
|
808
826
|
transform: `translate(${t - r / 2}, ${n - r / 2}) scale(${o})`,
|
|
@@ -810,12 +828,12 @@ function j(e, t, n, r, i) {
|
|
|
810
828
|
stroke: "none"
|
|
811
829
|
}), l(a, u(f("path"), { d: e })), a;
|
|
812
830
|
}
|
|
813
|
-
function
|
|
831
|
+
function N(e, t = 18) {
|
|
814
832
|
return `<svg viewBox="0 0 24 24" width="${t}" height="${t}" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
|
|
815
833
|
}
|
|
816
834
|
//#endregion
|
|
817
835
|
//#region src/draw/WardleyRenderer.ts
|
|
818
|
-
var ft = 1500,
|
|
836
|
+
var ft = 1500, P = class extends te {
|
|
819
837
|
grid;
|
|
820
838
|
elementRegistry;
|
|
821
839
|
static $inject = [
|
|
@@ -827,7 +845,7 @@ var ft = 1500, N = class extends te {
|
|
|
827
845
|
super(e, ft), this.grid = t, this.elementRegistry = n;
|
|
828
846
|
}
|
|
829
847
|
canRender(e) {
|
|
830
|
-
return
|
|
848
|
+
return x(e) || S(e);
|
|
831
849
|
}
|
|
832
850
|
drawShape(e, t) {
|
|
833
851
|
let n = t;
|
|
@@ -847,7 +865,7 @@ var ft = 1500, N = class extends te {
|
|
|
847
865
|
let n = t.drawingPoints ?? [], r = t.strokeStyle === "dashed" ? "8 5" : t.strokeStyle === "dotted" ? "2 4" : void 0, i = u(f(t.closed ? "polygon" : "polyline"), {
|
|
848
866
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
849
867
|
fill: "none",
|
|
850
|
-
stroke: t.color ??
|
|
868
|
+
stroke: t.color ?? _.ink,
|
|
851
869
|
"stroke-width": 2,
|
|
852
870
|
"stroke-linecap": "round",
|
|
853
871
|
"stroke-linejoin": "round",
|
|
@@ -856,7 +874,7 @@ var ft = 1500, N = class extends te {
|
|
|
856
874
|
return l(e, i), i;
|
|
857
875
|
}
|
|
858
876
|
drawConnection(e, t) {
|
|
859
|
-
let n = t, r = n.wardleyType === "flow", i = r ?
|
|
877
|
+
let n = t, r = n.wardleyType === "flow", i = r ? _.flow : _.dependency, [a, o] = yt(n), s = u(f("polyline"), {
|
|
860
878
|
points: `${a.x},${a.y} ${o.x},${o.y}`,
|
|
861
879
|
fill: "none",
|
|
862
880
|
stroke: i,
|
|
@@ -868,12 +886,12 @@ var ft = 1500, N = class extends te {
|
|
|
868
886
|
return r && n.flowValue && l(e, I(n.flowValue, c, d - 5, {
|
|
869
887
|
"text-anchor": "middle",
|
|
870
888
|
"font-size": 11,
|
|
871
|
-
fill:
|
|
889
|
+
fill: _.flow
|
|
872
890
|
})), n.linkLabel && l(e, I(n.linkLabel, c, d + (n.flowValue ? 12 : -4), {
|
|
873
891
|
"text-anchor": "middle",
|
|
874
892
|
"font-size": 11,
|
|
875
893
|
"font-style": "italic",
|
|
876
|
-
fill:
|
|
894
|
+
fill: _.axisText
|
|
877
895
|
})), s;
|
|
878
896
|
}
|
|
879
897
|
getShapePath(e) {
|
|
@@ -885,77 +903,54 @@ var ft = 1500, N = class extends te {
|
|
|
885
903
|
return t ? `M${t.x},${t.y}` + n.map((e) => `L${e.x},${e.y}`).join("") : "";
|
|
886
904
|
}
|
|
887
905
|
drawComponent(e, t) {
|
|
888
|
-
let n = t.width / 2, r = t.height / 2, i =
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
}), o = this.grid.toCanvas({
|
|
894
|
-
visibility: t.visibility,
|
|
895
|
-
evolution: i.targetEvolution
|
|
896
|
-
}).x - a.x, s = n + o, c = s - (Math.sign(o) || 1) * 17;
|
|
897
|
-
l(e, F(n, r, c, r, {
|
|
898
|
-
stroke: g.movement,
|
|
899
|
-
"stroke-width": 1.5,
|
|
900
|
-
"stroke-dasharray": "6 4"
|
|
901
|
-
})), l(e, L({
|
|
902
|
-
x: n,
|
|
903
|
-
y: r
|
|
904
|
-
}, {
|
|
905
|
-
x: c,
|
|
906
|
-
y: r
|
|
907
|
-
}, g.movement)), l(e, P(s, r, 15, {
|
|
908
|
-
fill: g.paper,
|
|
909
|
-
stroke: g.movement,
|
|
910
|
-
"stroke-width": 2,
|
|
911
|
-
class: "wardley-evolve-handle"
|
|
912
|
-
})), l(e, I(i.newLabel ?? t.wardleyLabel, s + 15 + 7, r - 4, {
|
|
913
|
-
"font-weight": "500",
|
|
914
|
-
fill: g.movement
|
|
915
|
-
})), i.method && l(e, I(i.method, s + 15 + 7, r + 11, {
|
|
916
|
-
"font-size": 10.5,
|
|
917
|
-
fill: g.movement
|
|
918
|
-
}));
|
|
919
|
-
}
|
|
920
|
-
if (a?.inertia) {
|
|
921
|
-
let t = n + 15 + 3;
|
|
922
|
-
l(e, F(t, r - 13, t, r + 13, {
|
|
923
|
-
stroke: g.inertia,
|
|
924
|
-
"stroke-width": 3,
|
|
925
|
-
"stroke-linecap": "round"
|
|
926
|
-
}));
|
|
927
|
-
}
|
|
928
|
-
let o = t.color ?? g.stroke, s = P(n, r, 15, {
|
|
929
|
-
fill: g.componentFill,
|
|
930
|
-
stroke: o,
|
|
906
|
+
let n = t.width / 2, r = t.height / 2, i = t.decorators;
|
|
907
|
+
t.movement && this.drawMovement(e, t, n, r), i?.inertia && pt(e, n, r);
|
|
908
|
+
let a = t.color ?? _.stroke, o = F(n, r, 15, {
|
|
909
|
+
fill: _.componentFill,
|
|
910
|
+
stroke: a,
|
|
931
911
|
"stroke-width": 2
|
|
932
912
|
});
|
|
933
|
-
|
|
913
|
+
return l(e, o), t.movement && l(e, F(n, r, 12, {
|
|
934
914
|
fill: "none",
|
|
935
|
-
stroke:
|
|
915
|
+
stroke: a,
|
|
936
916
|
"stroke-width": 1.5
|
|
937
|
-
})), a
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
917
|
+
})), mt(e, n, r, a, i), ht(e, t, n, r), o;
|
|
918
|
+
}
|
|
919
|
+
drawMovement(e, t, n, r) {
|
|
920
|
+
let i = t.movement;
|
|
921
|
+
if (!i) return;
|
|
922
|
+
let a = this.grid.toCanvas({
|
|
923
|
+
visibility: t.visibility,
|
|
924
|
+
evolution: t.evolution
|
|
925
|
+
}), o = this.grid.toCanvas({
|
|
926
|
+
visibility: t.visibility,
|
|
927
|
+
evolution: i.targetEvolution
|
|
928
|
+
}).x - a.x, s = n + o, c = s - (Math.sign(o) || 1) * 17;
|
|
929
|
+
l(e, gt(n, r, c, r, {
|
|
930
|
+
stroke: _.movement,
|
|
931
|
+
"stroke-width": 1.5,
|
|
932
|
+
"stroke-dasharray": "6 4"
|
|
933
|
+
})), l(e, L({
|
|
934
|
+
x: n,
|
|
935
|
+
y: r
|
|
936
|
+
}, {
|
|
937
|
+
x: c,
|
|
938
|
+
y: r
|
|
939
|
+
}, _.movement)), l(e, F(s, r, 15, {
|
|
940
|
+
fill: _.paper,
|
|
941
|
+
stroke: _.movement,
|
|
942
|
+
"stroke-width": 2,
|
|
943
|
+
class: "wardley-evolve-handle"
|
|
944
|
+
})), l(e, I(i.newLabel ?? t.wardleyLabel, s + 15 + 7, r - 4, {
|
|
950
945
|
"font-weight": "500",
|
|
951
|
-
|
|
952
|
-
})),
|
|
946
|
+
fill: _.movement
|
|
947
|
+
})), i.method && l(e, I(i.method, s + 15 + 7, r + 11, {
|
|
953
948
|
"font-size": 10.5,
|
|
954
|
-
fill:
|
|
955
|
-
}))
|
|
949
|
+
fill: _.movement
|
|
950
|
+
}));
|
|
956
951
|
}
|
|
957
952
|
drawAnchor(e, t) {
|
|
958
|
-
let n = t.width / 2, r = t.height / 2, i =
|
|
953
|
+
let n = t.width / 2, r = t.height / 2, i = M(D, n, r, 26, t.color ?? _.ink);
|
|
959
954
|
return l(e, i), l(e, I(t.wardleyLabel, n + (t.labelOffset?.dx ?? 0), r - 26 / 2 - 4 + (t.labelOffset?.dy ?? 0), {
|
|
960
955
|
"text-anchor": "middle",
|
|
961
956
|
"font-weight": "700",
|
|
@@ -970,17 +965,17 @@ var ft = 1500, N = class extends te {
|
|
|
970
965
|
height: Math.max(t.height, 1),
|
|
971
966
|
rx: 4,
|
|
972
967
|
fill: "none",
|
|
973
|
-
stroke: r ??
|
|
968
|
+
stroke: r ?? _.pipeline,
|
|
974
969
|
"stroke-width": 1.25,
|
|
975
970
|
"stroke-dasharray": "6 3"
|
|
976
971
|
});
|
|
977
|
-
return l(e, i), !this.elementRegistry.filter((e) =>
|
|
972
|
+
return l(e, i), !this.elementRegistry.filter((e) => x(e) && e.wardleyType === "component").some((e) => e.wardleyLabel === t.wardleyLabel) && (l(e, u(f("rect"), {
|
|
978
973
|
x: n / 2 - 8,
|
|
979
974
|
y: -8,
|
|
980
975
|
width: 16,
|
|
981
976
|
height: 16,
|
|
982
|
-
fill:
|
|
983
|
-
stroke: r ??
|
|
977
|
+
fill: _.componentFill,
|
|
978
|
+
stroke: r ?? _.stroke,
|
|
984
979
|
"stroke-width": 2
|
|
985
980
|
})), l(e, I(t.wardleyLabel, n / 2 + 8 + 6, -4, {
|
|
986
981
|
"font-weight": "500",
|
|
@@ -990,7 +985,7 @@ var ft = 1500, N = class extends te {
|
|
|
990
985
|
drawNote(e, t) {
|
|
991
986
|
let n = t.color, r = (t.wardleyLabel ?? "").split("\n"), i = t.width / 2, a = t.height / 2 - (r.length - 1) * 17 / 2 + 4, o = {
|
|
992
987
|
"text-anchor": "middle",
|
|
993
|
-
fill: n ??
|
|
988
|
+
fill: n ?? _.noteText,
|
|
994
989
|
"font-style": "italic",
|
|
995
990
|
...n ? { "font-weight": "600" } : {}
|
|
996
991
|
}, s;
|
|
@@ -1000,7 +995,7 @@ var ft = 1500, N = class extends te {
|
|
|
1000
995
|
}), s ?? f("text");
|
|
1001
996
|
}
|
|
1002
997
|
drawAttitude(e, t) {
|
|
1003
|
-
let n =
|
|
998
|
+
let n = v[t.attitudeKind ?? "pioneers"] ?? v.pioneers, r = t.color ?? n.stroke, i = u(f("rect"), {
|
|
1004
999
|
x: 0,
|
|
1005
1000
|
y: 0,
|
|
1006
1001
|
width: Math.max(t.width, 1),
|
|
@@ -1011,16 +1006,16 @@ var ft = 1500, N = class extends te {
|
|
|
1011
1006
|
"stroke-width": 1.25,
|
|
1012
1007
|
"stroke-dasharray": "5 4"
|
|
1013
1008
|
});
|
|
1014
|
-
return l(e, i), l(e, I(t.wardleyLabel && t.wardleyLabel !== t.attitudeKind ? t.wardleyLabel :
|
|
1009
|
+
return l(e, i), l(e, I(t.wardleyLabel && t.wardleyLabel !== t.attitudeKind ? t.wardleyLabel : bt(t.attitudeKind ?? "pioneers"), 10, 18, {
|
|
1015
1010
|
fill: r,
|
|
1016
1011
|
"font-weight": "700",
|
|
1017
1012
|
"letter-spacing": "0.04em"
|
|
1018
1013
|
})), i;
|
|
1019
1014
|
}
|
|
1020
1015
|
drawAnnotation(e, t) {
|
|
1021
|
-
let n = t.width / 2, r = t.height / 2, i =
|
|
1022
|
-
fill:
|
|
1023
|
-
stroke: t.color ??
|
|
1016
|
+
let n = t.width / 2, r = t.height / 2, i = F(n, r, 10, {
|
|
1017
|
+
fill: _.annotationFill,
|
|
1018
|
+
stroke: t.color ?? _.stroke,
|
|
1024
1019
|
"stroke-width": 1.25
|
|
1025
1020
|
});
|
|
1026
1021
|
return l(e, i), l(e, I(String(t.annotationNumber ?? ""), n, r + 4, {
|
|
@@ -1029,21 +1024,21 @@ var ft = 1500, N = class extends te {
|
|
|
1029
1024
|
"font-weight": "700"
|
|
1030
1025
|
}, !1)), t.wardleyLabel && l(e, I(t.wardleyLabel, n + 15, r + 4, {
|
|
1031
1026
|
"font-size": 12,
|
|
1032
|
-
fill:
|
|
1027
|
+
fill: _.noteText
|
|
1033
1028
|
})), i;
|
|
1034
1029
|
}
|
|
1035
1030
|
drawAccelerator(e, t) {
|
|
1036
|
-
let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a =
|
|
1031
|
+
let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a = M(i ? A : j, n, r, 24, t.color ?? (i ? _.accelerator : _.deaccelerator));
|
|
1037
1032
|
return l(e, a), t.wardleyLabel && l(e, I(t.wardleyLabel, n + 15, r + 5, { "font-size": 12 })), a;
|
|
1038
1033
|
}
|
|
1039
1034
|
drawSubmap(e, t) {
|
|
1040
|
-
let n = t.width / 2, r = t.height / 2, i = t.color ??
|
|
1035
|
+
let n = t.width / 2, r = t.height / 2, i = t.color ?? _.stroke, a = u(f("rect"), {
|
|
1041
1036
|
x: n - 16,
|
|
1042
1037
|
y: r - 16,
|
|
1043
1038
|
width: 32,
|
|
1044
1039
|
height: 32,
|
|
1045
1040
|
rx: 3,
|
|
1046
|
-
fill:
|
|
1041
|
+
fill: _.componentFill,
|
|
1047
1042
|
stroke: i,
|
|
1048
1043
|
"stroke-width": 2
|
|
1049
1044
|
});
|
|
@@ -1062,7 +1057,38 @@ var ft = 1500, N = class extends te {
|
|
|
1062
1057
|
})), a;
|
|
1063
1058
|
}
|
|
1064
1059
|
};
|
|
1065
|
-
function
|
|
1060
|
+
function pt(e, t, n) {
|
|
1061
|
+
let r = t + 15 + 3;
|
|
1062
|
+
l(e, gt(r, n - 13, r, n + 13, {
|
|
1063
|
+
stroke: _.inertia,
|
|
1064
|
+
"stroke-width": 3,
|
|
1065
|
+
"stroke-linecap": "round"
|
|
1066
|
+
}));
|
|
1067
|
+
}
|
|
1068
|
+
function mt(e, t, n, r, i) {
|
|
1069
|
+
if (i?.ecosystem && l(e, F(t, n, 18.5, {
|
|
1070
|
+
fill: "none",
|
|
1071
|
+
stroke: r,
|
|
1072
|
+
"stroke-width": 1.25,
|
|
1073
|
+
"stroke-dasharray": "1.5 3",
|
|
1074
|
+
"stroke-linecap": "round"
|
|
1075
|
+
})), i?.market) for (let [i, a] of [
|
|
1076
|
+
[0, -3.8],
|
|
1077
|
+
[-3.4, 2.4],
|
|
1078
|
+
[3.4, 2.4]
|
|
1079
|
+
]) l(e, F(t + i, n + a, 1.7, { fill: r }));
|
|
1080
|
+
}
|
|
1081
|
+
function ht(e, t, n, r) {
|
|
1082
|
+
let i = t.decorators, a = n + 15 + 7 + (t.labelOffset?.dx ?? 0), o = r - 4 + (t.labelOffset?.dy ?? 0);
|
|
1083
|
+
l(e, I(t.wardleyLabel, a, o, {
|
|
1084
|
+
"font-weight": "500",
|
|
1085
|
+
...t.color ? { fill: t.color } : {}
|
|
1086
|
+
})), i?.method && l(e, I(i.method, a, o + 15, {
|
|
1087
|
+
"font-size": 10.5,
|
|
1088
|
+
fill: _.axisText
|
|
1089
|
+
}));
|
|
1090
|
+
}
|
|
1091
|
+
function F(e, t, n, r) {
|
|
1066
1092
|
return u(f("circle"), {
|
|
1067
1093
|
cx: e,
|
|
1068
1094
|
cy: t,
|
|
@@ -1071,7 +1097,7 @@ function P(e, t, n, r) {
|
|
|
1071
1097
|
...r
|
|
1072
1098
|
});
|
|
1073
1099
|
}
|
|
1074
|
-
function
|
|
1100
|
+
function gt(e, t, n, r, i) {
|
|
1075
1101
|
return u(f("line"), {
|
|
1076
1102
|
x1: e,
|
|
1077
1103
|
y1: t,
|
|
@@ -1082,16 +1108,16 @@ function F(e, t, n, r, i) {
|
|
|
1082
1108
|
}
|
|
1083
1109
|
function I(e, t, n, r = {}, i = !0) {
|
|
1084
1110
|
let a = i ? {
|
|
1085
|
-
stroke:
|
|
1111
|
+
stroke: _.paper,
|
|
1086
1112
|
"stroke-width": 3.5,
|
|
1087
1113
|
"paint-order": "stroke",
|
|
1088
1114
|
"stroke-linejoin": "round"
|
|
1089
1115
|
} : {}, o = u(f("text"), {
|
|
1090
1116
|
x: t,
|
|
1091
1117
|
y: n,
|
|
1092
|
-
"font-family":
|
|
1093
|
-
"font-size":
|
|
1094
|
-
fill:
|
|
1118
|
+
"font-family": y.family,
|
|
1119
|
+
"font-size": y.label,
|
|
1120
|
+
fill: _.ink,
|
|
1095
1121
|
...a,
|
|
1096
1122
|
...r
|
|
1097
1123
|
});
|
|
@@ -1104,10 +1130,10 @@ function L(e, t, n, r = 10, i = 5) {
|
|
|
1104
1130
|
fill: n
|
|
1105
1131
|
});
|
|
1106
1132
|
}
|
|
1107
|
-
function
|
|
1133
|
+
function _t(e) {
|
|
1108
1134
|
return e.wardleyType === "component" ? 17 : e.wardleyType === "anchor" ? 14 : e.wardleyType === "pipeline" ? 10 : Math.min(e.width, e.height) / 2;
|
|
1109
1135
|
}
|
|
1110
|
-
function
|
|
1136
|
+
function vt(e) {
|
|
1111
1137
|
return e.wardleyType === "pipeline" ? {
|
|
1112
1138
|
x: e.x + e.width / 2,
|
|
1113
1139
|
y: e.y
|
|
@@ -1116,7 +1142,7 @@ function mt(e) {
|
|
|
1116
1142
|
y: e.y + e.height / 2
|
|
1117
1143
|
};
|
|
1118
1144
|
}
|
|
1119
|
-
function
|
|
1145
|
+
function yt(e) {
|
|
1120
1146
|
let t = e.source, n = e.target, r = e.waypoints;
|
|
1121
1147
|
if (!t || !n) {
|
|
1122
1148
|
let e = r[0] ?? {
|
|
@@ -1125,7 +1151,7 @@ function ht(e) {
|
|
|
1125
1151
|
};
|
|
1126
1152
|
return [e, r[r.length - 1] ?? e];
|
|
1127
1153
|
}
|
|
1128
|
-
let i =
|
|
1154
|
+
let i = vt(t), a = vt(n), o = a.x - i.x, s = a.y - i.y, c = Math.hypot(o, s) || 1, l = o / c, u = s / c, d = _t(t), f = _t(n);
|
|
1129
1155
|
return c <= d + f + 2 ? [i, a] : [{
|
|
1130
1156
|
x: i.x + l * d,
|
|
1131
1157
|
y: i.y + u * d
|
|
@@ -1134,15 +1160,15 @@ function ht(e) {
|
|
|
1134
1160
|
y: a.y - u * f
|
|
1135
1161
|
}];
|
|
1136
1162
|
}
|
|
1137
|
-
function
|
|
1163
|
+
function bt(e) {
|
|
1138
1164
|
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
1139
1165
|
}
|
|
1140
1166
|
//#endregion
|
|
1141
1167
|
//#region src/draw/index.ts
|
|
1142
|
-
var
|
|
1168
|
+
var xt = {
|
|
1143
1169
|
__init__: ["wardleyRenderer"],
|
|
1144
|
-
wardleyRenderer: ["type",
|
|
1145
|
-
},
|
|
1170
|
+
wardleyRenderer: ["type", P]
|
|
1171
|
+
}, St = /* @__PURE__ */ new Set(["attitude", "pipeline"]), Ct = {
|
|
1146
1172
|
attitude: 0,
|
|
1147
1173
|
pipeline: 1,
|
|
1148
1174
|
note: 2,
|
|
@@ -1151,7 +1177,7 @@ var _t = {
|
|
|
1151
1177
|
annotation: 5,
|
|
1152
1178
|
submap: 3,
|
|
1153
1179
|
accelerator: 3
|
|
1154
|
-
},
|
|
1180
|
+
}, wt = class {
|
|
1155
1181
|
canvas;
|
|
1156
1182
|
elementFactory;
|
|
1157
1183
|
factory;
|
|
@@ -1183,7 +1209,7 @@ var _t = {
|
|
|
1183
1209
|
}
|
|
1184
1210
|
let i;
|
|
1185
1211
|
r && r.id === "wardley-root" ? i = r : (i = this.elementFactory.createRoot({ id: De }), this.canvas.setRootElement(i)), i.businessObject = n, this.grid.render();
|
|
1186
|
-
let a = /* @__PURE__ */ new Map(), o = [...e.elements].sort((e, t) => (
|
|
1212
|
+
let a = /* @__PURE__ */ new Map(), o = [...e.elements].sort((e, t) => (Ct[e.elementType] ?? 9) - (Ct[t.elementType] ?? 9)), s = o.filter((e) => St.has(e.elementType)), c = o.filter((e) => !St.has(e.elementType)), l = 0;
|
|
1187
1213
|
for (let e of s) {
|
|
1188
1214
|
let t = this.createShape(e);
|
|
1189
1215
|
t && (this.canvas.addShape(t, i), a.set(e.id, t), l++);
|
|
@@ -1240,7 +1266,7 @@ function R(e) {
|
|
|
1240
1266
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
1241
1267
|
return t;
|
|
1242
1268
|
}
|
|
1243
|
-
var
|
|
1269
|
+
var Tt = class {
|
|
1244
1270
|
elementRegistry;
|
|
1245
1271
|
canvas;
|
|
1246
1272
|
grid;
|
|
@@ -1255,7 +1281,7 @@ var xt = class {
|
|
|
1255
1281
|
export() {
|
|
1256
1282
|
let e = this.canvas.getRootElement().businessObject, t = e?.config ?? { title: "Untitled Map" }, n = [], i = [];
|
|
1257
1283
|
for (let e of this.elementRegistry.getAll()) if (e.id !== "wardley-root") {
|
|
1258
|
-
if (
|
|
1284
|
+
if (S(e)) if (e.businessObject) i.push(e.businessObject);
|
|
1259
1285
|
else {
|
|
1260
1286
|
let t = {
|
|
1261
1287
|
id: e.id,
|
|
@@ -1271,7 +1297,7 @@ var xt = class {
|
|
|
1271
1297
|
edgeType: "dependency"
|
|
1272
1298
|
});
|
|
1273
1299
|
}
|
|
1274
|
-
else if (
|
|
1300
|
+
else if (x(e)) {
|
|
1275
1301
|
let t = this.buildElement(e);
|
|
1276
1302
|
t && n.push(t);
|
|
1277
1303
|
}
|
|
@@ -1405,23 +1431,23 @@ var xt = class {
|
|
|
1405
1431
|
} : void 0;
|
|
1406
1432
|
}
|
|
1407
1433
|
}
|
|
1408
|
-
},
|
|
1409
|
-
wardleyImporter: ["type",
|
|
1410
|
-
wardleyExporter: ["type",
|
|
1411
|
-
},
|
|
1434
|
+
}, Et = {
|
|
1435
|
+
wardleyImporter: ["type", wt],
|
|
1436
|
+
wardleyExporter: ["type", Tt]
|
|
1437
|
+
}, Dt = class extends ke {
|
|
1412
1438
|
_getModules() {
|
|
1413
1439
|
return [
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1440
|
+
Pe,
|
|
1441
|
+
E,
|
|
1442
|
+
xt,
|
|
1443
|
+
Et
|
|
1418
1444
|
];
|
|
1419
1445
|
}
|
|
1420
|
-
},
|
|
1421
|
-
function
|
|
1422
|
-
return t <= r ?
|
|
1446
|
+
}, Ot = 180, kt = 80, At = 120, jt = .5, Mt = (e, t, n) => e < t ? t : e > n ? n : e;
|
|
1447
|
+
function Nt(e, t, n, r) {
|
|
1448
|
+
return t <= r ? Mt(e, n, n + r - t) : n + r / 2 - t / 2;
|
|
1423
1449
|
}
|
|
1424
|
-
var
|
|
1450
|
+
var Pt = class {
|
|
1425
1451
|
canvas;
|
|
1426
1452
|
grid;
|
|
1427
1453
|
static $inject = [
|
|
@@ -1438,8 +1464,8 @@ var At = class {
|
|
|
1438
1464
|
constrain(e) {
|
|
1439
1465
|
let t = e ?? this.canvas.viewbox(), n = this.grid.outerBounds();
|
|
1440
1466
|
if (!(n.width > 0) || !(n.height > 0) || !(t.width > 0) || !(t.height > 0)) return;
|
|
1441
|
-
let r =
|
|
1442
|
-
if (!(Math.abs(r - t.x) <
|
|
1467
|
+
let r = Nt(t.x, t.width, n.x - At, n.width + 2 * At), i = Nt(t.y, t.height, n.y - Ot, n.height + Ot + kt);
|
|
1468
|
+
if (!(Math.abs(r - t.x) < jt && Math.abs(i - t.y) < jt)) {
|
|
1443
1469
|
this.applying = !0;
|
|
1444
1470
|
try {
|
|
1445
1471
|
this.canvas.viewbox({
|
|
@@ -1453,10 +1479,10 @@ var At = class {
|
|
|
1453
1479
|
}
|
|
1454
1480
|
}
|
|
1455
1481
|
}
|
|
1456
|
-
},
|
|
1482
|
+
}, Ft = {
|
|
1457
1483
|
__init__: ["panConstraint"],
|
|
1458
|
-
panConstraint: ["type",
|
|
1459
|
-
},
|
|
1484
|
+
panConstraint: ["type", Pt]
|
|
1485
|
+
}, It = class extends Dt {
|
|
1460
1486
|
_getModules() {
|
|
1461
1487
|
return [
|
|
1462
1488
|
...super._getModules(),
|
|
@@ -1464,47 +1490,47 @@ var At = class {
|
|
|
1464
1490
|
re,
|
|
1465
1491
|
ie,
|
|
1466
1492
|
ae,
|
|
1467
|
-
|
|
1493
|
+
Ft
|
|
1468
1494
|
];
|
|
1469
1495
|
}
|
|
1470
1496
|
};
|
|
1471
1497
|
//#endregion
|
|
1472
1498
|
//#region src/modeling/cmd/UpdatePropertiesHandler.ts
|
|
1473
|
-
function
|
|
1499
|
+
function Lt(e, t, n) {
|
|
1474
1500
|
n === void 0 ? delete e[t] : e[t] = n;
|
|
1475
1501
|
}
|
|
1476
|
-
var
|
|
1502
|
+
var Rt = class {
|
|
1477
1503
|
execute(e) {
|
|
1478
1504
|
let { element: t, properties: n } = e, r = t, i = {};
|
|
1479
|
-
for (let e of Object.keys(n)) i[e] = r[e],
|
|
1505
|
+
for (let e of Object.keys(n)) i[e] = r[e], Lt(r, e, n[e]);
|
|
1480
1506
|
return e.oldProperties = i, [t];
|
|
1481
1507
|
}
|
|
1482
1508
|
revert(e) {
|
|
1483
1509
|
let { element: t, oldProperties: n } = e, r = t;
|
|
1484
|
-
if (n) for (let e of Object.keys(n))
|
|
1510
|
+
if (n) for (let e of Object.keys(n)) Lt(r, e, n[e]);
|
|
1485
1511
|
return [t];
|
|
1486
1512
|
}
|
|
1487
|
-
},
|
|
1488
|
-
function
|
|
1513
|
+
}, zt = "element.updateProperties";
|
|
1514
|
+
function Bt(e) {
|
|
1489
1515
|
let t = {};
|
|
1490
1516
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
1491
1517
|
return t;
|
|
1492
1518
|
}
|
|
1493
|
-
var
|
|
1519
|
+
var Vt = class {
|
|
1494
1520
|
commandStack;
|
|
1495
1521
|
static $inject = ["commandStack"];
|
|
1496
1522
|
constructor(e) {
|
|
1497
|
-
this.commandStack = e, e.registerHandler(
|
|
1523
|
+
this.commandStack = e, e.registerHandler(zt, Rt);
|
|
1498
1524
|
}
|
|
1499
1525
|
updateProperties(e, t) {
|
|
1500
|
-
this.commandStack.execute(
|
|
1526
|
+
this.commandStack.execute(zt, {
|
|
1501
1527
|
element: e,
|
|
1502
1528
|
properties: t
|
|
1503
1529
|
});
|
|
1504
1530
|
}
|
|
1505
1531
|
updateLabel(e, t) {
|
|
1506
1532
|
if (e.wardleyType === "note") {
|
|
1507
|
-
let { width: n, height: r } =
|
|
1533
|
+
let { width: n, height: r } = g(t), i = e.x + e.width / 2, a = e.y + e.height / 2;
|
|
1508
1534
|
this.updateProperties(e, {
|
|
1509
1535
|
wardleyLabel: t,
|
|
1510
1536
|
width: n,
|
|
@@ -1517,8 +1543,8 @@ var z = class {
|
|
|
1517
1543
|
this.updateProperties(e, { wardleyLabel: t });
|
|
1518
1544
|
}
|
|
1519
1545
|
evolveComponent(e, t, n = {}) {
|
|
1520
|
-
let r =
|
|
1521
|
-
r <= e.evolution || this.updateProperties(e, { movement:
|
|
1546
|
+
let r = Ht(t);
|
|
1547
|
+
r <= e.evolution || this.updateProperties(e, { movement: Bt({
|
|
1522
1548
|
targetEvolution: r,
|
|
1523
1549
|
newLabel: n.newLabel,
|
|
1524
1550
|
method: n.method
|
|
@@ -1543,12 +1569,12 @@ var z = class {
|
|
|
1543
1569
|
this.updateProperties(e, { color: t });
|
|
1544
1570
|
}
|
|
1545
1571
|
};
|
|
1546
|
-
function
|
|
1572
|
+
function Ht(e) {
|
|
1547
1573
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
1548
1574
|
}
|
|
1549
1575
|
//#endregion
|
|
1550
1576
|
//#region src/modeling/WardleyCopyPaste.ts
|
|
1551
|
-
var
|
|
1577
|
+
var Ut = 24, Wt = [
|
|
1552
1578
|
"wardleyType",
|
|
1553
1579
|
"evolution",
|
|
1554
1580
|
"visibility",
|
|
@@ -1565,13 +1591,13 @@ var Rt = 24, zt = [
|
|
|
1565
1591
|
"drawingPoints",
|
|
1566
1592
|
"closed",
|
|
1567
1593
|
"strokeStyle"
|
|
1568
|
-
],
|
|
1594
|
+
], Gt = [
|
|
1569
1595
|
"wardleyType",
|
|
1570
1596
|
"bidirectional",
|
|
1571
1597
|
"flowValue",
|
|
1572
1598
|
"linkLabel"
|
|
1573
1599
|
];
|
|
1574
|
-
function
|
|
1600
|
+
function Kt(e, t) {
|
|
1575
1601
|
let n = {};
|
|
1576
1602
|
for (let r of t) {
|
|
1577
1603
|
let t = e[r];
|
|
@@ -1579,7 +1605,7 @@ function Vt(e, t) {
|
|
|
1579
1605
|
}
|
|
1580
1606
|
return n;
|
|
1581
1607
|
}
|
|
1582
|
-
var
|
|
1608
|
+
var qt = class {
|
|
1583
1609
|
selection;
|
|
1584
1610
|
modeling;
|
|
1585
1611
|
elementFactory;
|
|
@@ -1602,21 +1628,21 @@ var Ht = class {
|
|
|
1602
1628
|
this.selection = e, this.modeling = t, this.elementFactory = n, this.elementRegistry = r, this.canvas = i, this.create = a, this.mouse = o;
|
|
1603
1629
|
}
|
|
1604
1630
|
copy() {
|
|
1605
|
-
let e = this.selection.get().filter((e) =>
|
|
1631
|
+
let e = this.selection.get().filter((e) => x(e));
|
|
1606
1632
|
if (!e.length) return !1;
|
|
1607
1633
|
let t = new Map(e.map((e, t) => [e, t])), n = [], r = /* @__PURE__ */ new Set();
|
|
1608
1634
|
for (let i of e) for (let e of [...i.incoming ?? [], ...i.outgoing ?? []]) {
|
|
1609
|
-
if (!
|
|
1635
|
+
if (!S(e) || r.has(e)) continue;
|
|
1610
1636
|
let i = t.get(e.source), a = t.get(e.target);
|
|
1611
1637
|
i === void 0 || a === void 0 || (r.add(e), n.push({
|
|
1612
1638
|
sourceIdx: i,
|
|
1613
1639
|
targetIdx: a,
|
|
1614
|
-
props:
|
|
1640
|
+
props: Kt(e, Gt)
|
|
1615
1641
|
}));
|
|
1616
1642
|
}
|
|
1617
1643
|
return this.clipboard = {
|
|
1618
1644
|
shapes: e.map((e) => ({
|
|
1619
|
-
props:
|
|
1645
|
+
props: Kt(e, Wt),
|
|
1620
1646
|
x: e.x,
|
|
1621
1647
|
y: e.y,
|
|
1622
1648
|
width: e.width,
|
|
@@ -1650,13 +1676,13 @@ var Ht = class {
|
|
|
1650
1676
|
...structuredClone(e.props),
|
|
1651
1677
|
source: n[e.sourceIdx],
|
|
1652
1678
|
target: n[e.targetIdx],
|
|
1653
|
-
waypoints: [
|
|
1679
|
+
waypoints: [Jt(n[e.sourceIdx]), Jt(n[e.targetIdx])]
|
|
1654
1680
|
}))
|
|
1655
1681
|
};
|
|
1656
1682
|
}
|
|
1657
1683
|
insertWithOffset(e) {
|
|
1658
1684
|
this.pasteCount++;
|
|
1659
|
-
let t =
|
|
1685
|
+
let t = Ut * this.pasteCount, n = Yt(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
|
|
1660
1686
|
x: n.cx + t,
|
|
1661
1687
|
y: n.cy + t
|
|
1662
1688
|
}, this.canvas.getRootElement());
|
|
@@ -1675,13 +1701,13 @@ var Ht = class {
|
|
|
1675
1701
|
});
|
|
1676
1702
|
}
|
|
1677
1703
|
};
|
|
1678
|
-
function
|
|
1704
|
+
function Jt(e) {
|
|
1679
1705
|
return {
|
|
1680
1706
|
x: e.x + e.width / 2,
|
|
1681
1707
|
y: e.y + e.height / 2
|
|
1682
1708
|
};
|
|
1683
1709
|
}
|
|
1684
|
-
function
|
|
1710
|
+
function Yt(e) {
|
|
1685
1711
|
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));
|
|
1686
1712
|
return {
|
|
1687
1713
|
cx: (t + r) / 2,
|
|
@@ -1690,12 +1716,12 @@ function Wt(e) {
|
|
|
1690
1716
|
}
|
|
1691
1717
|
//#endregion
|
|
1692
1718
|
//#region src/modeling/index.ts
|
|
1693
|
-
var
|
|
1719
|
+
var Xt = {
|
|
1694
1720
|
__depends__: [ge, ce],
|
|
1695
1721
|
__init__: ["wardleyModeling"],
|
|
1696
|
-
wardleyModeling: ["type",
|
|
1697
|
-
wardleyCopyPaste: ["type",
|
|
1698
|
-
},
|
|
1722
|
+
wardleyModeling: ["type", Vt],
|
|
1723
|
+
wardleyCopyPaste: ["type", qt]
|
|
1724
|
+
}, Zt = {
|
|
1699
1725
|
__depends__: [_e],
|
|
1700
1726
|
__init__: ["wardleyLassoBehavior"],
|
|
1701
1727
|
wardleyLassoBehavior: ["type", class {
|
|
@@ -1718,33 +1744,33 @@ var Gt = {
|
|
|
1718
1744
|
});
|
|
1719
1745
|
}
|
|
1720
1746
|
}]
|
|
1721
|
-
},
|
|
1747
|
+
}, Qt = /* @__PURE__ */ new Set([
|
|
1722
1748
|
"component",
|
|
1723
1749
|
"anchor",
|
|
1724
1750
|
"submap",
|
|
1725
1751
|
"pipeline"
|
|
1726
1752
|
]);
|
|
1727
|
-
function
|
|
1728
|
-
return
|
|
1753
|
+
function z(e) {
|
|
1754
|
+
return x(e) && Qt.has(e.wardleyType);
|
|
1729
1755
|
}
|
|
1730
|
-
function
|
|
1756
|
+
function $t(e, t) {
|
|
1731
1757
|
return (e.outgoing ?? []).some((e) => e.target === t) || (e.incoming ?? []).some((e) => e.source === t);
|
|
1732
1758
|
}
|
|
1733
|
-
var
|
|
1759
|
+
var en = class extends ve {
|
|
1734
1760
|
static $inject = ["eventBus"];
|
|
1735
1761
|
constructor(e) {
|
|
1736
1762
|
super(e);
|
|
1737
1763
|
}
|
|
1738
1764
|
init() {
|
|
1739
|
-
this.addRule("connection.start", (e) =>
|
|
1765
|
+
this.addRule("connection.start", (e) => z(e.source)), this.addRule("connection.create", (e) => {
|
|
1740
1766
|
let { source: t, target: n } = e;
|
|
1741
|
-
return !
|
|
1742
|
-
}), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) =>
|
|
1767
|
+
return !z(t) || !z(n) || t === n || $t(t, n) ? !1 : { wardleyType: "dependency" };
|
|
1768
|
+
}), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => C(e.shape) || Ne(e.shape));
|
|
1743
1769
|
}
|
|
1744
|
-
},
|
|
1770
|
+
}, tn = {
|
|
1745
1771
|
__init__: ["wardleyRules"],
|
|
1746
|
-
wardleyRules: ["type",
|
|
1747
|
-
},
|
|
1772
|
+
wardleyRules: ["type", en]
|
|
1773
|
+
}, nn = 8, rn = {
|
|
1748
1774
|
__init__: ["stageSnapping"],
|
|
1749
1775
|
stageSnapping: ["type", class {
|
|
1750
1776
|
static $inject = ["eventBus", "evolutionGrid"];
|
|
@@ -1760,7 +1786,7 @@ var Yt = class extends ve {
|
|
|
1760
1786
|
let t = e.context?.shape;
|
|
1761
1787
|
if (!t) return;
|
|
1762
1788
|
let r = t.x + t.width / 2 + e.dx;
|
|
1763
|
-
for (let t of n()) if (Math.abs(r - t) <=
|
|
1789
|
+
for (let t of n()) if (Math.abs(r - t) <= nn) {
|
|
1764
1790
|
let n = t - r;
|
|
1765
1791
|
e.dx += n, e.x += n;
|
|
1766
1792
|
break;
|
|
@@ -1772,7 +1798,7 @@ var Yt = class extends ve {
|
|
|
1772
1798
|
"resize.end"
|
|
1773
1799
|
], 1500, (e) => {
|
|
1774
1800
|
if (!e.originalEvent?.shiftKey && typeof e.x == "number") {
|
|
1775
|
-
for (let t of n()) if (Math.abs(e.x - t) <=
|
|
1801
|
+
for (let t of n()) if (Math.abs(e.x - t) <= nn) {
|
|
1776
1802
|
r(e, t);
|
|
1777
1803
|
break;
|
|
1778
1804
|
}
|
|
@@ -1780,45 +1806,45 @@ var Yt = class extends ve {
|
|
|
1780
1806
|
});
|
|
1781
1807
|
}
|
|
1782
1808
|
}]
|
|
1783
|
-
},
|
|
1784
|
-
draw:
|
|
1785
|
-
lasso:
|
|
1786
|
-
component: V(
|
|
1787
|
-
market: V(
|
|
1788
|
-
ecosystem: V(
|
|
1789
|
-
anchor:
|
|
1790
|
-
pipeline:
|
|
1791
|
-
note:
|
|
1792
|
-
annotation:
|
|
1793
|
-
accelerator:
|
|
1794
|
-
deaccelerator:
|
|
1795
|
-
submap:
|
|
1809
|
+
}, B = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="wardley-palette-svg">${e}</svg>`, V = (e = "") => `<circle cx="12" cy="12" r="7" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="2"/>${e}`, H = {
|
|
1810
|
+
draw: B(`<polyline points="3,18 8.5,7 14,14 21,4" fill="none" stroke="${_.ink}" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><circle cx="3" cy="18" r="2.2" fill="${_.componentFill}" stroke="${_.ink}" stroke-width="1.4"/>`),
|
|
1811
|
+
lasso: B(`<rect x="3" y="3" width="13" height="13" rx="2" fill="none" stroke="${_.ink}" stroke-width="1.5" stroke-dasharray="3 2.5"/><path d="M13.5 13.5l7 2.7-3 1.3-1.3 3z" fill="${_.ink}"/>`),
|
|
1812
|
+
component: B(V()),
|
|
1813
|
+
market: B(V(`<circle cx="12" cy="10" r="1.4" fill="${_.stroke}"/><circle cx="10.2" cy="13.4" r="1.4" fill="${_.stroke}"/><circle cx="13.8" cy="13.4" r="1.4" fill="${_.stroke}"/>`)),
|
|
1814
|
+
ecosystem: B(V(`<circle cx="12" cy="12" r="10" fill="none" stroke="${_.stroke}" stroke-width="1.25" stroke-dasharray="1.5 3" stroke-linecap="round"/>`)),
|
|
1815
|
+
anchor: B(`<path d="${D}" fill="${_.ink}"/>`),
|
|
1816
|
+
pipeline: B(`<rect x="9.5" y="2.5" width="5.5" height="5.5" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.5"/><rect x="2" y="10" width="20" height="9" rx="2" fill="none" stroke="${_.pipeline}" stroke-width="1.25" stroke-dasharray="3 2"/><circle cx="7" cy="14.5" r="2.2" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.2"/><circle cx="17" cy="14.5" r="2.2" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.2"/>`),
|
|
1817
|
+
note: B(`<g stroke="${_.noteText}" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="13" y2="16"/></g>`),
|
|
1818
|
+
annotation: B(`<circle cx="12" cy="12" r="8" fill="${_.annotationFill}" stroke="${_.stroke}" stroke-width="1.25"/>` + ((e, t) => `<text x="12" text-anchor="middle" font-family="${y.family}" ${t}>${e}</text>`)("1", `y="16" font-size="11" font-weight="700" fill="${_.stroke}"`)),
|
|
1819
|
+
accelerator: B(`<path d="${A}" fill="${_.accelerator}"/>`),
|
|
1820
|
+
deaccelerator: B(`<path d="${j}" fill="${_.deaccelerator}"/>`),
|
|
1821
|
+
submap: B(`<rect x="4" y="4" width="16" height="16" rx="3" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="2"/><rect x="7.5" y="7.5" width="9" height="9" rx="1.5" fill="none" stroke="${_.stroke}" stroke-width="1"/>`)
|
|
1796
1822
|
};
|
|
1797
|
-
function
|
|
1798
|
-
let t =
|
|
1799
|
-
fill:
|
|
1800
|
-
stroke:
|
|
1823
|
+
function U(e) {
|
|
1824
|
+
let t = v[e] ?? {
|
|
1825
|
+
fill: _.band,
|
|
1826
|
+
stroke: _.dependency
|
|
1801
1827
|
};
|
|
1802
|
-
return
|
|
1828
|
+
return B(`<rect x="2" y="6" width="20" height="12" rx="3" fill="${t.fill}" stroke="${t.stroke}" stroke-width="1.5" stroke-dasharray="3 2"/>`);
|
|
1803
1829
|
}
|
|
1804
1830
|
//#endregion
|
|
1805
1831
|
//#region src/palette/WardleyPaletteProvider.ts
|
|
1806
|
-
var
|
|
1832
|
+
var W = "wardley-1-blocks", G = "wardley-2-strategy", an = [
|
|
1807
1833
|
{
|
|
1808
1834
|
key: "component",
|
|
1809
1835
|
type: "component",
|
|
1810
1836
|
label: "Component",
|
|
1811
1837
|
title: "Component — C",
|
|
1812
|
-
icon:
|
|
1813
|
-
group:
|
|
1838
|
+
icon: H.component,
|
|
1839
|
+
group: W
|
|
1814
1840
|
},
|
|
1815
1841
|
{
|
|
1816
1842
|
key: "market",
|
|
1817
1843
|
type: "component",
|
|
1818
1844
|
label: "Market",
|
|
1819
1845
|
title: "Market component",
|
|
1820
|
-
icon:
|
|
1821
|
-
group:
|
|
1846
|
+
icon: H.market,
|
|
1847
|
+
group: W,
|
|
1822
1848
|
extra: { market: !0 }
|
|
1823
1849
|
},
|
|
1824
1850
|
{
|
|
@@ -1826,8 +1852,8 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1826
1852
|
type: "component",
|
|
1827
1853
|
label: "Ecosystem",
|
|
1828
1854
|
title: "Ecosystem component",
|
|
1829
|
-
icon:
|
|
1830
|
-
group:
|
|
1855
|
+
icon: H.ecosystem,
|
|
1856
|
+
group: W,
|
|
1831
1857
|
extra: { ecosystem: !0 }
|
|
1832
1858
|
},
|
|
1833
1859
|
{
|
|
@@ -1835,32 +1861,32 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1835
1861
|
type: "anchor",
|
|
1836
1862
|
label: "User",
|
|
1837
1863
|
title: "Anchor / User — U",
|
|
1838
|
-
icon:
|
|
1839
|
-
group:
|
|
1864
|
+
icon: H.anchor,
|
|
1865
|
+
group: W
|
|
1840
1866
|
},
|
|
1841
1867
|
{
|
|
1842
1868
|
key: "pipeline",
|
|
1843
1869
|
type: "pipeline",
|
|
1844
1870
|
label: "Pipeline",
|
|
1845
1871
|
title: "Pipeline",
|
|
1846
|
-
icon:
|
|
1847
|
-
group:
|
|
1872
|
+
icon: H.pipeline,
|
|
1873
|
+
group: W
|
|
1848
1874
|
},
|
|
1849
1875
|
{
|
|
1850
1876
|
key: "submap",
|
|
1851
1877
|
type: "submap",
|
|
1852
1878
|
label: "Submap",
|
|
1853
1879
|
title: "Submap",
|
|
1854
|
-
icon:
|
|
1855
|
-
group:
|
|
1880
|
+
icon: H.submap,
|
|
1881
|
+
group: W
|
|
1856
1882
|
},
|
|
1857
1883
|
{
|
|
1858
1884
|
key: "pioneers",
|
|
1859
1885
|
type: "attitude",
|
|
1860
1886
|
label: "Pioneers",
|
|
1861
1887
|
title: "Pioneers region",
|
|
1862
|
-
icon:
|
|
1863
|
-
group:
|
|
1888
|
+
icon: U("pioneers"),
|
|
1889
|
+
group: G,
|
|
1864
1890
|
extra: { attitudeKind: "pioneers" }
|
|
1865
1891
|
},
|
|
1866
1892
|
{
|
|
@@ -1868,8 +1894,8 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1868
1894
|
type: "attitude",
|
|
1869
1895
|
label: "Settlers",
|
|
1870
1896
|
title: "Settlers region",
|
|
1871
|
-
icon:
|
|
1872
|
-
group:
|
|
1897
|
+
icon: U("settlers"),
|
|
1898
|
+
group: G,
|
|
1873
1899
|
extra: { attitudeKind: "settlers" }
|
|
1874
1900
|
},
|
|
1875
1901
|
{
|
|
@@ -1877,8 +1903,8 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1877
1903
|
type: "attitude",
|
|
1878
1904
|
label: "Town Planners",
|
|
1879
1905
|
title: "Town Planners region",
|
|
1880
|
-
icon:
|
|
1881
|
-
group:
|
|
1906
|
+
icon: U("townplanners"),
|
|
1907
|
+
group: G,
|
|
1882
1908
|
extra: { attitudeKind: "townplanners" }
|
|
1883
1909
|
},
|
|
1884
1910
|
{
|
|
@@ -1886,8 +1912,8 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1886
1912
|
type: "accelerator",
|
|
1887
1913
|
label: "Accelerate",
|
|
1888
1914
|
title: "Accelerator",
|
|
1889
|
-
icon:
|
|
1890
|
-
group:
|
|
1915
|
+
icon: H.accelerator,
|
|
1916
|
+
group: G,
|
|
1891
1917
|
extra: { acceleratorDirection: "accelerate" }
|
|
1892
1918
|
},
|
|
1893
1919
|
{
|
|
@@ -1895,8 +1921,8 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1895
1921
|
type: "accelerator",
|
|
1896
1922
|
label: "Deaccelerate",
|
|
1897
1923
|
title: "Deaccelerator",
|
|
1898
|
-
icon:
|
|
1899
|
-
group:
|
|
1924
|
+
icon: H.deaccelerator,
|
|
1925
|
+
group: G,
|
|
1900
1926
|
extra: { acceleratorDirection: "deaccelerate" }
|
|
1901
1927
|
},
|
|
1902
1928
|
{
|
|
@@ -1904,10 +1930,10 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1904
1930
|
type: "note",
|
|
1905
1931
|
label: "Note",
|
|
1906
1932
|
title: "Note",
|
|
1907
|
-
icon:
|
|
1933
|
+
icon: H.note,
|
|
1908
1934
|
group: "wardley-3-notes"
|
|
1909
1935
|
}
|
|
1910
|
-
],
|
|
1936
|
+
], on = {
|
|
1911
1937
|
__init__: ["wardleyPaletteProvider"],
|
|
1912
1938
|
wardleyPaletteProvider: ["type", class {
|
|
1913
1939
|
create;
|
|
@@ -1929,15 +1955,15 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1929
1955
|
e["lasso-tool"] = {
|
|
1930
1956
|
group: "tools",
|
|
1931
1957
|
title: "Selection tool — L (or Shift+drag)",
|
|
1932
|
-
html: `<div class="entry wardley-palette-entry" title="Selection tool — L (or Shift+drag)">${
|
|
1958
|
+
html: `<div class="entry wardley-palette-entry" title="Selection tool — L (or Shift+drag)">${H.lasso}</div>`,
|
|
1933
1959
|
action: { click: (e) => this.lassoTool.activateSelection(e) }
|
|
1934
1960
|
}, e["draw-tool"] = {
|
|
1935
1961
|
group: "tools",
|
|
1936
1962
|
title: "Draw — click point by point, double-click/Enter finishes, click the start point to close",
|
|
1937
|
-
html: `<div class="entry wardley-palette-entry" title="Draw — click point by point, double-click/Enter finishes, click the start point to close">${
|
|
1963
|
+
html: `<div class="entry wardley-palette-entry" title="Draw — click point by point, double-click/Enter finishes, click the start point to close">${H.draw}</div>`,
|
|
1938
1964
|
action: { click: () => this.drawTool.toggle() }
|
|
1939
1965
|
};
|
|
1940
|
-
for (let t of
|
|
1966
|
+
for (let t of an) {
|
|
1941
1967
|
let n = (e) => {
|
|
1942
1968
|
let n = this.factory.createNew(t.type, t.label, t.extra ?? {});
|
|
1943
1969
|
this.create.start(e, n);
|
|
@@ -1955,86 +1981,86 @@ var G = "wardley-1-blocks", K = "wardley-2-strategy", $t = [
|
|
|
1955
1981
|
return e;
|
|
1956
1982
|
}
|
|
1957
1983
|
}]
|
|
1958
|
-
},
|
|
1984
|
+
}, K = "wardley-element-settings", q = {
|
|
1959
1985
|
id: "type",
|
|
1960
1986
|
name: "Type"
|
|
1961
|
-
},
|
|
1987
|
+
}, J = {
|
|
1962
1988
|
id: "method",
|
|
1963
1989
|
name: "Sourcing"
|
|
1964
|
-
},
|
|
1990
|
+
}, sn = {
|
|
1965
1991
|
id: "props",
|
|
1966
1992
|
name: "Properties"
|
|
1967
1993
|
};
|
|
1968
|
-
function
|
|
1994
|
+
function Y(e, t) {
|
|
1969
1995
|
return e ? `✓ ${t}` : t;
|
|
1970
1996
|
}
|
|
1971
|
-
var
|
|
1997
|
+
var cn = class {
|
|
1972
1998
|
modeling;
|
|
1973
1999
|
static $inject = ["popupMenu", "wardleyModeling"];
|
|
1974
2000
|
constructor(e, t) {
|
|
1975
|
-
this.modeling = t, e.registerProvider(
|
|
2001
|
+
this.modeling = t, e.registerProvider(K, this);
|
|
1976
2002
|
}
|
|
1977
2003
|
getPopupMenuEntries(e) {
|
|
1978
2004
|
let t = Array.isArray(e) ? e[0] : e;
|
|
1979
|
-
return
|
|
2005
|
+
return Me(t) ? this.componentEntries(t) : {};
|
|
1980
2006
|
}
|
|
1981
2007
|
componentEntries(e) {
|
|
1982
2008
|
let t = e.decorators ?? {}, n = t.ecosystem ? "ecosystem" : t.market ? "market" : "normal", r = t.method;
|
|
1983
2009
|
return {
|
|
1984
2010
|
"type-normal": {
|
|
1985
|
-
label:
|
|
1986
|
-
group:
|
|
2011
|
+
label: Y(n === "normal", "Normal"),
|
|
2012
|
+
group: q,
|
|
1987
2013
|
action: () => this.modeling.setMarketEcosystem(e, void 0)
|
|
1988
2014
|
},
|
|
1989
2015
|
"type-market": {
|
|
1990
|
-
label:
|
|
1991
|
-
group:
|
|
2016
|
+
label: Y(n === "market", "Market"),
|
|
2017
|
+
group: q,
|
|
1992
2018
|
action: () => this.modeling.setMarketEcosystem(e, "market")
|
|
1993
2019
|
},
|
|
1994
2020
|
"type-ecosystem": {
|
|
1995
|
-
label:
|
|
1996
|
-
group:
|
|
2021
|
+
label: Y(n === "ecosystem", "Ecosystem"),
|
|
2022
|
+
group: q,
|
|
1997
2023
|
action: () => this.modeling.setMarketEcosystem(e, "ecosystem")
|
|
1998
2024
|
},
|
|
1999
2025
|
"method-none": {
|
|
2000
|
-
label:
|
|
2001
|
-
group:
|
|
2026
|
+
label: Y(!r, "None"),
|
|
2027
|
+
group: J,
|
|
2002
2028
|
action: () => this.modeling.setMethod(e, void 0)
|
|
2003
2029
|
},
|
|
2004
2030
|
"method-build": {
|
|
2005
|
-
label:
|
|
2006
|
-
group:
|
|
2031
|
+
label: Y(r === "build", "Build"),
|
|
2032
|
+
group: J,
|
|
2007
2033
|
action: () => this.modeling.setMethod(e, "build")
|
|
2008
2034
|
},
|
|
2009
2035
|
"method-buy": {
|
|
2010
|
-
label:
|
|
2011
|
-
group:
|
|
2036
|
+
label: Y(r === "buy", "Buy"),
|
|
2037
|
+
group: J,
|
|
2012
2038
|
action: () => this.modeling.setMethod(e, "buy")
|
|
2013
2039
|
},
|
|
2014
2040
|
"method-outsource": {
|
|
2015
|
-
label:
|
|
2016
|
-
group:
|
|
2041
|
+
label: Y(r === "outsource", "Outsource"),
|
|
2042
|
+
group: J,
|
|
2017
2043
|
action: () => this.modeling.setMethod(e, "outsource")
|
|
2018
2044
|
},
|
|
2019
2045
|
"prop-inertia": {
|
|
2020
|
-
label:
|
|
2021
|
-
group:
|
|
2046
|
+
label: Y(!!t.inertia, "Inertia"),
|
|
2047
|
+
group: sn,
|
|
2022
2048
|
action: () => this.modeling.toggleInertia(e)
|
|
2023
2049
|
}
|
|
2024
2050
|
};
|
|
2025
2051
|
}
|
|
2026
|
-
},
|
|
2052
|
+
}, ln = {
|
|
2027
2053
|
__init__: ["wardleyElementSettings"],
|
|
2028
|
-
wardleyElementSettings: ["type",
|
|
2054
|
+
wardleyElementSettings: ["type", cn]
|
|
2029
2055
|
};
|
|
2030
2056
|
//#endregion
|
|
2031
2057
|
//#region src/context-pad/WardleyContextPadProvider.ts
|
|
2032
|
-
function
|
|
2033
|
-
return `<div class="entry wardley-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${
|
|
2058
|
+
function X(e, t, n = !1) {
|
|
2059
|
+
return `<div class="entry wardley-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${N(e)}</div>`;
|
|
2034
2060
|
}
|
|
2035
2061
|
//#endregion
|
|
2036
2062
|
//#region src/context-pad/index.ts
|
|
2037
|
-
var
|
|
2063
|
+
var un = {
|
|
2038
2064
|
__init__: ["wardleyContextPadProvider"],
|
|
2039
2065
|
wardleyContextPadProvider: ["type", class {
|
|
2040
2066
|
modeling;
|
|
@@ -2062,24 +2088,24 @@ var an = {
|
|
|
2062
2088
|
this.modeling = t, this.connect = n, this.create = r, this.popupMenu = i, this.wardleyModeling = a, this.labelEditing = o, this.evolveDragging = s, this.factory = c, this.colorPicker = l, e.registerProvider(this);
|
|
2063
2089
|
}
|
|
2064
2090
|
getContextPadEntries(e) {
|
|
2065
|
-
if (
|
|
2091
|
+
if (S(e)) {
|
|
2066
2092
|
let t = e, n = t.wardleyType === "flow";
|
|
2067
2093
|
return {
|
|
2068
2094
|
"edit-value": {
|
|
2069
2095
|
group: "edit",
|
|
2070
2096
|
title: n ? "Edit flow value" : "Edit link annotation",
|
|
2071
|
-
html:
|
|
2097
|
+
html: X(O, n ? "Edit flow value" : "Edit link annotation"),
|
|
2072
2098
|
action: { click: () => this.labelEditing.activateConnection(t) }
|
|
2073
2099
|
},
|
|
2074
2100
|
delete: {
|
|
2075
2101
|
group: "edit",
|
|
2076
2102
|
title: "Delete connection",
|
|
2077
|
-
html:
|
|
2103
|
+
html: X(k, "Delete connection"),
|
|
2078
2104
|
action: { click: () => this.modeling.removeElements([e]) }
|
|
2079
2105
|
}
|
|
2080
2106
|
};
|
|
2081
2107
|
}
|
|
2082
|
-
if (!
|
|
2108
|
+
if (!x(e)) return {};
|
|
2083
2109
|
let t = e, n = {};
|
|
2084
2110
|
if (t.wardleyType === "component" || t.wardleyType === "anchor" || t.wardleyType === "submap" || t.wardleyType === "pipeline") {
|
|
2085
2111
|
let e = (e) => {
|
|
@@ -2089,7 +2115,7 @@ var an = {
|
|
|
2089
2115
|
n.append = {
|
|
2090
2116
|
group: "edit",
|
|
2091
2117
|
title: "Append component (auto-connect)",
|
|
2092
|
-
html:
|
|
2118
|
+
html: X(Ke, "Append component", !0),
|
|
2093
2119
|
action: {
|
|
2094
2120
|
click: e,
|
|
2095
2121
|
dragstart: e
|
|
@@ -2101,7 +2127,7 @@ var an = {
|
|
|
2101
2127
|
n.connect = {
|
|
2102
2128
|
group: "edit",
|
|
2103
2129
|
title: "Connect to existing element",
|
|
2104
|
-
html:
|
|
2130
|
+
html: X(qe, "Connect to existing element", !0),
|
|
2105
2131
|
action: {
|
|
2106
2132
|
click: r,
|
|
2107
2133
|
dragstart: r
|
|
@@ -2112,7 +2138,7 @@ var an = {
|
|
|
2112
2138
|
if (t.movement) n["evolve-clear"] = {
|
|
2113
2139
|
group: "wardley",
|
|
2114
2140
|
title: "Remove evolve",
|
|
2115
|
-
html:
|
|
2141
|
+
html: X(Ye, "Remove evolve"),
|
|
2116
2142
|
action: { click: () => this.wardleyModeling.clearMovement(t) }
|
|
2117
2143
|
};
|
|
2118
2144
|
else if (t.evolution < .999) {
|
|
@@ -2120,7 +2146,7 @@ var an = {
|
|
|
2120
2146
|
n.evolve = {
|
|
2121
2147
|
group: "wardley",
|
|
2122
2148
|
title: "Evolve: drag to set the target maturity",
|
|
2123
|
-
html:
|
|
2149
|
+
html: X(Je, "Evolve: drag to set the target maturity", !0),
|
|
2124
2150
|
action: {
|
|
2125
2151
|
click: e,
|
|
2126
2152
|
dragstart: e
|
|
@@ -2130,10 +2156,10 @@ var an = {
|
|
|
2130
2156
|
n.settings = {
|
|
2131
2157
|
group: "wardley",
|
|
2132
2158
|
title: "Settings (type, sourcing, inertia)",
|
|
2133
|
-
html:
|
|
2159
|
+
html: X(at, "Settings"),
|
|
2134
2160
|
action: { click: (e) => {
|
|
2135
2161
|
let n = e;
|
|
2136
|
-
this.popupMenu.open(t,
|
|
2162
|
+
this.popupMenu.open(t, K, {
|
|
2137
2163
|
x: n.clientX,
|
|
2138
2164
|
y: n.clientY
|
|
2139
2165
|
});
|
|
@@ -2145,14 +2171,14 @@ var an = {
|
|
|
2145
2171
|
n["stroke-style"] = {
|
|
2146
2172
|
group: "wardley",
|
|
2147
2173
|
title: r,
|
|
2148
|
-
html:
|
|
2174
|
+
html: X(st, r),
|
|
2149
2175
|
action: { click: () => this.wardleyModeling.updateProperties(t, { strokeStyle: e }) }
|
|
2150
2176
|
};
|
|
2151
2177
|
}
|
|
2152
2178
|
n.color = {
|
|
2153
2179
|
group: "wardley",
|
|
2154
2180
|
title: "Color",
|
|
2155
|
-
html:
|
|
2181
|
+
html: X(ot, "Color"),
|
|
2156
2182
|
action: { click: (e) => {
|
|
2157
2183
|
let n = e;
|
|
2158
2184
|
this.colorPicker.open(t, n.clientX, n.clientY);
|
|
@@ -2162,17 +2188,17 @@ var an = {
|
|
|
2162
2188
|
return i && (n["open-link"] = {
|
|
2163
2189
|
group: "wardley",
|
|
2164
2190
|
title: `Open link (${i})`,
|
|
2165
|
-
html:
|
|
2191
|
+
html: X(qe, "Open link"),
|
|
2166
2192
|
action: { click: () => window.open(i, "_blank", "noopener") }
|
|
2167
2193
|
}), t.wardleyType !== "drawing" && (n["edit-label"] = {
|
|
2168
2194
|
group: "edit",
|
|
2169
2195
|
title: "Edit label",
|
|
2170
|
-
html:
|
|
2196
|
+
html: X(O, "Edit label"),
|
|
2171
2197
|
action: { click: () => this.labelEditing.activate(t) }
|
|
2172
2198
|
}), n.delete = {
|
|
2173
2199
|
group: "edit",
|
|
2174
2200
|
title: "Delete",
|
|
2175
|
-
html:
|
|
2201
|
+
html: X(k, "Delete"),
|
|
2176
2202
|
action: { click: () => this.modeling.removeElements([t]) }
|
|
2177
2203
|
}, n;
|
|
2178
2204
|
}
|
|
@@ -2180,10 +2206,10 @@ var an = {
|
|
|
2180
2206
|
};
|
|
2181
2207
|
//#endregion
|
|
2182
2208
|
//#region src/label-editing/WardleyLabelEditing.ts
|
|
2183
|
-
function
|
|
2209
|
+
function dn(e) {
|
|
2184
2210
|
return e.replace(/->/g, "→").replace(/;/g, ",").replace(/\[/g, "(").replace(/\]/g, ")").trim();
|
|
2185
2211
|
}
|
|
2186
|
-
var
|
|
2212
|
+
var fn = class {
|
|
2187
2213
|
canvas;
|
|
2188
2214
|
modeling;
|
|
2189
2215
|
factory;
|
|
@@ -2196,7 +2222,7 @@ var sn = class {
|
|
|
2196
2222
|
active = null;
|
|
2197
2223
|
constructor(e, t, n, r) {
|
|
2198
2224
|
this.canvas = t, this.modeling = n, this.factory = r, e.on("element.dblclick", (e) => {
|
|
2199
|
-
|
|
2225
|
+
x(e.element) ? this.activate(e.element) : S(e.element) && this.activateConnection(e.element);
|
|
2200
2226
|
}), e.on([
|
|
2201
2227
|
"element.mousedown",
|
|
2202
2228
|
"drag.init",
|
|
@@ -2215,7 +2241,7 @@ var sn = class {
|
|
|
2215
2241
|
c || (c = !0, s.removeEventListener("keydown", d), s.removeEventListener("blur", f), s.remove(), this.active = null);
|
|
2216
2242
|
}, u = () => {
|
|
2217
2243
|
if (c) return;
|
|
2218
|
-
let t =
|
|
2244
|
+
let t = dn(s.value), n = t && t !== e.wardleyLabel;
|
|
2219
2245
|
if (l(), !n) return;
|
|
2220
2246
|
let r = i ? t : this.factory.uniqueLabel(t, e.id);
|
|
2221
2247
|
this.modeling.updateLabel(e, r);
|
|
@@ -2270,10 +2296,10 @@ var sn = class {
|
|
|
2270
2296
|
cancel() {
|
|
2271
2297
|
this.active?.cleanup();
|
|
2272
2298
|
}
|
|
2273
|
-
},
|
|
2299
|
+
}, pn = {
|
|
2274
2300
|
__init__: ["wardleyLabelEditing"],
|
|
2275
|
-
wardleyLabelEditing: ["type",
|
|
2276
|
-
},
|
|
2301
|
+
wardleyLabelEditing: ["type", fn]
|
|
2302
|
+
}, mn = 2, hn = 10, gn = {
|
|
2277
2303
|
arrowleft: {
|
|
2278
2304
|
x: -1,
|
|
2279
2305
|
y: 0
|
|
@@ -2290,7 +2316,7 @@ var sn = class {
|
|
|
2290
2316
|
x: 0,
|
|
2291
2317
|
y: 1
|
|
2292
2318
|
}
|
|
2293
|
-
},
|
|
2319
|
+
}, _n = class {
|
|
2294
2320
|
static $inject = [
|
|
2295
2321
|
"canvas",
|
|
2296
2322
|
"commandStack",
|
|
@@ -2307,7 +2333,7 @@ var sn = class {
|
|
|
2307
2333
|
let u = e.getContainer();
|
|
2308
2334
|
u.hasAttribute("tabindex") || u.setAttribute("tabindex", "0");
|
|
2309
2335
|
let d = (e) => {
|
|
2310
|
-
if (
|
|
2336
|
+
if (vn(e.target)) return;
|
|
2311
2337
|
let l = e.ctrlKey || e.metaKey, u = e.key.toLowerCase();
|
|
2312
2338
|
if (l && u === "z" && !e.shiftKey) e.preventDefault(), t.undo();
|
|
2313
2339
|
else if (l && u === "z" && e.shiftKey || l && u === "y") e.preventDefault(), t.redo();
|
|
@@ -2328,11 +2354,11 @@ var sn = class {
|
|
|
2328
2354
|
e.preventDefault();
|
|
2329
2355
|
let t = s.getLastMoveEvent();
|
|
2330
2356
|
c.activateSelection(t ?? e, !!t);
|
|
2331
|
-
} else if (u in
|
|
2357
|
+
} else if (u in gn && !l) {
|
|
2332
2358
|
let t = n.get();
|
|
2333
2359
|
if (t.length) {
|
|
2334
2360
|
e.preventDefault();
|
|
2335
|
-
let n = e.shiftKey ?
|
|
2361
|
+
let n = e.shiftKey ? hn : mn, i = gn[u];
|
|
2336
2362
|
r.moveElements(t, {
|
|
2337
2363
|
x: i.x * n,
|
|
2338
2364
|
y: i.y * n
|
|
@@ -2343,21 +2369,21 @@ var sn = class {
|
|
|
2343
2369
|
document.addEventListener("keydown", d), l.on("diagram.destroy", () => document.removeEventListener("keydown", d));
|
|
2344
2370
|
}
|
|
2345
2371
|
};
|
|
2346
|
-
function
|
|
2372
|
+
function vn(e) {
|
|
2347
2373
|
if (!(e instanceof HTMLElement)) return !1;
|
|
2348
2374
|
let t = e.tagName;
|
|
2349
2375
|
return t === "INPUT" || t === "TEXTAREA" || e.isContentEditable;
|
|
2350
2376
|
}
|
|
2351
2377
|
//#endregion
|
|
2352
2378
|
//#region src/keyboard/index.ts
|
|
2353
|
-
var
|
|
2379
|
+
var yn = {
|
|
2354
2380
|
__init__: ["wardleyKeyboard"],
|
|
2355
|
-
wardleyKeyboard: ["type",
|
|
2356
|
-
},
|
|
2357
|
-
function
|
|
2381
|
+
wardleyKeyboard: ["type", _n]
|
|
2382
|
+
}, Z = "wardley.evolve", bn = .005, xn = "wardley-evolve-handle";
|
|
2383
|
+
function Sn(e) {
|
|
2358
2384
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
2359
2385
|
}
|
|
2360
|
-
var
|
|
2386
|
+
var Cn = class {
|
|
2361
2387
|
dragging;
|
|
2362
2388
|
static $inject = [
|
|
2363
2389
|
"eventBus",
|
|
@@ -2373,33 +2399,33 @@ var vn = class {
|
|
|
2373
2399
|
n === void 0 ? delete t.movement : t.movement = n, e.fire("element.changed", { element: t });
|
|
2374
2400
|
}, s = (e, t) => {
|
|
2375
2401
|
let r = i.getContainer().getBoundingClientRect(), a = i.viewbox(), o = a.x + (e - r.left) * (a.width / r.width);
|
|
2376
|
-
return
|
|
2402
|
+
return Sn(n.fromCanvas({
|
|
2377
2403
|
x: o,
|
|
2378
2404
|
y: t
|
|
2379
2405
|
}).evolution);
|
|
2380
2406
|
};
|
|
2381
2407
|
i.getContainer().addEventListener("mousedown", (e) => {
|
|
2382
2408
|
let t = e.target;
|
|
2383
|
-
if (!t?.closest(`.${
|
|
2409
|
+
if (!t?.closest(`.${xn}`)) return;
|
|
2384
2410
|
let n = t.closest("[data-element-id]")?.getAttribute("data-element-id"), i = n ? a.get(n) : void 0;
|
|
2385
2411
|
if (!i || i.wardleyType !== "component") return;
|
|
2386
2412
|
e.stopPropagation(), e.preventDefault();
|
|
2387
2413
|
let c = i.movement, l = i.y + i.height / 2, u, d = (e) => {
|
|
2388
2414
|
u = s(e.clientX, l), o(i, { targetEvolution: u });
|
|
2389
2415
|
}, f = () => {
|
|
2390
|
-
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", f), o(i, c), u !== void 0 && Math.abs(u - i.evolution) >
|
|
2416
|
+
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", f), o(i, c), u !== void 0 && Math.abs(u - i.evolution) > bn && r.evolveComponent(i, u);
|
|
2391
2417
|
};
|
|
2392
2418
|
document.addEventListener("mousemove", d), document.addEventListener("mouseup", f);
|
|
2393
|
-
}, !0), e.on(`${
|
|
2394
|
-
let { shape: t } = e.context, r = t.y + t.height / 2, i =
|
|
2419
|
+
}, !0), e.on(`${Z}.move`, (e) => {
|
|
2420
|
+
let { shape: t } = e.context, r = t.y + t.height / 2, i = Sn(n.fromCanvas({
|
|
2395
2421
|
x: e.x,
|
|
2396
2422
|
y: r
|
|
2397
2423
|
}).evolution);
|
|
2398
2424
|
e.context.target = i, o(t, { targetEvolution: i });
|
|
2399
|
-
}), e.on(`${
|
|
2425
|
+
}), e.on(`${Z}.end`, (e) => {
|
|
2400
2426
|
let t = e.context, { shape: n, target: i } = t;
|
|
2401
|
-
o(n, t.originalMovement), i !== void 0 && Math.abs(i - n.evolution) >
|
|
2402
|
-
}), e.on(`${
|
|
2427
|
+
o(n, t.originalMovement), i !== void 0 && Math.abs(i - n.evolution) > bn && r.evolveComponent(n, i), t.committed = !0;
|
|
2428
|
+
}), e.on(`${Z}.cleanup`, (e) => {
|
|
2403
2429
|
let t = e.context;
|
|
2404
2430
|
t && !t.committed && o(t.shape, t.originalMovement);
|
|
2405
2431
|
});
|
|
@@ -2409,15 +2435,15 @@ var vn = class {
|
|
|
2409
2435
|
shape: t,
|
|
2410
2436
|
...t.movement ? { originalMovement: t.movement } : {}
|
|
2411
2437
|
};
|
|
2412
|
-
this.dragging.init(e,
|
|
2438
|
+
this.dragging.init(e, Z, {
|
|
2413
2439
|
cursor: "ew-resize",
|
|
2414
2440
|
data: { context: n }
|
|
2415
2441
|
});
|
|
2416
2442
|
}
|
|
2417
|
-
},
|
|
2443
|
+
}, wn = {
|
|
2418
2444
|
__init__: ["wardleyEvolveDragging"],
|
|
2419
|
-
wardleyEvolveDragging: ["type",
|
|
2420
|
-
},
|
|
2445
|
+
wardleyEvolveDragging: ["type", Cn]
|
|
2446
|
+
}, Tn = 500, En = class {
|
|
2421
2447
|
static $inject = ["injector", "eventBus"];
|
|
2422
2448
|
constructor(e, t) {
|
|
2423
2449
|
let n = e.get("connectionPreview", !1), r = e.get("wardleyLabelEditing", !1);
|
|
@@ -2442,18 +2468,18 @@ var vn = class {
|
|
|
2442
2468
|
"create.cleanup"
|
|
2443
2469
|
], (e) => {
|
|
2444
2470
|
n.cleanUp(e.context);
|
|
2445
|
-
})), r && t.on("create.end",
|
|
2471
|
+
})), r && t.on("create.end", Tn, (e) => {
|
|
2446
2472
|
let { context: t } = e;
|
|
2447
2473
|
if (!t.source || !t.canExecute || !t.shape) return;
|
|
2448
2474
|
let n = t.shape;
|
|
2449
2475
|
setTimeout(() => r.activate(n), 0);
|
|
2450
2476
|
});
|
|
2451
2477
|
}
|
|
2452
|
-
},
|
|
2478
|
+
}, Dn = {
|
|
2453
2479
|
__depends__: [ye],
|
|
2454
2480
|
__init__: ["wardleyAppendBehavior"],
|
|
2455
|
-
wardleyAppendBehavior: ["type",
|
|
2456
|
-
},
|
|
2481
|
+
wardleyAppendBehavior: ["type", En]
|
|
2482
|
+
}, Q = class {
|
|
2457
2483
|
canvas;
|
|
2458
2484
|
modeling;
|
|
2459
2485
|
static $inject = [
|
|
@@ -2503,18 +2529,18 @@ var vn = class {
|
|
|
2503
2529
|
close() {
|
|
2504
2530
|
this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0));
|
|
2505
2531
|
}
|
|
2506
|
-
},
|
|
2532
|
+
}, On = {
|
|
2507
2533
|
__init__: ["wardleyColorPicker"],
|
|
2508
|
-
wardleyColorPicker: ["type",
|
|
2534
|
+
wardleyColorPicker: ["type", Q]
|
|
2509
2535
|
};
|
|
2510
2536
|
//#endregion
|
|
2511
2537
|
//#region src/ordering/WardleyOrderingProvider.ts
|
|
2512
2538
|
function $(e) {
|
|
2513
|
-
return
|
|
2539
|
+
return x(e) && (e.wardleyType === "attitude" || e.wardleyType === "pipeline");
|
|
2514
2540
|
}
|
|
2515
2541
|
//#endregion
|
|
2516
2542
|
//#region src/ordering/index.ts
|
|
2517
|
-
var
|
|
2543
|
+
var kn = {
|
|
2518
2544
|
__init__: ["wardleyOrderingProvider"],
|
|
2519
2545
|
wardleyOrderingProvider: ["type", class extends be {
|
|
2520
2546
|
static $inject = ["eventBus"];
|
|
@@ -2523,16 +2549,16 @@ var Tn = {
|
|
|
2523
2549
|
}
|
|
2524
2550
|
getOrdering(e, t) {
|
|
2525
2551
|
let n = t.children ?? [];
|
|
2526
|
-
return
|
|
2552
|
+
return S(e) ? {
|
|
2527
2553
|
parent: t,
|
|
2528
|
-
index: n.filter((t) => t !== e && ($(t) ||
|
|
2554
|
+
index: n.filter((t) => t !== e && ($(t) || S(t))).length
|
|
2529
2555
|
} : $(e) ? {
|
|
2530
2556
|
parent: t,
|
|
2531
2557
|
index: n.filter((t) => t !== e && $(t)).length
|
|
2532
2558
|
} : { parent: t };
|
|
2533
2559
|
}
|
|
2534
2560
|
}]
|
|
2535
|
-
},
|
|
2561
|
+
}, An = 12, jn = class {
|
|
2536
2562
|
canvas;
|
|
2537
2563
|
eventBus;
|
|
2538
2564
|
modeling;
|
|
@@ -2609,12 +2635,12 @@ var Tn = {
|
|
|
2609
2635
|
if (e.button !== 0 || this.isChromeTarget(e)) return;
|
|
2610
2636
|
e.preventDefault(), e.stopPropagation();
|
|
2611
2637
|
let t = this.toCanvasPoint(e), n = this.points[0];
|
|
2612
|
-
if (n && this.points.length >= 3 &&
|
|
2638
|
+
if (n && this.points.length >= 3 && Mn(t, n) <= An) {
|
|
2613
2639
|
this.finishClosed();
|
|
2614
2640
|
return;
|
|
2615
2641
|
}
|
|
2616
2642
|
let r = this.points[this.points.length - 1];
|
|
2617
|
-
if (r &&
|
|
2643
|
+
if (r && Mn(t, r) <= An) {
|
|
2618
2644
|
this.points.length >= 2 && this.finish();
|
|
2619
2645
|
return;
|
|
2620
2646
|
}
|
|
@@ -2635,7 +2661,7 @@ var Tn = {
|
|
|
2635
2661
|
l(t, u(f("polyline"), {
|
|
2636
2662
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
2637
2663
|
fill: "none",
|
|
2638
|
-
stroke:
|
|
2664
|
+
stroke: _.ink,
|
|
2639
2665
|
"stroke-width": 2,
|
|
2640
2666
|
"stroke-linecap": "round",
|
|
2641
2667
|
"stroke-linejoin": "round",
|
|
@@ -2646,8 +2672,8 @@ var Tn = {
|
|
|
2646
2672
|
cx: r.x,
|
|
2647
2673
|
cy: r.y,
|
|
2648
2674
|
r: this.points.length >= 3 ? 5 : 3,
|
|
2649
|
-
fill:
|
|
2650
|
-
stroke:
|
|
2675
|
+
fill: _.paper,
|
|
2676
|
+
stroke: _.ink,
|
|
2651
2677
|
"stroke-width": 1.5
|
|
2652
2678
|
})), this.points.length >= 2) {
|
|
2653
2679
|
let e = this.points[this.points.length - 1];
|
|
@@ -2655,8 +2681,8 @@ var Tn = {
|
|
|
2655
2681
|
cx: e.x,
|
|
2656
2682
|
cy: e.y,
|
|
2657
2683
|
r: 5,
|
|
2658
|
-
fill:
|
|
2659
|
-
stroke:
|
|
2684
|
+
fill: _.paper,
|
|
2685
|
+
stroke: _.ink,
|
|
2660
2686
|
"stroke-width": 1.5
|
|
2661
2687
|
}));
|
|
2662
2688
|
}
|
|
@@ -2666,12 +2692,12 @@ var Tn = {
|
|
|
2666
2692
|
this.layer &&= (p(this.layer), null);
|
|
2667
2693
|
}
|
|
2668
2694
|
};
|
|
2669
|
-
function
|
|
2695
|
+
function Mn(e, t) {
|
|
2670
2696
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
2671
2697
|
}
|
|
2672
2698
|
//#endregion
|
|
2673
2699
|
//#region src/draw-tool/WardleyDrawingHandles.ts
|
|
2674
|
-
var
|
|
2700
|
+
var Nn = class {
|
|
2675
2701
|
eventBus;
|
|
2676
2702
|
canvas;
|
|
2677
2703
|
modeling;
|
|
@@ -2688,7 +2714,7 @@ var kn = class {
|
|
|
2688
2714
|
constructor(e, t, n, r) {
|
|
2689
2715
|
this.eventBus = e, this.canvas = t, this.modeling = n, this.grid = r, e.on("selection.changed", (e) => {
|
|
2690
2716
|
let t = e.newSelection ?? [], n = t.length === 1 ? t[0] : null;
|
|
2691
|
-
this.attach(
|
|
2717
|
+
this.attach(x(n) && n.wardleyType === "drawing" ? n : null);
|
|
2692
2718
|
}), e.on("element.changed", (e) => {
|
|
2693
2719
|
this.shape && e.element === this.shape && this.render();
|
|
2694
2720
|
}), e.on(["diagram.clear", "diagram.destroy"], () => this.attach(null));
|
|
@@ -2711,8 +2737,8 @@ var kn = class {
|
|
|
2711
2737
|
cx: e.x,
|
|
2712
2738
|
cy: e.y,
|
|
2713
2739
|
r: 5,
|
|
2714
|
-
fill:
|
|
2715
|
-
stroke:
|
|
2740
|
+
fill: _.paper,
|
|
2741
|
+
stroke: _.ink,
|
|
2716
2742
|
"stroke-width": 1.5,
|
|
2717
2743
|
class: "wardley-drawing-handle"
|
|
2718
2744
|
});
|
|
@@ -2749,7 +2775,7 @@ var kn = class {
|
|
|
2749
2775
|
let n = this.canvas.getLayer("wardley-drawing-handles", 1100), r = u(f(t ? "polygon" : "polyline"), {
|
|
2750
2776
|
points: e.map((e) => `${e.x},${e.y}`).join(" "),
|
|
2751
2777
|
fill: "none",
|
|
2752
|
-
stroke:
|
|
2778
|
+
stroke: _.ink,
|
|
2753
2779
|
"stroke-width": 1.5,
|
|
2754
2780
|
"stroke-dasharray": "5 4",
|
|
2755
2781
|
"pointer-events": "none"
|
|
@@ -2772,20 +2798,20 @@ var kn = class {
|
|
|
2772
2798
|
};
|
|
2773
2799
|
//#endregion
|
|
2774
2800
|
//#region src/draw-tool/WardleyDrawingHitProvider.ts
|
|
2775
|
-
function
|
|
2776
|
-
return
|
|
2801
|
+
function Pn(e) {
|
|
2802
|
+
return x(e) && e.wardleyType === "drawing";
|
|
2777
2803
|
}
|
|
2778
|
-
var
|
|
2804
|
+
var Fn = class {
|
|
2779
2805
|
static $inject = ["eventBus", "interactionEvents"];
|
|
2780
2806
|
constructor(e, t) {
|
|
2781
2807
|
e.on("interactionEvents.createHit", (e) => {
|
|
2782
|
-
if (!(!
|
|
2808
|
+
if (!(!Pn(e.element) || !e.gfx)) return In(e.element, e.gfx), !1;
|
|
2783
2809
|
}), e.on("interactionEvents.updateHit", (e) => {
|
|
2784
|
-
if (!(!
|
|
2810
|
+
if (!(!Pn(e.element) || !e.gfx)) return t.removeHits(e.gfx), In(e.element, e.gfx), !1;
|
|
2785
2811
|
});
|
|
2786
2812
|
}
|
|
2787
2813
|
};
|
|
2788
|
-
function
|
|
2814
|
+
function In(e, t) {
|
|
2789
2815
|
let n = e.drawingPoints ?? [], r = f(e.closed ? "polygon" : "polyline");
|
|
2790
2816
|
u(r, {
|
|
2791
2817
|
points: n.map((e) => `${e.x},${e.y}`).join(" "),
|
|
@@ -2798,16 +2824,16 @@ function Mn(e, t) {
|
|
|
2798
2824
|
}
|
|
2799
2825
|
//#endregion
|
|
2800
2826
|
//#region src/draw-tool/index.ts
|
|
2801
|
-
var
|
|
2827
|
+
var Ln = {
|
|
2802
2828
|
__init__: [
|
|
2803
2829
|
"wardleyDrawTool",
|
|
2804
2830
|
"wardleyDrawingHandles",
|
|
2805
2831
|
"wardleyDrawingHitProvider"
|
|
2806
2832
|
],
|
|
2807
|
-
wardleyDrawTool: ["type",
|
|
2808
|
-
wardleyDrawingHandles: ["type",
|
|
2809
|
-
wardleyDrawingHitProvider: ["type",
|
|
2810
|
-
},
|
|
2833
|
+
wardleyDrawTool: ["type", jn],
|
|
2834
|
+
wardleyDrawingHandles: ["type", Nn],
|
|
2835
|
+
wardleyDrawingHitProvider: ["type", Fn]
|
|
2836
|
+
}, Rn = class extends It {
|
|
2811
2837
|
_getModules() {
|
|
2812
2838
|
return [
|
|
2813
2839
|
...super._getModules(),
|
|
@@ -2821,21 +2847,21 @@ var Nn = {
|
|
|
2821
2847
|
pe,
|
|
2822
2848
|
me,
|
|
2823
2849
|
he,
|
|
2824
|
-
Gt,
|
|
2825
2850
|
Xt,
|
|
2851
|
+
tn,
|
|
2826
2852
|
Ge,
|
|
2827
|
-
Qt,
|
|
2828
|
-
en,
|
|
2829
|
-
an,
|
|
2830
|
-
cn,
|
|
2831
|
-
mn,
|
|
2832
|
-
yn,
|
|
2833
2853
|
rn,
|
|
2834
|
-
|
|
2854
|
+
on,
|
|
2855
|
+
un,
|
|
2856
|
+
pn,
|
|
2857
|
+
yn,
|
|
2835
2858
|
wn,
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2859
|
+
ln,
|
|
2860
|
+
Dn,
|
|
2861
|
+
On,
|
|
2862
|
+
Zt,
|
|
2863
|
+
kn,
|
|
2864
|
+
Ln
|
|
2839
2865
|
];
|
|
2840
2866
|
}
|
|
2841
2867
|
undo() {
|
|
@@ -2852,6 +2878,6 @@ var Nn = {
|
|
|
2852
2878
|
}
|
|
2853
2879
|
};
|
|
2854
2880
|
//#endregion
|
|
2855
|
-
export {
|
|
2881
|
+
export { _ as COLORS, Le as EvolutionGrid, ut as ICON_ADD, ct as ICON_ASPECT_RATIO, $e as ICON_CODE, Qe as ICON_DATA_OBJECT, k as ICON_DELETE, et as ICON_DOWNLOAD, O as ICON_EDIT, nt as ICON_FOLDER_OPEN, rt as ICON_IMAGE, lt as ICON_MENU, it as ICON_NEW, D as ICON_PERSON, Ze as ICON_REDO, tt as ICON_SHARE, Xe as ICON_UNDO, dt as ICON_VISIBILITY, m as MIRAGON, Rn as Modeler, Te as NOTE_COLORS, It as NavigatedViewer, h as PLOT, K as POPUP_PROVIDER_ID, Pt as PanConstraint, Ft as PanConstraintModule, De as ROOT_ID, Dt as Viewer, En as WardleyAppendBehavior, ke as WardleyBaseViewer, Q as WardleyColorPicker, Ae as WardleyElementFactory, cn as WardleyElementSettingsProvider, Cn as WardleyEvolveDragging, Tt as WardleyExporter, wt as WardleyImporter, fn as WardleyLabelEditing, Vt as WardleyModeling, P as WardleyRenderer, en as WardleyRules, Ge as evolutionConstraintModule, E as evolutionGridModule, N as iconMarkup, Et as ioModule, Me as isComponent, C as isPipeline, S as isWardleyConnection, x as isWardleyShape, pn as labelEditingModule, Ee as saveSVG, rn as stageSnappingModule, Dn as wardleyAppendModule, On as wardleyColorPickerModule, un as wardleyContextPadModule, xt as wardleyDrawModule, wn as wardleyEvolveModule, yn as wardleyKeyboardModule, Pe as wardleyModelModule, Xt as wardleyModelingModule, on as wardleyPaletteModule, ln as wardleyPopupModule, tn as wardleyRulesModule };
|
|
2856
2882
|
|
|
2857
2883
|
//# sourceMappingURL=index.js.map
|