schematex 0.2.5 → 0.3.2

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 (194) hide show
  1. package/README.md +4 -3
  2. package/dist/ai/ai-sdk.cjs +25 -25
  3. package/dist/ai/ai-sdk.d.cts +2 -2
  4. package/dist/ai/ai-sdk.d.ts +2 -2
  5. package/dist/ai/ai-sdk.js +20 -20
  6. package/dist/ai/index.cjs +28 -28
  7. package/dist/ai/index.d.cts +3 -3
  8. package/dist/ai/index.d.ts +3 -3
  9. package/dist/ai/index.js +20 -20
  10. package/dist/{api-bQZ98gkJ.d.cts → api-BuFilDQB.d.cts} +1 -1
  11. package/dist/{api-bQZ98gkJ.d.ts → api-BuFilDQB.d.ts} +1 -1
  12. package/dist/browser.cjs +22 -22
  13. package/dist/browser.d.cts +2 -2
  14. package/dist/browser.d.ts +2 -2
  15. package/dist/browser.js +20 -20
  16. package/dist/{chunk-J2LVOWVY.js → chunk-2J2QWNGI.js} +46 -24
  17. package/dist/chunk-2J2QWNGI.js.map +1 -0
  18. package/dist/{chunk-MCFQAUQV.cjs → chunk-2UJAVPA4.cjs} +58 -39
  19. package/dist/chunk-2UJAVPA4.cjs.map +1 -0
  20. package/dist/{chunk-5AEN2PLB.cjs → chunk-3YXXZ4LT.cjs} +33 -33
  21. package/dist/{chunk-5AEN2PLB.cjs.map → chunk-3YXXZ4LT.cjs.map} +1 -1
  22. package/dist/{chunk-RP5UATRA.js → chunk-56LXBM45.js} +4 -4
  23. package/dist/{chunk-RP5UATRA.js.map → chunk-56LXBM45.js.map} +1 -1
  24. package/dist/{chunk-OC22GGQN.js → chunk-6BKUD5EJ.js} +54 -4
  25. package/dist/chunk-6BKUD5EJ.js.map +1 -0
  26. package/dist/{chunk-ULYRO2KY.cjs → chunk-75BMFCP5.cjs} +44 -44
  27. package/dist/{chunk-ULYRO2KY.cjs.map → chunk-75BMFCP5.cjs.map} +1 -1
  28. package/dist/{chunk-ZNDIGQJD.js → chunk-7BEJHG43.js} +3 -3
  29. package/dist/{chunk-ZNDIGQJD.js.map → chunk-7BEJHG43.js.map} +1 -1
  30. package/dist/{chunk-WYFXOXVK.cjs → chunk-7MVDN5UC.cjs} +35 -35
  31. package/dist/{chunk-WYFXOXVK.cjs.map → chunk-7MVDN5UC.cjs.map} +1 -1
  32. package/dist/{chunk-JDTB7IKL.js → chunk-BJ65PKDU.js} +3 -3
  33. package/dist/{chunk-JDTB7IKL.js.map → chunk-BJ65PKDU.js.map} +1 -1
  34. package/dist/{chunk-FE6GAUNW.js → chunk-BJWMPPEA.js} +5 -5
  35. package/dist/{chunk-FE6GAUNW.js.map → chunk-BJWMPPEA.js.map} +1 -1
  36. package/dist/{chunk-MJGDP3CS.cjs → chunk-BUN3CRMP.cjs} +488 -109
  37. package/dist/chunk-BUN3CRMP.cjs.map +1 -0
  38. package/dist/{chunk-COLTVQWR.cjs → chunk-C3IVD7DI.cjs} +25 -25
  39. package/dist/{chunk-COLTVQWR.cjs.map → chunk-C3IVD7DI.cjs.map} +1 -1
  40. package/dist/{chunk-3YZ6FPQW.cjs → chunk-EYHD7LV3.cjs} +131 -131
  41. package/dist/{chunk-3YZ6FPQW.cjs.map → chunk-EYHD7LV3.cjs.map} +1 -1
  42. package/dist/{chunk-UGCUNADI.js → chunk-F6OROIHS.js} +35 -16
  43. package/dist/chunk-F6OROIHS.js.map +1 -0
  44. package/dist/{chunk-UAGSCTYI.cjs → chunk-GYTWJ6VB.cjs} +85 -63
  45. package/dist/chunk-GYTWJ6VB.cjs.map +1 -0
  46. package/dist/{chunk-MR5HU5WU.js → chunk-H4CJTKEH.js} +50 -4
  47. package/dist/chunk-H4CJTKEH.js.map +1 -0
  48. package/dist/{chunk-45KP67RR.js → chunk-HIQPEAL7.js} +5 -5
  49. package/dist/chunk-HIQPEAL7.js.map +1 -0
  50. package/dist/{chunk-LR4X4ZRG.js → chunk-IT2TVXC7.js} +20 -16
  51. package/dist/chunk-IT2TVXC7.js.map +1 -0
  52. package/dist/{chunk-2JDVJRR3.cjs → chunk-K5QG53GT.cjs} +28 -28
  53. package/dist/chunk-K5QG53GT.cjs.map +1 -0
  54. package/dist/{chunk-B37IKTI7.cjs → chunk-KUXOHLGC.cjs} +97 -47
  55. package/dist/chunk-KUXOHLGC.cjs.map +1 -0
  56. package/dist/{chunk-A5D2IMOX.cjs → chunk-L2KUGWFR.cjs} +47 -47
  57. package/dist/{chunk-A5D2IMOX.cjs.map → chunk-L2KUGWFR.cjs.map} +1 -1
  58. package/dist/{chunk-HDKDQAEQ.cjs → chunk-LFZZ4NCP.cjs} +14 -2
  59. package/dist/chunk-LFZZ4NCP.cjs.map +1 -0
  60. package/dist/{chunk-U6L3FAML.js → chunk-M3R6RCXY.js} +3 -3
  61. package/dist/{chunk-U6L3FAML.js.map → chunk-M3R6RCXY.js.map} +1 -1
  62. package/dist/{chunk-5YYAYW67.js → chunk-M5ZC3LFJ.js} +3 -3
  63. package/dist/{chunk-5YYAYW67.js.map → chunk-M5ZC3LFJ.js.map} +1 -1
  64. package/dist/{chunk-B6INLQBU.cjs → chunk-MKKFIPKU.cjs} +46 -46
  65. package/dist/{chunk-B6INLQBU.cjs.map → chunk-MKKFIPKU.cjs.map} +1 -1
  66. package/dist/{chunk-M5B2UUNW.js → chunk-NFT6VW73.js} +4 -4
  67. package/dist/{chunk-M5B2UUNW.js.map → chunk-NFT6VW73.js.map} +1 -1
  68. package/dist/{chunk-X7RPFTTR.cjs → chunk-OK5RYX55.cjs} +26 -26
  69. package/dist/{chunk-X7RPFTTR.cjs.map → chunk-OK5RYX55.cjs.map} +1 -1
  70. package/dist/{chunk-VPKCW4PB.js → chunk-RNGYXGHS.js} +2854 -42
  71. package/dist/chunk-RNGYXGHS.js.map +1 -0
  72. package/dist/{chunk-DPQYGWCT.cjs → chunk-RODV6PC4.cjs} +52 -6
  73. package/dist/chunk-RODV6PC4.cjs.map +1 -0
  74. package/dist/{chunk-H2OEUBPO.js → chunk-SE23X5OE.js} +441 -62
  75. package/dist/chunk-SE23X5OE.js.map +1 -0
  76. package/dist/{chunk-FCGHV6ZK.js → chunk-SFSZUOFT.js} +4 -4
  77. package/dist/{chunk-FCGHV6ZK.js.map → chunk-SFSZUOFT.js.map} +1 -1
  78. package/dist/{chunk-E65ITQXV.cjs → chunk-UK7JF5QB.cjs} +52 -48
  79. package/dist/chunk-UK7JF5QB.cjs.map +1 -0
  80. package/dist/{chunk-QSQX77S2.cjs → chunk-W7GIQTJV.cjs} +21 -21
  81. package/dist/{chunk-QSQX77S2.cjs.map → chunk-W7GIQTJV.cjs.map} +1 -1
  82. package/dist/{chunk-KLJEK547.js → chunk-WHJXRLFD.js} +14 -3
  83. package/dist/chunk-WHJXRLFD.js.map +1 -0
  84. package/dist/{chunk-YQANC7HQ.js → chunk-X4F6VVEJ.js} +3 -3
  85. package/dist/{chunk-YQANC7HQ.js.map → chunk-X4F6VVEJ.js.map} +1 -1
  86. package/dist/{chunk-ZNOD4VZT.cjs → chunk-XI6JOG76.cjs} +46 -46
  87. package/dist/{chunk-ZNOD4VZT.cjs.map → chunk-XI6JOG76.cjs.map} +1 -1
  88. package/dist/{chunk-4S2WILLW.cjs → chunk-XUEROLSB.cjs} +72 -19
  89. package/dist/chunk-XUEROLSB.cjs.map +1 -0
  90. package/dist/{chunk-MSYBSOU2.cjs → chunk-YTEEZV6J.cjs} +3055 -241
  91. package/dist/chunk-YTEEZV6J.cjs.map +1 -0
  92. package/dist/{chunk-PGALHQFF.js → chunk-ZNLEUL7T.js} +60 -7
  93. package/dist/chunk-ZNLEUL7T.js.map +1 -0
  94. package/dist/{chunk-DNZFOCV7.js → chunk-ZTSO3S4P.js} +3 -3
  95. package/dist/{chunk-DNZFOCV7.js.map → chunk-ZTSO3S4P.js.map} +1 -1
  96. package/dist/diagrams/blockdiagram/index.cjs +6 -6
  97. package/dist/diagrams/blockdiagram/index.d.cts +1 -1
  98. package/dist/diagrams/blockdiagram/index.d.ts +1 -1
  99. package/dist/diagrams/blockdiagram/index.js +2 -2
  100. package/dist/diagrams/circuit/index.cjs +8 -8
  101. package/dist/diagrams/circuit/index.d.cts +1 -1
  102. package/dist/diagrams/circuit/index.d.ts +1 -1
  103. package/dist/diagrams/circuit/index.js +2 -2
  104. package/dist/diagrams/ecomap/index.cjs +8 -8
  105. package/dist/diagrams/ecomap/index.d.cts +1 -1
  106. package/dist/diagrams/ecomap/index.d.ts +1 -1
  107. package/dist/diagrams/ecomap/index.js +3 -3
  108. package/dist/diagrams/entity/index.cjs +6 -6
  109. package/dist/diagrams/entity/index.d.cts +1 -1
  110. package/dist/diagrams/entity/index.d.ts +1 -1
  111. package/dist/diagrams/entity/index.js +2 -2
  112. package/dist/diagrams/fishbone/index.cjs +8 -8
  113. package/dist/diagrams/fishbone/index.d.cts +1 -1
  114. package/dist/diagrams/fishbone/index.d.ts +1 -1
  115. package/dist/diagrams/fishbone/index.js +2 -2
  116. package/dist/diagrams/flowchart/index.cjs +8 -8
  117. package/dist/diagrams/flowchart/index.d.cts +2 -2
  118. package/dist/diagrams/flowchart/index.d.ts +2 -2
  119. package/dist/diagrams/flowchart/index.js +2 -2
  120. package/dist/diagrams/genogram/index.cjs +10 -10
  121. package/dist/diagrams/genogram/index.d.cts +1 -1
  122. package/dist/diagrams/genogram/index.d.ts +1 -1
  123. package/dist/diagrams/genogram/index.js +3 -3
  124. package/dist/diagrams/ladder/index.cjs +6 -6
  125. package/dist/diagrams/ladder/index.d.cts +1 -1
  126. package/dist/diagrams/ladder/index.d.ts +1 -1
  127. package/dist/diagrams/ladder/index.js +2 -2
  128. package/dist/diagrams/logic/index.cjs +6 -6
  129. package/dist/diagrams/logic/index.d.cts +1 -1
  130. package/dist/diagrams/logic/index.d.ts +1 -1
  131. package/dist/diagrams/logic/index.js +2 -2
  132. package/dist/diagrams/orgchart/index.cjs +7 -7
  133. package/dist/diagrams/orgchart/index.d.cts +1 -1
  134. package/dist/diagrams/orgchart/index.d.ts +1 -1
  135. package/dist/diagrams/orgchart/index.js +2 -2
  136. package/dist/diagrams/pedigree/index.cjs +8 -8
  137. package/dist/diagrams/pedigree/index.d.cts +1 -1
  138. package/dist/diagrams/pedigree/index.d.ts +1 -1
  139. package/dist/diagrams/pedigree/index.js +3 -3
  140. package/dist/diagrams/phylo/index.cjs +7 -7
  141. package/dist/diagrams/phylo/index.d.cts +1 -1
  142. package/dist/diagrams/phylo/index.d.ts +1 -1
  143. package/dist/diagrams/phylo/index.js +2 -2
  144. package/dist/diagrams/sld/index.cjs +6 -6
  145. package/dist/diagrams/sld/index.d.cts +1 -1
  146. package/dist/diagrams/sld/index.d.ts +1 -1
  147. package/dist/diagrams/sld/index.js +2 -2
  148. package/dist/diagrams/sociogram/index.cjs +7 -7
  149. package/dist/diagrams/sociogram/index.d.cts +1 -1
  150. package/dist/diagrams/sociogram/index.d.ts +1 -1
  151. package/dist/diagrams/sociogram/index.js +3 -3
  152. package/dist/diagrams/timing/index.cjs +5 -5
  153. package/dist/diagrams/timing/index.d.cts +1 -1
  154. package/dist/diagrams/timing/index.d.ts +1 -1
  155. package/dist/diagrams/timing/index.js +2 -2
  156. package/dist/diagrams/venn/index.cjs +9 -9
  157. package/dist/diagrams/venn/index.d.cts +1 -1
  158. package/dist/diagrams/venn/index.d.ts +1 -1
  159. package/dist/diagrams/venn/index.js +2 -2
  160. package/dist/{index-BTZEka65.d.cts → index-BrLxEzSQ.d.cts} +1 -1
  161. package/dist/{index-DcU88F9i.d.ts → index-dWDwG6BW.d.ts} +1 -1
  162. package/dist/index.cjs +47 -39
  163. package/dist/index.d.cts +8 -4
  164. package/dist/index.d.ts +8 -4
  165. package/dist/index.js +19 -19
  166. package/dist/react.cjs +20 -20
  167. package/dist/react.cjs.map +1 -1
  168. package/dist/react.d.cts +1 -1
  169. package/dist/react.d.ts +1 -1
  170. package/dist/react.js +19 -19
  171. package/dist/react.js.map +1 -1
  172. package/dist/{types-C4LnMEcB.d.cts → types-BtiUg7Gx.d.cts} +25 -4
  173. package/dist/{types-C4LnMEcB.d.ts → types-BtiUg7Gx.d.ts} +25 -4
  174. package/package.json +2 -2
  175. package/dist/chunk-2JDVJRR3.cjs.map +0 -1
  176. package/dist/chunk-45KP67RR.js.map +0 -1
  177. package/dist/chunk-4S2WILLW.cjs.map +0 -1
  178. package/dist/chunk-B37IKTI7.cjs.map +0 -1
  179. package/dist/chunk-DPQYGWCT.cjs.map +0 -1
  180. package/dist/chunk-E65ITQXV.cjs.map +0 -1
  181. package/dist/chunk-H2OEUBPO.js.map +0 -1
  182. package/dist/chunk-HDKDQAEQ.cjs.map +0 -1
  183. package/dist/chunk-J2LVOWVY.js.map +0 -1
  184. package/dist/chunk-KLJEK547.js.map +0 -1
  185. package/dist/chunk-LR4X4ZRG.js.map +0 -1
  186. package/dist/chunk-MCFQAUQV.cjs.map +0 -1
  187. package/dist/chunk-MJGDP3CS.cjs.map +0 -1
  188. package/dist/chunk-MR5HU5WU.js.map +0 -1
  189. package/dist/chunk-MSYBSOU2.cjs.map +0 -1
  190. package/dist/chunk-OC22GGQN.js.map +0 -1
  191. package/dist/chunk-PGALHQFF.js.map +0 -1
  192. package/dist/chunk-UAGSCTYI.cjs.map +0 -1
  193. package/dist/chunk-UGCUNADI.js.map +0 -1
  194. package/dist/chunk-VPKCW4PB.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-WHJXRLFD.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++;
@@ -1415,8 +1420,8 @@ function layoutFlowchart(ast) {
1415
1420
  const hasClusters = ast.subgraphs.length > 0;
1416
1421
  const CLUSTER_OVERHEAD_TITLE = hasClusters ? CLUSTER_GEO.pad + CLUSTER_GEO.titleH : 0;
1417
1422
  const CLUSTER_OVERHEAD_SIDE = hasClusters ? CLUSTER_GEO.pad : 0;
1418
- const extraTopPad = isHorizontal ? CLUSTER_OVERHEAD_SIDE : CLUSTER_OVERHEAD_TITLE;
1419
- const extraLeftPad = isHorizontal ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
1423
+ const extraTopPad = !isHorizontal && dir !== "BT" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
1424
+ const extraLeftPad = isHorizontal && dir !== "RL" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
1420
1425
  const topLevelOf = (sgId) => {
1421
1426
  let cur = sgId;
1422
1427
  let safety = 32;
@@ -1507,8 +1512,8 @@ function layoutFlowchart(ast) {
1507
1512
  });
1508
1513
  }
1509
1514
  }
1510
- const extraRightPad = isHorizontal ? CLUSTER_OVERHEAD_SIDE : CLUSTER_OVERHEAD_SIDE;
1511
- const extraBottomPad = isHorizontal ? CLUSTER_OVERHEAD_SIDE : CLUSTER_OVERHEAD_SIDE;
1515
+ const extraRightPad = isHorizontal && dir === "RL" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
1516
+ const extraBottomPad = !isHorizontal && dir === "BT" ? CLUSTER_OVERHEAD_TITLE : CLUSTER_OVERHEAD_SIDE;
1512
1517
  const canvasW = maxX - minX + 2 * padding + extraLeftPad + extraRightPad;
1513
1518
  const lastLayer = layerCenterY.length - 1;
1514
1519
  const canvasH = lastLayer >= 0 ? layerCenterY[lastLayer] + layerHeights[lastLayer] / 2 + padding + extraBottomPad : 2 * padding;
@@ -1551,6 +1556,22 @@ function layoutFlowchart(ast) {
1551
1556
  if (!isHorizontal) dummyCenter.set(id, p);
1552
1557
  else dummyCenter.set(id, { x: p.y, y: p.x });
1553
1558
  }
1559
+ if (dir === "BT" || dir === "RL") {
1560
+ const flipY = dir === "BT";
1561
+ const flipX = dir === "RL";
1562
+ for (const n of outNodes) {
1563
+ if (flipY) n.y = outHeight - n.y - n.height;
1564
+ if (flipX) n.x = outWidth - n.x - n.width;
1565
+ }
1566
+ for (const c of nodeCenter.values()) {
1567
+ if (flipY) c.y = outHeight - c.y;
1568
+ if (flipX) c.x = outWidth - c.x;
1569
+ }
1570
+ for (const c of dummyCenter.values()) {
1571
+ if (flipY) c.y = outHeight - c.y;
1572
+ if (flipX) c.x = outWidth - c.x;
1573
+ }
1574
+ }
1554
1575
  const outEdges = updatedEdges.map((le) => {
1555
1576
  const chain = le.chain.length > 0 ? le.chain : [le.from, le.to];
1556
1577
  const points = [];
@@ -1858,7 +1879,7 @@ function renderCluster(lc) {
1858
1879
  function renderNode(ln) {
1859
1880
  const n = ln.node;
1860
1881
  const shapeEl = shapeSVG(n.shape, ln.width, ln.height);
1861
- const label = text(
1882
+ const label = multilineText(
1862
1883
  {
1863
1884
  x: ln.width / 2,
1864
1885
  y: ln.height / 2,
@@ -1868,7 +1889,8 @@ function renderNode(ln) {
1868
1889
  },
1869
1890
  n.label
1870
1891
  );
1871
- const nodeTitle = title(n.label);
1892
+ const plainLabel = n.label.replace(/<br\s*\/?>/gi, " ").replace(/<\/?[bi]>/gi, "");
1893
+ const nodeTitle = title(plainLabel);
1872
1894
  const classAttr = ["sx-fc-node-g", ...(n.classes ?? []).map((c) => `sx-fc-class-${c}`)].join(" ");
1873
1895
  return group(
1874
1896
  {
@@ -2022,5 +2044,5 @@ var flowchart = {
2022
2044
  };
2023
2045
 
2024
2046
  export { FC_CONST, flowchart, layoutFlowchart, parseFlowchart, renderFlowchart, renderFlowchartAST };
2025
- //# sourceMappingURL=chunk-J2LVOWVY.js.map
2026
- //# sourceMappingURL=chunk-J2LVOWVY.js.map
2047
+ //# sourceMappingURL=chunk-2J2QWNGI.js.map
2048
+ //# sourceMappingURL=chunk-2J2QWNGI.js.map