@md2nativedocx/core 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/diagrams/architecture-diagram/translator.js +8 -8
- package/dist/diagrams/architecture-diagram/translator.js.map +1 -1
- package/dist/diagrams/c4/translator.js +10 -10
- package/dist/diagrams/c4/translator.js.map +1 -1
- package/dist/diagrams/class-diagram/translator.js +20 -8
- package/dist/diagrams/class-diagram/translator.js.map +1 -1
- package/dist/diagrams/er-diagram/translator.js +8 -8
- package/dist/diagrams/er-diagram/translator.js.map +1 -1
- package/dist/diagrams/plantuml/class-parser.d.ts +24 -0
- package/dist/diagrams/plantuml/class-parser.js +315 -0
- package/dist/diagrams/plantuml/class-parser.js.map +1 -0
- package/dist/diagrams/plantuml/sequence-parser.d.ts +7 -4
- package/dist/diagrams/plantuml/sequence-parser.js +84 -18
- package/dist/diagrams/plantuml/sequence-parser.js.map +1 -1
- package/dist/diagrams/requirement-diagram/translator.js +10 -10
- package/dist/diagrams/requirement-diagram/translator.js.map +1 -1
- package/dist/diagrams/state-diagram/translator.js +8 -8
- package/dist/diagrams/state-diagram/translator.js.map +1 -1
- package/dist/layout/graph-limits.d.ts +13 -0
- package/dist/layout/graph-limits.js +34 -1
- package/dist/layout/graph-limits.js.map +1 -1
- package/dist/layout/layout.js +3 -3
- package/dist/layout/layout.js.map +1 -1
- package/dist/parser/diagram-type.d.ts +2 -0
- package/dist/parser/diagram-type.js +14 -3
- package/dist/parser/diagram-type.js.map +1 -1
- package/dist/render-diagram.js +11 -4
- package/dist/render-diagram.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for PlantUML class diagrams (`@startuml` ... `@enduml`), into the same AST as Mermaid's
|
|
3
|
+
* `classDiagram` (`../class-diagram/types.ts`), so layout, translation and the inheritance-tree SmartArt are
|
|
4
|
+
* shared. Line-oriented and forgiving like the other parsers: an unrecognized line is a warning, never a throw.
|
|
5
|
+
*
|
|
6
|
+
* Supported: element declarations (`class`, `abstract [class]`, `interface`, `enum`, `annotation`, `struct`,
|
|
7
|
+
* `exception`, `entity`, `protocol`, `metaclass`, `stereotype`, `record`, `dataclass`), quoted names and
|
|
8
|
+
* `as` aliases, generics (`Foo<T>`, not displayed), stereotypes, colours and `extends` / `implements`
|
|
9
|
+
* (drawn as relations); member blocks `{ ... }` with visibility, `{static}` / `{abstract}` / `{field}` /
|
|
10
|
+
* `{method}` modifiers and separator lines skipped; `Class : member` lines; relations with every end
|
|
11
|
+
* (`<|` `|>` `^` `*` `o` `<` `>` `#` `x` `}` `{` `+`), solid or dotted shafts, direction hints (`-up->`,
|
|
12
|
+
* `-[#red]->`), quoted cardinalities (dropped, with a warning) and `: label` (direction marks `<` `>`
|
|
13
|
+
* dropped); `left to right direction`. Kept with a warning: `package` / `namespace` / `together` blocks
|
|
14
|
+
* (contents parsed, grouping not drawn). Ignored with a warning: notes, `skinparam`, `<style>`, `hide` /
|
|
15
|
+
* `show` / `remove`, preprocessor lines, `!include` (never followed: it would read a file or a URL).
|
|
16
|
+
* Capped (hostile input): 300 classes, 600 relations, 100 members per class.
|
|
17
|
+
*/
|
|
18
|
+
const MAX_CLASSES = 300;
|
|
19
|
+
const MAX_RELATIONS = 600;
|
|
20
|
+
const MAX_MEMBERS = 100;
|
|
21
|
+
const MAX_LINE = 2000;
|
|
22
|
+
const KINDS = String.raw `abstract\s+class|abstract|class|interface|enum|annotation|struct|exception|entity|protocol|metaclass|stereotype|record|dataclass|circle|diamond`;
|
|
23
|
+
/** An element name: a quoted string or a run of name characters (dots for packages, `$` like Java). */
|
|
24
|
+
const NAME = String.raw `"[^"]+"|[\w.$À-]+(?:::[\w.$À-]+)*`;
|
|
25
|
+
const DECLARATION = new RegExp(String.raw `^(${KINDS})\s+(${NAME})(.*)$`, 'i');
|
|
26
|
+
/**
|
|
27
|
+
* Relation: optional quoted cardinality, left end, shaft (dashes or dots, with an optional direction word or
|
|
28
|
+
* `[...]` style inside), right end, optional cardinality. Ends are matched as short alternations, never nested
|
|
29
|
+
* quantifiers.
|
|
30
|
+
*/
|
|
31
|
+
const LEFT_END = String.raw `<\||\^|\*|o|<|#|x|\}|\+|\(\)`;
|
|
32
|
+
const RIGHT_END = String.raw `\|>|\^|\*|o|>|#|x|\{|\+|\(\)`;
|
|
33
|
+
/** A cardinality or role next to a relation end: `"1"`, `"0..n"/items`. */
|
|
34
|
+
const CARD = String.raw `(?:"[^"]*"(?:\/\S+)?\s*)?`;
|
|
35
|
+
const SHAFT = String.raw `(?:-+|\.+)(?:(?:up|down|left|right|u|d|l|r|le|ri|do)?(?:\[[^\]]*\])?)(?:-*|\.*)`;
|
|
36
|
+
const RELATION = new RegExp(String.raw `^(?<a>${NAME})\s*${CARD}(?<l>${LEFT_END})?(?<shaft>${SHAFT})(?<r>${RIGHT_END})?\s*${CARD}(?<b>${NAME})(?:\s+#\S+)?\s*(?::(?<label>.*))?$`, 'i');
|
|
37
|
+
const unquote = (s) => s.trim().replace(/^"(.*)"$/, '$1');
|
|
38
|
+
/** Which UML relation two ends and a shaft mean, and which side carries the marker. */
|
|
39
|
+
function relationOf(left, right, dotted) {
|
|
40
|
+
const kindOf = (end) => {
|
|
41
|
+
if (end === '<|' || end === '|>' || end === '^')
|
|
42
|
+
return dotted ? 'realization' : 'inheritance';
|
|
43
|
+
if (end === '*')
|
|
44
|
+
return 'composition';
|
|
45
|
+
if (end === 'o')
|
|
46
|
+
return 'aggregation';
|
|
47
|
+
if (end === '<' || end === '>')
|
|
48
|
+
return dotted ? 'dependency' : 'association';
|
|
49
|
+
return undefined; // `#`, `x`, `}`, `{`, `+`: no matching marker in the shared drawing; a plain line
|
|
50
|
+
};
|
|
51
|
+
// The more specific marker wins when both ends carry one (`<|--*` is rare; inheritance first).
|
|
52
|
+
const order = ['inheritance', 'realization', 'composition', 'aggregation', 'dependency', 'association'];
|
|
53
|
+
const l = kindOf(left);
|
|
54
|
+
const r = kindOf(right);
|
|
55
|
+
if (l !== undefined && (r === undefined || order.indexOf(l) <= order.indexOf(r)))
|
|
56
|
+
return { type: l, markerEnd: 'from' };
|
|
57
|
+
if (r !== undefined)
|
|
58
|
+
return { type: r, markerEnd: 'to' };
|
|
59
|
+
return { type: dotted ? 'dashedLink' : 'link', markerEnd: 'none' };
|
|
60
|
+
}
|
|
61
|
+
/** Parse PlantUML class-diagram text into the shared class AST. Never throws on malformed input. */
|
|
62
|
+
export function parsePlantUmlClass(source) {
|
|
63
|
+
const warnings = [];
|
|
64
|
+
const warned = new Set();
|
|
65
|
+
const ast = { direction: 'TD', classes: [], relationships: [] };
|
|
66
|
+
const warnOnce = (key, message) => {
|
|
67
|
+
if (warned.has(key))
|
|
68
|
+
return;
|
|
69
|
+
warned.add(key);
|
|
70
|
+
warnings.push(message);
|
|
71
|
+
};
|
|
72
|
+
const find = (id) => ast.classes.find((c) => c.id === id);
|
|
73
|
+
const ensure = (id, label) => {
|
|
74
|
+
const existing = find(id);
|
|
75
|
+
if (existing) {
|
|
76
|
+
if (label !== undefined)
|
|
77
|
+
existing.label = label;
|
|
78
|
+
return existing;
|
|
79
|
+
}
|
|
80
|
+
if (ast.classes.length >= MAX_CLASSES) {
|
|
81
|
+
warnOnce('classes', `Class diagram limited to ${MAX_CLASSES} classes; the rest were ignored.`);
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
const box = { id, label: label ?? id, attributes: [], methods: [] };
|
|
85
|
+
ast.classes.push(box);
|
|
86
|
+
return box;
|
|
87
|
+
};
|
|
88
|
+
const relate = (from, to, type, markerEnd, label) => {
|
|
89
|
+
if (ast.relationships.length >= MAX_RELATIONS)
|
|
90
|
+
return warnOnce('relations', `Class diagram limited to ${MAX_RELATIONS} relations; the rest were ignored.`);
|
|
91
|
+
if (!ensure(from) || !ensure(to))
|
|
92
|
+
return;
|
|
93
|
+
ast.relationships.push(label ? { from, to, type, markerEnd, label } : { from, to, type, markerEnd });
|
|
94
|
+
};
|
|
95
|
+
const addMember = (box, raw) => {
|
|
96
|
+
let line = raw.replace(/\{(?:static|classifier|abstract|field|method)\}\s*/gi, '').trim();
|
|
97
|
+
if (line === '' || /^(?:--|\.\.|==|__)/.test(line))
|
|
98
|
+
return; // separator, possibly titled (`-- title --`)
|
|
99
|
+
if (box.attributes.length + box.methods.length >= MAX_MEMBERS)
|
|
100
|
+
return warnOnce('members', `Classes limited to ${MAX_MEMBERS} members each; the rest were ignored.`);
|
|
101
|
+
let visibility;
|
|
102
|
+
const v = line.charAt(0);
|
|
103
|
+
if (v === '+' || v === '-' || v === '#' || v === '~') {
|
|
104
|
+
visibility = v;
|
|
105
|
+
line = line.slice(1).trim();
|
|
106
|
+
}
|
|
107
|
+
const member = visibility ? { visibility, text: line } : { text: line };
|
|
108
|
+
if (/\(/.test(line))
|
|
109
|
+
box.methods.push(member);
|
|
110
|
+
else
|
|
111
|
+
box.attributes.push(member);
|
|
112
|
+
};
|
|
113
|
+
/** Element ids in `extends A, B` / `implements C` lists. */
|
|
114
|
+
const names = (list) => list.split(',').map((s) => unquote(s.replace(/<[^>]*>/g, ''))).filter((s) => s !== '');
|
|
115
|
+
/** Open `{` blocks: a member block (the class it fills) or a grouping block (package, namespace...). */
|
|
116
|
+
const blocks = [];
|
|
117
|
+
let multi; // the end line of a block whose content is ignored (note, legend, style...)
|
|
118
|
+
let inBlockComment = false;
|
|
119
|
+
/** Names of notes (`note as N1`): a link to one (`N1 .. Foo`) is not a class relation. */
|
|
120
|
+
const noteIds = new Set();
|
|
121
|
+
for (const rawLine of source.split(/\r?\n/)) {
|
|
122
|
+
let line = rawLine.trim().slice(0, MAX_LINE);
|
|
123
|
+
if (inBlockComment) {
|
|
124
|
+
if (line.includes("'/"))
|
|
125
|
+
inBlockComment = false;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (multi) {
|
|
129
|
+
if (multi.test(line))
|
|
130
|
+
multi = undefined;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (line.length === 0 || line.startsWith("'"))
|
|
134
|
+
continue;
|
|
135
|
+
if (line.startsWith("/'")) {
|
|
136
|
+
if (!line.includes("'/", 2))
|
|
137
|
+
inBlockComment = true;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const top = blocks[blocks.length - 1];
|
|
141
|
+
if (top === 'skip') {
|
|
142
|
+
// Ignored content (skinparam, json, map...): only nesting matters.
|
|
143
|
+
if (/^[}\]]/.test(line))
|
|
144
|
+
blocks.pop();
|
|
145
|
+
else if (/[{[]$/.test(line))
|
|
146
|
+
blocks.push('skip');
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (top !== undefined && top !== 'group') {
|
|
150
|
+
// Inside a class body: members until the closing brace.
|
|
151
|
+
if (line === '}')
|
|
152
|
+
blocks.pop();
|
|
153
|
+
else
|
|
154
|
+
addMember(top, line);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
let m;
|
|
158
|
+
// Shorthands rewritten to the long form: element visibility (`-class X`), `()` / `<>` (circle / diamond),
|
|
159
|
+
// and a qualifier on a relation end (`A [key] -- B`), which is not drawn.
|
|
160
|
+
line = line
|
|
161
|
+
.replace(/^[-#~+](?=(?:abstract|class|interface|enum)\b)/i, '')
|
|
162
|
+
.replace(/^\(\)\s+/, 'circle ')
|
|
163
|
+
.replace(/^<>\s+/, 'diamond ')
|
|
164
|
+
.replace(new RegExp(String.raw `^(${NAME})\s*\[[^\]]*\]\s*(?=[-.<^*o#x}+(])`), '$1 ');
|
|
165
|
+
if ((m = line.match(new RegExp(String.raw `^\(\s*(${NAME})\s*,\s*(${NAME})\s*\)\s*\.+\s*(${NAME})$`)))) {
|
|
166
|
+
// Association class: `(A, B) .. C`. Drawn as dotted links from C to A and to B.
|
|
167
|
+
warnOnce('assocclass', 'Association classes (`(A, B) .. C`) are drawn as dotted links to both classes.');
|
|
168
|
+
const c = unquote(m[3]);
|
|
169
|
+
relate(unquote(m[1]), c, 'dashedLink', 'none');
|
|
170
|
+
relate(unquote(m[2]), c, 'dashedLink', 'none');
|
|
171
|
+
}
|
|
172
|
+
else if ((m = line.match(new RegExp(String.raw `^(object|map|json)\s+(${NAME})(.*)$`, 'i')))) {
|
|
173
|
+
// Objects, maps and JSON blocks: a box with the name; map entries and JSON content are not shown.
|
|
174
|
+
warnOnce('objects', 'Objects, maps and JSON blocks in a class diagram are drawn as plain boxes; map and JSON content is not shown.');
|
|
175
|
+
const kind = m[1].toLowerCase();
|
|
176
|
+
const box = ensure(unquote(m[2]));
|
|
177
|
+
if (m[3].trim().endsWith('{'))
|
|
178
|
+
blocks.push(kind === 'object' && box ? box : 'skip');
|
|
179
|
+
}
|
|
180
|
+
else if (/^@(start|end)uml\b/i.test(line)) {
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
else if (line === '}') {
|
|
184
|
+
if (blocks.length > 0)
|
|
185
|
+
blocks.pop();
|
|
186
|
+
else
|
|
187
|
+
warnings.push('`}` without an open block ignored.');
|
|
188
|
+
}
|
|
189
|
+
else if (/^!include/i.test(line)) {
|
|
190
|
+
warnOnce('include', '`!include` is not followed (it would read a file or a URL); its content is missing.');
|
|
191
|
+
}
|
|
192
|
+
else if (/^!/.test(line)) {
|
|
193
|
+
warnOnce('preprocessor', 'PlantUML preprocessor lines (`!theme`, `!define`, variables...) are ignored.');
|
|
194
|
+
}
|
|
195
|
+
else if (/^skinparam\b/i.test(line)) {
|
|
196
|
+
warnOnce('skinparam', '`skinparam` styling is ignored; the diagram uses the default look.');
|
|
197
|
+
if (line.endsWith('{'))
|
|
198
|
+
blocks.push('skip');
|
|
199
|
+
}
|
|
200
|
+
else if (/^<style>/i.test(line)) {
|
|
201
|
+
warnOnce('style', '`<style>` blocks are ignored; the diagram uses the default look.');
|
|
202
|
+
if (!/<\/style>\s*$/i.test(line))
|
|
203
|
+
multi = /^<\/style>$/i;
|
|
204
|
+
}
|
|
205
|
+
else if (/^left\s+to\s+right\s+direction$/i.test(line)) {
|
|
206
|
+
ast.direction = 'LR';
|
|
207
|
+
}
|
|
208
|
+
else if (/^top\s+to\s+bottom\s+direction$/i.test(line)) {
|
|
209
|
+
ast.direction = 'TD';
|
|
210
|
+
}
|
|
211
|
+
else if (/^(?:hide|show|remove|restore|set|scale|title|caption|header|footer|mainframe|allowmixing|allow_mixing|page)\b/i.test(line)) {
|
|
212
|
+
warnOnce('display', 'Display commands (`hide`, `show`, `title`, `set`, ...) are ignored.');
|
|
213
|
+
}
|
|
214
|
+
else if (/^legend\b/i.test(line)) {
|
|
215
|
+
warnOnce('legend', '`legend` blocks are ignored.');
|
|
216
|
+
multi = /^end\s*legend$/i;
|
|
217
|
+
}
|
|
218
|
+
else if (/^[hr]?note\b/i.test(line)) {
|
|
219
|
+
warnOnce('note', 'Notes are not drawn in class diagrams.');
|
|
220
|
+
// A named note (`note "text" as N1`, `note as N1`) can be linked to a class later: remember its name.
|
|
221
|
+
const named = /\bas\s+(\S+)$/i.exec(line);
|
|
222
|
+
if (named)
|
|
223
|
+
noteIds.add(named[1]);
|
|
224
|
+
// A one-line note has a `:` or a quoted text; otherwise the text runs to `end note`.
|
|
225
|
+
// (`A::counter` names a member; only a lone `:` starts the note's text.)
|
|
226
|
+
if (!/(?<!:):(?!:)/.test(line) && !/^[hr]?note\s+"[^"]*"/i.test(line))
|
|
227
|
+
multi = /^end\s*[hr]?note$/i;
|
|
228
|
+
}
|
|
229
|
+
else if ((m = line.match(/^(package|namespace|together|frame|folder|node|rectangle|cloud|database)\b.*\{$/i))) {
|
|
230
|
+
warnOnce('package', `\`${m[1].toLowerCase()}\` groups are not drawn; their classes are kept.`);
|
|
231
|
+
blocks.push('group');
|
|
232
|
+
}
|
|
233
|
+
else if ((m = line.match(DECLARATION))) {
|
|
234
|
+
let rest = m[3].trim();
|
|
235
|
+
const kind = m[1].toLowerCase().replace(/\s+/g, ' ');
|
|
236
|
+
let id = unquote(m[2]);
|
|
237
|
+
let label;
|
|
238
|
+
const alias = new RegExp(String.raw `^as\s+(${NAME})\s*`, 'i').exec(rest);
|
|
239
|
+
if (alias) {
|
|
240
|
+
// `class "Long name" as L` / `class L as "Long name"`: the quoted side is the label.
|
|
241
|
+
const other = alias[1];
|
|
242
|
+
if (m[2].startsWith('"'))
|
|
243
|
+
[id, label] = [unquote(other), id];
|
|
244
|
+
else
|
|
245
|
+
label = unquote(other);
|
|
246
|
+
rest = rest.slice(alias[0].length);
|
|
247
|
+
}
|
|
248
|
+
rest = rest.replace(/^<(?!<)[^>]*>\s*/, ''); // generics (`Foo<T>`): not displayed; `<<` is a stereotype
|
|
249
|
+
if (!/^(class|entity)$/.test(kind))
|
|
250
|
+
warnOnce('kinds', 'Interfaces, enums, abstract classes and other element kinds are drawn as plain class boxes.');
|
|
251
|
+
if (/<<.*?>>/.test(rest))
|
|
252
|
+
warnOnce('stereotype', 'Stereotypes (`<<...>>`) are not displayed.');
|
|
253
|
+
// Stereotypes, `$tags`, then colours and inline styles (`#red-green`, `##[dashed]blue`, `#line:red;back:x`).
|
|
254
|
+
rest = rest
|
|
255
|
+
.replace(/<<.*?>>/g, '')
|
|
256
|
+
.replace(/(?:^|\s)\$[\w.]+/g, ' ')
|
|
257
|
+
.replace(/##\[[^\]]*\][^\s{]*/g, '')
|
|
258
|
+
.replace(/#[^\s{]*/g, '')
|
|
259
|
+
.trim();
|
|
260
|
+
const box = ensure(id, label);
|
|
261
|
+
if (!box)
|
|
262
|
+
continue;
|
|
263
|
+
let ext;
|
|
264
|
+
while ((ext = /^(extends|implements)\s+(.+?)(?=\s+(?:extends|implements)\s|\s*\{?\s*$)/i.exec(rest))) {
|
|
265
|
+
const realization = ext[1].toLowerCase() === 'implements';
|
|
266
|
+
for (const parent of names(ext[2]))
|
|
267
|
+
relate(parent, id, realization ? 'realization' : 'inheritance', 'from');
|
|
268
|
+
rest = rest.slice(ext[0].length).trim();
|
|
269
|
+
}
|
|
270
|
+
if (rest.startsWith('{')) {
|
|
271
|
+
const inline = /^\{(.*)\}$/.exec(rest);
|
|
272
|
+
if (inline)
|
|
273
|
+
for (const part of inline[1].split(';'))
|
|
274
|
+
addMember(box, part);
|
|
275
|
+
else
|
|
276
|
+
blocks.push(box);
|
|
277
|
+
}
|
|
278
|
+
else if (rest !== '') {
|
|
279
|
+
warnings.push(`Unsupported part of a declaration ignored: ${line}`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
else if ((m = line.match(RELATION)) && m.groups) {
|
|
283
|
+
const g = m.groups;
|
|
284
|
+
if (noteIds.has(unquote(g.a)) || noteIds.has(unquote(g.b)))
|
|
285
|
+
continue;
|
|
286
|
+
const shaft = g.shaft;
|
|
287
|
+
if (/"/.test(line.replace(/:.*$/, '')))
|
|
288
|
+
warnOnce('cardinality', 'Relation cardinalities (`"1"`, `"0..*"`) are not displayed.');
|
|
289
|
+
const { type, markerEnd } = relationOf(g.l ?? '', g.r ?? '', shaft.startsWith('.'));
|
|
290
|
+
if (/[#x}{+(]/.test((g.l ?? '') + (g.r ?? '')))
|
|
291
|
+
warnOnce('ends', 'Relation ends `#`, `x`, `}`, `{`, `+` and `()` are drawn as plain lines.');
|
|
292
|
+
const label = (g.label ?? '').trim().replace(/^[<>]\s*|\s*[<>]$/g, '').trim();
|
|
293
|
+
relate(unquote(g.a), unquote(g.b), type, markerEnd, label === '' ? undefined : label);
|
|
294
|
+
}
|
|
295
|
+
else if ((m = line.match(new RegExp(String.raw `^(${NAME})\s*:\s*(.+)$`)))) {
|
|
296
|
+
const box = ensure(unquote(m[1]));
|
|
297
|
+
if (box)
|
|
298
|
+
addMember(box, m[2]);
|
|
299
|
+
}
|
|
300
|
+
else if ((m = line.match(new RegExp(String.raw `^(${NAME})\s*\{$`)))) {
|
|
301
|
+
// `Foo {` after a declaration elsewhere: more members for it.
|
|
302
|
+
const box = ensure(unquote(m[1]));
|
|
303
|
+
blocks.push(box ?? 'skip');
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
warnings.push(`Unsupported line ignored: ${line}`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (multi)
|
|
310
|
+
warnings.push('A multi-line block (`note`, `legend`, `<style>`) was never closed; the rest was ignored.');
|
|
311
|
+
if (blocks.length > 0)
|
|
312
|
+
warnings.push('One or more `{` blocks were never closed; closed automatically.');
|
|
313
|
+
return { ast, warnings };
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=class-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-parser.js","sourceRoot":"","sources":["../../../src/diagrams/plantuml/class-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA,iJAAiJ,CAAC;AAC1K,uGAAuG;AACvG,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA,qCAAqC,CAAC;AAC7D,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,KAAK,KAAK,QAAQ,IAAI,QAAQ,EAAE,GAAG,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA,8BAA8B,CAAC;AAC1D,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA,8BAA8B,CAAC;AAC3D,2EAA2E;AAC3E,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA,2BAA2B,CAAC;AACnD,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAA,iFAAiF,CAAC;AAC1G,MAAM,QAAQ,GAAG,IAAI,MAAM,CACzB,MAAM,CAAC,GAAG,CAAA,SAAS,IAAI,OAAO,IAAI,QAAQ,QAAQ,cAAc,KAAK,SAAS,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AE,IAAI,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC5G,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,KAAK,IAAI,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,CAAC,CAAC,CAAC;YAC5C,IAAI,GAAG;gBAAE,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAW,CAAC,CAAC;QAC1C,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,8DAA8D;YAC9D,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,CAAC,CAAC,CAAC;YAC5C,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,6BAA6B,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,IAAI,KAAK;QAAE,QAAQ,CAAC,IAAI,CAAC,0FAA0F,CAAC,CAAC;IACrH,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IACxG,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -10,10 +10,13 @@
|
|
|
10
10
|
* shorthands; `return`; `activate` / `deactivate` / `create` / `destroy`; notes (`note left of|right of|over`,
|
|
11
11
|
* `note left|right` on the last message, `note across`, `hnote` / `rnote`, single-line and `end note`
|
|
12
12
|
* blocks); `ref over`; `alt` / `else` / `opt` / `loop` / `par` / `break` / `critical` / `group` ... `end`;
|
|
13
|
-
* `== separators ==` (a note across the diagram); `title`; `autonumber
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* `== separators ==` (a note across the diagram); `title`; `autonumber`; `autoactivate on`; `partition`
|
|
14
|
+
* (a group); multi-line participant names (`participant X [ ... ]`); an inline `A -> "Name" as B`; a colour
|
|
15
|
+
* after the receiver (`B #red : text`, ignored). Drawn with a warning: slanted arrows `->(10)` (flat),
|
|
16
|
+
* teoz parallel `&` messages (one after the other), `{anchor}` prefixes (kept, durations dropped), `/ note`
|
|
17
|
+
* (as a plain note). Ignored with a warning: `box`, `skinparam`, `<style>`, `!theme`, `!include` (never
|
|
18
|
+
* followed: it would read a file or a URL), other preprocessor lines, `newpage`, incoming / outgoing
|
|
19
|
+
* messages (`[->`, `->]`, `?->`). Delays (`...`) and spaces (`|||`) are skipped. Capped like the Mermaid parser (hostile input): 50 participants, 500 items, 20 nested blocks.
|
|
17
20
|
*/
|
|
18
21
|
import type { SequenceDiagram } from '../sequence/types.js';
|
|
19
22
|
export interface PlantUmlSequenceParseResult {
|
|
@@ -10,17 +10,21 @@
|
|
|
10
10
|
* shorthands; `return`; `activate` / `deactivate` / `create` / `destroy`; notes (`note left of|right of|over`,
|
|
11
11
|
* `note left|right` on the last message, `note across`, `hnote` / `rnote`, single-line and `end note`
|
|
12
12
|
* blocks); `ref over`; `alt` / `else` / `opt` / `loop` / `par` / `break` / `critical` / `group` ... `end`;
|
|
13
|
-
* `== separators ==` (a note across the diagram); `title`; `autonumber
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* `== separators ==` (a note across the diagram); `title`; `autonumber`; `autoactivate on`; `partition`
|
|
14
|
+
* (a group); multi-line participant names (`participant X [ ... ]`); an inline `A -> "Name" as B`; a colour
|
|
15
|
+
* after the receiver (`B #red : text`, ignored). Drawn with a warning: slanted arrows `->(10)` (flat),
|
|
16
|
+
* teoz parallel `&` messages (one after the other), `{anchor}` prefixes (kept, durations dropped), `/ note`
|
|
17
|
+
* (as a plain note). Ignored with a warning: `box`, `skinparam`, `<style>`, `!theme`, `!include` (never
|
|
18
|
+
* followed: it would read a file or a URL), other preprocessor lines, `newpage`, incoming / outgoing
|
|
19
|
+
* messages (`[->`, `->]`, `?->`). Delays (`...`) and spaces (`|||`) are skipped. Capped like the Mermaid parser (hostile input): 50 participants, 500 items, 20 nested blocks.
|
|
17
20
|
*/
|
|
18
21
|
import { cleanText } from '../sequence/parser.js';
|
|
19
22
|
const MAX_PARTICIPANTS = 50;
|
|
20
23
|
const MAX_ITEMS = 500;
|
|
21
24
|
const MAX_DEPTH = 20;
|
|
22
25
|
const MAX_LINE = 2000;
|
|
23
|
-
|
|
26
|
+
/** A declaration; not `Participant -> Bob`, a message from a participant that happens to be named like a keyword. */
|
|
27
|
+
const PARTICIPANT_KINDS = /^(participant|actor|boundary|control|entity|database|collections|queue)\s+(?![xo]?(?:<|\\|\/)*-)(.+)$/i;
|
|
24
28
|
const GROUPS = new Map([
|
|
25
29
|
['alt', 'alt'],
|
|
26
30
|
['opt', 'opt'],
|
|
@@ -29,12 +33,27 @@ const GROUPS = new Map([
|
|
|
29
33
|
['break', 'break'],
|
|
30
34
|
['critical', 'critical'],
|
|
31
35
|
['group', 'group'],
|
|
36
|
+
['partition', 'group'],
|
|
32
37
|
]);
|
|
33
38
|
/** A participant reference: a quoted name, or a run of characters that cannot start an arrow. */
|
|
34
39
|
const NAME = String.raw `"[^"]+"|[^\s"<>:\-\[\]?]+`;
|
|
35
40
|
/** Arrow: optional left head, a shaft of dashes with an optional `[#colour]`, optional right head. */
|
|
36
41
|
const ARROW = String.raw `([xo]?(?:<<?|\\\\?|\/\/?)?)(-+(?:\[[^\]]*\])?-*)((?:>>?|\\\\?|\/\/?)?[xo]?)`;
|
|
37
|
-
const MESSAGE = new RegExp(String.raw `^(?<from>${NAME}|\[|\?)?\s*${ARROW}\s*(?<to>${NAME}|\]|\?)?\s*(?<mods>(?:\+\+|--|\*\*|!!)(?:\s*(?:\+\+|--|\*\*|!!))*)?\s*(?::(?<text>.*))?$`);
|
|
42
|
+
const MESSAGE = new RegExp(String.raw `^(?<from>${NAME}|\[|\?)?\s*${ARROW}\s*(?<to>${NAME}|\]|\?)?(?:\s+as\s+(?<alias>${NAME}))?\s*(?<color1>#\w+)?\s*(?<mods>(?:\+\+|--|\*\*|!!)(?:\s*(?:\+\+|--|\*\*|!!))*)?\s*(?<color2>#\w+)?\s*(?::(?<text>.*))?$`);
|
|
43
|
+
/** `participant Id [` opening a multi-line display name, closed by a lone `]`. */
|
|
44
|
+
const MULTILINE_PARTICIPANT = new RegExp(String.raw `^(participant|actor|boundary|control|entity|database|collections|queue)\s+(${NAME})\s*\[$`, 'i');
|
|
45
|
+
/** The `Id as Label` / `"Label" as Id` pair: which side is the id, which the label. */
|
|
46
|
+
function idAndLabel(first, second) {
|
|
47
|
+
if (second === undefined)
|
|
48
|
+
return [unquote(first), undefined];
|
|
49
|
+
return first.startsWith('"') && !second.startsWith('"') ? [second, unquote(first)] : [unquote(first), unquote(second)];
|
|
50
|
+
}
|
|
51
|
+
/** A multi-line participant name: `=Title` heading markers, `----` rules and `""monospace""` marks dropped. */
|
|
52
|
+
const multilineName = (body) => body
|
|
53
|
+
.split('\n')
|
|
54
|
+
.map((l) => l.trim().replace(/^=+\s*/, '').replace(/""/g, ''))
|
|
55
|
+
.filter((l) => l !== '' && !/^[-=.]{2,}$/.test(l))
|
|
56
|
+
.join('\\n');
|
|
38
57
|
const unquote = (s) => s.trim().replace(/^"(.*)"$/, '$1');
|
|
39
58
|
/** `\n` in PlantUML text is a line break; the Mermaid cleaner handles `<br>` and entity codes. */
|
|
40
59
|
const text = (raw) => cleanText(raw.replace(/\\n/g, '<br/>'));
|
|
@@ -52,6 +71,8 @@ export function parsePlantUmlSequence(source) {
|
|
|
52
71
|
/** An open multi-line block (`note ... end note`, `ref ... end ref`, `legend ... endlegend`, skinparam `{}`). */
|
|
53
72
|
let multi;
|
|
54
73
|
let inBlockComment = false;
|
|
74
|
+
/** `autoactivate on`: a solid message activates its receiver, a dashed reply from the callee ends it. */
|
|
75
|
+
let autoActivate = false;
|
|
55
76
|
const warnOnce = (key, message) => {
|
|
56
77
|
if (warned.has(key))
|
|
57
78
|
return;
|
|
@@ -95,10 +116,8 @@ export function parsePlantUmlSequence(source) {
|
|
|
95
116
|
warnings.push(`Participant ignored: ${rest}`);
|
|
96
117
|
return undefined;
|
|
97
118
|
}
|
|
98
|
-
const first = m[1];
|
|
99
|
-
const second = m[2];
|
|
100
119
|
// `"Long name" as Id`: the quoted side is the label. `Id as "Long name"` / `Id as Label`: the first is the id.
|
|
101
|
-
const [id, label] =
|
|
120
|
+
const [id, label] = idAndLabel(m[1], m[2]);
|
|
102
121
|
return declare(id, label === undefined ? undefined : text(label), kind.toLowerCase() === 'actor') ? id : undefined;
|
|
103
122
|
};
|
|
104
123
|
const message = (from, to, msgText, dashed, head, both, activate, deactivate) => {
|
|
@@ -122,8 +141,9 @@ export function parsePlantUmlSequence(source) {
|
|
|
122
141
|
const noteAcross = (body) => push({ type: 'note', placement: 'over', actors: [ACROSS], text: text(body) });
|
|
123
142
|
const notePlaced = (spec, body) => {
|
|
124
143
|
let m;
|
|
125
|
-
if ((m = /^(left|right)\s+
|
|
126
|
-
|
|
144
|
+
if ((m = /^(left|right)\s+(.+)$/i.exec(spec))) {
|
|
145
|
+
// `note left of A` and the shorter `note left A`.
|
|
146
|
+
const id = unquote(m[2].replace(/^of\s+/i, '').split(',')[0]);
|
|
127
147
|
if (declare(id))
|
|
128
148
|
push({ type: 'note', placement: m[1].toLowerCase(), actors: [id], text: text(body) });
|
|
129
149
|
}
|
|
@@ -144,7 +164,7 @@ export function parsePlantUmlSequence(source) {
|
|
|
144
164
|
return true;
|
|
145
165
|
};
|
|
146
166
|
for (const rawLine of source.split(/\r?\n/)) {
|
|
147
|
-
|
|
167
|
+
let line = rawLine.trim().slice(0, MAX_LINE);
|
|
148
168
|
if (inBlockComment) {
|
|
149
169
|
if (line.includes("'/"))
|
|
150
170
|
inBlockComment = false;
|
|
@@ -167,7 +187,33 @@ export function parsePlantUmlSequence(source) {
|
|
|
167
187
|
inBlockComment = true;
|
|
168
188
|
continue;
|
|
169
189
|
}
|
|
190
|
+
// Prefixes that only change placement in PlantUML's own renderer; the line itself is kept.
|
|
191
|
+
if (line.startsWith('&')) {
|
|
192
|
+
// teoz: this message runs at the same time as the previous one.
|
|
193
|
+
warnOnce('parallel', 'Parallel messages (`&`) are drawn one after the other.');
|
|
194
|
+
line = line.slice(1).trim();
|
|
195
|
+
}
|
|
196
|
+
if (/^\/\s*[hr]?note\b/i.test(line))
|
|
197
|
+
line = line.slice(1).trim(); // a note aligned with the previous one
|
|
170
198
|
let m;
|
|
199
|
+
if (/^\{[^}]*\}\s*<?-+>?\s*\{[^}]*\}/.test(line)) {
|
|
200
|
+
warnOnce('anchor', 'Duration anchors (`{start}` ... `{end}`) are not drawn.');
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if ((m = /^\{[^}]*\}\s*/.exec(line))) {
|
|
204
|
+
warnOnce('anchor', 'Duration anchors (`{start}` ... `{end}`) are not drawn.');
|
|
205
|
+
line = line.slice(m[0].length);
|
|
206
|
+
}
|
|
207
|
+
{
|
|
208
|
+
// Slanted arrows `->(10)` / `(10)<-`: drawn flat. Only the part before the message text is touched.
|
|
209
|
+
const colon = line.indexOf(':');
|
|
210
|
+
const head = colon === -1 ? line : line.slice(0, colon);
|
|
211
|
+
const flat = head.replace(/(-+>{1,2})\(\d+\)/, '$1').replace(/\(\d+\)(<{1,2}-+)/, '$1');
|
|
212
|
+
if (flat !== head) {
|
|
213
|
+
warnOnce('slanted', 'Slanted arrows (`->(10)`) are drawn flat.');
|
|
214
|
+
line = flat + (colon === -1 ? '' : line.slice(colon));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
171
217
|
if (/^@(start|end)uml\b/i.test(line)) {
|
|
172
218
|
continue;
|
|
173
219
|
}
|
|
@@ -182,7 +228,15 @@ export function parsePlantUmlSequence(source) {
|
|
|
182
228
|
if (line.endsWith('{'))
|
|
183
229
|
multi = { end: /^\}$/, lines: [] };
|
|
184
230
|
}
|
|
185
|
-
else if (
|
|
231
|
+
else if (/^<style>/i.test(line)) {
|
|
232
|
+
warnOnce('style', '`<style>` blocks are ignored; the diagram uses the default look.');
|
|
233
|
+
if (!/<\/style>\s*$/i.test(line))
|
|
234
|
+
multi = { end: /^<\/style>$/i, lines: [] };
|
|
235
|
+
}
|
|
236
|
+
else if ((m = line.match(/^autoactivate\s+(on|off)$/i))) {
|
|
237
|
+
autoActivate = m[1].toLowerCase() === 'on';
|
|
238
|
+
}
|
|
239
|
+
else if (/^(hide|show|scale|mainframe|header|footer|caption|newpage|ignore\s+newpage|left to right|top to bottom)\b/i.test(line)) {
|
|
186
240
|
warnOnce('display', 'Page and display commands (`hide`, `header`, `footer`, `newpage`, ...) are ignored.');
|
|
187
241
|
}
|
|
188
242
|
else if (/^legend\b/i.test(line)) {
|
|
@@ -206,6 +260,10 @@ export function parsePlantUmlSequence(source) {
|
|
|
206
260
|
auto = { next: nums[0] ?? 1, step: nums[1] ?? 1 };
|
|
207
261
|
}
|
|
208
262
|
}
|
|
263
|
+
else if ((m = line.match(MULTILINE_PARTICIPANT))) {
|
|
264
|
+
const id = declareFrom(m[1], m[2]);
|
|
265
|
+
multi = { end: /^\]$/, lines: [], emit: (b) => id !== undefined && declare(id, text(multilineName(b))) };
|
|
266
|
+
}
|
|
209
267
|
else if ((m = line.match(PARTICIPANT_KINDS))) {
|
|
210
268
|
declareFrom(m[1], m[2]);
|
|
211
269
|
}
|
|
@@ -308,8 +366,9 @@ export function parsePlantUmlSequence(source) {
|
|
|
308
366
|
const leftHead = m[2] ?? '';
|
|
309
367
|
const shaft = m[3];
|
|
310
368
|
const rightHead = m[4] ?? '';
|
|
311
|
-
if (/\[/.test(shaft))
|
|
312
|
-
warnOnce('arrowcolor', 'Arrow colours and styles (`-[#red]
|
|
369
|
+
if (/\[/.test(shaft) || m.groups?.color1 !== undefined || m.groups?.color2 !== undefined) {
|
|
370
|
+
warnOnce('arrowcolor', 'Arrow colours and styles (`-[#red]>`, `#red`) are ignored.');
|
|
371
|
+
}
|
|
313
372
|
// The receiving end is the side with a head; with heads on both sides (`<->`) the message goes left
|
|
314
373
|
// to right and is drawn two-way.
|
|
315
374
|
const reversed = leftHead !== '' && rightHead === '';
|
|
@@ -319,7 +378,11 @@ export function parsePlantUmlSequence(source) {
|
|
|
319
378
|
warnOnce('circle', 'Circle arrow ends (`->o`, `o->`) are drawn as plain arrows.');
|
|
320
379
|
const head = /x/.test(receivingHead) ? 'cross' : /<<|>>|[\\/]/.test(receivingHead) ? 'open' : 'arrow';
|
|
321
380
|
const a = unquote(fromRaw);
|
|
322
|
-
|
|
381
|
+
// `A -> "Long name" as L` declares the receiver inline, like `participant "Long name" as L`.
|
|
382
|
+
const [b, bLabel] = idAndLabel(toRaw, m.groups?.alias);
|
|
383
|
+
// Left-hand name first, so the columns keep source order.
|
|
384
|
+
if (bLabel !== undefined && (!declare(a) || !declare(b, text(bLabel))))
|
|
385
|
+
continue;
|
|
323
386
|
const from = reversed ? b : a;
|
|
324
387
|
const to = reversed ? a : b;
|
|
325
388
|
const mods = m.groups?.mods ?? '';
|
|
@@ -328,8 +391,11 @@ export function parsePlantUmlSequence(source) {
|
|
|
328
391
|
if (declare(to))
|
|
329
392
|
push({ type: 'create', actor: to });
|
|
330
393
|
}
|
|
331
|
-
const
|
|
332
|
-
const
|
|
394
|
+
const top = calls[calls.length - 1];
|
|
395
|
+
const autoReply = autoActivate && mods === '' && dashed && top?.callee === from && top.caller === to;
|
|
396
|
+
// `**` (create) still activates under autoactivate; `!!` (destroy) does not.
|
|
397
|
+
const activate = mods.includes('++') || (autoActivate && !/\+\+|--|!!/.test(mods) && !dashed && from !== to);
|
|
398
|
+
const deactivate = mods.includes('--') || autoReply;
|
|
333
399
|
message(from, to, m.groups?.text ?? '', dashed, head, both, activate, deactivate);
|
|
334
400
|
if (activate)
|
|
335
401
|
calls.push({ caller: from, callee: to });
|