mermaid 10.3.0 → 10.3.1

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.
Files changed (114) hide show
  1. package/dist/Diagram.d.ts +7 -5
  2. package/dist/{arc-9d741495.js → arc-95120417.js} +1 -1
  3. package/dist/{arc-da8fd8d8.js → arc-e34fbb53.js} +16 -16
  4. package/dist/{c4Diagram-0115bee6.js → c4Diagram-36a13f92.js} +2 -2
  5. package/dist/{c4Diagram-36d27044.js → c4Diagram-4de0d805.js} +1 -1
  6. package/dist/{c4Diagram-1bdb45a8.js → c4Diagram-bd40bc1b.js} +2 -2
  7. package/dist/{classDiagram-5e843ae7.js → classDiagram-0da88708.js} +3 -3
  8. package/dist/{classDiagram-185c1a10.js → classDiagram-b1e5886b.js} +5 -5
  9. package/dist/{classDiagram-819d3ad4.js → classDiagram-ced1f152.js} +5 -5
  10. package/dist/{classDiagram-v2-8c3b3e6a.js → classDiagram-v2-2f4ae322.js} +6 -6
  11. package/dist/{classDiagram-v2-6dc3b9c3.js → classDiagram-v2-b0bf8ef8.js} +8 -8
  12. package/dist/{classDiagram-v2-c4607319.js → classDiagram-v2-eb3281ff.js} +8 -8
  13. package/dist/config.type.d.ts +20 -20
  14. package/dist/{createText-2c3b104b.js → createText-24393182.js} +1 -1
  15. package/dist/{createText-285e50b4.js → createText-b670c180.js} +1 -1
  16. package/dist/{createText-94e3ebbf.js → createText-c64d47ca.js} +1 -1
  17. package/dist/diagram-api/diagramAPI.d.ts +1 -1
  18. package/dist/diagram-api/types.d.ts +11 -4
  19. package/dist/diagrams/error/errorDiagram.d.ts +2 -2
  20. package/dist/diagrams/error/errorRenderer.d.ts +5 -12
  21. package/dist/{edges-df708b89.js → edges-46e4f833.js} +90 -19
  22. package/dist/{edges-558884ee.js → edges-55004f96.js} +331 -269
  23. package/dist/{edges-b00f0ec2.js → edges-c959041a.js} +89 -18
  24. package/dist/{erDiagram-0ccc0425.js → erDiagram-105a1cb2.js} +1 -1
  25. package/dist/{erDiagram-97139f44.js → erDiagram-398a53e9.js} +3 -3
  26. package/dist/{erDiagram-de1b0455.js → erDiagram-7b1a703c.js} +3 -3
  27. package/dist/{flowDb-8f9fc471.js → flowDb-01624e90.js} +224 -169
  28. package/dist/flowDb-03a8f48d.js +1139 -0
  29. package/dist/{flowDb-7a27455c.js → flowDb-a18fdd2a.js} +224 -169
  30. package/dist/{flowDiagram-698c8d5d.js → flowDiagram-42ba8acc.js} +8 -16
  31. package/dist/{flowDiagram-786cd8ff.js → flowDiagram-ca8a3fc0.js} +10 -18
  32. package/dist/{flowDiagram-ccbbb58d.js → flowDiagram-dbf2c5c9.js} +21 -26
  33. package/dist/{flowDiagram-v2-79ccd6da.js → flowDiagram-v2-526e04fc.js} +9 -9
  34. package/dist/{flowDiagram-v2-65161881.js → flowDiagram-v2-60163505.js} +9 -9
  35. package/dist/{flowDiagram-v2-d6437390.js → flowDiagram-v2-e4ef3cbe.js} +7 -7
  36. package/dist/{flowchart-elk-definition-3f2388fe.js → flowchart-elk-definition-64c20dc9.js} +7 -16
  37. package/dist/{flowchart-elk-definition-6f4e6aa0.js → flowchart-elk-definition-8136f426.js} +6 -15
  38. package/dist/{flowchart-elk-definition-7863a61f.js → flowchart-elk-definition-c618ffa4.js} +1052 -1057
  39. package/dist/{ganttDiagram-60845bff.js → ganttDiagram-33119f0c.js} +1 -1
  40. package/dist/{ganttDiagram-f2041c70.js → ganttDiagram-673ab4e4.js} +2 -2
  41. package/dist/{ganttDiagram-3eff0dd8.js → ganttDiagram-bac86b83.js} +2 -2
  42. package/dist/{gitGraphDiagram-5269e1d6.js → gitGraphDiagram-19295f41.js} +1 -1
  43. package/dist/{gitGraphDiagram-a13ae597.js → gitGraphDiagram-1dcba3c4.js} +1 -1
  44. package/dist/{gitGraphDiagram-c3fe571f.js → gitGraphDiagram-e49c3762.js} +1 -1
  45. package/dist/{index-4c4adb72.js → index-892ad7fb.js} +3 -3
  46. package/dist/{index-d0b453e2.js → index-c821dd4c.js} +4 -4
  47. package/dist/{index-4ba10627.js → index-e3189d15.js} +4 -4
  48. package/dist/{infoDiagram-c976a9ed.js → infoDiagram-99aec0e9.js} +7 -20
  49. package/dist/{infoDiagram-9c10eab1.js → infoDiagram-a7376644.js} +65 -72
  50. package/dist/{infoDiagram-3fa6ea12.js → infoDiagram-a91f1f9c.js} +6 -19
  51. package/dist/{journeyDiagram-b6904cec.js → journeyDiagram-4884cc8d.js} +3 -3
  52. package/dist/{journeyDiagram-5120ee2f.js → journeyDiagram-50e783bb.js} +1 -1
  53. package/dist/{journeyDiagram-9f355b40.js → journeyDiagram-ddd7af72.js} +3 -3
  54. package/dist/{layout-c5a37d74.js → layout-2be1671e.js} +1 -1
  55. package/dist/{layout-cc6d5710.js → layout-9d8f8f12.js} +1 -1
  56. package/dist/{line-ce5d1152.js → line-331572f9.js} +1 -1
  57. package/dist/{line-cdadca5f.js → line-b5e58ece.js} +1 -1
  58. package/dist/{linear-db016d0c.js → linear-3f420504.js} +11 -11
  59. package/dist/{linear-32da3f07.js → linear-add80c81.js} +1 -1
  60. package/dist/{mermaid-a98f434b.js → mermaid-306576ad.js} +96 -105
  61. package/dist/{mermaid-42f7bf2b.js → mermaid-7e6c58c3.js} +1442 -1442
  62. package/dist/{mermaid-766fee4c.js → mermaid-a918c5c0.js} +147 -155
  63. package/dist/mermaid.core.mjs +2 -2
  64. package/dist/mermaid.esm.min.mjs +1 -1
  65. package/dist/mermaid.esm.mjs +2 -2
  66. package/dist/mermaid.js +387 -319
  67. package/dist/mermaid.min.js +180 -180
  68. package/dist/{mindmap-definition-35a1e92c.js → mindmap-definition-08eee8ac.js} +2 -2
  69. package/dist/{mindmap-definition-0ab67801.js → mindmap-definition-5f036dbb.js} +2 -2
  70. package/dist/{mindmap-definition-a9d0f378.js → mindmap-definition-dae41a11.js} +2 -2
  71. package/dist/{pieDiagram-6d9582b9.js → pieDiagram-470bd806.js} +2 -2
  72. package/dist/{pieDiagram-5efcb91d.js → pieDiagram-b06a513b.js} +1 -1
  73. package/dist/{pieDiagram-fd367f1f.js → pieDiagram-d415667d.js} +36 -36
  74. package/dist/{quadrantDiagram-559115c7.js → quadrantDiagram-42727e21.js} +1 -1
  75. package/dist/{quadrantDiagram-1763608a.js → quadrantDiagram-f4c13fcb.js} +8 -8
  76. package/dist/{quadrantDiagram-a1c81500.js → quadrantDiagram-f4c7ebd6.js} +2 -2
  77. package/dist/rendering-util/selectSvgElement.d.ts +8 -0
  78. package/dist/{requirementDiagram-3256a2fe.js → requirementDiagram-3039623f.js} +3 -3
  79. package/dist/{requirementDiagram-779d93b3.js → requirementDiagram-51520602.js} +3 -3
  80. package/dist/{requirementDiagram-b2d6a344.js → requirementDiagram-96e78f61.js} +1 -1
  81. package/dist/{sankeyDiagram-ebb0d63f.js → sankeyDiagram-41ed250a.js} +1 -1
  82. package/dist/{sankeyDiagram-e679478d.js → sankeyDiagram-91977475.js} +1 -1
  83. package/dist/{sankeyDiagram-86a66bae.js → sankeyDiagram-fedc6f27.js} +1 -1
  84. package/dist/{sequenceDiagram-583eee82.js → sequenceDiagram-342ef5c4.js} +1 -3
  85. package/dist/{sequenceDiagram-25152a15.js → sequenceDiagram-80aafbb8.js} +2 -4
  86. package/dist/{sequenceDiagram-169f11ec.js → sequenceDiagram-adea57f6.js} +3 -3
  87. package/dist/setupGraphViewbox.d.ts +2 -1
  88. package/dist/{stateDiagram-b1c07dc6.js → stateDiagram-3ac8af33.js} +2 -2
  89. package/dist/{stateDiagram-6f4bb19d.js → stateDiagram-949ae5f7.js} +4 -4
  90. package/dist/{stateDiagram-693ac5fb.js → stateDiagram-fa6ef012.js} +4 -4
  91. package/dist/stateDiagram-v2-2efec10d.js +189 -0
  92. package/dist/{stateDiagram-v2-8f2bb0da.js → stateDiagram-v2-ba87491d.js} +10 -17
  93. package/dist/{stateDiagram-v2-7c93469e.js → stateDiagram-v2-ca22f0dc.js} +8 -15
  94. package/dist/{styles-f626f8de.js → styles-1e36f090.js} +1 -1
  95. package/dist/{styles-f19653ad.js → styles-4f00232b.js} +1 -1
  96. package/dist/{styles-ff678862.js → styles-4fcf332f.js} +3 -14
  97. package/dist/{styles-8ef4cf23.js → styles-5664cd4f.js} +4 -15
  98. package/dist/{styles-3fb7b9cf.js → styles-7b411ea5.js} +1 -1
  99. package/dist/{styles-659d7242.js → styles-7cb29b29.js} +1 -1
  100. package/dist/{styles-3814544c.js → styles-cb6bcb55.js} +81 -87
  101. package/dist/{styles-88ad4441.js → styles-d0b2ab71.js} +1 -1
  102. package/dist/{styles-68f7452d.js → styles-d22f4783.js} +1 -1
  103. package/dist/{svgDraw-af99a425.js → svgDraw-3570afd5.js} +2 -2
  104. package/dist/{svgDraw-5d8a058e.js → svgDraw-b48a99d5.js} +1 -1
  105. package/dist/{svgDraw-f57324fe.js → svgDraw-d3f2a258.js} +2 -2
  106. package/dist/{svgDrawCommon-ebe6c236.js → svgDrawCommon-35739f2d.js} +1 -1
  107. package/dist/{svgDrawCommon-ce5062a7.js → svgDrawCommon-703c6069.js} +1 -1
  108. package/dist/{timeline-definition-65183566.js → timeline-definition-a91b186e.js} +2 -2
  109. package/dist/{timeline-definition-491ea63c.js → timeline-definition-cbf43e70.js} +1 -1
  110. package/dist/{timeline-definition-0c903a0d.js → timeline-definition-df0f8466.js} +2 -2
  111. package/package.json +4 -3
  112. package/dist/diagrams/error/styles.d.ts +0 -2
  113. package/dist/flowDb-a4faf166.js +0 -1119
  114. package/dist/stateDiagram-v2-d72c79bd.js +0 -194
package/dist/Diagram.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { DetailedError } from './utils.js';
1
+ import type { DetailedError } from './utils.js';
2
+ import type { DiagramDefinition } from './diagram-api/types.js';
2
3
  export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;
3
4
  /**
4
5
  * An object representing a parsed mermaid diagram definition.
@@ -7,14 +8,15 @@ export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?:
7
8
  export declare class Diagram {
8
9
  text: string;
9
10
  type: string;
10
- parser: any;
11
- renderer: any;
12
- db: import("./diagram-api/types.js").DiagramDB;
11
+ parser: DiagramDefinition['parser'];
12
+ renderer: DiagramDefinition['renderer'];
13
+ db: DiagramDefinition['db'];
14
+ private init?;
13
15
  private detectError?;
14
16
  constructor(text: string);
15
17
  parse(): void;
16
18
  render(id: string, version: string): Promise<void>;
17
- getParser(): any;
19
+ getParser(): import("./diagram-api/types.js").ParserDefinition;
18
20
  getType(): string;
19
21
  }
20
22
  /**
@@ -1,5 +1,5 @@
1
1
  import { c as constant, p as path } from "./constant-b644328d.js";
2
- import { aC as halfPi, aD as epsilon, V as tau, aE as cos, aF as sin, aG as sqrt, aH as min, aI as abs, aJ as pi, aK as atan2, aL as asin, aM as acos, aN as max } from "./mermaid-766fee4c.js";
2
+ import { aD as halfPi, aE as epsilon, W as tau, aF as cos, aG as sin, aH as sqrt, aI as min, aJ as abs, aK as pi, aL as atan2, aM as asin, aN as acos, aO as max } from "./mermaid-a918c5c0.js";
3
3
  function arcInnerRadius(d) {
4
4
  return d.innerRadius;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { c as J, p as sn } from "./constant-2fe7eae5.js";
2
- import { aC as en, aD as y, V as ln, aE as N, aF as D, aG as V, aH as b, aI as an, aJ as rn, aK as t, aL as un, aM as on, aN as tn } from "./mermaid-42f7bf2b.js";
2
+ import { aD as en, aE as y, W as ln, aF as N, aG as D, aH as j, aI as b, aJ as an, aK as rn, aL as t, aM as un, aN as on, aO as tn } from "./mermaid-7e6c58c3.js";
3
3
  function fn(l) {
4
4
  return l.innerRadius;
5
5
  }
@@ -15,13 +15,13 @@ function gn(l) {
15
15
  function mn(l) {
16
16
  return l && l.padAngle;
17
17
  }
18
- function pn(l, x, q, E, h, v, K, a) {
19
- var s = q - l, n = E - x, m = K - h, i = a - v, r = i * s - m * n;
18
+ function pn(l, x, O, E, h, v, K, a) {
19
+ var s = O - l, n = E - x, m = K - h, i = a - v, r = i * s - m * n;
20
20
  if (!(r * r < y))
21
21
  return r = (m * (x - v) - i * (l - h)) / r, [l + r * s, x + r * n];
22
22
  }
23
- function U(l, x, q, E, h, v, K) {
24
- var a = l - q, s = x - E, n = (K ? v : -v) / V(a * a + s * s), m = n * s, i = -n * a, r = l + m, f = x + i, c = q + m, w = E + i, o = (r + c) / 2, C = (f + w) / 2, p = c - r, g = w - f, A = p * p + g * g, F = h - v, P = r * w - c * f, G = (g < 0 ? -1 : 1) * V(tn(0, F * F * A - P * P)), H = (P * g - p * G) / A, d = (-P * p - g * G) / A, R = (P * g + p * G) / A, T = (-P * p + g * G) / A, e = H - o, u = d - C, L = R - o, M = T - C;
23
+ function U(l, x, O, E, h, v, K) {
24
+ var a = l - O, s = x - E, n = (K ? v : -v) / j(a * a + s * s), m = n * s, i = -n * a, r = l + m, f = x + i, c = O + m, q = E + i, o = (r + c) / 2, w = (f + q) / 2, p = c - r, g = q - f, A = p * p + g * g, F = h - v, P = r * q - c * f, G = (g < 0 ? -1 : 1) * j(tn(0, F * F * A - P * P)), H = (P * g - p * G) / A, d = (-P * p - g * G) / A, R = (P * g + p * G) / A, T = (-P * p + g * G) / A, e = H - o, u = d - w, L = R - o, M = T - w;
25
25
  return e * e + u * u > L * L + M * M && (H = R, d = T), {
26
26
  cx: H,
27
27
  cy: d,
@@ -32,28 +32,28 @@ function U(l, x, q, E, h, v, K) {
32
32
  };
33
33
  }
34
34
  function hn() {
35
- var l = fn, x = cn, q = J(0), E = null, h = yn, v = gn, K = mn, a = null;
35
+ var l = fn, x = cn, O = J(0), E = null, h = yn, v = gn, K = mn, a = null;
36
36
  function s() {
37
- var n, m, i = +l.apply(this, arguments), r = +x.apply(this, arguments), f = h.apply(this, arguments) - en, c = v.apply(this, arguments) - en, w = an(c - f), o = c > f;
37
+ var n, m, i = +l.apply(this, arguments), r = +x.apply(this, arguments), f = h.apply(this, arguments) - en, c = v.apply(this, arguments) - en, q = an(c - f), o = c > f;
38
38
  if (a || (a = n = sn()), r < i && (m = r, r = i, i = m), !(r > y))
39
39
  a.moveTo(0, 0);
40
- else if (w > ln - y)
40
+ else if (q > ln - y)
41
41
  a.moveTo(r * N(f), r * D(f)), a.arc(0, 0, r, f, c, !o), i > y && (a.moveTo(i * N(c), i * D(c)), a.arc(0, 0, i, c, f, o));
42
42
  else {
43
- var C = f, p = c, g = f, A = c, F = w, P = w, G = K.apply(this, arguments) / 2, H = G > y && (E ? +E.apply(this, arguments) : V(i * i + r * r)), d = b(an(r - i) / 2, +q.apply(this, arguments)), R = d, T = d, e, u;
43
+ var w = f, p = c, g = f, A = c, F = q, P = q, G = K.apply(this, arguments) / 2, H = G > y && (E ? +E.apply(this, arguments) : j(i * i + r * r)), d = b(an(r - i) / 2, +O.apply(this, arguments)), R = d, T = d, e, u;
44
44
  if (H > y) {
45
45
  var L = un(H / i * D(G)), M = un(H / r * D(G));
46
- (F -= L * 2) > y ? (L *= o ? 1 : -1, g += L, A -= L) : (F = 0, g = A = (f + c) / 2), (P -= M * 2) > y ? (M *= o ? 1 : -1, C += M, p -= M) : (P = 0, C = p = (f + c) / 2);
46
+ (F -= L * 2) > y ? (L *= o ? 1 : -1, g += L, A -= L) : (F = 0, g = A = (f + c) / 2), (P -= M * 2) > y ? (M *= o ? 1 : -1, w += M, p -= M) : (P = 0, w = p = (f + c) / 2);
47
47
  }
48
- var O = r * N(C), S = r * D(C), j = i * N(A), z = i * D(A);
48
+ var S = r * N(w), W = r * D(w), z = i * N(A), B = i * D(A);
49
49
  if (d > y) {
50
- var B = r * N(p), Q = r * D(p), W = i * N(g), X = i * D(g), I;
51
- if (w < rn && (I = pn(O, S, W, X, B, Q, j, z))) {
52
- var Y = O - I[0], Z = S - I[1], $ = B - I[0], k = Q - I[1], _ = 1 / D(on((Y * $ + Z * k) / (V(Y * Y + Z * Z) * V($ * $ + k * k))) / 2), nn = V(I[0] * I[0] + I[1] * I[1]);
50
+ var C = r * N(p), Q = r * D(p), V = i * N(g), X = i * D(g), I;
51
+ if (q < rn && (I = pn(S, W, V, X, C, Q, z, B))) {
52
+ var Y = S - I[0], Z = W - I[1], $ = C - I[0], k = Q - I[1], _ = 1 / D(on((Y * $ + Z * k) / (j(Y * Y + Z * Z) * j($ * $ + k * k))) / 2), nn = j(I[0] * I[0] + I[1] * I[1]);
53
53
  R = b(d, (i - nn) / (_ - 1)), T = b(d, (r - nn) / (_ + 1));
54
54
  }
55
55
  }
56
- P > y ? T > y ? (e = U(W, X, O, S, r, T, o), u = U(B, Q, j, z, r, T, o), a.moveTo(e.cx + e.x01, e.cy + e.y01), T < d ? a.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, r, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), !o), a.arc(u.cx, u.cy, T, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : (a.moveTo(O, S), a.arc(0, 0, r, C, p, !o)) : a.moveTo(O, S), !(i > y) || !(F > y) ? a.lineTo(j, z) : R > y ? (e = U(j, z, B, Q, i, -R, o), u = U(O, S, W, X, i, -R, o), a.lineTo(e.cx + e.x01, e.cy + e.y01), R < d ? a.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, i, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), o), a.arc(u.cx, u.cy, R, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : a.arc(0, 0, i, A, g, o);
56
+ P > y ? T > y ? (e = U(V, X, S, W, r, T, o), u = U(C, Q, z, B, r, T, o), a.moveTo(e.cx + e.x01, e.cy + e.y01), T < d ? a.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, r, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), !o), a.arc(u.cx, u.cy, T, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : (a.moveTo(S, W), a.arc(0, 0, r, w, p, !o)) : a.moveTo(S, W), !(i > y) || !(F > y) ? a.lineTo(z, B) : R > y ? (e = U(z, B, C, Q, i, -R, o), u = U(S, W, V, X, i, -R, o), a.lineTo(e.cx + e.x01, e.cy + e.y01), R < d ? a.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(u.y01, u.x01), !o) : (a.arc(e.cx, e.cy, R, t(e.y01, e.x01), t(e.y11, e.x11), !o), a.arc(0, 0, i, t(e.cy + e.y11, e.cx + e.x11), t(u.cy + u.y11, u.cx + u.x11), o), a.arc(u.cx, u.cy, R, t(u.y11, u.x11), t(u.y01, u.x01), !o))) : a.arc(0, 0, i, A, g, o);
57
57
  }
58
58
  if (a.closePath(), n)
59
59
  return a = null, n + "" || null;
@@ -66,7 +66,7 @@ function hn() {
66
66
  }, s.outerRadius = function(n) {
67
67
  return arguments.length ? (x = typeof n == "function" ? n : J(+n), s) : x;
68
68
  }, s.cornerRadius = function(n) {
69
- return arguments.length ? (q = typeof n == "function" ? n : J(+n), s) : q;
69
+ return arguments.length ? (O = typeof n == "function" ? n : J(+n), s) : O;
70
70
  }, s.padRadius = function(n) {
71
71
  return arguments.length ? (E = n == null ? null : typeof n == "function" ? n : J(+n), s) : E;
72
72
  }, s.startAngle = function(n) {
@@ -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-766fee4c.js";
2
- import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-ce5062a7.js";
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-a918c5c0.js";
2
+ import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-703c6069.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,4 +1,4 @@
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-a98f434b.js";
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-306576ad.js";
2
2
  import { select } from "d3";
3
3
  import { d as drawRect$1, g as getNoteRect } from "./svgDrawCommon-f26cad39.js";
4
4
  import { sanitizeUrl } from "@braintree/sanitize-url";
@@ -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-42f7bf2b.js";
2
- import { d as Qe, g as He } from "./svgDrawCommon-ebe6c236.js";
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-7e6c58c3.js";
2
+ import { d as Qe, g as He } from "./svgDrawCommon-35739f2d.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,9 +1,9 @@
1
- import { p as parser, d as db, s as styles } from "./styles-88ad4441.js";
1
+ import { p as parser, d as db, s as styles } from "./styles-d0b2ab71.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-a98f434b.js";
6
- import { s as svgDraw } from "./svgDraw-5d8a058e.js";
5
+ import { c as getConfig, l as log, i as configureSvgSize } from "./mermaid-306576ad.js";
6
+ import { s as svgDraw } from "./svgDraw-b48a99d5.js";
7
7
  import "ts-dedent";
8
8
  import "dayjs";
9
9
  import "@braintree/sanitize-url";
@@ -1,8 +1,8 @@
1
- import { p as W, d as M, s as H } from "./styles-659d7242.js";
2
- import { c as S, l as d, j as m, k as X } from "./mermaid-42f7bf2b.js";
3
- import { G as Y, l as Z } from "./layout-c5a37d74.js";
4
- import { s as l } from "./svgDraw-af99a425.js";
5
- import "./line-ce5d1152.js";
1
+ import { p as W, d as M, s as H } from "./styles-7cb29b29.js";
2
+ import { c as S, l as d, j as m, k as X } from "./mermaid-7e6c58c3.js";
3
+ import { G as Y, l as Z } from "./layout-2be1671e.js";
4
+ import { s as l } from "./svgDraw-3570afd5.js";
5
+ import "./line-331572f9.js";
6
6
  import "./array-2ff2c7a6.js";
7
7
  import "./constant-2fe7eae5.js";
8
8
  let h = {};
@@ -1,8 +1,8 @@
1
- import { p as parser, d as db, s as styles } from "./styles-68f7452d.js";
2
- import { c as getConfig, l as log, j as d3select, k as configureSvgSize } from "./mermaid-766fee4c.js";
3
- import { G as Graph, l as layout } from "./layout-cc6d5710.js";
4
- import { s as svgDraw } from "./svgDraw-f57324fe.js";
5
- import "./line-cdadca5f.js";
1
+ import { p as parser, d as db, s as styles } from "./styles-d22f4783.js";
2
+ import { c as getConfig, l as log, j as d3select, k as configureSvgSize } from "./mermaid-a918c5c0.js";
3
+ import { G as Graph, l as layout } from "./layout-9d8f8f12.js";
4
+ import { s as svgDraw } from "./svgDraw-d3f2a258.js";
5
+ import "./line-b5e58ece.js";
6
6
  import "./array-b7dcf730.js";
7
7
  import "./constant-b644328d.js";
8
8
  let idCache = {};
@@ -1,8 +1,8 @@
1
- import { p as parser, d as db, s as styles } from "./styles-88ad4441.js";
1
+ import { p as parser, d as db, s as styles } from "./styles-d0b2ab71.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-a98f434b.js";
5
- import { r as render } from "./index-4c4adb72.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-306576ad.js";
5
+ import { r as render } from "./index-892ad7fb.js";
6
6
  import "ts-dedent";
7
7
  import "dayjs";
8
8
  import "@braintree/sanitize-url";
@@ -13,10 +13,10 @@ import "stylis";
13
13
  import "lodash-es/isEmpty.js";
14
14
  import "dagre-d3-es/src/dagre/index.js";
15
15
  import "dagre-d3-es/src/graphlib/json.js";
16
- import "./edges-b00f0ec2.js";
17
- import "./createText-285e50b4.js";
16
+ import "./edges-c959041a.js";
17
+ import "./createText-b670c180.js";
18
18
  import "mdast-util-from-markdown";
19
- import "./svgDraw-5d8a058e.js";
19
+ import "./svgDraw-b48a99d5.js";
20
20
  const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
21
21
  let conf = {
22
22
  dividerMargin: 10,
@@ -1,11 +1,11 @@
1
- import { p as R, d as N, s as B } from "./styles-659d7242.js";
2
- import { l as c, c as r, j as k, z as G, t as _, r as E, o as C, p as z, f as A } from "./mermaid-42f7bf2b.js";
3
- import { G as P } from "./layout-c5a37d74.js";
4
- import { r as $ } from "./index-d0b453e2.js";
5
- import "./edges-558884ee.js";
6
- import "./createText-94e3ebbf.js";
7
- import "./svgDraw-af99a425.js";
8
- import "./line-ce5d1152.js";
1
+ import { p as R, d as N, s as B } from "./styles-7cb29b29.js";
2
+ import { l as c, c as r, j as k, z as G, t as _, r as E, o as C, p as z, f as A } from "./mermaid-7e6c58c3.js";
3
+ import { G as P } from "./layout-2be1671e.js";
4
+ import { r as $ } from "./index-c821dd4c.js";
5
+ import "./edges-55004f96.js";
6
+ import "./createText-c64d47ca.js";
7
+ import "./svgDraw-3570afd5.js";
8
+ import "./line-331572f9.js";
9
9
  import "./array-2ff2c7a6.js";
10
10
  import "./constant-2fe7eae5.js";
11
11
  const S = (o) => A.sanitizeText(o, r());
@@ -1,11 +1,11 @@
1
- import { p as parser, d as db, s as styles } from "./styles-68f7452d.js";
2
- import { l as log, c as getConfig, j as d3select, z as utils, t as setupGraphViewbox, r as interpolateToCurve, o as curveLinear, p as getStylesFromArray, f as common } from "./mermaid-766fee4c.js";
3
- import { G as Graph } from "./layout-cc6d5710.js";
4
- import { r as render } from "./index-4ba10627.js";
5
- import "./edges-df708b89.js";
6
- import "./createText-2c3b104b.js";
7
- import "./svgDraw-f57324fe.js";
8
- import "./line-cdadca5f.js";
1
+ import { p as parser, d as db, s as styles } from "./styles-d22f4783.js";
2
+ import { l as log, c as getConfig, j as d3select, z as utils, t as setupGraphViewbox, r as interpolateToCurve, o as curveLinear, p as getStylesFromArray, f as common } from "./mermaid-a918c5c0.js";
3
+ import { G as Graph } from "./layout-9d8f8f12.js";
4
+ import { r as render } from "./index-e3189d15.js";
5
+ import "./edges-46e4f833.js";
6
+ import "./createText-24393182.js";
7
+ import "./svgDraw-d3f2a258.js";
8
+ import "./line-b5e58ece.js";
9
9
  import "./array-b7dcf730.js";
10
10
  import "./constant-b644328d.js";
11
11
  const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * Configuration options to pass to the `dompurify` library.
8
8
  */
9
- export type DOMPurifyConfiguration = import("dompurify").Config;
9
+ export type DOMPurifyConfiguration = import('dompurify').Config;
10
10
  /**
11
11
  * JavaScript function that returns a `FontConfig`.
12
12
  *
@@ -37,7 +37,7 @@ export type FontCalculator = () => Partial<FontConfig>;
37
37
  * This interface was referenced by `MermaidConfig`'s JSON-Schema
38
38
  * via the `definition` "SankeyLinkColor".
39
39
  */
40
- export type SankeyLinkColor = "source" | "target" | "gradient";
40
+ export type SankeyLinkColor = 'source' | 'target' | 'gradient';
41
41
  /**
42
42
  * Controls the alignment of the Sankey diagrams.
43
43
  *
@@ -47,7 +47,7 @@ export type SankeyLinkColor = "source" | "target" | "gradient";
47
47
  * This interface was referenced by `MermaidConfig`'s JSON-Schema
48
48
  * via the `definition` "SankeyNodeAlignment".
49
49
  */
50
- export type SankeyNodeAlignment = "left" | "right" | "center" | "justify";
50
+ export type SankeyNodeAlignment = 'left' | 'right' | 'center' | 'justify';
51
51
  /**
52
52
  * The font size to use
53
53
  */
@@ -58,7 +58,7 @@ export interface MermaidConfig {
58
58
  * You may also use `themeCSS` to override this value.
59
59
  *
60
60
  */
61
- theme?: string | "default" | "forest" | "dark" | "neutral" | "null";
61
+ theme?: string | 'default' | 'forest' | 'dark' | 'neutral' | 'null';
62
62
  themeVariables?: any;
63
63
  themeCSS?: string;
64
64
  /**
@@ -79,11 +79,11 @@ export interface MermaidConfig {
79
79
  * This option decides the amount of logging to be used by mermaid.
80
80
  *
81
81
  */
82
- logLevel?: number | string | 0 | 2 | 1 | "trace" | "debug" | "info" | "warn" | "error" | "fatal" | 3 | 4 | 5 | undefined;
82
+ logLevel?: number | string | 0 | 2 | 1 | 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' | 3 | 4 | 5 | undefined;
83
83
  /**
84
84
  * Level of trust for parsed diagram
85
85
  */
86
- securityLevel?: string | "strict" | "loose" | "antiscript" | "sandbox" | undefined;
86
+ securityLevel?: string | 'strict' | 'loose' | 'antiscript' | 'sandbox' | undefined;
87
87
  /**
88
88
  * Dictates whether mermaid starts on Page load
89
89
  */
@@ -671,11 +671,11 @@ export interface QuadrantChartConfig extends BaseDiagramConfig {
671
671
  /**
672
672
  * position of x-axis labels
673
673
  */
674
- xAxisPosition?: "top" | "bottom";
674
+ xAxisPosition?: 'top' | 'bottom';
675
675
  /**
676
676
  * position of y-axis labels
677
677
  */
678
- yAxisPosition?: "left" | "right";
678
+ yAxisPosition?: 'left' | 'right';
679
679
  /**
680
680
  * stroke width of edges of the box that are inside the quadrant
681
681
  */
@@ -705,7 +705,7 @@ export interface ErDiagramConfig extends BaseDiagramConfig {
705
705
  /**
706
706
  * Directional bias for layout of entities
707
707
  */
708
- layoutDirection?: string | "TB" | "BT" | "LR" | "RL";
708
+ layoutDirection?: string | 'TB' | 'BT' | 'LR' | 'RL';
709
709
  /**
710
710
  * The minimum width of an entity box. Expressed in pixels.
711
711
  */
@@ -770,7 +770,7 @@ export interface StateDiagramConfig extends BaseDiagramConfig {
770
770
  * Decides which rendering engine that is to be used for the rendering.
771
771
  *
772
772
  */
773
- defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
773
+ defaultRenderer?: string | 'dagre-d3' | 'dagre-wrapper' | 'elk';
774
774
  }
775
775
  /**
776
776
  * This interface was referenced by `MermaidConfig`'s JSON-Schema
@@ -794,7 +794,7 @@ export interface ClassDiagramConfig extends BaseDiagramConfig {
794
794
  * Decides which rendering engine that is to be used for the rendering.
795
795
  *
796
796
  */
797
- defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
797
+ defaultRenderer?: string | 'dagre-d3' | 'dagre-wrapper' | 'elk';
798
798
  nodeSpacing?: number;
799
799
  rankSpacing?: number;
800
800
  /**
@@ -854,7 +854,7 @@ export interface JourneyDiagramConfig extends BaseDiagramConfig {
854
854
  /**
855
855
  * Multiline message alignment
856
856
  */
857
- messageAlign?: string | "left" | "center" | "right";
857
+ messageAlign?: string | 'left' | 'center' | 'right';
858
858
  /**
859
859
  * Prolongs the edge of the diagram downwards.
860
860
  *
@@ -933,7 +933,7 @@ export interface TimelineDiagramConfig extends BaseDiagramConfig {
933
933
  /**
934
934
  * Multiline message alignment
935
935
  */
936
- messageAlign?: string | "left" | "center" | "right";
936
+ messageAlign?: string | 'left' | 'center' | 'right';
937
937
  /**
938
938
  * Prolongs the edge of the diagram downwards.
939
939
  *
@@ -1044,12 +1044,12 @@ export interface GanttDiagramConfig extends BaseDiagramConfig {
1044
1044
  * Controls the display mode.
1045
1045
  *
1046
1046
  */
1047
- displayMode?: string | "compact";
1047
+ displayMode?: string | 'compact';
1048
1048
  /**
1049
1049
  * On which day a week-based interval should start
1050
1050
  *
1051
1051
  */
1052
- weekday?: "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
1052
+ weekday?: 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
1053
1053
  }
1054
1054
  /**
1055
1055
  * The object containing configurations specific for sequence diagrams
@@ -1103,7 +1103,7 @@ export interface SequenceDiagramConfig extends BaseDiagramConfig {
1103
1103
  /**
1104
1104
  * Multiline message alignment
1105
1105
  */
1106
- messageAlign?: string | "left" | "center" | "right";
1106
+ messageAlign?: string | 'left' | 'center' | 'right';
1107
1107
  /**
1108
1108
  * Mirror actors under diagram
1109
1109
  *
@@ -1160,7 +1160,7 @@ export interface SequenceDiagramConfig extends BaseDiagramConfig {
1160
1160
  /**
1161
1161
  * This sets the text alignment of actor-attached notes
1162
1162
  */
1163
- noteAlign?: string | "left" | "center" | "right";
1163
+ noteAlign?: string | 'left' | 'center' | 'right';
1164
1164
  /**
1165
1165
  * This sets the font size of actor messages
1166
1166
  */
@@ -1236,7 +1236,7 @@ export interface FlowchartDiagramConfig extends BaseDiagramConfig {
1236
1236
  * Defines how mermaid renders curves for flowcharts.
1237
1237
  *
1238
1238
  */
1239
- curve?: string | "basis" | "linear" | "cardinal";
1239
+ curve?: string | 'basis' | 'linear' | 'cardinal';
1240
1240
  /**
1241
1241
  * Represents the padding between the labels and the shape
1242
1242
  *
@@ -1248,7 +1248,7 @@ export interface FlowchartDiagramConfig extends BaseDiagramConfig {
1248
1248
  * Decides which rendering engine that is to be used for the rendering.
1249
1249
  *
1250
1250
  */
1251
- defaultRenderer?: string | "dagre-d3" | "dagre-wrapper" | "elk";
1251
+ defaultRenderer?: string | 'dagre-d3' | 'dagre-wrapper' | 'elk';
1252
1252
  /**
1253
1253
  * Width of nodes where text is wrapped.
1254
1254
  *
@@ -1278,7 +1278,7 @@ export interface SankeyDiagramConfig extends BaseDiagramConfig {
1278
1278
  * See <https://github.com/d3/d3-sankey#alignments>.
1279
1279
  *
1280
1280
  */
1281
- nodeAlignment?: "left" | "right" | "center" | "justify";
1281
+ nodeAlignment?: 'left' | 'right' | 'center' | 'justify';
1282
1282
  useMaxWidth?: boolean;
1283
1283
  }
1284
1284
  /**
@@ -1,4 +1,4 @@
1
- import { aO as dedent, l as log, aw as decodeEntities } from "./mermaid-766fee4c.js";
1
+ import { aP as dedent, l as log, ax as decodeEntities } from "./mermaid-a918c5c0.js";
2
2
  function toString(node, options) {
3
3
  var { includeImageAlt = true } = options || {};
4
4
  return one(node, includeImageAlt);
@@ -1,4 +1,4 @@
1
- import { l as log, H as decodeEntities } from "./mermaid-a98f434b.js";
1
+ import { l as log, I as decodeEntities } from "./mermaid-306576ad.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 { aO as At, l as zt, aw as It } from "./mermaid-42f7bf2b.js";
1
+ import { aP as At, l as zt, ax as It } from "./mermaid-7e6c58c3.js";
2
2
  function Tt(n, r) {
3
3
  var { includeImageAlt: t = !0 } = r || {};
4
4
  return nt(n, t);
@@ -25,5 +25,5 @@ export interface Detectors {
25
25
  export declare const registerDiagram: (id: string, diagram: DiagramDefinition, detector?: DiagramDetector) => void;
26
26
  export declare const getDiagram: (name: string) => DiagramDefinition;
27
27
  export declare class DiagramNotFoundError extends Error {
28
- constructor(message: string);
28
+ constructor(name: string);
29
29
  }
@@ -1,5 +1,5 @@
1
1
  import { Diagram } from '../Diagram.js';
2
- import { MermaidConfig } from '../config.type.js';
2
+ import type { MermaidConfig } from '../config.type.js';
3
3
  import type * as d3 from 'd3';
4
4
  export interface InjectUtils {
5
5
  _log: any;
@@ -24,7 +24,7 @@ export interface DiagramDB {
24
24
  export interface DiagramDefinition {
25
25
  db: DiagramDB;
26
26
  renderer: any;
27
- parser: any;
27
+ parser: ParserDefinition;
28
28
  styles?: any;
29
29
  init?: (config: MermaidConfig) => void;
30
30
  injectUtils?: (_log: InjectUtils['_log'], _setLogLevel: InjectUtils['_setLogLevel'], _getConfig: InjectUtils['_getConfig'], _sanitizeText: InjectUtils['_sanitizeText'], _setupGraphViewbox: InjectUtils['_setupGraphViewbox'], _commonDb: InjectUtils['_commonDb'], _parseDirective: InjectUtils['_parseDirective']) => void;
@@ -52,6 +52,12 @@ export type DiagramLoader = () => Promise<{
52
52
  * @param diagramObject - A standard diagram containing the DB and the text and type etc of the diagram.
53
53
  */
54
54
  export type DrawDefinition = (text: string, id: string, version: string, diagramObject: Diagram) => void;
55
+ export interface ParserDefinition {
56
+ parse: (text: string) => void;
57
+ parser: {
58
+ yy: DiagramDB;
59
+ };
60
+ }
55
61
  /**
56
62
  * Type for function parse directive from diagram code.
57
63
  *
@@ -60,6 +66,7 @@ export type DrawDefinition = (text: string, id: string, version: string, diagram
60
66
  * @param type -
61
67
  */
62
68
  export type ParseDirectiveDefinition = (statement: string, context: string, type: string) => void;
63
- export type HTML = d3.Selection<HTMLIFrameElement, unknown, Element, unknown>;
64
- export type SVG = d3.Selection<SVGSVGElement, unknown, Element, unknown>;
69
+ export type HTML = d3.Selection<HTMLIFrameElement, unknown, Element | null, unknown>;
70
+ export type SVG = d3.Selection<SVGSVGElement, unknown, Element | null, unknown>;
71
+ export type Group = d3.Selection<SVGGElement, unknown, Element | null, unknown>;
65
72
  export type DiagramStylesProvider = (options?: any) => string;
@@ -1,3 +1,3 @@
1
- import { DiagramDefinition } from '../../diagram-api/types.js';
2
- export declare const diagram: DiagramDefinition;
1
+ import type { DiagramDefinition } from '../../diagram-api/types.js';
2
+ declare const diagram: DiagramDefinition;
3
3
  export default diagram;
@@ -1,19 +1,12 @@
1
- /**
2
- * Merges the value of `conf` with the passed `cnf`
3
- *
4
- * @param cnf - Config to merge
5
- */
6
- export declare const setConf: () => void;
7
1
  /**
8
2
  * Draws a an info picture in the tag with id: id based on the graph definition in text.
9
3
  *
10
4
  * @param _text - Mermaid graph definition.
11
5
  * @param id - The text for the error
12
- * @param mermaidVersion - The version
6
+ * @param version - The version
13
7
  */
14
- export declare const draw: (_text: string, id: string, mermaidVersion: string) => void;
15
- declare const _default: {
16
- setConf: () => void;
17
- draw: (_text: string, id: string, mermaidVersion: string) => void;
8
+ export declare const draw: (_text: string, id: string, version: string) => void;
9
+ export declare const renderer: {
10
+ draw: (_text: string, id: string, version: string) => void;
18
11
  };
19
- export default _default;
12
+ export default renderer;