@wzh-/ai-chat-example 1.0.13 → 1.0.15
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/css/index.css +1 -1
- package/dist/js/_baseFor.js +309 -0
- package/dist/js/architecture-U656AL7Q.js +3 -4
- package/dist/js/architectureDiagram-VXUJARFQ.js +53 -54
- package/dist/js/blockDiagram-VD42YOAC.js +449 -449
- package/dist/js/c4Diagram-YG6GDRKO.js +87 -87
- package/dist/js/chunk-B4BG7PRW.js +160 -160
- package/dist/js/chunk-DI55MBZ5.js +98 -98
- package/dist/js/chunk-FPAJGGOC.js +1373 -197
- package/dist/js/chunk-JA3XYJ7Z.js +36 -36
- package/dist/js/chunk-JZLCHNYA.js +1461 -1461
- package/dist/js/chunk-N4CR4FBY.js +5 -5
- package/dist/js/chunk-QXUST7PY.js +226 -226
- package/dist/js/chunk-S3R3BYOJ.js +602 -454
- package/dist/js/classDiagram-2ON5EDUG.js +2 -2
- package/dist/js/classDiagram-v2-WZHVMYZB.js +2 -2
- package/dist/js/clone.js +1 -1
- package/dist/js/dagre-6UL2VRFP.js +152 -152
- package/dist/js/dagre.js +1034 -933
- package/dist/js/diagram-PSM6KHXK.js +58 -59
- package/dist/js/diagram-QEK2KX5R.js +53 -54
- package/dist/js/diagram-S2PKOQOG.js +24 -25
- package/dist/js/erDiagram-Q2GNP2WA.js +96 -96
- package/dist/js/flatten.js +34 -0
- package/dist/js/flowDiagram-NV44I4VS.js +166 -166
- package/dist/js/ganttDiagram-JELNMOA3.js +916 -916
- package/dist/js/gitGraph-F6HP7TQM.js +3 -4
- package/dist/js/gitGraphDiagram-NY62KEGX.js +373 -374
- package/dist/js/graphlib.js +264 -143
- package/dist/js/index.js +3280 -3266
- package/dist/js/info-NVLQJR56.js +3 -4
- package/dist/js/infoDiagram-WHAUD3N6.js +3 -4
- package/dist/js/isEmpty.js +18 -18
- package/dist/js/kanban-definition-3W4ZIXB7.js +2 -2
- package/dist/js/line.js +7 -7
- package/dist/js/mermaid.core.js +65 -65
- package/dist/js/mindmap-definition-VGOIOE7T.js +2 -2
- package/dist/js/packet-BFZMPI3H.js +3 -4
- package/dist/js/pie-7BOR55EZ.js +3 -4
- package/dist/js/pieDiagram-ADFJNKIX.js +39 -40
- package/dist/js/radar-NHE76QYJ.js +3 -4
- package/dist/js/reduce.js +451 -0
- package/dist/js/requirementDiagram-UZGBJVZJ.js +16 -16
- package/dist/js/sequenceDiagram-WL72ISMW.js +731 -731
- package/dist/js/stateDiagram-FKZM4ZOC.js +83 -83
- package/dist/js/stateDiagram-v2-4FDKWEC3.js +2 -2
- package/dist/js/treemap-KMMF4GRG.js +3 -4
- package/dist/js/xychartDiagram-PRI3JC2R.js +25 -25
- package/package.json +14 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./marked.esm.js";
|
|
2
|
-
import "./
|
|
3
|
-
import { c as getEdgeId, g as utils_default } from "./chunk-S3R3BYOJ.js";
|
|
2
|
+
import "./_baseFor.js";
|
|
4
3
|
import { g as log, h as __name, p as select_default } from "./src.js";
|
|
5
4
|
import { B as setAccTitle, C as getDiagramTitle, H as setConfig2, U as setDiagramTitle, _ as getAccDescription, a as clear, b as getConfig2, et as rgba_default, s as common_default, u as defaultConfig2, v as getAccTitle, z as setAccDescription } from "./chunk-ABZYJK2D.js";
|
|
6
5
|
import { t as channel_default } from "./channel.js";
|
|
7
6
|
import "./path.js";
|
|
8
7
|
import "./math.js";
|
|
9
8
|
import "./array.js";
|
|
9
|
+
import { c as getEdgeId, g as utils_default } from "./chunk-S3R3BYOJ.js";
|
|
10
10
|
import "./line.js";
|
|
11
11
|
import "./dist.js";
|
|
12
12
|
import "./chunk-JA3XYJ7Z.js";
|
|
@@ -39,36 +39,36 @@ var MERMAID_DOM_ID_PREFIX = "flowchart-", FlowDB = class {
|
|
|
39
39
|
let e;
|
|
40
40
|
e = s.includes("\n") ? s + "\n" : "{\n" + s + "\n}", c = load(e, { schema: JSON_SCHEMA });
|
|
41
41
|
}
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
42
|
+
let u = this.edges.find((t) => t.id === e);
|
|
43
|
+
if (u) {
|
|
44
44
|
let e = c;
|
|
45
|
-
e?.animate !== void 0 && (
|
|
45
|
+
e?.animate !== void 0 && (u.animate = e.animate), e?.animation !== void 0 && (u.animation = e.animation), e?.curve !== void 0 && (u.interpolate = e.curve);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
let
|
|
49
|
-
if (
|
|
48
|
+
let d, f = this.vertices.get(e);
|
|
49
|
+
if (f === void 0 && (f = {
|
|
50
50
|
id: e,
|
|
51
51
|
labelType: "text",
|
|
52
52
|
domId: MERMAID_DOM_ID_PREFIX + e + "-" + this.vertexCounter,
|
|
53
53
|
styles: [],
|
|
54
54
|
classes: []
|
|
55
|
-
}, this.vertices.set(e,
|
|
56
|
-
|
|
55
|
+
}, this.vertices.set(e, f)), this.vertexCounter++, t === void 0 ? f.text === void 0 && (f.text = e) : (this.config = getConfig2(), d = this.sanitizeText(t.text.trim()), f.labelType = t.type, d.startsWith("\"") && d.endsWith("\"") && (d = d.substring(1, d.length - 1)), f.text = d), n !== void 0 && (f.type = n), r?.forEach((e) => {
|
|
56
|
+
f.styles.push(e);
|
|
57
57
|
}), i?.forEach((e) => {
|
|
58
|
-
|
|
59
|
-
}), a !== void 0 && (
|
|
58
|
+
f.classes.push(e);
|
|
59
|
+
}), a !== void 0 && (f.dir = a), f.props === void 0 ? f.props = o : o !== void 0 && Object.assign(f.props, o), c !== void 0) {
|
|
60
60
|
if (c.shape) {
|
|
61
61
|
if (c.shape !== c.shape.toLowerCase() || c.shape.includes("_")) throw Error(`No such shape: ${c.shape}. Shape names should be lowercase.`);
|
|
62
62
|
if (!isValidShape(c.shape)) throw Error(`No such shape: ${c.shape}.`);
|
|
63
|
-
|
|
63
|
+
f.type = c?.shape;
|
|
64
64
|
}
|
|
65
|
-
c?.label && (
|
|
65
|
+
c?.label && (f.text = c?.label), c?.icon && (f.icon = c?.icon, !c.label?.trim() && f.text === e && (f.text = "")), c?.form && (f.form = c?.form), c?.pos && (f.pos = c?.pos), c?.img && (f.img = c?.img, !c.label?.trim() && f.text === e && (f.text = "")), c?.constraint && (f.constraint = c.constraint), c.w && (f.assetWidth = Number(c.w)), c.h && (f.assetHeight = Number(c.h));
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
addSingleLink(t, r, i
|
|
69
|
-
let
|
|
68
|
+
addSingleLink(t, n, r, i) {
|
|
69
|
+
let a = {
|
|
70
70
|
start: t,
|
|
71
|
-
end:
|
|
71
|
+
end: n,
|
|
72
72
|
type: void 0,
|
|
73
73
|
text: "",
|
|
74
74
|
labelType: "text",
|
|
@@ -76,20 +76,20 @@ var MERMAID_DOM_ID_PREFIX = "flowchart-", FlowDB = class {
|
|
|
76
76
|
isUserDefinedId: !1,
|
|
77
77
|
interpolate: this.edges.defaultInterpolate
|
|
78
78
|
};
|
|
79
|
-
log.info("abc78 Got edge...",
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
79
|
+
log.info("abc78 Got edge...", a);
|
|
80
|
+
let o = r.text;
|
|
81
|
+
if (o !== void 0 && (a.text = this.sanitizeText(o.text.trim()), a.text.startsWith("\"") && a.text.endsWith("\"") && (a.text = a.text.substring(1, a.text.length - 1)), a.labelType = o.type), r !== void 0 && (a.type = r.type, a.stroke = r.stroke, a.length = r.length > 10 ? 10 : r.length), i && !this.edges.some((e) => e.id === i)) a.id = i, a.isUserDefinedId = !0;
|
|
82
82
|
else {
|
|
83
|
-
let
|
|
84
|
-
|
|
83
|
+
let e = this.edges.filter((e) => e.start === a.start && e.end === a.end);
|
|
84
|
+
e.length === 0 ? a.id = getEdgeId(a.start, a.end, {
|
|
85
85
|
counter: 0,
|
|
86
86
|
prefix: "L"
|
|
87
|
-
}) :
|
|
88
|
-
counter:
|
|
87
|
+
}) : a.id = getEdgeId(a.start, a.end, {
|
|
88
|
+
counter: e.length + 1,
|
|
89
89
|
prefix: "L"
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
if (this.edges.length < (this.config.maxEdges ?? 500)) log.info("Pushing edge..."), this.edges.push(
|
|
92
|
+
if (this.edges.length < (this.config.maxEdges ?? 500)) log.info("Pushing edge..."), this.edges.push(a);
|
|
93
93
|
else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
|
|
94
94
|
|
|
95
95
|
Initialize mermaid with maxEdges set to a higher number to allow more edges.
|
|
@@ -99,12 +99,12 @@ You have to call mermaid.initialize.`);
|
|
|
99
99
|
isLinkData(e) {
|
|
100
100
|
return typeof e == "object" && !!e && "id" in e && typeof e.id == "string";
|
|
101
101
|
}
|
|
102
|
-
addLink(
|
|
102
|
+
addLink(t, n, r) {
|
|
103
103
|
let i = this.isLinkData(r) ? r.id.replace("@", "") : void 0;
|
|
104
|
-
log.info("addLink",
|
|
105
|
-
for (let
|
|
106
|
-
let o =
|
|
107
|
-
o && s ? this.addSingleLink(
|
|
104
|
+
log.info("addLink", t, n, i);
|
|
105
|
+
for (let e of t) for (let a of n) {
|
|
106
|
+
let o = e === t[t.length - 1], s = a === n[0];
|
|
107
|
+
o && s ? this.addSingleLink(e, a, r, i) : this.addSingleLink(e, a, r, void 0);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
updateLinkInterpolate(e, t) {
|
|
@@ -154,30 +154,30 @@ You have to call mermaid.initialize.`);
|
|
|
154
154
|
for (let n of e.split(",")) this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(n) : n, t);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
setClickFun(e,
|
|
158
|
-
let
|
|
159
|
-
if (getConfig2().securityLevel !== "loose" ||
|
|
160
|
-
let
|
|
161
|
-
if (typeof
|
|
162
|
-
|
|
163
|
-
for (let e = 0; e <
|
|
164
|
-
let t =
|
|
165
|
-
t.startsWith("\"") && t.endsWith("\"") && (t = t.substr(1, t.length - 2)),
|
|
157
|
+
setClickFun(e, t, n) {
|
|
158
|
+
let r = this.lookUpDomId(e);
|
|
159
|
+
if (getConfig2().securityLevel !== "loose" || t === void 0) return;
|
|
160
|
+
let i = [];
|
|
161
|
+
if (typeof n == "string") {
|
|
162
|
+
i = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
|
|
163
|
+
for (let e = 0; e < i.length; e++) {
|
|
164
|
+
let t = i[e].trim();
|
|
165
|
+
t.startsWith("\"") && t.endsWith("\"") && (t = t.substr(1, t.length - 2)), i[e] = t;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
|
|
169
|
-
let
|
|
170
|
-
|
|
171
|
-
let e = document.querySelector(`[id="${
|
|
168
|
+
i.length === 0 && i.push(e);
|
|
169
|
+
let a = this.vertices.get(e);
|
|
170
|
+
a && (a.haveCallback = !0, this.funs.push(() => {
|
|
171
|
+
let e = document.querySelector(`[id="${r}"]`);
|
|
172
172
|
e !== null && e.addEventListener("click", () => {
|
|
173
|
-
utils_default.runFunc(
|
|
173
|
+
utils_default.runFunc(t, ...i);
|
|
174
174
|
}, !1);
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
|
-
setLink(e,
|
|
177
|
+
setLink(e, t, n) {
|
|
178
178
|
e.split(",").forEach((e) => {
|
|
179
|
-
let
|
|
180
|
-
|
|
179
|
+
let r = this.vertices.get(e);
|
|
180
|
+
r !== void 0 && (r.link = utils_default.formatUrl(t, this.config), r.linkTarget = n);
|
|
181
181
|
}), this.setClass(e, "clickable");
|
|
182
182
|
}
|
|
183
183
|
getTooltip(e) {
|
|
@@ -208,10 +208,10 @@ You have to call mermaid.initialize.`);
|
|
|
208
208
|
setupToolTips(e) {
|
|
209
209
|
let t = select_default(".mermaidTooltip");
|
|
210
210
|
(t._groups || t)[0][0] === null && (t = select_default("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0)), select_default(e).select("svg").selectAll("g.node").on("mouseover", (e) => {
|
|
211
|
-
let
|
|
212
|
-
if (
|
|
213
|
-
let
|
|
214
|
-
t.transition().duration(200).style("opacity", ".9"), t.text(
|
|
211
|
+
let r = select_default(e.currentTarget);
|
|
212
|
+
if (r.attr("title") === null) return;
|
|
213
|
+
let i = e.currentTarget?.getBoundingClientRect();
|
|
214
|
+
t.transition().duration(200).style("opacity", ".9"), t.text(r.attr("title")).style("left", window.scrollX + i.left + (i.right - i.left) / 2 + "px").style("top", window.scrollY + i.bottom + "px"), t.html(t.html().replace(/<br\/>/g, "<br/>")), r.classed("hover", !0);
|
|
215
215
|
}).on("mouseout", (e) => {
|
|
216
216
|
t.transition().duration(500).style("opacity", 0), select_default(e.currentTarget).classed("hover", !1);
|
|
217
217
|
});
|
|
@@ -225,9 +225,9 @@ You have to call mermaid.initialize.`);
|
|
|
225
225
|
defaultStyle() {
|
|
226
226
|
return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
|
|
227
227
|
}
|
|
228
|
-
addSubGraph(
|
|
229
|
-
let a =
|
|
230
|
-
|
|
228
|
+
addSubGraph(n, r, i) {
|
|
229
|
+
let a = n.text.trim(), o = i.text;
|
|
230
|
+
n === i && /\s/.exec(i.text) && (a = void 0);
|
|
231
231
|
let s = (/* @__PURE__ */ __name((e) => {
|
|
232
232
|
let t = {
|
|
233
233
|
boolean: {},
|
|
@@ -241,18 +241,18 @@ You have to call mermaid.initialize.`);
|
|
|
241
241
|
}),
|
|
242
242
|
dir: r
|
|
243
243
|
};
|
|
244
|
-
}, "uniq"))(
|
|
245
|
-
if (
|
|
244
|
+
}, "uniq"))(r.flat()), c = s.nodeList, u = s.dir, d = getConfig2().flowchart ?? {};
|
|
245
|
+
if (u ??= d.inheritDir ? this.getDirection() ?? getConfig2().direction ?? void 0 : void 0, this.version === "gen-1") for (let e = 0; e < c.length; e++) c[e] = this.lookUpDomId(c[e]);
|
|
246
246
|
a ??= "subGraph" + this.subCount, o ||= "", o = this.sanitizeText(o), this.subCount += 1;
|
|
247
|
-
let
|
|
247
|
+
let f = {
|
|
248
248
|
id: a,
|
|
249
249
|
nodes: c,
|
|
250
250
|
title: o.trim(),
|
|
251
251
|
classes: [],
|
|
252
|
-
dir:
|
|
252
|
+
dir: u,
|
|
253
253
|
labelType: i.type
|
|
254
254
|
};
|
|
255
|
-
return log.info("Adding",
|
|
255
|
+
return log.info("Adding", f.id, f.nodes, f.dir), f.nodes = this.makeUniq(f, this.subGraphs).nodes, this.subGraphs.push(f), this.subGraphLookup.set(a, f), a;
|
|
256
256
|
}
|
|
257
257
|
getPosForId(e) {
|
|
258
258
|
for (let [t, n] of this.subGraphs.entries()) if (n.id === e) return t;
|
|
@@ -456,67 +456,67 @@ You have to call mermaid.initialize.`);
|
|
|
456
456
|
return t;
|
|
457
457
|
}
|
|
458
458
|
getData() {
|
|
459
|
-
let
|
|
460
|
-
for (let e =
|
|
461
|
-
let t =
|
|
462
|
-
t.nodes.length > 0 &&
|
|
463
|
-
for (let e of t.nodes)
|
|
459
|
+
let e = getConfig2(), t = [], n = [], r = this.getSubGraphs(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
460
|
+
for (let e = r.length - 1; e >= 0; e--) {
|
|
461
|
+
let t = r[e];
|
|
462
|
+
t.nodes.length > 0 && a.set(t.id, !0);
|
|
463
|
+
for (let e of t.nodes) i.set(e, t.id);
|
|
464
464
|
}
|
|
465
|
-
for (let
|
|
466
|
-
let
|
|
467
|
-
|
|
468
|
-
id:
|
|
469
|
-
label:
|
|
465
|
+
for (let n = r.length - 1; n >= 0; n--) {
|
|
466
|
+
let a = r[n];
|
|
467
|
+
t.push({
|
|
468
|
+
id: a.id,
|
|
469
|
+
label: a.title,
|
|
470
470
|
labelStyle: "",
|
|
471
|
-
parentId:
|
|
471
|
+
parentId: i.get(a.id),
|
|
472
472
|
padding: 8,
|
|
473
|
-
cssCompiledStyles: this.getCompiledStyles(
|
|
474
|
-
cssClasses:
|
|
473
|
+
cssCompiledStyles: this.getCompiledStyles(a.classes),
|
|
474
|
+
cssClasses: a.classes.join(" "),
|
|
475
475
|
shape: "rect",
|
|
476
|
-
dir:
|
|
476
|
+
dir: a.dir,
|
|
477
477
|
isGroup: !0,
|
|
478
|
-
look:
|
|
478
|
+
look: e.look
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
this.getVertices().forEach((
|
|
482
|
-
this.addNodeFromVertex(
|
|
481
|
+
this.getVertices().forEach((n) => {
|
|
482
|
+
this.addNodeFromVertex(n, t, i, a, e, e.look || "classic");
|
|
483
483
|
});
|
|
484
|
-
let
|
|
485
|
-
return
|
|
486
|
-
let { arrowTypeStart:
|
|
487
|
-
|
|
488
|
-
let
|
|
489
|
-
id: getEdgeId(
|
|
490
|
-
counter:
|
|
484
|
+
let o = this.getEdges();
|
|
485
|
+
return o.forEach((t, r) => {
|
|
486
|
+
let { arrowTypeStart: i, arrowTypeEnd: a } = this.destructEdgeType(t.type), s = [...o.defaultStyle ?? []];
|
|
487
|
+
t.style && s.push(...t.style);
|
|
488
|
+
let c = {
|
|
489
|
+
id: getEdgeId(t.start, t.end, {
|
|
490
|
+
counter: r,
|
|
491
491
|
prefix: "L"
|
|
492
|
-
},
|
|
493
|
-
isUserDefinedId:
|
|
494
|
-
start:
|
|
495
|
-
end:
|
|
496
|
-
type:
|
|
497
|
-
label:
|
|
492
|
+
}, t.id),
|
|
493
|
+
isUserDefinedId: t.isUserDefinedId,
|
|
494
|
+
start: t.start,
|
|
495
|
+
end: t.end,
|
|
496
|
+
type: t.type ?? "normal",
|
|
497
|
+
label: t.text,
|
|
498
498
|
labelpos: "c",
|
|
499
|
-
thickness:
|
|
500
|
-
minlen:
|
|
501
|
-
classes:
|
|
502
|
-
arrowTypeStart:
|
|
503
|
-
arrowTypeEnd:
|
|
499
|
+
thickness: t.stroke,
|
|
500
|
+
minlen: t.length,
|
|
501
|
+
classes: t?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
|
|
502
|
+
arrowTypeStart: t?.stroke === "invisible" || t?.type === "arrow_open" ? "none" : i,
|
|
503
|
+
arrowTypeEnd: t?.stroke === "invisible" || t?.type === "arrow_open" ? "none" : a,
|
|
504
504
|
arrowheadStyle: "fill: #333",
|
|
505
|
-
cssCompiledStyles: this.getCompiledStyles(
|
|
506
|
-
labelStyle:
|
|
507
|
-
style:
|
|
508
|
-
pattern:
|
|
509
|
-
look:
|
|
510
|
-
animate:
|
|
511
|
-
animation:
|
|
512
|
-
curve:
|
|
505
|
+
cssCompiledStyles: this.getCompiledStyles(t.classes),
|
|
506
|
+
labelStyle: s,
|
|
507
|
+
style: s,
|
|
508
|
+
pattern: t.stroke,
|
|
509
|
+
look: e.look,
|
|
510
|
+
animate: t.animate,
|
|
511
|
+
animation: t.animation,
|
|
512
|
+
curve: t.interpolate || this.edges.defaultInterpolate || e.flowchart?.curve
|
|
513
513
|
};
|
|
514
|
-
|
|
514
|
+
n.push(c);
|
|
515
515
|
}), {
|
|
516
|
-
nodes:
|
|
517
|
-
edges:
|
|
516
|
+
nodes: t,
|
|
517
|
+
edges: n,
|
|
518
518
|
other: {},
|
|
519
|
-
config:
|
|
519
|
+
config: e
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
522
|
defaultConfig() {
|
|
@@ -526,32 +526,32 @@ You have to call mermaid.initialize.`);
|
|
|
526
526
|
getClasses: /* @__PURE__ */ __name(function(e, t) {
|
|
527
527
|
return t.db.getClasses();
|
|
528
528
|
}, "getClasses"),
|
|
529
|
-
draw: /* @__PURE__ */ __name(async function(
|
|
529
|
+
draw: /* @__PURE__ */ __name(async function(t, r, i, a) {
|
|
530
530
|
log.info("REF0:"), log.info("Drawing state diagram (v2)", r);
|
|
531
|
-
let { securityLevel:
|
|
532
|
-
|
|
533
|
-
let d =
|
|
531
|
+
let { securityLevel: o, flowchart: s, layout: c } = getConfig2(), u;
|
|
532
|
+
o === "sandbox" && (u = select_default("#i" + r));
|
|
533
|
+
let d = o === "sandbox" ? u.nodes()[0].contentDocument : document;
|
|
534
534
|
log.debug("Before getData: ");
|
|
535
|
-
let f =
|
|
535
|
+
let f = a.db.getData();
|
|
536
536
|
log.debug("Data: ", f);
|
|
537
|
-
let p = getDiagramElement(r,
|
|
538
|
-
f.type =
|
|
537
|
+
let p = getDiagramElement(r, o), ee = a.db.getDirection();
|
|
538
|
+
f.type = a.type, f.layoutAlgorithm = getRegisteredLayoutAlgorithm(c), f.layoutAlgorithm === "dagre" && c === "elk" && log.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."), f.direction = ee, f.nodeSpacing = s?.nodeSpacing || 50, f.rankSpacing = s?.rankSpacing || 50, f.markers = [
|
|
539
539
|
"point",
|
|
540
540
|
"circle",
|
|
541
541
|
"cross"
|
|
542
542
|
], f.diagramId = r, log.debug("REF1:", f), await render(f, p);
|
|
543
|
-
let
|
|
544
|
-
utils_default.insertTitle(p, "flowchartTitleText",
|
|
543
|
+
let m = f.config.flowchart?.diagramPadding ?? 8;
|
|
544
|
+
utils_default.insertTitle(p, "flowchartTitleText", s?.titleTopMargin || 0, a.db.getDiagramTitle()), setupViewPortForSVG(p, m, "flowchart", s?.useMaxWidth || !1);
|
|
545
545
|
for (let e of f.nodes) {
|
|
546
546
|
let t = select_default(`#${r} [id="${e.id}"]`);
|
|
547
547
|
if (!t || !e.link) continue;
|
|
548
|
-
let
|
|
549
|
-
|
|
548
|
+
let i = d.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
549
|
+
i.setAttributeNS("http://www.w3.org/2000/svg", "class", e.cssClasses), i.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), o === "sandbox" ? i.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : e.linkTarget && i.setAttributeNS("http://www.w3.org/2000/svg", "target", e.linkTarget);
|
|
550
550
|
let a = t.insert(function() {
|
|
551
|
-
return
|
|
552
|
-
}, ":first-child"),
|
|
553
|
-
|
|
554
|
-
return
|
|
551
|
+
return i;
|
|
552
|
+
}, ":first-child"), s = t.select(".label-container");
|
|
553
|
+
s && a.append(function() {
|
|
554
|
+
return s.node();
|
|
555
555
|
});
|
|
556
556
|
let c = t.select(".label");
|
|
557
557
|
c && a.append(function() {
|
|
@@ -563,7 +563,7 @@ You have to call mermaid.initialize.`);
|
|
|
563
563
|
var e = /* @__PURE__ */ __name(function(e, t, n, r) {
|
|
564
564
|
for (n ||= {}, r = e.length; r--; n[e[r]] = t);
|
|
565
565
|
return n;
|
|
566
|
-
}, "o"),
|
|
566
|
+
}, "o"), n = [1, 4], r = [1, 3], i = [1, 5], a = [
|
|
567
567
|
1,
|
|
568
568
|
8,
|
|
569
569
|
9,
|
|
@@ -593,7 +593,7 @@ You have to call mermaid.initialize.`);
|
|
|
593
593
|
122,
|
|
594
594
|
123,
|
|
595
595
|
124
|
|
596
|
-
], o = [2, 2], s = [1, 13], c = [1, 14], l = [1, 15], u = [1, 16],
|
|
596
|
+
], o = [2, 2], s = [1, 13], c = [1, 14], l = [1, 15], u = [1, 16], d = [1, 23], f = [1, 25], p = [1, 26], ee = [1, 27], m = [1, 49], h = [1, 48], g = [1, 29], te = [1, 30], ne = [1, 31], re = [1, 32], ie = [1, 33], _ = [1, 44], v = [1, 46], y = [1, 42], b = [1, 47], x = [1, 43], S = [1, 50], C = [1, 45], w = [1, 51], T = [1, 52], E = [1, 34], ae = [1, 35], oe = [1, 36], se = [1, 37], D = [1, 57], O = [
|
|
597
597
|
1,
|
|
598
598
|
8,
|
|
599
599
|
9,
|
|
@@ -1632,22 +1632,22 @@ You have to call mermaid.initialize.`);
|
|
|
1632
1632
|
{
|
|
1633
1633
|
3: 1,
|
|
1634
1634
|
4: 2,
|
|
1635
|
-
9:
|
|
1636
|
-
10:
|
|
1635
|
+
9: n,
|
|
1636
|
+
10: r,
|
|
1637
1637
|
12: i
|
|
1638
1638
|
},
|
|
1639
1639
|
{ 1: [3] },
|
|
1640
1640
|
e(a, o, { 5: 6 }),
|
|
1641
1641
|
{
|
|
1642
1642
|
4: 7,
|
|
1643
|
-
9:
|
|
1644
|
-
10:
|
|
1643
|
+
9: n,
|
|
1644
|
+
10: r,
|
|
1645
1645
|
12: i
|
|
1646
1646
|
},
|
|
1647
1647
|
{
|
|
1648
1648
|
4: 8,
|
|
1649
|
-
9:
|
|
1650
|
-
10:
|
|
1649
|
+
9: n,
|
|
1650
|
+
10: r,
|
|
1651
1651
|
12: i
|
|
1652
1652
|
},
|
|
1653
1653
|
{
|
|
@@ -1668,19 +1668,19 @@ You have to call mermaid.initialize.`);
|
|
|
1668
1668
|
24: 20,
|
|
1669
1669
|
25: 21,
|
|
1670
1670
|
26: 22,
|
|
1671
|
-
27:
|
|
1671
|
+
27: d,
|
|
1672
1672
|
33: 24,
|
|
1673
|
-
34:
|
|
1674
|
-
36:
|
|
1675
|
-
38:
|
|
1673
|
+
34: f,
|
|
1674
|
+
36: p,
|
|
1675
|
+
38: ee,
|
|
1676
1676
|
42: 28,
|
|
1677
1677
|
43: 38,
|
|
1678
1678
|
44: m,
|
|
1679
1679
|
45: 39,
|
|
1680
1680
|
47: 40,
|
|
1681
1681
|
60: h,
|
|
1682
|
-
84:
|
|
1683
|
-
85:
|
|
1682
|
+
84: g,
|
|
1683
|
+
85: te,
|
|
1684
1684
|
86: ne,
|
|
1685
1685
|
87: re,
|
|
1686
1686
|
88: ie,
|
|
@@ -2250,20 +2250,20 @@ You have to call mermaid.initialize.`);
|
|
|
2250
2250
|
24: 20,
|
|
2251
2251
|
25: 21,
|
|
2252
2252
|
26: 22,
|
|
2253
|
-
27:
|
|
2253
|
+
27: d,
|
|
2254
2254
|
32: [1, 202],
|
|
2255
2255
|
33: 24,
|
|
2256
|
-
34:
|
|
2257
|
-
36:
|
|
2258
|
-
38:
|
|
2256
|
+
34: f,
|
|
2257
|
+
36: p,
|
|
2258
|
+
38: ee,
|
|
2259
2259
|
42: 28,
|
|
2260
2260
|
43: 38,
|
|
2261
2261
|
44: m,
|
|
2262
2262
|
45: 39,
|
|
2263
2263
|
47: 40,
|
|
2264
2264
|
60: h,
|
|
2265
|
-
84:
|
|
2266
|
-
85:
|
|
2265
|
+
84: g,
|
|
2266
|
+
85: te,
|
|
2267
2267
|
86: ne,
|
|
2268
2268
|
87: re,
|
|
2269
2269
|
88: ie,
|
|
@@ -2684,20 +2684,20 @@ You have to call mermaid.initialize.`);
|
|
|
2684
2684
|
24: 20,
|
|
2685
2685
|
25: 21,
|
|
2686
2686
|
26: 22,
|
|
2687
|
-
27:
|
|
2687
|
+
27: d,
|
|
2688
2688
|
32: [1, 266],
|
|
2689
2689
|
33: 24,
|
|
2690
|
-
34:
|
|
2691
|
-
36:
|
|
2692
|
-
38:
|
|
2690
|
+
34: f,
|
|
2691
|
+
36: p,
|
|
2692
|
+
38: ee,
|
|
2693
2693
|
42: 28,
|
|
2694
2694
|
43: 38,
|
|
2695
2695
|
44: m,
|
|
2696
2696
|
45: 39,
|
|
2697
2697
|
47: 40,
|
|
2698
2698
|
60: h,
|
|
2699
|
-
84:
|
|
2700
|
-
85:
|
|
2699
|
+
84: g,
|
|
2700
|
+
85: te,
|
|
2701
2701
|
86: ne,
|
|
2702
2702
|
87: re,
|
|
2703
2703
|
88: ie,
|
|
@@ -2911,20 +2911,20 @@ You have to call mermaid.initialize.`);
|
|
|
2911
2911
|
24: 20,
|
|
2912
2912
|
25: 21,
|
|
2913
2913
|
26: 22,
|
|
2914
|
-
27:
|
|
2914
|
+
27: d,
|
|
2915
2915
|
32: [1, 287],
|
|
2916
2916
|
33: 24,
|
|
2917
|
-
34:
|
|
2918
|
-
36:
|
|
2919
|
-
38:
|
|
2917
|
+
34: f,
|
|
2918
|
+
36: p,
|
|
2919
|
+
38: ee,
|
|
2920
2920
|
42: 28,
|
|
2921
2921
|
43: 38,
|
|
2922
2922
|
44: m,
|
|
2923
2923
|
45: 39,
|
|
2924
2924
|
47: 40,
|
|
2925
2925
|
60: h,
|
|
2926
|
-
84:
|
|
2927
|
-
85:
|
|
2926
|
+
84: g,
|
|
2927
|
+
85: te,
|
|
2928
2928
|
86: ne,
|
|
2929
2929
|
87: re,
|
|
2930
2930
|
88: ie,
|
|
@@ -2983,38 +2983,38 @@ You have to call mermaid.initialize.`);
|
|
|
2983
2983
|
}
|
|
2984
2984
|
}, "parseError"),
|
|
2985
2985
|
parse: /* @__PURE__ */ __name(function(e) {
|
|
2986
|
-
var
|
|
2987
|
-
for (var
|
|
2986
|
+
var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, ee = o.slice.call(arguments, 1), m = Object.create(this.lexer), h = { yy: {} };
|
|
2987
|
+
for (var g in this.yy) Object.prototype.hasOwnProperty.call(this.yy, g) && (h.yy[g] = this.yy[g]);
|
|
2988
2988
|
m.setInput(e, h.yy), h.yy.lexer = m, h.yy.parser = this, m.yylloc === void 0 && (m.yylloc = {});
|
|
2989
|
-
var
|
|
2990
|
-
o.push(
|
|
2989
|
+
var te = m.yylloc;
|
|
2990
|
+
o.push(te);
|
|
2991
2991
|
var ne = m.options && m.options.ranges;
|
|
2992
2992
|
typeof h.yy.parseError == "function" ? this.parseError = h.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
2993
2993
|
function re(e) {
|
|
2994
|
-
|
|
2994
|
+
r.length -= 2 * e, a.length -= e, o.length -= e;
|
|
2995
2995
|
}
|
|
2996
2996
|
__name(re, "popStack");
|
|
2997
2997
|
function ie() {
|
|
2998
|
-
var e = i.pop() || m.lex() ||
|
|
2999
|
-
return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e =
|
|
2998
|
+
var e = i.pop() || m.lex() || p;
|
|
2999
|
+
return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
|
|
3000
3000
|
}
|
|
3001
3001
|
__name(ie, "lex");
|
|
3002
3002
|
for (var _, v, y, b, x, S = {}, C, w, T, E;;) {
|
|
3003
|
-
if (y =
|
|
3003
|
+
if (y = r[r.length - 1], this.defaultActions[y] ? b = this.defaultActions[y] : (_ ??= ie(), b = s[y] && s[y][_]), b === void 0 || !b.length || !b[0]) {
|
|
3004
3004
|
var ae = "";
|
|
3005
|
-
for (C in E = [], s[y]) this.terminals_[C] && C >
|
|
3006
|
-
ae = m.showPosition ? "Parse error on line " + (l + 1) + ":\n" + m.showPosition() + "\nExpecting " + E.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (_ ==
|
|
3005
|
+
for (C in E = [], s[y]) this.terminals_[C] && C > f && E.push("'" + this.terminals_[C] + "'");
|
|
3006
|
+
ae = m.showPosition ? "Parse error on line " + (l + 1) + ":\n" + m.showPosition() + "\nExpecting " + E.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (_ == p ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(ae, {
|
|
3007
3007
|
text: m.match,
|
|
3008
3008
|
token: this.terminals_[_] || _,
|
|
3009
3009
|
line: m.yylineno,
|
|
3010
|
-
loc:
|
|
3010
|
+
loc: te,
|
|
3011
3011
|
expected: E
|
|
3012
3012
|
});
|
|
3013
3013
|
}
|
|
3014
3014
|
if (b[0] instanceof Array && b.length > 1) throw Error("Parse Error: multiple actions possible at state: " + y + ", token: " + _);
|
|
3015
3015
|
switch (b[0]) {
|
|
3016
3016
|
case 1:
|
|
3017
|
-
|
|
3017
|
+
r.push(_), a.push(m.yytext), o.push(m.yylloc), r.push(b[1]), _ = null, v ? (_ = v, v = null) : (u = m.yyleng, c = m.yytext, l = m.yylineno, te = m.yylloc, d > 0 && d--);
|
|
3018
3018
|
break;
|
|
3019
3019
|
case 2:
|
|
3020
3020
|
if (w = this.productions_[b[1]][1], S.$ = a[a.length - w], S._$ = {
|
|
@@ -3030,8 +3030,8 @@ You have to call mermaid.initialize.`);
|
|
|
3030
3030
|
b[1],
|
|
3031
3031
|
a,
|
|
3032
3032
|
o
|
|
3033
|
-
].concat(
|
|
3034
|
-
w && (
|
|
3033
|
+
].concat(ee)), x !== void 0) return x;
|
|
3034
|
+
w && (r = r.slice(0, -1 * w * 2), a = a.slice(0, -1 * w), o = o.slice(0, -1 * w)), r.push(this.productions_[b[1]][0]), a.push(S.$), o.push(S._$), T = s[r[r.length - 2]][r[r.length - 1]], r.push(T);
|
|
3035
3035
|
break;
|
|
3036
3036
|
case 3: return !0;
|
|
3037
3037
|
}
|