@diagrammo/dgmo 0.45.0 → 0.47.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/advanced.cjs +31 -25
- package/dist/advanced.d.cts +3 -855
- package/dist/advanced.d.ts +3 -855
- package/dist/advanced.js +541 -70101
- package/dist/analyzer-UYKBXAKR.js +15 -0
- package/dist/auto.cjs +500 -341
- package/dist/auto.css +342 -159
- package/dist/auto.d.cts +10 -8
- package/dist/auto.d.ts +10 -8
- package/dist/auto.js +373 -265
- package/dist/auto.mjs +500 -341
- package/dist/block.cjs +31 -25
- package/dist/block.js +83 -69411
- package/dist/calculator-LDYQCDDY.js +11 -0
- package/dist/charts-d3-QOZHKTCT.js +25 -0
- package/dist/chunk-2DXMZRWJ.js +800 -0
- package/dist/chunk-2LACINWN.js +786 -0
- package/dist/chunk-33LCUH4H.js +893 -0
- package/dist/chunk-3CIOJ5YJ.js +35 -0
- package/dist/chunk-3HDBAXF5.js +86 -0
- package/dist/chunk-3JLKYGBQ.js +290 -0
- package/dist/chunk-3MQQNXPD.js +415 -0
- package/dist/chunk-3R5POCTZ.js +967 -0
- package/dist/chunk-3SMGIJDD.js +112 -0
- package/dist/chunk-44CM72SQ.js +409 -0
- package/dist/chunk-4GRI7MEB.js +1604 -0
- package/dist/chunk-4OHACBGX.js +606 -0
- package/dist/chunk-5DH3KYFH.js +21 -0
- package/dist/chunk-5MLYVTYM.js +76 -0
- package/dist/chunk-5QXL4NYS.js +553 -0
- package/dist/chunk-5WRI5ZAA.js +31 -0
- package/dist/chunk-6EK55ART.js +117 -0
- package/dist/chunk-6FZYCKXB.js +2065 -0
- package/dist/chunk-6HO5ZTXK.js +277 -0
- package/dist/chunk-6KFWC4CO.js +7 -0
- package/dist/chunk-6MTWIQVO.js +121 -0
- package/dist/chunk-6NYWYNBI.js +329 -0
- package/dist/chunk-6SM5NJQH.js +620 -0
- package/dist/chunk-725LDASD.js +422 -0
- package/dist/chunk-76OWZ3BA.js +130 -0
- package/dist/chunk-7JEGTRLD.js +338 -0
- package/dist/chunk-A44USUV7.js +923 -0
- package/dist/chunk-A4GOY3PE.js +25 -0
- package/dist/chunk-A4VFQH5G.js +251 -0
- package/dist/chunk-AELOBFW5.js +375 -0
- package/dist/chunk-AN2MOO5T.js +522 -0
- package/dist/chunk-BMR4CIEO.js +41 -0
- package/dist/chunk-BS7SV7C3.js +51 -0
- package/dist/chunk-BUPDIHML.js +613 -0
- package/dist/chunk-BUVJFRPY.js +887 -0
- package/dist/chunk-C3Z4DX3V.js +112 -0
- package/dist/chunk-CI2G3OEB.js +1818 -0
- package/dist/chunk-CKNVO24D.js +54 -0
- package/dist/chunk-CUVHQHZ7.js +391 -0
- package/dist/chunk-CXK4DZH3.js +114 -0
- package/dist/chunk-DKEPS5LH.js +315 -0
- package/dist/chunk-DU7W62N5.js +487 -0
- package/dist/chunk-DZAQBW35.js +751 -0
- package/dist/chunk-EB6FPQUP.js +316 -0
- package/dist/chunk-EMS2SK26.js +376 -0
- package/dist/chunk-ERLBPDGU.js +510 -0
- package/dist/chunk-EVCVDTXE.js +732 -0
- package/dist/chunk-FCIIHT24.js +384 -0
- package/dist/chunk-FFUN5D66.js +97 -0
- package/dist/chunk-FITOLXSX.js +714 -0
- package/dist/chunk-FMDSF3OV.js +68 -0
- package/dist/chunk-FNB3PNGF.js +410 -0
- package/dist/chunk-G2H74XJZ.js +2104 -0
- package/dist/chunk-GMR5MFHJ.js +339 -0
- package/dist/chunk-H6PI3KJT.js +305 -0
- package/dist/chunk-I46X5VUA.js +59 -0
- package/dist/chunk-I5IGB56C.js +255 -0
- package/dist/chunk-IH6ZMVQ5.js +3950 -0
- package/dist/chunk-IJZFN3HM.js +463 -0
- package/dist/chunk-IPWPWM6R.js +3079 -0
- package/dist/chunk-IYULMRBE.js +23 -0
- package/dist/chunk-IZMRON6C.js +167 -0
- package/dist/chunk-J5FIXQRT.js +813 -0
- package/dist/chunk-JED6ZDEE.js +73 -0
- package/dist/chunk-JEUJOX5X.js +136 -0
- package/dist/chunk-JM4LEPY3.js +436 -0
- package/dist/chunk-L3UHP6TD.js +101 -0
- package/dist/chunk-L66GEFB6.js +524 -0
- package/dist/chunk-LIOHW36Z.js +469 -0
- package/dist/chunk-LP7EC4MI.js +16 -0
- package/dist/chunk-MITI6NOL.js +548 -0
- package/dist/chunk-MO5YHHMQ.js +168 -0
- package/dist/chunk-MZSBFAPJ.js +885 -0
- package/dist/chunk-NNAAJVBU.js +9 -0
- package/dist/chunk-NOTA6TEI.js +47 -0
- package/dist/chunk-NURGB5Z4.js +335 -0
- package/dist/chunk-NX4EQS3U.js +1062 -0
- package/dist/chunk-NXMESY4J.js +1 -0
- package/dist/chunk-OJR3MQYV.js +1458 -0
- package/dist/chunk-OURHMODR.js +454 -0
- package/dist/chunk-P235SVAH.js +1057 -0
- package/dist/chunk-P4RH4OSP.js +1038 -0
- package/dist/chunk-P6T66CCZ.js +226 -0
- package/dist/chunk-PBAHEPLQ.js +223 -0
- package/dist/chunk-PBHE5UG6.js +1530 -0
- package/dist/chunk-PDKUANDZ.js +35 -0
- package/dist/chunk-PWIHZ6NJ.js +296 -0
- package/dist/chunk-QEBUY5NY.js +1685 -0
- package/dist/chunk-QLCCJEJI.js +253 -0
- package/dist/chunk-QOOUC2J5.js +52 -0
- package/dist/chunk-QYTPPDAO.js +402 -0
- package/dist/chunk-R3XI2VC7.js +801 -0
- package/dist/chunk-RCERWOJR.js +154 -0
- package/dist/chunk-RJE5JTVK.js +362 -0
- package/dist/chunk-RTLBSQ3G.js +1155 -0
- package/dist/chunk-RUNNI6VE.js +448 -0
- package/dist/chunk-RVMRZAPB.js +354 -0
- package/dist/chunk-RYEGFMUO.js +955 -0
- package/dist/chunk-RZCF2VVM.js +528 -0
- package/dist/chunk-SML67VPV.js +1025 -0
- package/dist/chunk-SQ7IY53Q.js +44 -0
- package/dist/chunk-SQAG3UXH.js +161 -0
- package/dist/chunk-SRTU6HMQ.js +1851 -0
- package/dist/chunk-T2OE3YQB.js +550 -0
- package/dist/chunk-T3UBLACL.js +299 -0
- package/dist/chunk-TLVIHFRO.js +296 -0
- package/dist/chunk-TYS6CSS5.js +52 -0
- package/dist/chunk-U6EQI3U6.js +130 -0
- package/dist/chunk-UJ4FJLBF.js +86 -0
- package/dist/chunk-ULOEATBZ.js +347 -0
- package/dist/chunk-UNCCZ3NU.js +127 -0
- package/dist/chunk-USZW2HHU.js +197 -0
- package/dist/chunk-UWN33VNX.js +1610 -0
- package/dist/chunk-UZ7EZW3B.js +40 -0
- package/dist/chunk-VOKGH627.js +37 -0
- package/dist/chunk-WBRZJOEC.js +204 -0
- package/dist/chunk-WCSOJFU3.js +380 -0
- package/dist/chunk-WCT3NYCV.js +160 -0
- package/dist/chunk-WVAJFAIA.js +529 -0
- package/dist/chunk-X5LCYCL5.js +394 -0
- package/dist/chunk-XAKEUMEJ.js +1256 -0
- package/dist/chunk-Y2ZE3MSG.js +590 -0
- package/dist/chunk-Y3J7VR52.js +646 -0
- package/dist/chunk-Y5QGVTVC.js +33 -0
- package/dist/chunk-YAA6IID3.js +548 -0
- package/dist/chunk-YGJTDXVR.js +692 -0
- package/dist/chunk-YRYKTYMQ.js +186 -0
- package/dist/chunk-YYVTBZZC.js +61 -0
- package/dist/chunk-Z5CGSFJB.js +647 -0
- package/dist/chunk-Z72XRXD4.js +787 -0
- package/dist/chunk-ZGR7ULFJ.js +978 -0
- package/dist/chunk-ZJEL4H2R.js +851 -0
- package/dist/chunk-ZO27FGJS.js +554 -0
- package/dist/cli.cjs +112 -112
- package/dist/collapse-CLPJD2RL.js +11 -0
- package/dist/collapse-SLINJQW6.js +9 -0
- package/dist/collapse-ZWUFFCK2.js +9 -0
- package/dist/compute-G55RG53N.js +8 -0
- package/dist/dgmo-router-DZCIDUO5.js +73 -0
- package/dist/dimensions-J3FHIMJ6.js +22 -0
- package/dist/element.cjs +492 -325
- package/dist/element.js +367 -259
- package/dist/element.mjs +492 -325
- package/dist/flowchart-parser-ZNSKIBVR.js +21 -0
- package/dist/flowchart-renderer-ZAEOL4DX.js +35 -0
- package/dist/index.cjs +34 -28
- package/dist/index.d.cts +3 -469
- package/dist/index.d.ts +3 -469
- package/dist/index.js +137 -69679
- package/dist/layout-46N4JJYK.js +17 -0
- package/dist/layout-5RA6QWR6.js +26 -0
- package/dist/layout-5T6RH5M6.js +14 -0
- package/dist/layout-7QXCNOVS.js +13 -0
- package/dist/layout-EE6GE46Y.js +17 -0
- package/dist/layout-G23F7LDH.js +9 -0
- package/dist/layout-HRBZPFCN.js +23 -0
- package/dist/layout-HWDSRX5E.js +20 -0
- package/dist/layout-HYZPWAK5.js +18 -0
- package/dist/layout-N76NR4ZO.js +19 -0
- package/dist/layout-OB3RI63S.js +14 -0
- package/dist/layout-S2QBYSK2.js +15 -0
- package/dist/layout-UM5F4DJB.js +15 -0
- package/dist/layout-search-OYV77HHS.js +1655 -0
- package/dist/load-data-EHDDZ5ZS.js +8 -0
- package/dist/palettes-PRJ2RI6D.js +56 -0
- package/dist/parser-2MFP2H2E.js +11 -0
- package/dist/parser-3STE62GB.js +21 -0
- package/dist/parser-4FL2CMDG.js +18 -0
- package/dist/parser-4OGOBJJ4.js +13 -0
- package/dist/parser-6BTRLKRZ.js +15 -0
- package/dist/parser-AQETEVRW.js +21 -0
- package/dist/parser-CFZD5IBL.js +12 -0
- package/dist/parser-FUSKFGZN.js +16 -0
- package/dist/parser-I6KXEYFK.js +13 -0
- package/dist/parser-IXSZZQHY.js +18 -0
- package/dist/parser-JAL2HD4I.js +13 -0
- package/dist/parser-KNSQSKQO.js +20 -0
- package/dist/parser-N5O4IHUN.js +13 -0
- package/dist/parser-NGU3ETO6.js +16 -0
- package/dist/parser-NRAI6O25.js +19 -0
- package/dist/parser-O5J4VBII.js +11 -0
- package/dist/parser-OV7NOBW6.js +21 -0
- package/dist/parser-PQ3POX45.js +23 -0
- package/dist/parser-TFZFBVWN.js +11 -0
- package/dist/parser-TRTHDFPP.js +18 -0
- package/dist/parser-VQP2UJ6W.js +11 -0
- package/dist/parser-XDVELHRK.js +13 -0
- package/dist/parser-XKRP7QKP.js +11 -0
- package/dist/parser-Y6WTBU76.js +14 -0
- package/dist/parser-ZSDPZYQP.js +12 -0
- package/dist/renderer-2XQQQ6QR.js +28 -0
- package/dist/renderer-5NDVNDAZ.js +26 -0
- package/dist/renderer-6EEZHMH4.js +26 -0
- package/dist/renderer-6W5462RB.js +43 -0
- package/dist/renderer-7MVLWWQD.js +22 -0
- package/dist/renderer-AWWAF6XD.js +33 -0
- package/dist/renderer-BYCNMBF7.js +34 -0
- package/dist/renderer-CLJHQPBJ.js +29 -0
- package/dist/renderer-GHPZMFU2.js +15 -0
- package/dist/renderer-JGBKUCZD.js +16 -0
- package/dist/renderer-KQB7UGDS.js +19 -0
- package/dist/renderer-PGX2TKVS.js +24 -0
- package/dist/renderer-QIWVHWZO.js +15 -0
- package/dist/renderer-RPOA5YPZ.js +35 -0
- package/dist/renderer-SMIBCRVB.js +24 -0
- package/dist/renderer-T7YKC5VP.js +28 -0
- package/dist/renderer-TOCOVLHS.js +37 -0
- package/dist/renderer-UWA5XS74.js +39 -0
- package/dist/renderer-VACVQYML.js +25 -0
- package/dist/renderer-W4M6QLIJ.js +37 -0
- package/dist/renderer-WZRREQ2P.js +23 -0
- package/dist/renderer-YY2OSF6E.js +27 -0
- package/dist/renderer-Z7I3W2PP.js +24 -0
- package/dist/renderer-ZGNTUWC4.js +22 -0
- package/dist/renderer-ZTR3DER3.js +19 -0
- package/dist/renderer-radial-C32GPJQ7.js +21 -0
- package/dist/resolver-NOAA7ID7.js +13 -0
- package/dist/state-collapse-HCGD6IVJ.js +8 -0
- package/dist/state-parser-Z2V23ATR.js +18 -0
- package/dist/state-renderer-RFYHSP4K.js +34 -0
- package/dist/themes-1-CuKpeH.d.cts +908 -0
- package/dist/themes-1-CuKpeH.d.ts +908 -0
- package/package.json +1 -1
- package/src/auto/index.ts +55 -57
- package/src/auto/shared.ts +142 -142
- package/src/auto/styles.ts +44 -199
- package/src/c4/renderer.ts +2 -2
- package/src/element/index.ts +29 -21
- package/src/infra/renderer.ts +1 -1
- package/src/render.ts +34 -14
- package/src/sitemap/renderer.ts +1 -1
- package/src/timeline/renderer.ts +1 -1
- package/src/utils/hover-styles.ts +6 -1
- package/src/utils/legend-d3.ts +1 -4
- package/src/utils/legend-svg.ts +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// src/utils/text-measure.ts
|
|
2
|
+
var CHAR_W = {
|
|
3
|
+
" ": 0.28,
|
|
4
|
+
"!": 0.28,
|
|
5
|
+
'"': 0.36,
|
|
6
|
+
"#": 0.56,
|
|
7
|
+
"$": 0.56,
|
|
8
|
+
"%": 0.89,
|
|
9
|
+
"&": 0.67,
|
|
10
|
+
"'": 0.19,
|
|
11
|
+
"(": 0.33,
|
|
12
|
+
")": 0.33,
|
|
13
|
+
"*": 0.39,
|
|
14
|
+
"+": 0.58,
|
|
15
|
+
",": 0.28,
|
|
16
|
+
"-": 0.33,
|
|
17
|
+
".": 0.28,
|
|
18
|
+
"/": 0.28,
|
|
19
|
+
"0": 0.56,
|
|
20
|
+
"1": 0.56,
|
|
21
|
+
"2": 0.56,
|
|
22
|
+
"3": 0.56,
|
|
23
|
+
"4": 0.56,
|
|
24
|
+
"5": 0.56,
|
|
25
|
+
"6": 0.56,
|
|
26
|
+
"7": 0.56,
|
|
27
|
+
"8": 0.56,
|
|
28
|
+
"9": 0.56,
|
|
29
|
+
":": 0.28,
|
|
30
|
+
";": 0.28,
|
|
31
|
+
"<": 0.58,
|
|
32
|
+
"=": 0.58,
|
|
33
|
+
">": 0.58,
|
|
34
|
+
"?": 0.56,
|
|
35
|
+
"@": 1.02,
|
|
36
|
+
A: 0.67,
|
|
37
|
+
B: 0.67,
|
|
38
|
+
C: 0.72,
|
|
39
|
+
D: 0.72,
|
|
40
|
+
E: 0.67,
|
|
41
|
+
F: 0.61,
|
|
42
|
+
G: 0.78,
|
|
43
|
+
H: 0.72,
|
|
44
|
+
I: 0.28,
|
|
45
|
+
J: 0.5,
|
|
46
|
+
K: 0.67,
|
|
47
|
+
L: 0.56,
|
|
48
|
+
M: 0.83,
|
|
49
|
+
N: 0.72,
|
|
50
|
+
O: 0.78,
|
|
51
|
+
P: 0.67,
|
|
52
|
+
Q: 0.78,
|
|
53
|
+
R: 0.72,
|
|
54
|
+
S: 0.67,
|
|
55
|
+
T: 0.61,
|
|
56
|
+
U: 0.72,
|
|
57
|
+
V: 0.67,
|
|
58
|
+
W: 0.94,
|
|
59
|
+
X: 0.67,
|
|
60
|
+
Y: 0.67,
|
|
61
|
+
Z: 0.61,
|
|
62
|
+
a: 0.56,
|
|
63
|
+
b: 0.56,
|
|
64
|
+
c: 0.5,
|
|
65
|
+
d: 0.56,
|
|
66
|
+
e: 0.56,
|
|
67
|
+
f: 0.28,
|
|
68
|
+
g: 0.56,
|
|
69
|
+
h: 0.56,
|
|
70
|
+
i: 0.22,
|
|
71
|
+
j: 0.22,
|
|
72
|
+
k: 0.5,
|
|
73
|
+
l: 0.22,
|
|
74
|
+
m: 0.83,
|
|
75
|
+
n: 0.56,
|
|
76
|
+
o: 0.56,
|
|
77
|
+
p: 0.56,
|
|
78
|
+
q: 0.56,
|
|
79
|
+
r: 0.33,
|
|
80
|
+
s: 0.5,
|
|
81
|
+
t: 0.28,
|
|
82
|
+
u: 0.56,
|
|
83
|
+
v: 0.5,
|
|
84
|
+
w: 0.72,
|
|
85
|
+
x: 0.5,
|
|
86
|
+
y: 0.5,
|
|
87
|
+
z: 0.5
|
|
88
|
+
};
|
|
89
|
+
var DEFAULT_W = 0.56;
|
|
90
|
+
var CHAR_WIDTH_RATIO = DEFAULT_W;
|
|
91
|
+
function measureText(text, fontSize) {
|
|
92
|
+
let w = 0;
|
|
93
|
+
for (let i = 0; i < text.length; i++) {
|
|
94
|
+
w += (CHAR_W[text.charAt(i)] ?? DEFAULT_W) * fontSize;
|
|
95
|
+
}
|
|
96
|
+
return w;
|
|
97
|
+
}
|
|
98
|
+
function truncateText(text, fontSize, maxWidth) {
|
|
99
|
+
if (measureText(text, fontSize) <= maxWidth) return text;
|
|
100
|
+
const ellipsis = "\u2026";
|
|
101
|
+
const ellipsisW = measureText(ellipsis, fontSize);
|
|
102
|
+
if (ellipsisW > maxWidth) return "";
|
|
103
|
+
let lo = 0;
|
|
104
|
+
let hi = text.length;
|
|
105
|
+
while (lo < hi) {
|
|
106
|
+
const mid = Math.ceil((lo + hi) / 2);
|
|
107
|
+
if (measureText(text.slice(0, mid), fontSize) + ellipsisW <= maxWidth) {
|
|
108
|
+
lo = mid;
|
|
109
|
+
} else {
|
|
110
|
+
hi = mid - 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return lo === 0 ? ellipsis : text.slice(0, lo) + ellipsis;
|
|
114
|
+
}
|
|
115
|
+
function wrapTextToWidth(text, fontSize, maxWidth, opts) {
|
|
116
|
+
const words = text.split(/\s+/).filter((w) => w.length > 0);
|
|
117
|
+
if (words.length === 0) return [""];
|
|
118
|
+
const hardBreak = opts?.hardBreak ?? false;
|
|
119
|
+
const lines = [];
|
|
120
|
+
let current = "";
|
|
121
|
+
const pushWord = (word) => {
|
|
122
|
+
const test = current ? `${current} ${word}` : word;
|
|
123
|
+
if (measureText(test, fontSize) <= maxWidth || !current) {
|
|
124
|
+
current = test;
|
|
125
|
+
} else {
|
|
126
|
+
lines.push(current);
|
|
127
|
+
current = word;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
for (const word of words) {
|
|
131
|
+
if (hardBreak && measureText(word, fontSize) > maxWidth) {
|
|
132
|
+
if (current) {
|
|
133
|
+
lines.push(current);
|
|
134
|
+
current = "";
|
|
135
|
+
}
|
|
136
|
+
let chunk = "";
|
|
137
|
+
for (const ch of word) {
|
|
138
|
+
if (chunk && measureText(chunk + ch, fontSize) > maxWidth) {
|
|
139
|
+
lines.push(chunk);
|
|
140
|
+
chunk = ch;
|
|
141
|
+
} else {
|
|
142
|
+
chunk += ch;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
current = chunk;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
pushWord(word);
|
|
149
|
+
}
|
|
150
|
+
if (current) lines.push(current);
|
|
151
|
+
return lines.length > 0 ? lines : [""];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
CHAR_WIDTH_RATIO,
|
|
156
|
+
measureText,
|
|
157
|
+
truncateText,
|
|
158
|
+
wrapTextToWidth
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=chunk-WCT3NYCV.js.map
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTO_TAG_COLOR_SENTINEL,
|
|
3
|
+
finalizeAutoTagColors,
|
|
4
|
+
matchTagBlockHeading,
|
|
5
|
+
stripDefaultModifier,
|
|
6
|
+
tagAttrKey
|
|
7
|
+
} from "./chunk-QLCCJEJI.js";
|
|
8
|
+
import {
|
|
9
|
+
extractColor,
|
|
10
|
+
measureIndent,
|
|
11
|
+
parseFirstLine
|
|
12
|
+
} from "./chunk-Y3J7VR52.js";
|
|
13
|
+
import {
|
|
14
|
+
emit
|
|
15
|
+
} from "./chunk-CXK4DZH3.js";
|
|
16
|
+
|
|
17
|
+
// src/swimlane/diagnostics.ts
|
|
18
|
+
var SWIMLANE_DX = {
|
|
19
|
+
DUPLICATE_NODE: {
|
|
20
|
+
code: "E_SWIMLANE_DUPLICATE_NODE",
|
|
21
|
+
severity: "error",
|
|
22
|
+
chartType: "swimlane",
|
|
23
|
+
title: "Duplicate node",
|
|
24
|
+
message: (p) => `Duplicate node name '${p.name ?? "Foo"}'`,
|
|
25
|
+
hint: "Every node name must be unique across the diagram \u2014 rename or remove the second declaration.",
|
|
26
|
+
example: `swimlane T
|
|
27
|
+
lane L
|
|
28
|
+
L
|
|
29
|
+
Foo
|
|
30
|
+
Foo`
|
|
31
|
+
},
|
|
32
|
+
UNKNOWN_NODE: {
|
|
33
|
+
code: "E_SWIMLANE_UNKNOWN_NODE",
|
|
34
|
+
severity: "error",
|
|
35
|
+
chartType: "swimlane",
|
|
36
|
+
title: "Unknown node in edge",
|
|
37
|
+
message: (p) => `Edge references unknown node '${p.node ?? "Bar"}'`,
|
|
38
|
+
hint: "Declare the node under a lane before referencing it in a flow arrow.",
|
|
39
|
+
example: `swimlane T
|
|
40
|
+
lane L
|
|
41
|
+
L
|
|
42
|
+
Foo
|
|
43
|
+
Foo -> Bar`
|
|
44
|
+
},
|
|
45
|
+
UNKNOWN_LANE: {
|
|
46
|
+
code: "E_SWIMLANE_UNKNOWN_LANE",
|
|
47
|
+
severity: "error",
|
|
48
|
+
chartType: "swimlane",
|
|
49
|
+
title: "Node outside a lane",
|
|
50
|
+
message: (p) => `Node '${p.node ?? "Foo"}' is not inside a lane \u2014 declare a lane first`,
|
|
51
|
+
hint: "Open a lane context (a bare line matching a declared lane) before the node line.",
|
|
52
|
+
example: `swimlane T
|
|
53
|
+
lane L
|
|
54
|
+
[Start]
|
|
55
|
+
Foo`
|
|
56
|
+
},
|
|
57
|
+
NO_LANES: {
|
|
58
|
+
code: "E_SWIMLANE_NO_LANES",
|
|
59
|
+
severity: "error",
|
|
60
|
+
chartType: "swimlane",
|
|
61
|
+
title: "Phase without lanes",
|
|
62
|
+
message: (p) => `Phase '${p.phase ?? "Start"}' declared but no lanes exist`,
|
|
63
|
+
hint: "Declare at least one `lane <Name>` before any `[Phase]` header.",
|
|
64
|
+
example: `swimlane T
|
|
65
|
+
[Start]`
|
|
66
|
+
},
|
|
67
|
+
// One code, many wordings — the call site passes the exact `reason`:
|
|
68
|
+
// parseNodeToken: 'inclusive gateway (<o …>) is fast-follow', event-based,
|
|
69
|
+
// timer|message|signal events; declareNode: 'notes are
|
|
70
|
+
// deferred past v1', 'data objects are deferred past v1',
|
|
71
|
+
// `${k} events are fast-follow`; addChain: 'message flow
|
|
72
|
+
// (~>) is fast-follow'.
|
|
73
|
+
UNSUPPORTED: {
|
|
74
|
+
code: "E_SWIMLANE_UNSUPPORTED",
|
|
75
|
+
severity: "error",
|
|
76
|
+
chartType: "swimlane",
|
|
77
|
+
title: "Unsupported construct",
|
|
78
|
+
message: (p) => typeof p.reason === "string" && p.reason ? p.reason : "inclusive gateway (<o \u2026>) is fast-follow",
|
|
79
|
+
hint: "This construct is deferred past v1 / fast-follow \u2014 remove it or use a supported shape, event, or flow.",
|
|
80
|
+
example: `swimlane T
|
|
81
|
+
lane L
|
|
82
|
+
L
|
|
83
|
+
<o Maybe>`
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var SWIMLANE_DIAGNOSTICS = Object.values(SWIMLANE_DX);
|
|
87
|
+
|
|
88
|
+
// src/swimlane/parser.ts
|
|
89
|
+
function normKey(label) {
|
|
90
|
+
return label.trim().replace(/\s+/g, " ").toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
function parseNodeToken(raw) {
|
|
93
|
+
const t = raw.trim();
|
|
94
|
+
if (t.startsWith("<") && t.endsWith(">") && t.length >= 2) {
|
|
95
|
+
const inner = t.slice(1, -1).trim();
|
|
96
|
+
if (inner.startsWith("+")) {
|
|
97
|
+
return {
|
|
98
|
+
shape: "parallel",
|
|
99
|
+
event: "none",
|
|
100
|
+
label: inner.slice(1).trim()
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (inner.startsWith("o ") || inner === "o") {
|
|
104
|
+
return {
|
|
105
|
+
shape: "exclusive",
|
|
106
|
+
event: "none",
|
|
107
|
+
label: inner.replace(/^o\s*/, "").trim(),
|
|
108
|
+
unsupported: "inclusive gateway (<o \u2026>) is fast-follow"
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (inner.startsWith("* ") || inner === "*") {
|
|
112
|
+
return {
|
|
113
|
+
shape: "exclusive",
|
|
114
|
+
event: "none",
|
|
115
|
+
label: inner.replace(/^\*\s*/, "").trim(),
|
|
116
|
+
unsupported: "event-based gateway (<* \u2026>) is fast-follow"
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return { shape: "exclusive", event: "none", label: inner };
|
|
120
|
+
}
|
|
121
|
+
if (t.startsWith("[[") && t.endsWith("]]") && t.length >= 4) {
|
|
122
|
+
return { shape: "subprocess", event: "none", label: t.slice(2, -2).trim() };
|
|
123
|
+
}
|
|
124
|
+
if (t.startsWith("(")) {
|
|
125
|
+
const close = t.indexOf(")");
|
|
126
|
+
if (close > 0) {
|
|
127
|
+
let inner = t.slice(1, close).trim();
|
|
128
|
+
let event = "none";
|
|
129
|
+
let unsupported;
|
|
130
|
+
if (inner.startsWith("!")) {
|
|
131
|
+
event = "error";
|
|
132
|
+
inner = inner.slice(1).trim();
|
|
133
|
+
}
|
|
134
|
+
const trailing = t.slice(close + 1).trim().toLowerCase();
|
|
135
|
+
if (trailing) {
|
|
136
|
+
if (trailing === "success") event = "success";
|
|
137
|
+
else if (trailing === "terminate") event = "terminate";
|
|
138
|
+
else if (trailing === "error") event = "error";
|
|
139
|
+
else if (trailing === "timer")
|
|
140
|
+
unsupported = "timer events are fast-follow";
|
|
141
|
+
else if (trailing === "message")
|
|
142
|
+
unsupported = "message events are fast-follow";
|
|
143
|
+
else if (trailing === "signal")
|
|
144
|
+
unsupported = "signal events are fast-follow";
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
shape: "terminal",
|
|
148
|
+
event,
|
|
149
|
+
label: inner,
|
|
150
|
+
...unsupported !== void 0 && { unsupported }
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return { shape: "task", event: "none", label: t };
|
|
155
|
+
}
|
|
156
|
+
var ARROW_RE = /(?:^|\s)-([^>]+?)->|->/g;
|
|
157
|
+
function splitChain(line) {
|
|
158
|
+
const parts = [];
|
|
159
|
+
ARROW_RE.lastIndex = 0;
|
|
160
|
+
let lastIndex = 0;
|
|
161
|
+
let m;
|
|
162
|
+
const rawLabels = [];
|
|
163
|
+
const segments = [];
|
|
164
|
+
while ((m = ARROW_RE.exec(line)) !== null) {
|
|
165
|
+
segments.push(line.slice(lastIndex, m.index));
|
|
166
|
+
let lbl = m[1]?.trim();
|
|
167
|
+
if (lbl === "") lbl = void 0;
|
|
168
|
+
rawLabels.push(lbl);
|
|
169
|
+
lastIndex = m.index + m[0].length;
|
|
170
|
+
}
|
|
171
|
+
segments.push(line.slice(lastIndex));
|
|
172
|
+
for (let i = 0; i < segments.length; i++) {
|
|
173
|
+
parts.push({
|
|
174
|
+
text: segments[i].trim(),
|
|
175
|
+
...rawLabels[i] !== void 0 && { labelAfter: rawLabels[i] }
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return parts;
|
|
179
|
+
}
|
|
180
|
+
function splitNodeMeta(line) {
|
|
181
|
+
const m = line.match(/(^|\s)([A-Za-z][\w-]*)\s*:/);
|
|
182
|
+
if (m?.index === void 0) {
|
|
183
|
+
return { token: line.trim(), meta: {} };
|
|
184
|
+
}
|
|
185
|
+
const cut = m.index + (m[1] ? m[1].length : 0);
|
|
186
|
+
const token = line.slice(0, cut).trim();
|
|
187
|
+
const region = line.slice(cut);
|
|
188
|
+
const meta = {};
|
|
189
|
+
for (const pair of region.split(",")) {
|
|
190
|
+
const idx = pair.indexOf(":");
|
|
191
|
+
if (idx <= 0) continue;
|
|
192
|
+
const key = pair.slice(0, idx).trim().toLowerCase();
|
|
193
|
+
const value = pair.slice(idx + 1).trim();
|
|
194
|
+
if (!key) continue;
|
|
195
|
+
meta[key] = value;
|
|
196
|
+
}
|
|
197
|
+
return { token, meta };
|
|
198
|
+
}
|
|
199
|
+
function parseSwimlane(content, palette) {
|
|
200
|
+
const diagnostics = [];
|
|
201
|
+
const lanes = [];
|
|
202
|
+
const phases = [];
|
|
203
|
+
const nodes = [];
|
|
204
|
+
const edges = [];
|
|
205
|
+
const tagGroups = [];
|
|
206
|
+
const laneByKey = /* @__PURE__ */ new Map();
|
|
207
|
+
const phaseByKey = /* @__PURE__ */ new Map();
|
|
208
|
+
const nodeByKey = /* @__PURE__ */ new Map();
|
|
209
|
+
const metaAliasMap = /* @__PURE__ */ new Map();
|
|
210
|
+
const options = {};
|
|
211
|
+
let direction = "LR";
|
|
212
|
+
const rawLines = content.split("\n");
|
|
213
|
+
let title;
|
|
214
|
+
let titleLineNumber;
|
|
215
|
+
let startIdx = 0;
|
|
216
|
+
for (let i = 0; i < rawLines.length; i++) {
|
|
217
|
+
const t = rawLines[i].trim();
|
|
218
|
+
if (!t || t.startsWith("//")) continue;
|
|
219
|
+
const fl = parseFirstLine(rawLines[i]);
|
|
220
|
+
if (fl?.chartType === "swimlane") {
|
|
221
|
+
title = fl.title;
|
|
222
|
+
titleLineNumber = i + 1;
|
|
223
|
+
}
|
|
224
|
+
startIdx = i + 1;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
let currentTagGroup = null;
|
|
228
|
+
let sawContent = false;
|
|
229
|
+
for (let i = startIdx; i < rawLines.length; i++) {
|
|
230
|
+
const raw = rawLines[i];
|
|
231
|
+
const lineNum = i + 1;
|
|
232
|
+
const trimmed = raw.trim();
|
|
233
|
+
if (!trimmed || trimmed.startsWith("//")) continue;
|
|
234
|
+
const indent = measureIndent(raw);
|
|
235
|
+
const tagMatch = matchTagBlockHeading(trimmed);
|
|
236
|
+
if (tagMatch && indent === 0) {
|
|
237
|
+
const newGroup = {
|
|
238
|
+
name: tagMatch.name,
|
|
239
|
+
...tagMatch.alias !== void 0 && { alias: tagMatch.alias },
|
|
240
|
+
entries: [],
|
|
241
|
+
lineNumber: lineNum
|
|
242
|
+
};
|
|
243
|
+
currentTagGroup = newGroup;
|
|
244
|
+
if (tagMatch.alias) {
|
|
245
|
+
metaAliasMap.set(normKey(tagMatch.alias), tagAttrKey(tagMatch.name));
|
|
246
|
+
}
|
|
247
|
+
metaAliasMap.set(normKey(tagMatch.name), tagAttrKey(tagMatch.name));
|
|
248
|
+
if (tagMatch.inlineValues) {
|
|
249
|
+
for (const rawVal of tagMatch.inlineValues) {
|
|
250
|
+
const { text, isDefault } = stripDefaultModifier(rawVal);
|
|
251
|
+
const { label, color } = extractColor(
|
|
252
|
+
text,
|
|
253
|
+
palette,
|
|
254
|
+
diagnostics,
|
|
255
|
+
lineNum
|
|
256
|
+
);
|
|
257
|
+
newGroup.entries.push({
|
|
258
|
+
value: label,
|
|
259
|
+
color: color ?? AUTO_TAG_COLOR_SENTINEL,
|
|
260
|
+
lineNumber: lineNum
|
|
261
|
+
});
|
|
262
|
+
if (isDefault) newGroup.defaultValue = label;
|
|
263
|
+
}
|
|
264
|
+
if (!newGroup.defaultValue && newGroup.entries.length > 0) {
|
|
265
|
+
newGroup.defaultValue = newGroup.entries[0].value;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
tagGroups.push(newGroup);
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (currentTagGroup && indent > 0 && !sawContent) {
|
|
272
|
+
const { text, isDefault } = stripDefaultModifier(trimmed);
|
|
273
|
+
const { label, color } = extractColor(
|
|
274
|
+
text,
|
|
275
|
+
palette,
|
|
276
|
+
diagnostics,
|
|
277
|
+
lineNum
|
|
278
|
+
);
|
|
279
|
+
currentTagGroup.entries.push({
|
|
280
|
+
value: label,
|
|
281
|
+
color: color ?? AUTO_TAG_COLOR_SENTINEL,
|
|
282
|
+
lineNumber: lineNum
|
|
283
|
+
});
|
|
284
|
+
if (isDefault || currentTagGroup.entries.length === 1) {
|
|
285
|
+
currentTagGroup.defaultValue = label;
|
|
286
|
+
}
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
if (indent === 0) currentTagGroup = null;
|
|
290
|
+
if (indent === 0 && /^solid-fill\s*$/i.test(trimmed)) {
|
|
291
|
+
options["solid-fill"] = "on";
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
if (indent === 0 && /^direction\s+/i.test(trimmed)) {
|
|
295
|
+
const val = trimmed.replace(/^direction\s+/i, "").trim().toUpperCase();
|
|
296
|
+
if (val === "LR" || val === "TB") {
|
|
297
|
+
direction = val;
|
|
298
|
+
options["direction"] = val;
|
|
299
|
+
}
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
if (indent === 0 && /^lane\s+/i.test(trimmed)) {
|
|
303
|
+
const rest = trimmed.replace(/^lane\s+/i, "").trim();
|
|
304
|
+
const { label, color } = extractColor(
|
|
305
|
+
rest,
|
|
306
|
+
palette,
|
|
307
|
+
diagnostics,
|
|
308
|
+
lineNum
|
|
309
|
+
);
|
|
310
|
+
const key = normKey(label);
|
|
311
|
+
if (laneByKey.has(key)) continue;
|
|
312
|
+
const lane = {
|
|
313
|
+
id: label,
|
|
314
|
+
label,
|
|
315
|
+
...color !== void 0 && { color },
|
|
316
|
+
lineNumber: lineNum
|
|
317
|
+
};
|
|
318
|
+
lanes.push(lane);
|
|
319
|
+
laneByKey.set(key, lane);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
if (indent === 0 && !trimmed.startsWith("tag ")) sawContent = true;
|
|
323
|
+
}
|
|
324
|
+
let currentPhase = null;
|
|
325
|
+
let currentLane = null;
|
|
326
|
+
let laneIndent = -1;
|
|
327
|
+
let currentFlowSource = null;
|
|
328
|
+
const declareNode = (token, meta, lineNum) => {
|
|
329
|
+
const parsed = parseNodeToken(token);
|
|
330
|
+
if (parsed.unsupported) {
|
|
331
|
+
diagnostics.push(
|
|
332
|
+
emit(SWIMLANE_DX.UNSUPPORTED, lineNum, { reason: parsed.unsupported })
|
|
333
|
+
);
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (!parsed.label) return;
|
|
337
|
+
if (!currentLane) {
|
|
338
|
+
diagnostics.push(
|
|
339
|
+
emit(SWIMLANE_DX.UNKNOWN_LANE, lineNum, { node: parsed.label })
|
|
340
|
+
);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const { label: cleanLabel, color } = extractColor(
|
|
344
|
+
parsed.label,
|
|
345
|
+
palette,
|
|
346
|
+
diagnostics,
|
|
347
|
+
lineNum
|
|
348
|
+
);
|
|
349
|
+
const key = normKey(cleanLabel);
|
|
350
|
+
if (nodeByKey.has(key)) {
|
|
351
|
+
diagnostics.push(
|
|
352
|
+
emit(SWIMLANE_DX.DUPLICATE_NODE, lineNum, { name: cleanLabel })
|
|
353
|
+
);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
const tags = {};
|
|
357
|
+
for (const [k, v] of Object.entries(meta)) {
|
|
358
|
+
if (k === "note") {
|
|
359
|
+
diagnostics.push(
|
|
360
|
+
emit(SWIMLANE_DX.UNSUPPORTED, lineNum, {
|
|
361
|
+
reason: "notes are deferred past v1"
|
|
362
|
+
})
|
|
363
|
+
);
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
if (k === "data") {
|
|
367
|
+
diagnostics.push(
|
|
368
|
+
emit(SWIMLANE_DX.UNSUPPORTED, lineNum, {
|
|
369
|
+
reason: "data objects are deferred past v1"
|
|
370
|
+
})
|
|
371
|
+
);
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
if (k === "timer" || k === "message" || k === "signal") {
|
|
375
|
+
diagnostics.push(
|
|
376
|
+
emit(SWIMLANE_DX.UNSUPPORTED, lineNum, {
|
|
377
|
+
reason: `${k} events are fast-follow`
|
|
378
|
+
})
|
|
379
|
+
);
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
const canonical = metaAliasMap.get(k) ?? k;
|
|
383
|
+
tags[canonical] = v;
|
|
384
|
+
}
|
|
385
|
+
const node = {
|
|
386
|
+
id: cleanLabel,
|
|
387
|
+
label: cleanLabel,
|
|
388
|
+
shape: parsed.shape,
|
|
389
|
+
event: parsed.event,
|
|
390
|
+
lane: currentLane.id,
|
|
391
|
+
...currentPhase && { phase: currentPhase.id },
|
|
392
|
+
...color !== void 0 && { color },
|
|
393
|
+
tags,
|
|
394
|
+
lineNumber: lineNum
|
|
395
|
+
};
|
|
396
|
+
nodes.push(node);
|
|
397
|
+
nodeByKey.set(key, node);
|
|
398
|
+
};
|
|
399
|
+
const resolveRef = (token, lineNum) => {
|
|
400
|
+
const parsed = parseNodeToken(token);
|
|
401
|
+
if (parsed.unsupported) {
|
|
402
|
+
diagnostics.push(
|
|
403
|
+
emit(SWIMLANE_DX.UNSUPPORTED, lineNum, { reason: parsed.unsupported })
|
|
404
|
+
);
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
const { label } = extractColor(parsed.label, palette);
|
|
408
|
+
const key = normKey(label);
|
|
409
|
+
const node = nodeByKey.get(key);
|
|
410
|
+
if (!node) {
|
|
411
|
+
diagnostics.push(
|
|
412
|
+
emit(SWIMLANE_DX.UNKNOWN_NODE, lineNum, { node: parsed.label })
|
|
413
|
+
);
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
return node.id;
|
|
417
|
+
};
|
|
418
|
+
const addChain = (line, lineNum) => {
|
|
419
|
+
if (line.includes("~>")) {
|
|
420
|
+
diagnostics.push(
|
|
421
|
+
emit(SWIMLANE_DX.UNSUPPORTED, lineNum, {
|
|
422
|
+
reason: "message flow (~>) is fast-follow"
|
|
423
|
+
})
|
|
424
|
+
);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
const parts = splitChain(line);
|
|
428
|
+
if (parts.length < 2) return;
|
|
429
|
+
const resolved = [];
|
|
430
|
+
for (let p = 0; p < parts.length; p++) {
|
|
431
|
+
const text = parts[p].text;
|
|
432
|
+
if (p === 0 && text === "") {
|
|
433
|
+
resolved.push(currentFlowSource);
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
resolved.push(resolveRef(text, lineNum));
|
|
437
|
+
}
|
|
438
|
+
for (let p = 0; p < parts.length - 1; p++) {
|
|
439
|
+
const src = resolved[p];
|
|
440
|
+
const tgt = resolved[p + 1];
|
|
441
|
+
const label = parts[p].labelAfter;
|
|
442
|
+
if (!src || !tgt) continue;
|
|
443
|
+
edges.push({
|
|
444
|
+
source: src,
|
|
445
|
+
target: tgt,
|
|
446
|
+
...label !== void 0 && { label },
|
|
447
|
+
lineNumber: lineNum
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
let inTagBlock = false;
|
|
452
|
+
for (let i = startIdx; i < rawLines.length; i++) {
|
|
453
|
+
const raw = rawLines[i];
|
|
454
|
+
const lineNum = i + 1;
|
|
455
|
+
let trimmed = raw.trim();
|
|
456
|
+
if (!trimmed || trimmed.startsWith("//")) continue;
|
|
457
|
+
const cIdx = trimmed.indexOf("//");
|
|
458
|
+
if (cIdx > 0) trimmed = trimmed.slice(0, cIdx).trim();
|
|
459
|
+
if (!trimmed) continue;
|
|
460
|
+
const indent = measureIndent(raw);
|
|
461
|
+
if (indent === 0 && /^(lane|direction|tag)\s+/i.test(trimmed)) {
|
|
462
|
+
inTagBlock = /^tag\s+/i.test(trimmed);
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
if (indent === 0 && /^solid-fill\s*$/i.test(trimmed)) continue;
|
|
466
|
+
if (matchTagBlockHeading(trimmed) && indent === 0) {
|
|
467
|
+
inTagBlock = true;
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
if (indent === 0) inTagBlock = false;
|
|
471
|
+
if (inTagBlock && indent > 0) continue;
|
|
472
|
+
if (indent === 0 && trimmed.startsWith("[") && trimmed.endsWith("]") && !trimmed.startsWith("[[")) {
|
|
473
|
+
const label = trimmed.slice(1, -1).trim();
|
|
474
|
+
if (lanes.length === 0) {
|
|
475
|
+
diagnostics.push(emit(SWIMLANE_DX.NO_LANES, lineNum, { phase: label }));
|
|
476
|
+
}
|
|
477
|
+
const key = normKey(label);
|
|
478
|
+
let phase = phaseByKey.get(key);
|
|
479
|
+
if (!phase) {
|
|
480
|
+
phase = { id: label, label, lineNumber: lineNum };
|
|
481
|
+
phases.push(phase);
|
|
482
|
+
phaseByKey.set(key, phase);
|
|
483
|
+
}
|
|
484
|
+
currentPhase = phase;
|
|
485
|
+
currentLane = null;
|
|
486
|
+
laneIndent = -1;
|
|
487
|
+
currentFlowSource = null;
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
if (trimmed.includes("->") || trimmed.includes("~>")) {
|
|
491
|
+
addChain(trimmed, lineNum);
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
const laneRef = laneByKey.get(normKey(trimmed));
|
|
495
|
+
if (laneRef && (laneIndent < 0 || indent <= laneIndent)) {
|
|
496
|
+
currentLane = laneRef;
|
|
497
|
+
laneIndent = indent;
|
|
498
|
+
currentFlowSource = null;
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
if (indent === 0) {
|
|
502
|
+
const ref = resolveRef(trimmed, lineNum);
|
|
503
|
+
if (ref) currentFlowSource = ref;
|
|
504
|
+
continue;
|
|
505
|
+
}
|
|
506
|
+
const { token, meta } = splitNodeMeta(trimmed);
|
|
507
|
+
declareNode(token, meta, lineNum);
|
|
508
|
+
}
|
|
509
|
+
finalizeAutoTagColors(tagGroups, palette);
|
|
510
|
+
return {
|
|
511
|
+
...title !== void 0 && { title },
|
|
512
|
+
...titleLineNumber !== void 0 && { titleLineNumber },
|
|
513
|
+
direction,
|
|
514
|
+
lanes,
|
|
515
|
+
phases,
|
|
516
|
+
nodes,
|
|
517
|
+
edges,
|
|
518
|
+
tagGroups,
|
|
519
|
+
options,
|
|
520
|
+
diagnostics,
|
|
521
|
+
error: null
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export {
|
|
526
|
+
SWIMLANE_DIAGNOSTICS,
|
|
527
|
+
parseSwimlane
|
|
528
|
+
};
|
|
529
|
+
//# sourceMappingURL=chunk-WVAJFAIA.js.map
|