mermaid 10.3.1 → 10.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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/arc-1026bbaf.js +84 -0
- package/dist/{arc-95120417.js → arc-eae95b9d.js} +1 -1
- package/dist/assignWithDepth.d.ts +19 -20
- package/dist/{c4Diagram-bd40bc1b.js → c4Diagram-01b08bdc.js} +2 -2
- package/dist/{c4Diagram-36a13f92.js → c4Diagram-ae26940c.js} +2 -2
- package/dist/{c4Diagram-4de0d805.js → c4Diagram-c0b17d02.js} +3 -2
- package/dist/{classDiagram-b1e5886b.js → classDiagram-09b02f81.js} +5 -5
- package/dist/{classDiagram-0da88708.js → classDiagram-a8cc8886.js} +4 -3
- package/dist/{classDiagram-ced1f152.js → classDiagram-aa2e62c5.js} +5 -5
- package/dist/{classDiagram-v2-eb3281ff.js → classDiagram-v2-115132f8.js} +8 -8
- package/dist/{classDiagram-v2-b0bf8ef8.js → classDiagram-v2-441552b7.js} +12 -12
- package/dist/{classDiagram-v2-2f4ae322.js → classDiagram-v2-802a48d3.js} +7 -6
- package/dist/config.d.ts +2 -2
- package/dist/config.type.d.ts +15 -0
- package/dist/{createText-b670c180.js → createText-3b1f58a4.js} +1 -1
- package/dist/{createText-24393182.js → createText-6836bc4a.js} +1 -1
- package/dist/{createText-c64d47ca.js → createText-98e4790d.js} +1 -1
- package/dist/defaultConfig.d.ts +4 -3
- package/dist/diagram-api/detectType.d.ts +3 -3
- package/dist/diagram-api/diagramAPI.d.ts +1 -1
- package/dist/diagram-api/frontmatter.d.ts +4 -3
- package/dist/diagram-api/loadDiagram.d.ts +1 -0
- package/dist/diagram-api/regexes.d.ts +3 -0
- package/dist/diagram-api/types.d.ts +7 -3
- package/dist/diagrams/c4/c4Diagram.d.ts +1 -1
- package/dist/diagrams/c4/svgDraw.d.ts +1 -1
- package/dist/diagrams/class/classDb.d.ts +1 -1
- package/dist/diagrams/class/classDiagram-v2.d.ts +1 -1
- package/dist/diagrams/class/classDiagram.d.ts +1 -1
- package/dist/diagrams/class/classRenderer-v2.d.ts +1 -1
- package/dist/diagrams/common/common.d.ts +1 -1
- package/dist/diagrams/common/common.spec.d.ts +1 -0
- package/dist/diagrams/common/commonTypes.d.ts +50 -0
- package/dist/diagrams/common/svgDrawCommon.d.ts +15 -0
- package/dist/diagrams/flowchart/flowDiagram-v2.d.ts +1 -1
- package/dist/diagrams/flowchart/flowDiagram.d.ts +1 -1
- package/dist/diagrams/gantt/ganttDiagram.d.ts +1 -1
- package/dist/diagrams/git/gitGraphDiagram.d.ts +1 -1
- package/dist/diagrams/mindmap/mindmapDb.d.ts +1 -1
- package/dist/diagrams/pie/pie.spec.d.ts +1 -0
- package/dist/diagrams/pie/pieDb.d.ts +6 -30
- package/dist/diagrams/pie/pieDetector.d.ts +1 -2
- package/dist/diagrams/pie/pieDiagram.d.ts +1 -1
- package/dist/diagrams/pie/pieRenderer.d.ts +13 -5
- package/dist/diagrams/pie/pieStyles.d.ts +3 -0
- package/dist/diagrams/pie/pieTypes.d.ts +54 -0
- package/dist/diagrams/quadrant-chart/quadrantDiagram.d.ts +1 -1
- package/dist/diagrams/quadrant-chart/quadrantRenderer.d.ts +1 -1
- package/dist/diagrams/requirement/requirementDiagram.d.ts +1 -1
- package/dist/diagrams/sankey/sankeyDiagram.d.ts +1 -1
- package/dist/diagrams/sankey/sankeyRenderer.d.ts +1 -1
- package/dist/diagrams/sequence/sequenceDiagram.d.ts +1 -1
- package/dist/diagrams/sequence/sequenceRenderer.d.ts +1 -1
- package/dist/diagrams/sequence/svgDraw.d.ts +1 -1
- package/dist/diagrams/state/stateDiagram-v2.d.ts +1 -1
- package/dist/diagrams/state/stateDiagram.d.ts +1 -1
- package/dist/diagrams/timeline/timelineRenderer.d.ts +3 -3
- package/dist/diagrams/user-journey/journeyDiagram.d.ts +1 -1
- package/dist/diagrams/user-journey/svgDraw.d.ts +2 -2
- package/dist/{edges-c959041a.js → edges-0005682e.js} +3 -3
- package/dist/{edges-55004f96.js → edges-6be02a86.js} +30 -30
- package/dist/{edges-46e4f833.js → edges-ecd2ecb8.js} +4 -4
- package/dist/{erDiagram-7b1a703c.js → erDiagram-98d114f5.js} +3 -3
- package/dist/{erDiagram-398a53e9.js → erDiagram-9aadf2be.js} +17 -17
- package/dist/{erDiagram-105a1cb2.js → erDiagram-dedf2781.js} +2 -1
- package/dist/{flowDb-03a8f48d.js → flowDb-1d600296.js} +1 -1
- package/dist/{flowDb-a18fdd2a.js → flowDb-3647b264.js} +1 -1
- package/dist/{flowDb-01624e90.js → flowDb-ff651a22.js} +1 -1
- package/dist/{flowDiagram-dbf2c5c9.js → flowDiagram-5d2b0cd4.js} +9 -9
- package/dist/{flowDiagram-ca8a3fc0.js → flowDiagram-791cd6ce.js} +9 -9
- package/dist/{flowDiagram-42ba8acc.js → flowDiagram-d6f8fe3a.js} +8 -7
- package/dist/{flowDiagram-v2-e4ef3cbe.js → flowDiagram-v2-58f49b84.js} +8 -7
- package/dist/{flowDiagram-v2-60163505.js → flowDiagram-v2-ba221793.js} +9 -9
- package/dist/{flowDiagram-v2-526e04fc.js → flowDiagram-v2-c8096018.js} +9 -9
- package/dist/{flowchart-elk-definition-c618ffa4.js → flowchart-elk-definition-32a627c1.js} +6 -6
- package/dist/{flowchart-elk-definition-8136f426.js → flowchart-elk-definition-56584a6c.js} +6 -5
- package/dist/{flowchart-elk-definition-64c20dc9.js → flowchart-elk-definition-b51952f5.js} +6 -6
- package/dist/{ganttDiagram-33119f0c.js → ganttDiagram-088dbd90.js} +2 -1
- package/dist/{ganttDiagram-673ab4e4.js → ganttDiagram-2f2b3e35.js} +2 -2
- package/dist/{ganttDiagram-bac86b83.js → ganttDiagram-3d9d1ab4.js} +70 -70
- package/dist/{gitGraphDiagram-19295f41.js → gitGraphDiagram-2a92ed83.js} +1 -1
- package/dist/{gitGraphDiagram-e49c3762.js → gitGraphDiagram-4c126424.js} +49 -49
- package/dist/{gitGraphDiagram-1dcba3c4.js → gitGraphDiagram-e0ffc2d1.js} +2 -1
- package/dist/{index-e3189d15.js → index-1bb7dfb9.js} +4 -4
- package/dist/{index-c821dd4c.js → index-c449e2c7.js} +4 -4
- package/dist/{index-892ad7fb.js → index-f58d48f9.js} +3 -3
- package/dist/{infoDiagram-99aec0e9.js → infoDiagram-64895a6e.js} +2 -1
- package/dist/{infoDiagram-a7376644.js → infoDiagram-6cbe7c6f.js} +14 -14
- package/dist/{infoDiagram-a91f1f9c.js → infoDiagram-71364981.js} +1 -1
- package/dist/{journeyDiagram-ddd7af72.js → journeyDiagram-a9730694.js} +3 -3
- package/dist/{journeyDiagram-50e783bb.js → journeyDiagram-adaa34f8.js} +3 -2
- package/dist/{journeyDiagram-4884cc8d.js → journeyDiagram-f3c7ca51.js} +18 -18
- package/dist/{layout-9d8f8f12.js → layout-7899ed33.js} +10 -418
- package/dist/layout-df07420e.js +2396 -0
- package/dist/{line-331572f9.js → line-b0ce4b23.js} +1 -1
- package/dist/{line-b5e58ece.js → line-eb9172ee.js} +1 -1
- package/dist/{linear-3f420504.js → linear-50d4520f.js} +10 -10
- package/dist/{linear-add80c81.js → linear-7aa3c424.js} +1 -1
- package/dist/{mermaid-306576ad.js → mermaid-768dc893.js} +3253 -3263
- package/dist/{mermaid-7e6c58c3.js → mermaid-d733041c.js} +3883 -3561
- package/dist/{mermaid-a918c5c0.js → mermaid-f185fde2.js} +4327 -3913
- package/dist/mermaid.core.mjs +3 -2
- package/dist/mermaid.d.ts +5 -4
- package/dist/mermaid.esm.min.mjs +1 -1
- package/dist/mermaid.esm.mjs +2 -2
- package/dist/mermaid.js +4665 -4690
- package/dist/mermaid.min.js +147 -146
- package/dist/mermaidAPI.d.ts +1 -1
- package/dist/{mindmap-definition-5f036dbb.js → mindmap-definition-57868176.js} +3 -2
- package/dist/{mindmap-definition-08eee8ac.js → mindmap-definition-6b172555.js} +2 -2
- package/dist/{mindmap-definition-dae41a11.js → mindmap-definition-6e51e9e7.js} +2 -2
- package/dist/pieDiagram-16330908.js +528 -0
- package/dist/{pieDiagram-b06a513b.js → pieDiagram-3fca7ce7.js} +120 -136
- package/dist/{pieDiagram-470bd806.js → pieDiagram-62059850.js} +119 -136
- package/dist/{quadrantDiagram-42727e21.js → quadrantDiagram-0ca4be02.js} +2 -1
- package/dist/{quadrantDiagram-f4c13fcb.js → quadrantDiagram-6f203608.js} +2 -2
- package/dist/{quadrantDiagram-f4c7ebd6.js → quadrantDiagram-eefba29b.js} +2 -2
- package/dist/rendering-util/handle-markdown-text.d.ts +1 -1
- package/dist/{requirementDiagram-3039623f.js → requirementDiagram-6a2e589f.js} +3 -3
- package/dist/{requirementDiagram-96e78f61.js → requirementDiagram-e13af0f0.js} +2 -1
- package/dist/{requirementDiagram-51520602.js → requirementDiagram-e64784ea.js} +3 -3
- package/dist/{sankeyDiagram-41ed250a.js → sankeyDiagram-081bcda6.js} +17 -7
- package/dist/{sankeyDiagram-fedc6f27.js → sankeyDiagram-80078f5f.js} +194 -191
- package/dist/{sankeyDiagram-91977475.js → sankeyDiagram-a7f8e230.js} +18 -7
- package/dist/{sequenceDiagram-80aafbb8.js → sequenceDiagram-415e57eb.js} +2 -2
- package/dist/{sequenceDiagram-342ef5c4.js → sequenceDiagram-84aa38e3.js} +3 -2
- package/dist/{sequenceDiagram-adea57f6.js → sequenceDiagram-b5c34a98.js} +2 -2
- package/dist/setupGraphViewbox.d.ts +1 -2
- package/dist/{stateDiagram-fa6ef012.js → stateDiagram-956145d5.js} +4 -4
- package/dist/{stateDiagram-3ac8af33.js → stateDiagram-9a586ac6.js} +3 -2
- package/dist/{stateDiagram-949ae5f7.js → stateDiagram-c6f77c62.js} +4 -4
- package/dist/{stateDiagram-v2-2efec10d.js → stateDiagram-v2-7af7da00.js} +13 -13
- package/dist/{stateDiagram-v2-ca22f0dc.js → stateDiagram-v2-96f2b9df.js} +7 -6
- package/dist/{stateDiagram-v2-ba87491d.js → stateDiagram-v2-e78ef88c.js} +8 -8
- package/dist/{styles-7cb29b29.js → styles-04cc473c.js} +29 -29
- package/dist/{styles-4fcf332f.js → styles-1b0c237a.js} +2 -2
- package/dist/{styles-cb6bcb55.js → styles-472dd00e.js} +7 -7
- package/dist/{styles-d0b2ab71.js → styles-622362e4.js} +1 -1
- package/dist/{styles-5664cd4f.js → styles-6e9ebeb4.js} +3 -3
- package/dist/{styles-4f00232b.js → styles-91b2881f.js} +1 -1
- package/dist/{styles-7b411ea5.js → styles-91bd061f.js} +1 -1
- package/dist/{styles-1e36f090.js → styles-a1a6e33f.js} +1 -1
- package/dist/{styles-d22f4783.js → styles-f1c03133.js} +1 -1
- package/dist/{svgDraw-d3f2a258.js → svgDraw-092a0897.js} +2 -2
- package/dist/{svgDraw-b48a99d5.js → svgDraw-70101091.js} +1 -1
- package/dist/{svgDraw-3570afd5.js → svgDraw-8c7d5329.js} +2 -2
- package/dist/svgDrawCommon-05124e63.js +64 -0
- package/dist/svgDrawCommon-42e92da3.js +98 -0
- package/dist/svgDrawCommon-5f2bf747.js +97 -0
- package/dist/{timeline-definition-cbf43e70.js → timeline-definition-1a90b03d.js} +2 -1
- package/dist/{timeline-definition-df0f8466.js → timeline-definition-8fc01fef.js} +2 -2
- package/dist/{timeline-definition-a91b186e.js → timeline-definition-e6c31e7d.js} +33 -33
- package/dist/utils.d.ts +16 -14
- package/dist/utils.spec.d.ts +1 -0
- package/package.json +25 -20
- package/LICENSE +0 -21
- package/dist/arc-e34fbb53.js +0 -84
- package/dist/diagrams/pie/styles.d.ts +0 -2
- package/dist/layout-2be1671e.js +0 -2679
- package/dist/pieDiagram-d415667d.js +0 -544
- package/dist/svgDrawCommon-35739f2d.js +0 -70
- package/dist/svgDrawCommon-703c6069.js +0 -101
- package/dist/svgDrawCommon-f26cad39.js +0 -101
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ Use Mermaid with your favorite applications, check out the list of [Integrations
|
|
|
60
60
|
|
|
61
61
|
You can also use Mermaid within [GitHub](https://github.blog/2022-02-14-include-diagrams-markdown-files-mermaid/) as well many of your other favorite applications—check out the list of [Integrations and Usages of Mermaid](./docs/ecosystem/integrations.md).
|
|
62
62
|
|
|
63
|
-
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/
|
|
63
|
+
For a more detailed introduction to Mermaid and some of its more basic uses, look to the [Beginner's Guide](./docs/intro/n00b-gettingStarted.md), [Usage](./docs/config/usage.md) and [Tutorials](./docs/config/Tutorials.md).
|
|
64
64
|
|
|
65
65
|
In our release process we rely heavily on visual regression tests using [applitools](https://applitools.com/). Applitools is a great service which has been easy to use and integrate with our tests.
|
|
66
66
|
|
package/README.zh-CN.md
CHANGED
|
@@ -55,7 +55,7 @@ Mermaid 通过允许用户创建便于修改的图表来解决这一难题,它
|
|
|
55
55
|
Mermaid 甚至能让非程序员也能通过 [Mermaid Live Editor](https://mermaid.live/) 轻松创建详细的图表。<br/>
|
|
56
56
|
你可以访问 [教程](./docs/config/Tutorials.md) 来查看 Live Editor 的视频教程,也可以查看 [Mermaid 的集成和使用](./docs/ecosystem/integrations.md) 这个清单来检查你的文档工具是否已经集成了 Mermaid 支持。
|
|
57
57
|
|
|
58
|
-
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/
|
|
58
|
+
如果想要查看关于 Mermaid 更详细的介绍及基础使用方式,可以查看 [入门指引](./docs/intro/n00b-gettingStarted.md), [用法](./docs/config/usage.md) 和 [教程](./docs/config/Tutorials.md).
|
|
59
59
|
|
|
60
60
|
<!-- </Main description> -->
|
|
61
61
|
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { c as Y, p as sn } from "./constant-2fe7eae5.js";
|
|
2
|
+
import { aY as en, aZ as z, a_ as P, a$ as rn, b0 as y, X as ln, b1 as F, b2 as k, b3 as an, b4 as t, b5 as un, b6 as on, b7 as tn } from "./mermaid-d733041c.js";
|
|
3
|
+
function fn(l) {
|
|
4
|
+
return l.innerRadius;
|
|
5
|
+
}
|
|
6
|
+
function cn(l) {
|
|
7
|
+
return l.outerRadius;
|
|
8
|
+
}
|
|
9
|
+
function yn(l) {
|
|
10
|
+
return l.startAngle;
|
|
11
|
+
}
|
|
12
|
+
function gn(l) {
|
|
13
|
+
return l.endAngle;
|
|
14
|
+
}
|
|
15
|
+
function mn(l) {
|
|
16
|
+
return l && l.padAngle;
|
|
17
|
+
}
|
|
18
|
+
function pn(l, x, D, q, h, v, Z, r) {
|
|
19
|
+
var s = D - l, n = q - x, m = Z - h, i = r - v, a = i * s - m * n;
|
|
20
|
+
if (!(a * a < y))
|
|
21
|
+
return a = (m * (x - v) - i * (l - h)) / a, [l + a * s, x + a * n];
|
|
22
|
+
}
|
|
23
|
+
function L(l, x, D, q, h, v, Z) {
|
|
24
|
+
var r = l - D, s = x - q, n = (Z ? v : -v) / F(r * r + s * s), m = n * s, i = -n * r, a = l + m, f = x + i, c = D + m, E = q + i, o = (a + c) / 2, I = (f + E) / 2, p = c - a, g = E - f, A = p * p + g * g, O = h - v, b = a * E - c * f, S = (g < 0 ? -1 : 1) * F(tn(0, O * O * A - b * b)), X = (b * g - p * S) / A, d = (-b * p - g * S) / A, R = (b * g + p * S) / A, T = (-b * p + g * S) / A, e = X - o, u = d - I, $ = R - o, j = T - I;
|
|
25
|
+
return e * e + u * u > $ * $ + j * j && (X = R, d = T), {
|
|
26
|
+
cx: X,
|
|
27
|
+
cy: d,
|
|
28
|
+
x01: -m,
|
|
29
|
+
y01: -i,
|
|
30
|
+
x11: X * (h / O - 1),
|
|
31
|
+
y11: d * (h / O - 1)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function hn() {
|
|
35
|
+
var l = fn, x = cn, D = Y(0), q = null, h = yn, v = gn, Z = mn, r = null;
|
|
36
|
+
function s() {
|
|
37
|
+
var n, m, i = +l.apply(this, arguments), a = +x.apply(this, arguments), f = h.apply(this, arguments) - rn, c = v.apply(this, arguments) - rn, E = an(c - f), o = c > f;
|
|
38
|
+
if (r || (r = n = sn()), a < i && (m = a, a = i, i = m), !(a > y))
|
|
39
|
+
r.moveTo(0, 0);
|
|
40
|
+
else if (E > ln - y)
|
|
41
|
+
r.moveTo(a * z(f), a * P(f)), r.arc(0, 0, a, f, c, !o), i > y && (r.moveTo(i * z(c), i * P(c)), r.arc(0, 0, i, c, f, o));
|
|
42
|
+
else {
|
|
43
|
+
var I = f, p = c, g = f, A = c, O = E, b = E, S = Z.apply(this, arguments) / 2, X = S > y && (q ? +q.apply(this, arguments) : F(i * i + a * a)), d = k(an(a - i) / 2, +D.apply(this, arguments)), R = d, T = d, e, u;
|
|
44
|
+
if (X > y) {
|
|
45
|
+
var $ = un(X / i * P(S)), j = un(X / a * P(S));
|
|
46
|
+
(O -= $ * 2) > y ? ($ *= o ? 1 : -1, g += $, A -= $) : (O = 0, g = A = (f + c) / 2), (b -= j * 2) > y ? (j *= o ? 1 : -1, I += j, p -= j) : (b = 0, I = p = (f + c) / 2);
|
|
47
|
+
}
|
|
48
|
+
var B = a * z(I), C = a * P(I), G = i * z(A), H = i * P(A);
|
|
49
|
+
if (d > y) {
|
|
50
|
+
var J = a * z(p), K = a * P(p), M = i * z(g), N = i * P(g), w;
|
|
51
|
+
if (E < en && (w = pn(B, C, M, N, J, K, G, H))) {
|
|
52
|
+
var Q = B - w[0], U = C - w[1], V = J - w[0], W = K - w[1], _ = 1 / P(on((Q * V + U * W) / (F(Q * Q + U * U) * F(V * V + W * W))) / 2), nn = F(w[0] * w[0] + w[1] * w[1]);
|
|
53
|
+
R = k(d, (i - nn) / (_ - 1)), T = k(d, (a - nn) / (_ + 1));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
b > y ? T > y ? (e = L(M, N, B, C, a, T, o), u = L(J, K, G, H, a, T, o), r.moveTo(e.cx + e.x01, e.cy + e.y01), T < d ? r.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (r.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(e.y11, e.x11), !o), r.arc(0, 0, a, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), !o), r.arc(u.cx, u.cy, T, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : (r.moveTo(B, C), r.arc(0, 0, a, I, p, !o)) : r.moveTo(B, C), !(i > y) || !(O > y) ? r.lineTo(G, H) : R > y ? (e = L(G, H, J, K, i, -R, o), u = L(B, C, M, N, i, -R, o), r.lineTo(e.cx + e.x01, e.cy + e.y01), R < d ? r.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (r.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(e.y11, e.x11), !o), r.arc(0, 0, i, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), o), r.arc(u.cx, u.cy, R, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : r.arc(0, 0, i, A, g, o);
|
|
57
|
+
}
|
|
58
|
+
if (r.closePath(), n)
|
|
59
|
+
return r = null, n + "" || null;
|
|
60
|
+
}
|
|
61
|
+
return s.centroid = function() {
|
|
62
|
+
var n = (+l.apply(this, arguments) + +x.apply(this, arguments)) / 2, m = (+h.apply(this, arguments) + +v.apply(this, arguments)) / 2 - en / 2;
|
|
63
|
+
return [z(m) * n, P(m) * n];
|
|
64
|
+
}, s.innerRadius = function(n) {
|
|
65
|
+
return arguments.length ? (l = typeof n == "function" ? n : Y(+n), s) : l;
|
|
66
|
+
}, s.outerRadius = function(n) {
|
|
67
|
+
return arguments.length ? (x = typeof n == "function" ? n : Y(+n), s) : x;
|
|
68
|
+
}, s.cornerRadius = function(n) {
|
|
69
|
+
return arguments.length ? (D = typeof n == "function" ? n : Y(+n), s) : D;
|
|
70
|
+
}, s.padRadius = function(n) {
|
|
71
|
+
return arguments.length ? (q = n == null ? null : typeof n == "function" ? n : Y(+n), s) : q;
|
|
72
|
+
}, s.startAngle = function(n) {
|
|
73
|
+
return arguments.length ? (h = typeof n == "function" ? n : Y(+n), s) : h;
|
|
74
|
+
}, s.endAngle = function(n) {
|
|
75
|
+
return arguments.length ? (v = typeof n == "function" ? n : Y(+n), s) : v;
|
|
76
|
+
}, s.padAngle = function(n) {
|
|
77
|
+
return arguments.length ? (Z = typeof n == "function" ? n : Y(+n), s) : Z;
|
|
78
|
+
}, s.context = function(n) {
|
|
79
|
+
return arguments.length ? (r = n ?? null, s) : r;
|
|
80
|
+
}, s;
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
hn as d
|
|
84
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as constant, p as path } from "./constant-b644328d.js";
|
|
2
|
-
import {
|
|
2
|
+
import { aY as pi, aZ as cos, a_ as sin, a$ as halfPi, b0 as epsilon, X as tau, b1 as sqrt, b2 as min, b3 as abs, b4 as atan2, b5 as asin, b6 as acos, b7 as max } from "./mermaid-f185fde2.js";
|
|
3
3
|
function arcInnerRadius(d) {
|
|
4
4
|
return d.innerRadius;
|
|
5
5
|
}
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
export default assignWithDepth;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* assignWithDepth Extends the functionality of {@link Object.assign} with the
|
|
4
3
|
* ability to merge arbitrary-depth objects For each key in src with path `k` (recursively)
|
|
5
4
|
* performs an Object.assign(dst[`k`], src[`k`]) with a slight change from the typical handling of
|
|
6
|
-
* undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to {} and
|
|
5
|
+
* undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to `{}` and
|
|
7
6
|
* effectively merged with src[`k`]<p> Additionally, dissimilar types will not clobber unless the
|
|
8
7
|
* config.clobber parameter === true. Example:
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
9
|
+
* ```
|
|
10
|
+
* const config_0 = { foo: { bar: 'bar' }, bar: 'foo' };
|
|
11
|
+
* const config_1 = { foo: 'foo', bar: 'bar' };
|
|
12
|
+
* const result = assignWithDepth(config_0, config_1);
|
|
13
|
+
* console.log(result);
|
|
14
|
+
* //-> result: { foo: { bar: 'bar' }, bar: 'bar' }
|
|
15
|
+
* ```
|
|
17
16
|
*
|
|
18
17
|
* Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. If src is a
|
|
19
18
|
* destructured array of objects and dst is not an array, assignWithDepth will apply each element
|
|
20
19
|
* of src to dst in order.
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @returns {any}
|
|
20
|
+
* @param dst - The destination of the merge
|
|
21
|
+
* @param src - The source object(s) to merge into destination
|
|
22
|
+
* @param config -
|
|
23
|
+
* * depth: depth to traverse within src and dst for merging
|
|
24
|
+
* * clobber: should dissimilar types clobber
|
|
27
25
|
*/
|
|
28
|
-
declare
|
|
29
|
-
depth
|
|
30
|
-
clobber
|
|
31
|
-
}
|
|
26
|
+
declare const assignWithDepth: (dst: any, src: any, { depth, clobber }?: {
|
|
27
|
+
depth?: number | undefined;
|
|
28
|
+
clobber?: boolean | undefined;
|
|
29
|
+
}) => any;
|
|
30
|
+
export default assignWithDepth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as Ye, g as Ie, a as Ve, b as je, c as Ut, d as ve, m as Ue, e as Fe, f as le, h as Xe, i as Yt, j as Qt, l as _e, k as ze, w as We, n as xe } from "./mermaid-
|
|
2
|
-
import { d as Qe, g as He } from "./svgDrawCommon-
|
|
1
|
+
import { s as Ye, g as Ie, a as Ve, b as je, c as Ut, d as ve, m as Ue, e as Fe, f as le, h as Xe, i as Yt, j as Qt, l as _e, k as ze, w as We, n as xe } from "./mermaid-d733041c.js";
|
|
2
|
+
import { d as Qe, g as He } from "./svgDrawCommon-05124e63.js";
|
|
3
3
|
var qt = function() {
|
|
4
4
|
var e = function(Ot, _, x, m) {
|
|
5
5
|
for (x = x || {}, m = Ot.length; m--; x[Ot[m]] = _)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as setAccTitle, g as getAccTitle, a as getAccDescription, b as setAccDescription, c as getConfig, d as sanitizeText, m as mermaidAPI, e as sanitizeUrl_1, f as common, h as assignWithDepth, i as calculateTextWidth, j as d3select, l as log, k as configureSvgSize, w as wrapLabel, n as calculateTextHeight } from "./mermaid-
|
|
2
|
-
import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-
|
|
1
|
+
import { s as setAccTitle, g as getAccTitle, a as getAccDescription, b as setAccDescription, c as getConfig, d as sanitizeText, m as mermaidAPI, e as sanitizeUrl_1, f as common, h as assignWithDepth, i as calculateTextWidth, j as d3select, l as log, k as configureSvgSize, w as wrapLabel, n as calculateTextHeight } from "./mermaid-f185fde2.js";
|
|
2
|
+
import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-5f2bf747.js";
|
|
3
3
|
var parser = function() {
|
|
4
4
|
var o = function(k, v, o2, l) {
|
|
5
5
|
for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { s as setAccTitle, g as getAccTitle, a as getAccDescription, b as setAccDescription, c as getConfig, d as sanitizeText, m as mermaidAPI, e as common, f as assignWithDepth, h as calculateTextWidth, l as log, i as configureSvgSize, w as wrapLabel, j as calculateTextHeight } from "./mermaid-
|
|
1
|
+
import { s as setAccTitle, g as getAccTitle, a as getAccDescription, b as setAccDescription, c as getConfig, d as sanitizeText, m as mermaidAPI, e as common, f as assignWithDepth, h as calculateTextWidth, l as log, i as configureSvgSize, w as wrapLabel, j as calculateTextHeight } from "./mermaid-768dc893.js";
|
|
2
2
|
import { select } from "d3";
|
|
3
|
-
import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-
|
|
3
|
+
import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-42e92da3.js";
|
|
4
4
|
import { sanitizeUrl } from "@braintree/sanitize-url";
|
|
5
5
|
import "ts-dedent";
|
|
6
6
|
import "dayjs";
|
|
7
7
|
import "dompurify";
|
|
8
8
|
import "khroma";
|
|
9
9
|
import "lodash-es/memoize.js";
|
|
10
|
+
import "lodash-es/merge.js";
|
|
10
11
|
import "stylis";
|
|
11
12
|
import "lodash-es/isEmpty.js";
|
|
12
13
|
var parser = function() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as W, d as M, s as H } from "./styles-
|
|
2
|
-
import { c as S, l as d, j as m, k as X } from "./mermaid-
|
|
3
|
-
import { G as Y, l as Z } from "./layout-
|
|
4
|
-
import { s as l } from "./svgDraw-
|
|
5
|
-
import "./line-
|
|
1
|
+
import { p as W, d as M, s as H } from "./styles-04cc473c.js";
|
|
2
|
+
import { c as S, l as d, j as m, k as X } from "./mermaid-d733041c.js";
|
|
3
|
+
import { G as Y, l as Z } from "./layout-df07420e.js";
|
|
4
|
+
import { s as l } from "./svgDraw-8c7d5329.js";
|
|
5
|
+
import "./line-b0ce4b23.js";
|
|
6
6
|
import "./array-2ff2c7a6.js";
|
|
7
7
|
import "./constant-2fe7eae5.js";
|
|
8
8
|
let h = {};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { p as parser, d as db, s as styles } from "./styles-
|
|
1
|
+
import { p as parser, d as db, s as styles } from "./styles-622362e4.js";
|
|
2
2
|
import { select } from "d3";
|
|
3
3
|
import { layout } from "dagre-d3-es/src/dagre/index.js";
|
|
4
4
|
import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
|
|
5
|
-
import { c as getConfig, l as log, i as configureSvgSize } from "./mermaid-
|
|
6
|
-
import { s as svgDraw } from "./svgDraw-
|
|
5
|
+
import { c as getConfig, l as log, i as configureSvgSize } from "./mermaid-768dc893.js";
|
|
6
|
+
import { s as svgDraw } from "./svgDraw-70101091.js";
|
|
7
7
|
import "ts-dedent";
|
|
8
8
|
import "dayjs";
|
|
9
9
|
import "@braintree/sanitize-url";
|
|
10
10
|
import "dompurify";
|
|
11
11
|
import "khroma";
|
|
12
12
|
import "lodash-es/memoize.js";
|
|
13
|
+
import "lodash-es/merge.js";
|
|
13
14
|
import "stylis";
|
|
14
15
|
import "lodash-es/isEmpty.js";
|
|
15
16
|
let idCache = {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { p as parser, d as db, s as styles } from "./styles-
|
|
2
|
-
import { c as getConfig, l as log, j as d3select, k as configureSvgSize } from "./mermaid-
|
|
3
|
-
import { G as Graph, l as layout } from "./layout-
|
|
4
|
-
import { s as svgDraw } from "./svgDraw-
|
|
5
|
-
import "./line-
|
|
1
|
+
import { p as parser, d as db, s as styles } from "./styles-f1c03133.js";
|
|
2
|
+
import { c as getConfig, l as log, j as d3select, k as configureSvgSize } from "./mermaid-f185fde2.js";
|
|
3
|
+
import { G as Graph, l as layout } from "./layout-7899ed33.js";
|
|
4
|
+
import { s as svgDraw } from "./svgDraw-092a0897.js";
|
|
5
|
+
import "./line-eb9172ee.js";
|
|
6
6
|
import "./array-b7dcf730.js";
|
|
7
7
|
import "./constant-b644328d.js";
|
|
8
8
|
let idCache = {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { p as parser, d as db, s as styles } from "./styles-
|
|
2
|
-
import { l as log, c as getConfig, j as d3select,
|
|
3
|
-
import { G as Graph } from "./layout-
|
|
4
|
-
import { r as render } from "./index-
|
|
5
|
-
import "./edges-
|
|
6
|
-
import "./createText-
|
|
7
|
-
import "./svgDraw-
|
|
8
|
-
import "./line-
|
|
1
|
+
import { p as parser, d as db, s as styles } from "./styles-f1c03133.js";
|
|
2
|
+
import { l as log, c as getConfig, j as d3select, A as utils, t as setupGraphViewbox, r as interpolateToCurve, o as curveLinear, p as getStylesFromArray, f as common } from "./mermaid-f185fde2.js";
|
|
3
|
+
import { G as Graph } from "./layout-7899ed33.js";
|
|
4
|
+
import { r as render } from "./index-1bb7dfb9.js";
|
|
5
|
+
import "./edges-ecd2ecb8.js";
|
|
6
|
+
import "./createText-6836bc4a.js";
|
|
7
|
+
import "./svgDraw-092a0897.js";
|
|
8
|
+
import "./line-eb9172ee.js";
|
|
9
9
|
import "./array-b7dcf730.js";
|
|
10
10
|
import "./constant-b644328d.js";
|
|
11
11
|
const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { p as R, d as N, s as B } from "./styles-
|
|
2
|
-
import { l as c, c as r, j as k,
|
|
3
|
-
import { G as P } from "./layout-
|
|
4
|
-
import { r as $ } from "./index-
|
|
5
|
-
import "./edges-
|
|
6
|
-
import "./createText-
|
|
7
|
-
import "./svgDraw-
|
|
8
|
-
import "./line-
|
|
1
|
+
import { p as R, d as N, s as B } from "./styles-04cc473c.js";
|
|
2
|
+
import { l as c, c as r, j as k, A as G, t as _, r as E, o as A, p as z, f as C } from "./mermaid-d733041c.js";
|
|
3
|
+
import { G as P } from "./layout-df07420e.js";
|
|
4
|
+
import { r as $ } from "./index-c449e2c7.js";
|
|
5
|
+
import "./edges-6be02a86.js";
|
|
6
|
+
import "./createText-98e4790d.js";
|
|
7
|
+
import "./svgDraw-8c7d5329.js";
|
|
8
|
+
import "./line-b0ce4b23.js";
|
|
9
9
|
import "./array-2ff2c7a6.js";
|
|
10
10
|
import "./constant-2fe7eae5.js";
|
|
11
|
-
const S = (o) =>
|
|
11
|
+
const S = (o) => C.sanitizeText(o, r());
|
|
12
12
|
let v = {
|
|
13
13
|
dividerMargin: 10,
|
|
14
14
|
padding: 5,
|
|
@@ -92,7 +92,7 @@ const q = function(o, t, p, n) {
|
|
|
92
92
|
arrowTypeEnd: "none",
|
|
93
93
|
style: "fill:none",
|
|
94
94
|
labelStyle: "",
|
|
95
|
-
curve: E(v.curve,
|
|
95
|
+
curve: E(v.curve, A)
|
|
96
96
|
};
|
|
97
97
|
t.setEdge(l.id, l.class, u, b);
|
|
98
98
|
});
|
|
@@ -117,13 +117,13 @@ const q = function(o, t, p, n) {
|
|
|
117
117
|
arrowTypeEnd: D(e.relation.type2),
|
|
118
118
|
style: "fill:none",
|
|
119
119
|
labelStyle: "",
|
|
120
|
-
curve: E(p == null ? void 0 : p.curve,
|
|
120
|
+
curve: E(p == null ? void 0 : p.curve, A)
|
|
121
121
|
};
|
|
122
122
|
if (c.info(s, e), e.style !== void 0) {
|
|
123
123
|
const a = z(e.style);
|
|
124
124
|
s.style = a.style, s.labelStyle = a.labelStyle;
|
|
125
125
|
}
|
|
126
|
-
e.text = e.title, e.text === void 0 ? e.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((l = r().flowchart) == null ? void 0 : l.htmlLabels) ?? r().htmlLabels ? (s.labelType = "html", s.label = '<span class="edgeLabel">' + e.text + "</span>") : (s.labelType = "text", s.label = e.text.replace(
|
|
126
|
+
e.text = e.title, e.text === void 0 ? e.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((l = r().flowchart) == null ? void 0 : l.htmlLabels) ?? r().htmlLabels ? (s.labelType = "html", s.label = '<span class="edgeLabel">' + e.text + "</span>") : (s.labelType = "text", s.label = e.text.replace(C.lineBreakRegex, `
|
|
127
127
|
`), e.style === void 0 && (s.style = s.style || "stroke: #333; stroke-width: 1.5px;fill:none"), s.labelStyle = s.labelStyle.replace("color:", "fill:"))), t.setEdge(e.id1, e.id2, s, n);
|
|
128
128
|
});
|
|
129
129
|
}, V = function(o) {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { p as parser, d as db, s as styles } from "./styles-
|
|
1
|
+
import { p as parser, d as db, s as styles } from "./styles-622362e4.js";
|
|
2
2
|
import { select, curveLinear } from "d3";
|
|
3
3
|
import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
|
|
4
|
-
import { l as log, c as getConfig, u as utils, p as setupGraphViewbox, o as interpolateToCurve, k as getStylesFromArray, e as common } from "./mermaid-
|
|
5
|
-
import { r as render } from "./index-
|
|
4
|
+
import { l as log, c as getConfig, u as utils, p as setupGraphViewbox, o as interpolateToCurve, k as getStylesFromArray, e as common } from "./mermaid-768dc893.js";
|
|
5
|
+
import { r as render } from "./index-f58d48f9.js";
|
|
6
6
|
import "ts-dedent";
|
|
7
7
|
import "dayjs";
|
|
8
8
|
import "@braintree/sanitize-url";
|
|
9
9
|
import "dompurify";
|
|
10
10
|
import "khroma";
|
|
11
11
|
import "lodash-es/memoize.js";
|
|
12
|
+
import "lodash-es/merge.js";
|
|
12
13
|
import "stylis";
|
|
13
14
|
import "lodash-es/isEmpty.js";
|
|
14
15
|
import "dagre-d3-es/src/dagre/index.js";
|
|
15
16
|
import "dagre-d3-es/src/graphlib/json.js";
|
|
16
|
-
import "./edges-
|
|
17
|
-
import "./createText-
|
|
17
|
+
import "./edges-0005682e.js";
|
|
18
|
+
import "./createText-3b1f58a4.js";
|
|
18
19
|
import "mdast-util-from-markdown";
|
|
19
|
-
import "./svgDraw-
|
|
20
|
+
import "./svgDraw-70101091.js";
|
|
20
21
|
const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
|
|
21
22
|
let conf = {
|
|
22
23
|
dividerMargin: 10,
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MermaidConfig } from './config.type.js';
|
|
2
2
|
export declare const defaultConfig: MermaidConfig;
|
|
3
|
-
export declare const updateCurrentConfig: (siteCfg: MermaidConfig, _directives:
|
|
3
|
+
export declare const updateCurrentConfig: (siteCfg: MermaidConfig, _directives: MermaidConfig[]) => MermaidConfig;
|
|
4
4
|
/**
|
|
5
5
|
* ## setSiteConfig
|
|
6
6
|
*
|
|
@@ -76,7 +76,7 @@ export declare const sanitize: (options: any) => void;
|
|
|
76
76
|
*
|
|
77
77
|
* @param directive - The directive to push in
|
|
78
78
|
*/
|
|
79
|
-
export declare const addDirective: (directive:
|
|
79
|
+
export declare const addDirective: (directive: MermaidConfig) => void;
|
|
80
80
|
/**
|
|
81
81
|
* ## reset
|
|
82
82
|
*
|
package/dist/config.type.d.ts
CHANGED
|
@@ -1280,6 +1280,21 @@ export interface SankeyDiagramConfig extends BaseDiagramConfig {
|
|
|
1280
1280
|
*/
|
|
1281
1281
|
nodeAlignment?: 'left' | 'right' | 'center' | 'justify';
|
|
1282
1282
|
useMaxWidth?: boolean;
|
|
1283
|
+
/**
|
|
1284
|
+
* Toggle to display or hide values along with title.
|
|
1285
|
+
*
|
|
1286
|
+
*/
|
|
1287
|
+
showValues?: boolean;
|
|
1288
|
+
/**
|
|
1289
|
+
* The prefix to use for values
|
|
1290
|
+
*
|
|
1291
|
+
*/
|
|
1292
|
+
prefix?: string;
|
|
1293
|
+
/**
|
|
1294
|
+
* The suffix to use for values
|
|
1295
|
+
*
|
|
1296
|
+
*/
|
|
1297
|
+
suffix?: string;
|
|
1283
1298
|
}
|
|
1284
1299
|
/**
|
|
1285
1300
|
* This interface was referenced by `MermaidConfig`'s JSON-Schema
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as log,
|
|
1
|
+
import { l as log, L as decodeEntities } from "./mermaid-768dc893.js";
|
|
2
2
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
3
3
|
import { dedent } from "ts-dedent";
|
|
4
4
|
function preprocessMarkdown(markdown) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b8 as dedent, l as log, aT as decodeEntities } from "./mermaid-f185fde2.js";
|
|
2
2
|
function toString(node, options) {
|
|
3
3
|
var { includeImageAlt = true } = options || {};
|
|
4
4
|
return one(node, includeImageAlt);
|
package/dist/defaultConfig.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RequiredDeep } from 'type-fest';
|
|
2
|
+
import type { MermaidConfig } from './config.type.js';
|
|
2
3
|
/**
|
|
3
4
|
* Default mermaid configuration options.
|
|
4
5
|
*
|
|
@@ -6,6 +7,6 @@ import { type MermaidConfig } from './config.type.js';
|
|
|
6
7
|
* Non-JSON JS default values are listed in this file, e.g. functions, or
|
|
7
8
|
* `undefined` (explicitly set so that `configKeys` finds them).
|
|
8
9
|
*/
|
|
9
|
-
declare const config:
|
|
10
|
-
export declare const configKeys: string
|
|
10
|
+
declare const config: RequiredDeep<MermaidConfig>;
|
|
11
|
+
export declare const configKeys: Set<string>;
|
|
11
12
|
export default config;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { MermaidConfig } from '../config.type.js';
|
|
2
|
-
import type { DiagramDetector, DiagramLoader, ExternalDiagramDefinition } from './types.js';
|
|
1
|
+
import type { MermaidConfig } from '../config.type.js';
|
|
2
|
+
import type { DetectorRecord, DiagramDetector, DiagramLoader, ExternalDiagramDefinition } from './types.js';
|
|
3
|
+
export declare const detectors: Record<string, DetectorRecord>;
|
|
3
4
|
/**
|
|
4
5
|
* Detects the type of the graph text.
|
|
5
6
|
*
|
|
@@ -37,6 +38,5 @@ export declare const detectType: (text: string, config?: MermaidConfig) => strin
|
|
|
37
38
|
* @param diagrams - Diagrams to lazy load, and their detectors, in order of importance.
|
|
38
39
|
*/
|
|
39
40
|
export declare const registerLazyLoadedDiagrams: (...diagrams: ExternalDiagramDefinition[]) => void;
|
|
40
|
-
export declare const loadRegisteredDiagrams: () => Promise<void>;
|
|
41
41
|
export declare const addDetector: (key: string, detector: DiagramDetector, loader?: DiagramLoader) => void;
|
|
42
42
|
export declare const getDiagramLoader: (key: string) => DiagramLoader | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiagramDefinition, DiagramDetector } from './types.js';
|
|
1
|
+
import type { DiagramDefinition, DiagramDetector } from './types.js';
|
|
2
2
|
import * as _commonDb from '../commonDb.js';
|
|
3
3
|
export declare const log: Record<import("../logger.js").LogLevel, {
|
|
4
4
|
(...data: any[]): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { MermaidConfig } from '../config.type.js';
|
|
2
|
+
import type { DiagramDB } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Extract and parse frontmatter from text, if present, and sets appropriate
|
|
5
5
|
* properties in the provided db.
|
|
6
6
|
* @param text - The text that may have a YAML frontmatter.
|
|
7
7
|
* @param db - Diagram database, could be of any diagram.
|
|
8
|
+
* @param setDiagramConfig - Optional function to set diagram config.
|
|
8
9
|
* @returns text with frontmatter stripped out
|
|
9
10
|
*/
|
|
10
|
-
export declare function extractFrontMatter(text: string, db: DiagramDB): string;
|
|
11
|
+
export declare function extractFrontMatter(text: string, db: DiagramDB, setDiagramConfig?: (config: MermaidConfig) => void): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadRegisteredDiagrams: () => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Diagram } from '../Diagram.js';
|
|
2
|
-
import type { MermaidConfig } from '../config.type.js';
|
|
1
|
+
import type { Diagram } from '../Diagram.js';
|
|
2
|
+
import type { BaseDiagramConfig, MermaidConfig } from '../config.type.js';
|
|
3
3
|
import type * as d3 from 'd3';
|
|
4
4
|
export interface InjectUtils {
|
|
5
5
|
_log: any;
|
|
@@ -14,11 +14,15 @@ export interface InjectUtils {
|
|
|
14
14
|
* Generic Diagram DB that may apply to any diagram type.
|
|
15
15
|
*/
|
|
16
16
|
export interface DiagramDB {
|
|
17
|
+
getConfig?: () => BaseDiagramConfig | undefined;
|
|
17
18
|
clear?: () => void;
|
|
18
19
|
setDiagramTitle?: (title: string) => void;
|
|
19
|
-
|
|
20
|
+
getDiagramTitle?: () => string;
|
|
21
|
+
setAccTitle?: (title: string) => void;
|
|
20
22
|
getAccTitle?: () => string;
|
|
23
|
+
setAccDescription?: (describetion: string) => void;
|
|
21
24
|
getAccDescription?: () => string;
|
|
25
|
+
setDisplayMode?: (title: string) => void;
|
|
22
26
|
bindFunctions?: (element: Element) => void;
|
|
23
27
|
}
|
|
24
28
|
export interface DiagramDefinition {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DiagramDefinition } from '../../diagram-api/types.js';
|
|
1
|
+
import type { DiagramDefinition } from '../../diagram-api/types.js';
|
|
2
2
|
export declare const diagram: DiagramDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function drawRect(elem: any, rectData: any):
|
|
1
|
+
export function drawRect(elem: any, rectData: any): import("../common/commonTypes.js").D3RectElement;
|
|
2
2
|
export function drawImage(elem: any, width: any, height: any, x: any, y: any, link: any): void;
|
|
3
3
|
export function drawRels(elem: any, rels: any, conf: any): void;
|
|
4
4
|
export function drawC4Shape(elem: any, c4Shape: any, conf: any): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassRelation, ClassNode, ClassNote, ClassMap, NamespaceMap, NamespaceNode } from './classTypes.js';
|
|
1
|
+
import type { ClassRelation, ClassNode, ClassNote, ClassMap, NamespaceMap, NamespaceNode } from './classTypes.js';
|
|
2
2
|
export declare const parseDirective: (statement: string, context: string, type: string) => void;
|
|
3
3
|
export declare const setClassLabel: (id: string, label: string) => void;
|
|
4
4
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DiagramDefinition } from '../../diagram-api/types.js';
|
|
1
|
+
import type { DiagramDefinition } from '../../diagram-api/types.js';
|
|
2
2
|
export declare const diagram: DiagramDefinition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DiagramDefinition } from '../../diagram-api/types.js';
|
|
1
|
+
import type { DiagramDefinition } from '../../diagram-api/types.js';
|
|
2
2
|
export declare const diagram: DiagramDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';
|
|
2
|
-
import { ClassRelation, ClassNote, ClassMap, NamespaceMap } from './classTypes.js';
|
|
2
|
+
import type { ClassRelation, ClassNote, ClassMap, NamespaceMap } from './classTypes.js';
|
|
3
3
|
/**
|
|
4
4
|
* Function that adds the vertices found during parsing to the graph to be rendered.
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface RectData {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
fill: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
stroke: string;
|
|
8
|
+
class?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
rx?: number;
|
|
11
|
+
ry?: number;
|
|
12
|
+
attrs?: Record<string, string | number>;
|
|
13
|
+
anchor?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface Bound {
|
|
16
|
+
startx: number;
|
|
17
|
+
stopx: number;
|
|
18
|
+
starty: number;
|
|
19
|
+
stopy: number;
|
|
20
|
+
fill: string;
|
|
21
|
+
stroke: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TextData {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
anchor: string;
|
|
27
|
+
text: string;
|
|
28
|
+
textMargin: number;
|
|
29
|
+
class?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface TextObject {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
fill?: string;
|
|
37
|
+
anchor?: string;
|
|
38
|
+
'text-anchor': string;
|
|
39
|
+
style: string;
|
|
40
|
+
textMargin: number;
|
|
41
|
+
rx: number;
|
|
42
|
+
ry: number;
|
|
43
|
+
tspan: boolean;
|
|
44
|
+
valign?: string;
|
|
45
|
+
}
|
|
46
|
+
export type D3RectElement = d3.Selection<SVGRectElement, unknown, Element | null, unknown>;
|
|
47
|
+
export type D3UseElement = d3.Selection<SVGUseElement, unknown, Element | null, unknown>;
|
|
48
|
+
export type D3ImageElement = d3.Selection<SVGImageElement, unknown, Element | null, unknown>;
|
|
49
|
+
export type D3TextElement = d3.Selection<SVGTextElement, unknown, Element | null, unknown>;
|
|
50
|
+
export type D3TSpanElement = d3.Selection<SVGTSpanElement, unknown, Element | null, unknown>;
|