@webskill/sdk 0.21.0 → 0.22.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/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +1012 -130
- package/dist/{approval-DwN2o2QG.js → approval-DWQlDPbY.js} +102 -16
- package/dist/arc-8U_6NQWm.js +130 -0
- package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
- package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
- package/dist/array-DQfpQNY8.js +8 -0
- package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
- package/dist/browser.d.ts +444 -48
- package/dist/browser.js +1771 -91
- package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
- package/dist/channel-CZxxLrG7.js +9 -0
- package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
- package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
- package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
- package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
- package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
- package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
- package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
- package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
- package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
- package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
- package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
- package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
- package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
- package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
- package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
- package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
- package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
- package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
- package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
- package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
- package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
- package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
- package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
- package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
- package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
- package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
- package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
- package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
- package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
- package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
- package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
- package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
- package/dist/defaultLocale-B_EoOkSF.js +249 -0
- package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
- package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
- package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
- package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
- package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
- package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
- package/dist/dist-UajCDt3n.js +92 -0
- package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
- package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
- package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
- package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
- package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
- package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
- package/dist/{toolSource-C9oNuKmr.js → geometry-wx5ZTYzi.js} +162 -12
- package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
- package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
- package/dist/governance.d.ts +3 -3
- package/dist/graphlib-tk9gQYuN.js +4194 -0
- package/dist/{index-B8Tgmpwh.d.ts → index-BiO9_XRk.d.ts} +2 -2
- package/dist/{index-CYLt5u4L.d.ts → index-CjwdZQOS.d.ts} +700 -12
- package/dist/{index-DHopiH_m.d.ts → index-YPd8ZSEa.d.ts} +156 -9
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
- package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
- package/dist/init-CMOIWdg-.js +16 -0
- package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
- package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
- package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
- package/dist/katex-BcRRvyh_.js +26465 -0
- package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
- package/dist/line-LgV8iVMV.js +48 -0
- package/dist/linear-BWKR0Tqd.js +393 -0
- package/dist/linkedDocument-CIuh_Yp0.js +416 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
- package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
- package/dist/mermaid.core-DMtwGCHy.js +1756 -0
- package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
- package/dist/node.d.ts +3 -3
- package/dist/node.js +2 -2
- package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
- package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
- package/dist/ordinal-CxA6GHQS.js +84 -0
- package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
- package/dist/path-C27Z2Bjv.js +106 -0
- package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
- package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
- package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
- package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
- package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
- package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
- package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
- package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
- package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
- package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
- package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
- package/dist/rough.cjs-AmDd_NQk.js +1395 -0
- package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
- package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
- package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
- package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-B24Jjjry-BY1H7Krp.d.ts} +1 -1
- package/dist/src-NkhI3UMl.js +2653 -0
- package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
- package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
- package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
- package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
- package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
- package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BM5FI9oN.d.ts} +59 -8
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +3718 -77
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
- package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
- package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
- package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
- package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-Dy-Zjv0y.js} +1 -1
- package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
- package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
- package/package.json +1 -1
- package/dist/linkedDocument-C0gj1sMq.js +0 -245
|
@@ -0,0 +1,1227 @@
|
|
|
1
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
2
|
+
import { p as select_default } from "./src-NkhI3UMl.js";
|
|
3
|
+
import { H as setAccDescription, U as setAccTitle, a as clear, c as configureSvgSize, q as setDiagramTitle, v as getAccDescription, w as getDiagramTitle, x as getConfig2, y as getAccTitle } from "./chunk-O7XYJQB3-B6K0KOSL.js";
|
|
4
|
+
import { t as arc_default } from "./arc-8U_6NQWm.js";
|
|
5
|
+
import { t as getIconStyles } from "./chunk-5VM5RSS4-BBxa48HL.js";
|
|
6
|
+
import { a as drawRect, n as drawBackgroundRect, o as drawText, s as getNoteRect } from "./chunk-GWA4HPMP-B6vN3fkL.js";
|
|
7
|
+
|
|
8
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-ZHPQQLJL.mjs
|
|
9
|
+
var parser = (function() {
|
|
10
|
+
var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
|
|
11
|
+
for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
|
|
12
|
+
return o2;
|
|
13
|
+
}, "o"), $V0 = [
|
|
14
|
+
6,
|
|
15
|
+
8,
|
|
16
|
+
10,
|
|
17
|
+
11,
|
|
18
|
+
12,
|
|
19
|
+
14,
|
|
20
|
+
16,
|
|
21
|
+
17,
|
|
22
|
+
18
|
|
23
|
+
], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 14];
|
|
24
|
+
var parser2 = {
|
|
25
|
+
trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
|
|
26
|
+
yy: {},
|
|
27
|
+
symbols_: {
|
|
28
|
+
"error": 2,
|
|
29
|
+
"start": 3,
|
|
30
|
+
"journey": 4,
|
|
31
|
+
"document": 5,
|
|
32
|
+
"EOF": 6,
|
|
33
|
+
"line": 7,
|
|
34
|
+
"SPACE": 8,
|
|
35
|
+
"statement": 9,
|
|
36
|
+
"NEWLINE": 10,
|
|
37
|
+
"title": 11,
|
|
38
|
+
"acc_title": 12,
|
|
39
|
+
"acc_title_value": 13,
|
|
40
|
+
"acc_descr": 14,
|
|
41
|
+
"acc_descr_value": 15,
|
|
42
|
+
"acc_descr_multiline_value": 16,
|
|
43
|
+
"section": 17,
|
|
44
|
+
"taskName": 18,
|
|
45
|
+
"taskData": 19,
|
|
46
|
+
"$accept": 0,
|
|
47
|
+
"$end": 1
|
|
48
|
+
},
|
|
49
|
+
terminals_: {
|
|
50
|
+
2: "error",
|
|
51
|
+
4: "journey",
|
|
52
|
+
6: "EOF",
|
|
53
|
+
8: "SPACE",
|
|
54
|
+
10: "NEWLINE",
|
|
55
|
+
11: "title",
|
|
56
|
+
12: "acc_title",
|
|
57
|
+
13: "acc_title_value",
|
|
58
|
+
14: "acc_descr",
|
|
59
|
+
15: "acc_descr_value",
|
|
60
|
+
16: "acc_descr_multiline_value",
|
|
61
|
+
17: "section",
|
|
62
|
+
18: "taskName",
|
|
63
|
+
19: "taskData"
|
|
64
|
+
},
|
|
65
|
+
productions_: [
|
|
66
|
+
0,
|
|
67
|
+
[3, 3],
|
|
68
|
+
[5, 0],
|
|
69
|
+
[5, 2],
|
|
70
|
+
[7, 2],
|
|
71
|
+
[7, 1],
|
|
72
|
+
[7, 1],
|
|
73
|
+
[7, 1],
|
|
74
|
+
[9, 1],
|
|
75
|
+
[9, 2],
|
|
76
|
+
[9, 2],
|
|
77
|
+
[9, 1],
|
|
78
|
+
[9, 1],
|
|
79
|
+
[9, 2]
|
|
80
|
+
],
|
|
81
|
+
performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
|
|
82
|
+
var $0 = $$.length - 1;
|
|
83
|
+
switch (yystate) {
|
|
84
|
+
case 1: return $$[$0 - 1];
|
|
85
|
+
case 2:
|
|
86
|
+
this.$ = [];
|
|
87
|
+
break;
|
|
88
|
+
case 3:
|
|
89
|
+
$$[$0 - 1].push($$[$0]);
|
|
90
|
+
this.$ = $$[$0 - 1];
|
|
91
|
+
break;
|
|
92
|
+
case 4:
|
|
93
|
+
case 5:
|
|
94
|
+
this.$ = $$[$0];
|
|
95
|
+
break;
|
|
96
|
+
case 6:
|
|
97
|
+
case 7:
|
|
98
|
+
this.$ = [];
|
|
99
|
+
break;
|
|
100
|
+
case 8:
|
|
101
|
+
yy.setDiagramTitle($$[$0].substr(6));
|
|
102
|
+
this.$ = $$[$0].substr(6);
|
|
103
|
+
break;
|
|
104
|
+
case 9:
|
|
105
|
+
this.$ = $$[$0].trim();
|
|
106
|
+
yy.setAccTitle(this.$);
|
|
107
|
+
break;
|
|
108
|
+
case 10:
|
|
109
|
+
case 11:
|
|
110
|
+
this.$ = $$[$0].trim();
|
|
111
|
+
yy.setAccDescription(this.$);
|
|
112
|
+
break;
|
|
113
|
+
case 12:
|
|
114
|
+
yy.addSection($$[$0].substr(8));
|
|
115
|
+
this.$ = $$[$0].substr(8);
|
|
116
|
+
break;
|
|
117
|
+
case 13:
|
|
118
|
+
yy.addTask($$[$0 - 1], $$[$0]);
|
|
119
|
+
this.$ = "task";
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}, "anonymous"),
|
|
123
|
+
table: [
|
|
124
|
+
{
|
|
125
|
+
3: 1,
|
|
126
|
+
4: [1, 2]
|
|
127
|
+
},
|
|
128
|
+
{ 1: [3] },
|
|
129
|
+
o($V0, [2, 2], { 5: 3 }),
|
|
130
|
+
{
|
|
131
|
+
6: [1, 4],
|
|
132
|
+
7: 5,
|
|
133
|
+
8: [1, 6],
|
|
134
|
+
9: 7,
|
|
135
|
+
10: [1, 8],
|
|
136
|
+
11: $V1,
|
|
137
|
+
12: $V2,
|
|
138
|
+
14: $V3,
|
|
139
|
+
16: $V4,
|
|
140
|
+
17: $V5,
|
|
141
|
+
18: $V6
|
|
142
|
+
},
|
|
143
|
+
o($V0, [2, 7], { 1: [2, 1] }),
|
|
144
|
+
o($V0, [2, 3]),
|
|
145
|
+
{
|
|
146
|
+
9: 15,
|
|
147
|
+
11: $V1,
|
|
148
|
+
12: $V2,
|
|
149
|
+
14: $V3,
|
|
150
|
+
16: $V4,
|
|
151
|
+
17: $V5,
|
|
152
|
+
18: $V6
|
|
153
|
+
},
|
|
154
|
+
o($V0, [2, 5]),
|
|
155
|
+
o($V0, [2, 6]),
|
|
156
|
+
o($V0, [2, 8]),
|
|
157
|
+
{ 13: [1, 16] },
|
|
158
|
+
{ 15: [1, 17] },
|
|
159
|
+
o($V0, [2, 11]),
|
|
160
|
+
o($V0, [2, 12]),
|
|
161
|
+
{ 19: [1, 18] },
|
|
162
|
+
o($V0, [2, 4]),
|
|
163
|
+
o($V0, [2, 9]),
|
|
164
|
+
o($V0, [2, 10]),
|
|
165
|
+
o($V0, [2, 13])
|
|
166
|
+
],
|
|
167
|
+
defaultActions: {},
|
|
168
|
+
parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
|
|
169
|
+
if (hash.recoverable) this.trace(str);
|
|
170
|
+
else {
|
|
171
|
+
var error = new Error(str);
|
|
172
|
+
error.hash = hash;
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
}, "parseError"),
|
|
176
|
+
parse: /* @__PURE__ */ __name(function parse(input) {
|
|
177
|
+
var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
|
|
178
|
+
var args = lstack.slice.call(arguments, 1);
|
|
179
|
+
var lexer2 = Object.create(this.lexer);
|
|
180
|
+
var sharedState = { yy: {} };
|
|
181
|
+
for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
|
|
182
|
+
lexer2.setInput(input, sharedState.yy);
|
|
183
|
+
sharedState.yy.lexer = lexer2;
|
|
184
|
+
sharedState.yy.parser = this;
|
|
185
|
+
if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
|
|
186
|
+
var yyloc = lexer2.yylloc;
|
|
187
|
+
lstack.push(yyloc);
|
|
188
|
+
var ranges = lexer2.options && lexer2.options.ranges;
|
|
189
|
+
if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
|
|
190
|
+
else this.parseError = Object.getPrototypeOf(this).parseError;
|
|
191
|
+
function popStack(n) {
|
|
192
|
+
stack.length = stack.length - 2 * n;
|
|
193
|
+
vstack.length = vstack.length - n;
|
|
194
|
+
lstack.length = lstack.length - n;
|
|
195
|
+
}
|
|
196
|
+
__name(popStack, "popStack");
|
|
197
|
+
function lex() {
|
|
198
|
+
var token = tstack.pop() || lexer2.lex() || EOF;
|
|
199
|
+
if (typeof token !== "number") {
|
|
200
|
+
if (token instanceof Array) {
|
|
201
|
+
tstack = token;
|
|
202
|
+
token = tstack.pop();
|
|
203
|
+
}
|
|
204
|
+
token = self.symbols_[token] || token;
|
|
205
|
+
}
|
|
206
|
+
return token;
|
|
207
|
+
}
|
|
208
|
+
__name(lex, "lex");
|
|
209
|
+
var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
|
|
210
|
+
while (true) {
|
|
211
|
+
state = stack[stack.length - 1];
|
|
212
|
+
if (this.defaultActions[state]) action = this.defaultActions[state];
|
|
213
|
+
else {
|
|
214
|
+
if (symbol === null || typeof symbol == "undefined") symbol = lex();
|
|
215
|
+
action = table[state] && table[state][symbol];
|
|
216
|
+
}
|
|
217
|
+
if (typeof action === "undefined" || !action.length || !action[0]) {
|
|
218
|
+
var errStr = "";
|
|
219
|
+
expected = [];
|
|
220
|
+
for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
|
|
221
|
+
if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
|
|
222
|
+
else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
|
|
223
|
+
this.parseError(errStr, {
|
|
224
|
+
text: lexer2.match,
|
|
225
|
+
token: this.terminals_[symbol] || symbol,
|
|
226
|
+
line: lexer2.yylineno,
|
|
227
|
+
loc: yyloc,
|
|
228
|
+
expected
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
|
|
232
|
+
switch (action[0]) {
|
|
233
|
+
case 1:
|
|
234
|
+
stack.push(symbol);
|
|
235
|
+
vstack.push(lexer2.yytext);
|
|
236
|
+
lstack.push(lexer2.yylloc);
|
|
237
|
+
stack.push(action[1]);
|
|
238
|
+
symbol = null;
|
|
239
|
+
if (!preErrorSymbol) {
|
|
240
|
+
yyleng = lexer2.yyleng;
|
|
241
|
+
yytext = lexer2.yytext;
|
|
242
|
+
yylineno = lexer2.yylineno;
|
|
243
|
+
yyloc = lexer2.yylloc;
|
|
244
|
+
if (recovering > 0) recovering--;
|
|
245
|
+
} else {
|
|
246
|
+
symbol = preErrorSymbol;
|
|
247
|
+
preErrorSymbol = null;
|
|
248
|
+
}
|
|
249
|
+
break;
|
|
250
|
+
case 2:
|
|
251
|
+
len = this.productions_[action[1]][1];
|
|
252
|
+
yyval.$ = vstack[vstack.length - len];
|
|
253
|
+
yyval._$ = {
|
|
254
|
+
first_line: lstack[lstack.length - (len || 1)].first_line,
|
|
255
|
+
last_line: lstack[lstack.length - 1].last_line,
|
|
256
|
+
first_column: lstack[lstack.length - (len || 1)].first_column,
|
|
257
|
+
last_column: lstack[lstack.length - 1].last_column
|
|
258
|
+
};
|
|
259
|
+
if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
|
260
|
+
r = this.performAction.apply(yyval, [
|
|
261
|
+
yytext,
|
|
262
|
+
yyleng,
|
|
263
|
+
yylineno,
|
|
264
|
+
sharedState.yy,
|
|
265
|
+
action[1],
|
|
266
|
+
vstack,
|
|
267
|
+
lstack
|
|
268
|
+
].concat(args));
|
|
269
|
+
if (typeof r !== "undefined") return r;
|
|
270
|
+
if (len) {
|
|
271
|
+
stack = stack.slice(0, -1 * len * 2);
|
|
272
|
+
vstack = vstack.slice(0, -1 * len);
|
|
273
|
+
lstack = lstack.slice(0, -1 * len);
|
|
274
|
+
}
|
|
275
|
+
stack.push(this.productions_[action[1]][0]);
|
|
276
|
+
vstack.push(yyval.$);
|
|
277
|
+
lstack.push(yyval._$);
|
|
278
|
+
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
|
279
|
+
stack.push(newState);
|
|
280
|
+
break;
|
|
281
|
+
case 3: return true;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return true;
|
|
285
|
+
}, "parse")
|
|
286
|
+
};
|
|
287
|
+
parser2.lexer = /* @__PURE__ */ (function() {
|
|
288
|
+
return {
|
|
289
|
+
EOF: 1,
|
|
290
|
+
parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
|
|
291
|
+
if (this.yy.parser) this.yy.parser.parseError(str, hash);
|
|
292
|
+
else throw new Error(str);
|
|
293
|
+
}, "parseError"),
|
|
294
|
+
setInput: /* @__PURE__ */ __name(function(input, yy) {
|
|
295
|
+
this.yy = yy || this.yy || {};
|
|
296
|
+
this._input = input;
|
|
297
|
+
this._more = this._backtrack = this.done = false;
|
|
298
|
+
this.yylineno = this.yyleng = 0;
|
|
299
|
+
this.yytext = this.matched = this.match = "";
|
|
300
|
+
this.conditionStack = ["INITIAL"];
|
|
301
|
+
this.yylloc = {
|
|
302
|
+
first_line: 1,
|
|
303
|
+
first_column: 0,
|
|
304
|
+
last_line: 1,
|
|
305
|
+
last_column: 0
|
|
306
|
+
};
|
|
307
|
+
if (this.options.ranges) this.yylloc.range = [0, 0];
|
|
308
|
+
this.offset = 0;
|
|
309
|
+
return this;
|
|
310
|
+
}, "setInput"),
|
|
311
|
+
input: /* @__PURE__ */ __name(function() {
|
|
312
|
+
var ch = this._input[0];
|
|
313
|
+
this.yytext += ch;
|
|
314
|
+
this.yyleng++;
|
|
315
|
+
this.offset++;
|
|
316
|
+
this.match += ch;
|
|
317
|
+
this.matched += ch;
|
|
318
|
+
if (ch.match(/(?:\r\n?|\n).*/g)) {
|
|
319
|
+
this.yylineno++;
|
|
320
|
+
this.yylloc.last_line++;
|
|
321
|
+
} else this.yylloc.last_column++;
|
|
322
|
+
if (this.options.ranges) this.yylloc.range[1]++;
|
|
323
|
+
this._input = this._input.slice(1);
|
|
324
|
+
return ch;
|
|
325
|
+
}, "input"),
|
|
326
|
+
unput: /* @__PURE__ */ __name(function(ch) {
|
|
327
|
+
var len = ch.length;
|
|
328
|
+
var lines = ch.split(/(?:\r\n?|\n)/g);
|
|
329
|
+
this._input = ch + this._input;
|
|
330
|
+
this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
|
331
|
+
this.offset -= len;
|
|
332
|
+
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
|
333
|
+
this.match = this.match.substr(0, this.match.length - 1);
|
|
334
|
+
this.matched = this.matched.substr(0, this.matched.length - 1);
|
|
335
|
+
if (lines.length - 1) this.yylineno -= lines.length - 1;
|
|
336
|
+
var r = this.yylloc.range;
|
|
337
|
+
this.yylloc = {
|
|
338
|
+
first_line: this.yylloc.first_line,
|
|
339
|
+
last_line: this.yylineno + 1,
|
|
340
|
+
first_column: this.yylloc.first_column,
|
|
341
|
+
last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
|
342
|
+
};
|
|
343
|
+
if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
|
344
|
+
this.yyleng = this.yytext.length;
|
|
345
|
+
return this;
|
|
346
|
+
}, "unput"),
|
|
347
|
+
more: /* @__PURE__ */ __name(function() {
|
|
348
|
+
this._more = true;
|
|
349
|
+
return this;
|
|
350
|
+
}, "more"),
|
|
351
|
+
reject: /* @__PURE__ */ __name(function() {
|
|
352
|
+
if (this.options.backtrack_lexer) this._backtrack = true;
|
|
353
|
+
else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
|
|
354
|
+
text: "",
|
|
355
|
+
token: null,
|
|
356
|
+
line: this.yylineno
|
|
357
|
+
});
|
|
358
|
+
return this;
|
|
359
|
+
}, "reject"),
|
|
360
|
+
less: /* @__PURE__ */ __name(function(n) {
|
|
361
|
+
this.unput(this.match.slice(n));
|
|
362
|
+
}, "less"),
|
|
363
|
+
pastInput: /* @__PURE__ */ __name(function() {
|
|
364
|
+
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
|
365
|
+
return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
|
|
366
|
+
}, "pastInput"),
|
|
367
|
+
upcomingInput: /* @__PURE__ */ __name(function() {
|
|
368
|
+
var next = this.match;
|
|
369
|
+
if (next.length < 20) next += this._input.substr(0, 20 - next.length);
|
|
370
|
+
return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
371
|
+
}, "upcomingInput"),
|
|
372
|
+
showPosition: /* @__PURE__ */ __name(function() {
|
|
373
|
+
var pre = this.pastInput();
|
|
374
|
+
var c = new Array(pre.length + 1).join("-");
|
|
375
|
+
return pre + this.upcomingInput() + "\n" + c + "^";
|
|
376
|
+
}, "showPosition"),
|
|
377
|
+
test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
|
|
378
|
+
var token, lines, backup;
|
|
379
|
+
if (this.options.backtrack_lexer) {
|
|
380
|
+
backup = {
|
|
381
|
+
yylineno: this.yylineno,
|
|
382
|
+
yylloc: {
|
|
383
|
+
first_line: this.yylloc.first_line,
|
|
384
|
+
last_line: this.last_line,
|
|
385
|
+
first_column: this.yylloc.first_column,
|
|
386
|
+
last_column: this.yylloc.last_column
|
|
387
|
+
},
|
|
388
|
+
yytext: this.yytext,
|
|
389
|
+
match: this.match,
|
|
390
|
+
matches: this.matches,
|
|
391
|
+
matched: this.matched,
|
|
392
|
+
yyleng: this.yyleng,
|
|
393
|
+
offset: this.offset,
|
|
394
|
+
_more: this._more,
|
|
395
|
+
_input: this._input,
|
|
396
|
+
yy: this.yy,
|
|
397
|
+
conditionStack: this.conditionStack.slice(0),
|
|
398
|
+
done: this.done
|
|
399
|
+
};
|
|
400
|
+
if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
|
|
401
|
+
}
|
|
402
|
+
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
|
403
|
+
if (lines) this.yylineno += lines.length;
|
|
404
|
+
this.yylloc = {
|
|
405
|
+
first_line: this.yylloc.last_line,
|
|
406
|
+
last_line: this.yylineno + 1,
|
|
407
|
+
first_column: this.yylloc.last_column,
|
|
408
|
+
last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
|
409
|
+
};
|
|
410
|
+
this.yytext += match[0];
|
|
411
|
+
this.match += match[0];
|
|
412
|
+
this.matches = match;
|
|
413
|
+
this.yyleng = this.yytext.length;
|
|
414
|
+
if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
|
415
|
+
this._more = false;
|
|
416
|
+
this._backtrack = false;
|
|
417
|
+
this._input = this._input.slice(match[0].length);
|
|
418
|
+
this.matched += match[0];
|
|
419
|
+
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
|
420
|
+
if (this.done && this._input) this.done = false;
|
|
421
|
+
if (token) return token;
|
|
422
|
+
else if (this._backtrack) {
|
|
423
|
+
for (var k in backup) this[k] = backup[k];
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
return false;
|
|
427
|
+
}, "test_match"),
|
|
428
|
+
next: /* @__PURE__ */ __name(function() {
|
|
429
|
+
if (this.done) return this.EOF;
|
|
430
|
+
if (!this._input) this.done = true;
|
|
431
|
+
var token, match, tempMatch, index;
|
|
432
|
+
if (!this._more) {
|
|
433
|
+
this.yytext = "";
|
|
434
|
+
this.match = "";
|
|
435
|
+
}
|
|
436
|
+
var rules = this._currentRules();
|
|
437
|
+
for (var i = 0; i < rules.length; i++) {
|
|
438
|
+
tempMatch = this._input.match(this.rules[rules[i]]);
|
|
439
|
+
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
|
440
|
+
match = tempMatch;
|
|
441
|
+
index = i;
|
|
442
|
+
if (this.options.backtrack_lexer) {
|
|
443
|
+
token = this.test_match(tempMatch, rules[i]);
|
|
444
|
+
if (token !== false) return token;
|
|
445
|
+
else if (this._backtrack) {
|
|
446
|
+
match = false;
|
|
447
|
+
continue;
|
|
448
|
+
} else return false;
|
|
449
|
+
} else if (!this.options.flex) break;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
if (match) {
|
|
453
|
+
token = this.test_match(match, rules[index]);
|
|
454
|
+
if (token !== false) return token;
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
if (this._input === "") return this.EOF;
|
|
458
|
+
else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
|
|
459
|
+
text: "",
|
|
460
|
+
token: null,
|
|
461
|
+
line: this.yylineno
|
|
462
|
+
});
|
|
463
|
+
}, "next"),
|
|
464
|
+
lex: /* @__PURE__ */ __name(function lex() {
|
|
465
|
+
var r = this.next();
|
|
466
|
+
if (r) return r;
|
|
467
|
+
else return this.lex();
|
|
468
|
+
}, "lex"),
|
|
469
|
+
begin: /* @__PURE__ */ __name(function begin(condition) {
|
|
470
|
+
this.conditionStack.push(condition);
|
|
471
|
+
}, "begin"),
|
|
472
|
+
popState: /* @__PURE__ */ __name(function popState() {
|
|
473
|
+
if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
|
|
474
|
+
else return this.conditionStack[0];
|
|
475
|
+
}, "popState"),
|
|
476
|
+
_currentRules: /* @__PURE__ */ __name(function _currentRules() {
|
|
477
|
+
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
|
478
|
+
else return this.conditions["INITIAL"].rules;
|
|
479
|
+
}, "_currentRules"),
|
|
480
|
+
topState: /* @__PURE__ */ __name(function topState(n) {
|
|
481
|
+
n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
|
482
|
+
if (n >= 0) return this.conditionStack[n];
|
|
483
|
+
else return "INITIAL";
|
|
484
|
+
}, "topState"),
|
|
485
|
+
pushState: /* @__PURE__ */ __name(function pushState(condition) {
|
|
486
|
+
this.begin(condition);
|
|
487
|
+
}, "pushState"),
|
|
488
|
+
stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
|
|
489
|
+
return this.conditionStack.length;
|
|
490
|
+
}, "stateStackSize"),
|
|
491
|
+
options: { "case-insensitive": true },
|
|
492
|
+
performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
|
493
|
+
switch ($avoiding_name_collisions) {
|
|
494
|
+
case 0: break;
|
|
495
|
+
case 1: break;
|
|
496
|
+
case 2: return 10;
|
|
497
|
+
case 3: break;
|
|
498
|
+
case 4: break;
|
|
499
|
+
case 5: return 4;
|
|
500
|
+
case 6: return 11;
|
|
501
|
+
case 7:
|
|
502
|
+
this.begin("acc_title");
|
|
503
|
+
return 12;
|
|
504
|
+
case 8:
|
|
505
|
+
this.popState();
|
|
506
|
+
return "acc_title_value";
|
|
507
|
+
case 9:
|
|
508
|
+
this.begin("acc_descr");
|
|
509
|
+
return 14;
|
|
510
|
+
case 10:
|
|
511
|
+
this.popState();
|
|
512
|
+
return "acc_descr_value";
|
|
513
|
+
case 11:
|
|
514
|
+
this.begin("acc_descr_multiline");
|
|
515
|
+
break;
|
|
516
|
+
case 12:
|
|
517
|
+
this.popState();
|
|
518
|
+
break;
|
|
519
|
+
case 13: return "acc_descr_multiline_value";
|
|
520
|
+
case 14: return 17;
|
|
521
|
+
case 15: return 18;
|
|
522
|
+
case 16: return 19;
|
|
523
|
+
case 17: return ":";
|
|
524
|
+
case 18: return 6;
|
|
525
|
+
case 19: return "INVALID";
|
|
526
|
+
}
|
|
527
|
+
}, "anonymous"),
|
|
528
|
+
rules: [
|
|
529
|
+
/^(?:%(?!\{)[^\n]*)/i,
|
|
530
|
+
/^(?:[^\}]%%[^\n]*)/i,
|
|
531
|
+
/^(?:[\n]+)/i,
|
|
532
|
+
/^(?:\s+)/i,
|
|
533
|
+
/^(?:#[^\n]*)/i,
|
|
534
|
+
/^(?:journey\b)/i,
|
|
535
|
+
/^(?:title\s[^#\n;]+)/i,
|
|
536
|
+
/^(?:accTitle\s*:\s*)/i,
|
|
537
|
+
/^(?:(?!\n||)*[^\n]*)/i,
|
|
538
|
+
/^(?:accDescr\s*:\s*)/i,
|
|
539
|
+
/^(?:(?!\n||)*[^\n]*)/i,
|
|
540
|
+
/^(?:accDescr\s*\{\s*)/i,
|
|
541
|
+
/^(?:[\}])/i,
|
|
542
|
+
/^(?:[^\}]*)/i,
|
|
543
|
+
/^(?:section\s[^#:\n;]+)/i,
|
|
544
|
+
/^(?:[^#:\n;]+)/i,
|
|
545
|
+
/^(?::[^#\n;]+)/i,
|
|
546
|
+
/^(?::)/i,
|
|
547
|
+
/^(?:$)/i,
|
|
548
|
+
/^(?:.)/i
|
|
549
|
+
],
|
|
550
|
+
conditions: {
|
|
551
|
+
"acc_descr_multiline": {
|
|
552
|
+
"rules": [12, 13],
|
|
553
|
+
"inclusive": false
|
|
554
|
+
},
|
|
555
|
+
"acc_descr": {
|
|
556
|
+
"rules": [10],
|
|
557
|
+
"inclusive": false
|
|
558
|
+
},
|
|
559
|
+
"acc_title": {
|
|
560
|
+
"rules": [8],
|
|
561
|
+
"inclusive": false
|
|
562
|
+
},
|
|
563
|
+
"INITIAL": {
|
|
564
|
+
"rules": [
|
|
565
|
+
0,
|
|
566
|
+
1,
|
|
567
|
+
2,
|
|
568
|
+
3,
|
|
569
|
+
4,
|
|
570
|
+
5,
|
|
571
|
+
6,
|
|
572
|
+
7,
|
|
573
|
+
9,
|
|
574
|
+
11,
|
|
575
|
+
14,
|
|
576
|
+
15,
|
|
577
|
+
16,
|
|
578
|
+
17,
|
|
579
|
+
18,
|
|
580
|
+
19
|
|
581
|
+
],
|
|
582
|
+
"inclusive": true
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
})();
|
|
587
|
+
function Parser() {
|
|
588
|
+
this.yy = {};
|
|
589
|
+
}
|
|
590
|
+
__name(Parser, "Parser");
|
|
591
|
+
Parser.prototype = parser2;
|
|
592
|
+
parser2.Parser = Parser;
|
|
593
|
+
return new Parser();
|
|
594
|
+
})();
|
|
595
|
+
parser.parser = parser;
|
|
596
|
+
var journey_default = parser;
|
|
597
|
+
var currentSection = "";
|
|
598
|
+
var sections = [];
|
|
599
|
+
var tasks = [];
|
|
600
|
+
var rawTasks = [];
|
|
601
|
+
var clear2 = /* @__PURE__ */ __name(function() {
|
|
602
|
+
sections.length = 0;
|
|
603
|
+
tasks.length = 0;
|
|
604
|
+
currentSection = "";
|
|
605
|
+
rawTasks.length = 0;
|
|
606
|
+
clear();
|
|
607
|
+
}, "clear");
|
|
608
|
+
var addSection = /* @__PURE__ */ __name(function(txt) {
|
|
609
|
+
currentSection = txt;
|
|
610
|
+
sections.push(txt);
|
|
611
|
+
}, "addSection");
|
|
612
|
+
var getSections = /* @__PURE__ */ __name(function() {
|
|
613
|
+
return sections;
|
|
614
|
+
}, "getSections");
|
|
615
|
+
var getTasks = /* @__PURE__ */ __name(function() {
|
|
616
|
+
let allItemsProcessed = compileTasks();
|
|
617
|
+
const maxDepth = 100;
|
|
618
|
+
let iterationCount = 0;
|
|
619
|
+
while (!allItemsProcessed && iterationCount < maxDepth) {
|
|
620
|
+
allItemsProcessed = compileTasks();
|
|
621
|
+
iterationCount++;
|
|
622
|
+
}
|
|
623
|
+
tasks.push(...rawTasks);
|
|
624
|
+
return tasks;
|
|
625
|
+
}, "getTasks");
|
|
626
|
+
var updateActors = /* @__PURE__ */ __name(function() {
|
|
627
|
+
const tempActors = [];
|
|
628
|
+
tasks.forEach((task) => {
|
|
629
|
+
if (task.people) tempActors.push(...task.people);
|
|
630
|
+
});
|
|
631
|
+
return [...new Set(tempActors)].sort();
|
|
632
|
+
}, "updateActors");
|
|
633
|
+
var addTask = /* @__PURE__ */ __name(function(descr, taskData) {
|
|
634
|
+
const pieces = taskData.substr(1).split(":");
|
|
635
|
+
let score = 0;
|
|
636
|
+
let peeps = [];
|
|
637
|
+
if (pieces.length === 1) {
|
|
638
|
+
score = Number(pieces[0]);
|
|
639
|
+
peeps = [];
|
|
640
|
+
} else {
|
|
641
|
+
score = Number(pieces[0]);
|
|
642
|
+
peeps = pieces[1].split(",");
|
|
643
|
+
}
|
|
644
|
+
const peopleList = peeps.map((s) => s.trim());
|
|
645
|
+
const rawTask = {
|
|
646
|
+
section: currentSection,
|
|
647
|
+
type: currentSection,
|
|
648
|
+
people: peopleList,
|
|
649
|
+
task: descr,
|
|
650
|
+
score
|
|
651
|
+
};
|
|
652
|
+
rawTasks.push(rawTask);
|
|
653
|
+
}, "addTask");
|
|
654
|
+
var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
|
|
655
|
+
const newTask = {
|
|
656
|
+
section: currentSection,
|
|
657
|
+
type: currentSection,
|
|
658
|
+
description: descr,
|
|
659
|
+
task: descr,
|
|
660
|
+
classes: []
|
|
661
|
+
};
|
|
662
|
+
tasks.push(newTask);
|
|
663
|
+
}, "addTaskOrg");
|
|
664
|
+
var compileTasks = /* @__PURE__ */ __name(function() {
|
|
665
|
+
const compileTask = /* @__PURE__ */ __name(function(pos) {
|
|
666
|
+
return rawTasks[pos].processed;
|
|
667
|
+
}, "compileTask");
|
|
668
|
+
let allProcessed = true;
|
|
669
|
+
for (const [i, rawTask] of rawTasks.entries()) {
|
|
670
|
+
compileTask(i);
|
|
671
|
+
allProcessed = allProcessed && rawTask.processed;
|
|
672
|
+
}
|
|
673
|
+
return allProcessed;
|
|
674
|
+
}, "compileTasks");
|
|
675
|
+
var journeyDb_default = {
|
|
676
|
+
getConfig: /* @__PURE__ */ __name(() => getConfig2().journey, "getConfig"),
|
|
677
|
+
clear: clear2,
|
|
678
|
+
setDiagramTitle,
|
|
679
|
+
getDiagramTitle,
|
|
680
|
+
setAccTitle,
|
|
681
|
+
getAccTitle,
|
|
682
|
+
setAccDescription,
|
|
683
|
+
getAccDescription,
|
|
684
|
+
addSection,
|
|
685
|
+
getSections,
|
|
686
|
+
getTasks,
|
|
687
|
+
addTask,
|
|
688
|
+
addTaskOrg,
|
|
689
|
+
getActors: /* @__PURE__ */ __name(function() {
|
|
690
|
+
return updateActors();
|
|
691
|
+
}, "getActors")
|
|
692
|
+
};
|
|
693
|
+
var styles_default = /* @__PURE__ */ __name((options) => `.label {
|
|
694
|
+
font-family: ${options.fontFamily};
|
|
695
|
+
color: ${options.textColor};
|
|
696
|
+
}
|
|
697
|
+
.mouth {
|
|
698
|
+
stroke: #666;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
line {
|
|
702
|
+
stroke: ${options.textColor}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.legend {
|
|
706
|
+
fill: ${options.textColor};
|
|
707
|
+
font-family: ${options.fontFamily};
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
.label text {
|
|
711
|
+
fill: #333;
|
|
712
|
+
}
|
|
713
|
+
.label {
|
|
714
|
+
color: ${options.textColor}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.face {
|
|
718
|
+
${options.faceColor ? `fill: ${options.faceColor}` : "fill: #FFF8DC"};
|
|
719
|
+
stroke: #999;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.node rect,
|
|
723
|
+
.node circle,
|
|
724
|
+
.node ellipse,
|
|
725
|
+
.node polygon,
|
|
726
|
+
.node path {
|
|
727
|
+
fill: ${options.mainBkg};
|
|
728
|
+
stroke: ${options.nodeBorder};
|
|
729
|
+
stroke-width: 1px;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.node .label {
|
|
733
|
+
text-align: center;
|
|
734
|
+
}
|
|
735
|
+
.node.clickable {
|
|
736
|
+
cursor: pointer;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.arrowheadPath {
|
|
740
|
+
fill: ${options.arrowheadColor};
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
.edgePaths .path {
|
|
744
|
+
stroke: ${options.lineColor};
|
|
745
|
+
stroke-width: 1.5px;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.flowchart-link {
|
|
749
|
+
stroke: ${options.lineColor};
|
|
750
|
+
fill: none;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
.edgeLabel {
|
|
754
|
+
background-color: ${options.edgeLabelBackground};
|
|
755
|
+
rect {
|
|
756
|
+
opacity: 0.5;
|
|
757
|
+
}
|
|
758
|
+
text-align: center;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.cluster rect {
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.cluster text {
|
|
765
|
+
fill: ${options.titleColor};
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
div.mermaidTooltip {
|
|
769
|
+
position: absolute;
|
|
770
|
+
text-align: center;
|
|
771
|
+
max-width: 200px;
|
|
772
|
+
padding: 2px;
|
|
773
|
+
font-family: ${options.fontFamily};
|
|
774
|
+
font-size: 12px;
|
|
775
|
+
background: ${options.tertiaryColor};
|
|
776
|
+
border: 1px solid ${options.border2};
|
|
777
|
+
border-radius: 2px;
|
|
778
|
+
pointer-events: none;
|
|
779
|
+
z-index: 100;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
.task-type-0, .section-type-0 {
|
|
783
|
+
${options.fillType0 ? `fill: ${options.fillType0}` : ""};
|
|
784
|
+
}
|
|
785
|
+
.task-type-1, .section-type-1 {
|
|
786
|
+
${options.fillType0 ? `fill: ${options.fillType1}` : ""};
|
|
787
|
+
}
|
|
788
|
+
.task-type-2, .section-type-2 {
|
|
789
|
+
${options.fillType0 ? `fill: ${options.fillType2}` : ""};
|
|
790
|
+
}
|
|
791
|
+
.task-type-3, .section-type-3 {
|
|
792
|
+
${options.fillType0 ? `fill: ${options.fillType3}` : ""};
|
|
793
|
+
}
|
|
794
|
+
.task-type-4, .section-type-4 {
|
|
795
|
+
${options.fillType0 ? `fill: ${options.fillType4}` : ""};
|
|
796
|
+
}
|
|
797
|
+
.task-type-5, .section-type-5 {
|
|
798
|
+
${options.fillType0 ? `fill: ${options.fillType5}` : ""};
|
|
799
|
+
}
|
|
800
|
+
.task-type-6, .section-type-6 {
|
|
801
|
+
${options.fillType0 ? `fill: ${options.fillType6}` : ""};
|
|
802
|
+
}
|
|
803
|
+
.task-type-7, .section-type-7 {
|
|
804
|
+
${options.fillType0 ? `fill: ${options.fillType7}` : ""};
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.actor-0 {
|
|
808
|
+
${options.actor0 ? `fill: ${options.actor0}` : ""};
|
|
809
|
+
}
|
|
810
|
+
.actor-1 {
|
|
811
|
+
${options.actor1 ? `fill: ${options.actor1}` : ""};
|
|
812
|
+
}
|
|
813
|
+
.actor-2 {
|
|
814
|
+
${options.actor2 ? `fill: ${options.actor2}` : ""};
|
|
815
|
+
}
|
|
816
|
+
.actor-3 {
|
|
817
|
+
${options.actor3 ? `fill: ${options.actor3}` : ""};
|
|
818
|
+
}
|
|
819
|
+
.actor-4 {
|
|
820
|
+
${options.actor4 ? `fill: ${options.actor4}` : ""};
|
|
821
|
+
}
|
|
822
|
+
.actor-5 {
|
|
823
|
+
${options.actor5 ? `fill: ${options.actor5}` : ""};
|
|
824
|
+
}
|
|
825
|
+
${getIconStyles()}
|
|
826
|
+
`, "getStyles");
|
|
827
|
+
var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
|
|
828
|
+
return drawRect(elem, rectData);
|
|
829
|
+
}, "drawRect");
|
|
830
|
+
var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
|
|
831
|
+
const radius = 15;
|
|
832
|
+
const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
|
|
833
|
+
const face = element.append("g");
|
|
834
|
+
face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
|
|
835
|
+
face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
|
|
836
|
+
function smile(face2) {
|
|
837
|
+
const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
|
|
838
|
+
face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
|
|
839
|
+
}
|
|
840
|
+
__name(smile, "smile");
|
|
841
|
+
function sad(face2) {
|
|
842
|
+
const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
|
|
843
|
+
face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
|
|
844
|
+
}
|
|
845
|
+
__name(sad, "sad");
|
|
846
|
+
function ambivalent(face2) {
|
|
847
|
+
face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
|
|
848
|
+
}
|
|
849
|
+
__name(ambivalent, "ambivalent");
|
|
850
|
+
if (faceData.score > 3) smile(face);
|
|
851
|
+
else if (faceData.score < 3) sad(face);
|
|
852
|
+
else ambivalent(face);
|
|
853
|
+
return circleElement;
|
|
854
|
+
}, "drawFace");
|
|
855
|
+
var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
|
|
856
|
+
const circleElement = element.append("circle");
|
|
857
|
+
circleElement.attr("cx", circleData.cx);
|
|
858
|
+
circleElement.attr("cy", circleData.cy);
|
|
859
|
+
circleElement.attr("class", "actor-" + circleData.pos);
|
|
860
|
+
circleElement.attr("fill", circleData.fill);
|
|
861
|
+
circleElement.attr("stroke", circleData.stroke);
|
|
862
|
+
circleElement.attr("r", circleData.r);
|
|
863
|
+
if (circleElement.class !== void 0) circleElement.attr("class", circleElement.class);
|
|
864
|
+
if (circleData.title !== void 0) circleElement.append("title").text(circleData.title);
|
|
865
|
+
return circleElement;
|
|
866
|
+
}, "drawCircle");
|
|
867
|
+
var drawText2 = /* @__PURE__ */ __name(function(elem, textData) {
|
|
868
|
+
return drawText(elem, textData);
|
|
869
|
+
}, "drawText");
|
|
870
|
+
var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
|
|
871
|
+
function genPoints(x, y, width, height, cut) {
|
|
872
|
+
return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
|
|
873
|
+
}
|
|
874
|
+
__name(genPoints, "genPoints");
|
|
875
|
+
const polygon = elem.append("polygon");
|
|
876
|
+
polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
|
|
877
|
+
polygon.attr("class", "labelBox");
|
|
878
|
+
txtObject.y = txtObject.y + txtObject.labelMargin;
|
|
879
|
+
txtObject.x = txtObject.x + .5 * txtObject.labelMargin;
|
|
880
|
+
drawText2(elem, txtObject);
|
|
881
|
+
}, "drawLabel");
|
|
882
|
+
var drawSection = /* @__PURE__ */ __name(function(elem, section, conf2) {
|
|
883
|
+
const g = elem.append("g");
|
|
884
|
+
const rect = getNoteRect();
|
|
885
|
+
rect.x = section.x;
|
|
886
|
+
rect.y = section.y;
|
|
887
|
+
rect.fill = section.fill;
|
|
888
|
+
rect.width = conf2.width * section.taskCount + conf2.diagramMarginX * (section.taskCount - 1);
|
|
889
|
+
rect.height = conf2.height;
|
|
890
|
+
rect.class = "journey-section section-type-" + section.num;
|
|
891
|
+
rect.rx = 3;
|
|
892
|
+
rect.ry = 3;
|
|
893
|
+
drawRect2(g, rect);
|
|
894
|
+
_drawTextCandidateFunc(conf2)(section.text, g, rect.x, rect.y, rect.width, rect.height, { class: "journey-section section-type-" + section.num }, conf2, section.colour);
|
|
895
|
+
}, "drawSection");
|
|
896
|
+
var taskCount = -1;
|
|
897
|
+
var drawTask = /* @__PURE__ */ __name(function(elem, task, conf2, diagramId) {
|
|
898
|
+
const center = task.x + conf2.width / 2;
|
|
899
|
+
const g = elem.append("g");
|
|
900
|
+
taskCount++;
|
|
901
|
+
g.append("line").attr("id", diagramId + "-task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
|
|
902
|
+
drawFace(g, {
|
|
903
|
+
cx: center,
|
|
904
|
+
cy: 300 + (5 - task.score) * 30,
|
|
905
|
+
score: task.score
|
|
906
|
+
});
|
|
907
|
+
const rect = getNoteRect();
|
|
908
|
+
rect.x = task.x;
|
|
909
|
+
rect.y = task.y;
|
|
910
|
+
rect.fill = task.fill;
|
|
911
|
+
rect.width = conf2.width;
|
|
912
|
+
rect.height = conf2.height;
|
|
913
|
+
rect.class = "task task-type-" + task.num;
|
|
914
|
+
rect.rx = 3;
|
|
915
|
+
rect.ry = 3;
|
|
916
|
+
drawRect2(g, rect);
|
|
917
|
+
let xPos = task.x + 14;
|
|
918
|
+
task.people.forEach((person) => {
|
|
919
|
+
const colour = task.actors[person].color;
|
|
920
|
+
const circle = {
|
|
921
|
+
cx: xPos,
|
|
922
|
+
cy: task.y,
|
|
923
|
+
r: 7,
|
|
924
|
+
fill: colour,
|
|
925
|
+
stroke: "#000",
|
|
926
|
+
title: person,
|
|
927
|
+
pos: task.actors[person].position
|
|
928
|
+
};
|
|
929
|
+
drawCircle(g, circle);
|
|
930
|
+
xPos += 10;
|
|
931
|
+
});
|
|
932
|
+
_drawTextCandidateFunc(conf2)(task.task, g, rect.x, rect.y, rect.width, rect.height, { class: "task" }, conf2, task.colour);
|
|
933
|
+
}, "drawTask");
|
|
934
|
+
var drawBackgroundRect2 = /* @__PURE__ */ __name(function(elem, bounds2) {
|
|
935
|
+
drawBackgroundRect(elem, bounds2);
|
|
936
|
+
}, "drawBackgroundRect");
|
|
937
|
+
var _drawTextCandidateFunc = /* @__PURE__ */ (function() {
|
|
938
|
+
function byText(content, g, x, y, width, height, textAttrs, colour) {
|
|
939
|
+
_setTextAttrs(g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content), textAttrs);
|
|
940
|
+
}
|
|
941
|
+
__name(byText, "byText");
|
|
942
|
+
function byTspan(content, g, x, y, width, height, textAttrs, conf2, colour) {
|
|
943
|
+
const { taskFontSize, taskFontFamily } = conf2;
|
|
944
|
+
const lines = content.split(/<br\s*\/?>/gi);
|
|
945
|
+
for (let i = 0; i < lines.length; i++) {
|
|
946
|
+
const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
|
|
947
|
+
const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
|
|
948
|
+
text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
|
|
949
|
+
text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
|
|
950
|
+
_setTextAttrs(text, textAttrs);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
__name(byTspan, "byTspan");
|
|
954
|
+
function byFo(content, g, x, y, width, height, textAttrs, conf2) {
|
|
955
|
+
const body = g.append("switch");
|
|
956
|
+
const text = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
|
|
957
|
+
text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
|
|
958
|
+
byTspan(content, body, x, y, width, height, textAttrs, conf2);
|
|
959
|
+
_setTextAttrs(text, textAttrs);
|
|
960
|
+
}
|
|
961
|
+
__name(byFo, "byFo");
|
|
962
|
+
function _setTextAttrs(toText, fromTextAttrsDict) {
|
|
963
|
+
for (const key in fromTextAttrsDict) if (key in fromTextAttrsDict) toText.attr(key, fromTextAttrsDict[key]);
|
|
964
|
+
}
|
|
965
|
+
__name(_setTextAttrs, "_setTextAttrs");
|
|
966
|
+
return function(conf2) {
|
|
967
|
+
return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
|
|
968
|
+
};
|
|
969
|
+
})();
|
|
970
|
+
var svgDraw_default = {
|
|
971
|
+
drawRect: drawRect2,
|
|
972
|
+
drawCircle,
|
|
973
|
+
drawSection,
|
|
974
|
+
drawText: drawText2,
|
|
975
|
+
drawLabel,
|
|
976
|
+
drawTask,
|
|
977
|
+
drawBackgroundRect: drawBackgroundRect2,
|
|
978
|
+
initGraphics: /* @__PURE__ */ __name(function(graphics, id) {
|
|
979
|
+
taskCount = -1;
|
|
980
|
+
graphics.append("defs").append("marker").attr("id", id + "-arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
|
|
981
|
+
}, "initGraphics")
|
|
982
|
+
};
|
|
983
|
+
var setConf = /* @__PURE__ */ __name(function(cnf) {
|
|
984
|
+
Object.keys(cnf).forEach(function(key) {
|
|
985
|
+
conf[key] = cnf[key];
|
|
986
|
+
});
|
|
987
|
+
}, "setConf");
|
|
988
|
+
var actors = {};
|
|
989
|
+
var maxWidth = 0;
|
|
990
|
+
function drawActorLegend(diagram2) {
|
|
991
|
+
const conf2 = getConfig2().journey;
|
|
992
|
+
const maxLabelWidth = conf2.maxLabelWidth;
|
|
993
|
+
maxWidth = 0;
|
|
994
|
+
let yPos = 60;
|
|
995
|
+
Object.keys(actors).forEach((person) => {
|
|
996
|
+
const colour = actors[person].color;
|
|
997
|
+
const circleData = {
|
|
998
|
+
cx: 20,
|
|
999
|
+
cy: yPos,
|
|
1000
|
+
r: 7,
|
|
1001
|
+
fill: colour,
|
|
1002
|
+
stroke: "#000",
|
|
1003
|
+
pos: actors[person].position
|
|
1004
|
+
};
|
|
1005
|
+
svgDraw_default.drawCircle(diagram2, circleData);
|
|
1006
|
+
let measureText = diagram2.append("text").attr("visibility", "hidden").text(person);
|
|
1007
|
+
const fullTextWidth = measureText.node().getBoundingClientRect().width;
|
|
1008
|
+
measureText.remove();
|
|
1009
|
+
let lines = [];
|
|
1010
|
+
if (fullTextWidth <= maxLabelWidth) lines = [person];
|
|
1011
|
+
else {
|
|
1012
|
+
const words = person.split(" ");
|
|
1013
|
+
let currentLine = "";
|
|
1014
|
+
measureText = diagram2.append("text").attr("visibility", "hidden");
|
|
1015
|
+
words.forEach((word) => {
|
|
1016
|
+
const testLine = currentLine ? `${currentLine} ${word}` : word;
|
|
1017
|
+
measureText.text(testLine);
|
|
1018
|
+
if (measureText.node().getBoundingClientRect().width > maxLabelWidth) {
|
|
1019
|
+
if (currentLine) lines.push(currentLine);
|
|
1020
|
+
currentLine = word;
|
|
1021
|
+
measureText.text(word);
|
|
1022
|
+
if (measureText.node().getBoundingClientRect().width > maxLabelWidth) {
|
|
1023
|
+
let brokenWord = "";
|
|
1024
|
+
for (const char of word) {
|
|
1025
|
+
brokenWord += char;
|
|
1026
|
+
measureText.text(brokenWord + "-");
|
|
1027
|
+
if (measureText.node().getBoundingClientRect().width > maxLabelWidth) {
|
|
1028
|
+
lines.push(brokenWord.slice(0, -1) + "-");
|
|
1029
|
+
brokenWord = char;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
currentLine = brokenWord;
|
|
1033
|
+
}
|
|
1034
|
+
} else currentLine = testLine;
|
|
1035
|
+
});
|
|
1036
|
+
if (currentLine) lines.push(currentLine);
|
|
1037
|
+
measureText.remove();
|
|
1038
|
+
}
|
|
1039
|
+
lines.forEach((line, index) => {
|
|
1040
|
+
const labelData = {
|
|
1041
|
+
x: 40,
|
|
1042
|
+
y: yPos + 7 + index * 20,
|
|
1043
|
+
fill: "#666",
|
|
1044
|
+
text: line,
|
|
1045
|
+
textMargin: conf2.boxTextMargin ?? 5
|
|
1046
|
+
};
|
|
1047
|
+
const lineWidth = svgDraw_default.drawText(diagram2, labelData).node().getBoundingClientRect().width;
|
|
1048
|
+
if (lineWidth > maxWidth && lineWidth > conf2.leftMargin - lineWidth) maxWidth = lineWidth;
|
|
1049
|
+
});
|
|
1050
|
+
yPos += Math.max(20, lines.length * 20);
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
__name(drawActorLegend, "drawActorLegend");
|
|
1054
|
+
var conf = getConfig2().journey;
|
|
1055
|
+
var leftMargin = 0;
|
|
1056
|
+
var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
|
|
1057
|
+
const configObject = getConfig2();
|
|
1058
|
+
const titleColor = configObject.journey.titleColor;
|
|
1059
|
+
const titleFontSize = configObject.journey.titleFontSize;
|
|
1060
|
+
const titleFontFamily = configObject.journey.titleFontFamily;
|
|
1061
|
+
const securityLevel = configObject.securityLevel;
|
|
1062
|
+
let sandboxElement;
|
|
1063
|
+
if (securityLevel === "sandbox") sandboxElement = select_default("#i" + id);
|
|
1064
|
+
const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
|
|
1065
|
+
bounds.init();
|
|
1066
|
+
const diagram2 = root.select("#" + id);
|
|
1067
|
+
svgDraw_default.initGraphics(diagram2, id);
|
|
1068
|
+
const tasks2 = diagObj.db.getTasks();
|
|
1069
|
+
const title = diagObj.db.getDiagramTitle();
|
|
1070
|
+
const actorNames = diagObj.db.getActors();
|
|
1071
|
+
for (const member in actors) delete actors[member];
|
|
1072
|
+
let actorPos = 0;
|
|
1073
|
+
actorNames.forEach((actorName) => {
|
|
1074
|
+
actors[actorName] = {
|
|
1075
|
+
color: conf.actorColours[actorPos % conf.actorColours.length],
|
|
1076
|
+
position: actorPos
|
|
1077
|
+
};
|
|
1078
|
+
actorPos++;
|
|
1079
|
+
});
|
|
1080
|
+
drawActorLegend(diagram2);
|
|
1081
|
+
leftMargin = conf.leftMargin + maxWidth;
|
|
1082
|
+
bounds.insert(0, 0, leftMargin, Object.keys(actors).length * 50);
|
|
1083
|
+
drawTasks(diagram2, tasks2, 0, id);
|
|
1084
|
+
const box = bounds.getBounds();
|
|
1085
|
+
if (title) diagram2.append("text").text(title).attr("x", leftMargin).attr("font-size", titleFontSize).attr("font-weight", "bold").attr("y", 25).attr("fill", titleColor).attr("font-family", titleFontFamily);
|
|
1086
|
+
const height = box.stopy - box.starty + 2 * conf.diagramMarginY;
|
|
1087
|
+
const width = leftMargin + box.stopx + 2 * conf.diagramMarginX;
|
|
1088
|
+
configureSvgSize(diagram2, height, width, conf.useMaxWidth);
|
|
1089
|
+
diagram2.append("line").attr("x1", leftMargin).attr("y1", conf.height * 4).attr("x2", width - leftMargin - 4).attr("y2", conf.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#" + id + "-arrowhead)");
|
|
1090
|
+
const extraVertForTitle = title ? 70 : 0;
|
|
1091
|
+
diagram2.attr("viewBox", `${box.startx} -25 ${width} ${height + extraVertForTitle}`);
|
|
1092
|
+
diagram2.attr("preserveAspectRatio", "xMinYMin meet");
|
|
1093
|
+
diagram2.attr("height", height + extraVertForTitle + 25);
|
|
1094
|
+
}, "draw");
|
|
1095
|
+
var bounds = {
|
|
1096
|
+
data: {
|
|
1097
|
+
startx: void 0,
|
|
1098
|
+
stopx: void 0,
|
|
1099
|
+
starty: void 0,
|
|
1100
|
+
stopy: void 0
|
|
1101
|
+
},
|
|
1102
|
+
verticalPos: 0,
|
|
1103
|
+
sequenceItems: [],
|
|
1104
|
+
init: /* @__PURE__ */ __name(function() {
|
|
1105
|
+
this.sequenceItems = [];
|
|
1106
|
+
this.data = {
|
|
1107
|
+
startx: void 0,
|
|
1108
|
+
stopx: void 0,
|
|
1109
|
+
starty: void 0,
|
|
1110
|
+
stopy: void 0
|
|
1111
|
+
};
|
|
1112
|
+
this.verticalPos = 0;
|
|
1113
|
+
}, "init"),
|
|
1114
|
+
updateVal: /* @__PURE__ */ __name(function(obj, key, val, fun) {
|
|
1115
|
+
if (obj[key] === void 0) obj[key] = val;
|
|
1116
|
+
else obj[key] = fun(val, obj[key]);
|
|
1117
|
+
}, "updateVal"),
|
|
1118
|
+
updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
|
|
1119
|
+
const conf2 = getConfig2().journey;
|
|
1120
|
+
const _self = this;
|
|
1121
|
+
let cnt = 0;
|
|
1122
|
+
function updateFn(type) {
|
|
1123
|
+
return /* @__PURE__ */ __name(function updateItemBounds(item) {
|
|
1124
|
+
cnt++;
|
|
1125
|
+
const n = _self.sequenceItems.length - cnt + 1;
|
|
1126
|
+
_self.updateVal(item, "starty", starty - n * conf2.boxMargin, Math.min);
|
|
1127
|
+
_self.updateVal(item, "stopy", stopy + n * conf2.boxMargin, Math.max);
|
|
1128
|
+
_self.updateVal(bounds.data, "startx", startx - n * conf2.boxMargin, Math.min);
|
|
1129
|
+
_self.updateVal(bounds.data, "stopx", stopx + n * conf2.boxMargin, Math.max);
|
|
1130
|
+
if (!(type === "activation")) {
|
|
1131
|
+
_self.updateVal(item, "startx", startx - n * conf2.boxMargin, Math.min);
|
|
1132
|
+
_self.updateVal(item, "stopx", stopx + n * conf2.boxMargin, Math.max);
|
|
1133
|
+
_self.updateVal(bounds.data, "starty", starty - n * conf2.boxMargin, Math.min);
|
|
1134
|
+
_self.updateVal(bounds.data, "stopy", stopy + n * conf2.boxMargin, Math.max);
|
|
1135
|
+
}
|
|
1136
|
+
}, "updateItemBounds");
|
|
1137
|
+
}
|
|
1138
|
+
__name(updateFn, "updateFn");
|
|
1139
|
+
this.sequenceItems.forEach(updateFn());
|
|
1140
|
+
}, "updateBounds"),
|
|
1141
|
+
insert: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
|
|
1142
|
+
const _startx = Math.min(startx, stopx);
|
|
1143
|
+
const _stopx = Math.max(startx, stopx);
|
|
1144
|
+
const _starty = Math.min(starty, stopy);
|
|
1145
|
+
const _stopy = Math.max(starty, stopy);
|
|
1146
|
+
this.updateVal(bounds.data, "startx", _startx, Math.min);
|
|
1147
|
+
this.updateVal(bounds.data, "starty", _starty, Math.min);
|
|
1148
|
+
this.updateVal(bounds.data, "stopx", _stopx, Math.max);
|
|
1149
|
+
this.updateVal(bounds.data, "stopy", _stopy, Math.max);
|
|
1150
|
+
this.updateBounds(_startx, _starty, _stopx, _stopy);
|
|
1151
|
+
}, "insert"),
|
|
1152
|
+
bumpVerticalPos: /* @__PURE__ */ __name(function(bump) {
|
|
1153
|
+
this.verticalPos = this.verticalPos + bump;
|
|
1154
|
+
this.data.stopy = this.verticalPos;
|
|
1155
|
+
}, "bumpVerticalPos"),
|
|
1156
|
+
getVerticalPos: /* @__PURE__ */ __name(function() {
|
|
1157
|
+
return this.verticalPos;
|
|
1158
|
+
}, "getVerticalPos"),
|
|
1159
|
+
getBounds: /* @__PURE__ */ __name(function() {
|
|
1160
|
+
return this.data;
|
|
1161
|
+
}, "getBounds")
|
|
1162
|
+
};
|
|
1163
|
+
var fills = conf.sectionFills;
|
|
1164
|
+
var textColours = conf.sectionColours;
|
|
1165
|
+
var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, verticalPos, diagramId) {
|
|
1166
|
+
const conf2 = getConfig2().journey;
|
|
1167
|
+
let lastSection = "";
|
|
1168
|
+
const taskPos = verticalPos + (conf2.height * 2 + conf2.diagramMarginY);
|
|
1169
|
+
let sectionNumber = 0;
|
|
1170
|
+
let fill = "#CCC";
|
|
1171
|
+
let colour = "black";
|
|
1172
|
+
let num = 0;
|
|
1173
|
+
for (const [i, task] of tasks2.entries()) {
|
|
1174
|
+
if (lastSection !== task.section) {
|
|
1175
|
+
fill = fills[sectionNumber % fills.length];
|
|
1176
|
+
num = sectionNumber % fills.length;
|
|
1177
|
+
colour = textColours[sectionNumber % textColours.length];
|
|
1178
|
+
let taskInSectionCount = 0;
|
|
1179
|
+
const currentSection2 = task.section;
|
|
1180
|
+
for (let taskIndex = i; taskIndex < tasks2.length; taskIndex++) if (tasks2[taskIndex].section == currentSection2) taskInSectionCount = taskInSectionCount + 1;
|
|
1181
|
+
else break;
|
|
1182
|
+
const section = {
|
|
1183
|
+
x: i * conf2.taskMargin + i * conf2.width + leftMargin,
|
|
1184
|
+
y: 50,
|
|
1185
|
+
text: task.section,
|
|
1186
|
+
fill,
|
|
1187
|
+
num,
|
|
1188
|
+
colour,
|
|
1189
|
+
taskCount: taskInSectionCount
|
|
1190
|
+
};
|
|
1191
|
+
svgDraw_default.drawSection(diagram2, section, conf2);
|
|
1192
|
+
lastSection = task.section;
|
|
1193
|
+
sectionNumber++;
|
|
1194
|
+
}
|
|
1195
|
+
const taskActors = task.people.reduce((acc, actorName) => {
|
|
1196
|
+
if (actors[actorName]) acc[actorName] = actors[actorName];
|
|
1197
|
+
return acc;
|
|
1198
|
+
}, {});
|
|
1199
|
+
task.x = i * conf2.taskMargin + i * conf2.width + leftMargin;
|
|
1200
|
+
task.y = taskPos;
|
|
1201
|
+
task.width = conf2.diagramMarginX;
|
|
1202
|
+
task.height = conf2.diagramMarginY;
|
|
1203
|
+
task.colour = colour;
|
|
1204
|
+
task.fill = fill;
|
|
1205
|
+
task.num = num;
|
|
1206
|
+
task.actors = taskActors;
|
|
1207
|
+
svgDraw_default.drawTask(diagram2, task, conf2, diagramId);
|
|
1208
|
+
bounds.insert(task.x, task.y, task.x + task.width + conf2.taskMargin, 450);
|
|
1209
|
+
}
|
|
1210
|
+
}, "drawTasks");
|
|
1211
|
+
var journeyRenderer_default = {
|
|
1212
|
+
setConf,
|
|
1213
|
+
draw
|
|
1214
|
+
};
|
|
1215
|
+
var diagram = {
|
|
1216
|
+
parser: journey_default,
|
|
1217
|
+
db: journeyDb_default,
|
|
1218
|
+
renderer: journeyRenderer_default,
|
|
1219
|
+
styles: styles_default,
|
|
1220
|
+
init: /* @__PURE__ */ __name((cnf) => {
|
|
1221
|
+
journeyRenderer_default.setConf(cnf.journey);
|
|
1222
|
+
journeyDb_default.clear();
|
|
1223
|
+
}, "init")
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1226
|
+
//#endregion
|
|
1227
|
+
export { diagram };
|