schematex 0.3.0 → 0.3.3

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 (186) hide show
  1. package/dist/ai/ai-sdk.cjs +25 -25
  2. package/dist/ai/ai-sdk.d.cts +1 -1
  3. package/dist/ai/ai-sdk.d.ts +1 -1
  4. package/dist/ai/ai-sdk.js +20 -20
  5. package/dist/ai/index.cjs +28 -28
  6. package/dist/ai/index.d.cts +1 -1
  7. package/dist/ai/index.d.ts +1 -1
  8. package/dist/ai/index.js +20 -20
  9. package/dist/browser.cjs +22 -22
  10. package/dist/browser.js +20 -20
  11. package/dist/{chunk-HDKDQAEQ.cjs → chunk-3WNW5Y7P.cjs} +54 -2
  12. package/dist/chunk-3WNW5Y7P.cjs.map +1 -0
  13. package/dist/{chunk-B6INLQBU.cjs → chunk-55UEHL57.cjs} +46 -46
  14. package/dist/{chunk-B6INLQBU.cjs.map → chunk-55UEHL57.cjs.map} +1 -1
  15. package/dist/{chunk-JDTB7IKL.js → chunk-5U2W3HQA.js} +3 -3
  16. package/dist/{chunk-JDTB7IKL.js.map → chunk-5U2W3HQA.js.map} +1 -1
  17. package/dist/{chunk-ULYRO2KY.cjs → chunk-5UCXMYE7.cjs} +44 -44
  18. package/dist/{chunk-ULYRO2KY.cjs.map → chunk-5UCXMYE7.cjs.map} +1 -1
  19. package/dist/{chunk-UGCUNADI.js → chunk-66XQBGX7.js} +35 -16
  20. package/dist/chunk-66XQBGX7.js.map +1 -0
  21. package/dist/{chunk-45KP67RR.js → chunk-6TIN33CA.js} +5 -5
  22. package/dist/chunk-6TIN33CA.js.map +1 -0
  23. package/dist/{chunk-NNU4RGT3.js → chunk-6YUP3QMA.js} +39 -27
  24. package/dist/chunk-6YUP3QMA.js.map +1 -0
  25. package/dist/{chunk-COLTVQWR.cjs → chunk-7EWFVNYD.cjs} +25 -25
  26. package/dist/{chunk-COLTVQWR.cjs.map → chunk-7EWFVNYD.cjs.map} +1 -1
  27. package/dist/{chunk-RP5UATRA.js → chunk-AC3XH3LB.js} +4 -4
  28. package/dist/{chunk-RP5UATRA.js.map → chunk-AC3XH3LB.js.map} +1 -1
  29. package/dist/{chunk-XTATRNUN.cjs → chunk-APV4AWQ5.cjs} +442 -430
  30. package/dist/chunk-APV4AWQ5.cjs.map +1 -0
  31. package/dist/{chunk-NZH4GWE6.cjs → chunk-AVIKQZSX.cjs} +37 -37
  32. package/dist/{chunk-NZH4GWE6.cjs.map → chunk-AVIKQZSX.cjs.map} +1 -1
  33. package/dist/{chunk-X7RPFTTR.cjs → chunk-CWZKP3CJ.cjs} +26 -26
  34. package/dist/{chunk-X7RPFTTR.cjs.map → chunk-CWZKP3CJ.cjs.map} +1 -1
  35. package/dist/{chunk-TYCHEOQX.js → chunk-FIVUMDLF.js} +49 -24
  36. package/dist/chunk-FIVUMDLF.js.map +1 -0
  37. package/dist/{chunk-DNZFOCV7.js → chunk-FO7BLCEW.js} +3 -3
  38. package/dist/{chunk-DNZFOCV7.js.map → chunk-FO7BLCEW.js.map} +1 -1
  39. package/dist/{chunk-OC22GGQN.js → chunk-GLFBHQSQ.js} +54 -4
  40. package/dist/chunk-GLFBHQSQ.js.map +1 -0
  41. package/dist/{chunk-XZNPAD6E.js → chunk-GVCPFBAV.js} +59 -8
  42. package/dist/chunk-GVCPFBAV.js.map +1 -0
  43. package/dist/{chunk-B37IKTI7.cjs → chunk-HOI6QKC6.cjs} +97 -47
  44. package/dist/chunk-HOI6QKC6.cjs.map +1 -0
  45. package/dist/{chunk-A5D2IMOX.cjs → chunk-IAEABLIV.cjs} +47 -47
  46. package/dist/{chunk-A5D2IMOX.cjs.map → chunk-IAEABLIV.cjs.map} +1 -1
  47. package/dist/{chunk-5YYAYW67.js → chunk-IQRRZPVZ.js} +3 -3
  48. package/dist/{chunk-5YYAYW67.js.map → chunk-IQRRZPVZ.js.map} +1 -1
  49. package/dist/{chunk-VLMK7MQK.js → chunk-MNOO7STY.js} +25 -6
  50. package/dist/chunk-MNOO7STY.js.map +1 -0
  51. package/dist/{chunk-ZNOD4VZT.cjs → chunk-N56YC75X.cjs} +46 -46
  52. package/dist/{chunk-ZNOD4VZT.cjs.map → chunk-N56YC75X.cjs.map} +1 -1
  53. package/dist/{chunk-YQANC7HQ.js → chunk-PAG3BNIV.js} +3 -3
  54. package/dist/{chunk-YQANC7HQ.js.map → chunk-PAG3BNIV.js.map} +1 -1
  55. package/dist/{chunk-QSQX77S2.cjs → chunk-PG6TDGKI.cjs} +21 -21
  56. package/dist/{chunk-QSQX77S2.cjs.map → chunk-PG6TDGKI.cjs.map} +1 -1
  57. package/dist/{chunk-WYFXOXVK.cjs → chunk-Q5OFA4I2.cjs} +35 -35
  58. package/dist/{chunk-WYFXOXVK.cjs.map → chunk-Q5OFA4I2.cjs.map} +1 -1
  59. package/dist/{chunk-MJGDP3CS.cjs → chunk-QOLBWCF5.cjs} +488 -109
  60. package/dist/chunk-QOLBWCF5.cjs.map +1 -0
  61. package/dist/{chunk-MCFQAUQV.cjs → chunk-QXL7AY2H.cjs} +58 -39
  62. package/dist/chunk-QXL7AY2H.cjs.map +1 -0
  63. package/dist/chunk-SYYBKDL7.js +122 -0
  64. package/dist/chunk-SYYBKDL7.js.map +1 -0
  65. package/dist/{chunk-H2OEUBPO.js → chunk-TQU44E46.js} +441 -62
  66. package/dist/chunk-TQU44E46.js.map +1 -0
  67. package/dist/{chunk-FCGHV6ZK.js → chunk-U3KRKXF7.js} +4 -4
  68. package/dist/{chunk-FCGHV6ZK.js.map → chunk-U3KRKXF7.js.map} +1 -1
  69. package/dist/{chunk-3YZ6FPQW.cjs → chunk-UDGU73RL.cjs} +131 -131
  70. package/dist/{chunk-3YZ6FPQW.cjs.map → chunk-UDGU73RL.cjs.map} +1 -1
  71. package/dist/{chunk-U6L3FAML.js → chunk-UDJ2KN2A.js} +3 -3
  72. package/dist/{chunk-U6L3FAML.js.map → chunk-UDJ2KN2A.js.map} +1 -1
  73. package/dist/{chunk-FE6GAUNW.js → chunk-UT4TIDAA.js} +5 -5
  74. package/dist/{chunk-FE6GAUNW.js.map → chunk-UT4TIDAA.js.map} +1 -1
  75. package/dist/{chunk-SQKLKBBK.cjs → chunk-UWRTV6IV.cjs} +27 -8
  76. package/dist/chunk-UWRTV6IV.cjs.map +1 -0
  77. package/dist/{chunk-NB56L5QK.js → chunk-WTF6JXHN.js} +4 -4
  78. package/dist/{chunk-NB56L5QK.js.map → chunk-WTF6JXHN.js.map} +1 -1
  79. package/dist/{chunk-ZNDIGQJD.js → chunk-X5QJO4ZD.js} +3 -3
  80. package/dist/{chunk-ZNDIGQJD.js.map → chunk-X5QJO4ZD.js.map} +1 -1
  81. package/dist/{chunk-M5B2UUNW.js → chunk-XV2DTN6G.js} +4 -4
  82. package/dist/{chunk-M5B2UUNW.js.map → chunk-XV2DTN6G.js.map} +1 -1
  83. package/dist/{chunk-K2SOC3XF.cjs → chunk-YUPG2M3I.cjs} +71 -20
  84. package/dist/chunk-YUPG2M3I.cjs.map +1 -0
  85. package/dist/{chunk-2JDVJRR3.cjs → chunk-ZCW7YH3C.cjs} +28 -28
  86. package/dist/chunk-ZCW7YH3C.cjs.map +1 -0
  87. package/dist/{chunk-3FKS4KQK.cjs → chunk-ZFNZ2FYI.cjs} +88 -63
  88. package/dist/chunk-ZFNZ2FYI.cjs.map +1 -0
  89. package/dist/{chunk-5AEN2PLB.cjs → chunk-ZZJDGGC3.cjs} +33 -33
  90. package/dist/{chunk-5AEN2PLB.cjs.map → chunk-ZZJDGGC3.cjs.map} +1 -1
  91. package/dist/diagrams/blockdiagram/index.cjs +6 -6
  92. package/dist/diagrams/blockdiagram/index.d.cts +1 -1
  93. package/dist/diagrams/blockdiagram/index.d.ts +1 -1
  94. package/dist/diagrams/blockdiagram/index.js +2 -2
  95. package/dist/diagrams/circuit/index.cjs +8 -8
  96. package/dist/diagrams/circuit/index.d.cts +1 -1
  97. package/dist/diagrams/circuit/index.d.ts +1 -1
  98. package/dist/diagrams/circuit/index.js +2 -2
  99. package/dist/diagrams/ecomap/index.cjs +8 -8
  100. package/dist/diagrams/ecomap/index.d.cts +1 -1
  101. package/dist/diagrams/ecomap/index.d.ts +1 -1
  102. package/dist/diagrams/ecomap/index.js +3 -3
  103. package/dist/diagrams/entity/index.cjs +6 -6
  104. package/dist/diagrams/entity/index.d.cts +1 -1
  105. package/dist/diagrams/entity/index.d.ts +1 -1
  106. package/dist/diagrams/entity/index.js +2 -2
  107. package/dist/diagrams/fishbone/index.cjs +8 -8
  108. package/dist/diagrams/fishbone/index.d.cts +1 -1
  109. package/dist/diagrams/fishbone/index.d.ts +1 -1
  110. package/dist/diagrams/fishbone/index.js +2 -2
  111. package/dist/diagrams/flowchart/index.cjs +8 -8
  112. package/dist/diagrams/flowchart/index.d.cts +2 -2
  113. package/dist/diagrams/flowchart/index.d.ts +2 -2
  114. package/dist/diagrams/flowchart/index.js +2 -2
  115. package/dist/diagrams/genogram/index.cjs +10 -10
  116. package/dist/diagrams/genogram/index.d.cts +1 -1
  117. package/dist/diagrams/genogram/index.d.ts +1 -1
  118. package/dist/diagrams/genogram/index.js +3 -3
  119. package/dist/diagrams/ladder/index.cjs +6 -6
  120. package/dist/diagrams/ladder/index.d.cts +1 -1
  121. package/dist/diagrams/ladder/index.d.ts +1 -1
  122. package/dist/diagrams/ladder/index.js +2 -2
  123. package/dist/diagrams/logic/index.cjs +6 -6
  124. package/dist/diagrams/logic/index.d.cts +1 -1
  125. package/dist/diagrams/logic/index.d.ts +1 -1
  126. package/dist/diagrams/logic/index.js +2 -2
  127. package/dist/diagrams/orgchart/index.cjs +7 -7
  128. package/dist/diagrams/orgchart/index.d.cts +1 -1
  129. package/dist/diagrams/orgchart/index.d.ts +1 -1
  130. package/dist/diagrams/orgchart/index.js +2 -2
  131. package/dist/diagrams/pedigree/index.cjs +8 -8
  132. package/dist/diagrams/pedigree/index.d.cts +1 -1
  133. package/dist/diagrams/pedigree/index.d.ts +1 -1
  134. package/dist/diagrams/pedigree/index.js +3 -3
  135. package/dist/diagrams/phylo/index.cjs +7 -7
  136. package/dist/diagrams/phylo/index.d.cts +1 -1
  137. package/dist/diagrams/phylo/index.d.ts +1 -1
  138. package/dist/diagrams/phylo/index.js +2 -2
  139. package/dist/diagrams/sld/index.cjs +6 -6
  140. package/dist/diagrams/sld/index.d.cts +1 -1
  141. package/dist/diagrams/sld/index.d.ts +1 -1
  142. package/dist/diagrams/sld/index.js +2 -2
  143. package/dist/diagrams/sociogram/index.cjs +7 -7
  144. package/dist/diagrams/sociogram/index.d.cts +1 -1
  145. package/dist/diagrams/sociogram/index.d.ts +1 -1
  146. package/dist/diagrams/sociogram/index.js +3 -3
  147. package/dist/diagrams/timing/index.cjs +5 -5
  148. package/dist/diagrams/timing/index.d.cts +1 -1
  149. package/dist/diagrams/timing/index.d.ts +1 -1
  150. package/dist/diagrams/timing/index.js +2 -2
  151. package/dist/diagrams/venn/index.cjs +9 -9
  152. package/dist/diagrams/venn/index.d.cts +1 -1
  153. package/dist/diagrams/venn/index.d.ts +1 -1
  154. package/dist/diagrams/venn/index.js +2 -2
  155. package/dist/{index-CUwp4GXI.d.ts → index-D3u6vcA4.d.ts} +1 -1
  156. package/dist/{index-ivhNGsyU.d.cts → index-bdfj6FpQ.d.cts} +1 -1
  157. package/dist/index.cjs +41 -41
  158. package/dist/index.d.cts +2 -2
  159. package/dist/index.d.ts +2 -2
  160. package/dist/index.js +19 -19
  161. package/dist/react.cjs +20 -20
  162. package/dist/react.cjs.map +1 -1
  163. package/dist/react.js +19 -19
  164. package/dist/react.js.map +1 -1
  165. package/dist/{types-Bl-Pn7Wj.d.cts → types-DnU2UlWz.d.cts} +26 -3
  166. package/dist/{types-Bl-Pn7Wj.d.ts → types-DnU2UlWz.d.ts} +26 -3
  167. package/package.json +1 -1
  168. package/dist/chunk-2JDVJRR3.cjs.map +0 -1
  169. package/dist/chunk-3FKS4KQK.cjs.map +0 -1
  170. package/dist/chunk-45KP67RR.js.map +0 -1
  171. package/dist/chunk-B37IKTI7.cjs.map +0 -1
  172. package/dist/chunk-H2OEUBPO.js.map +0 -1
  173. package/dist/chunk-HDKDQAEQ.cjs.map +0 -1
  174. package/dist/chunk-K2SOC3XF.cjs.map +0 -1
  175. package/dist/chunk-KLJEK547.js +0 -71
  176. package/dist/chunk-KLJEK547.js.map +0 -1
  177. package/dist/chunk-MCFQAUQV.cjs.map +0 -1
  178. package/dist/chunk-MJGDP3CS.cjs.map +0 -1
  179. package/dist/chunk-NNU4RGT3.js.map +0 -1
  180. package/dist/chunk-OC22GGQN.js.map +0 -1
  181. package/dist/chunk-SQKLKBBK.cjs.map +0 -1
  182. package/dist/chunk-TYCHEOQX.js.map +0 -1
  183. package/dist/chunk-UGCUNADI.js.map +0 -1
  184. package/dist/chunk-VLMK7MQK.js.map +0 -1
  185. package/dist/chunk-XTATRNUN.cjs.map +0 -1
  186. package/dist/chunk-XZNPAD6E.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { resolveFlowchartTheme } from './chunk-2VNMKOUO.js';
2
- import { text, title, desc, el, defs, group, svgRoot, rect, path, polygon, circle, line } from './chunk-KLJEK547.js';
2
+ import { text, title, desc, el, defs, group, svgRoot, rect, multilineText, path, polygon, circle, line } from './chunk-SYYBKDL7.js';
3
3
 
4
4
  // src/diagrams/flowchart/parser.ts
5
5
  var FlowchartParseError = class extends Error {
@@ -15,76 +15,81 @@ var FlowchartParseError = class extends Error {
15
15
  source;
16
16
  };
17
17
  var DIRECTIONS = /* @__PURE__ */ new Set(["TB", "TD", "BT", "LR", "RL"]);
18
+ function unquoteLabel(s) {
19
+ const t = s.trim();
20
+ if (t.length >= 2 && t.startsWith('"') && t.endsWith('"')) return t.slice(1, -1);
21
+ return t;
22
+ }
18
23
  function parseShapeSuffix(line2, pos) {
19
24
  const ch = line2[pos];
20
25
  if (ch === void 0) return null;
21
26
  if (ch === ">") {
22
27
  const end = line2.indexOf("]", pos + 1);
23
28
  if (end < 0) return null;
24
- return { shape: "asymmetric", label: line2.slice(pos + 1, end).trim(), end: end + 1 };
29
+ return { shape: "asymmetric", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
25
30
  }
26
31
  if (ch === "(" && line2[pos + 1] === "(" && line2[pos + 2] === "(") {
27
32
  const end = line2.indexOf(")))", pos + 3);
28
33
  if (end < 0) return null;
29
- return { shape: "double-circle", label: line2.slice(pos + 3, end).trim(), end: end + 3 };
34
+ return { shape: "double-circle", label: unquoteLabel(line2.slice(pos + 3, end)), end: end + 3 };
30
35
  }
31
36
  if (ch === "(" && line2[pos + 1] === "[") {
32
37
  const end = line2.indexOf("])", pos + 2);
33
38
  if (end < 0) return null;
34
- return { shape: "stadium", label: line2.slice(pos + 2, end).trim(), end: end + 2 };
39
+ return { shape: "stadium", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
35
40
  }
36
41
  if (ch === "(" && line2[pos + 1] === "(") {
37
42
  const end = line2.indexOf("))", pos + 2);
38
43
  if (end < 0) return null;
39
- return { shape: "circle", label: line2.slice(pos + 2, end).trim(), end: end + 2 };
44
+ return { shape: "circle", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
40
45
  }
41
46
  if (ch === "[" && line2[pos + 1] === "[") {
42
47
  const end = line2.indexOf("]]", pos + 2);
43
48
  if (end < 0) return null;
44
- return { shape: "subroutine", label: line2.slice(pos + 2, end).trim(), end: end + 2 };
49
+ return { shape: "subroutine", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
45
50
  }
46
51
  if (ch === "[" && line2[pos + 1] === "(") {
47
52
  const end = line2.indexOf(")]", pos + 2);
48
53
  if (end < 0) return null;
49
- return { shape: "cylinder", label: line2.slice(pos + 2, end).trim(), end: end + 2 };
54
+ return { shape: "cylinder", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
50
55
  }
51
56
  if (ch === "{" && line2[pos + 1] === "{") {
52
57
  const end = line2.indexOf("}}", pos + 2);
53
58
  if (end < 0) return null;
54
- return { shape: "hexagon", label: line2.slice(pos + 2, end).trim(), end: end + 2 };
59
+ return { shape: "hexagon", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
55
60
  }
56
61
  if (ch === "[" && line2[pos + 1] === "/") {
57
62
  const endSlash = line2.indexOf("\\]", pos + 2);
58
63
  if (endSlash >= 0) {
59
- return { shape: "trapezoid", label: line2.slice(pos + 2, endSlash).trim(), end: endSlash + 2 };
64
+ return { shape: "trapezoid", label: unquoteLabel(line2.slice(pos + 2, endSlash)), end: endSlash + 2 };
60
65
  }
61
66
  const end = line2.indexOf("/]", pos + 2);
62
67
  if (end < 0) return null;
63
- return { shape: "parallelogram", label: line2.slice(pos + 2, end).trim(), end: end + 2 };
68
+ return { shape: "parallelogram", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
64
69
  }
65
70
  if (ch === "[" && line2[pos + 1] === "\\") {
66
71
  const endFwd = line2.indexOf("/]", pos + 2);
67
72
  if (endFwd >= 0) {
68
- return { shape: "trapezoid-alt", label: line2.slice(pos + 2, endFwd).trim(), end: endFwd + 2 };
73
+ return { shape: "trapezoid-alt", label: unquoteLabel(line2.slice(pos + 2, endFwd)), end: endFwd + 2 };
69
74
  }
70
75
  const end = line2.indexOf("\\]", pos + 2);
71
76
  if (end < 0) return null;
72
- return { shape: "parallelogram-alt", label: line2.slice(pos + 2, end).trim(), end: end + 2 };
77
+ return { shape: "parallelogram-alt", label: unquoteLabel(line2.slice(pos + 2, end)), end: end + 2 };
73
78
  }
74
79
  if (ch === "[") {
75
80
  const end = line2.indexOf("]", pos + 1);
76
81
  if (end < 0) return null;
77
- return { shape: "rect", label: line2.slice(pos + 1, end).trim(), end: end + 1 };
82
+ return { shape: "rect", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
78
83
  }
79
84
  if (ch === "(") {
80
85
  const end = line2.indexOf(")", pos + 1);
81
86
  if (end < 0) return null;
82
- return { shape: "round", label: line2.slice(pos + 1, end).trim(), end: end + 1 };
87
+ return { shape: "round", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
83
88
  }
84
89
  if (ch === "{") {
85
90
  const end = line2.indexOf("}", pos + 1);
86
91
  if (end < 0) return null;
87
- return { shape: "diamond", label: line2.slice(pos + 1, end).trim(), end: end + 1 };
92
+ return { shape: "diamond", label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
88
93
  }
89
94
  return null;
90
95
  }
@@ -168,7 +173,7 @@ function parsePipeLabel(line2, pos) {
168
173
  if (line2[pos] !== "|") return null;
169
174
  const end = line2.indexOf("|", pos + 1);
170
175
  if (end < 0) return null;
171
- return { label: line2.slice(pos + 1, end).trim(), end: end + 1 };
176
+ return { label: unquoteLabel(line2.slice(pos + 1, end)), end: end + 1 };
172
177
  }
173
178
  function skipSpaces(line2, pos) {
174
179
  while (pos < line2.length && (line2[pos] === " " || line2[pos] === " ")) pos++;
@@ -397,7 +402,18 @@ function parseFlowchart(source) {
397
402
  }
398
403
  continue;
399
404
  }
400
- if (/^linkStyle\s/.test(trimmed)) continue;
405
+ const linkStyleMatch = /^linkStyle\s+([\d,\s]+|default)\s+(.+)$/.exec(trimmed);
406
+ if (linkStyleMatch) {
407
+ const sel = linkStyleMatch[1].trim();
408
+ const props = parseCssProps(linkStyleMatch[2]);
409
+ if (sel !== "default") {
410
+ const indices = sel.split(/[,\s]+/).map((s) => s.trim()).filter((s) => s.length > 0).map((s) => parseInt(s, 10)).filter((n) => !isNaN(n));
411
+ for (const idx of indices) {
412
+ ast.linkStyles.set(idx, { ...ast.linkStyles.get(idx) ?? {}, ...props });
413
+ }
414
+ }
415
+ continue;
416
+ }
401
417
  let parsed;
402
418
  try {
403
419
  parsed = parseChainStatement(trimmed, i + 1);
@@ -1567,6 +1583,8 @@ function layoutFlowchart(ast) {
1567
1583
  if (flipX) c.x = outWidth - c.x;
1568
1584
  }
1569
1585
  }
1586
+ const edgeIndex = /* @__PURE__ */ new Map();
1587
+ ast.edges.forEach((e, i) => edgeIndex.set(e, i));
1570
1588
  const outEdges = updatedEdges.map((le) => {
1571
1589
  const chain = le.chain.length > 0 ? le.chain : [le.from, le.to];
1572
1590
  const points = [];
@@ -1581,7 +1599,7 @@ function layoutFlowchart(ast) {
1581
1599
  }
1582
1600
  }
1583
1601
  if (points.length < 2) {
1584
- return { edge: le.original, path: "" };
1602
+ return { edge: le.original, path: "", index: edgeIndex.get(le.original) };
1585
1603
  }
1586
1604
  const startNode = nodeCenter.get(chain[0]);
1587
1605
  const endNode = nodeCenter.get(chain[chain.length - 1]);
@@ -1606,7 +1624,8 @@ function layoutFlowchart(ast) {
1606
1624
  isReversed: le.isReversed
1607
1625
  },
1608
1626
  path: d,
1609
- labelAnchor
1627
+ labelAnchor,
1628
+ index: edgeIndex.get(le.original)
1610
1629
  };
1611
1630
  });
1612
1631
  function collectDescendantNodeIds(sgId) {
@@ -1874,7 +1893,7 @@ function renderCluster(lc) {
1874
1893
  function renderNode(ln) {
1875
1894
  const n = ln.node;
1876
1895
  const shapeEl = shapeSVG(n.shape, ln.width, ln.height);
1877
- const label = text(
1896
+ const label = multilineText(
1878
1897
  {
1879
1898
  x: ln.width / 2,
1880
1899
  y: ln.height / 2,
@@ -1884,7 +1903,8 @@ function renderNode(ln) {
1884
1903
  },
1885
1904
  n.label
1886
1905
  );
1887
- const nodeTitle = title(n.label);
1906
+ const plainLabel = n.label.replace(/<br\s*\/?>/gi, " ").replace(/<\/?[bi]>/gi, "");
1907
+ const nodeTitle = title(plainLabel);
1888
1908
  const classAttr = ["sx-fc-node-g", ...(n.classes ?? []).map((c) => `sx-fc-class-${c}`)].join(" ");
1889
1909
  return group(
1890
1910
  {
@@ -1921,6 +1941,7 @@ function renderEdge(le) {
1921
1941
  return group(
1922
1942
  {
1923
1943
  "data-edge-id": e.id ?? `${e.from}->${e.to}`,
1944
+ "data-edge-index": le.index,
1924
1945
  "data-kind": e.kind,
1925
1946
  "data-from": e.from,
1926
1947
  "data-to": e.to
@@ -1969,6 +1990,10 @@ function renderFlowchartAST(ast, themeName = "default") {
1969
1990
  const props = Object.entries(cd.props).map(([k, v]) => `${k}:${v}`).join(";");
1970
1991
  return `.sx-fc-class-${cd.id} > .sx-fc-node { ${props} }`;
1971
1992
  }).join("\n");
1993
+ const linkStyleOverrides = Array.from(ast.linkStyles.entries()).map(([idx, props]) => {
1994
+ const cssProps = Object.entries(props).map(([k, v]) => `${k}:${v}`).join(";");
1995
+ return `g[data-edge-index="${idx}"] path { ${cssProps} }`;
1996
+ }).join("\n");
1972
1997
  const titleBlock = ast.title ? text(
1973
1998
  {
1974
1999
  x: layout.width / 2,
@@ -1978,7 +2003,7 @@ function renderFlowchartAST(ast, themeName = "default") {
1978
2003
  },
1979
2004
  ast.title
1980
2005
  ) : "";
1981
- const cssOverrides = [nodeStyleOverrides, classDefOverrides].filter((s) => s.length > 0).join("\n");
2006
+ const cssOverrides = [nodeStyleOverrides, classDefOverrides, linkStyleOverrides].filter((s) => s.length > 0).join("\n");
1982
2007
  const headMeta = [
1983
2008
  title(ast.title ? `${ast.title} \u2014 Flowchart` : "Flowchart"),
1984
2009
  desc(
@@ -2038,5 +2063,5 @@ var flowchart = {
2038
2063
  };
2039
2064
 
2040
2065
  export { FC_CONST, flowchart, layoutFlowchart, parseFlowchart, renderFlowchart, renderFlowchartAST };
2041
- //# sourceMappingURL=chunk-TYCHEOQX.js.map
2042
- //# sourceMappingURL=chunk-TYCHEOQX.js.map
2066
+ //# sourceMappingURL=chunk-FIVUMDLF.js.map
2067
+ //# sourceMappingURL=chunk-FIVUMDLF.js.map